@qvac/core 1.0.0-rc.5 → 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.
Files changed (108) hide show
  1. package/CHANGELOG.md +43 -2
  2. package/README.md +55 -4
  3. package/dist-lib/lib/api/agents.d.ts +2 -1
  4. package/dist-lib/lib/api/agents.js +5 -1
  5. package/dist-lib/lib/api/app-config.d.ts +3 -0
  6. package/dist-lib/lib/api/app-config.js +20 -0
  7. package/dist-lib/lib/api/device-routes.d.ts +1 -1
  8. package/dist-lib/lib/api/device-routes.js +3 -1
  9. package/dist-lib/lib/api/index.js +2 -1
  10. package/dist-lib/lib/api/projects.js +3 -4
  11. package/dist-lib/lib/api/served.d.ts +2 -2
  12. package/dist-lib/lib/api/served.js +24 -1
  13. package/dist-lib/lib/assistant/harness.d.ts +3 -0
  14. package/dist-lib/lib/assistant/history.js +14 -2
  15. package/dist-lib/lib/assistant/message.d.ts +1 -0
  16. package/dist-lib/lib/assistant/model-round.d.ts +3 -0
  17. package/dist-lib/lib/assistant/model-round.js +16 -2
  18. package/dist-lib/lib/assistant/round-host.d.ts +2 -0
  19. package/dist-lib/lib/assistant/round-host.js +8 -0
  20. package/dist-lib/lib/assistant-tree.d.ts +2 -0
  21. package/dist-lib/lib/assistant-tree.js +4 -2
  22. package/dist-lib/lib/assistant.d.ts +11 -1
  23. package/dist-lib/lib/assistant.js +115 -8
  24. package/dist-lib/lib/client.js +4 -1
  25. package/dist-lib/lib/core/agent-copies.js +2 -1
  26. package/dist-lib/lib/core/agent-hosting.js +9 -4
  27. package/dist-lib/lib/core/agent.js +2 -1
  28. package/dist-lib/lib/core/chat-copy.d.ts +1 -0
  29. package/dist-lib/lib/core/chat-copy.js +13 -2
  30. package/dist-lib/lib/core/chat.d.ts +0 -1
  31. package/dist-lib/lib/core/chat.js +0 -3
  32. package/dist-lib/lib/core/collections.d.ts +7 -7
  33. package/dist-lib/lib/core/collections.js +7 -7
  34. package/dist-lib/lib/core/contract/project-device-keys.d.ts +4 -2
  35. package/dist-lib/lib/core/contract/project-device-keys.js +12 -12
  36. package/dist-lib/lib/core/contract/project-host-keys.d.ts +5 -3
  37. package/dist-lib/lib/core/contract/project-host-keys.js +22 -11
  38. package/dist-lib/lib/core/contract/projects.d.ts +4 -2
  39. package/dist-lib/lib/core/contract/projects.js +29 -17
  40. package/dist-lib/lib/core/deleted-agent-runs.d.ts +1 -0
  41. package/dist-lib/lib/core/deleted-agent-runs.js +22 -11
  42. package/dist-lib/lib/core/helpers/index.d.ts +1 -1
  43. package/dist-lib/lib/core/helpers/index.js +2 -2
  44. package/dist-lib/lib/core/mesh.d.ts +1 -0
  45. package/dist-lib/lib/core/mesh.js +4 -4
  46. package/dist-lib/lib/core/project-keys.d.ts +5 -2
  47. package/dist-lib/lib/core/project-keys.js +15 -6
  48. package/dist-lib/lib/core/sync/index.js +5 -5
  49. package/dist-lib/lib/core.d.ts +2 -0
  50. package/dist-lib/lib/core.js +102 -25
  51. package/dist-lib/lib/kv-cache-ledger.d.ts +22 -0
  52. package/dist-lib/lib/kv-cache-ledger.js +72 -0
  53. package/dist-lib/lib/kv-cache-retention.d.ts +1 -0
  54. package/dist-lib/lib/kv-cache-retention.js +5 -2
  55. package/dist-lib/lib/model-memory-cap.d.ts +3 -0
  56. package/dist-lib/lib/model-memory-cap.js +15 -6
  57. package/dist-lib/lib/run-replay.d.ts +3 -2
  58. package/dist-lib/lib/run-replay.js +16 -5
  59. package/dist-lib/lib/run-transcript.js +1 -1
  60. package/dist-lib/schema/engine.js +54 -1
  61. package/dist-lib/schema/qvac.js +62 -1
  62. package/dist-lib/spec/bind.js +3 -0
  63. package/dist-lib/spec/calls.js +1 -0
  64. package/dist-lib/spec/capabilities.d.ts +2 -0
  65. package/dist-lib/spec/hrpc/hrpc.json +13 -0
  66. package/dist-lib/spec/hrpc/index.js +15 -3
  67. package/dist-lib/spec/hrpc/messages.js +253 -3
  68. package/dist-lib/spec/hyperschema/index.js +253 -3
  69. package/dist-lib/spec/hyperschema/schema.json +187 -0
  70. package/dist-lib/spec/hyperschema/types.d.ts +33 -0
  71. package/dist-lib/spec/mesh/hyperdb/db.json +110 -0
  72. package/dist-lib/spec/mesh/hyperdb/index.js +498 -2
  73. package/dist-lib/spec/mesh/hyperdb/messages.js +865 -410
  74. package/dist-lib/spec/mesh/hyperdispatch/messages.js +244 -3
  75. package/dist-lib/spec/mesh/hyperschema/index.js +244 -3
  76. package/dist-lib/spec/mesh/hyperschema/schema.json +155 -0
  77. package/dist-lib/spec/mesh/hyperschema/types.d.ts +37 -0
  78. package/package.json +27 -11
  79. package/tui/README.md +190 -0
  80. package/tui/app.mjs +8247 -0
  81. package/tui/boot.mjs +159 -0
  82. package/tui/index.mjs +89 -0
  83. package/tui/lib/boot-timing.mjs +41 -0
  84. package/tui/lib/busy-words.mjs +116 -0
  85. package/tui/lib/connect-sheet.mjs +350 -0
  86. package/tui/lib/device-target.mjs +64 -0
  87. package/tui/lib/export.mjs +194 -0
  88. package/tui/lib/folders-command.mjs +84 -0
  89. package/tui/lib/fork-command.mjs +43 -0
  90. package/tui/lib/knowledge-command.mjs +190 -0
  91. package/tui/lib/knowledge-import.mjs +153 -0
  92. package/tui/lib/local-path.mjs +21 -0
  93. package/tui/lib/move-command.mjs +17 -0
  94. package/tui/lib/render.mjs +225 -0
  95. package/tui/lib/save-file.mjs +88 -0
  96. package/tui/lib/select.mjs +81 -0
  97. package/tui/lib/selection.mjs +18 -0
  98. package/tui/lib/setup.mjs +135 -0
  99. package/tui/lib/sidebar.mjs +63 -0
  100. package/tui/lib/skill-connect.mjs +145 -0
  101. package/tui/lib/splash-art.mjs +107 -0
  102. package/tui/lib/splash.mjs +18 -0
  103. package/tui/lib/upload-frames.mjs +9 -0
  104. package/tui/lib/usage.mjs +59 -0
  105. package/tui/lib/wrap.mjs +143 -0
  106. package/tui/main.mjs +279 -0
  107. package/tui/plugins.mjs +158 -0
  108. package/worker/assistant-sidecar.mjs +1 -0
@@ -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
+ }
@@ -29,6 +29,7 @@ export declare class KvCacheRetention {
29
29
  sweep(meshId: string): Promise<void>;
30
30
  start(meshIds: () => Iterable<string>): void;
31
31
  stop(): void;
32
+ retentionMs(): Promise<number | null>;
32
33
  private _sweep;
33
34
  private _deleteIdle;
34
35
  }
@@ -64,9 +64,12 @@ export class KvCacheRetention {
64
64
  }
65
65
  this._timer = null;
66
66
  }
67
- async _sweep(meshId) {
67
+ async retentionMs() {
68
68
  const retention = await this._engine.configGet({ key: KV_CACHE_RETENTION_KEY });
69
- const retentionMs = kvCacheRetentionMs(retention.value, this._opts.defaultMs);
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 usableBytes = null;
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
- usableBytes ??= (await harness.capability?.())?.memoryBudget?.availableBytes ?? null;
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
- const usable = usableBytes;
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) * usable);
47
- return usage && withUsage({ usableBytes: usable, capPercent, capBytes }, usage.usedBytes);
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) ? { role: turn.role, content: turn.content } : null));
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() { }
@@ -1,6 +1,6 @@
1
1
  import { WriteQueue } from './write-queue.js';
2
2
  const COALESCE_CAP = 8192;
3
- const FLUSH_INTERVAL_MS = 250;
3
+ const FLUSH_INTERVAL_MS = 1000;
4
4
  const SLOW_WRITE_MS = 5000;
5
5
  const TRANSCRIPT = 'transcript';
6
6
  const STATUS = 'status';
@@ -2284,7 +2284,10 @@ export function registerEngineTypes(ns) {
2284
2284
  { name: 'capPercent', type: 'uint', required: true },
2285
2285
  { name: 'capBytes', type: 'uint', required: true },
2286
2286
  { name: 'usedBytes', type: 'uint', required: true },
2287
- { 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' }
2288
2291
  ]
2289
2292
  });
2290
2293
  ns.register({ name: 'device-scope', fields: [{ name: 'deviceId', type: 'fixed32' }] });
@@ -2514,6 +2517,51 @@ export function registerEngineTypes(ns) {
2514
2517
  name: 'quarantined-skill-keys',
2515
2518
  fields: [{ name: 'keys', type: 'string', array: true, required: true }]
2516
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
+ });
2517
2565
  }
2518
2566
  export function registerEngineApi(api) {
2519
2567
  api.register({
@@ -3526,4 +3574,9 @@ export function registerEngineApi(api) {
3526
3574
  request: { name: '@assistant/quarantined-skill-keys', stream: false },
3527
3575
  response: { name: '@assistant/quarantined-skill-keys', stream: false }
3528
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
+ });
3529
3582
  }
@@ -689,7 +689,8 @@ export function registerQvacTypes(ns) {
689
689
  { name: 'updatedAt', type: 'uint', required: true },
690
690
  { name: 'createdBy', type: 'fixed32' },
691
691
  { name: 'deletedAt', type: 'uint' },
692
- { name: 'groupId', type: 'string' }
692
+ { name: 'groupId', type: 'string' },
693
+ { name: 'seedFingerprint', type: 'fixed32' }
693
694
  ]);
694
695
  versioned('put-project-operation', [{ name: 'project', type: '@qvac/project', required: true }]);
695
696
  versioned('set-project-listing-operation', [
@@ -800,6 +801,27 @@ export function registerQvacTypes(ns) {
800
801
  { name: 'memberId', type: 'fixed32', required: true },
801
802
  { name: 'sealedSeed', type: 'buffer', required: true }
802
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
+ ]);
803
825
  }
804
826
  export function registerQvacCollections(dbns, helpersPath) {
805
827
  dbns.require(helpersPath);
@@ -1306,6 +1328,45 @@ export function registerQvacCollections(dbns, helpersPath) {
1306
1328
  map: 'terminalRunStatusesMap'
1307
1329
  }
1308
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
+ });
1309
1370
  }
1310
1371
  export function registerQvacDispatch(ds) {
1311
1372
  ds.register({ name: 'append-chunk', requestType: '@qvac/append-chunk-operation' });
@@ -839,4 +839,7 @@ export function bindApi(rpc, api) {
839
839
  if (api.discardQuarantinedSkills) {
840
840
  rpc.onDiscardQuarantinedSkills((req) => api.discardQuarantinedSkills(req));
841
841
  }
842
+ if (api.skillOauth) {
843
+ rpc.onSkillOauth((req) => api.skillOauth(req));
844
+ }
842
845
  }
@@ -212,5 +212,6 @@ export function engineClient(rpc) {
212
212
  listQuarantinedSkills: (input) => rpc.listQuarantinedSkills(input ?? {}),
213
213
  retryQuarantinedSkills: (input) => rpc.retryQuarantinedSkills(input ?? {}),
214
214
  discardQuarantinedSkills: (input) => rpc.discardQuarantinedSkills(input),
215
+ skillOauth: (input) => rpc.skillOauth(input),
215
216
  };
216
217
  }
@@ -230,6 +230,7 @@ export interface Capabilities {
230
230
  listQuarantinedSkills(input?: T.AssistantEmpty): Promise<T.AssistantQuarantinedSkillKeys>
231
231
  retryQuarantinedSkills(input?: T.AssistantEmpty): Promise<T.AssistantQuarantinedSkillKeys>
232
232
  discardQuarantinedSkills(input: T.AssistantQuarantinedSkillKeys): Promise<T.AssistantQuarantinedSkillKeys>
233
+ skillOauth(input: T.AssistantSkillOauthRequest): Promise<T.AssistantSkillOauthResponse>
233
234
  }
234
235
 
235
236
  export interface CapabilityHandlers {
@@ -435,4 +436,5 @@ export interface CapabilityHandlers {
435
436
  listQuarantinedSkills(input?: T.AssistantEmpty): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
436
437
  retryQuarantinedSkills(input?: T.AssistantEmpty): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
437
438
  discardQuarantinedSkills(input: T.AssistantQuarantinedSkillKeys): T.AssistantQuarantinedSkillKeys | Promise<T.AssistantQuarantinedSkillKeys>
439
+ skillOauth(input: T.AssistantSkillOauthRequest): T.AssistantSkillOauthResponse | Promise<T.AssistantSkillOauthResponse>
438
440
  }
@@ -2626,6 +2626,19 @@
2626
2626
  "stream": false
2627
2627
  },
2628
2628
  "version": 1
2629
+ },
2630
+ {
2631
+ "id": 202,
2632
+ "name": "@assistant/skill-oauth",
2633
+ "request": {
2634
+ "name": "@assistant/skill-oauth-request",
2635
+ "stream": false
2636
+ },
2637
+ "response": {
2638
+ "name": "@assistant/skill-oauth-response",
2639
+ "stream": false
2640
+ },
2641
+ "version": 1
2629
2642
  }
2630
2643
  ]
2631
2644
  }
@@ -409,7 +409,9 @@ const methods = new Map([
409
409
  ['@assistant/retry-quarantined-skills', 200],
410
410
  [200, '@assistant/retry-quarantined-skills'],
411
411
  ['@assistant/discard-quarantined-skills', 201],
412
- [201, '@assistant/discard-quarantined-skills']
412
+ [201, '@assistant/discard-quarantined-skills'],
413
+ ['@assistant/skill-oauth', 202],
414
+ [202, '@assistant/skill-oauth']
413
415
  ])
414
416
 
415
417
  class HRPC {
@@ -618,7 +620,8 @@ class HRPC {
618
620
  ['@assistant/remove-approval-rule', getEncoding('@assistant/approval-rule-id')],
619
621
  ['@assistant/list-quarantined-skills', getEncoding('@assistant/empty')],
620
622
  ['@assistant/retry-quarantined-skills', getEncoding('@assistant/empty')],
621
- ['@assistant/discard-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')]
623
+ ['@assistant/discard-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')],
624
+ ['@assistant/skill-oauth', getEncoding('@assistant/skill-oauth-request')]
622
625
  ])
623
626
  this._responseEncodings = new Map([
624
627
  ['@assistant/config-get', getEncoding('@assistant/config-value')],
@@ -822,7 +825,8 @@ class HRPC {
822
825
  ['@assistant/remove-approval-rule', getEncoding('@assistant/ok-response')],
823
826
  ['@assistant/list-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')],
824
827
  ['@assistant/retry-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')],
825
- ['@assistant/discard-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')]
828
+ ['@assistant/discard-quarantined-skills', getEncoding('@assistant/quarantined-skill-keys')],
829
+ ['@assistant/skill-oauth', getEncoding('@assistant/skill-oauth-response')]
826
830
  ])
827
831
  this._rpc = new RPC(stream, async (req) => {
828
832
  const command = methods.get(req.command)
@@ -1728,6 +1732,10 @@ class HRPC {
1728
1732
  return this._call('@assistant/discard-quarantined-skills', args)
1729
1733
  }
1730
1734
 
1735
+ async skillOauth(args) {
1736
+ return this._call('@assistant/skill-oauth', args)
1737
+ }
1738
+
1731
1739
  onConfigGet(responseFn) {
1732
1740
  this._handlers['@assistant/config-get'] = responseFn
1733
1741
  }
@@ -2536,6 +2544,10 @@ class HRPC {
2536
2544
  this._handlers['@assistant/discard-quarantined-skills'] = responseFn
2537
2545
  }
2538
2546
 
2547
+ onSkillOauth(responseFn) {
2548
+ this._handlers['@assistant/skill-oauth'] = responseFn
2549
+ }
2550
+
2539
2551
  _requestIsStream(command) {
2540
2552
  return [
2541
2553
  '@assistant/upload-attachment',