@qvac/core 0.10.1 → 0.10.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/CHANGELOG.md +63 -1
- package/dist-lib/lib/api/agent-folders.d.ts +22 -0
- package/dist-lib/lib/api/agent-folders.js +115 -0
- package/dist-lib/lib/api/agents.d.ts +3 -1
- package/dist-lib/lib/api/agents.js +5 -3
- package/dist-lib/lib/api/execution.js +2 -0
- package/dist-lib/lib/api/index.d.ts +1 -0
- package/dist-lib/lib/api/index.js +4 -0
- package/dist-lib/lib/assistant-tree.js +2 -1
- package/dist-lib/lib/assistant.js +7 -4
- package/dist-lib/lib/core/agent.d.ts +5 -1
- package/dist-lib/lib/core/agent.js +8 -3
- package/dist-lib/lib/core/chat.d.ts +4 -1
- package/dist-lib/lib/core/chat.js +12 -4
- package/dist-lib/lib/core/local/index.d.ts +2 -1
- package/dist-lib/lib/core/local/index.js +9 -1
- package/dist-lib/lib/core/send.js +2 -0
- package/dist-lib/lib/core.d.ts +1 -0
- package/dist-lib/lib/core.js +41 -13
- package/dist-lib/lib/errors.d.ts +20 -0
- package/dist-lib/lib/errors.js +20 -0
- package/dist-lib/lib/lent-harness.d.ts +2 -0
- package/dist-lib/lib/lent-harness.js +51 -0
- package/dist-lib/lib/mesh-scoped-engine.js +3 -0
- package/dist-lib/schema/engine.js +58 -1
- package/dist-lib/spec/bind.js +9 -0
- package/dist-lib/spec/calls.js +3 -0
- package/dist-lib/spec/capabilities.d.ts +8 -2
- package/dist-lib/spec/hrpc/hrpc.json +40 -1
- package/dist-lib/spec/hrpc/index.js +40 -4
- package/dist-lib/spec/hrpc/messages.js +190 -0
- package/dist-lib/spec/hyperschema/index.js +190 -0
- package/dist-lib/spec/hyperschema/schema.json +141 -0
- package/dist-lib/spec/hyperschema/types.d.ts +40 -0
- package/package.json +2 -1
- package/tui/README.md +16 -0
- package/tui/app.mjs +80 -13
- package/tui/lib/folders-command.mjs +92 -0
- package/tui/lib/knowledge-import.mjs +3 -21
- package/tui/lib/local-path.mjs +21 -0
package/dist-lib/lib/errors.d.ts
CHANGED
|
@@ -268,6 +268,26 @@ declare const DEFINITIONS: {
|
|
|
268
268
|
readonly code: 100616;
|
|
269
269
|
readonly message: () => string;
|
|
270
270
|
};
|
|
271
|
+
readonly AGENT_FOLDER_NOT_ABSOLUTE: {
|
|
272
|
+
readonly code: 100617;
|
|
273
|
+
readonly message: (path: string) => string;
|
|
274
|
+
};
|
|
275
|
+
readonly AGENT_FOLDER_MISSING: {
|
|
276
|
+
readonly code: 100618;
|
|
277
|
+
readonly message: (path: string) => string;
|
|
278
|
+
};
|
|
279
|
+
readonly AGENT_FOLDER_IS_FILE: {
|
|
280
|
+
readonly code: 100619;
|
|
281
|
+
readonly message: (path: string) => string;
|
|
282
|
+
};
|
|
283
|
+
readonly AGENT_FOLDER_IN_STORAGE: {
|
|
284
|
+
readonly code: 100620;
|
|
285
|
+
readonly message: (path: string) => string;
|
|
286
|
+
};
|
|
287
|
+
readonly AGENT_FOLDER_NOT_SHARED: {
|
|
288
|
+
readonly code: 100621;
|
|
289
|
+
readonly message: (path: string) => string;
|
|
290
|
+
};
|
|
271
291
|
readonly CHAT_NOT_FOUND: {
|
|
272
292
|
readonly code: 100701;
|
|
273
293
|
readonly message: (chatId: string) => string;
|
package/dist-lib/lib/errors.js
CHANGED
|
@@ -197,6 +197,26 @@ const DEFINITIONS = {
|
|
|
197
197
|
},
|
|
198
198
|
LOAN_UNREACHABLE: { code: 100615, message: () => LOAN_UNREACHABLE },
|
|
199
199
|
LOAN_REVOKED: { code: 100616, message: () => 'the device stopped lending its model' },
|
|
200
|
+
AGENT_FOLDER_NOT_ABSOLUTE: {
|
|
201
|
+
code: 100617,
|
|
202
|
+
message: (path) => `a shared folder is an absolute path, not ${path}`
|
|
203
|
+
},
|
|
204
|
+
AGENT_FOLDER_MISSING: {
|
|
205
|
+
code: 100618,
|
|
206
|
+
message: (path) => `there is no folder at ${path}`
|
|
207
|
+
},
|
|
208
|
+
AGENT_FOLDER_IS_FILE: {
|
|
209
|
+
code: 100619,
|
|
210
|
+
message: (path) => `${path} is a file, not a folder`
|
|
211
|
+
},
|
|
212
|
+
AGENT_FOLDER_IN_STORAGE: {
|
|
213
|
+
code: 100620,
|
|
214
|
+
message: (path) => `${path} is inside the app's own storage, which no agent may reach`
|
|
215
|
+
},
|
|
216
|
+
AGENT_FOLDER_NOT_SHARED: {
|
|
217
|
+
code: 100621,
|
|
218
|
+
message: (path) => `${path} is not shared with this agent`
|
|
219
|
+
},
|
|
200
220
|
CHAT_NOT_FOUND: {
|
|
201
221
|
code: 100701,
|
|
202
222
|
message: (chatId) => `chat not found: ${chatId}`
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const HOST_TOOLSETS = ['files', 'exec'];
|
|
2
|
+
const LENT_AGENT = 'lent';
|
|
3
|
+
export function lentHarness(harness) {
|
|
4
|
+
const invoke = harness.invoke?.bind(harness);
|
|
5
|
+
const deleteKvCache = harness.deleteKvCache?.bind(harness);
|
|
6
|
+
return {
|
|
7
|
+
describe: async () => ({
|
|
8
|
+
toolNames: [],
|
|
9
|
+
skills: [],
|
|
10
|
+
supportsImages: false,
|
|
11
|
+
supportsKvCacheDeletion: (await harness.describe?.())?.supportsKvCacheDeletion === true
|
|
12
|
+
}),
|
|
13
|
+
completion: (context) => harness.completion(lentRun(context)),
|
|
14
|
+
invoke: invoke && ((context) => invoke(lentInvoke(context))),
|
|
15
|
+
deleteKvCache: deleteKvCache && ((key) => deleteKvCache(lentKey(key)))
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function lentRun(context) {
|
|
19
|
+
return {
|
|
20
|
+
...context,
|
|
21
|
+
agent: lentAgent(context.agent),
|
|
22
|
+
cacheKey: context.cacheKey && lentKey(context.cacheKey),
|
|
23
|
+
session: context.session && lentKey(context.session),
|
|
24
|
+
messages: context.messages.map((turn) => ({ ...turn, attachments: undefined })),
|
|
25
|
+
fetchAttachment: undefined,
|
|
26
|
+
grantedDirs: undefined,
|
|
27
|
+
grantedWriteDirs: undefined,
|
|
28
|
+
grantedDrives: undefined,
|
|
29
|
+
driveOp: undefined
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function lentInvoke(context) {
|
|
33
|
+
return {
|
|
34
|
+
...context,
|
|
35
|
+
agent: context.agent && lentAgent(context.agent),
|
|
36
|
+
fetchAttachment: undefined
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function lentAgent(agent) {
|
|
40
|
+
const disabled = agent.disabledToolsets ?? [];
|
|
41
|
+
return {
|
|
42
|
+
...agent,
|
|
43
|
+
id: LENT_AGENT,
|
|
44
|
+
skillsScope: 'selected',
|
|
45
|
+
enabledSkills: [],
|
|
46
|
+
disabledToolsets: [...new Set([...disabled, ...HOST_TOOLSETS])]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function lentKey(key) {
|
|
50
|
+
return `${LENT_AGENT}-${key}`;
|
|
51
|
+
}
|
|
@@ -2159,6 +2159,48 @@ export function registerEngineTypes(ns) {
|
|
|
2159
2159
|
]
|
|
2160
2160
|
});
|
|
2161
2161
|
ns.register({ name: 'device-scope', fields: [{ name: 'deviceId', type: 'fixed32' }] });
|
|
2162
|
+
ns.register({
|
|
2163
|
+
name: 'delete-agent-request',
|
|
2164
|
+
fields: [
|
|
2165
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2166
|
+
{ name: 'meshId', type: 'string', required: true },
|
|
2167
|
+
{ name: 'keepChats', type: 'bool' }
|
|
2168
|
+
]
|
|
2169
|
+
});
|
|
2170
|
+
ns.register({ name: 'agent-folder-access', enum: ['read', 'write'], strings: true });
|
|
2171
|
+
ns.register({
|
|
2172
|
+
name: 'agent-folder',
|
|
2173
|
+
fields: [
|
|
2174
|
+
{ name: 'path', type: 'string', required: true },
|
|
2175
|
+
{ name: 'access', type: '@assistant/agent-folder-access', required: true }
|
|
2176
|
+
]
|
|
2177
|
+
});
|
|
2178
|
+
ns.register({
|
|
2179
|
+
name: 'agent-folders-request',
|
|
2180
|
+
fields: [{ name: 'agentId', type: 'string', required: true }]
|
|
2181
|
+
});
|
|
2182
|
+
ns.register({
|
|
2183
|
+
name: 'agent-folders',
|
|
2184
|
+
fields: [
|
|
2185
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2186
|
+
{ name: 'folders', type: '@assistant/agent-folder', array: true }
|
|
2187
|
+
]
|
|
2188
|
+
});
|
|
2189
|
+
ns.register({
|
|
2190
|
+
name: 'add-agent-folder-request',
|
|
2191
|
+
fields: [
|
|
2192
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2193
|
+
{ name: 'path', type: 'string', required: true },
|
|
2194
|
+
{ name: 'access', type: '@assistant/agent-folder-access', required: true }
|
|
2195
|
+
]
|
|
2196
|
+
});
|
|
2197
|
+
ns.register({
|
|
2198
|
+
name: 'remove-agent-folder-request',
|
|
2199
|
+
fields: [
|
|
2200
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2201
|
+
{ name: 'path', type: 'string', required: true }
|
|
2202
|
+
]
|
|
2203
|
+
});
|
|
2162
2204
|
}
|
|
2163
2205
|
export function registerEngineApi(api) {
|
|
2164
2206
|
api.register({
|
|
@@ -2198,7 +2240,7 @@ export function registerEngineApi(api) {
|
|
|
2198
2240
|
});
|
|
2199
2241
|
api.register({
|
|
2200
2242
|
name: 'delete-agent',
|
|
2201
|
-
request: { name: '@assistant/agent-
|
|
2243
|
+
request: { name: '@assistant/delete-agent-request', stream: false },
|
|
2202
2244
|
response: { name: '@assistant/agent', stream: false }
|
|
2203
2245
|
});
|
|
2204
2246
|
api.register({
|
|
@@ -2966,4 +3008,19 @@ export function registerEngineApi(api) {
|
|
|
2966
3008
|
request: { name: '@assistant/empty', stream: false },
|
|
2967
3009
|
response: { name: '@assistant/blind-peering', stream: true }
|
|
2968
3010
|
});
|
|
3011
|
+
api.register({
|
|
3012
|
+
name: 'list-agent-folders',
|
|
3013
|
+
request: { name: '@assistant/agent-folders-request', stream: false },
|
|
3014
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3015
|
+
});
|
|
3016
|
+
api.register({
|
|
3017
|
+
name: 'add-agent-folder',
|
|
3018
|
+
request: { name: '@assistant/add-agent-folder-request', stream: false },
|
|
3019
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3020
|
+
});
|
|
3021
|
+
api.register({
|
|
3022
|
+
name: 'remove-agent-folder',
|
|
3023
|
+
request: { name: '@assistant/remove-agent-folder-request', stream: false },
|
|
3024
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3025
|
+
});
|
|
2969
3026
|
}
|
package/dist-lib/spec/bind.js
CHANGED
|
@@ -690,4 +690,13 @@ export function bindApi(rpc, api) {
|
|
|
690
690
|
out.writeStream?.on("close", () => src.destroy());
|
|
691
691
|
});
|
|
692
692
|
}
|
|
693
|
+
if (api.listAgentFolders) {
|
|
694
|
+
rpc.onListAgentFolders((req) => api.listAgentFolders(req));
|
|
695
|
+
}
|
|
696
|
+
if (api.addAgentFolder) {
|
|
697
|
+
rpc.onAddAgentFolder((req) => api.addAgentFolder(req));
|
|
698
|
+
}
|
|
699
|
+
if (api.removeAgentFolder) {
|
|
700
|
+
rpc.onRemoveAgentFolder((req) => api.removeAgentFolder(req));
|
|
701
|
+
}
|
|
693
702
|
}
|
package/dist-lib/spec/calls.js
CHANGED
|
@@ -171,5 +171,8 @@ export function engineClient(rpc) {
|
|
|
171
171
|
forkChat: (input) => rpc.forkChat(input),
|
|
172
172
|
setBlindPeering: (input) => rpc.setBlindPeering(input),
|
|
173
173
|
blindPeeringWatch: (input) => armed(rpc.blindPeeringWatch(input ?? {})),
|
|
174
|
+
listAgentFolders: (input) => rpc.listAgentFolders(input),
|
|
175
|
+
addAgentFolder: (input) => rpc.addAgentFolder(input),
|
|
176
|
+
removeAgentFolder: (input) => rpc.removeAgentFolder(input),
|
|
174
177
|
};
|
|
175
178
|
}
|
|
@@ -35,7 +35,7 @@ export interface Capabilities {
|
|
|
35
35
|
listAgents(input: T.AssistantListAgentsRequest): Promise<T.AssistantAgentList>
|
|
36
36
|
getAgent(input: T.AssistantAgentId): Promise<T.AssistantAgent>
|
|
37
37
|
updateAgent(input: T.AssistantUpdateAgentRequest): Promise<T.AssistantAgent>
|
|
38
|
-
deleteAgent(input: T.
|
|
38
|
+
deleteAgent(input: T.AssistantDeleteAgentRequest): Promise<T.AssistantAgent>
|
|
39
39
|
agentsWatch(input: T.AssistantListAgentsRequest): WatchStream<T.AssistantAgentList>
|
|
40
40
|
createChat(input: T.AssistantCreateChatRequest): Promise<T.AssistantChat>
|
|
41
41
|
listChats(input: T.AssistantListChatsRequest): Promise<T.AssistantChatList>
|
|
@@ -189,6 +189,9 @@ export interface Capabilities {
|
|
|
189
189
|
forkChat(input: T.AssistantForkChatRequest): Promise<T.AssistantChat>
|
|
190
190
|
setBlindPeering(input: T.AssistantBlindPeering): Promise<T.AssistantBlindPeering>
|
|
191
191
|
blindPeeringWatch(input?: T.AssistantEmpty): WatchStream<T.AssistantBlindPeering>
|
|
192
|
+
listAgentFolders(input: T.AssistantAgentFoldersRequest): Promise<T.AssistantAgentFolders>
|
|
193
|
+
addAgentFolder(input: T.AssistantAddAgentFolderRequest): Promise<T.AssistantAgentFolders>
|
|
194
|
+
removeAgentFolder(input: T.AssistantRemoveAgentFolderRequest): Promise<T.AssistantAgentFolders>
|
|
192
195
|
}
|
|
193
196
|
|
|
194
197
|
export interface CapabilityHandlers {
|
|
@@ -199,7 +202,7 @@ export interface CapabilityHandlers {
|
|
|
199
202
|
listAgents(input: T.AssistantListAgentsRequest): T.AssistantAgentList | Promise<T.AssistantAgentList>
|
|
200
203
|
getAgent(input: T.AssistantAgentId): T.AssistantAgent | Promise<T.AssistantAgent>
|
|
201
204
|
updateAgent(input: T.AssistantUpdateAgentRequest): T.AssistantAgent | Promise<T.AssistantAgent>
|
|
202
|
-
deleteAgent(input: T.
|
|
205
|
+
deleteAgent(input: T.AssistantDeleteAgentRequest): T.AssistantAgent | Promise<T.AssistantAgent>
|
|
203
206
|
agentsWatch(input: T.AssistantListAgentsRequest): AsyncIterable<T.AssistantAgentList>
|
|
204
207
|
createChat(input: T.AssistantCreateChatRequest): T.AssistantChat | Promise<T.AssistantChat>
|
|
205
208
|
listChats(input: T.AssistantListChatsRequest): T.AssistantChatList | Promise<T.AssistantChatList>
|
|
@@ -353,4 +356,7 @@ export interface CapabilityHandlers {
|
|
|
353
356
|
forkChat(input: T.AssistantForkChatRequest): T.AssistantChat | Promise<T.AssistantChat>
|
|
354
357
|
setBlindPeering(input: T.AssistantBlindPeering): T.AssistantBlindPeering | Promise<T.AssistantBlindPeering>
|
|
355
358
|
blindPeeringWatch(input?: T.AssistantEmpty): AsyncIterable<T.AssistantBlindPeering>
|
|
359
|
+
listAgentFolders(input: T.AssistantAgentFoldersRequest): T.AssistantAgentFolders | Promise<T.AssistantAgentFolders>
|
|
360
|
+
addAgentFolder(input: T.AssistantAddAgentFolderRequest): T.AssistantAgentFolders | Promise<T.AssistantAgentFolders>
|
|
361
|
+
removeAgentFolder(input: T.AssistantRemoveAgentFolderRequest): T.AssistantAgentFolders | Promise<T.AssistantAgentFolders>
|
|
356
362
|
}
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"id": 7,
|
|
97
97
|
"name": "@assistant/delete-agent",
|
|
98
98
|
"request": {
|
|
99
|
-
"name": "@assistant/agent-
|
|
99
|
+
"name": "@assistant/delete-agent-request",
|
|
100
100
|
"stream": false
|
|
101
101
|
},
|
|
102
102
|
"response": {
|
|
@@ -2093,6 +2093,45 @@
|
|
|
2093
2093
|
"stream": true
|
|
2094
2094
|
},
|
|
2095
2095
|
"version": 1
|
|
2096
|
+
},
|
|
2097
|
+
{
|
|
2098
|
+
"id": 161,
|
|
2099
|
+
"name": "@assistant/list-agent-folders",
|
|
2100
|
+
"request": {
|
|
2101
|
+
"name": "@assistant/agent-folders-request",
|
|
2102
|
+
"stream": false
|
|
2103
|
+
},
|
|
2104
|
+
"response": {
|
|
2105
|
+
"name": "@assistant/agent-folders",
|
|
2106
|
+
"stream": false
|
|
2107
|
+
},
|
|
2108
|
+
"version": 1
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
"id": 162,
|
|
2112
|
+
"name": "@assistant/add-agent-folder",
|
|
2113
|
+
"request": {
|
|
2114
|
+
"name": "@assistant/add-agent-folder-request",
|
|
2115
|
+
"stream": false
|
|
2116
|
+
},
|
|
2117
|
+
"response": {
|
|
2118
|
+
"name": "@assistant/agent-folders",
|
|
2119
|
+
"stream": false
|
|
2120
|
+
},
|
|
2121
|
+
"version": 1
|
|
2122
|
+
},
|
|
2123
|
+
{
|
|
2124
|
+
"id": 163,
|
|
2125
|
+
"name": "@assistant/remove-agent-folder",
|
|
2126
|
+
"request": {
|
|
2127
|
+
"name": "@assistant/remove-agent-folder-request",
|
|
2128
|
+
"stream": false
|
|
2129
|
+
},
|
|
2130
|
+
"response": {
|
|
2131
|
+
"name": "@assistant/agent-folders",
|
|
2132
|
+
"stream": false
|
|
2133
|
+
},
|
|
2134
|
+
"version": 1
|
|
2096
2135
|
}
|
|
2097
2136
|
]
|
|
2098
2137
|
}
|
|
@@ -327,7 +327,13 @@ const methods = new Map([
|
|
|
327
327
|
['@assistant/set-blind-peering', 159],
|
|
328
328
|
[159, '@assistant/set-blind-peering'],
|
|
329
329
|
['@assistant/blind-peering-watch', 160],
|
|
330
|
-
[160, '@assistant/blind-peering-watch']
|
|
330
|
+
[160, '@assistant/blind-peering-watch'],
|
|
331
|
+
['@assistant/list-agent-folders', 161],
|
|
332
|
+
[161, '@assistant/list-agent-folders'],
|
|
333
|
+
['@assistant/add-agent-folder', 162],
|
|
334
|
+
[162, '@assistant/add-agent-folder'],
|
|
335
|
+
['@assistant/remove-agent-folder', 163],
|
|
336
|
+
[163, '@assistant/remove-agent-folder']
|
|
331
337
|
])
|
|
332
338
|
|
|
333
339
|
class HRPC {
|
|
@@ -342,7 +348,7 @@ class HRPC {
|
|
|
342
348
|
['@assistant/list-agents', getEncoding('@assistant/list-agents-request')],
|
|
343
349
|
['@assistant/get-agent', getEncoding('@assistant/agent-id')],
|
|
344
350
|
['@assistant/update-agent', getEncoding('@assistant/update-agent-request')],
|
|
345
|
-
['@assistant/delete-agent', getEncoding('@assistant/agent-
|
|
351
|
+
['@assistant/delete-agent', getEncoding('@assistant/delete-agent-request')],
|
|
346
352
|
['@assistant/agents-watch', getEncoding('@assistant/list-agents-request')],
|
|
347
353
|
['@assistant/create-chat', getEncoding('@assistant/create-chat-request')],
|
|
348
354
|
['@assistant/list-chats', getEncoding('@assistant/list-chats-request')],
|
|
@@ -495,7 +501,10 @@ class HRPC {
|
|
|
495
501
|
['@assistant/set-auto-download-models', getEncoding('@assistant/set-auto-download-models-request')],
|
|
496
502
|
['@assistant/fork-chat', getEncoding('@assistant/fork-chat-request')],
|
|
497
503
|
['@assistant/set-blind-peering', getEncoding('@assistant/blind-peering')],
|
|
498
|
-
['@assistant/blind-peering-watch', getEncoding('@assistant/empty')]
|
|
504
|
+
['@assistant/blind-peering-watch', getEncoding('@assistant/empty')],
|
|
505
|
+
['@assistant/list-agent-folders', getEncoding('@assistant/agent-folders-request')],
|
|
506
|
+
['@assistant/add-agent-folder', getEncoding('@assistant/add-agent-folder-request')],
|
|
507
|
+
['@assistant/remove-agent-folder', getEncoding('@assistant/remove-agent-folder-request')]
|
|
499
508
|
])
|
|
500
509
|
this._responseEncodings = new Map([
|
|
501
510
|
['@assistant/config-get', getEncoding('@assistant/config-value')],
|
|
@@ -658,7 +667,10 @@ class HRPC {
|
|
|
658
667
|
['@assistant/set-auto-download-models', getEncoding('@assistant/app-config')],
|
|
659
668
|
['@assistant/fork-chat', getEncoding('@assistant/chat')],
|
|
660
669
|
['@assistant/set-blind-peering', getEncoding('@assistant/blind-peering')],
|
|
661
|
-
['@assistant/blind-peering-watch', getEncoding('@assistant/blind-peering')]
|
|
670
|
+
['@assistant/blind-peering-watch', getEncoding('@assistant/blind-peering')],
|
|
671
|
+
['@assistant/list-agent-folders', getEncoding('@assistant/agent-folders')],
|
|
672
|
+
['@assistant/add-agent-folder', getEncoding('@assistant/agent-folders')],
|
|
673
|
+
['@assistant/remove-agent-folder', getEncoding('@assistant/agent-folders')]
|
|
662
674
|
])
|
|
663
675
|
this._rpc = new RPC(stream, async (req) => {
|
|
664
676
|
const command = methods.get(req.command)
|
|
@@ -1400,6 +1412,18 @@ class HRPC {
|
|
|
1400
1412
|
return this._callSync('@assistant/blind-peering-watch', args)
|
|
1401
1413
|
}
|
|
1402
1414
|
|
|
1415
|
+
async listAgentFolders(args) {
|
|
1416
|
+
return this._call('@assistant/list-agent-folders', args)
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
async addAgentFolder(args) {
|
|
1420
|
+
return this._call('@assistant/add-agent-folder', args)
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
async removeAgentFolder(args) {
|
|
1424
|
+
return this._call('@assistant/remove-agent-folder', args)
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1403
1427
|
onConfigGet(responseFn) {
|
|
1404
1428
|
this._handlers['@assistant/config-get'] = responseFn
|
|
1405
1429
|
}
|
|
@@ -2044,6 +2068,18 @@ class HRPC {
|
|
|
2044
2068
|
this._handlers['@assistant/blind-peering-watch'] = responseFn
|
|
2045
2069
|
}
|
|
2046
2070
|
|
|
2071
|
+
onListAgentFolders(responseFn) {
|
|
2072
|
+
this._handlers['@assistant/list-agent-folders'] = responseFn
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2075
|
+
onAddAgentFolder(responseFn) {
|
|
2076
|
+
this._handlers['@assistant/add-agent-folder'] = responseFn
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
onRemoveAgentFolder(responseFn) {
|
|
2080
|
+
this._handlers['@assistant/remove-agent-folder'] = responseFn
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2047
2083
|
_requestIsStream(command) {
|
|
2048
2084
|
return [
|
|
2049
2085
|
'@assistant/upload-attachment',
|
|
@@ -10492,6 +10492,180 @@ const encoding303 = {
|
|
|
10492
10492
|
}
|
|
10493
10493
|
}
|
|
10494
10494
|
|
|
10495
|
+
// @assistant/delete-agent-request
|
|
10496
|
+
const encoding304 = {
|
|
10497
|
+
preencode(state, m) {
|
|
10498
|
+
c.string.preencode(state, m.agentId)
|
|
10499
|
+
c.string.preencode(state, m.meshId)
|
|
10500
|
+
state.end++ // max flag is 1 so always one byte
|
|
10501
|
+
},
|
|
10502
|
+
encode(state, m) {
|
|
10503
|
+
const flags = m.keepChats ? 1 : 0
|
|
10504
|
+
|
|
10505
|
+
c.string.encode(state, m.agentId)
|
|
10506
|
+
c.string.encode(state, m.meshId)
|
|
10507
|
+
c.uint.encode(state, flags)
|
|
10508
|
+
},
|
|
10509
|
+
decode(state) {
|
|
10510
|
+
const r0 = c.string.decode(state)
|
|
10511
|
+
const r1 = c.string.decode(state)
|
|
10512
|
+
const flags = c.uint.decode(state)
|
|
10513
|
+
|
|
10514
|
+
return {
|
|
10515
|
+
agentId: r0,
|
|
10516
|
+
meshId: r1,
|
|
10517
|
+
keepChats: (flags & 1) !== 0
|
|
10518
|
+
}
|
|
10519
|
+
}
|
|
10520
|
+
}
|
|
10521
|
+
|
|
10522
|
+
const encoding305_enum = {
|
|
10523
|
+
read: 'read',
|
|
10524
|
+
write: 'write'
|
|
10525
|
+
}
|
|
10526
|
+
|
|
10527
|
+
// @assistant/agent-folder-access enum
|
|
10528
|
+
const encoding305 = {
|
|
10529
|
+
preencode (state, m) {
|
|
10530
|
+
state.end++ // max enum is 2 so always one byte
|
|
10531
|
+
},
|
|
10532
|
+
encode (state, m) {
|
|
10533
|
+
switch (m) {
|
|
10534
|
+
case 'read':
|
|
10535
|
+
c.uint.encode(state, 1)
|
|
10536
|
+
break
|
|
10537
|
+
case 'write':
|
|
10538
|
+
c.uint.encode(state, 2)
|
|
10539
|
+
break
|
|
10540
|
+
default:
|
|
10541
|
+
throw new Error('Unknown enum')
|
|
10542
|
+
}
|
|
10543
|
+
},
|
|
10544
|
+
decode (state) {
|
|
10545
|
+
switch (c.uint.decode(state)) {
|
|
10546
|
+
case 1:
|
|
10547
|
+
return 'read'
|
|
10548
|
+
case 2:
|
|
10549
|
+
return 'write'
|
|
10550
|
+
default: return null
|
|
10551
|
+
}
|
|
10552
|
+
}
|
|
10553
|
+
}
|
|
10554
|
+
|
|
10555
|
+
// @assistant/agent-folder
|
|
10556
|
+
const encoding306 = {
|
|
10557
|
+
preencode(state, m) {
|
|
10558
|
+
c.string.preencode(state, m.path)
|
|
10559
|
+
encoding305.preencode(state, m.access)
|
|
10560
|
+
},
|
|
10561
|
+
encode(state, m) {
|
|
10562
|
+
c.string.encode(state, m.path)
|
|
10563
|
+
encoding305.encode(state, m.access)
|
|
10564
|
+
},
|
|
10565
|
+
decode(state) {
|
|
10566
|
+
const r0 = c.string.decode(state)
|
|
10567
|
+
const r1 = encoding305.decode(state)
|
|
10568
|
+
|
|
10569
|
+
return {
|
|
10570
|
+
path: r0,
|
|
10571
|
+
access: r1
|
|
10572
|
+
}
|
|
10573
|
+
}
|
|
10574
|
+
}
|
|
10575
|
+
|
|
10576
|
+
// @assistant/agent-folders-request
|
|
10577
|
+
const encoding307 = {
|
|
10578
|
+
preencode(state, m) {
|
|
10579
|
+
c.string.preencode(state, m.agentId)
|
|
10580
|
+
},
|
|
10581
|
+
encode(state, m) {
|
|
10582
|
+
c.string.encode(state, m.agentId)
|
|
10583
|
+
},
|
|
10584
|
+
decode(state) {
|
|
10585
|
+
const r0 = c.string.decode(state)
|
|
10586
|
+
|
|
10587
|
+
return {
|
|
10588
|
+
agentId: r0
|
|
10589
|
+
}
|
|
10590
|
+
}
|
|
10591
|
+
}
|
|
10592
|
+
|
|
10593
|
+
// @assistant/agent-folders.folders
|
|
10594
|
+
const encoding308_1 = c.array(c.frame(encoding306))
|
|
10595
|
+
|
|
10596
|
+
// @assistant/agent-folders
|
|
10597
|
+
const encoding308 = {
|
|
10598
|
+
preencode(state, m) {
|
|
10599
|
+
c.string.preencode(state, m.agentId)
|
|
10600
|
+
state.end++ // max flag is 1 so always one byte
|
|
10601
|
+
|
|
10602
|
+
if (m.folders) encoding308_1.preencode(state, m.folders)
|
|
10603
|
+
},
|
|
10604
|
+
encode(state, m) {
|
|
10605
|
+
const flags = m.folders ? 1 : 0
|
|
10606
|
+
|
|
10607
|
+
c.string.encode(state, m.agentId)
|
|
10608
|
+
c.uint.encode(state, flags)
|
|
10609
|
+
|
|
10610
|
+
if (m.folders) encoding308_1.encode(state, m.folders)
|
|
10611
|
+
},
|
|
10612
|
+
decode(state) {
|
|
10613
|
+
const r0 = c.string.decode(state)
|
|
10614
|
+
const flags = c.uint.decode(state)
|
|
10615
|
+
|
|
10616
|
+
return {
|
|
10617
|
+
agentId: r0,
|
|
10618
|
+
folders: (flags & 1) !== 0 ? encoding308_1.decode(state) : null
|
|
10619
|
+
}
|
|
10620
|
+
}
|
|
10621
|
+
}
|
|
10622
|
+
|
|
10623
|
+
// @assistant/add-agent-folder-request
|
|
10624
|
+
const encoding309 = {
|
|
10625
|
+
preencode(state, m) {
|
|
10626
|
+
c.string.preencode(state, m.agentId)
|
|
10627
|
+
c.string.preencode(state, m.path)
|
|
10628
|
+
encoding305.preencode(state, m.access)
|
|
10629
|
+
},
|
|
10630
|
+
encode(state, m) {
|
|
10631
|
+
c.string.encode(state, m.agentId)
|
|
10632
|
+
c.string.encode(state, m.path)
|
|
10633
|
+
encoding305.encode(state, m.access)
|
|
10634
|
+
},
|
|
10635
|
+
decode(state) {
|
|
10636
|
+
const r0 = c.string.decode(state)
|
|
10637
|
+
const r1 = c.string.decode(state)
|
|
10638
|
+
const r2 = encoding305.decode(state)
|
|
10639
|
+
|
|
10640
|
+
return {
|
|
10641
|
+
agentId: r0,
|
|
10642
|
+
path: r1,
|
|
10643
|
+
access: r2
|
|
10644
|
+
}
|
|
10645
|
+
}
|
|
10646
|
+
}
|
|
10647
|
+
|
|
10648
|
+
// @assistant/remove-agent-folder-request
|
|
10649
|
+
const encoding310 = {
|
|
10650
|
+
preencode(state, m) {
|
|
10651
|
+
c.string.preencode(state, m.agentId)
|
|
10652
|
+
c.string.preencode(state, m.path)
|
|
10653
|
+
},
|
|
10654
|
+
encode(state, m) {
|
|
10655
|
+
c.string.encode(state, m.agentId)
|
|
10656
|
+
c.string.encode(state, m.path)
|
|
10657
|
+
},
|
|
10658
|
+
decode(state) {
|
|
10659
|
+
const r0 = c.string.decode(state)
|
|
10660
|
+
const r1 = c.string.decode(state)
|
|
10661
|
+
|
|
10662
|
+
return {
|
|
10663
|
+
agentId: r0,
|
|
10664
|
+
path: r1
|
|
10665
|
+
}
|
|
10666
|
+
}
|
|
10667
|
+
}
|
|
10668
|
+
|
|
10495
10669
|
// @assistant/model-info-list.memory, deferred due to recusive use
|
|
10496
10670
|
const encoding156_1 = c.frame(encoding302)
|
|
10497
10671
|
|
|
@@ -10585,6 +10759,8 @@ function getEnum(name) {
|
|
|
10585
10759
|
return encoding245_enum
|
|
10586
10760
|
case '@assistant/model-use':
|
|
10587
10761
|
return encoding297_enum
|
|
10762
|
+
case '@assistant/agent-folder-access':
|
|
10763
|
+
return encoding305_enum
|
|
10588
10764
|
default:
|
|
10589
10765
|
throw new Error('Enum not found ' + name)
|
|
10590
10766
|
}
|
|
@@ -11200,6 +11376,20 @@ function getEncoding(name) {
|
|
|
11200
11376
|
return encoding302
|
|
11201
11377
|
case '@assistant/device-scope':
|
|
11202
11378
|
return encoding303
|
|
11379
|
+
case '@assistant/delete-agent-request':
|
|
11380
|
+
return encoding304
|
|
11381
|
+
case '@assistant/agent-folder-access':
|
|
11382
|
+
return encoding305
|
|
11383
|
+
case '@assistant/agent-folder':
|
|
11384
|
+
return encoding306
|
|
11385
|
+
case '@assistant/agent-folders-request':
|
|
11386
|
+
return encoding307
|
|
11387
|
+
case '@assistant/agent-folders':
|
|
11388
|
+
return encoding308
|
|
11389
|
+
case '@assistant/add-agent-folder-request':
|
|
11390
|
+
return encoding309
|
|
11391
|
+
case '@assistant/remove-agent-folder-request':
|
|
11392
|
+
return encoding310
|
|
11203
11393
|
default:
|
|
11204
11394
|
throw new Error('Encoder not found ' + name)
|
|
11205
11395
|
}
|