tauri-plugin-askit-api 0.6.0 → 0.7.1
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 +67 -52
- package/dist-js/index.d.ts +30 -59
- package/dist-js/index.js +52 -37
- package/package.json +1 -1
package/dist-js/index.cjs
CHANGED
|
@@ -13,56 +13,71 @@ async function getAgentDefinitions() {
|
|
|
13
13
|
async function getAgentSpec(agentId) {
|
|
14
14
|
return await core.invoke("plugin:askit|get_agent_spec", { agentId });
|
|
15
15
|
}
|
|
16
|
-
//
|
|
17
|
-
async function
|
|
18
|
-
return await core.invoke("plugin:askit|
|
|
16
|
+
// stream
|
|
17
|
+
async function getAgentStreams() {
|
|
18
|
+
return await core.invoke("plugin:askit|get_agent_streams", {});
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
21
|
-
return await core.invoke("plugin:askit|
|
|
20
|
+
async function newAgentStream(streamName) {
|
|
21
|
+
return await core.invoke("plugin:askit|new_agent_stream", { streamName });
|
|
22
22
|
}
|
|
23
|
-
async function
|
|
24
|
-
return await core.invoke("plugin:askit|
|
|
25
|
-
|
|
23
|
+
async function renameAgentStream(streamId, newName) {
|
|
24
|
+
return await core.invoke("plugin:askit|rename_agent_stream", {
|
|
25
|
+
streamId,
|
|
26
26
|
newName,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
async function
|
|
30
|
-
return await core.invoke("plugin:askit|
|
|
29
|
+
async function uniqueStreamName(name) {
|
|
30
|
+
return await core.invoke("plugin:askit|unique_stream_name", { name });
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
33
|
-
await core.invoke("plugin:askit|
|
|
32
|
+
async function addAgentStream(AgentStream) {
|
|
33
|
+
await core.invoke("plugin:askit|add_agent_stream", { AgentStream });
|
|
34
34
|
}
|
|
35
|
-
async function
|
|
36
|
-
await core.invoke("plugin:askit|
|
|
35
|
+
async function removeAgentStream(id) {
|
|
36
|
+
await core.invoke("plugin:askit|remove_agent_stream", { id });
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
39
|
-
await core.invoke("plugin:askit|
|
|
38
|
+
async function insertAgentStream(AgentStream) {
|
|
39
|
+
await core.invoke("plugin:askit|insert_agent_stream", { AgentStream });
|
|
40
40
|
}
|
|
41
|
-
async function
|
|
42
|
-
return await core.invoke("plugin:askit|
|
|
41
|
+
async function copySubStream(agents, channels) {
|
|
42
|
+
return await core.invoke("plugin:askit|copy_sub_stream", {
|
|
43
|
+
agents,
|
|
44
|
+
channels,
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
|
-
async function
|
|
45
|
-
await core.invoke("plugin:askit|
|
|
47
|
+
async function startAgentStream(id) {
|
|
48
|
+
await core.invoke("plugin:askit|start_agent_stream", { id });
|
|
46
49
|
}
|
|
47
|
-
async function
|
|
48
|
-
await core.invoke("plugin:askit|
|
|
50
|
+
async function stopAgentStream(id) {
|
|
51
|
+
await core.invoke("plugin:askit|stop_agent_stream", { id });
|
|
49
52
|
}
|
|
50
|
-
//
|
|
51
|
-
async function
|
|
52
|
-
return await core.invoke("plugin:askit|
|
|
53
|
+
// agents
|
|
54
|
+
async function newAgentSpec(defName) {
|
|
55
|
+
return await core.invoke("plugin:askit|new_agent_spec", { defName });
|
|
53
56
|
}
|
|
54
|
-
async function
|
|
55
|
-
await core.invoke("plugin:askit|
|
|
57
|
+
async function addAgent(streamId, spec) {
|
|
58
|
+
await core.invoke("plugin:askit|add_agent", {
|
|
59
|
+
streamId,
|
|
60
|
+
spec,
|
|
61
|
+
});
|
|
56
62
|
}
|
|
57
|
-
async function
|
|
58
|
-
await core.invoke("plugin:askit|
|
|
63
|
+
async function removeAgent(streamId, agentId) {
|
|
64
|
+
await core.invoke("plugin:askit|remove_agent", {
|
|
65
|
+
streamId,
|
|
66
|
+
agentId,
|
|
67
|
+
});
|
|
59
68
|
}
|
|
60
|
-
//
|
|
61
|
-
async function
|
|
62
|
-
await core.invoke("plugin:askit|
|
|
69
|
+
// channel
|
|
70
|
+
async function addChannel(streamId, channel) {
|
|
71
|
+
await core.invoke("plugin:askit|add_channel", {
|
|
72
|
+
streamId,
|
|
73
|
+
channel,
|
|
74
|
+
});
|
|
63
75
|
}
|
|
64
|
-
async function
|
|
65
|
-
await core.invoke("plugin:askit|
|
|
76
|
+
async function removeChannel(streamId, channelId) {
|
|
77
|
+
await core.invoke("plugin:askit|remove_channel", {
|
|
78
|
+
streamId,
|
|
79
|
+
channelId,
|
|
80
|
+
});
|
|
66
81
|
}
|
|
67
82
|
// agent
|
|
68
83
|
async function startAgent(agentId) {
|
|
@@ -91,36 +106,36 @@ async function setGlobalConfigs(defName, configs) {
|
|
|
91
106
|
async function setGlobalConfigsMap(configs) {
|
|
92
107
|
await core.invoke("plugin:askit|set_global_configs_map", { configs });
|
|
93
108
|
}
|
|
94
|
-
async function
|
|
95
|
-
return await core.invoke("plugin:askit|
|
|
109
|
+
async function getAgentConfigSpecs(defName) {
|
|
110
|
+
return await core.invoke("plugin:askit|get_agent_config_specs", {
|
|
96
111
|
defName,
|
|
97
112
|
});
|
|
98
113
|
}
|
|
99
114
|
|
|
100
|
-
exports.
|
|
101
|
-
exports.
|
|
102
|
-
exports.
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
115
|
+
exports.addAgent = addAgent;
|
|
116
|
+
exports.addAgentStream = addAgentStream;
|
|
117
|
+
exports.addChannel = addChannel;
|
|
118
|
+
exports.copySubStream = copySubStream;
|
|
119
|
+
exports.getAgentConfigSpecs = getAgentConfigSpecs;
|
|
105
120
|
exports.getAgentDefinition = getAgentDefinition;
|
|
106
121
|
exports.getAgentDefinitions = getAgentDefinitions;
|
|
107
|
-
exports.getAgentFlows = getAgentFlows;
|
|
108
122
|
exports.getAgentSpec = getAgentSpec;
|
|
123
|
+
exports.getAgentStreams = getAgentStreams;
|
|
109
124
|
exports.getGlobalConfigs = getGlobalConfigs;
|
|
110
125
|
exports.getGlobalConfigsMap = getGlobalConfigsMap;
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
126
|
+
exports.insertAgentStream = insertAgentStream;
|
|
127
|
+
exports.newAgentSpec = newAgentSpec;
|
|
128
|
+
exports.newAgentStream = newAgentStream;
|
|
129
|
+
exports.removeAgent = removeAgent;
|
|
130
|
+
exports.removeAgentStream = removeAgentStream;
|
|
131
|
+
exports.removeChannel = removeChannel;
|
|
132
|
+
exports.renameAgentStream = renameAgentStream;
|
|
118
133
|
exports.setAgentConfigs = setAgentConfigs;
|
|
119
134
|
exports.setGlobalConfigs = setGlobalConfigs;
|
|
120
135
|
exports.setGlobalConfigsMap = setGlobalConfigsMap;
|
|
121
136
|
exports.startAgent = startAgent;
|
|
122
|
-
exports.
|
|
137
|
+
exports.startAgentStream = startAgentStream;
|
|
123
138
|
exports.stopAgent = stopAgent;
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
139
|
+
exports.stopAgentStream = stopAgentStream;
|
|
140
|
+
exports.uniqueStreamName = uniqueStreamName;
|
|
126
141
|
exports.writeBoard = writeBoard;
|
package/dist-js/index.d.ts
CHANGED
|
@@ -8,9 +8,8 @@ export type AgentDefinition = {
|
|
|
8
8
|
category?: string | null;
|
|
9
9
|
inputs?: string[] | null;
|
|
10
10
|
outputs?: string[] | null;
|
|
11
|
-
|
|
11
|
+
configs?: AgentConfigSpecs | null;
|
|
12
12
|
global_configs?: AgentGlobalConfigSpecs | null;
|
|
13
|
-
display_configs?: AgentDisplayConfigSpecs | null;
|
|
14
13
|
native_thread?: boolean | null;
|
|
15
14
|
};
|
|
16
15
|
export type AgentConfigSpecs = Record<string, AgentConfigSpec>;
|
|
@@ -19,44 +18,33 @@ export type AgentConfigSpec = {
|
|
|
19
18
|
value: any;
|
|
20
19
|
type: AgentConfigValueType | null;
|
|
21
20
|
title?: string | null;
|
|
21
|
+
hide_title?: boolean | null;
|
|
22
22
|
description?: string | null;
|
|
23
23
|
hidden?: boolean | null;
|
|
24
|
+
readonly?: boolean | null;
|
|
24
25
|
};
|
|
25
26
|
export type AgentConfigValueType = string;
|
|
26
|
-
export type
|
|
27
|
-
export type
|
|
28
|
-
value?: any | null;
|
|
29
|
-
type: AgentDisplayConfigType | null;
|
|
30
|
-
title?: string | null;
|
|
31
|
-
description?: string | null;
|
|
32
|
-
hideTitle?: boolean | null;
|
|
33
|
-
};
|
|
34
|
-
export type AgentDisplayConfigType = string;
|
|
35
|
-
export type AgentFlows = Record<string, AgentFlow>;
|
|
36
|
-
export type AgentFlow = {
|
|
27
|
+
export type AgentStreams = Record<string, AgentStream>;
|
|
28
|
+
export type AgentStream = {
|
|
37
29
|
id: string;
|
|
38
30
|
name: string;
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
agents: AgentSpec[];
|
|
32
|
+
channels: ChannelSpec[];
|
|
41
33
|
viewport: Viewport | null;
|
|
42
34
|
};
|
|
43
35
|
export type AgentConfigsMap = Record<string, AgentConfigs>;
|
|
44
36
|
export type AgentConfigs = Record<string, any>;
|
|
37
|
+
export type AgentSpecExtensions = Record<string, any>;
|
|
45
38
|
export type AgentSpec = {
|
|
39
|
+
id?: string | null;
|
|
46
40
|
def_name: string;
|
|
47
41
|
inputs?: string[] | null;
|
|
48
42
|
outputs?: string[] | null;
|
|
49
43
|
configs?: AgentConfigs | null;
|
|
50
44
|
config_specs?: AgentConfigSpecs | null;
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
export type
|
|
54
|
-
export type AgentFlowNode = AgentFlowNodeExtensions & {
|
|
55
|
-
id: string;
|
|
56
|
-
enabled: boolean;
|
|
57
|
-
spec: AgentSpec;
|
|
58
|
-
};
|
|
59
|
-
export type AgentFlowEdge = {
|
|
45
|
+
enabled?: boolean | null;
|
|
46
|
+
} & AgentSpecExtensions;
|
|
47
|
+
export type ChannelSpec = {
|
|
60
48
|
id: string;
|
|
61
49
|
source: string;
|
|
62
50
|
source_handle: string | null;
|
|
@@ -75,47 +63,30 @@ export type CoreSettings = {
|
|
|
75
63
|
export type Settings = {
|
|
76
64
|
core: CoreSettings;
|
|
77
65
|
agents: Record<string, AgentDefinition>;
|
|
78
|
-
|
|
66
|
+
agent_streams: AgentStream[];
|
|
79
67
|
};
|
|
80
|
-
export type
|
|
81
|
-
agent_id: string;
|
|
68
|
+
export type BoardMessage = {
|
|
82
69
|
key: string;
|
|
83
70
|
value: any;
|
|
84
71
|
};
|
|
85
|
-
export type DisplayMessage = {
|
|
86
|
-
agent_id: string;
|
|
87
|
-
key: string;
|
|
88
|
-
value: any;
|
|
89
|
-
};
|
|
90
|
-
export type ErrorMessage = {
|
|
91
|
-
agent_id: string;
|
|
92
|
-
message: string;
|
|
93
|
-
};
|
|
94
|
-
export type AgentSpecUpdatedMessage = {
|
|
95
|
-
agent_id: string;
|
|
96
|
-
};
|
|
97
|
-
export type InputMessage = {
|
|
98
|
-
agent_id: string;
|
|
99
|
-
ch: string;
|
|
100
|
-
};
|
|
101
72
|
export declare function getAgentDefinition(): Promise<AgentDefinition | null>;
|
|
102
73
|
export declare function getAgentDefinitions(): Promise<AgentDefinitions>;
|
|
103
74
|
export declare function getAgentSpec(agentId: string): Promise<AgentSpec | null>;
|
|
104
|
-
export declare function
|
|
105
|
-
export declare function
|
|
106
|
-
export declare function
|
|
107
|
-
export declare function
|
|
108
|
-
export declare function
|
|
109
|
-
export declare function
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
112
|
-
export declare function
|
|
113
|
-
export declare function
|
|
114
|
-
export declare function
|
|
115
|
-
export declare function
|
|
116
|
-
export declare function
|
|
117
|
-
export declare function
|
|
118
|
-
export declare function
|
|
75
|
+
export declare function getAgentStreams(): Promise<AgentStreams>;
|
|
76
|
+
export declare function newAgentStream(streamName: string): Promise<AgentStream>;
|
|
77
|
+
export declare function renameAgentStream(streamId: string, newName: string): Promise<string>;
|
|
78
|
+
export declare function uniqueStreamName(name: string): Promise<string>;
|
|
79
|
+
export declare function addAgentStream(AgentStream: AgentStream): Promise<void>;
|
|
80
|
+
export declare function removeAgentStream(id: string): Promise<void>;
|
|
81
|
+
export declare function insertAgentStream(AgentStream: AgentStream): Promise<void>;
|
|
82
|
+
export declare function copySubStream(agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
|
|
83
|
+
export declare function startAgentStream(id: string): Promise<void>;
|
|
84
|
+
export declare function stopAgentStream(id: string): Promise<void>;
|
|
85
|
+
export declare function newAgentSpec(defName: string): Promise<AgentSpec>;
|
|
86
|
+
export declare function addAgent(streamId: string, spec: AgentSpec): Promise<void>;
|
|
87
|
+
export declare function removeAgent(streamId: string, agentId: string): Promise<void>;
|
|
88
|
+
export declare function addChannel(streamId: string, channel: ChannelSpec): Promise<void>;
|
|
89
|
+
export declare function removeChannel(streamId: string, channelId: string): Promise<void>;
|
|
119
90
|
export declare function startAgent(agentId: string): Promise<void>;
|
|
120
91
|
export declare function stopAgent(agentId: string): Promise<void>;
|
|
121
92
|
export declare function writeBoard(board: string, message: string): Promise<void>;
|
|
@@ -124,4 +95,4 @@ export declare function getGlobalConfigs(defName: string): Promise<AgentConfigs
|
|
|
124
95
|
export declare function getGlobalConfigsMap(): Promise<AgentConfigsMap>;
|
|
125
96
|
export declare function setGlobalConfigs(defName: string, configs: AgentConfigs): Promise<void>;
|
|
126
97
|
export declare function setGlobalConfigsMap(configs: AgentConfigsMap): Promise<void>;
|
|
127
|
-
export declare function
|
|
98
|
+
export declare function getAgentConfigSpecs(defName: string): Promise<AgentConfigSpecs | null>;
|
package/dist-js/index.js
CHANGED
|
@@ -11,56 +11,71 @@ async function getAgentDefinitions() {
|
|
|
11
11
|
async function getAgentSpec(agentId) {
|
|
12
12
|
return await invoke("plugin:askit|get_agent_spec", { agentId });
|
|
13
13
|
}
|
|
14
|
-
//
|
|
15
|
-
async function
|
|
16
|
-
return await invoke("plugin:askit|
|
|
14
|
+
// stream
|
|
15
|
+
async function getAgentStreams() {
|
|
16
|
+
return await invoke("plugin:askit|get_agent_streams", {});
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
19
|
-
return await invoke("plugin:askit|
|
|
18
|
+
async function newAgentStream(streamName) {
|
|
19
|
+
return await invoke("plugin:askit|new_agent_stream", { streamName });
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
22
|
-
return await invoke("plugin:askit|
|
|
23
|
-
|
|
21
|
+
async function renameAgentStream(streamId, newName) {
|
|
22
|
+
return await invoke("plugin:askit|rename_agent_stream", {
|
|
23
|
+
streamId,
|
|
24
24
|
newName,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
async function
|
|
28
|
-
return await invoke("plugin:askit|
|
|
27
|
+
async function uniqueStreamName(name) {
|
|
28
|
+
return await invoke("plugin:askit|unique_stream_name", { name });
|
|
29
29
|
}
|
|
30
|
-
async function
|
|
31
|
-
await invoke("plugin:askit|
|
|
30
|
+
async function addAgentStream(AgentStream) {
|
|
31
|
+
await invoke("plugin:askit|add_agent_stream", { AgentStream });
|
|
32
32
|
}
|
|
33
|
-
async function
|
|
34
|
-
await invoke("plugin:askit|
|
|
33
|
+
async function removeAgentStream(id) {
|
|
34
|
+
await invoke("plugin:askit|remove_agent_stream", { id });
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
37
|
-
await invoke("plugin:askit|
|
|
36
|
+
async function insertAgentStream(AgentStream) {
|
|
37
|
+
await invoke("plugin:askit|insert_agent_stream", { AgentStream });
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
40
|
-
return await invoke("plugin:askit|
|
|
39
|
+
async function copySubStream(agents, channels) {
|
|
40
|
+
return await invoke("plugin:askit|copy_sub_stream", {
|
|
41
|
+
agents,
|
|
42
|
+
channels,
|
|
43
|
+
});
|
|
41
44
|
}
|
|
42
|
-
async function
|
|
43
|
-
await invoke("plugin:askit|
|
|
45
|
+
async function startAgentStream(id) {
|
|
46
|
+
await invoke("plugin:askit|start_agent_stream", { id });
|
|
44
47
|
}
|
|
45
|
-
async function
|
|
46
|
-
await invoke("plugin:askit|
|
|
48
|
+
async function stopAgentStream(id) {
|
|
49
|
+
await invoke("plugin:askit|stop_agent_stream", { id });
|
|
47
50
|
}
|
|
48
|
-
//
|
|
49
|
-
async function
|
|
50
|
-
return await invoke("plugin:askit|
|
|
51
|
+
// agents
|
|
52
|
+
async function newAgentSpec(defName) {
|
|
53
|
+
return await invoke("plugin:askit|new_agent_spec", { defName });
|
|
51
54
|
}
|
|
52
|
-
async function
|
|
53
|
-
await invoke("plugin:askit|
|
|
55
|
+
async function addAgent(streamId, spec) {
|
|
56
|
+
await invoke("plugin:askit|add_agent", {
|
|
57
|
+
streamId,
|
|
58
|
+
spec,
|
|
59
|
+
});
|
|
54
60
|
}
|
|
55
|
-
async function
|
|
56
|
-
await invoke("plugin:askit|
|
|
61
|
+
async function removeAgent(streamId, agentId) {
|
|
62
|
+
await invoke("plugin:askit|remove_agent", {
|
|
63
|
+
streamId,
|
|
64
|
+
agentId,
|
|
65
|
+
});
|
|
57
66
|
}
|
|
58
|
-
//
|
|
59
|
-
async function
|
|
60
|
-
await invoke("plugin:askit|
|
|
67
|
+
// channel
|
|
68
|
+
async function addChannel(streamId, channel) {
|
|
69
|
+
await invoke("plugin:askit|add_channel", {
|
|
70
|
+
streamId,
|
|
71
|
+
channel,
|
|
72
|
+
});
|
|
61
73
|
}
|
|
62
|
-
async function
|
|
63
|
-
await invoke("plugin:askit|
|
|
74
|
+
async function removeChannel(streamId, channelId) {
|
|
75
|
+
await invoke("plugin:askit|remove_channel", {
|
|
76
|
+
streamId,
|
|
77
|
+
channelId,
|
|
78
|
+
});
|
|
64
79
|
}
|
|
65
80
|
// agent
|
|
66
81
|
async function startAgent(agentId) {
|
|
@@ -89,10 +104,10 @@ async function setGlobalConfigs(defName, configs) {
|
|
|
89
104
|
async function setGlobalConfigsMap(configs) {
|
|
90
105
|
await invoke("plugin:askit|set_global_configs_map", { configs });
|
|
91
106
|
}
|
|
92
|
-
async function
|
|
93
|
-
return await invoke("plugin:askit|
|
|
107
|
+
async function getAgentConfigSpecs(defName) {
|
|
108
|
+
return await invoke("plugin:askit|get_agent_config_specs", {
|
|
94
109
|
defName,
|
|
95
110
|
});
|
|
96
111
|
}
|
|
97
112
|
|
|
98
|
-
export {
|
|
113
|
+
export { addAgent, addAgentStream, addChannel, copySubStream, getAgentConfigSpecs, getAgentDefinition, getAgentDefinitions, getAgentSpec, getAgentStreams, getGlobalConfigs, getGlobalConfigsMap, insertAgentStream, newAgentSpec, newAgentStream, removeAgent, removeAgentStream, removeChannel, renameAgentStream, setAgentConfigs, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentStream, stopAgent, stopAgentStream, uniqueStreamName, writeBoard };
|