@uniqueli/openwork 0.2.1 → 0.2.3
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/README.md +13 -6
- package/bin/cli.js +15 -14
- package/out/main/index.js +2466 -409
- package/out/preload/index.js +67 -9
- package/out/renderer/assets/{index-BtAM3QNQ.css → index-BmPF126u.css} +586 -18
- package/out/renderer/assets/{index-BPV5Z3ZG.js → index-DTaVewa6.js} +1898 -644
- package/out/renderer/index.html +2 -2
- package/package.json +8 -7
- package/resources/README.md +0 -16
package/out/preload/index.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const electron = require("electron");
|
|
3
|
+
function ipcRequest(channel, ...args) {
|
|
4
|
+
return new Promise((resolve) => {
|
|
5
|
+
const responseChannel = `${channel}:result`;
|
|
6
|
+
const handler = (_, result) => {
|
|
7
|
+
electron.ipcRenderer.removeListener(responseChannel, handler);
|
|
8
|
+
resolve(result);
|
|
9
|
+
};
|
|
10
|
+
electron.ipcRenderer.once(responseChannel, handler);
|
|
11
|
+
electron.ipcRenderer.send(channel, ...args);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
3
14
|
const electronAPI = {
|
|
4
15
|
ipcRenderer: {
|
|
5
16
|
send: (channel, ...args) => electron.ipcRenderer.send(channel, ...args),
|
|
@@ -20,7 +31,7 @@ const electronAPI = {
|
|
|
20
31
|
const api = {
|
|
21
32
|
agent: {
|
|
22
33
|
// Send message and receive events via callback
|
|
23
|
-
invoke: (threadId, message, onEvent) => {
|
|
34
|
+
invoke: (threadId, message, onEvent, modelId) => {
|
|
24
35
|
const channel = `agent:stream:${threadId}`;
|
|
25
36
|
const handler = (_, data) => {
|
|
26
37
|
onEvent(data);
|
|
@@ -29,13 +40,13 @@ const api = {
|
|
|
29
40
|
}
|
|
30
41
|
};
|
|
31
42
|
electron.ipcRenderer.on(channel, handler);
|
|
32
|
-
electron.ipcRenderer.send("agent:invoke", { threadId, message });
|
|
43
|
+
electron.ipcRenderer.send("agent:invoke", { threadId, message, modelId });
|
|
33
44
|
return () => {
|
|
34
45
|
electron.ipcRenderer.removeListener(channel, handler);
|
|
35
46
|
};
|
|
36
47
|
},
|
|
37
48
|
// Stream agent events for useStream transport
|
|
38
|
-
streamAgent: (threadId, message, command, onEvent) => {
|
|
49
|
+
streamAgent: (threadId, message, command, onEvent, modelId) => {
|
|
39
50
|
const channel = `agent:stream:${threadId}`;
|
|
40
51
|
const handler = (_, data) => {
|
|
41
52
|
onEvent(data);
|
|
@@ -45,9 +56,9 @@ const api = {
|
|
|
45
56
|
};
|
|
46
57
|
electron.ipcRenderer.on(channel, handler);
|
|
47
58
|
if (command) {
|
|
48
|
-
electron.ipcRenderer.send("agent:resume", { threadId, command });
|
|
59
|
+
electron.ipcRenderer.send("agent:resume", { threadId, command, modelId });
|
|
49
60
|
} else {
|
|
50
|
-
electron.ipcRenderer.send("agent:invoke", { threadId, message });
|
|
61
|
+
electron.ipcRenderer.send("agent:invoke", { threadId, message, modelId });
|
|
51
62
|
}
|
|
52
63
|
return () => {
|
|
53
64
|
electron.ipcRenderer.removeListener(channel, handler);
|
|
@@ -116,14 +127,17 @@ const api = {
|
|
|
116
127
|
deleteApiKey: (provider) => {
|
|
117
128
|
return electron.ipcRenderer.invoke("models:deleteApiKey", provider);
|
|
118
129
|
},
|
|
119
|
-
getCustomApiConfig: () => {
|
|
120
|
-
return electron.ipcRenderer.invoke("models:getCustomApiConfig");
|
|
130
|
+
getCustomApiConfig: (id) => {
|
|
131
|
+
return electron.ipcRenderer.invoke("models:getCustomApiConfig", id);
|
|
132
|
+
},
|
|
133
|
+
getCustomApiConfigs: () => {
|
|
134
|
+
return electron.ipcRenderer.invoke("models:getCustomApiConfigs");
|
|
121
135
|
},
|
|
122
136
|
setCustomApiConfig: (config) => {
|
|
123
137
|
return electron.ipcRenderer.invoke("models:setCustomApiConfig", config);
|
|
124
138
|
},
|
|
125
|
-
deleteCustomApiConfig: () => {
|
|
126
|
-
return electron.ipcRenderer.invoke("models:deleteCustomApiConfig");
|
|
139
|
+
deleteCustomApiConfig: (id) => {
|
|
140
|
+
return electron.ipcRenderer.invoke("models:deleteCustomApiConfig", id);
|
|
127
141
|
}
|
|
128
142
|
},
|
|
129
143
|
workspace: {
|
|
@@ -155,6 +169,50 @@ const api = {
|
|
|
155
169
|
electron.ipcRenderer.removeListener("workspace:files-changed", handler);
|
|
156
170
|
};
|
|
157
171
|
}
|
|
172
|
+
},
|
|
173
|
+
skills: {
|
|
174
|
+
list: (params) => {
|
|
175
|
+
return ipcRequest("skills:list", params);
|
|
176
|
+
},
|
|
177
|
+
get: (skillId) => {
|
|
178
|
+
return ipcRequest("skills:get", { skillId });
|
|
179
|
+
},
|
|
180
|
+
create: (params) => {
|
|
181
|
+
return ipcRequest("skills:create", params);
|
|
182
|
+
},
|
|
183
|
+
update: (params) => {
|
|
184
|
+
return ipcRequest("skills:update", params);
|
|
185
|
+
},
|
|
186
|
+
delete: (skillId) => {
|
|
187
|
+
return ipcRequest("skills:delete", { skillId });
|
|
188
|
+
},
|
|
189
|
+
toggle: (skillId, enabled) => {
|
|
190
|
+
return ipcRequest("skills:toggle", { skillId, enabled });
|
|
191
|
+
},
|
|
192
|
+
setEnabled: (skillIds) => {
|
|
193
|
+
return ipcRequest("skills:setEnabled", { skillIds });
|
|
194
|
+
},
|
|
195
|
+
getConfig: () => {
|
|
196
|
+
return ipcRequest("skills:getConfig");
|
|
197
|
+
},
|
|
198
|
+
search: (query) => {
|
|
199
|
+
return ipcRequest("skills:search", { query });
|
|
200
|
+
},
|
|
201
|
+
export: () => {
|
|
202
|
+
return ipcRequest("skills:export");
|
|
203
|
+
},
|
|
204
|
+
import: (data) => {
|
|
205
|
+
return ipcRequest("skills:import", { data });
|
|
206
|
+
},
|
|
207
|
+
getStats: () => {
|
|
208
|
+
return ipcRequest("skills:getStats");
|
|
209
|
+
},
|
|
210
|
+
recordUsage: (skillId) => {
|
|
211
|
+
return ipcRequest("skills:recordUsage", { skillId });
|
|
212
|
+
},
|
|
213
|
+
getUsage: (skillId) => {
|
|
214
|
+
return ipcRequest("skills:getUsage", { skillId });
|
|
215
|
+
}
|
|
158
216
|
}
|
|
159
217
|
};
|
|
160
218
|
if (process.contextIsolated) {
|