forked from janhq/jan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: jan extensions (janhq#799)
* refactor: rename plugin to extension
- Loading branch information
Showing
134 changed files
with
1,747 additions
and
1,860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
export {}; | ||
|
||
declare global { | ||
interface CorePlugin { | ||
store?: any | undefined; | ||
events?: any | undefined; | ||
} | ||
interface Window { | ||
corePlugin?: CorePlugin; | ||
coreAPI?: any | undefined; | ||
electronAPI?: any | undefined; | ||
core?: any; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export enum ExtensionType { | ||
Assistant = "assistant", | ||
Conversational = "conversational", | ||
Inference = "inference", | ||
Model = "model", | ||
SystemMonitoring = "systemMonitoring", | ||
} | ||
|
||
/** | ||
* Represents a base extension. | ||
* This class should be extended by any class that represents an extension. | ||
*/ | ||
export abstract class BaseExtension { | ||
/** | ||
* Returns the type of the extension. | ||
* @returns {ExtensionType} The type of the extension | ||
* Undefined means its not extending any known extension by the application. | ||
*/ | ||
abstract type(): ExtensionType | undefined; | ||
/** | ||
* Called when the extension is loaded. | ||
* Any initialization logic for the extension should be put here. | ||
*/ | ||
abstract onLoad(): void; | ||
/** | ||
* Called when the extension is unloaded. | ||
* Any cleanup logic for the extension should be put here. | ||
*/ | ||
abstract onUnload(): void; | ||
} |
8 changes: 4 additions & 4 deletions
8
core/src/plugins/assistant.ts → core/src/extensions/assistant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
core/src/plugins/conversational.ts → core/src/extensions/conversational.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Conversational extension. Persists and retrieves conversations. | ||
* @module | ||
*/ | ||
export { ConversationalExtension } from "./conversational"; | ||
|
||
/** | ||
* Inference extension. Start, stop and inference models. | ||
*/ | ||
export { InferenceExtension } from "./inference"; | ||
|
||
/** | ||
* Monitoring extension for system monitoring. | ||
*/ | ||
export { MonitoringExtension } from "./monitoring"; | ||
|
||
/** | ||
* Assistant extension for managing assistants. | ||
*/ | ||
export { AssistantExtension } from "./assistant"; | ||
|
||
/** | ||
* Model extension for managing models. | ||
*/ | ||
export { ModelExtension } from "./model"; |
10 changes: 5 additions & 5 deletions
10
core/src/plugins/inference.ts → core/src/extensions/inference.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
core/src/plugins/monitoring.ts → core/src/extensions/monitoring.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.