tauri-plugin-askit-api 0.7.1 → 0.8.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
@@ -14,30 +14,36 @@ async function getAgentSpec(agentId) {
14
14
  return await core.invoke("plugin:askit|get_agent_spec", { agentId });
15
15
  }
16
16
  // stream
17
- async function getAgentStreams() {
18
- return await core.invoke("plugin:askit|get_agent_streams", {});
17
+ async function getAgentStreamInfo(id) {
18
+ return await core.invoke("plugin:askit|get_agent_stream_info", { id });
19
19
  }
20
- async function newAgentStream(streamName) {
21
- return await core.invoke("plugin:askit|new_agent_stream", { streamName });
20
+ async function getAgentStreamInfos() {
21
+ return await core.invoke("plugin:askit|get_agent_stream_infos", {});
22
22
  }
23
- async function renameAgentStream(streamId, newName) {
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
- streamId,
26
- newName,
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(AgentStream) {
33
- await core.invoke("plugin:askit|add_agent_stream", { AgentStream });
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 insertAgentStream(AgentStream) {
39
- await core.invoke("plugin:askit|insert_agent_stream", { AgentStream });
40
- }
41
47
  async function copySubStream(agents, channels) {
42
48
  return await core.invoke("plugin:askit|copy_sub_stream", {
43
49
  agents,
@@ -106,24 +112,19 @@ async function setGlobalConfigs(defName, configs) {
106
112
  async function setGlobalConfigsMap(configs) {
107
113
  await core.invoke("plugin:askit|set_global_configs_map", { configs });
108
114
  }
109
- async function getAgentConfigSpecs(defName) {
110
- return await core.invoke("plugin:askit|get_agent_config_specs", {
111
- defName,
112
- });
113
- }
114
115
 
115
116
  exports.addAgent = addAgent;
116
117
  exports.addAgentStream = addAgentStream;
117
118
  exports.addChannel = addChannel;
118
119
  exports.copySubStream = copySubStream;
119
- exports.getAgentConfigSpecs = getAgentConfigSpecs;
120
120
  exports.getAgentDefinition = getAgentDefinition;
121
121
  exports.getAgentDefinitions = getAgentDefinitions;
122
122
  exports.getAgentSpec = getAgentSpec;
123
- exports.getAgentStreams = getAgentStreams;
123
+ exports.getAgentStreamInfo = getAgentStreamInfo;
124
+ exports.getAgentStreamInfos = getAgentStreamInfos;
125
+ exports.getAgentStreamSpec = getAgentStreamSpec;
124
126
  exports.getGlobalConfigs = getGlobalConfigs;
125
127
  exports.getGlobalConfigsMap = getGlobalConfigsMap;
126
- exports.insertAgentStream = insertAgentStream;
127
128
  exports.newAgentSpec = newAgentSpec;
128
129
  exports.newAgentStream = newAgentStream;
129
130
  exports.removeAgent = removeAgent;
@@ -131,6 +132,7 @@ exports.removeAgentStream = removeAgentStream;
131
132
  exports.removeChannel = removeChannel;
132
133
  exports.renameAgentStream = renameAgentStream;
133
134
  exports.setAgentConfigs = setAgentConfigs;
135
+ exports.setAgentStreamSpec = setAgentStreamSpec;
134
136
  exports.setGlobalConfigs = setGlobalConfigs;
135
137
  exports.setGlobalConfigsMap = setGlobalConfigsMap;
136
138
  exports.startAgent = startAgent;
@@ -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?: AgentGlobalConfigSpecs | null;
17
+ global_configs?: AgentGlobalConfigs | null;
13
18
  native_thread?: boolean | null;
14
19
  };
15
20
  export type AgentConfigSpecs = Record<string, AgentConfigSpec>;
16
- export type AgentGlobalConfigSpecs = Record<string, AgentConfigSpec>;
21
+ export type AgentGlobalConfigs = Record<string, AgentConfigSpec>;
17
22
  export type AgentConfigSpec = {
18
23
  value: any;
19
- type: AgentConfigValueType | null;
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 AgentConfigValueType = string;
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,7 +45,7 @@ export type AgentSpec = {
42
45
  outputs?: string[] | null;
43
46
  configs?: AgentConfigs | null;
44
47
  config_specs?: AgentConfigSpecs | null;
45
- enabled?: boolean | null;
48
+ disabled?: boolean | null;
46
49
  } & AgentSpecExtensions;
47
50
  export type ChannelSpec = {
48
51
  id: string;
@@ -56,15 +59,6 @@ export type Viewport = {
56
59
  y: number;
57
60
  zoom: number;
58
61
  };
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
62
  export type BoardMessage = {
69
63
  key: string;
70
64
  value: any;
@@ -72,13 +66,15 @@ export type BoardMessage = {
72
66
  export declare function getAgentDefinition(): Promise<AgentDefinition | null>;
73
67
  export declare function getAgentDefinitions(): Promise<AgentDefinitions>;
74
68
  export declare function getAgentSpec(agentId: string): Promise<AgentSpec | null>;
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>;
69
+ export declare function getAgentStreamInfo(id: string): Promise<AgentStreamInfo | null>;
70
+ export declare function getAgentStreamInfos(): Promise<AgentStreamInfo[]>;
71
+ export declare function getAgentStreamSpec(id: string): Promise<AgentStreamSpec | null>;
72
+ export declare function setAgentStreamSpec(id: string, spec: AgentStreamSpec): Promise<void>;
73
+ export declare function newAgentStream(name: string): Promise<[string, string]>;
74
+ export declare function renameAgentStream(id: string, name: string): Promise<string>;
78
75
  export declare function uniqueStreamName(name: string): Promise<string>;
79
- export declare function addAgentStream(AgentStream: AgentStream): Promise<void>;
76
+ export declare function addAgentStream(name: string, spec: AgentStreamSpec): Promise<string>;
80
77
  export declare function removeAgentStream(id: string): Promise<void>;
81
- export declare function insertAgentStream(AgentStream: AgentStream): Promise<void>;
82
78
  export declare function copySubStream(agents: AgentSpec[], channels: ChannelSpec[]): Promise<[AgentSpec[], ChannelSpec[]]>;
83
79
  export declare function startAgentStream(id: string): Promise<void>;
84
80
  export declare function stopAgentStream(id: string): Promise<void>;
@@ -95,4 +91,3 @@ export declare function getGlobalConfigs(defName: string): Promise<AgentConfigs
95
91
  export declare function getGlobalConfigsMap(): Promise<AgentConfigsMap>;
96
92
  export declare function setGlobalConfigs(defName: string, configs: AgentConfigs): Promise<void>;
97
93
  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,30 +12,36 @@ async function getAgentSpec(agentId) {
12
12
  return await invoke("plugin:askit|get_agent_spec", { agentId });
13
13
  }
14
14
  // stream
15
- async function getAgentStreams() {
16
- return await invoke("plugin:askit|get_agent_streams", {});
15
+ async function getAgentStreamInfo(id) {
16
+ return await invoke("plugin:askit|get_agent_stream_info", { id });
17
17
  }
18
- async function newAgentStream(streamName) {
19
- return await invoke("plugin:askit|new_agent_stream", { streamName });
18
+ async function getAgentStreamInfos() {
19
+ return await invoke("plugin:askit|get_agent_stream_infos", {});
20
20
  }
21
- async function renameAgentStream(streamId, newName) {
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
- streamId,
24
- newName,
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(AgentStream) {
31
- await invoke("plugin:askit|add_agent_stream", { AgentStream });
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 insertAgentStream(AgentStream) {
37
- await invoke("plugin:askit|insert_agent_stream", { AgentStream });
38
- }
39
45
  async function copySubStream(agents, channels) {
40
46
  return await invoke("plugin:askit|copy_sub_stream", {
41
47
  agents,
@@ -104,10 +110,5 @@ async function setGlobalConfigs(defName, configs) {
104
110
  async function setGlobalConfigsMap(configs) {
105
111
  await invoke("plugin:askit|set_global_configs_map", { configs });
106
112
  }
107
- async function getAgentConfigSpecs(defName) {
108
- return await invoke("plugin:askit|get_agent_config_specs", {
109
- defName,
110
- });
111
- }
112
113
 
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 };
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-plugin-askit-api",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "license": "MIT OR Apache-2.0",
5
5
  "author": "Akira Ishino",
6
6
  "description": "Tauri plugin for Agent Stream Kit",