@qvac/core 1.0.0-rc.3 → 1.0.0-rc.6
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 +147 -36
- package/README.md +55 -4
- package/dist-lib/index.d.ts +2 -1
- package/dist-lib/lib/api/agents.d.ts +2 -1
- package/dist-lib/lib/api/agents.js +5 -1
- package/dist-lib/lib/api/app-config.d.ts +3 -0
- package/dist-lib/lib/api/app-config.js +20 -0
- package/dist-lib/lib/api/approval-rules.d.ts +1 -1
- package/dist-lib/lib/api/approval-rules.js +5 -1
- package/dist-lib/lib/api/config.d.ts +6 -2
- package/dist-lib/lib/api/config.js +9 -5
- package/dist-lib/lib/api/device-routes.d.ts +1 -1
- package/dist-lib/lib/api/device-routes.js +3 -1
- package/dist-lib/lib/api/index.d.ts +12 -2
- package/dist-lib/lib/api/index.js +8 -2
- package/dist-lib/lib/api/projects.js +3 -4
- package/dist-lib/lib/api/rag.js +5 -5
- package/dist-lib/lib/api/served.d.ts +2 -2
- package/dist-lib/lib/api/served.js +24 -1
- package/dist-lib/lib/assistant/harness.d.ts +3 -0
- package/dist-lib/lib/assistant/history.js +14 -2
- package/dist-lib/lib/assistant/message.d.ts +1 -0
- package/dist-lib/lib/assistant/model-round.d.ts +3 -0
- package/dist-lib/lib/assistant/model-round.js +18 -4
- package/dist-lib/lib/assistant/round-host.d.ts +2 -0
- package/dist-lib/lib/assistant/round-host.js +8 -0
- package/dist-lib/lib/assistant-tree.d.ts +2 -0
- package/dist-lib/lib/assistant-tree.js +4 -2
- package/dist-lib/lib/assistant.d.ts +12 -1
- package/dist-lib/lib/assistant.js +131 -15
- package/dist-lib/lib/client.js +4 -1
- package/dist-lib/lib/core/agent-copies.js +9 -2
- package/dist-lib/lib/core/agent-hosting.js +9 -4
- package/dist-lib/lib/core/agent.js +3 -1
- package/dist-lib/lib/core/approval-rules.d.ts +5 -1
- package/dist-lib/lib/core/approval-rules.js +16 -1
- package/dist-lib/lib/core/chat-copy.d.ts +1 -0
- package/dist-lib/lib/core/chat-copy.js +13 -2
- package/dist-lib/lib/core/chat.d.ts +0 -1
- package/dist-lib/lib/core/chat.js +0 -3
- package/dist-lib/lib/core/chunk.js +4 -3
- package/dist-lib/lib/core/collections.d.ts +7 -7
- package/dist-lib/lib/core/collections.js +7 -7
- package/dist-lib/lib/core/config-value.d.ts +1 -0
- package/dist-lib/lib/core/config-value.js +1 -0
- package/dist-lib/lib/core/contract/project-device-keys.d.ts +4 -2
- package/dist-lib/lib/core/contract/project-device-keys.js +12 -12
- package/dist-lib/lib/core/contract/project-host-keys.d.ts +5 -3
- package/dist-lib/lib/core/contract/project-host-keys.js +22 -11
- package/dist-lib/lib/core/contract/projects.d.ts +4 -2
- package/dist-lib/lib/core/contract/projects.js +29 -17
- package/dist-lib/lib/core/contract/workspace.js +2 -2
- package/dist-lib/lib/core/deleted-agent-runs.d.ts +8 -0
- package/dist-lib/lib/core/deleted-agent-runs.js +57 -0
- package/dist-lib/lib/core/files/index.d.ts +1 -1
- package/dist-lib/lib/core/files/index.js +4 -2
- package/dist-lib/lib/core/helpers/index.d.ts +1 -1
- package/dist-lib/lib/core/helpers/index.js +2 -2
- package/dist-lib/lib/core/local/index.d.ts +6 -0
- package/dist-lib/lib/core/local/index.js +14 -0
- package/dist-lib/lib/core/mesh.d.ts +2 -1
- package/dist-lib/lib/core/mesh.js +7 -5
- package/dist-lib/lib/core/project-keys.d.ts +5 -2
- package/dist-lib/lib/core/project-keys.js +15 -6
- package/dist-lib/lib/core/skill-secrets.d.ts +3 -2
- package/dist-lib/lib/core/skill-secrets.js +4 -1
- package/dist-lib/lib/core/sync/index.js +18 -6
- package/dist-lib/lib/core/vault-managed-skills.d.ts +18 -0
- package/dist-lib/lib/core/vault-managed-skills.js +105 -0
- package/dist-lib/lib/core.d.ts +10 -1
- package/dist-lib/lib/core.js +165 -31
- package/dist-lib/lib/errors.d.ts +8 -0
- package/dist-lib/lib/errors.js +8 -0
- package/dist-lib/lib/kv-cache-ledger.d.ts +22 -0
- package/dist-lib/lib/kv-cache-ledger.js +72 -0
- package/dist-lib/lib/kv-cache-retention.d.ts +1 -0
- package/dist-lib/lib/kv-cache-retention.js +5 -2
- package/dist-lib/lib/mesh-scoped-engine.js +1 -0
- package/dist-lib/lib/model-memory-cap.d.ts +3 -0
- package/dist-lib/lib/model-memory-cap.js +15 -6
- package/dist-lib/lib/run-replay.d.ts +3 -2
- package/dist-lib/lib/run-replay.js +16 -5
- package/dist-lib/lib/run-transcript.js +1 -1
- package/dist-lib/schema/config.d.ts +1 -1
- package/dist-lib/schema/config.js +1 -1
- package/dist-lib/schema/engine.js +87 -2
- package/dist-lib/schema/qvac.js +66 -3
- package/dist-lib/spec/bind.js +15 -0
- package/dist-lib/spec/calls.js +5 -0
- package/dist-lib/spec/capabilities.d.ts +10 -0
- package/dist-lib/spec/config/hyperconf/index.js +1 -1
- package/dist-lib/spec/hrpc/hrpc.json +65 -0
- package/dist-lib/spec/hrpc/index.js +63 -3
- package/dist-lib/spec/hrpc/messages.js +1302 -993
- package/dist-lib/spec/hyperschema/index.js +1302 -993
- package/dist-lib/spec/hyperschema/schema.json +227 -0
- package/dist-lib/spec/hyperschema/types.d.ts +45 -0
- package/dist-lib/spec/mesh/hyperdb/db.json +110 -0
- package/dist-lib/spec/mesh/hyperdb/index.js +498 -2
- package/dist-lib/spec/mesh/hyperdb/messages.js +1385 -892
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +561 -301
- package/dist-lib/spec/mesh/hyperschema/index.js +561 -301
- package/dist-lib/spec/mesh/hyperschema/schema.json +343 -178
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +40 -1
- package/package.json +34 -18
- package/tui/README.md +190 -0
- package/tui/app.mjs +8247 -0
- package/tui/boot.mjs +159 -0
- package/tui/index.mjs +89 -0
- package/tui/lib/boot-timing.mjs +41 -0
- package/tui/lib/busy-words.mjs +116 -0
- package/tui/lib/connect-sheet.mjs +350 -0
- package/tui/lib/device-target.mjs +64 -0
- package/tui/lib/export.mjs +194 -0
- package/tui/lib/folders-command.mjs +84 -0
- package/tui/lib/fork-command.mjs +43 -0
- package/tui/lib/knowledge-command.mjs +190 -0
- package/tui/lib/knowledge-import.mjs +153 -0
- package/tui/lib/local-path.mjs +21 -0
- package/tui/lib/move-command.mjs +17 -0
- package/tui/lib/render.mjs +225 -0
- package/tui/lib/save-file.mjs +88 -0
- package/tui/lib/select.mjs +81 -0
- package/tui/lib/selection.mjs +18 -0
- package/tui/lib/setup.mjs +135 -0
- package/tui/lib/sidebar.mjs +63 -0
- package/tui/lib/skill-connect.mjs +145 -0
- package/tui/lib/splash-art.mjs +107 -0
- package/tui/lib/splash.mjs +18 -0
- package/tui/lib/upload-frames.mjs +9 -0
- package/tui/lib/usage.mjs +59 -0
- package/tui/lib/wrap.mjs +143 -0
- package/tui/main.mjs +279 -0
- package/tui/plugins.mjs +158 -0
- package/worker/assistant-sidecar.mjs +1 -0
package/dist-lib/lib/errors.d.ts
CHANGED
|
@@ -383,6 +383,10 @@ declare const DEFINITIONS: {
|
|
|
383
383
|
readonly code: 100625;
|
|
384
384
|
readonly message: () => string;
|
|
385
385
|
};
|
|
386
|
+
readonly SKILL_SECRET_NOT_VAULT_SAFE: {
|
|
387
|
+
readonly code: 100626;
|
|
388
|
+
readonly message: () => string;
|
|
389
|
+
};
|
|
386
390
|
readonly CHAT_NOT_FOUND: {
|
|
387
391
|
readonly code: 100701;
|
|
388
392
|
readonly message: (chatId: string) => string;
|
|
@@ -499,6 +503,10 @@ declare const DEFINITIONS: {
|
|
|
499
503
|
readonly code: 100730;
|
|
500
504
|
readonly message: (chunkId: string) => string;
|
|
501
505
|
};
|
|
506
|
+
readonly APPROVAL_RULE_NOT_FOUND: {
|
|
507
|
+
readonly code: 100731;
|
|
508
|
+
readonly message: (ruleId: string) => string;
|
|
509
|
+
};
|
|
502
510
|
readonly CHAT_MOVE_NOT_FOUND: {
|
|
503
511
|
readonly code: 100801;
|
|
504
512
|
readonly message: () => string;
|
package/dist-lib/lib/errors.js
CHANGED
|
@@ -297,6 +297,10 @@ const DEFINITIONS = {
|
|
|
297
297
|
code: 100625,
|
|
298
298
|
message: () => "This chat's agent is no longer shared with you: pick another agent"
|
|
299
299
|
},
|
|
300
|
+
SKILL_SECRET_NOT_VAULT_SAFE: {
|
|
301
|
+
code: 100626,
|
|
302
|
+
message: () => 'Vault-managed skill state requires vault migration or reconnect'
|
|
303
|
+
},
|
|
300
304
|
CHAT_NOT_FOUND: {
|
|
301
305
|
code: 100701,
|
|
302
306
|
message: (chatId) => `chat not found: ${chatId}`
|
|
@@ -413,6 +417,10 @@ const DEFINITIONS = {
|
|
|
413
417
|
code: 100730,
|
|
414
418
|
message: (chunkId) => `run-request ${chunkId} is not open to take`
|
|
415
419
|
},
|
|
420
|
+
APPROVAL_RULE_NOT_FOUND: {
|
|
421
|
+
code: 100731,
|
|
422
|
+
message: (ruleId) => `no approval rule of yours: ${ruleId}`
|
|
423
|
+
},
|
|
416
424
|
CHAT_MOVE_NOT_FOUND: {
|
|
417
425
|
code: 100801,
|
|
418
426
|
message: () => 'no move of this chat is recorded on this device'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface LedgerEntry {
|
|
2
|
+
readonly chatId: string;
|
|
3
|
+
readonly meshId: string;
|
|
4
|
+
readonly served?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface KnownChats {
|
|
7
|
+
readonly live: ReadonlySet<string>;
|
|
8
|
+
readonly read: ReadonlySet<string>;
|
|
9
|
+
readonly closed: ReadonlySet<string>;
|
|
10
|
+
readonly gone: ReadonlySet<string>;
|
|
11
|
+
}
|
|
12
|
+
export declare function orphanedChats(entries: ReadonlyArray<LedgerEntry>, { live, read, closed, gone }: KnownChats): string[];
|
|
13
|
+
export declare class KvCacheLedger {
|
|
14
|
+
private readonly _dir;
|
|
15
|
+
private readonly _recorded;
|
|
16
|
+
constructor(dir: string);
|
|
17
|
+
record({ chatId, meshId, served }: LedgerEntry): Promise<void>;
|
|
18
|
+
forget(chatId: string): Promise<void>;
|
|
19
|
+
clear(): Promise<void>;
|
|
20
|
+
entries(): Promise<LedgerEntry[]>;
|
|
21
|
+
private _file;
|
|
22
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { isRecord, safeName } from './guards.js';
|
|
4
|
+
export function orphanedChats(entries, { live, read, closed, gone }) {
|
|
5
|
+
return entries
|
|
6
|
+
.filter(({ chatId, meshId, served }) => {
|
|
7
|
+
if (live.has(chatId) || closed.has(meshId))
|
|
8
|
+
return false;
|
|
9
|
+
return !served || read.has(meshId) || gone.has(meshId);
|
|
10
|
+
})
|
|
11
|
+
.map(({ chatId }) => chatId);
|
|
12
|
+
}
|
|
13
|
+
export class KvCacheLedger {
|
|
14
|
+
_dir;
|
|
15
|
+
_recorded = new Map();
|
|
16
|
+
constructor(dir) {
|
|
17
|
+
this._dir = dir;
|
|
18
|
+
}
|
|
19
|
+
async record({ chatId, meshId, served = false }) {
|
|
20
|
+
const held = `${meshId}/${served}`;
|
|
21
|
+
if (this._recorded.get(chatId) === held) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
await fs.promises.mkdir(this._dir, { recursive: true });
|
|
25
|
+
await fs.promises.writeFile(this._file(chatId), JSON.stringify({ chatId, meshId, served }));
|
|
26
|
+
this._recorded.set(chatId, held);
|
|
27
|
+
}
|
|
28
|
+
async forget(chatId) {
|
|
29
|
+
this._recorded.delete(chatId);
|
|
30
|
+
await fs.promises.rm(this._file(chatId), { force: true });
|
|
31
|
+
}
|
|
32
|
+
async clear() {
|
|
33
|
+
this._recorded.clear();
|
|
34
|
+
await fs.promises.rm(this._dir, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
async entries() {
|
|
37
|
+
let names;
|
|
38
|
+
try {
|
|
39
|
+
names = await fs.promises.readdir(this._dir);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const entries = [];
|
|
45
|
+
for (const name of names) {
|
|
46
|
+
if (!name.endsWith('.json'))
|
|
47
|
+
continue;
|
|
48
|
+
const parsed = await readJson(join(this._dir, name));
|
|
49
|
+
if (isRecord(parsed) &&
|
|
50
|
+
typeof parsed.chatId === 'string' &&
|
|
51
|
+
typeof parsed.meshId === 'string') {
|
|
52
|
+
entries.push({
|
|
53
|
+
chatId: parsed.chatId,
|
|
54
|
+
meshId: parsed.meshId,
|
|
55
|
+
served: parsed.served === true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return entries;
|
|
60
|
+
}
|
|
61
|
+
_file(chatId) {
|
|
62
|
+
return join(this._dir, `${safeName(chatId)}.json`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function readJson(file) {
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(await fs.promises.readFile(file, 'utf8'));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -64,9 +64,12 @@ export class KvCacheRetention {
|
|
|
64
64
|
}
|
|
65
65
|
this._timer = null;
|
|
66
66
|
}
|
|
67
|
-
async
|
|
67
|
+
async retentionMs() {
|
|
68
68
|
const retention = await this._engine.configGet({ key: KV_CACHE_RETENTION_KEY });
|
|
69
|
-
|
|
69
|
+
return kvCacheRetentionMs(retention.value, this._opts.defaultMs);
|
|
70
|
+
}
|
|
71
|
+
async _sweep(meshId) {
|
|
72
|
+
const retentionMs = await this.retentionMs();
|
|
70
73
|
if (retentionMs === null || !this._opts.active()) {
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
@@ -8,6 +8,9 @@ export interface ModelMemorySummary {
|
|
|
8
8
|
readonly usableBytes: number;
|
|
9
9
|
readonly capPercent: number;
|
|
10
10
|
readonly capBytes: number;
|
|
11
|
+
readonly totalBytes?: number;
|
|
12
|
+
readonly source?: string;
|
|
13
|
+
readonly gpuClass?: string;
|
|
11
14
|
}
|
|
12
15
|
export interface ModelMemoryUse extends ModelMemorySummary {
|
|
13
16
|
readonly usedBytes: number;
|
|
@@ -5,14 +5,14 @@ export function startModelMemoryCap(harness, state, { logger, onPushed } = {}) {
|
|
|
5
5
|
const lock = new ScopeLock({ debounce: true });
|
|
6
6
|
let disposed = false;
|
|
7
7
|
let pushed = null;
|
|
8
|
-
let
|
|
8
|
+
let budget = null;
|
|
9
9
|
const push = async () => {
|
|
10
10
|
const percent = memoryCapPercent(await state.get(MODEL_MEMORY_CAP_KEY));
|
|
11
11
|
if (disposed || percent === pushed || !harness.setModelMemoryCap) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
await harness.setModelMemoryCap(percent === MODEL_MEMORY_CAP_MIN ? 0 : percent);
|
|
15
|
-
|
|
15
|
+
budget ??= (await harness.capability?.())?.memoryBudget ?? null;
|
|
16
16
|
pushed = percent;
|
|
17
17
|
onPushed?.();
|
|
18
18
|
};
|
|
@@ -35,16 +35,15 @@ export function startModelMemoryCap(harness, state, { logger, onPushed } = {}) {
|
|
|
35
35
|
return {
|
|
36
36
|
summary: async () => {
|
|
37
37
|
const capPercent = pushed;
|
|
38
|
-
|
|
39
|
-
if (capPercent === null || usable === null || !harness.memoryUsage) {
|
|
38
|
+
if (capPercent === null || budget === null || !harness.memoryUsage) {
|
|
40
39
|
return null;
|
|
41
40
|
}
|
|
42
41
|
const usage = await harness.memoryUsage().catch((err) => {
|
|
43
42
|
logger?.warn('model-memory-cap', 'usage read failed', errorMessage(err));
|
|
44
43
|
return null;
|
|
45
44
|
});
|
|
46
|
-
const capBytes = Math.round((capPercent / 100) *
|
|
47
|
-
return usage && withUsage(
|
|
45
|
+
const capBytes = Math.round((capPercent / 100) * budget.availableBytes);
|
|
46
|
+
return usage && withUsage(capSummary(budget, capPercent, capBytes), usage.usedBytes);
|
|
48
47
|
},
|
|
49
48
|
stop: async () => {
|
|
50
49
|
disposed = true;
|
|
@@ -54,6 +53,16 @@ export function startModelMemoryCap(harness, state, { logger, onPushed } = {}) {
|
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
55
|
}
|
|
56
|
+
function capSummary({ availableBytes, totalBytes, source, gpuClass }, capPercent, capBytes) {
|
|
57
|
+
return {
|
|
58
|
+
usableBytes: availableBytes,
|
|
59
|
+
capPercent,
|
|
60
|
+
capBytes,
|
|
61
|
+
totalBytes,
|
|
62
|
+
source,
|
|
63
|
+
gpuClass
|
|
64
|
+
};
|
|
65
|
+
}
|
|
57
66
|
export function withUsage(cap, usedBytes) {
|
|
58
67
|
return {
|
|
59
68
|
...cap,
|
|
@@ -33,12 +33,13 @@ export declare class RunReplayStore {
|
|
|
33
33
|
private _chatDir;
|
|
34
34
|
private _holders;
|
|
35
35
|
}
|
|
36
|
+
export type ImageIdOf = (file: string) => string | undefined;
|
|
36
37
|
export interface SentRunTracker {
|
|
37
38
|
readonly used: boolean;
|
|
38
39
|
readonly onKey: boolean;
|
|
39
40
|
observe(call: Record<string, unknown>): void;
|
|
40
41
|
turns(inputLength: number): ChatMessage[] | null;
|
|
41
42
|
}
|
|
42
|
-
export declare function trackSentRun(cacheKey: string | undefined): SentRunTracker;
|
|
43
|
-
export declare function appendedTurns(sent: unknown, inputLength: number): ChatMessage[] | null;
|
|
43
|
+
export declare function trackSentRun(cacheKey: string | undefined, imageIdOf?: ImageIdOf): SentRunTracker;
|
|
44
|
+
export declare function appendedTurns(sent: unknown, inputLength: number, imageIdOf?: ImageIdOf): ChatMessage[] | null;
|
|
44
45
|
export declare function isChatMessage(value: unknown): value is ChatMessage;
|
|
@@ -99,7 +99,7 @@ export class RunReplayStore {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
export function trackSentRun(cacheKey) {
|
|
102
|
+
export function trackSentRun(cacheKey, imageIdOf) {
|
|
103
103
|
let used = false;
|
|
104
104
|
let onKey = false;
|
|
105
105
|
let last = null;
|
|
@@ -120,10 +120,10 @@ export function trackSentRun(cacheKey) {
|
|
|
120
120
|
last = null;
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
|
-
turns: (inputLength) => appendedTurns(last, inputLength)
|
|
123
|
+
turns: (inputLength) => appendedTurns(last, inputLength, imageIdOf)
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
export function appendedTurns(sent, inputLength) {
|
|
126
|
+
export function appendedTurns(sent, inputLength, imageIdOf = () => undefined) {
|
|
127
127
|
if (!Array.isArray(sent))
|
|
128
128
|
return null;
|
|
129
129
|
const offset = (isRecord(sent[0]) && sent[0].role === 'system' ? 1 : 0) + inputLength;
|
|
@@ -132,9 +132,18 @@ export function appendedTurns(sent, inputLength) {
|
|
|
132
132
|
}
|
|
133
133
|
const turns = sent
|
|
134
134
|
.slice(offset)
|
|
135
|
-
.map((turn) => (isRecord(turn) ?
|
|
135
|
+
.map((turn) => (isRecord(turn) ? sentTurn(turn, imageIdOf) : null));
|
|
136
136
|
return turns.every(isChatMessage) ? turns : null;
|
|
137
137
|
}
|
|
138
|
+
function sentTurn(turn, imageIdOf) {
|
|
139
|
+
const sent = { role: turn.role, content: turn.content };
|
|
140
|
+
const files = Array.isArray(turn.attachments) ? turn.attachments : [];
|
|
141
|
+
if (!files.length) {
|
|
142
|
+
return sent;
|
|
143
|
+
}
|
|
144
|
+
const imageIds = files.map((file) => isRecord(file) && typeof file.path === 'string' ? imageIdOf(file.path) : undefined);
|
|
145
|
+
return imageIds.every((id) => id !== undefined) ? { ...sent, imageIds } : null;
|
|
146
|
+
}
|
|
138
147
|
function mark(chatDir, reason) {
|
|
139
148
|
return fs.promises
|
|
140
149
|
.mkdir(chatDir, { recursive: true })
|
|
@@ -153,6 +162,8 @@ async function exists(path) {
|
|
|
153
162
|
export function isChatMessage(value) {
|
|
154
163
|
return (isRecord(value) &&
|
|
155
164
|
(value.role === 'user' || value.role === 'assistant' || value.role === 'tool') &&
|
|
156
|
-
typeof value.content === 'string'
|
|
165
|
+
typeof value.content === 'string' &&
|
|
166
|
+
(value.imageIds === undefined ||
|
|
167
|
+
(Array.isArray(value.imageIds) && value.imageIds.every((id) => typeof id === 'string'))));
|
|
157
168
|
}
|
|
158
169
|
function noop() { }
|
|
@@ -724,7 +724,8 @@ export function registerEngineTypes(ns) {
|
|
|
724
724
|
{ name: 'expiresAt', type: 'uint' },
|
|
725
725
|
{ name: 'agentId', type: 'string' },
|
|
726
726
|
{ name: 'effect', type: 'string' },
|
|
727
|
-
{ name: 'memberId', type: 'fixed32' }
|
|
727
|
+
{ name: 'memberId', type: 'fixed32' },
|
|
728
|
+
{ name: 'chatId', type: 'string' }
|
|
728
729
|
]
|
|
729
730
|
});
|
|
730
731
|
ns.register({
|
|
@@ -734,6 +735,13 @@ export function registerEngineTypes(ns) {
|
|
|
734
735
|
{ name: 'ourMemberId', type: 'fixed32' }
|
|
735
736
|
]
|
|
736
737
|
});
|
|
738
|
+
ns.register({
|
|
739
|
+
name: 'approval-rule-id',
|
|
740
|
+
fields: [
|
|
741
|
+
{ name: 'ruleId', type: 'string', required: true },
|
|
742
|
+
{ name: 'meshId', type: 'string', required: true }
|
|
743
|
+
]
|
|
744
|
+
});
|
|
737
745
|
ns.register({
|
|
738
746
|
name: 'chunks-by-chat-request',
|
|
739
747
|
fields: [
|
|
@@ -2276,7 +2284,10 @@ export function registerEngineTypes(ns) {
|
|
|
2276
2284
|
{ name: 'capPercent', type: 'uint', required: true },
|
|
2277
2285
|
{ name: 'capBytes', type: 'uint', required: true },
|
|
2278
2286
|
{ name: 'usedBytes', type: 'uint', required: true },
|
|
2279
|
-
{ name: 'overCap', type: 'bool', required: true }
|
|
2287
|
+
{ name: 'overCap', type: 'bool', required: true },
|
|
2288
|
+
{ name: 'totalBytes', type: 'uint' },
|
|
2289
|
+
{ name: 'source', type: 'string' },
|
|
2290
|
+
{ name: 'gpuClass', type: 'string' }
|
|
2280
2291
|
]
|
|
2281
2292
|
});
|
|
2282
2293
|
ns.register({ name: 'device-scope', fields: [{ name: 'deviceId', type: 'fixed32' }] });
|
|
@@ -2502,6 +2513,55 @@ export function registerEngineTypes(ns) {
|
|
|
2502
2513
|
{ name: 'fileIds', type: 'string', array: true, required: true }
|
|
2503
2514
|
]
|
|
2504
2515
|
});
|
|
2516
|
+
ns.register({
|
|
2517
|
+
name: 'quarantined-skill-keys',
|
|
2518
|
+
fields: [{ name: 'keys', type: 'string', array: true, required: true }]
|
|
2519
|
+
});
|
|
2520
|
+
ns.register({
|
|
2521
|
+
name: 'skill-oauth-operation',
|
|
2522
|
+
enum: ['target', 'config', 'connect', 'callback', 'cancel', 'disconnect'],
|
|
2523
|
+
strings: true
|
|
2524
|
+
});
|
|
2525
|
+
ns.register({
|
|
2526
|
+
name: 'skill-oauth-phase',
|
|
2527
|
+
enum: [
|
|
2528
|
+
'unavailable',
|
|
2529
|
+
'local',
|
|
2530
|
+
'ready',
|
|
2531
|
+
'authorize',
|
|
2532
|
+
'connected',
|
|
2533
|
+
'needs-config',
|
|
2534
|
+
'refused',
|
|
2535
|
+
'error'
|
|
2536
|
+
],
|
|
2537
|
+
strings: true
|
|
2538
|
+
});
|
|
2539
|
+
ns.register({
|
|
2540
|
+
name: 'skill-oauth-request',
|
|
2541
|
+
fields: [
|
|
2542
|
+
{ name: 'operation', type: '@assistant/skill-oauth-operation', required: true },
|
|
2543
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
2544
|
+
{ name: 'credentialKey', type: 'string', required: true },
|
|
2545
|
+
{ name: 'deviceId', type: 'fixed32' },
|
|
2546
|
+
{ name: 'attemptId', type: 'string' },
|
|
2547
|
+
{ name: 'clientId', type: 'string' },
|
|
2548
|
+
{ name: 'clientSecret', type: 'string' },
|
|
2549
|
+
{ name: 'address', type: 'string' },
|
|
2550
|
+
{ name: 'meshId', type: 'string' }
|
|
2551
|
+
]
|
|
2552
|
+
});
|
|
2553
|
+
ns.register({
|
|
2554
|
+
name: 'skill-oauth-response',
|
|
2555
|
+
fields: [
|
|
2556
|
+
{ name: 'phase', type: '@assistant/skill-oauth-phase', required: true },
|
|
2557
|
+
{ name: 'deviceId', type: 'fixed32' },
|
|
2558
|
+
{ name: 'url', type: 'string' },
|
|
2559
|
+
{ name: 'clientId', type: 'bool' },
|
|
2560
|
+
{ name: 'clientSecret', type: 'bool' },
|
|
2561
|
+
{ name: 'savedClientId', type: 'string' },
|
|
2562
|
+
{ name: 'error', type: 'string' }
|
|
2563
|
+
]
|
|
2564
|
+
});
|
|
2505
2565
|
}
|
|
2506
2566
|
export function registerEngineApi(api) {
|
|
2507
2567
|
api.register({
|
|
@@ -3494,4 +3554,29 @@ export function registerEngineApi(api) {
|
|
|
3494
3554
|
request: { name: '@assistant/files-ready-request', stream: false },
|
|
3495
3555
|
response: { name: '@assistant/file-status-list', stream: false }
|
|
3496
3556
|
});
|
|
3557
|
+
api.register({
|
|
3558
|
+
name: 'remove-approval-rule',
|
|
3559
|
+
request: { name: '@assistant/approval-rule-id', stream: false },
|
|
3560
|
+
response: { name: '@assistant/ok-response', stream: false }
|
|
3561
|
+
});
|
|
3562
|
+
api.register({
|
|
3563
|
+
name: 'list-quarantined-skills',
|
|
3564
|
+
request: { name: '@assistant/empty', stream: false },
|
|
3565
|
+
response: { name: '@assistant/quarantined-skill-keys', stream: false }
|
|
3566
|
+
});
|
|
3567
|
+
api.register({
|
|
3568
|
+
name: 'retry-quarantined-skills',
|
|
3569
|
+
request: { name: '@assistant/empty', stream: false },
|
|
3570
|
+
response: { name: '@assistant/quarantined-skill-keys', stream: false }
|
|
3571
|
+
});
|
|
3572
|
+
api.register({
|
|
3573
|
+
name: 'discard-quarantined-skills',
|
|
3574
|
+
request: { name: '@assistant/quarantined-skill-keys', stream: false },
|
|
3575
|
+
response: { name: '@assistant/quarantined-skill-keys', stream: false }
|
|
3576
|
+
});
|
|
3577
|
+
api.register({
|
|
3578
|
+
name: 'skill-oauth',
|
|
3579
|
+
request: { name: '@assistant/skill-oauth-request', stream: false },
|
|
3580
|
+
response: { name: '@assistant/skill-oauth-response', stream: false }
|
|
3581
|
+
});
|
|
3497
3582
|
}
|
package/dist-lib/schema/qvac.js
CHANGED
|
@@ -209,7 +209,8 @@ export function registerQvacTypes(ns) {
|
|
|
209
209
|
{ name: 'approvalMode', type: '@qvac/approval-mode' },
|
|
210
210
|
{ name: 'disabledToolsets', type: 'string', array: true },
|
|
211
211
|
{ name: 'lenderDeviceId', type: 'fixed32' },
|
|
212
|
-
{ name: 'sharedIn', type: 'fixed32' }
|
|
212
|
+
{ name: 'sharedIn', type: 'fixed32' },
|
|
213
|
+
{ name: 'chatRetention', type: 'string' }
|
|
213
214
|
]);
|
|
214
215
|
ns.register({
|
|
215
216
|
name: 'chat-fork-source',
|
|
@@ -350,7 +351,8 @@ export function registerQvacTypes(ns) {
|
|
|
350
351
|
{ name: 'expiresAt', type: 'uint' },
|
|
351
352
|
{ name: 'agentId', type: 'string' },
|
|
352
353
|
{ name: 'effect', type: 'string' },
|
|
353
|
-
{ name: 'memberId', type: 'fixed32' }
|
|
354
|
+
{ name: 'memberId', type: 'fixed32' },
|
|
355
|
+
{ name: 'chatId', type: 'string' }
|
|
354
356
|
]);
|
|
355
357
|
versioned('put-approval-rule-operation', [
|
|
356
358
|
{ name: 'rule', type: '@qvac/approval-rule', required: true }
|
|
@@ -687,7 +689,8 @@ export function registerQvacTypes(ns) {
|
|
|
687
689
|
{ name: 'updatedAt', type: 'uint', required: true },
|
|
688
690
|
{ name: 'createdBy', type: 'fixed32' },
|
|
689
691
|
{ name: 'deletedAt', type: 'uint' },
|
|
690
|
-
{ name: 'groupId', type: 'string' }
|
|
692
|
+
{ name: 'groupId', type: 'string' },
|
|
693
|
+
{ name: 'seedFingerprint', type: 'fixed32' }
|
|
691
694
|
]);
|
|
692
695
|
versioned('put-project-operation', [{ name: 'project', type: '@qvac/project', required: true }]);
|
|
693
696
|
versioned('set-project-listing-operation', [
|
|
@@ -798,6 +801,27 @@ export function registerQvacTypes(ns) {
|
|
|
798
801
|
{ name: 'memberId', type: 'fixed32', required: true },
|
|
799
802
|
{ name: 'sealedSeed', type: 'buffer', required: true }
|
|
800
803
|
]);
|
|
804
|
+
versioned('project-host-seal', [
|
|
805
|
+
{ name: 'projectId', type: 'fixed32', required: true },
|
|
806
|
+
{ name: 'deviceId', type: 'fixed32', required: true },
|
|
807
|
+
{ name: 'sealedBy', type: 'fixed32', required: true },
|
|
808
|
+
{ name: 'agentId', type: 'string', required: true },
|
|
809
|
+
{ name: 'sealedSeed', type: 'buffer', required: true }
|
|
810
|
+
]);
|
|
811
|
+
versioned('project-member-seal', [
|
|
812
|
+
{ name: 'projectId', type: 'fixed32', required: true },
|
|
813
|
+
{ name: 'memberId', type: 'fixed32', required: true },
|
|
814
|
+
{ name: 'sealedBy', type: 'fixed32', required: true },
|
|
815
|
+
{ name: 'boxKey', type: 'fixed32', required: true },
|
|
816
|
+
{ name: 'sealedSeed', type: 'buffer', required: true }
|
|
817
|
+
]);
|
|
818
|
+
versioned('project-device-seal', [
|
|
819
|
+
{ name: 'projectId', type: 'fixed32', required: true },
|
|
820
|
+
{ name: 'deviceId', type: 'fixed32', required: true },
|
|
821
|
+
{ name: 'sealedBy', type: 'fixed32', required: true },
|
|
822
|
+
{ name: 'memberId', type: 'fixed32', required: true },
|
|
823
|
+
{ name: 'sealedSeed', type: 'buffer', required: true }
|
|
824
|
+
]);
|
|
801
825
|
}
|
|
802
826
|
export function registerQvacCollections(dbns, helpersPath) {
|
|
803
827
|
dbns.require(helpersPath);
|
|
@@ -1304,6 +1328,45 @@ export function registerQvacCollections(dbns, helpersPath) {
|
|
|
1304
1328
|
map: 'terminalRunStatusesMap'
|
|
1305
1329
|
}
|
|
1306
1330
|
});
|
|
1331
|
+
dbns.collections.register({
|
|
1332
|
+
name: 'project-host-seals',
|
|
1333
|
+
schema: '@qvac/project-host-seal',
|
|
1334
|
+
key: ['projectId', 'deviceId', 'sealedBy']
|
|
1335
|
+
});
|
|
1336
|
+
dbns.indexes.register({
|
|
1337
|
+
name: 'project-host-seals-by-device',
|
|
1338
|
+
collection: '@qvac/project-host-seals',
|
|
1339
|
+
unique: false,
|
|
1340
|
+
key: ['deviceId']
|
|
1341
|
+
});
|
|
1342
|
+
dbns.collections.register({
|
|
1343
|
+
name: 'project-member-seals',
|
|
1344
|
+
schema: '@qvac/project-member-seal',
|
|
1345
|
+
key: ['projectId', 'memberId', 'sealedBy']
|
|
1346
|
+
});
|
|
1347
|
+
dbns.indexes.register({
|
|
1348
|
+
name: 'project-member-seals-by-member',
|
|
1349
|
+
collection: '@qvac/project-member-seals',
|
|
1350
|
+
unique: false,
|
|
1351
|
+
key: ['memberId']
|
|
1352
|
+
});
|
|
1353
|
+
dbns.collections.register({
|
|
1354
|
+
name: 'project-device-seals',
|
|
1355
|
+
schema: '@qvac/project-device-seal',
|
|
1356
|
+
key: ['projectId', 'deviceId', 'sealedBy']
|
|
1357
|
+
});
|
|
1358
|
+
dbns.indexes.register({
|
|
1359
|
+
name: 'project-device-seals-by-device',
|
|
1360
|
+
collection: '@qvac/project-device-seals',
|
|
1361
|
+
unique: false,
|
|
1362
|
+
key: ['deviceId']
|
|
1363
|
+
});
|
|
1364
|
+
dbns.indexes.register({
|
|
1365
|
+
name: 'project-device-seals-by-member',
|
|
1366
|
+
collection: '@qvac/project-device-seals',
|
|
1367
|
+
unique: false,
|
|
1368
|
+
key: ['memberId']
|
|
1369
|
+
});
|
|
1307
1370
|
}
|
|
1308
1371
|
export function registerQvacDispatch(ds) {
|
|
1309
1372
|
ds.register({ name: 'append-chunk', requestType: '@qvac/append-chunk-operation' });
|
package/dist-lib/spec/bind.js
CHANGED
|
@@ -827,4 +827,19 @@ export function bindApi(rpc, api) {
|
|
|
827
827
|
if (api.filesReady) {
|
|
828
828
|
rpc.onFilesReady((req) => api.filesReady(req));
|
|
829
829
|
}
|
|
830
|
+
if (api.removeApprovalRule) {
|
|
831
|
+
rpc.onRemoveApprovalRule((req) => api.removeApprovalRule(req));
|
|
832
|
+
}
|
|
833
|
+
if (api.listQuarantinedSkills) {
|
|
834
|
+
rpc.onListQuarantinedSkills((req) => api.listQuarantinedSkills(req));
|
|
835
|
+
}
|
|
836
|
+
if (api.retryQuarantinedSkills) {
|
|
837
|
+
rpc.onRetryQuarantinedSkills((req) => api.retryQuarantinedSkills(req));
|
|
838
|
+
}
|
|
839
|
+
if (api.discardQuarantinedSkills) {
|
|
840
|
+
rpc.onDiscardQuarantinedSkills((req) => api.discardQuarantinedSkills(req));
|
|
841
|
+
}
|
|
842
|
+
if (api.skillOauth) {
|
|
843
|
+
rpc.onSkillOauth((req) => api.skillOauth(req));
|
|
844
|
+
}
|
|
830
845
|
}
|
package/dist-lib/spec/calls.js
CHANGED
|
@@ -208,5 +208,10 @@ export function engineClient(rpc) {
|
|
|
208
208
|
hostRunLogRelease: (input) => rpc.hostRunLogRelease(input),
|
|
209
209
|
takeRunRequest: (input) => rpc.takeRunRequest(input),
|
|
210
210
|
filesReady: (input) => rpc.filesReady(input),
|
|
211
|
+
removeApprovalRule: (input) => rpc.removeApprovalRule(input),
|
|
212
|
+
listQuarantinedSkills: (input) => rpc.listQuarantinedSkills(input ?? {}),
|
|
213
|
+
retryQuarantinedSkills: (input) => rpc.retryQuarantinedSkills(input ?? {}),
|
|
214
|
+
discardQuarantinedSkills: (input) => rpc.discardQuarantinedSkills(input),
|
|
215
|
+
skillOauth: (input) => rpc.skillOauth(input),
|
|
211
216
|
};
|
|
212
217
|
}
|
|
@@ -226,6 +226,11 @@ export interface Capabilities {
|
|
|
226
226
|
hostRunLogRelease(input: T.AssistantHostRunLogReleaseRequest): Promise<T.AssistantOkResponse>
|
|
227
227
|
takeRunRequest(input: T.AssistantRunRequestRequest): Promise<T.AssistantChunk>
|
|
228
228
|
filesReady(input: T.AssistantFilesReadyRequest): Promise<T.AssistantFileStatusList>
|
|
229
|
+
removeApprovalRule(input: T.AssistantApprovalRuleId): Promise<T.AssistantOkResponse>
|
|
230
|
+
listQuarantinedSkills(input?: T.AssistantEmpty): Promise<T.AssistantQuarantinedSkillKeys>
|
|
231
|
+
retryQuarantinedSkills(input?: T.AssistantEmpty): Promise<T.AssistantQuarantinedSkillKeys>
|
|
232
|
+
discardQuarantinedSkills(input: T.AssistantQuarantinedSkillKeys): Promise<T.AssistantQuarantinedSkillKeys>
|
|
233
|
+
skillOauth(input: T.AssistantSkillOauthRequest): Promise<T.AssistantSkillOauthResponse>
|
|
229
234
|
}
|
|
230
235
|
|
|
231
236
|
export interface CapabilityHandlers {
|
|
@@ -427,4 +432,9 @@ export interface CapabilityHandlers {
|
|
|
427
432
|
hostRunLogRelease(input: T.AssistantHostRunLogReleaseRequest): T.AssistantOkResponse | Promise<T.AssistantOkResponse>
|
|
428
433
|
takeRunRequest(input: T.AssistantRunRequestRequest): T.AssistantChunk | Promise<T.AssistantChunk>
|
|
429
434
|
filesReady(input: T.AssistantFilesReadyRequest): T.AssistantFileStatusList | Promise<T.AssistantFileStatusList>
|
|
435
|
+
removeApprovalRule(input: T.AssistantApprovalRuleId): T.AssistantOkResponse | Promise<T.AssistantOkResponse>
|
|
436
|
+
listQuarantinedSkills(input?: T.AssistantEmpty): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
|
|
437
|
+
retryQuarantinedSkills(input?: T.AssistantEmpty): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
|
|
438
|
+
discardQuarantinedSkills(input: T.AssistantQuarantinedSkillKeys): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
|
|
439
|
+
skillOauth(input: T.AssistantSkillOauthRequest): T.AssistantSkillOauthResponse | Promise<T.AssistantSkillOauthResponse>
|
|
430
440
|
}
|
|
@@ -6,7 +6,7 @@ const runtime = require('hyperconf/runtime')
|
|
|
6
6
|
const productionEncoding = schema.getEncoding('@conf/config')
|
|
7
7
|
const production = decode(
|
|
8
8
|
productionEncoding,
|
|
9
|
-
runtime.b4a.from('
|
|
9
|
+
runtime.b4a.from('CD49MC4yMi4w', 'base64')
|
|
10
10
|
)
|
|
11
11
|
|
|
12
12
|
const developmentEncoding = null
|