khoj/src/interface/desktop
sabaimran 44f8f20ea7
Miscellaneous bugs and fixes for chat sessions (#646)
* Display given_name field only if it is not None

* Add default slugs in the migration script

* Ensure that updated_at is saved appropriately, make sure most recent chat is returned for default history

* Remove the bin button from the chat interface, given deletion is handled in the drop-down menus

* Refresh the side panel when a new chat is created

* Improveme tool retrieval prompt, don't let /online fail, and improve parsing of extract questions

* Fix ending chat response by offline chat on hitting a stop phrase

Previously the whole phrase wouldn't be in the same response chunk, so
chat response wouldn't stop on hitting a stop phrase

Now use a queue to keep track of last 3 chunks, and to stop responding
when hit a stop phrase

* Make chat on Obsidian backward compatible post chat session API updates

- Make chat on Obsidian get chat history from
  `responseJson.response.chat' when available (i.e when using new api)
- Else fallback to loading chat history from
  responseJson.response (i.e when using old api)

* Fix detecting success of indexing update in khoj.el

When khoj.el attempts to index on a Khoj server served behind an https
endpoint, the success reponse status contains plist with certs. This
doesn't mean the update failed.

Look for :errors key in status instead to determine if indexing API
call failed. This fixes detecting indexing API call success on the
Khoj Emacs client, even for Khoj servers running behind SSL/HTTPS

* Fix the mechanism for populating notes references in the conversation primer for both offline and online chat

* Return conversation.default when empty list for dynamic prompt selection, send all cmds in telemetry

* Fix making chat on Obsidian backward compatible post chat session API updates

New API always has conversation_id set, not `chat' which can be unset
when chat session is empty.

So use conversation_id to decide whether to get chat logs from
`responseJson.response.chat' or `responseJson.response' instead

---------

Co-authored-by: Debanjum Singh Solanky <debanjum@gmail.com>
2024-02-20 13:55:35 -08:00
..
assets Miscellaneous bugs and fixes for chat sessions (#646) 2024-02-20 13:55:35 -08:00
about.html Update the font used across Khoj desktop and web to be Tajawal (#622) 2024-01-20 23:13:33 +05:30
chat.html Miscellaneous bugs and fixes for chat sessions (#646) 2024-02-20 13:55:35 -08:00
config.html Update the font used across Khoj desktop and web to be Tajawal (#622) 2024-01-20 23:13:33 +05:30
loading-animation.js Replace var declarations with let declarations (#576) 2023-12-29 10:20:48 +05:30
main.js Miscellaneous bugs and fixes for chat sessions (#646) 2024-02-20 13:55:35 -08:00
package.json Add support for multiple chat sessions in the desktop application (#639) 2024-02-11 16:05:28 +05:30
preload.js Indicate in the desktop if the user gets rate limited for indexing 2023-11-25 22:31:23 -08:00
README.md Add front-end Electron application for Khoj local file syncing (#473) 2023-09-06 12:04:18 -07:00
renderer.js Show relevant error msg in desktop app, e.g when can't connect to server 2024-01-09 23:09:34 +05:30
search.html Update the font used across Khoj desktop and web to be Tajawal (#622) 2024-01-20 23:13:33 +05:30
splash.html Show splash screen on starting desktop app 2023-11-03 03:19:08 -07:00
todesktop.json Add front-end Electron application for Khoj local file syncing (#473) 2023-09-06 12:04:18 -07:00
utils.js Add About page for Khoj to Desktop app. Expose it via system tray 2023-11-03 23:59:21 -07:00
yarn.lock Add support for multiple chat sessions in the desktop application (#639) 2024-02-11 16:05:28 +05:30

Run it locally

Prerequisites

Install the runtime dependencies. This command should install all dev dependencies.

yarn add

Run the application

yarn start

Deploying the Electron App

Prerequisites

Install the ToDesktop CLI. Full documentation can be found here: https://www.npmjs.com/package/@todesktop/cli

yarn global add @todesktop/cli

Configure the todesktop.json file. Fill in the id based on the application ID.

Build

This will prompt you to login. It triggers builds for all platforms.

todesktop build

If you get an error saying the command is not found, make sure that your yarn global bin directory is in your PATH environment variable. You can find the location of the global bin directory by running yarn global bin. Add this line to your .bashrc or .zshrc file: export PATH="$PATH:$(yarn global bin)".