tauri-plugin-askit-api 0.8.0 → 0.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.
package/dist-js/index.cjs CHANGED
@@ -13,6 +13,12 @@ async function getAgentDefinitions() {
13
13
  async function getAgentSpec(agentId) {
14
14
  return await core.invoke("plugin:askit|get_agent_spec", { agentId });
15
15
  }
16
+ async function updateAgentSpec(agentId, value) {
17
+ await core.invoke("plugin:askit|update_agent_spec", {
18
+ agentId,
19
+ value,
20
+ });
21
+ }
16
22
  // stream
17
23
  async function getAgentStreamInfo(id) {
18
24
  return await core.invoke("plugin:askit|get_agent_stream_info", { id });
@@ -23,8 +29,8 @@ async function getAgentStreamInfos() {
23
29
  async function getAgentStreamSpec(id) {
24
30
  return await core.invoke("plugin:askit|get_agent_stream_spec", { id });
25
31
  }
26
- async function setAgentStreamSpec(id, spec) {
27
- await core.invoke("plugin:askit|set_agent_stream_spec", { id, spec });
32
+ async function updateAgentStreamSpec(id, value) {
33
+ await core.invoke("plugin:askit|update_agent_stream_spec", { id, value });
28
34
  }
29
35
  async function newAgentStream(name) {
30
36
  return await core.invoke("plugin:askit|new_agent_stream", { name });
@@ -44,8 +50,9 @@ async function addAgentStream(name, spec) {
44
50
  async function removeAgentStream(id) {
45
51
  await core.invoke("plugin:askit|remove_agent_stream", { id });
46
52
  }
47
- async function copySubStream(agents, channels) {
48
- return await core.invoke("plugin:askit|copy_sub_stream", {
53
+ async function addAgentsAndChannels(streamId, agents, channels) {
54
+ return await core.invoke("plugin:askit|add_agents_and_channels", {
55
+ streamId,
49
56
  agents,
50
57
  channels,
51
58
  });
@@ -61,7 +68,7 @@ async function newAgentSpec(defName) {
61
68
  return await core.invoke("plugin:askit|new_agent_spec", { defName });
62
69
  }
63
70
  async function addAgent(streamId, spec) {
64
- await core.invoke("plugin:askit|add_agent", {
71
+ return await core.invoke("plugin:askit|add_agent", {
65
72
  streamId,
66
73
  spec,
67
74
  });
@@ -79,10 +86,10 @@ async function addChannel(streamId, channel) {
79
86
  channel,
80
87
  });
81
88
  }
82
- async function removeChannel(streamId, channelId) {
89
+ async function removeChannel(streamId, channel) {
83
90
  await core.invoke("plugin:askit|remove_channel", {
84
91
  streamId,
85
- channelId,
92
+ channel,
86
93
  });
87
94
  }
88
95
  // agent
@@ -115,8 +122,8 @@ async function setGlobalConfigsMap(configs) {
115
122
 
116
123
  exports.addAgent = addAgent;
117
124
  exports.addAgentStream = addAgentStream;
125
+ exports.addAgentsAndChannels = addAgentsAndChannels;
118
126
  exports.addChannel = addChannel;
119
- exports.copySubStream = copySubStream;
120
127
  exports.getAgentDefinition = getAgentDefinition;
121
128
  exports.getAgentDefinitions = getAgentDefinitions;
122
129
  exports.getAgentSpec = getAgentSpec;
@@ -132,7 +139,6 @@ exports.removeAgentStream = removeAgentStream;
132
139
  exports.removeChannel = removeChannel;
133
140
  exports.renameAgentStream = renameAgentStream;
134
141
  exports.setAgentConfigs = setAgentConfigs;
135
- exports.setAgentStreamSpec = setAgentStreamSpec;
136
142
  exports.setGlobalConfigs = setGlobalConfigs;
137
143
  exports.setGlobalConfigsMap = setGlobalConfigsMap;
138
144
  exports.startAgent = startAgent;
@@ -140,4 +146,6 @@ exports.startAgentStream = startAgentStream;
140
146
  exports.stopAgent = stopAgent;
141
147
  exports.stopAgentStream = stopAgentStream;
142
148
  exports.uniqueStreamName = uniqueStreamName;
149
+ exports.updateAgentSpec = updateAgentSpec;
150
+ exports.updateAgentStreamSpec = updateAgentStreamSpec;
143
151
  exports.writeBoard = writeBoard;
@@ -2,7 +2,6 @@ export type AgentStreamInfo = {
2
2
  id: string;
3
3
  name: string;
4
4
  running: boolean;
5
- run_on_start: boolean;
6
5
  };
7
6
  export type AgentDefinitions = Record<string, AgentDefinition>;
8
7
  export type AgentDefinition = {
@@ -31,7 +30,6 @@ export type AgentConfigSpec = {
31
30
  export type AgentStreamSpec = {
32
31
  agents: AgentSpec[];
33
32
  channels: ChannelSpec[];
34
- run_on_start?: boolean | null;
35
33
  viewport: Viewport | null;
36
34
  };
37
35
  export type AgentConfigsMap = Record<string, AgentConfigs>;
@@ -48,7 +46,6 @@ export type AgentSpec = {
48
46
  disabled?: boolean | null;
49
47
  } & AgentSpecExtensions;
50
48
  export type ChannelSpec = {
51
- id: string;
52
49
  source: string;
53
50
  source_handle: string | null;
54
51
  target: string;
@@ -66,23 +63,24 @@ export type BoardMessage = {
66
63
  export declare function getAgentDefinition(): Promise<AgentDefinition | null>;
67
64
  export declare function getAgentDefinitions(): Promise<AgentDefinitions>;
68
65
  export declare function getAgentSpec(agentId: string): Promise<AgentSpec | null>;
66
+ export declare function updateAgentSpec(agentId: string, value: Partial<AgentSpec>): Promise<void>;
69
67
  export declare function getAgentStreamInfo(id: string): Promise<AgentStreamInfo | null>;
70
68
  export declare function getAgentStreamInfos(): Promise<AgentStreamInfo[]>;
71
69
  export declare function getAgentStreamSpec(id: string): Promise<AgentStreamSpec | null>;
72
- export declare function setAgentStreamSpec(id: string, spec: AgentStreamSpec): Promise<void>;
70
+ export declare function updateAgentStreamSpec(id: string, value: Partial<AgentStreamSpec>): Promise<void>;
73
71
  export declare function newAgentStream(name: string): Promise<[string, string]>;
74
72
  export declare function renameAgentStream(id: string, name: string): Promise<string>;
75
73
  export declare function uniqueStreamName(name: string): Promise<string>;
76
74
  export declare function addAgentStream(name: string, spec: AgentStreamSpec): Promise<string>;
77
75
  export declare function removeAgentStream(id: string): Promise<void>;
78
- export declare function copySubStream(agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
76
+ export declare function addAgentsAndChannels(streamId: string, agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
79
77
  export declare function startAgentStream(id: string): Promise<void>;
80
78
  export declare function stopAgentStream(id: string): Promise<void>;
81
79
  export declare function newAgentSpec(defName: string): Promise<AgentSpec>;
82
- export declare function addAgent(streamId: string, spec: AgentSpec): Promise<void>;
80
+ export declare function addAgent(streamId: string, spec: AgentSpec): Promise<string>;
83
81
  export declare function removeAgent(streamId: string, agentId: string): Promise<void>;
84
82
  export declare function addChannel(streamId: string, channel: ChannelSpec): Promise<void>;
85
- export declare function removeChannel(streamId: string, channelId: string): Promise<void>;
83
+ export declare function removeChannel(streamId: string, channel: ChannelSpec): Promise<void>;
86
84
  export declare function startAgent(agentId: string): Promise<void>;
87
85
  export declare function stopAgent(agentId: string): Promise<void>;
88
86
  export declare function writeBoard(board: string, message: string): Promise<void>;
package/dist-js/index.js CHANGED
@@ -11,6 +11,12 @@ async function getAgentDefinitions() {
11
11
  async function getAgentSpec(agentId) {
12
12
  return await invoke("plugin:askit|get_agent_spec", { agentId });
13
13
  }
14
+ async function updateAgentSpec(agentId, value) {
15
+ await invoke("plugin:askit|update_agent_spec", {
16
+ agentId,
17
+ value,
18
+ });
19
+ }
14
20
  // stream
15
21
  async function getAgentStreamInfo(id) {
16
22
  return await invoke("plugin:askit|get_agent_stream_info", { id });
@@ -21,8 +27,8 @@ async function getAgentStreamInfos() {
21
27
  async function getAgentStreamSpec(id) {
22
28
  return await invoke("plugin:askit|get_agent_stream_spec", { id });
23
29
  }
24
- async function setAgentStreamSpec(id, spec) {
25
- await invoke("plugin:askit|set_agent_stream_spec", { id, spec });
30
+ async function updateAgentStreamSpec(id, value) {
31
+ await invoke("plugin:askit|update_agent_stream_spec", { id, value });
26
32
  }
27
33
  async function newAgentStream(name) {
28
34
  return await invoke("plugin:askit|new_agent_stream", { name });
@@ -42,8 +48,9 @@ async function addAgentStream(name, spec) {
42
48
  async function removeAgentStream(id) {
43
49
  await invoke("plugin:askit|remove_agent_stream", { id });
44
50
  }
45
- async function copySubStream(agents, channels) {
46
- return await invoke("plugin:askit|copy_sub_stream", {
51
+ async function addAgentsAndChannels(streamId, agents, channels) {
52
+ return await invoke("plugin:askit|add_agents_and_channels", {
53
+ streamId,
47
54
  agents,
48
55
  channels,
49
56
  });
@@ -59,7 +66,7 @@ async function newAgentSpec(defName) {
59
66
  return await invoke("plugin:askit|new_agent_spec", { defName });
60
67
  }
61
68
  async function addAgent(streamId, spec) {
62
- await invoke("plugin:askit|add_agent", {
69
+ return await invoke("plugin:askit|add_agent", {
63
70
  streamId,
64
71
  spec,
65
72
  });
@@ -77,10 +84,10 @@ async function addChannel(streamId, channel) {
77
84
  channel,
78
85
  });
79
86
  }
80
- async function removeChannel(streamId, channelId) {
87
+ async function removeChannel(streamId, channel) {
81
88
  await invoke("plugin:askit|remove_channel", {
82
89
  streamId,
83
- channelId,
90
+ channel,
84
91
  });
85
92
  }
86
93
  // agent
@@ -111,4 +118,4 @@ async function setGlobalConfigsMap(configs) {
111
118
  await invoke("plugin:askit|set_global_configs_map", { configs });
112
119
  }
113
120
 
114
- export { addAgent, addAgentStream, addChannel, copySubStream, getAgentDefinition, getAgentDefinitions, getAgentSpec, getAgentStreamInfo, getAgentStreamInfos, getAgentStreamSpec, getGlobalConfigs, getGlobalConfigsMap, newAgentSpec, newAgentStream, removeAgent, removeAgentStream, removeChannel, renameAgentStream, setAgentConfigs, setAgentStreamSpec, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentStream, stopAgent, stopAgentStream, uniqueStreamName, writeBoard };
121
+ export { addAgent, addAgentStream, addAgentsAndChannels, addChannel, getAgentDefinition, getAgentDefinitions, getAgentSpec, getAgentStreamInfo, getAgentStreamInfos, getAgentStreamSpec, getGlobalConfigs, getGlobalConfigsMap, newAgentSpec, newAgentStream, removeAgent, removeAgentStream, removeChannel, renameAgentStream, setAgentConfigs, setGlobalConfigs, setGlobalConfigsMap, startAgent, startAgentStream, stopAgent, stopAgentStream, uniqueStreamName, updateAgentSpec, updateAgentStreamSpec, writeBoard };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-askit-api",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "author": "Akira Ishino",
6
6
  "description": "Tauri plugin for Agent Stream Kit",