tauri-plugin-askit-api 0.6.0 → 0.7.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 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
- // flow
17
- async function getAgentFlows() {
18
- return await core.invoke("plugin:askit|get_agent_flows", {});
16
+ // stream
17
+ async function getAgentStreams() {
18
+ return await core.invoke("plugin:askit|get_agent_streams", {});
19
19
  }
20
- async function newAgentFlow(flowName) {
21
- return await core.invoke("plugin:askit|new_agent_flow", { flowName });
20
+ async function newAgentStream(streamName) {
21
+ return await core.invoke("plugin:askit|new_agent_stream", { streamName });
22
22
  }
23
- async function renameAgentFlow(flowId, newName) {
24
- return await core.invoke("plugin:askit|rename_agent_flow", {
25
- flowId,
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 uniqueFlowName(name) {
30
- return await core.invoke("plugin:askit|unique_flow_name", { name });
29
+ async function uniqueStreamName(name) {
30
+ return await core.invoke("plugin:askit|unique_stream_name", { name });
31
31
  }
32
- async function addAgentFlow(agentFlow) {
33
- await core.invoke("plugin:askit|add_agent_flow", { agentFlow });
32
+ async function addAgentStream(AgentStream) {
33
+ await core.invoke("plugin:askit|add_agent_stream", { AgentStream });
34
34
  }
35
- async function removeAgentFlow(id) {
36
- await core.invoke("plugin:askit|remove_agent_flow", { id });
35
+ async function removeAgentStream(id) {
36
+ await core.invoke("plugin:askit|remove_agent_stream", { id });
37
37
  }
38
- async function insertAgentFlow(agentFlow) {
39
- await core.invoke("plugin:askit|insert_agent_flow", { agentFlow });
38
+ async function insertAgentStream(AgentStream) {
39
+ await core.invoke("plugin:askit|insert_agent_stream", { AgentStream });
40
40
  }
41
- async function copySubFlow(nodes, edges) {
42
- return await core.invoke("plugin:askit|copy_sub_flow", { nodes, edges });
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 startAgentFlow(id) {
45
- await core.invoke("plugin:askit|start_agent_flow", { id });
47
+ async function startAgentStream(id) {
48
+ await core.invoke("plugin:askit|start_agent_stream", { id });
46
49
  }
47
- async function stopAgentFlow(id) {
48
- await core.invoke("plugin:askit|stop_agent_flow", { id });
50
+ async function stopAgentStream(id) {
51
+ await core.invoke("plugin:askit|stop_agent_stream", { id });
49
52
  }
50
- // nodes
51
- async function newAgentFlowNode(defName) {
52
- return await core.invoke("plugin:askit|new_agent_flow_node", { defName });
53
+ // agents
54
+ async function newAgentSpec(defName) {
55
+ return await core.invoke("plugin:askit|new_agent_spec", { defName });
53
56
  }
54
- async function addAgentFlowNode(flowId, node) {
55
- await core.invoke("plugin:askit|add_agent_flow_node", { flowId, node });
57
+ async function addAgent(streamId, spec) {
58
+ await core.invoke("plugin:askit|add_agent", {
59
+ streamId,
60
+ spec,
61
+ });
56
62
  }
57
- async function removeAgentFlowNode(flowId, nodeId) {
58
- await core.invoke("plugin:askit|remove_agent_flow_node", { flowId, nodeId });
63
+ async function removeAgent(streamId, agentId) {
64
+ await core.invoke("plugin:askit|remove_agent", {
65
+ streamId,
66
+ agentId,
67
+ });
59
68
  }
60
- // edge
61
- async function addAgentFlowEdge(flowId, edge) {
62
- await core.invoke("plugin:askit|add_agent_flow_edge", { flowId, edge });
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 removeAgentFlowEdge(flowId, edgeId) {
65
- await core.invoke("plugin:askit|remove_agent_flow_edge", { flowId, edgeId });
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 getAgentDefaultConfigs(defName) {
95
- return await core.invoke("plugin:askit|get_agent_default_configs", {
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.addAgentFlow = addAgentFlow;
101
- exports.addAgentFlowEdge = addAgentFlowEdge;
102
- exports.addAgentFlowNode = addAgentFlowNode;
103
- exports.copySubFlow = copySubFlow;
104
- exports.getAgentDefaultConfigs = getAgentDefaultConfigs;
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.insertAgentFlow = insertAgentFlow;
112
- exports.newAgentFlow = newAgentFlow;
113
- exports.newAgentFlowNode = newAgentFlowNode;
114
- exports.removeAgentFlow = removeAgentFlow;
115
- exports.removeAgentFlowEdge = removeAgentFlowEdge;
116
- exports.removeAgentFlowNode = removeAgentFlowNode;
117
- exports.renameAgentFlow = renameAgentFlow;
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.startAgentFlow = startAgentFlow;
137
+ exports.startAgentStream = startAgentStream;
123
138
  exports.stopAgent = stopAgent;
124
- exports.stopAgentFlow = stopAgentFlow;
125
- exports.uniqueFlowName = uniqueFlowName;
139
+ exports.stopAgentStream = stopAgentStream;
140
+ exports.uniqueStreamName = uniqueStreamName;
126
141
  exports.writeBoard = writeBoard;
@@ -8,9 +8,8 @@ export type AgentDefinition = {
8
8
  category?: string | null;
9
9
  inputs?: string[] | null;
10
10
  outputs?: string[] | null;
11
- default_configs?: AgentConfigSpecs | null;
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
+ hideTitle?: 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 AgentDisplayConfigSpecs = Record<string, AgentDisplayConfigSpec>;
27
- export type AgentDisplayConfigSpec = {
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
- nodes: AgentFlowNode[];
40
- edges: AgentFlowEdge[];
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
- display_config_specs?: AgentDisplayConfigSpecs | null;
52
- };
53
- export type AgentFlowNodeExtensions = Record<string, any>;
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
- agent_flows: AgentFlow[];
79
- };
80
- export type ConfigMessage = {
81
- agent_id: string;
82
- key: string;
83
- value: any;
66
+ agent_streams: AgentStream[];
84
67
  };
85
- export type DisplayMessage = {
86
- agent_id: string;
68
+ export type BoardMessage = {
87
69
  key: string;
88
70
  value: any;
89
71
  };
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 getAgentFlows(): Promise<AgentFlows>;
105
- export declare function newAgentFlow(flowName: string): Promise<AgentFlow>;
106
- export declare function renameAgentFlow(flowId: string, newName: string): Promise<string>;
107
- export declare function uniqueFlowName(name: string): Promise<string>;
108
- export declare function addAgentFlow(agentFlow: AgentFlow): Promise<void>;
109
- export declare function removeAgentFlow(id: string): Promise<void>;
110
- export declare function insertAgentFlow(agentFlow: AgentFlow): Promise<void>;
111
- export declare function copySubFlow(nodes: AgentFlowNode[], edges: AgentFlowEdge[]): Promise<[AgentFlowNode[], AgentFlowEdge[]]>;
112
- export declare function startAgentFlow(id: string): Promise<void>;
113
- export declare function stopAgentFlow(id: string): Promise<void>;
114
- export declare function newAgentFlowNode(defName: string): Promise<AgentFlowNode>;
115
- export declare function addAgentFlowNode(flowId: string, node: AgentFlowNode): Promise<void>;
116
- export declare function removeAgentFlowNode(flowId: string, nodeId: string): Promise<void>;
117
- export declare function addAgentFlowEdge(flowId: string, edge: AgentFlowEdge): Promise<void>;
118
- export declare function removeAgentFlowEdge(flowId: string, edgeId: string): Promise<void>;
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 getAgentDefaultConfigs(defName: string): Promise<AgentConfigSpecs | null>;
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
- // flow
15
- async function getAgentFlows() {
16
- return await invoke("plugin:askit|get_agent_flows", {});
14
+ // stream
15
+ async function getAgentStreams() {
16
+ return await invoke("plugin:askit|get_agent_streams", {});
17
17
  }
18
- async function newAgentFlow(flowName) {
19
- return await invoke("plugin:askit|new_agent_flow", { flowName });
18
+ async function newAgentStream(streamName) {
19
+ return await invoke("plugin:askit|new_agent_stream", { streamName });
20
20
  }
21
- async function renameAgentFlow(flowId, newName) {
22
- return await invoke("plugin:askit|rename_agent_flow", {
23
- flowId,
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 uniqueFlowName(name) {
28
- return await invoke("plugin:askit|unique_flow_name", { name });
27
+ async function uniqueStreamName(name) {
28
+ return await invoke("plugin:askit|unique_stream_name", { name });
29
29
  }
30
- async function addAgentFlow(agentFlow) {
31
- await invoke("plugin:askit|add_agent_flow", { agentFlow });
30
+ async function addAgentStream(AgentStream) {
31
+ await invoke("plugin:askit|add_agent_stream", { AgentStream });
32
32
  }
33
- async function removeAgentFlow(id) {
34
- await invoke("plugin:askit|remove_agent_flow", { id });
33
+ async function removeAgentStream(id) {
34
+ await invoke("plugin:askit|remove_agent_stream", { id });
35
35
  }
36
- async function insertAgentFlow(agentFlow) {
37
- await invoke("plugin:askit|insert_agent_flow", { agentFlow });
36
+ async function insertAgentStream(AgentStream) {
37
+ await invoke("plugin:askit|insert_agent_stream", { AgentStream });
38
38
  }
39
- async function copySubFlow(nodes, edges) {
40
- return await invoke("plugin:askit|copy_sub_flow", { nodes, edges });
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 startAgentFlow(id) {
43
- await invoke("plugin:askit|start_agent_flow", { id });
45
+ async function startAgentStream(id) {
46
+ await invoke("plugin:askit|start_agent_stream", { id });
44
47
  }
45
- async function stopAgentFlow(id) {
46
- await invoke("plugin:askit|stop_agent_flow", { id });
48
+ async function stopAgentStream(id) {
49
+ await invoke("plugin:askit|stop_agent_stream", { id });
47
50
  }
48
- // nodes
49
- async function newAgentFlowNode(defName) {
50
- return await invoke("plugin:askit|new_agent_flow_node", { defName });
51
+ // agents
52
+ async function newAgentSpec(defName) {
53
+ return await invoke("plugin:askit|new_agent_spec", { defName });
51
54
  }
52
- async function addAgentFlowNode(flowId, node) {
53
- await invoke("plugin:askit|add_agent_flow_node", { flowId, node });
55
+ async function addAgent(streamId, spec) {
56
+ await invoke("plugin:askit|add_agent", {
57
+ streamId,
58
+ spec,
59
+ });
54
60
  }
55
- async function removeAgentFlowNode(flowId, nodeId) {
56
- await invoke("plugin:askit|remove_agent_flow_node", { flowId, nodeId });
61
+ async function removeAgent(streamId, agentId) {
62
+ await invoke("plugin:askit|remove_agent", {
63
+ streamId,
64
+ agentId,
65
+ });
57
66
  }
58
- // edge
59
- async function addAgentFlowEdge(flowId, edge) {
60
- await invoke("plugin:askit|add_agent_flow_edge", { flowId, edge });
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 removeAgentFlowEdge(flowId, edgeId) {
63
- await invoke("plugin:askit|remove_agent_flow_edge", { flowId, edgeId });
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 getAgentDefaultConfigs(defName) {
93
- return await invoke("plugin:askit|get_agent_default_configs", {
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 { addAgentFlow, addAgentFlowEdge, addAgentFlowNode, copySubFlow, getAgentDefaultConfigs, getAgentDefinition, getAgentDefinitions, getAgentFlows, getAgentSpec, getGlobalConfigs, getGlobalConfigsMap, insertAgentFlow, newAgentFlow, newAgentFlowNode, removeAgentFlow, removeAgentFlowEdge, removeAgentFlowNode, renameAgentFlow, setAgentConfigs, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentFlow, stopAgent, stopAgentFlow, uniqueFlowName, writeBoard };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-askit-api",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "author": "Akira Ishino",
6
6
  "description": "Tauri plugin for Agent Stream Kit",