* chore: upgrade marked-katex-extension (#3049) * fix: handle long word without space to avoid right panel disappears (#3048) * add time weighted retrieval (#2908) * add time weighted retrieval * add missing configuration for timeWeightedVectorStore * resolving conflict * add missing configuration for timeWeightedVectorStore * resolving conflict * fix linting issues * fix build failed due to requirement for useTimeWeightedRetriever in AssistantTool * update web packages complying the new structure --------- Co-authored-by: thu <thu@treehouse.finance> * fix: model dropdown search by configured model (#3047) * bump version (#3082) (#3083) Co-authored-by: Hoang Ha <64120343+hahuyhoang411@users.noreply.github.com> * Update cortex cpp nightly to version 0.4.18 (#3072) * Update cortex cpp nightly to version 0.4.17 * update linux downloadnitro * cortex 0.4.18 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Van Pham <64197333+Van-QA@users.noreply.github.com> * chore: update download.ts (#3088) infomation -> information * chore: cortex version update (#3098) * fix: handle words without space (#3101) * fix: handle long thread title without space (#3107) * fix: handle long thread title without space, and make searchbar autofocus inside model dropdown * feat: enable right click to show setting on thread items (#3108) * chore: Bump-cortex-0.4.17 (#3111) * Update cortex cpp nightly to version 0.4.18 (#3114) * Update cortex cpp nightly to version 0.4.18 * cortex 0.4.19 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Van Pham <64197333+Van-QA@users.noreply.github.com> * Chore: Add stop token for Gemma 2b (#3125) * add stop token * Bump version * fix: set specific version for terminate (#3126) Signed-off-by: James <namnh0122@gmail.com> * feat: add claude 3.5 sonnet (#3129) Signed-off-by: James <namnh0122@gmail.com> * feat: add options config spell check for chat input (#3131) * fixed grammar nits (#3132) * Update cortex cpp nightly to version 0.4.20 * fix: toggle button for expand log section on modal troubleshoot (#3130) * fix: add tooltip messages toolbar (#3138) * fix: handle error message when apikey is not setup (#3149) * fix: title thread not updated on input edit title (#3148) * merge dev * fix move jan folder * Update electron/preload.ts * refactor * Update electron/preload.ts * fix wrong param * use correct method * chore: fix lint --------- Signed-off-by: James <namnh0122@gmail.com> Co-authored-by: Faisal Amir <urmauur@gmail.com> Co-authored-by: Nathan <thu.nhuanh99@gmail.com> Co-authored-by: thu <thu@treehouse.finance> Co-authored-by: Van Pham <64197333+Van-QA@users.noreply.github.com> Co-authored-by: Hoang Ha <64120343+hahuyhoang411@users.noreply.github.com> Co-authored-by: jan-service-account <136811300+jan-service-account@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Ikko Eltociear Ashimine <eltociear@gmail.com> Co-authored-by: NamH <NamNh0122@gmail.com> Co-authored-by: Saurabh <saurabhrai1717@gmail.com> Co-authored-by: Louis <louis@jan.ai>
@janhq/core
This module includes functions for communicating with core APIs, registering app extensions, and exporting type definitions.
Usage
Import the package
// Web / extension runtime
import * as core from "@janhq/core";
// Node runtime
import * as node from "@janhq/core/node";
Build an Extension
-
Download an extension template, for example, https://github.com/janhq/extension-template.
-
Update the source code:
- Open
index.tsin your code editor. - Rename the extension class from
SampleExtensionto your preferred extension name. - Import modules from the core package.
import * as core from "@janhq/core"; - In the
onLoad()method, add your code:// Example of listening to app events and providing customized inference logic: import * as core from "@janhq/core"; export default class MyExtension extends BaseExtension { // On extension load onLoad() { core.events.on(MessageEvent.OnMessageSent, (data) => MyExtension.inference(data, this)); } // Customized inference logic private static inference(incomingMessage: MessageRequestData) { // Prepare customized message content const content: ThreadContent = { type: ContentType.Text, text: { value: "I'm Jan Assistant!", annotations: [], }, }; // Modify message and send out const outGoingMessage: ThreadMessage = { ...incomingMessage, content }; } }
- Open
-
Build the extension:
- Navigate to the extension directory.
- Install dependencies.
yarn install - Compile the source code. The following command keeps running in the terminal and rebuilds the extension when you modify the source code.
yarn build - Select the generated .tgz from Jan > Settings > Extension > Manual Installation.