@lvce-editor/rpc-registry 9.9.0 → 9.10.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.
|
@@ -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
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/rpc-registry",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.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",
|