@lvce-editor/rpc-registry 9.9.0 → 9.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parts/AuthWorker/AuthWorker.d.ts +3 -0
- package/dist/parts/AuthWorker/AuthWorker.js +8 -0
- package/dist/parts/ChatStorageWorker/ChatStorageWorker.d.ts +92 -0
- package/dist/parts/ChatStorageWorker/ChatStorageWorker.js +21 -0
- package/dist/parts/ChatToolWorker/ChatToolWorker.d.ts +19 -2
- package/dist/parts/ChatToolWorker/ChatToolWorker.js +6 -5
- package/dist/parts/Main/Main.d.ts +2 -0
- package/dist/parts/Main/Main.js +2 -0
- package/dist/parts/RendererWorker/RendererWorker.d.ts +2 -0
- package/dist/parts/RendererWorker/RendererWorker.js +7 -0
- package/dist/parts/TextSearchWorker/TextSearchWorker.d.ts +3 -0
- package/dist/parts/TextSearchWorker/TextSearchWorker.js +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const dispose: () => Promise<void>, invoke: (method: string, ...params: readonly unknown[]) => Promise<any>, invokeAndTransfer: (method: string, ...params: readonly unknown[]) => Promise<any>, registerMockRpc: (commandMap: Record<string, any>) => import("../DisposableMockRpc/DisposableMockRpc.ts").DisposableMockRpc, set: (rpc: import("@lvce-editor/rpc").Rpc) => void;
|
|
2
|
+
export declare const makeApiRequest: (options: any) => Promise<any>;
|
|
3
|
+
export declare const makeStreamingApiRequest: (options: any) => Promise<any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as RpcFactory from "../RpcFactory/RpcFactory.js";
|
|
2
|
+
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(6010);
|
|
3
|
+
export const makeApiRequest = async (options) => {
|
|
4
|
+
return invoke('ChatNetwork.makeApiRequest', options);
|
|
5
|
+
};
|
|
6
|
+
export const makeStreamingApiRequest = async (options) => {
|
|
7
|
+
return invoke('ChatNetwork.makeStreamingApiRequest', options);
|
|
8
|
+
};
|
|
@@ -1,3 +1,95 @@
|
|
|
1
1
|
export declare const dispose: () => Promise<void>, invoke: (method: string, ...params: readonly unknown[]) => Promise<any>, invokeAndTransfer: (method: string, ...params: readonly unknown[]) => Promise<any>, registerMockRpc: (commandMap: Record<string, any>) => import("../DisposableMockRpc/DisposableMockRpc.ts").DisposableMockRpc, set: (rpc: import("@lvce-editor/rpc").Rpc) => void;
|
|
2
2
|
export declare const save: (options: any) => Promise<any>;
|
|
3
3
|
export declare const get: (options: any) => Promise<any>;
|
|
4
|
+
export type ChatToolCallStatus = 'error' | 'not-found' | 'success';
|
|
5
|
+
export interface ChatToolCall {
|
|
6
|
+
readonly arguments: string;
|
|
7
|
+
readonly errorMessage?: string;
|
|
8
|
+
readonly errorStack?: string;
|
|
9
|
+
readonly id?: string;
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly result?: string;
|
|
12
|
+
readonly status?: ChatToolCallStatus;
|
|
13
|
+
}
|
|
14
|
+
export interface ChatMessage {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly inProgress?: boolean;
|
|
17
|
+
readonly role: 'user' | 'assistant';
|
|
18
|
+
readonly text: string;
|
|
19
|
+
readonly time: string;
|
|
20
|
+
readonly toolCalls?: readonly ChatToolCall[];
|
|
21
|
+
}
|
|
22
|
+
interface ChatViewEventBase {
|
|
23
|
+
readonly sessionId: string;
|
|
24
|
+
readonly timestamp: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ChatSessionCreatedEvent extends ChatViewEventBase {
|
|
27
|
+
readonly title: string;
|
|
28
|
+
readonly type: 'chat-session-created';
|
|
29
|
+
}
|
|
30
|
+
export interface ChatSessionDeletedEvent extends ChatViewEventBase {
|
|
31
|
+
readonly type: 'chat-session-deleted';
|
|
32
|
+
}
|
|
33
|
+
export interface ChatSessionTitleUpdatedEvent extends ChatViewEventBase {
|
|
34
|
+
readonly title: string;
|
|
35
|
+
readonly type: 'chat-session-title-updated';
|
|
36
|
+
}
|
|
37
|
+
export interface ChatMessageAddedEvent extends ChatViewEventBase {
|
|
38
|
+
readonly message: ChatMessage;
|
|
39
|
+
readonly type: 'chat-message-added';
|
|
40
|
+
}
|
|
41
|
+
export interface ChatMessageUpdatedEvent extends ChatViewEventBase {
|
|
42
|
+
readonly inProgress: boolean | undefined;
|
|
43
|
+
readonly messageId: string;
|
|
44
|
+
readonly text: string;
|
|
45
|
+
readonly time: string;
|
|
46
|
+
readonly toolCalls?: ChatMessage['toolCalls'];
|
|
47
|
+
readonly type: 'chat-message-updated';
|
|
48
|
+
}
|
|
49
|
+
export interface ChatSessionMessagesReplacedEvent extends ChatViewEventBase {
|
|
50
|
+
readonly messages: readonly ChatMessage[];
|
|
51
|
+
readonly type: 'chat-session-messages-replaced';
|
|
52
|
+
}
|
|
53
|
+
export interface HandleInputEvent extends ChatViewEventBase {
|
|
54
|
+
readonly type: 'handle-input';
|
|
55
|
+
readonly value: string;
|
|
56
|
+
}
|
|
57
|
+
export interface HandleSubmitEvent extends ChatViewEventBase {
|
|
58
|
+
readonly type: 'handle-submit';
|
|
59
|
+
readonly value: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ChatAttachmentAddedEvent extends ChatViewEventBase {
|
|
62
|
+
readonly attachmentId: string;
|
|
63
|
+
readonly blob: Blob;
|
|
64
|
+
readonly mimeType: string;
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly size: number;
|
|
67
|
+
readonly type: 'chat-attachment-added';
|
|
68
|
+
}
|
|
69
|
+
export interface DataEvent extends ChatViewEventBase {
|
|
70
|
+
readonly type: 'sse-response-part';
|
|
71
|
+
readonly value: unknown;
|
|
72
|
+
}
|
|
73
|
+
export interface ResponseCompletedEvent extends ChatViewEventBase {
|
|
74
|
+
readonly type: 'sse-response-completed';
|
|
75
|
+
readonly value: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface EventStreamFinishedEvent extends ChatViewEventBase {
|
|
78
|
+
readonly type: 'event-stream-finished';
|
|
79
|
+
readonly value: '[DONE]';
|
|
80
|
+
}
|
|
81
|
+
export type ChatViewEvent = ChatSessionCreatedEvent | ChatSessionDeletedEvent | ChatSessionTitleUpdatedEvent | ChatMessageAddedEvent | ChatMessageUpdatedEvent | ChatSessionMessagesReplacedEvent | HandleInputEvent | HandleSubmitEvent | ChatAttachmentAddedEvent | DataEvent | ResponseCompletedEvent | EventStreamFinishedEvent;
|
|
82
|
+
export interface ChatSession {
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly messages: readonly ChatMessage[];
|
|
85
|
+
readonly projectId?: string;
|
|
86
|
+
readonly title: string;
|
|
87
|
+
}
|
|
88
|
+
export declare const appendEvent: (event: ChatViewEvent) => Promise<void>;
|
|
89
|
+
export declare const clear: () => Promise<void>;
|
|
90
|
+
export declare const deleteSession: (id: string) => Promise<void>;
|
|
91
|
+
export declare const getEvents: (sessionId?: string) => Promise<readonly ChatViewEvent[]>;
|
|
92
|
+
export declare const getSession: (sessionId: string) => Promise<ChatSession | undefined>;
|
|
93
|
+
export declare const listSessions: (sessionId: string) => Promise<readonly ChatSession[]>;
|
|
94
|
+
export declare const setSession: (session: ChatSession) => Promise<void>;
|
|
95
|
+
export {};
|
|
@@ -7,3 +7,24 @@ export const save = async (options) => {
|
|
|
7
7
|
export const get = async (options) => {
|
|
8
8
|
return invoke('ChatStorage.get', options);
|
|
9
9
|
};
|
|
10
|
+
export const appendEvent = async (event) => {
|
|
11
|
+
return invoke('ChatStorage.appendEvent', event);
|
|
12
|
+
};
|
|
13
|
+
export const clear = async () => {
|
|
14
|
+
return invoke('ChatStorage.clear');
|
|
15
|
+
};
|
|
16
|
+
export const deleteSession = async (id) => {
|
|
17
|
+
return invoke('ChatStorage.deleteSession', id);
|
|
18
|
+
};
|
|
19
|
+
export const getEvents = async (sessionId) => {
|
|
20
|
+
return invoke('ChatStorage.getEvents', sessionId);
|
|
21
|
+
};
|
|
22
|
+
export const getSession = async (sessionId) => {
|
|
23
|
+
return invoke('ChatStorage.getSession', sessionId);
|
|
24
|
+
};
|
|
25
|
+
export const listSessions = async (sessionId) => {
|
|
26
|
+
return invoke('ChatStorage.listSessions', sessionId);
|
|
27
|
+
};
|
|
28
|
+
export const setSession = async (session) => {
|
|
29
|
+
return invoke('ChatStorage.setSession', session);
|
|
30
|
+
};
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
export declare const dispose: () => Promise<void>, invoke: (method: string, ...params: readonly unknown[]) => Promise<any>, invokeAndTransfer: (method: string, ...params: readonly unknown[]) => Promise<any>, registerMockRpc: (commandMap: Record<string, any>) => import("../DisposableMockRpc/DisposableMockRpc.ts").DisposableMockRpc, set: (rpc: import("@lvce-editor/rpc").Rpc) => void;
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type ChatTool = {
|
|
3
|
+
readonly type: 'function';
|
|
4
|
+
readonly function: {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly parameters: {
|
|
8
|
+
readonly type: 'object';
|
|
9
|
+
readonly properties: Record<string, unknown>;
|
|
10
|
+
readonly required?: readonly string[];
|
|
11
|
+
readonly additionalProperties: boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type ExecuteToolOptions = {
|
|
16
|
+
readonly assetDir: string;
|
|
17
|
+
readonly platform: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const execute: (name: string, rawArguments: unknown, options: ExecuteToolOptions) => Promise<any>;
|
|
20
|
+
export declare const getTools: () => Promise<readonly ChatTool[]>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { RpcId } from '@lvce-editor/constants';
|
|
1
2
|
import * as RpcFactory from "../RpcFactory/RpcFactory.js";
|
|
2
|
-
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(
|
|
3
|
-
export const
|
|
4
|
-
return invoke('
|
|
3
|
+
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(RpcId.ChatToolWorker);
|
|
4
|
+
export const execute = async (name, rawArguments, options) => {
|
|
5
|
+
return invoke('ChatTool.execute', name, rawArguments, options);
|
|
5
6
|
};
|
|
6
|
-
export const
|
|
7
|
-
return invoke('
|
|
7
|
+
export const getTools = async () => {
|
|
8
|
+
return invoke('ChatTool.getTools');
|
|
8
9
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { Rpc, MockRpc } from '@lvce-editor/rpc';
|
|
2
|
+
export * as AuthWorker from '../AuthWorker/AuthWorker.ts';
|
|
2
3
|
export * as ChatCoordinatorWorker from '../ChatCoordinatorWorker/ChatCoordinatorWorker.ts';
|
|
3
4
|
export * as ChatDebugWorker from '../ChatDebugWorker/ChatDebugWorker.ts';
|
|
4
5
|
export * as ChatMathWorker from '../ChatMathWorker/ChatMathWorker.ts';
|
|
@@ -30,6 +31,7 @@ export * as RendererProcess from '../RendererProcess/RendererProcess.ts';
|
|
|
30
31
|
export * as RendererWorker from '../RendererWorker/RendererWorker.ts';
|
|
31
32
|
export * as SourceControlWorker from '../SourceControlWorker/SourceControlWorker.ts';
|
|
32
33
|
export * as TextMeasurementWorker from '../TextMeasurementWorker/TextMeasurementWorker.ts';
|
|
34
|
+
export * as TextSearchWorker from '../TextSearchWorker/TextSearchWorker.ts';
|
|
33
35
|
export { RpcId } from '@lvce-editor/constants';
|
|
34
36
|
export * as SearchProcess from '../SearchProcess/SearchProcess.ts';
|
|
35
37
|
export * as SharedProcess from '../SharedProcess/SharedProcess.ts';
|
package/dist/parts/Main/Main.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * as AuthWorker from "../AuthWorker/AuthWorker.js";
|
|
1
2
|
export * as ChatCoordinatorWorker from "../ChatCoordinatorWorker/ChatCoordinatorWorker.js";
|
|
2
3
|
export * as ChatDebugWorker from "../ChatDebugWorker/ChatDebugWorker.js";
|
|
3
4
|
export * as ChatMathWorker from "../ChatMathWorker/ChatMathWorker.js";
|
|
@@ -29,6 +30,7 @@ export * as RendererProcess from "../RendererProcess/RendererProcess.js";
|
|
|
29
30
|
export * as RendererWorker from "../RendererWorker/RendererWorker.js";
|
|
30
31
|
export * as SourceControlWorker from "../SourceControlWorker/SourceControlWorker.js";
|
|
31
32
|
export * as TextMeasurementWorker from "../TextMeasurementWorker/TextMeasurementWorker.js";
|
|
33
|
+
export * as TextSearchWorker from "../TextSearchWorker/TextSearchWorker.js";
|
|
32
34
|
export { RpcId } from '@lvce-editor/constants';
|
|
33
35
|
export * as SearchProcess from "../SearchProcess/SearchProcess.js";
|
|
34
36
|
export * as SharedProcess from "../SharedProcess/SharedProcess.js";
|
|
@@ -24,6 +24,7 @@ export declare const sendMessagePortToOpenerWorker: (port: MessagePort, rpcId: n
|
|
|
24
24
|
export declare const sendMessagePortToChatMathWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
25
25
|
export declare const sendMessagePortToChatCoordinatorWorkerWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
26
26
|
export declare const sendMessagePortToMainAreaWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
27
|
+
export declare const sendMessagePortToTextSearchWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
27
28
|
export declare const sendMessagePortToErrorWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
28
29
|
export declare const sendMessagePortToMarkdownWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
29
30
|
export declare const sendMessagePortToIconThemeWorker: (port: MessagePort, rpcId: number) => Promise<void>;
|
|
@@ -54,6 +55,7 @@ export declare const sendMessagePortToQuickPickWorker: (port: MessagePort, rpcId
|
|
|
54
55
|
export declare const sendMessagePortToSearchProcess: (port: MessagePort) => Promise<void>;
|
|
55
56
|
export declare const sendMessagePortToChatNetworkWorker: (port: MessagePort) => Promise<void>;
|
|
56
57
|
export declare const sendMessagePortToChatToolWorker: (port: MessagePort) => Promise<void>;
|
|
58
|
+
export declare const sendMessagePortToChatStorageWorker: (port: MessagePort) => Promise<void>;
|
|
57
59
|
export declare const sendMessagePortToChatDebugViewWorker: (port: MessagePort) => Promise<void>;
|
|
58
60
|
export declare const confirm: (message: string, options?: any) => Promise<boolean>;
|
|
59
61
|
export declare const getRecentlyOpened: () => Promise<readonly string[]>;
|
|
@@ -82,6 +82,10 @@ export const sendMessagePortToMainAreaWorker = async (port, rpcId) => {
|
|
|
82
82
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
83
83
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMainAreaWorker', port, command, rpcId);
|
|
84
84
|
};
|
|
85
|
+
export const sendMessagePortToTextSearchWorker = async (port, rpcId) => {
|
|
86
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
87
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextSearchWorker', port, command, rpcId);
|
|
88
|
+
};
|
|
85
89
|
export const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
86
90
|
const command = 'Errors.handleMessagePort';
|
|
87
91
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
@@ -179,6 +183,9 @@ export const sendMessagePortToChatNetworkWorker = async (port) => {
|
|
|
179
183
|
export const sendMessagePortToChatToolWorker = async (port) => {
|
|
180
184
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatToolWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
181
185
|
};
|
|
186
|
+
export const sendMessagePortToChatStorageWorker = async (port) => {
|
|
187
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatStorageWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
188
|
+
};
|
|
182
189
|
export const sendMessagePortToChatDebugViewWorker = async (port) => {
|
|
183
190
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatDebugViewWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
184
191
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const dispose: () => Promise<void>, invoke: (method: string, ...params: readonly unknown[]) => Promise<any>, invokeAndTransfer: (method: string, ...params: readonly unknown[]) => Promise<any>, registerMockRpc: (commandMap: Record<string, any>) => import("../DisposableMockRpc/DisposableMockRpc.ts").DisposableMockRpc, set: (rpc: import("@lvce-editor/rpc").Rpc) => void;
|
|
2
|
+
export declare const makeApiRequest: (options: any) => Promise<any>;
|
|
3
|
+
export declare const makeStreamingApiRequest: (options: any) => Promise<any>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RpcId } from '@lvce-editor/constants';
|
|
2
|
+
import * as RpcFactory from "../RpcFactory/RpcFactory.js";
|
|
3
|
+
export const { dispose, invoke, invokeAndTransfer, registerMockRpc, set } = RpcFactory.create(RpcId.TextSearchWorker);
|
|
4
|
+
export const makeApiRequest = async (options) => {
|
|
5
|
+
return invoke('ChatNetwork.makeApiRequest', options);
|
|
6
|
+
};
|
|
7
|
+
export const makeStreamingApiRequest = async (options) => {
|
|
8
|
+
return invoke('ChatNetwork.makeStreamingApiRequest', options);
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/rpc-registry",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.11.0",
|
|
4
4
|
"description": "Rpc Registry",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@lvce-editor/assert": "^1.5.1",
|
|
16
|
-
"@lvce-editor/constants": "^5.
|
|
16
|
+
"@lvce-editor/constants": "^5.7.0",
|
|
17
17
|
"@lvce-editor/rpc": "^5.5.0"
|
|
18
18
|
},
|
|
19
19
|
"exports": "./dist/index.js",
|