tauri-plugin-askit-api 0.2.0 → 0.3.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-js/index.cjs +18 -18
- package/dist-js/index.d.ts +22 -17
- package/dist-js/index.js +15 -15
- package/package.json +33 -34
package/dist-js/index.cjs
CHANGED
|
@@ -42,7 +42,7 @@ async function stopAgentFlow(flowName) {
|
|
|
42
42
|
}
|
|
43
43
|
// nodes
|
|
44
44
|
async function newAgentFlowNode(defName) {
|
|
45
|
-
await core.invoke('plugin:askit|new_agent_flow_node', { defName });
|
|
45
|
+
return await core.invoke('plugin:askit|new_agent_flow_node', { defName });
|
|
46
46
|
}
|
|
47
47
|
async function addAgentFlowNode(flowName, node) {
|
|
48
48
|
await core.invoke('plugin:askit|add_agent_flow_node', { flowName, node });
|
|
@@ -68,36 +68,36 @@ async function stopAgent(agentId) {
|
|
|
68
68
|
async function writeBoard(board, message) {
|
|
69
69
|
await core.invoke('plugin:askit|write_board', { board, message });
|
|
70
70
|
}
|
|
71
|
-
//
|
|
72
|
-
async function
|
|
73
|
-
await core.invoke('plugin:askit|
|
|
71
|
+
// configs
|
|
72
|
+
async function setAgentConfigs(agentId, configs) {
|
|
73
|
+
await core.invoke('plugin:askit|set_agent_configs', { agentId, configs });
|
|
74
74
|
}
|
|
75
|
-
async function
|
|
76
|
-
return await core.invoke('plugin:askit|
|
|
75
|
+
async function getGlobalConfigs(defName) {
|
|
76
|
+
return await core.invoke('plugin:askit|get_global_configs', { defName });
|
|
77
77
|
}
|
|
78
|
-
async function
|
|
79
|
-
return await core.invoke('plugin:askit|
|
|
78
|
+
async function getGlobalConfigsMap() {
|
|
79
|
+
return await core.invoke('plugin:askit|get_global_configs_map', {});
|
|
80
80
|
}
|
|
81
|
-
async function
|
|
82
|
-
await core.invoke('plugin:askit|
|
|
81
|
+
async function setGlobalConfigs(defName, configs) {
|
|
82
|
+
await core.invoke('plugin:askit|set_global_configs', { defName, configs });
|
|
83
83
|
}
|
|
84
|
-
async function
|
|
85
|
-
await core.invoke('plugin:askit|
|
|
84
|
+
async function setGlobalConfigsMap(configs) {
|
|
85
|
+
await core.invoke('plugin:askit|set_global_configs_map', { configs });
|
|
86
86
|
}
|
|
87
|
-
async function
|
|
88
|
-
return await core.invoke('plugin:askit|
|
|
87
|
+
async function getAgentDefaultConfigs(defName) {
|
|
88
|
+
return await core.invoke('plugin:askit|get_agent_default_configs', { defName });
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
exports.addAgentFlow = addAgentFlow;
|
|
92
92
|
exports.addAgentFlowEdge = addAgentFlowEdge;
|
|
93
93
|
exports.addAgentFlowNode = addAgentFlowNode;
|
|
94
94
|
exports.copySubFlow = copySubFlow;
|
|
95
|
-
exports.
|
|
95
|
+
exports.getAgentDefaultConfigs = getAgentDefaultConfigs;
|
|
96
96
|
exports.getAgentDefinition = getAgentDefinition;
|
|
97
97
|
exports.getAgentDefinitions = getAgentDefinitions;
|
|
98
98
|
exports.getAgentFlows = getAgentFlows;
|
|
99
|
-
exports.getGlobalConfig = getGlobalConfig;
|
|
100
99
|
exports.getGlobalConfigs = getGlobalConfigs;
|
|
100
|
+
exports.getGlobalConfigsMap = getGlobalConfigsMap;
|
|
101
101
|
exports.insertAgentFlow = insertAgentFlow;
|
|
102
102
|
exports.newAgentFlow = newAgentFlow;
|
|
103
103
|
exports.newAgentFlowNode = newAgentFlowNode;
|
|
@@ -105,9 +105,9 @@ exports.removeAgentFlow = removeAgentFlow;
|
|
|
105
105
|
exports.removeAgentFlowEdge = removeAgentFlowEdge;
|
|
106
106
|
exports.removeAgentFlowNode = removeAgentFlowNode;
|
|
107
107
|
exports.renameAgentFlow = renameAgentFlow;
|
|
108
|
-
exports.
|
|
109
|
-
exports.setGlobalConfig = setGlobalConfig;
|
|
108
|
+
exports.setAgentConfigs = setAgentConfigs;
|
|
110
109
|
exports.setGlobalConfigs = setGlobalConfigs;
|
|
110
|
+
exports.setGlobalConfigsMap = setGlobalConfigsMap;
|
|
111
111
|
exports.startAgent = startAgent;
|
|
112
112
|
exports.startAgentFlow = startAgentFlow;
|
|
113
113
|
exports.stopAgent = stopAgent;
|
package/dist-js/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type AgentDefinitions = Record<string, AgentDefinition>;
|
|
2
|
-
export type
|
|
2
|
+
export type AgentGlobalConfigsMap = Record<string, AgentConfigs>;
|
|
3
3
|
export type AgentDefinition = {
|
|
4
4
|
kind: string;
|
|
5
5
|
name: string;
|
|
@@ -9,12 +9,12 @@ export type AgentDefinition = {
|
|
|
9
9
|
path: string;
|
|
10
10
|
inputs: string[] | null;
|
|
11
11
|
outputs: string[] | null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
default_configs: AgentDefaultConfigs | null;
|
|
13
|
+
global_configs: AgentGlobalConfigs | null;
|
|
14
|
+
display_configs: AgentDisplayConfigs | null;
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
16
|
+
export type AgentDefaultConfigs = [string, AgentConfigEntry][];
|
|
17
|
+
export type AgentGlobalConfigs = [string, AgentConfigEntry][];
|
|
18
18
|
export type AgentConfigEntry = {
|
|
19
19
|
value: any;
|
|
20
20
|
type: AgentConfigValueType | null;
|
|
@@ -23,7 +23,7 @@ export type AgentConfigEntry = {
|
|
|
23
23
|
hidden?: boolean | null;
|
|
24
24
|
};
|
|
25
25
|
export type AgentConfigValueType = "unit" | "boolean" | "integer" | "number" | "string" | "password" | "text" | "object";
|
|
26
|
-
export type
|
|
26
|
+
export type AgentDisplayConfigs = [string, AgentDisplayConfigEntry][];
|
|
27
27
|
export type AgentDisplayConfigEntry = {
|
|
28
28
|
type: AgentDisplayConfigType | null;
|
|
29
29
|
title?: string | null;
|
|
@@ -38,13 +38,13 @@ export type AgentFlow = {
|
|
|
38
38
|
name: string;
|
|
39
39
|
viewport: Viewport | null;
|
|
40
40
|
};
|
|
41
|
-
export type
|
|
42
|
-
export type
|
|
41
|
+
export type AgentConfigsMap = Record<string, AgentConfigs>;
|
|
42
|
+
export type AgentConfigs = Record<string, any>;
|
|
43
43
|
export type AgentFlowNode = {
|
|
44
44
|
id: string;
|
|
45
45
|
def_name: string;
|
|
46
46
|
enabled: boolean;
|
|
47
|
-
|
|
47
|
+
configs: AgentConfigs | null;
|
|
48
48
|
title: string | null;
|
|
49
49
|
x: number;
|
|
50
50
|
y: number;
|
|
@@ -72,6 +72,11 @@ export type Settings = {
|
|
|
72
72
|
agents: Record<string, AgentDefinition>;
|
|
73
73
|
agent_flows: AgentFlow[];
|
|
74
74
|
};
|
|
75
|
+
export type ConfigMessage = {
|
|
76
|
+
agent_id: string;
|
|
77
|
+
key: string;
|
|
78
|
+
data: any;
|
|
79
|
+
};
|
|
75
80
|
export type DisplayMessage = {
|
|
76
81
|
agent_id: string;
|
|
77
82
|
key: string;
|
|
@@ -97,7 +102,7 @@ export declare function insertAgentFlow(agentFlow: AgentFlow): Promise<void>;
|
|
|
97
102
|
export declare function copySubFlow(nodes: AgentFlowNode[], edges: AgentFlowEdge[]): Promise<[AgentFlowNode[], AgentFlowEdge[]]>;
|
|
98
103
|
export declare function startAgentFlow(flowName: string): Promise<void>;
|
|
99
104
|
export declare function stopAgentFlow(flowName: string): Promise<void>;
|
|
100
|
-
export declare function newAgentFlowNode(defName: string): Promise<
|
|
105
|
+
export declare function newAgentFlowNode(defName: string): Promise<AgentFlowNode>;
|
|
101
106
|
export declare function addAgentFlowNode(flowName: string, node: AgentFlowNode): Promise<void>;
|
|
102
107
|
export declare function removeAgentFlowNode(flowName: string, nodeId: string): Promise<void>;
|
|
103
108
|
export declare function addAgentFlowEdge(flowName: string, edge: AgentFlowEdge): Promise<void>;
|
|
@@ -105,9 +110,9 @@ export declare function removeAgentFlowEdge(flowName: string, edgeId: string): P
|
|
|
105
110
|
export declare function startAgent(agentId: string): Promise<void>;
|
|
106
111
|
export declare function stopAgent(agentId: string): Promise<void>;
|
|
107
112
|
export declare function writeBoard(board: string, message: string): Promise<void>;
|
|
108
|
-
export declare function
|
|
109
|
-
export declare function
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
112
|
-
export declare function
|
|
113
|
-
export declare function
|
|
113
|
+
export declare function setAgentConfigs(agentId: string, configs: Record<string, any>): Promise<void>;
|
|
114
|
+
export declare function getGlobalConfigs(defName: string): Promise<AgentConfigs | null>;
|
|
115
|
+
export declare function getGlobalConfigsMap(): Promise<AgentConfigsMap>;
|
|
116
|
+
export declare function setGlobalConfigs(defName: string, configs: AgentConfigs): Promise<void>;
|
|
117
|
+
export declare function setGlobalConfigsMap(configs: AgentConfigsMap): Promise<void>;
|
|
118
|
+
export declare function getAgentDefaultConfigs(defName: string): Promise<AgentDefaultConfigs | null>;
|
package/dist-js/index.js
CHANGED
|
@@ -40,7 +40,7 @@ async function stopAgentFlow(flowName) {
|
|
|
40
40
|
}
|
|
41
41
|
// nodes
|
|
42
42
|
async function newAgentFlowNode(defName) {
|
|
43
|
-
await invoke('plugin:askit|new_agent_flow_node', { defName });
|
|
43
|
+
return await invoke('plugin:askit|new_agent_flow_node', { defName });
|
|
44
44
|
}
|
|
45
45
|
async function addAgentFlowNode(flowName, node) {
|
|
46
46
|
await invoke('plugin:askit|add_agent_flow_node', { flowName, node });
|
|
@@ -66,24 +66,24 @@ async function stopAgent(agentId) {
|
|
|
66
66
|
async function writeBoard(board, message) {
|
|
67
67
|
await invoke('plugin:askit|write_board', { board, message });
|
|
68
68
|
}
|
|
69
|
-
//
|
|
70
|
-
async function
|
|
71
|
-
await invoke('plugin:askit|
|
|
69
|
+
// configs
|
|
70
|
+
async function setAgentConfigs(agentId, configs) {
|
|
71
|
+
await invoke('plugin:askit|set_agent_configs', { agentId, configs });
|
|
72
72
|
}
|
|
73
|
-
async function
|
|
74
|
-
return await invoke('plugin:askit|
|
|
73
|
+
async function getGlobalConfigs(defName) {
|
|
74
|
+
return await invoke('plugin:askit|get_global_configs', { defName });
|
|
75
75
|
}
|
|
76
|
-
async function
|
|
77
|
-
return await invoke('plugin:askit|
|
|
76
|
+
async function getGlobalConfigsMap() {
|
|
77
|
+
return await invoke('plugin:askit|get_global_configs_map', {});
|
|
78
78
|
}
|
|
79
|
-
async function
|
|
80
|
-
await invoke('plugin:askit|
|
|
79
|
+
async function setGlobalConfigs(defName, configs) {
|
|
80
|
+
await invoke('plugin:askit|set_global_configs', { defName, configs });
|
|
81
81
|
}
|
|
82
|
-
async function
|
|
83
|
-
await invoke('plugin:askit|
|
|
82
|
+
async function setGlobalConfigsMap(configs) {
|
|
83
|
+
await invoke('plugin:askit|set_global_configs_map', { configs });
|
|
84
84
|
}
|
|
85
|
-
async function
|
|
86
|
-
return await invoke('plugin:askit|
|
|
85
|
+
async function getAgentDefaultConfigs(defName) {
|
|
86
|
+
return await invoke('plugin:askit|get_agent_default_configs', { defName });
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
export { addAgentFlow, addAgentFlowEdge, addAgentFlowNode, copySubFlow,
|
|
89
|
+
export { addAgentFlow, addAgentFlowEdge, addAgentFlowNode, copySubFlow, getAgentDefaultConfigs, getAgentDefinition, getAgentDefinitions, getAgentFlows, getGlobalConfigs, getGlobalConfigsMap, insertAgentFlow, newAgentFlow, newAgentFlowNode, removeAgentFlow, removeAgentFlowEdge, removeAgentFlowNode, renameAgentFlow, setAgentConfigs, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentFlow, stopAgent, stopAgentFlow, uniqueFlowName, writeBoard };
|
package/package.json
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tauri-plugin-askit-api",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "MIT OR Apache-2.0",
|
|
5
|
-
"author": "Akira Ishino",
|
|
6
|
-
"description": "Tauri plugin for Agent Stream Kit",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"types": "./dist-js/index.d.ts",
|
|
9
|
-
"main": "./dist-js/index.cjs",
|
|
10
|
-
"module": "./dist-js/index.js",
|
|
11
|
-
"exports": {
|
|
12
|
-
"types": "./dist-js/index.d.ts",
|
|
13
|
-
"import": "./dist-js/index.js",
|
|
14
|
-
"require": "./dist-js/index.cjs"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist-js",
|
|
18
|
-
"README.md"
|
|
19
|
-
],
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "tauri-plugin-askit-api",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"license": "MIT OR Apache-2.0",
|
|
5
|
+
"author": "Akira Ishino",
|
|
6
|
+
"description": "Tauri plugin for Agent Stream Kit",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"types": "./dist-js/index.d.ts",
|
|
9
|
+
"main": "./dist-js/index.cjs",
|
|
10
|
+
"module": "./dist-js/index.js",
|
|
11
|
+
"exports": {
|
|
12
|
+
"types": "./dist-js/index.d.ts",
|
|
13
|
+
"import": "./dist-js/index.js",
|
|
14
|
+
"require": "./dist-js/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist-js",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@tauri-apps/api": "^2.0.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@rollup/plugin-typescript": "^12.0.0",
|
|
25
|
+
"rollup": "^4.9.6",
|
|
26
|
+
"typescript": "^5.3.3",
|
|
27
|
+
"tslib": "^2.6.2"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rollup -c",
|
|
31
|
+
"pretest": "pnpm build"
|
|
32
|
+
}
|
|
33
|
+
}
|