tauri-plugin-askit-api 0.7.1 → 0.9.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 +29 -26
- package/dist-js/index.d.ts +23 -29
- package/dist-js/index.js +25 -23
- package/package.json +1 -1
package/dist-js/index.cjs
CHANGED
|
@@ -14,32 +14,39 @@ async function getAgentSpec(agentId) {
|
|
|
14
14
|
return await core.invoke("plugin:askit|get_agent_spec", { agentId });
|
|
15
15
|
}
|
|
16
16
|
// stream
|
|
17
|
-
async function
|
|
18
|
-
return await core.invoke("plugin:askit|
|
|
17
|
+
async function getAgentStreamInfo(id) {
|
|
18
|
+
return await core.invoke("plugin:askit|get_agent_stream_info", { id });
|
|
19
19
|
}
|
|
20
|
-
async function
|
|
21
|
-
return await core.invoke("plugin:askit|
|
|
20
|
+
async function getAgentStreamInfos() {
|
|
21
|
+
return await core.invoke("plugin:askit|get_agent_stream_infos", {});
|
|
22
22
|
}
|
|
23
|
-
async function
|
|
23
|
+
async function getAgentStreamSpec(id) {
|
|
24
|
+
return await core.invoke("plugin:askit|get_agent_stream_spec", { id });
|
|
25
|
+
}
|
|
26
|
+
async function setAgentStreamSpec(id, spec) {
|
|
27
|
+
await core.invoke("plugin:askit|set_agent_stream_spec", { id, spec });
|
|
28
|
+
}
|
|
29
|
+
async function newAgentStream(name) {
|
|
30
|
+
return await core.invoke("plugin:askit|new_agent_stream", { name });
|
|
31
|
+
}
|
|
32
|
+
async function renameAgentStream(id, name) {
|
|
24
33
|
return await core.invoke("plugin:askit|rename_agent_stream", {
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
id,
|
|
35
|
+
name,
|
|
27
36
|
});
|
|
28
37
|
}
|
|
29
38
|
async function uniqueStreamName(name) {
|
|
30
39
|
return await core.invoke("plugin:askit|unique_stream_name", { name });
|
|
31
40
|
}
|
|
32
|
-
async function addAgentStream(
|
|
33
|
-
await core.invoke("plugin:askit|add_agent_stream", {
|
|
41
|
+
async function addAgentStream(name, spec) {
|
|
42
|
+
return await core.invoke("plugin:askit|add_agent_stream", { name, spec });
|
|
34
43
|
}
|
|
35
44
|
async function removeAgentStream(id) {
|
|
36
45
|
await core.invoke("plugin:askit|remove_agent_stream", { id });
|
|
37
46
|
}
|
|
38
|
-
async function
|
|
39
|
-
await core.invoke("plugin:askit|
|
|
40
|
-
|
|
41
|
-
async function copySubStream(agents, channels) {
|
|
42
|
-
return await core.invoke("plugin:askit|copy_sub_stream", {
|
|
47
|
+
async function addAgentsAndChannels(streamId, agents, channels) {
|
|
48
|
+
return await core.invoke("plugin:askit|add_agents_and_channels", {
|
|
49
|
+
streamId,
|
|
43
50
|
agents,
|
|
44
51
|
channels,
|
|
45
52
|
});
|
|
@@ -55,7 +62,7 @@ async function newAgentSpec(defName) {
|
|
|
55
62
|
return await core.invoke("plugin:askit|new_agent_spec", { defName });
|
|
56
63
|
}
|
|
57
64
|
async function addAgent(streamId, spec) {
|
|
58
|
-
await core.invoke("plugin:askit|add_agent", {
|
|
65
|
+
return await core.invoke("plugin:askit|add_agent", {
|
|
59
66
|
streamId,
|
|
60
67
|
spec,
|
|
61
68
|
});
|
|
@@ -73,10 +80,10 @@ async function addChannel(streamId, channel) {
|
|
|
73
80
|
channel,
|
|
74
81
|
});
|
|
75
82
|
}
|
|
76
|
-
async function removeChannel(streamId,
|
|
83
|
+
async function removeChannel(streamId, channel) {
|
|
77
84
|
await core.invoke("plugin:askit|remove_channel", {
|
|
78
85
|
streamId,
|
|
79
|
-
|
|
86
|
+
channel,
|
|
80
87
|
});
|
|
81
88
|
}
|
|
82
89
|
// agent
|
|
@@ -106,24 +113,19 @@ async function setGlobalConfigs(defName, configs) {
|
|
|
106
113
|
async function setGlobalConfigsMap(configs) {
|
|
107
114
|
await core.invoke("plugin:askit|set_global_configs_map", { configs });
|
|
108
115
|
}
|
|
109
|
-
async function getAgentConfigSpecs(defName) {
|
|
110
|
-
return await core.invoke("plugin:askit|get_agent_config_specs", {
|
|
111
|
-
defName,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
116
|
|
|
115
117
|
exports.addAgent = addAgent;
|
|
116
118
|
exports.addAgentStream = addAgentStream;
|
|
119
|
+
exports.addAgentsAndChannels = addAgentsAndChannels;
|
|
117
120
|
exports.addChannel = addChannel;
|
|
118
|
-
exports.copySubStream = copySubStream;
|
|
119
|
-
exports.getAgentConfigSpecs = getAgentConfigSpecs;
|
|
120
121
|
exports.getAgentDefinition = getAgentDefinition;
|
|
121
122
|
exports.getAgentDefinitions = getAgentDefinitions;
|
|
122
123
|
exports.getAgentSpec = getAgentSpec;
|
|
123
|
-
exports.
|
|
124
|
+
exports.getAgentStreamInfo = getAgentStreamInfo;
|
|
125
|
+
exports.getAgentStreamInfos = getAgentStreamInfos;
|
|
126
|
+
exports.getAgentStreamSpec = getAgentStreamSpec;
|
|
124
127
|
exports.getGlobalConfigs = getGlobalConfigs;
|
|
125
128
|
exports.getGlobalConfigsMap = getGlobalConfigsMap;
|
|
126
|
-
exports.insertAgentStream = insertAgentStream;
|
|
127
129
|
exports.newAgentSpec = newAgentSpec;
|
|
128
130
|
exports.newAgentStream = newAgentStream;
|
|
129
131
|
exports.removeAgent = removeAgent;
|
|
@@ -131,6 +133,7 @@ exports.removeAgentStream = removeAgentStream;
|
|
|
131
133
|
exports.removeChannel = removeChannel;
|
|
132
134
|
exports.renameAgentStream = renameAgentStream;
|
|
133
135
|
exports.setAgentConfigs = setAgentConfigs;
|
|
136
|
+
exports.setAgentStreamSpec = setAgentStreamSpec;
|
|
134
137
|
exports.setGlobalConfigs = setGlobalConfigs;
|
|
135
138
|
exports.setGlobalConfigsMap = setGlobalConfigsMap;
|
|
136
139
|
exports.startAgent = startAgent;
|
package/dist-js/index.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export type AgentStreamInfo = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
running: boolean;
|
|
5
|
+
run_on_start: boolean;
|
|
6
|
+
};
|
|
1
7
|
export type AgentDefinitions = Record<string, AgentDefinition>;
|
|
2
|
-
export type AgentGlobalConfigsMap = Record<string, AgentConfigs>;
|
|
3
8
|
export type AgentDefinition = {
|
|
4
9
|
kind: string;
|
|
5
10
|
name: string;
|
|
@@ -9,30 +14,28 @@ export type AgentDefinition = {
|
|
|
9
14
|
inputs?: string[] | null;
|
|
10
15
|
outputs?: string[] | null;
|
|
11
16
|
configs?: AgentConfigSpecs | null;
|
|
12
|
-
global_configs?:
|
|
17
|
+
global_configs?: AgentGlobalConfigs | null;
|
|
13
18
|
native_thread?: boolean | null;
|
|
14
19
|
};
|
|
15
20
|
export type AgentConfigSpecs = Record<string, AgentConfigSpec>;
|
|
16
|
-
export type
|
|
21
|
+
export type AgentGlobalConfigs = Record<string, AgentConfigSpec>;
|
|
17
22
|
export type AgentConfigSpec = {
|
|
18
23
|
value: any;
|
|
19
|
-
type:
|
|
24
|
+
type: string | null;
|
|
20
25
|
title?: string | null;
|
|
21
26
|
hide_title?: boolean | null;
|
|
22
27
|
description?: string | null;
|
|
23
28
|
hidden?: boolean | null;
|
|
24
29
|
readonly?: boolean | null;
|
|
25
30
|
};
|
|
26
|
-
export type
|
|
27
|
-
export type AgentStreams = Record<string, AgentStream>;
|
|
28
|
-
export type AgentStream = {
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
+
export type AgentStreamSpec = {
|
|
31
32
|
agents: AgentSpec[];
|
|
32
33
|
channels: ChannelSpec[];
|
|
34
|
+
run_on_start?: boolean | null;
|
|
33
35
|
viewport: Viewport | null;
|
|
34
36
|
};
|
|
35
37
|
export type AgentConfigsMap = Record<string, AgentConfigs>;
|
|
38
|
+
export type AgentGlobalConfigsMap = Record<string, AgentConfigs>;
|
|
36
39
|
export type AgentConfigs = Record<string, any>;
|
|
37
40
|
export type AgentSpecExtensions = Record<string, any>;
|
|
38
41
|
export type AgentSpec = {
|
|
@@ -42,10 +45,9 @@ export type AgentSpec = {
|
|
|
42
45
|
outputs?: string[] | null;
|
|
43
46
|
configs?: AgentConfigs | null;
|
|
44
47
|
config_specs?: AgentConfigSpecs | null;
|
|
45
|
-
|
|
48
|
+
disabled?: boolean | null;
|
|
46
49
|
} & AgentSpecExtensions;
|
|
47
50
|
export type ChannelSpec = {
|
|
48
|
-
id: string;
|
|
49
51
|
source: string;
|
|
50
52
|
source_handle: string | null;
|
|
51
53
|
target: string;
|
|
@@ -56,15 +58,6 @@ export type Viewport = {
|
|
|
56
58
|
y: number;
|
|
57
59
|
zoom: number;
|
|
58
60
|
};
|
|
59
|
-
export type CoreSettings = {
|
|
60
|
-
autostart: boolean;
|
|
61
|
-
shortcut_keys: Record<string, string>;
|
|
62
|
-
};
|
|
63
|
-
export type Settings = {
|
|
64
|
-
core: CoreSettings;
|
|
65
|
-
agents: Record<string, AgentDefinition>;
|
|
66
|
-
agent_streams: AgentStream[];
|
|
67
|
-
};
|
|
68
61
|
export type BoardMessage = {
|
|
69
62
|
key: string;
|
|
70
63
|
value: any;
|
|
@@ -72,21 +65,23 @@ export type BoardMessage = {
|
|
|
72
65
|
export declare function getAgentDefinition(): Promise<AgentDefinition | null>;
|
|
73
66
|
export declare function getAgentDefinitions(): Promise<AgentDefinitions>;
|
|
74
67
|
export declare function getAgentSpec(agentId: string): Promise<AgentSpec | null>;
|
|
75
|
-
export declare function
|
|
76
|
-
export declare function
|
|
77
|
-
export declare function
|
|
68
|
+
export declare function getAgentStreamInfo(id: string): Promise<AgentStreamInfo | null>;
|
|
69
|
+
export declare function getAgentStreamInfos(): Promise<AgentStreamInfo[]>;
|
|
70
|
+
export declare function getAgentStreamSpec(id: string): Promise<AgentStreamSpec | null>;
|
|
71
|
+
export declare function setAgentStreamSpec(id: string, spec: AgentStreamSpec): Promise<void>;
|
|
72
|
+
export declare function newAgentStream(name: string): Promise<[string, string]>;
|
|
73
|
+
export declare function renameAgentStream(id: string, name: string): Promise<string>;
|
|
78
74
|
export declare function uniqueStreamName(name: string): Promise<string>;
|
|
79
|
-
export declare function addAgentStream(
|
|
75
|
+
export declare function addAgentStream(name: string, spec: AgentStreamSpec): Promise<string>;
|
|
80
76
|
export declare function removeAgentStream(id: string): Promise<void>;
|
|
81
|
-
export declare function
|
|
82
|
-
export declare function copySubStream(agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
|
|
77
|
+
export declare function addAgentsAndChannels(streamId: string, agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
|
|
83
78
|
export declare function startAgentStream(id: string): Promise<void>;
|
|
84
79
|
export declare function stopAgentStream(id: string): Promise<void>;
|
|
85
80
|
export declare function newAgentSpec(defName: string): Promise<AgentSpec>;
|
|
86
|
-
export declare function addAgent(streamId: string, spec: AgentSpec): Promise<
|
|
81
|
+
export declare function addAgent(streamId: string, spec: AgentSpec): Promise<string>;
|
|
87
82
|
export declare function removeAgent(streamId: string, agentId: string): Promise<void>;
|
|
88
83
|
export declare function addChannel(streamId: string, channel: ChannelSpec): Promise<void>;
|
|
89
|
-
export declare function removeChannel(streamId: string,
|
|
84
|
+
export declare function removeChannel(streamId: string, channel: ChannelSpec): Promise<void>;
|
|
90
85
|
export declare function startAgent(agentId: string): Promise<void>;
|
|
91
86
|
export declare function stopAgent(agentId: string): Promise<void>;
|
|
92
87
|
export declare function writeBoard(board: string, message: string): Promise<void>;
|
|
@@ -95,4 +90,3 @@ export declare function getGlobalConfigs(defName: string): Promise<AgentConfigs
|
|
|
95
90
|
export declare function getGlobalConfigsMap(): Promise<AgentConfigsMap>;
|
|
96
91
|
export declare function setGlobalConfigs(defName: string, configs: AgentConfigs): Promise<void>;
|
|
97
92
|
export declare function setGlobalConfigsMap(configs: AgentConfigsMap): Promise<void>;
|
|
98
|
-
export declare function getAgentConfigSpecs(defName: string): Promise<AgentConfigSpecs | null>;
|
package/dist-js/index.js
CHANGED
|
@@ -12,32 +12,39 @@ async function getAgentSpec(agentId) {
|
|
|
12
12
|
return await invoke("plugin:askit|get_agent_spec", { agentId });
|
|
13
13
|
}
|
|
14
14
|
// stream
|
|
15
|
-
async function
|
|
16
|
-
return await invoke("plugin:askit|
|
|
15
|
+
async function getAgentStreamInfo(id) {
|
|
16
|
+
return await invoke("plugin:askit|get_agent_stream_info", { id });
|
|
17
17
|
}
|
|
18
|
-
async function
|
|
19
|
-
return await invoke("plugin:askit|
|
|
18
|
+
async function getAgentStreamInfos() {
|
|
19
|
+
return await invoke("plugin:askit|get_agent_stream_infos", {});
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function getAgentStreamSpec(id) {
|
|
22
|
+
return await invoke("plugin:askit|get_agent_stream_spec", { id });
|
|
23
|
+
}
|
|
24
|
+
async function setAgentStreamSpec(id, spec) {
|
|
25
|
+
await invoke("plugin:askit|set_agent_stream_spec", { id, spec });
|
|
26
|
+
}
|
|
27
|
+
async function newAgentStream(name) {
|
|
28
|
+
return await invoke("plugin:askit|new_agent_stream", { name });
|
|
29
|
+
}
|
|
30
|
+
async function renameAgentStream(id, name) {
|
|
22
31
|
return await invoke("plugin:askit|rename_agent_stream", {
|
|
23
|
-
|
|
24
|
-
|
|
32
|
+
id,
|
|
33
|
+
name,
|
|
25
34
|
});
|
|
26
35
|
}
|
|
27
36
|
async function uniqueStreamName(name) {
|
|
28
37
|
return await invoke("plugin:askit|unique_stream_name", { name });
|
|
29
38
|
}
|
|
30
|
-
async function addAgentStream(
|
|
31
|
-
await invoke("plugin:askit|add_agent_stream", {
|
|
39
|
+
async function addAgentStream(name, spec) {
|
|
40
|
+
return await invoke("plugin:askit|add_agent_stream", { name, spec });
|
|
32
41
|
}
|
|
33
42
|
async function removeAgentStream(id) {
|
|
34
43
|
await invoke("plugin:askit|remove_agent_stream", { id });
|
|
35
44
|
}
|
|
36
|
-
async function
|
|
37
|
-
await invoke("plugin:askit|
|
|
38
|
-
|
|
39
|
-
async function copySubStream(agents, channels) {
|
|
40
|
-
return await invoke("plugin:askit|copy_sub_stream", {
|
|
45
|
+
async function addAgentsAndChannels(streamId, agents, channels) {
|
|
46
|
+
return await invoke("plugin:askit|add_agents_and_channels", {
|
|
47
|
+
streamId,
|
|
41
48
|
agents,
|
|
42
49
|
channels,
|
|
43
50
|
});
|
|
@@ -53,7 +60,7 @@ async function newAgentSpec(defName) {
|
|
|
53
60
|
return await invoke("plugin:askit|new_agent_spec", { defName });
|
|
54
61
|
}
|
|
55
62
|
async function addAgent(streamId, spec) {
|
|
56
|
-
await invoke("plugin:askit|add_agent", {
|
|
63
|
+
return await invoke("plugin:askit|add_agent", {
|
|
57
64
|
streamId,
|
|
58
65
|
spec,
|
|
59
66
|
});
|
|
@@ -71,10 +78,10 @@ async function addChannel(streamId, channel) {
|
|
|
71
78
|
channel,
|
|
72
79
|
});
|
|
73
80
|
}
|
|
74
|
-
async function removeChannel(streamId,
|
|
81
|
+
async function removeChannel(streamId, channel) {
|
|
75
82
|
await invoke("plugin:askit|remove_channel", {
|
|
76
83
|
streamId,
|
|
77
|
-
|
|
84
|
+
channel,
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
87
|
// agent
|
|
@@ -104,10 +111,5 @@ async function setGlobalConfigs(defName, configs) {
|
|
|
104
111
|
async function setGlobalConfigsMap(configs) {
|
|
105
112
|
await invoke("plugin:askit|set_global_configs_map", { configs });
|
|
106
113
|
}
|
|
107
|
-
async function getAgentConfigSpecs(defName) {
|
|
108
|
-
return await invoke("plugin:askit|get_agent_config_specs", {
|
|
109
|
-
defName,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
114
|
|
|
113
|
-
export { addAgent, addAgentStream,
|
|
115
|
+
export { addAgent, addAgentStream, addAgentsAndChannels, addChannel, getAgentDefinition, getAgentDefinitions, getAgentSpec, getAgentStreamInfo, getAgentStreamInfos, getAgentStreamSpec, getGlobalConfigs, getGlobalConfigsMap, newAgentSpec, newAgentStream, removeAgent, removeAgentStream, removeChannel, renameAgentStream, setAgentConfigs, setAgentStreamSpec, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentStream, stopAgent, stopAgentStream, uniqueStreamName, writeBoard };
|