@qvac/core 0.10.2 → 0.10.4
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 +66 -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 +4 -2
- package/dist-lib/lib/api/index.d.ts +1 -0
- package/dist-lib/lib/api/index.js +4 -0
- package/dist-lib/lib/assistant/history.js +18 -2
- package/dist-lib/lib/assistant/message.d.ts +17 -0
- package/dist-lib/lib/assistant/message.js +28 -0
- package/dist-lib/lib/assistant/video-budget.d.ts +13 -0
- package/dist-lib/lib/assistant/video-budget.js +29 -0
- package/dist-lib/lib/assistant-tree.js +2 -1
- package/dist-lib/lib/assistant.d.ts +22 -2
- package/dist-lib/lib/assistant.js +377 -15
- package/dist-lib/lib/core/chat-fork.js +1 -0
- package/dist-lib/lib/core/chat-search.js +1 -1
- package/dist-lib/lib/core/chat.d.ts +1 -0
- package/dist-lib/lib/core/chat.js +2 -1
- package/dist-lib/lib/core/chunk.d.ts +2 -2
- package/dist-lib/lib/core/chunk.js +5 -1
- package/dist-lib/lib/core/document-attachment.js +3 -0
- package/dist-lib/lib/core/files/index.js +4 -4
- package/dist-lib/lib/core/files/records/chunks.js +21 -0
- package/dist-lib/lib/core/files/records/purge.js +4 -3
- package/dist-lib/lib/core/files/records/source.js +3 -5
- package/dist-lib/lib/core/files/upload.js +3 -2
- package/dist-lib/lib/core/video/attachment.d.ts +1 -0
- package/dist-lib/lib/core/video/attachment.js +7 -0
- package/dist-lib/lib/core/video/digest.d.ts +16 -0
- package/dist-lib/lib/core/video/digest.js +57 -0
- package/dist-lib/lib/core/video/frames.d.ts +32 -0
- package/dist-lib/lib/core/video/frames.js +224 -0
- package/dist-lib/lib/core.js +25 -5
- package/dist-lib/lib/credential-pusher.d.ts +5 -0
- package/dist-lib/lib/credential-pusher.js +42 -11
- 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/lib/run-notices.d.ts +1 -0
- package/dist-lib/lib/run-notices.js +2 -1
- package/dist-lib/lib/task.js +1 -1
- package/dist-lib/schema/engine.js +53 -2
- package/dist-lib/schema/indexes.js +2 -2
- package/dist-lib/schema/qvac.js +4 -2
- package/dist-lib/spec/bind.js +9 -0
- package/dist-lib/spec/calls.js +3 -0
- package/dist-lib/spec/capabilities.d.ts +6 -0
- package/dist-lib/spec/hrpc/hrpc.json +39 -0
- package/dist-lib/spec/hrpc/index.js +39 -3
- package/dist-lib/spec/hrpc/messages.js +177 -6
- package/dist-lib/spec/hyperschema/index.js +177 -6
- package/dist-lib/spec/hyperschema/schema.json +126 -0
- package/dist-lib/spec/hyperschema/types.d.ts +35 -0
- package/dist-lib/spec/mesh/hyperdb/messages.js +26 -11
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +18 -8
- package/dist-lib/spec/mesh/hyperschema/index.js +18 -8
- package/dist-lib/spec/mesh/hyperschema/schema.json +11 -1
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +3 -1
- package/package.json +4 -1
- package/tui/README.md +10 -0
- package/tui/app.mjs +63 -2
- 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/tui/lib/render.mjs +5 -0
- package/tui/main.mjs +8 -0
|
@@ -174,14 +174,22 @@ async function resolveSettings(engine, scopes, { catalog, logger }) {
|
|
|
174
174
|
}
|
|
175
175
|
return entries;
|
|
176
176
|
}
|
|
177
|
+
async function accountScopes(engine) {
|
|
178
|
+
const { meshId } = await engine.account({});
|
|
179
|
+
const ids = meshId
|
|
180
|
+
? ((await engine.listAgents({ meshId })).agents ?? []).map((agent) => agent.id)
|
|
181
|
+
: [];
|
|
182
|
+
return { meshId, scopes: [undefined, ...ids] };
|
|
183
|
+
}
|
|
177
184
|
export function startCredentialPusher(harness, engine, logger) {
|
|
178
185
|
const last = new Map();
|
|
179
186
|
const watches = new Map();
|
|
187
|
+
const agentLists = new Map();
|
|
180
188
|
let disposed = false;
|
|
181
189
|
let timer = null;
|
|
182
190
|
const pushLock = new ScopeLock({ debounce: true });
|
|
183
191
|
const watch = (key) => {
|
|
184
|
-
const stream = engine.configWatch({ key
|
|
192
|
+
const stream = engine.configWatch({ key });
|
|
185
193
|
watches.set(key, stream);
|
|
186
194
|
(async () => {
|
|
187
195
|
for await (const _ of stream) {
|
|
@@ -197,10 +205,11 @@ export function startCredentialPusher(harness, engine, logger) {
|
|
|
197
205
|
logger?.warn('credential-pusher', `credential watch ended for ${key}`, errorMessage(err));
|
|
198
206
|
});
|
|
199
207
|
};
|
|
200
|
-
const syncWatches = (oauthKeys) => {
|
|
208
|
+
const syncWatches = (oauthKeys, scopes) => {
|
|
201
209
|
if (disposed)
|
|
202
210
|
return;
|
|
203
|
-
const
|
|
211
|
+
const keys = new Set([...oauthKeys, ...PLAIN_KEYS]);
|
|
212
|
+
const wanted = new Set(scopes.flatMap((agentId) => [...keys].map((key) => scopedKey(agentId, key))));
|
|
204
213
|
for (const [key, stream] of watches) {
|
|
205
214
|
if (wanted.has(key))
|
|
206
215
|
continue;
|
|
@@ -217,11 +226,34 @@ export function startCredentialPusher(harness, engine, logger) {
|
|
|
217
226
|
}
|
|
218
227
|
for (const mk of last.keys()) {
|
|
219
228
|
const key = mk.includes('\0') ? mk.slice(mk.indexOf('\0') + 1) : mk;
|
|
220
|
-
if (!
|
|
229
|
+
if (!keys.has(key)) {
|
|
221
230
|
last.delete(mk);
|
|
222
231
|
}
|
|
223
232
|
}
|
|
224
233
|
};
|
|
234
|
+
const syncAgentsWatch = (meshId) => {
|
|
235
|
+
if (disposed)
|
|
236
|
+
return;
|
|
237
|
+
for (const [id, stream] of agentLists) {
|
|
238
|
+
if (id === meshId)
|
|
239
|
+
continue;
|
|
240
|
+
try {
|
|
241
|
+
stream.destroy();
|
|
242
|
+
}
|
|
243
|
+
catch { }
|
|
244
|
+
agentLists.delete(id);
|
|
245
|
+
}
|
|
246
|
+
if (!meshId || agentLists.has(meshId)) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const stream = engine.agentsWatch({ meshId });
|
|
250
|
+
agentLists.set(meshId, stream);
|
|
251
|
+
(async () => {
|
|
252
|
+
for await (const _ of stream) {
|
|
253
|
+
schedule();
|
|
254
|
+
}
|
|
255
|
+
})().catch(noop);
|
|
256
|
+
};
|
|
225
257
|
const armTimer = (delay) => {
|
|
226
258
|
if (disposed)
|
|
227
259
|
return;
|
|
@@ -253,12 +285,9 @@ export function startCredentialPusher(harness, engine, logger) {
|
|
|
253
285
|
}
|
|
254
286
|
const owners = credentialOwners(skills);
|
|
255
287
|
const specs = oauthSpecs(skills);
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
? ((await engine.listAgents({ meshId })).agents ?? []).map((agent) => agent.id)
|
|
260
|
-
: [];
|
|
261
|
-
const scopes = [undefined, ...ids];
|
|
288
|
+
const { meshId, scopes } = await accountScopes(engine);
|
|
289
|
+
syncWatches(specs.map((spec) => spec.credentialKey), scopes);
|
|
290
|
+
syncAgentsWatch(meshId);
|
|
262
291
|
const resolution = { engine, last, owners, specs, logger };
|
|
263
292
|
for (const agentId of scopes) {
|
|
264
293
|
entries.push(...(await resolveScope(agentId, resolution)));
|
|
@@ -326,15 +355,17 @@ export function startCredentialPusher(harness, engine, logger) {
|
|
|
326
355
|
clearTimeout(timer);
|
|
327
356
|
}
|
|
328
357
|
timer = null;
|
|
329
|
-
for (const stream of watches.values()) {
|
|
358
|
+
for (const stream of [...watches.values(), ...agentLists.values()]) {
|
|
330
359
|
try {
|
|
331
360
|
stream.destroy();
|
|
332
361
|
}
|
|
333
362
|
catch { }
|
|
334
363
|
}
|
|
335
364
|
watches.clear();
|
|
365
|
+
agentLists.clear();
|
|
336
366
|
pushLock.destroy();
|
|
337
367
|
await pushLock.flush();
|
|
338
368
|
};
|
|
339
369
|
return Object.assign(stop, { sync });
|
|
340
370
|
}
|
|
371
|
+
function noop() { }
|
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
|
+
}
|
|
@@ -13,6 +13,7 @@ export declare const RUN_FAILURE_REASONS: {
|
|
|
13
13
|
readonly runtimeEndedTurn: 'the model runtime ended this turn';
|
|
14
14
|
readonly capabilityUnavailable: 'this device cannot run a capability without a model';
|
|
15
15
|
readonly stalled: 'the agent stopped responding';
|
|
16
|
+
readonly videoNeedsVision: 'this model cannot see video: switch to a model that reads images to ask about one';
|
|
16
17
|
};
|
|
17
18
|
export type AbortOutcome = {
|
|
18
19
|
readonly kind: 'replay';
|
|
@@ -11,7 +11,8 @@ export const RUN_FAILURE_REASONS = {
|
|
|
11
11
|
harnessDied: 'the model runtime died',
|
|
12
12
|
runtimeEndedTurn: 'the model runtime ended this turn',
|
|
13
13
|
capabilityUnavailable: 'this device cannot run a capability without a model',
|
|
14
|
-
stalled: 'the agent stopped responding'
|
|
14
|
+
stalled: 'the agent stopped responding',
|
|
15
|
+
videoNeedsVision: 'this model cannot see video: switch to a model that reads images to ask about one'
|
|
15
16
|
};
|
|
16
17
|
export function knownAbortOutcome(reason) {
|
|
17
18
|
if (reason === RUN_ABORT_REASONS.suspended ||
|
package/dist-lib/lib/task.js
CHANGED
|
@@ -55,7 +55,7 @@ function collect(all, { chatId, runId, state }) {
|
|
|
55
55
|
if (call) {
|
|
56
56
|
toolCalls.push({ name: call.name, arguments: call.arguments });
|
|
57
57
|
}
|
|
58
|
-
if (chunk.attachment && !chunk.attachment.deletedAt) {
|
|
58
|
+
if (chunk.attachment && !chunk.attachment.deletedAt && !chunk.sourceId) {
|
|
59
59
|
attachments.push(chunk.attachment);
|
|
60
60
|
}
|
|
61
61
|
if (chunk.sources) {
|
|
@@ -579,7 +579,8 @@ export function registerEngineTypes(ns) {
|
|
|
579
579
|
{ name: 'senderMemberId', type: 'fixed32' },
|
|
580
580
|
{ name: 'capability', type: 'string' },
|
|
581
581
|
{ name: 'capabilityArgs', type: 'json' },
|
|
582
|
-
{ name: 'enhance', type: '@assistant/enhance-mode' }
|
|
582
|
+
{ name: 'enhance', type: '@assistant/enhance-mode' },
|
|
583
|
+
{ name: 'sourceId', type: 'string' }
|
|
583
584
|
]);
|
|
584
585
|
ns.register({
|
|
585
586
|
name: 'chunk-list',
|
|
@@ -695,7 +696,8 @@ export function registerEngineTypes(ns) {
|
|
|
695
696
|
{ name: 'raw', type: 'bool' },
|
|
696
697
|
{ name: 'fileId', type: 'string' },
|
|
697
698
|
{ name: 'totalBytes', type: 'uint' },
|
|
698
|
-
{ name: 'meshId', type: 'string' }
|
|
699
|
+
{ name: 'meshId', type: 'string' },
|
|
700
|
+
{ name: 'sourceId', type: 'string' }
|
|
699
701
|
]
|
|
700
702
|
});
|
|
701
703
|
ns.register({
|
|
@@ -2167,6 +2169,40 @@ export function registerEngineTypes(ns) {
|
|
|
2167
2169
|
{ name: 'keepChats', type: 'bool' }
|
|
2168
2170
|
]
|
|
2169
2171
|
});
|
|
2172
|
+
ns.register({ name: 'agent-folder-access', enum: ['read', 'write'], strings: true });
|
|
2173
|
+
ns.register({
|
|
2174
|
+
name: 'agent-folder',
|
|
2175
|
+
fields: [
|
|
2176
|
+
{ name: 'path', type: 'string', required: true },
|
|
2177
|
+
{ name: 'access', type: '@assistant/agent-folder-access', required: true }
|
|
2178
|
+
]
|
|
2179
|
+
});
|
|
2180
|
+
ns.register({
|
|
2181
|
+
name: 'agent-folders-request',
|
|
2182
|
+
fields: [{ name: 'agentId', type: 'string', required: true }]
|
|
2183
|
+
});
|
|
2184
|
+
ns.register({
|
|
2185
|
+
name: 'agent-folders',
|
|
2186
|
+
fields: [
|
|
2187
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2188
|
+
{ name: 'folders', type: '@assistant/agent-folder', array: true }
|
|
2189
|
+
]
|
|
2190
|
+
});
|
|
2191
|
+
ns.register({
|
|
2192
|
+
name: 'add-agent-folder-request',
|
|
2193
|
+
fields: [
|
|
2194
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2195
|
+
{ name: 'path', type: 'string', required: true },
|
|
2196
|
+
{ name: 'access', type: '@assistant/agent-folder-access', required: true }
|
|
2197
|
+
]
|
|
2198
|
+
});
|
|
2199
|
+
ns.register({
|
|
2200
|
+
name: 'remove-agent-folder-request',
|
|
2201
|
+
fields: [
|
|
2202
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2203
|
+
{ name: 'path', type: 'string', required: true }
|
|
2204
|
+
]
|
|
2205
|
+
});
|
|
2170
2206
|
}
|
|
2171
2207
|
export function registerEngineApi(api) {
|
|
2172
2208
|
api.register({
|
|
@@ -2974,4 +3010,19 @@ export function registerEngineApi(api) {
|
|
|
2974
3010
|
request: { name: '@assistant/empty', stream: false },
|
|
2975
3011
|
response: { name: '@assistant/blind-peering', stream: true }
|
|
2976
3012
|
});
|
|
3013
|
+
api.register({
|
|
3014
|
+
name: 'list-agent-folders',
|
|
3015
|
+
request: { name: '@assistant/agent-folders-request', stream: false },
|
|
3016
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3017
|
+
});
|
|
3018
|
+
api.register({
|
|
3019
|
+
name: 'add-agent-folder',
|
|
3020
|
+
request: { name: '@assistant/add-agent-folder-request', stream: false },
|
|
3021
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3022
|
+
});
|
|
3023
|
+
api.register({
|
|
3024
|
+
name: 'remove-agent-folder',
|
|
3025
|
+
request: { name: '@assistant/remove-agent-folder-request', stream: false },
|
|
3026
|
+
response: { name: '@assistant/agent-folders', stream: false }
|
|
3027
|
+
});
|
|
2977
3028
|
}
|
|
@@ -91,7 +91,7 @@ export function runRequestsMap(record) {
|
|
|
91
91
|
|
|
92
92
|
// not chatId-prefixed, so one range lists every audio attachment in the mesh without filtering
|
|
93
93
|
export function attachmentsByMediaKindMap(record) {
|
|
94
|
-
if (record.type !== 'attachment') return []
|
|
94
|
+
if (record.type !== 'attachment' || record.sourceId) return []
|
|
95
95
|
const attachment = record.attachment
|
|
96
96
|
if (!attachment || attachment.deletedAt) {
|
|
97
97
|
return []
|
|
@@ -112,7 +112,7 @@ function attachmentGenerated(record) {
|
|
|
112
112
|
|
|
113
113
|
// origin in the key makes "only generated audio" a range query, not a post-filter
|
|
114
114
|
export function attachmentsByMediaKindOriginMap(record) {
|
|
115
|
-
if (record.type !== 'attachment') return []
|
|
115
|
+
if (record.type !== 'attachment' || record.sourceId) return []
|
|
116
116
|
const attachment = record.attachment
|
|
117
117
|
if (!attachment || attachment.deletedAt) {
|
|
118
118
|
return []
|
package/dist-lib/schema/qvac.js
CHANGED
|
@@ -82,7 +82,8 @@ export function registerQvacTypes(ns) {
|
|
|
82
82
|
{ name: 'senderMemberId', type: 'fixed32' },
|
|
83
83
|
{ name: 'capability', type: 'string' },
|
|
84
84
|
{ name: 'capabilityArgs', type: 'json' },
|
|
85
|
-
{ name: 'enhance', type: '@qvac/enhance-mode' }
|
|
85
|
+
{ name: 'enhance', type: '@qvac/enhance-mode' },
|
|
86
|
+
{ name: 'sourceId', type: 'string' }
|
|
86
87
|
]);
|
|
87
88
|
versioned('chunk-counter', [
|
|
88
89
|
{ name: 'chatId', type: 'string', required: true },
|
|
@@ -115,7 +116,8 @@ export function registerQvacTypes(ns) {
|
|
|
115
116
|
{ name: 'senderMemberId', type: 'fixed32' },
|
|
116
117
|
{ name: 'capability', type: 'string' },
|
|
117
118
|
{ name: 'capabilityArgs', type: 'json' },
|
|
118
|
-
{ name: 'enhance', type: '@qvac/enhance-mode' }
|
|
119
|
+
{ name: 'enhance', type: '@qvac/enhance-mode' },
|
|
120
|
+
{ name: 'sourceId', type: 'string' }
|
|
119
121
|
]);
|
|
120
122
|
versioned('update-chunk-operation', [
|
|
121
123
|
{ name: 'id', type: 'string', required: true },
|
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
|
}
|
|
@@ -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 {
|
|
@@ -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
|
}
|
|
@@ -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 {
|
|
@@ -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',
|