@qvac/core 0.6.0 → 0.6.2

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 (82) hide show
  1. package/CHANGELOG.md +112 -2
  2. package/dist-lib/lib/api/chat.d.ts +1 -1
  3. package/dist-lib/lib/api/chat.js +2 -1
  4. package/dist-lib/lib/api/index.d.ts +3 -1
  5. package/dist-lib/lib/api/index.js +2 -0
  6. package/dist-lib/lib/api/watchable.d.ts +1 -0
  7. package/dist-lib/lib/api/watchable.js +1 -1
  8. package/dist-lib/lib/assistant/harness.d.ts +2 -0
  9. package/dist-lib/lib/assistant/harness.js +13 -9
  10. package/dist-lib/lib/assistant-tree.js +4 -0
  11. package/dist-lib/lib/assistant.d.ts +5 -1
  12. package/dist-lib/lib/assistant.js +66 -20
  13. package/dist-lib/lib/client.js +2 -1
  14. package/dist-lib/lib/collabora/entry.js +13 -19
  15. package/dist-lib/lib/collabora/worker.js +77 -18
  16. package/dist-lib/lib/core/chat.d.ts +1 -0
  17. package/dist-lib/lib/core/chat.js +26 -4
  18. package/dist-lib/lib/core/collections.d.ts +1 -0
  19. package/dist-lib/lib/core/collections.js +1 -0
  20. package/dist-lib/lib/core/contract/chat.d.ts +2 -0
  21. package/dist-lib/lib/core/contract/chat.js +77 -4
  22. package/dist-lib/lib/core/contract/chunks.js +5 -0
  23. package/dist-lib/lib/core/contract/compute.d.ts +1 -1
  24. package/dist-lib/lib/core/contract/compute.js +2 -1
  25. package/dist-lib/lib/core/contract/tool-activity.js +5 -0
  26. package/dist-lib/lib/core/files/index.d.ts +2 -0
  27. package/dist-lib/lib/core/files/index.js +7 -1
  28. package/dist-lib/lib/core/files/local-index.d.ts +4 -1
  29. package/dist-lib/lib/core/files/processing/index.d.ts +3 -0
  30. package/dist-lib/lib/core/files/processing/index.js +9 -0
  31. package/dist-lib/lib/core/files/processing/state.d.ts +1 -0
  32. package/dist-lib/lib/core/files/processing/state.js +5 -0
  33. package/dist-lib/lib/core/files/rag/index.d.ts +2 -0
  34. package/dist-lib/lib/core/files/rag/index.js +6 -0
  35. package/dist-lib/lib/core/files/records/index.d.ts +1 -0
  36. package/dist-lib/lib/core/files/records/index.js +1 -0
  37. package/dist-lib/lib/core/files/records/purge.d.ts +4 -0
  38. package/dist-lib/lib/core/files/records/purge.js +108 -0
  39. package/dist-lib/lib/core/files/records/reclaim.js +5 -3
  40. package/dist-lib/lib/core/files/store/blob.d.ts +1 -0
  41. package/dist-lib/lib/core/files/store/blob.js +29 -0
  42. package/dist-lib/lib/core/files/store/index.d.ts +1 -0
  43. package/dist-lib/lib/core/files/store/index.js +6 -1
  44. package/dist-lib/lib/core/local/files.d.ts +2 -0
  45. package/dist-lib/lib/core/local/files.js +31 -0
  46. package/dist-lib/lib/core/sync/index.js +14 -1
  47. package/dist-lib/lib/core.d.ts +12 -2
  48. package/dist-lib/lib/core.js +79 -16
  49. package/dist-lib/lib/credential-pusher.d.ts +8 -3
  50. package/dist-lib/lib/credential-pusher.js +4 -1
  51. package/dist-lib/lib/mesh-scoped-engine.js +3 -0
  52. package/dist-lib/lib/model-download.d.ts +11 -7
  53. package/dist-lib/lib/model-download.js +22 -21
  54. package/dist-lib/lib/models-watch.d.ts +6 -0
  55. package/dist-lib/lib/models-watch.js +45 -0
  56. package/dist-lib/schema/engine.d.ts +1 -0
  57. package/dist-lib/schema/engine.js +57 -3
  58. package/dist-lib/schema/field-order.js +3 -1
  59. package/dist-lib/schema/qvac.js +12 -1
  60. package/dist-lib/spec/bind.js +14 -0
  61. package/dist-lib/spec/calls.js +3 -0
  62. package/dist-lib/spec/capabilities.d.ts +6 -0
  63. package/dist-lib/spec/hrpc/hrpc.json +39 -0
  64. package/dist-lib/spec/hrpc/index.js +41 -4
  65. package/dist-lib/spec/hrpc/messages.js +788 -583
  66. package/dist-lib/spec/hyperschema/index.js +788 -583
  67. package/dist-lib/spec/hyperschema/schema.json +149 -0
  68. package/dist-lib/spec/hyperschema/types.d.ts +29 -0
  69. package/dist-lib/spec/mesh/hyperdb/db.json +16 -1
  70. package/dist-lib/spec/mesh/hyperdb/index.js +71 -2
  71. package/dist-lib/spec/mesh/hyperdb/messages.js +434 -227
  72. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +7 -1
  73. package/dist-lib/spec/mesh/hyperdispatch/index.js +18 -1
  74. package/dist-lib/spec/mesh/hyperdispatch/messages.js +134 -5
  75. package/dist-lib/spec/mesh/hyperschema/index.js +134 -5
  76. package/dist-lib/spec/mesh/hyperschema/schema.json +70 -1
  77. package/dist-lib/spec/mesh/hyperschema/types.d.ts +20 -1
  78. package/package.json +23 -10
  79. package/tui/app.mjs +3 -2
  80. package/tui/boot.mjs +1 -3
  81. package/dist-lib/lib/model-clamp.d.ts +0 -6
  82. package/dist-lib/lib/model-clamp.js +0 -23
@@ -1,8 +1,8 @@
1
1
  import { type AbortSignal } from 'bare-abort-controller';
2
- import { type AgentSkillModelInput } from '@qvac/harness/lib/models/model-catalog.ts';
2
+ import { type AgentSkillModelInput, type HostCapability } from '@qvac/harness/lib/models/model-catalog.ts';
3
+ import { type MusicModelChoice } from '@qvac/harness/music-catalog';
3
4
  import type { AssistantAppConfig } from '../spec/hyperschema/types.d.ts';
4
5
  import { type ModelProgressFrame } from '@qvac/harness/model-progress';
5
- import { type HostCapability } from './model-clamp.ts';
6
6
  import { type StatusRow } from './model-download-status.ts';
7
7
  import type { Logger } from './log.ts';
8
8
  export interface DownloadArgs {
@@ -33,9 +33,14 @@ interface DownloadHarness {
33
33
  name: string;
34
34
  addon: string;
35
35
  }>>;
36
- capability?(): Promise<HostCapability>;
36
+ capability?(): Promise<ProbedCapability>;
37
37
  download?(args: DownloadArgs): DownloadEventStream;
38
38
  }
39
+ type ProbedCapability = Omit<HostCapability, 'mobile'>;
40
+ interface ToolConfigRow {
41
+ toolName?: string | null;
42
+ settings?: unknown;
43
+ }
39
44
  interface ModelTransfer {
40
45
  readonly name: string;
41
46
  readonly transferId: string;
@@ -68,10 +73,7 @@ interface DownloadEngine {
68
73
  agentId: string;
69
74
  meshId: string;
70
75
  }): Promise<{
71
- configs?: ReadonlyArray<{
72
- toolName?: string | null;
73
- settings?: unknown;
74
- }> | null;
76
+ configs?: ReadonlyArray<ToolConfigRow> | null;
75
77
  }>;
76
78
  toolConfigsWatch(request: {
77
79
  agentId: string;
@@ -198,6 +200,7 @@ export declare class ModelDownloadReconciler {
198
200
  private _deviceProfile;
199
201
  private _hostCapability;
200
202
  private _refreshLocalAgentModels;
203
+ private _adoptLocalModels;
201
204
  private _musicModelChoice;
202
205
  private _begin;
203
206
  private _removeDemandWaiter;
@@ -207,4 +210,5 @@ export declare class ModelDownloadReconciler {
207
210
  private _stopActive;
208
211
  private _download;
209
212
  }
213
+ export declare function musicModelChoiceOf(configs: ReadonlyArray<ToolConfigRow | null>): MusicModelChoice | undefined;
210
214
  export {};
@@ -1,9 +1,8 @@
1
1
  import { AbortController } from 'bare-abort-controller';
2
- import { skillModelsForAgent } from '@qvac/harness/lib/models/model-catalog.ts';
3
- import { GENERATE_MUSIC_TOOL, MUSIC_MODEL_CHOICES } from '@qvac/harness/music-catalog';
2
+ import { modelsForAgent, musicModelChoiceFrom } from '@qvac/harness/lib/models/model-catalog.ts';
3
+ import { GENERATE_MUSIC_TOOL } from '@qvac/harness/music-catalog';
4
4
  import { DeadlineScheduler } from './deadline.js';
5
5
  import { DownloadSpeedSampler, progressBytes, transferProgress } from '@qvac/harness/model-progress';
6
- import { runnableModelName } from './model-clamp.js';
7
6
  import { ModelDownloadStatus } from './model-download-status.js';
8
7
  import { RetryBudget } from './retry-budget.js';
9
8
  import { unref } from './unref.js';
@@ -641,8 +640,8 @@ export class ModelDownloadReconciler {
641
640
  if (!probed?.recommendedModelName) {
642
641
  return null;
643
642
  }
644
- this._capability = probed;
645
- return probed;
643
+ this._capability = { ...probed, mobile: this._mobileClass };
644
+ return this._capability;
646
645
  }
647
646
  catch (err) {
648
647
  this._log?.warn('model-download', 'capability probe failed', err);
@@ -662,14 +661,22 @@ export class ModelDownloadReconciler {
662
661
  if (!agent.providerDeviceId || !b4a.equals(agent.providerDeviceId, this._deviceId)) {
663
662
  return;
664
663
  }
665
- const model = runnableModelName(agent.modelName, await this._hostCapability(), this._mobileClass);
664
+ const host = await this._hostCapability();
666
665
  const music = await this._musicModelChoice(activeAgentId);
667
666
  if (this._config?.activeAgentId !== activeAgentId) {
668
667
  return;
669
668
  }
670
- if (model !== agent.modelName) {
669
+ if (music.ok) {
670
+ this._musicChoice = music.choice;
671
+ }
672
+ const models = modelsForAgent({ ...agent, musicModelChoice: this._musicChoice }, host);
673
+ this._adoptLocalModels(agent.modelName, models);
674
+ }
675
+ _adoptLocalModels(requested, models) {
676
+ const model = models.find((entry) => entry.use === 'chat')?.name ?? requested;
677
+ if (model !== requested) {
671
678
  this._log?.warn('model-download', 'model clamped to what this device can run', {
672
- requested: agent.modelName,
679
+ requested,
673
680
  model
674
681
  });
675
682
  }
@@ -677,10 +684,9 @@ export class ModelDownloadReconciler {
677
684
  this._preemptLlm = model;
678
685
  }
679
686
  this._localLlm = model;
680
- if (music.ok) {
681
- this._musicChoice = music.choice;
682
- }
683
- this._localSkillModels = skillModelsForAgent({ ...agent, musicModelChoice: this._musicChoice });
687
+ this._localSkillModels = models
688
+ .filter((entry) => entry.use !== 'chat')
689
+ .map(({ name, addon }) => ({ name, addon }));
684
690
  }
685
691
  async _musicModelChoice(agentId) {
686
692
  const meshId = this._meshId();
@@ -694,13 +700,7 @@ export class ModelDownloadReconciler {
694
700
  if (!configs) {
695
701
  return { ok: false };
696
702
  }
697
- const row = configs.find((entry) => entry?.toolName === GENERATE_MUSIC_TOOL);
698
- const settings = row?.settings;
699
- if (!settings || typeof settings !== 'object') {
700
- return { ok: true, choice: undefined };
701
- }
702
- const choice = 'modelChoice' in settings ? settings.modelChoice : undefined;
703
- return { ok: true, choice: isMusicModelChoice(choice) ? choice : undefined };
703
+ return { ok: true, choice: musicModelChoiceOf(configs) };
704
704
  }
705
705
  _begin({ name, addon, total }) {
706
706
  const controller = new AbortController();
@@ -901,7 +901,8 @@ function shouldFlush(previous, { at, percentage }) {
901
901
  at - previous.at >= LOCAL_PROGRESS_INTERVAL_MS ||
902
902
  percentage - previous.percentage >= LOCAL_PROGRESS_PERCENTAGE_STEP);
903
903
  }
904
- function isMusicModelChoice(value) {
905
- return MUSIC_MODEL_CHOICES.some((choice) => choice === value);
904
+ export function musicModelChoiceOf(configs) {
905
+ const music = configs.find((entry) => entry?.toolName === GENERATE_MUSIC_TOOL);
906
+ return musicModelChoiceFrom(music?.settings);
906
907
  }
907
908
  function noop() { }
@@ -0,0 +1,6 @@
1
+ import type { AssistantModelCatalogRevision, AssistantModelInfo, AssistantModelInfoList } from '../spec/hyperschema/types.d.ts';
2
+ type Catalog = () => Promise<AsyncIterable<AssistantModelCatalogRevision> | null>;
3
+ type Read = () => Promise<AssistantModelInfo[] | null>;
4
+ export declare function watchModels(catalog: Catalog, read: Read): AsyncIterable<AssistantModelInfoList>;
5
+ export declare function asEncoded(models: AssistantModelInfo[]): AssistantModelInfo[];
6
+ export {};
@@ -0,0 +1,45 @@
1
+ import { decode, encode } from '../spec/hyperschema/index.js';
2
+ import { snapshotEquals } from './api/watchable.js';
3
+ class ModelsWatch {
4
+ _catalog;
5
+ _read;
6
+ _revisions = null;
7
+ _opening = null;
8
+ _closed = false;
9
+ _last = null;
10
+ constructor(catalog, read) {
11
+ this._catalog = catalog;
12
+ this._read = read;
13
+ }
14
+ async next() {
15
+ this._opening ??= this._open();
16
+ const revisions = await this._opening;
17
+ while (revisions && !this._closed && !(await revisions.next()).done) {
18
+ const models = this._closed ? null : await this._read();
19
+ if (models === null || this._closed || snapshotEquals(models, this._last)) {
20
+ continue;
21
+ }
22
+ this._last = models;
23
+ return { value: { models }, done: false };
24
+ }
25
+ return { value: undefined, done: true };
26
+ }
27
+ async return() {
28
+ this._closed = true;
29
+ await this._revisions?.return?.();
30
+ return { value: undefined, done: true };
31
+ }
32
+ async _open() {
33
+ this._revisions = (await this._catalog())?.[Symbol.asyncIterator]() ?? null;
34
+ if (this._closed) {
35
+ await this._revisions?.return?.();
36
+ }
37
+ return this._revisions;
38
+ }
39
+ }
40
+ export function watchModels(catalog, read) {
41
+ return { [Symbol.asyncIterator]: () => new ModelsWatch(catalog, read) };
42
+ }
43
+ export function asEncoded(models) {
44
+ return models.map((model) => decode('@assistant/model-info', encode('@assistant/model-info', model)));
45
+ }
@@ -1,3 +1,4 @@
1
1
  import { type Registry } from './content.ts';
2
+ export declare const MODEL_TASK_TYPES: readonly ['llm', 'embeddings', 'speech-to-text', 'text-to-speech', 'image-generation', 'audio-generation', 'translation', 'text-recognition', 'other'];
2
3
  export declare function registerEngineTypes(ns: Registry): void;
3
4
  export declare function registerEngineApi(api: Registry): void;
@@ -1,6 +1,17 @@
1
1
  import { registerContentTypes, versionedRegistrar } from './content.js';
2
2
  import { MEDIA_KINDS } from './media-kind.js';
3
3
  import { APP_CHANNELS, CAPABILITY_PROFILES, INDEXING_STATES } from './qvac.js';
4
+ export const MODEL_TASK_TYPES = [
5
+ 'llm',
6
+ 'embeddings',
7
+ 'speech-to-text',
8
+ 'text-to-speech',
9
+ 'image-generation',
10
+ 'audio-generation',
11
+ 'translation',
12
+ 'text-recognition',
13
+ 'other'
14
+ ];
4
15
  const rangeBounds = () => [
5
16
  { name: 'gt', type: 'uint' },
6
17
  { name: 'gte', type: 'uint' },
@@ -194,7 +205,8 @@ export function registerEngineTypes(ns) {
194
205
  { name: 'webSearchEnabled', type: 'bool' },
195
206
  { name: 'updatedAt', type: 'uint' },
196
207
  { name: 'lastActivityAt', type: 'uint' },
197
- { name: 'groupId', type: 'string' }
208
+ { name: 'groupId', type: 'string' },
209
+ { name: 'readThrough', type: 'uint' }
198
210
  ]
199
211
  });
200
212
  ns.register({
@@ -907,12 +919,15 @@ export function registerEngineTypes(ns) {
907
919
  name: 'join-mesh-request',
908
920
  fields: [{ name: 'invite', type: 'string', required: true }]
909
921
  });
922
+ ns.register({ name: 'model-task-type', enum: [...MODEL_TASK_TYPES], strings: true });
910
923
  ns.register({
911
924
  name: 'list-models-request',
912
925
  fields: [
913
926
  { name: 'type', type: 'string' },
914
927
  { name: 'cachedOnly', type: 'bool' },
915
- { name: 'fullRegistry', type: 'bool' }
928
+ { name: 'fullRegistry', type: 'bool' },
929
+ { name: 'taskType', type: '@assistant/model-task-type' },
930
+ { name: 'excludeCustom', type: 'bool' }
916
931
  ]
917
932
  });
918
933
  ns.register({
@@ -926,7 +941,9 @@ export function registerEngineTypes(ns) {
926
941
  { name: 'isLoaded', type: 'bool', required: true },
927
942
  { name: 'expectedSize', type: 'uint', required: true },
928
943
  { name: 'actualSize', type: 'uint' },
929
- { name: 'supportsImages', type: 'bool' }
944
+ { name: 'supportsImages', type: 'bool' },
945
+ { name: 'taskType', type: '@assistant/model-task-type' },
946
+ { name: 'isLoading', type: 'bool' }
930
947
  ]
931
948
  });
932
949
  ns.register({
@@ -1981,6 +1998,28 @@ export function registerEngineTypes(ns) {
1981
1998
  name: 'unload-model-response',
1982
1999
  fields: [{ name: 'unloaded', type: 'bool', required: true }]
1983
2000
  });
2001
+ ns.register({
2002
+ name: 'model-use',
2003
+ enum: ['chat', 'image', 'music'],
2004
+ strings: true
2005
+ });
2006
+ ns.register({
2007
+ name: 'model-users-request',
2008
+ fields: [{ name: 'name', type: 'string', required: true }]
2009
+ });
2010
+ ns.register({
2011
+ name: 'model-user',
2012
+ fields: [
2013
+ { name: 'agentId', type: 'string', required: true },
2014
+ { name: 'meshId', type: 'string', required: true },
2015
+ { name: 'agentName', type: 'string', required: true },
2016
+ { name: 'via', type: '@assistant/model-use', required: true }
2017
+ ]
2018
+ });
2019
+ ns.register({
2020
+ name: 'model-users',
2021
+ fields: [{ name: 'agents', type: '@assistant/model-user', array: true }]
2022
+ });
1984
2023
  }
1985
2024
  export function registerEngineApi(api) {
1986
2025
  api.register({
@@ -2728,4 +2767,19 @@ export function registerEngineApi(api) {
2728
2767
  request: { name: '@assistant/preview-custom-model-request', stream: false },
2729
2768
  response: { name: '@assistant/custom-model-preview', stream: false }
2730
2769
  });
2770
+ api.register({
2771
+ name: 'model-users',
2772
+ request: { name: '@assistant/model-users-request', stream: false },
2773
+ response: { name: '@assistant/model-users', stream: false }
2774
+ });
2775
+ api.register({
2776
+ name: 'mark-chat-read',
2777
+ request: { name: '@assistant/chat-id', stream: false },
2778
+ response: { name: '@assistant/chat', stream: false }
2779
+ });
2780
+ api.register({
2781
+ name: 'models-watch',
2782
+ request: { name: '@assistant/list-models-request', stream: false },
2783
+ response: { name: '@assistant/model-info-list', stream: true }
2784
+ });
2731
2785
  }
@@ -1,6 +1,8 @@
1
1
  import fs from 'bare-fs';
2
2
  import { spawnSync } from 'bare-subprocess';
3
- const EXEMPT = {};
3
+ const EXEMPT = {
4
+ '@qvac/seed-defaults-operation-v1.chat': 'seedableChat (lib/core/helpers/index.ts) allowlists the seed chat and leaves readThrough off it'
5
+ };
4
6
  export function assertFieldOrder(root, schemaFile, tags) {
5
7
  const current = index(JSON.parse(fs.readFileSync(schemaFile, 'utf8')).schema);
6
8
  const seen = new Set();
@@ -191,7 +191,8 @@ export function registerQvacTypes(ns) {
191
191
  { name: 'updatedAt', type: 'uint' },
192
192
  { name: 'groupId', type: 'string' },
193
193
  { name: 'rank', type: 'float64' },
194
- { name: 'rankedAt', type: 'uint' }
194
+ { name: 'rankedAt', type: 'uint' },
195
+ { name: 'readThrough', type: 'uint' }
195
196
  ]);
196
197
  ns.register({
197
198
  name: 'tool-report-entry',
@@ -539,6 +540,14 @@ export function registerQvacTypes(ns) {
539
540
  { name: 'id', type: 'string', required: true },
540
541
  { name: 'memberId', type: 'fixed32', required: true }
541
542
  ]);
543
+ versioned('purged-chat', [
544
+ { name: 'chatId', type: 'string', required: true },
545
+ { name: 'at', type: 'uint', required: true }
546
+ ]);
547
+ versioned('purge-chat-operation', [
548
+ { name: 'chatId', type: 'string', required: true },
549
+ { name: 'at', type: 'uint', required: true }
550
+ ]);
542
551
  }
543
552
  export function registerQvacCollections(dbns, helpersPath) {
544
553
  dbns.require(helpersPath);
@@ -867,6 +876,7 @@ export function registerQvacCollections(dbns, helpersPath) {
867
876
  key: ['memberId']
868
877
  });
869
878
  dbns.collections.register({ name: 'mesh-founders', schema: '@qvac/mesh-founder', key: ['id'] });
879
+ dbns.collections.register({ name: 'purged-chats', schema: '@qvac/purged-chat', key: ['chatId'] });
870
880
  }
871
881
  export function registerQvacDispatch(ds) {
872
882
  ds.register({ name: 'append-chunk', requestType: '@qvac/append-chunk-operation' });
@@ -931,4 +941,5 @@ export function registerQvacDispatch(ds) {
931
941
  ds.register({ name: 'vouched-join', requestType: '@qvac/vouched-join' });
932
942
  ds.register({ name: 'reindex-devices', requestType: '@qvac/reindex-devices-operation' });
933
943
  ds.register({ name: 'recover-device', requestType: '@qvac/recovery-claim' });
944
+ ds.register({ name: 'purge-chat', requestType: '@qvac/purge-chat-operation' });
934
945
  }
@@ -634,4 +634,18 @@ export function bindApi(rpc, api) {
634
634
  if (api.previewCustomModel) {
635
635
  rpc.onPreviewCustomModel((req) => api.previewCustomModel(req));
636
636
  }
637
+ if (api.modelUsers) {
638
+ rpc.onModelUsers((req) => api.modelUsers(req));
639
+ }
640
+ if (api.markChatRead) {
641
+ rpc.onMarkChatRead((req) => api.markChatRead(req));
642
+ }
643
+ if (api.modelsWatch) {
644
+ rpc.onModelsWatch((out) => {
645
+ const src = Readable.from(api.modelsWatch(out.data));
646
+ src.on("error", (err) => out.writeStream?.destroy(err));
647
+ pipeline(src, out, noop);
648
+ out.writeStream?.on("close", () => src.destroy());
649
+ });
650
+ }
637
651
  }
@@ -159,5 +159,8 @@ export function engineClient(rpc) {
159
159
  unloadModel: (input) => rpc.unloadModel(input),
160
160
  setModelReleased: (input) => rpc.setModelReleased(input),
161
161
  previewCustomModel: (input) => rpc.previewCustomModel(input),
162
+ modelUsers: (input) => rpc.modelUsers(input),
163
+ markChatRead: (input) => rpc.markChatRead(input),
164
+ modelsWatch: (input) => armed(rpc.modelsWatch(input)),
162
165
  };
163
166
  }
@@ -177,6 +177,9 @@ export interface Capabilities {
177
177
  unloadModel(input: T.AssistantUnloadModelRequest): Promise<T.AssistantUnloadModelResponse>
178
178
  setModelReleased(input: T.AssistantSetModelReleasedRequest): Promise<T.AssistantAppConfig>
179
179
  previewCustomModel(input: T.AssistantPreviewCustomModelRequest): Promise<T.AssistantCustomModelPreview>
180
+ modelUsers(input: T.AssistantModelUsersRequest): Promise<T.AssistantModelUsers>
181
+ markChatRead(input: T.AssistantChatId): Promise<T.AssistantChat>
182
+ modelsWatch(input: T.AssistantListModelsRequest): WatchStream<T.AssistantModelInfoList>
180
183
  }
181
184
 
182
185
  export interface CapabilityHandlers {
@@ -329,4 +332,7 @@ export interface CapabilityHandlers {
329
332
  unloadModel(input: T.AssistantUnloadModelRequest): T.AssistantUnloadModelResponse | Promise<T.AssistantUnloadModelResponse>
330
333
  setModelReleased(input: T.AssistantSetModelReleasedRequest): T.AssistantAppConfig | Promise<T.AssistantAppConfig>
331
334
  previewCustomModel(input: T.AssistantPreviewCustomModelRequest): T.AssistantCustomModelPreview | Promise<T.AssistantCustomModelPreview>
335
+ modelUsers(input: T.AssistantModelUsersRequest): T.AssistantModelUsers | Promise<T.AssistantModelUsers>
336
+ markChatRead(input: T.AssistantChatId): T.AssistantChat | Promise<T.AssistantChat>
337
+ modelsWatch(input: T.AssistantListModelsRequest): AsyncIterable<T.AssistantModelInfoList>
332
338
  }
@@ -1937,6 +1937,45 @@
1937
1937
  "stream": false
1938
1938
  },
1939
1939
  "version": 1
1940
+ },
1941
+ {
1942
+ "id": 149,
1943
+ "name": "@assistant/model-users",
1944
+ "request": {
1945
+ "name": "@assistant/model-users-request",
1946
+ "stream": false
1947
+ },
1948
+ "response": {
1949
+ "name": "@assistant/model-users",
1950
+ "stream": false
1951
+ },
1952
+ "version": 1
1953
+ },
1954
+ {
1955
+ "id": 150,
1956
+ "name": "@assistant/mark-chat-read",
1957
+ "request": {
1958
+ "name": "@assistant/chat-id",
1959
+ "stream": false
1960
+ },
1961
+ "response": {
1962
+ "name": "@assistant/chat",
1963
+ "stream": false
1964
+ },
1965
+ "version": 1
1966
+ },
1967
+ {
1968
+ "id": 151,
1969
+ "name": "@assistant/models-watch",
1970
+ "request": {
1971
+ "name": "@assistant/list-models-request",
1972
+ "stream": false
1973
+ },
1974
+ "response": {
1975
+ "name": "@assistant/model-info-list",
1976
+ "stream": true
1977
+ },
1978
+ "version": 1
1940
1979
  }
1941
1980
  ]
1942
1981
  }
@@ -303,7 +303,13 @@ const methods = new Map([
303
303
  ['@assistant/set-model-released', 147],
304
304
  [147, '@assistant/set-model-released'],
305
305
  ['@assistant/preview-custom-model', 148],
306
- [148, '@assistant/preview-custom-model']
306
+ [148, '@assistant/preview-custom-model'],
307
+ ['@assistant/model-users', 149],
308
+ [149, '@assistant/model-users'],
309
+ ['@assistant/mark-chat-read', 150],
310
+ [150, '@assistant/mark-chat-read'],
311
+ ['@assistant/models-watch', 151],
312
+ [151, '@assistant/models-watch']
307
313
  ])
308
314
 
309
315
  class HRPC {
@@ -459,7 +465,10 @@ class HRPC {
459
465
  ['@assistant/load-model', getEncoding('@assistant/load-model-request')],
460
466
  ['@assistant/unload-model', getEncoding('@assistant/unload-model-request')],
461
467
  ['@assistant/set-model-released', getEncoding('@assistant/set-model-released-request')],
462
- ['@assistant/preview-custom-model', getEncoding('@assistant/preview-custom-model-request')]
468
+ ['@assistant/preview-custom-model', getEncoding('@assistant/preview-custom-model-request')],
469
+ ['@assistant/model-users', getEncoding('@assistant/model-users-request')],
470
+ ['@assistant/mark-chat-read', getEncoding('@assistant/chat-id')],
471
+ ['@assistant/models-watch', getEncoding('@assistant/list-models-request')]
463
472
  ])
464
473
  this._responseEncodings = new Map([
465
474
  ['@assistant/config-get', getEncoding('@assistant/config-value')],
@@ -610,7 +619,10 @@ class HRPC {
610
619
  ['@assistant/load-model', getEncoding('@assistant/load-model-response')],
611
620
  ['@assistant/unload-model', getEncoding('@assistant/unload-model-response')],
612
621
  ['@assistant/set-model-released', getEncoding('@assistant/app-config')],
613
- ['@assistant/preview-custom-model', getEncoding('@assistant/custom-model-preview')]
622
+ ['@assistant/preview-custom-model', getEncoding('@assistant/custom-model-preview')],
623
+ ['@assistant/model-users', getEncoding('@assistant/model-users')],
624
+ ['@assistant/mark-chat-read', getEncoding('@assistant/chat')],
625
+ ['@assistant/models-watch', getEncoding('@assistant/model-info-list')]
614
626
  ])
615
627
  this._rpc = new RPC(stream, async (req) => {
616
628
  const command = methods.get(req.command)
@@ -1304,6 +1316,18 @@ class HRPC {
1304
1316
  return this._call('@assistant/preview-custom-model', args)
1305
1317
  }
1306
1318
 
1319
+ async modelUsers(args) {
1320
+ return this._call('@assistant/model-users', args)
1321
+ }
1322
+
1323
+ async markChatRead(args) {
1324
+ return this._call('@assistant/mark-chat-read', args)
1325
+ }
1326
+
1327
+ modelsWatch(args) {
1328
+ return this._callSync('@assistant/models-watch', args)
1329
+ }
1330
+
1307
1331
  onConfigGet(responseFn) {
1308
1332
  this._handlers['@assistant/config-get'] = responseFn
1309
1333
  }
@@ -1900,6 +1924,18 @@ class HRPC {
1900
1924
  this._handlers['@assistant/preview-custom-model'] = responseFn
1901
1925
  }
1902
1926
 
1927
+ onModelUsers(responseFn) {
1928
+ this._handlers['@assistant/model-users'] = responseFn
1929
+ }
1930
+
1931
+ onMarkChatRead(responseFn) {
1932
+ this._handlers['@assistant/mark-chat-read'] = responseFn
1933
+ }
1934
+
1935
+ onModelsWatch(responseFn) {
1936
+ this._handlers['@assistant/models-watch'] = responseFn
1937
+ }
1938
+
1903
1939
  _requestIsStream(command) {
1904
1940
  return [
1905
1941
  '@assistant/upload-attachment',
@@ -1941,7 +1977,8 @@ class HRPC {
1941
1977
  '@assistant/file-read',
1942
1978
  '@assistant/meshes-watch',
1943
1979
  '@assistant/account-watch',
1944
- '@assistant/members-watch'
1980
+ '@assistant/members-watch',
1981
+ '@assistant/models-watch'
1945
1982
  ].includes(command)
1946
1983
  }
1947
1984