@qvac/core 0.3.5 → 0.4.1

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 (173) hide show
  1. package/CHANGELOG.md +177 -9
  2. package/README.md +19 -17
  3. package/dist-lib/lib/api/agents.d.ts +3 -3
  4. package/dist-lib/lib/api/agents.js +31 -20
  5. package/dist-lib/lib/api/approval-rules.d.ts +2 -2
  6. package/dist-lib/lib/api/approval-rules.js +2 -2
  7. package/dist-lib/lib/api/attachments.d.ts +2 -2
  8. package/dist-lib/lib/api/attachments.js +14 -25
  9. package/dist-lib/lib/api/chat-groups.d.ts +2 -2
  10. package/dist-lib/lib/api/chat-groups.js +9 -9
  11. package/dist-lib/lib/api/chat.d.ts +4 -2
  12. package/dist-lib/lib/api/chat.js +18 -18
  13. package/dist-lib/lib/api/chunks.d.ts +2 -2
  14. package/dist-lib/lib/api/chunks.js +27 -36
  15. package/dist-lib/lib/api/current-mesh.d.ts +7 -15
  16. package/dist-lib/lib/api/current-mesh.js +7 -22
  17. package/dist-lib/lib/api/devices.d.ts +4 -3
  18. package/dist-lib/lib/api/devices.js +18 -18
  19. package/dist-lib/lib/api/execution.d.ts +2 -2
  20. package/dist-lib/lib/api/execution.js +6 -6
  21. package/dist-lib/lib/api/files.d.ts +2 -2
  22. package/dist-lib/lib/api/files.js +4 -4
  23. package/dist-lib/lib/api/index.d.ts +12 -11
  24. package/dist-lib/lib/api/index.js +15 -13
  25. package/dist-lib/lib/api/inference-calls.d.ts +1 -1
  26. package/dist-lib/lib/api/inference-calls.js +2 -2
  27. package/dist-lib/lib/api/knowledge.d.ts +2 -2
  28. package/dist-lib/lib/api/knowledge.js +22 -11
  29. package/dist-lib/lib/api/local-files.d.ts +3 -0
  30. package/dist-lib/lib/api/local-files.js +23 -0
  31. package/dist-lib/lib/api/members.d.ts +6 -2
  32. package/dist-lib/lib/api/members.js +24 -17
  33. package/dist-lib/lib/api/mesh.d.ts +4 -5
  34. package/dist-lib/lib/api/mesh.js +7 -9
  35. package/dist-lib/lib/api/notifications.d.ts +2 -13
  36. package/dist-lib/lib/api/notifications.js +20 -52
  37. package/dist-lib/lib/api/rag.d.ts +2 -2
  38. package/dist-lib/lib/api/rag.js +4 -4
  39. package/dist-lib/lib/api/range.d.ts +11 -0
  40. package/dist-lib/lib/api/range.js +10 -0
  41. package/dist-lib/lib/api/sync.d.ts +2 -2
  42. package/dist-lib/lib/api/sync.js +3 -3
  43. package/dist-lib/lib/api/tool-activity.d.ts +2 -2
  44. package/dist-lib/lib/api/tool-activity.js +11 -10
  45. package/dist-lib/lib/api/tool-configs.d.ts +2 -2
  46. package/dist-lib/lib/api/tool-configs.js +6 -7
  47. package/dist-lib/lib/api/upload-frames.d.ts +9 -0
  48. package/dist-lib/lib/api/upload-frames.js +17 -0
  49. package/dist-lib/lib/api/watchable.d.ts +1 -6
  50. package/dist-lib/lib/api/watchable.js +4 -13
  51. package/dist-lib/lib/assistant/history.d.ts +3 -3
  52. package/dist-lib/lib/assistant-client.js +3 -2
  53. package/dist-lib/lib/assistant-tree.js +1 -1
  54. package/dist-lib/lib/assistant.d.ts +16 -14
  55. package/dist-lib/lib/assistant.js +166 -137
  56. package/dist-lib/lib/collabora/convert.js +1 -1
  57. package/dist-lib/lib/core/agent.d.ts +5 -7
  58. package/dist-lib/lib/core/agent.js +26 -6
  59. package/dist-lib/lib/core/archived-mesh.js +1 -0
  60. package/dist-lib/lib/core/chat-order.d.ts +20 -0
  61. package/dist-lib/lib/core/chat-order.js +96 -0
  62. package/dist-lib/lib/core/chat.d.ts +0 -5
  63. package/dist-lib/lib/core/chat.js +1 -3
  64. package/dist-lib/lib/core/chunk.d.ts +7 -14
  65. package/dist-lib/lib/core/chunk.js +17 -35
  66. package/dist-lib/lib/core/contract/agents.js +8 -0
  67. package/dist-lib/lib/core/contract/compute.d.ts +1 -1
  68. package/dist-lib/lib/core/contract/compute.js +1 -0
  69. package/dist-lib/lib/core/contract/joined-meshes.js +4 -3
  70. package/dist-lib/lib/core/contract/members.js +4 -3
  71. package/dist-lib/lib/core/contract/writers.js +5 -4
  72. package/dist-lib/lib/core/departures.js +5 -4
  73. package/dist-lib/lib/core/device-invites.js +2 -1
  74. package/dist-lib/lib/core/files/attachments.d.ts +8 -1
  75. package/dist-lib/lib/core/files/index.d.ts +4 -4
  76. package/dist-lib/lib/core/files/index.js +18 -8
  77. package/dist-lib/lib/core/files/local-index.d.ts +16 -0
  78. package/dist-lib/lib/core/files/local-index.js +38 -0
  79. package/dist-lib/lib/core/files/processing/document.js +2 -1
  80. package/dist-lib/lib/core/files/processing/ownership.js +6 -3
  81. package/dist-lib/lib/core/files/records/chunks.js +1 -0
  82. package/dist-lib/lib/core/files/records/reclaim.js +1 -0
  83. package/dist-lib/lib/core/files/records/routing.js +2 -1
  84. package/dist-lib/lib/core/files/store/blob.d.ts +1 -1
  85. package/dist-lib/lib/core/files/store/blob.js +6 -3
  86. package/dist-lib/lib/core/files/store/index.d.ts +1 -1
  87. package/dist-lib/lib/core/files/store/reference.js +4 -3
  88. package/dist-lib/lib/core/files/store/server.d.ts +8 -4
  89. package/dist-lib/lib/core/files/store/server.js +16 -12
  90. package/dist-lib/lib/core/files/store/sweep.js +2 -1
  91. package/dist-lib/lib/core/files/upload.d.ts +1 -1
  92. package/dist-lib/lib/core/hosted-agents.js +1 -1
  93. package/dist-lib/lib/core/image/cache-sweep.d.ts +1 -0
  94. package/dist-lib/lib/core/image/cache-sweep.js +7 -3
  95. package/dist-lib/lib/core/local/files.d.ts +24 -0
  96. package/dist-lib/lib/core/local/files.js +154 -0
  97. package/dist-lib/lib/core/local/index.d.ts +21 -5
  98. package/dist-lib/lib/core/local/index.js +75 -45
  99. package/dist-lib/lib/core/membership.d.ts +4 -1
  100. package/dist-lib/lib/core/membership.js +17 -2
  101. package/dist-lib/lib/core/mesh.d.ts +5 -0
  102. package/dist-lib/lib/core/mesh.js +10 -5
  103. package/dist-lib/lib/core/migrations/agent-indexes.d.ts +2 -0
  104. package/dist-lib/lib/core/migrations/agent-indexes.js +30 -0
  105. package/dist-lib/lib/core/migrations/file-index.d.ts +2 -0
  106. package/dist-lib/lib/core/migrations/file-index.js +27 -0
  107. package/dist-lib/lib/core/migrations/index.js +3 -1
  108. package/dist-lib/lib/core/notification.js +5 -5
  109. package/dist-lib/lib/core/range.d.ts +18 -0
  110. package/dist-lib/lib/core/range.js +17 -0
  111. package/dist-lib/lib/core/sync/index.js +39 -32
  112. package/dist-lib/lib/core/sync-status.js +3 -2
  113. package/dist-lib/lib/core/tool-activity.d.ts +2 -5
  114. package/dist-lib/lib/core/tool-activity.js +4 -7
  115. package/dist-lib/lib/core.d.ts +48 -29
  116. package/dist-lib/lib/core.js +465 -359
  117. package/dist-lib/lib/knowledge-search.d.ts +2 -2
  118. package/dist-lib/lib/kv-cache.js +1 -1
  119. package/dist-lib/lib/log.js +2 -3
  120. package/dist-lib/lib/mesh-scoped-engine.d.ts +8 -1
  121. package/dist-lib/lib/mesh-scoped-engine.js +62 -15
  122. package/dist-lib/lib/model-download.d.ts +14 -5
  123. package/dist-lib/lib/model-download.js +25 -17
  124. package/dist-lib/lib/oauth/browser-connect.d.ts +0 -14
  125. package/dist-lib/lib/oauth/browser-connect.js +1 -26
  126. package/dist-lib/lib/oauth/token-exchange.d.ts +1 -2
  127. package/dist-lib/lib/oauth/token-exchange.js +1 -4
  128. package/dist-lib/lib/run-transcript.d.ts +2 -2
  129. package/dist-lib/lib/run-transcript.js +3 -2
  130. package/dist-lib/lib/task.d.ts +1 -0
  131. package/dist-lib/lib/task.js +3 -2
  132. package/dist-lib/schema/build.js +4 -10
  133. package/dist-lib/schema/engine.js +261 -91
  134. package/dist-lib/schema/field-order.js +1 -4
  135. package/dist-lib/schema/helpers.d.ts +4 -0
  136. package/dist-lib/schema/helpers.js +20 -0
  137. package/dist-lib/schema/local.d.ts +1 -1
  138. package/dist-lib/schema/local.js +70 -2
  139. package/dist-lib/schema/qvac.js +30 -0
  140. package/dist-lib/spec/bind.js +20 -3
  141. package/dist-lib/spec/calls.js +19 -15
  142. package/dist-lib/spec/capabilities.d.ts +42 -34
  143. package/dist-lib/spec/hrpc/hrpc.json +82 -30
  144. package/dist-lib/spec/hrpc/index.js +106 -57
  145. package/dist-lib/spec/hrpc/messages.js +5420 -5019
  146. package/dist-lib/spec/hyperschema/index.js +5424 -5023
  147. package/dist-lib/spec/hyperschema/schema.json +3202 -2666
  148. package/dist-lib/spec/hyperschema/types.d.ts +455 -319
  149. package/dist-lib/spec/local/hyperdb/db.json +119 -1
  150. package/dist-lib/spec/local/hyperdb/index.js +414 -2
  151. package/dist-lib/spec/local/hyperdb/messages.js +505 -124
  152. package/dist-lib/spec/local/hyperschema/index.js +203 -5
  153. package/dist-lib/spec/local/hyperschema/schema.json +136 -1
  154. package/dist-lib/spec/local/hyperschema/types.d.ts +32 -1
  155. package/dist-lib/spec/mesh/hyperdb/db.json +55 -3
  156. package/dist-lib/spec/mesh/hyperdb/index.js +119 -3
  157. package/dist-lib/spec/mesh/hyperdb/messages.js +244 -172
  158. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +7 -1
  159. package/dist-lib/spec/mesh/hyperdispatch/index.js +18 -1
  160. package/dist-lib/spec/mesh/hyperdispatch/messages.js +74 -2
  161. package/dist-lib/spec/mesh/hyperschema/index.js +74 -2
  162. package/dist-lib/spec/mesh/hyperschema/schema.json +27 -1
  163. package/dist-lib/spec/mesh/hyperschema/types.d.ts +9 -1
  164. package/package.json +15 -9
  165. package/tui/app.mjs +376 -151
  166. package/tui/boot.mjs +2 -1
  167. package/tui/lib/busy-words.mjs +2 -1
  168. package/tui/lib/knowledge-command.mjs +11 -10
  169. package/tui/lib/knowledge-import.mjs +7 -5
  170. package/tui/lib/render.mjs +4 -3
  171. package/tui/lib/usage.mjs +2 -1
  172. package/tui/main.mjs +2 -1
  173. package/tui/lib/projection-env.mjs +0 -24
@@ -1,15 +1,16 @@
1
- import { appendChunk, listAttachmentsByKind, listChunks, listRunRequests, resolveApproval, updateChunk } from '../core/chunk.js';
1
+ import { appendChunk, listAttachmentsByKind, listChunks, listRunRequests, recordLinks, resolveApproval, updateChunk } from '../core/chunk.js';
2
2
  import { meshWatchable, requireMesh } from './current-mesh.js';
3
- export function createChunksApi(current, deviceId) {
3
+ import { bounds } from './range.js';
4
+ export function createChunksApi(pool, deviceId) {
4
5
  return {
5
- appendChunk: async ({ meshId, ...input }) => appendChunk(await requireMesh(current, meshId), input),
6
- updateChunk: async ({ meshId, ...input }) => {
7
- await updateChunk(await requireMesh(current, meshId), input);
6
+ appendChunk: async ({ meshId, ...input }) => appendChunk(await requireMesh(pool, meshId), input),
7
+ updateChunk: async ({ meshId, chunkId, runStatus }) => {
8
+ await updateChunk(await requireMesh(pool, meshId), { id: chunkId, runStatus });
8
9
  return { ok: true };
9
10
  },
10
11
  resolveApproval: async (input) => {
11
- await resolveApproval(await requireMesh(current, input.meshId), {
12
- id: input.id,
12
+ await resolveApproval(await requireMesh(pool, input.meshId), {
13
+ id: input.chunkId,
13
14
  approved: input.approved === true,
14
15
  scope: input.scope ?? undefined,
15
16
  expiresAt: input.expiresAt || undefined,
@@ -17,35 +18,25 @@ export function createChunksApi(current, deviceId) {
17
18
  });
18
19
  return { ok: true };
19
20
  },
20
- listChunks: async ({ chatId, type, types, fromSeq, reverse, limit, meshId }) => ({
21
- chunks: await listChunks(await requireMesh(current, meshId), {
22
- chatId,
23
- type: type ?? undefined,
24
- types: types ?? undefined,
25
- fromSeq: fromSeq || undefined,
26
- reverse: reverse === true,
27
- limit: limit || undefined
28
- })
29
- }),
30
- listAttachmentsByKind: async ({ kind, origin, fromCreatedAt, reverse, limit }) => ({
31
- chunks: await listAttachmentsByKind(await requireMesh(current), {
32
- kind,
33
- origin: origin ?? undefined,
34
- fromCreatedAt: fromCreatedAt || undefined,
35
- reverse: reverse === true,
36
- limit: limit || undefined
37
- })
38
- }),
39
- chunksWatch: meshWatchable('chunksWatch', current, async ({ chatId, type, types, fromSeq, reverse, limit }, mesh) => ({
40
- chunks: await listChunks(mesh, {
41
- chatId,
42
- type: type ?? undefined,
43
- types: types ?? undefined,
44
- fromSeq: fromSeq || undefined,
45
- reverse: reverse === true,
46
- limit: limit || undefined
47
- })
21
+ listChunks: async ({ meshId, ...input }) => {
22
+ const mesh = await requireMesh(pool, meshId);
23
+ return { chunks: await recordLinks(mesh, await listChunks(mesh, chunkSelection(input))) };
24
+ },
25
+ listAttachmentsByKind: async ({ meshId, ...input }) => {
26
+ const mesh = await requireMesh(pool, meshId);
27
+ const chunks = await listAttachmentsByKind(mesh, {
28
+ ...bounds(input),
29
+ kind: input.kind,
30
+ origin: input.origin ?? undefined
31
+ });
32
+ return { chunks: await recordLinks(mesh, chunks) };
33
+ },
34
+ chunksWatch: meshWatchable('chunksWatch', pool, async ({ meshId, ...input }, mesh) => ({
35
+ chunks: await recordLinks(mesh, await listChunks(mesh, chunkSelection(input)))
48
36
  })),
49
- runRequestsWatch: meshWatchable('runRequestsWatch', current, async (_request, mesh) => ({ chunks: await listRunRequests(mesh, deviceId) }))
37
+ runRequestsWatch: meshWatchable('runRequestsWatch', pool, async (_request, mesh) => ({ chunks: await listRunRequests(mesh, deviceId) }))
50
38
  };
51
39
  }
40
+ function chunkSelection({ chatId, type, types, ...rest }) {
41
+ return { ...bounds(rest), chatId, type: type ?? undefined, types: types ?? undefined };
42
+ }
@@ -1,21 +1,13 @@
1
1
  import type { Mesh } from '../core/mesh.ts';
2
- import { type WatchPin } from './watchable.ts';
3
- export interface CurrentMesh {
4
- (meshId?: string | null): Mesh | null | Promise<Mesh | null>;
5
- readonly selection?: MeshSelection;
6
- }
7
- export interface MeshSelection {
8
- key(): string | null;
2
+ export type MeshPool = (meshId: string) => Mesh | null | Promise<Mesh | null>;
3
+ export declare const NO_SUCH_MESH = "no such mesh";
4
+ export declare function requireMesh(pool: MeshPool, meshId: string): Promise<Mesh>;
5
+ export declare function isMissingMesh(err: unknown): boolean;
6
+ export declare function meshWatchable<TRequest extends MeshScoped, TResult>(name: string, pool: MeshPool, query: (request: TRequest, mesh: Mesh) => Promise<TResult>, changes?: {
9
7
  watch(listener: () => void): void;
10
8
  unwatch(listener: () => void): void;
11
- }
12
- export declare const NO_ACTIVE_MESH = "no active mesh";
13
- export declare const NO_SUCH_MESH = "no such mesh";
14
- export declare function requireMesh(current: CurrentMesh, meshId?: string | null): Promise<Mesh>;
15
- export declare function isMeshTransition(err: unknown): boolean;
16
- export declare function meshWatchable<TRequest extends MeshScoped | undefined, TResult>(name: string, current: CurrentMesh, query: (request: TRequest, mesh: Mesh) => Promise<TResult>): (request: TRequest) => import("streamx").Readable<import("streamx").ReadableEvents> & AsyncIterable<TResult>;
17
- export declare function selectionPin(current: CurrentMesh, meshId?: string | null): WatchPin | null;
9
+ }): (request: TRequest) => import("streamx").Readable<import("streamx").ReadableEvents> & AsyncIterable<TResult>;
18
10
  interface MeshScoped {
19
- readonly meshId?: string | null;
11
+ readonly meshId: string;
20
12
  }
21
13
  export {};
@@ -1,31 +1,16 @@
1
1
  import { watchable } from './watchable.js';
2
- export const NO_ACTIVE_MESH = 'no active mesh';
3
2
  export const NO_SUCH_MESH = 'no such mesh';
4
- export async function requireMesh(current, meshId) {
5
- const mesh = await current(meshId);
3
+ export async function requireMesh(pool, meshId) {
4
+ const mesh = await pool(meshId);
6
5
  if (!mesh)
7
- throw new Error(meshId ? `${NO_SUCH_MESH}: ${meshId}` : NO_ACTIVE_MESH);
6
+ throw new Error(`${NO_SUCH_MESH}: ${meshId}`);
8
7
  if (!mesh.opened)
9
8
  await mesh.ready();
10
9
  return mesh;
11
10
  }
12
- export function isMeshTransition(err) {
13
- return err instanceof Error && err.message === NO_ACTIVE_MESH;
11
+ export function isMissingMesh(err) {
12
+ return err instanceof Error && err.message.startsWith(`${NO_SUCH_MESH}: `);
14
13
  }
15
- export function meshWatchable(name, current, query) {
16
- return watchable(name, (request) => requireMesh(current, request?.meshId), query, (request) => selectionPin(current, request?.meshId));
17
- }
18
- export function selectionPin(current, meshId) {
19
- const selection = current.selection;
20
- if (meshId || !selection)
21
- return null;
22
- const opened = selection.key();
23
- return {
24
- stale: () => {
25
- const now = selection.key();
26
- return now !== null && now !== opened;
27
- },
28
- watch: (listener) => selection.watch(listener),
29
- unwatch: (listener) => selection.unwatch(listener)
30
- };
14
+ export function meshWatchable(name, pool, query, changes) {
15
+ return watchable(name, (request) => requireMesh(pool, request.meshId), query, changes);
31
16
  }
@@ -1,8 +1,9 @@
1
1
  import type { AssistantCapabilityProfile } from '../../spec/hyperschema/types.d.ts';
2
- import { type CurrentMesh } from './current-mesh.ts';
2
+ import type { Mesh } from '../core/mesh.ts';
3
+ import { type MeshPool } from './current-mesh.ts';
3
4
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
4
- export declare function createDevicesApi(current: CurrentMesh, deviceId: Buffer, removeWriter: (writerKey: Buffer, deviceId: Buffer) => Promise<void>, renameLocal: (name: string) => Promise<void>, saveProfileLocal: (capabilityProfile: AssistantCapabilityProfile, recommendedModelName: string, platform?: string) => Promise<void>, readLocalProfile: () => {
5
+ export declare function createDevicesApi(pool: MeshPool, deviceId: Buffer, removeWriter: (writerKey: Buffer, deviceId: Buffer, mesh: Mesh) => Promise<void>, renameLocal: (name: string) => Promise<void>, saveProfileLocal: (capabilityProfile: AssistantCapabilityProfile, recommendedModelName: string, platform?: string) => Promise<void>, readLocalProfile: () => {
5
6
  capabilityProfile: AssistantCapabilityProfile;
6
7
  recommendedModelName: string;
7
8
  platform?: string;
8
- } | null, computeLender?: (() => Promise<Buffer | null>) | null): Pick<CapabilityHandlers, 'listDevices' | 'devicesWatch' | 'deviceInfo' | 'saveDeviceCapabilities' | 'saveDeviceProfile' | 'removeDevice' | 'renameDevice'>;
9
+ } | null, computeLender?: (() => Promise<Buffer | null>) | null): Pick<CapabilityHandlers, 'listDevices' | 'getDevice' | 'devicesWatch' | 'deviceInfo' | 'saveDeviceCapabilities' | 'saveDeviceProfile' | 'removeDevice' | 'renameDevice'>;
@@ -1,6 +1,7 @@
1
1
  import { MAX_DEVICE_NAME_CHARS, deviceNameWithinBounds } from '../../schema/qvac.js';
2
2
  import { saveDeviceCapabilities } from '../core/devices.js';
3
3
  import { meshWatchable, requireMesh } from './current-mesh.js';
4
+ import b4a from 'b4a';
4
5
  const DEVICES = '@qvac/devices';
5
6
  function toEngineDevice(device, overrides = {}) {
6
7
  return {
@@ -24,13 +25,13 @@ function toEngineDevice(device, overrides = {}) {
24
25
  ...overrides
25
26
  };
26
27
  }
27
- export function createDevicesApi(current, deviceId, removeWriter, renameLocal, saveProfileLocal, readLocalProfile, computeLender = null) {
28
+ export function createDevicesApi(pool, deviceId, removeWriter, renameLocal, saveProfileLocal, readLocalProfile, computeLender = null) {
28
29
  const mustGetDevice = async (mesh, id) => {
29
30
  const snap = mesh.view.snapshot();
30
31
  try {
31
32
  const device = await snap.get(DEVICES, { id });
32
33
  if (!device)
33
- throw new Error(`device not found: ${id.toString('hex')}`);
34
+ throw new Error(`device not found: ${b4a.toHex(id)}`);
34
35
  return device;
35
36
  }
36
37
  finally {
@@ -48,15 +49,16 @@ export function createDevicesApi(current, deviceId, removeWriter, renameLocal, s
48
49
  }
49
50
  };
50
51
  return {
51
- listDevices: async (request) => list(await requireMesh(current, request?.meshId)),
52
- devicesWatch: meshWatchable('devicesWatch', current, (_request, mesh) => list(mesh)),
52
+ listDevices: async (request) => list(await requireMesh(pool, request.meshId)),
53
+ getDevice: async ({ deviceId: id, meshId }) => toEngineDevice(await mustGetDevice(await requireMesh(pool, meshId), id)),
54
+ devicesWatch: meshWatchable('devicesWatch', pool, (_request, mesh) => list(mesh)),
53
55
  deviceInfo: async () => {
54
56
  logger.info(['api', 'devices'], 'deviceInfo handler reached');
55
57
  const computeLenderId = (await computeLender?.()) ?? undefined;
56
58
  return { id: deviceId, supportsKvCacheDeletion: true, computeLenderId };
57
59
  },
58
60
  saveDeviceCapabilities: async (input) => {
59
- await saveDeviceCapabilities(await requireMesh(current), {
61
+ await saveDeviceCapabilities(await requireMesh(pool, input.meshId), {
60
62
  deviceId,
61
63
  installedToolNames: input.installedToolNames ?? [],
62
64
  installedSkillNames: input.installedSkillNames ?? [],
@@ -67,29 +69,27 @@ export function createDevicesApi(current, deviceId, removeWriter, renameLocal, s
67
69
  });
68
70
  return { ok: true };
69
71
  },
70
- removeDevice: async ({ id }) => {
71
- if (id.equals(deviceId))
72
+ removeDevice: async ({ deviceId: target, meshId }) => {
73
+ if (target.equals(deviceId))
72
74
  throw new Error('cannot remove own device, use leaveMesh');
73
- const device = await mustGetDevice(await requireMesh(current), id);
75
+ const mesh = await requireMesh(pool, meshId);
76
+ const device = await mustGetDevice(mesh, target);
74
77
  if (device.revoked)
75
78
  return { ok: true };
76
79
  if (!device.writerKey)
77
80
  throw new Error('device has no writer key, cannot remove');
78
- await removeWriter(device.writerKey, id);
81
+ await removeWriter(device.writerKey, target, mesh);
79
82
  return { ok: true };
80
83
  },
81
- renameDevice: async ({ id, name }) => {
82
- if (!id.equals(deviceId)) {
83
- throw new Error('can only rename this device, a device owns its row');
84
- }
85
- const trimmed = name.trim();
84
+ renameDevice: async ({ meshId, config }) => {
85
+ const trimmed = config.name.trim();
86
86
  if (!trimmed)
87
87
  throw new Error('device name must not be empty');
88
88
  if (!deviceNameWithinBounds(trimmed)) {
89
89
  throw new Error(`device name must be at most ${MAX_DEVICE_NAME_CHARS} characters`);
90
90
  }
91
- const mesh = await requireMesh(current);
92
- const device = await mustGetDevice(mesh, id);
91
+ const mesh = await requireMesh(pool, meshId);
92
+ const device = await mustGetDevice(mesh, deviceId);
93
93
  await renameLocal(trimmed);
94
94
  try {
95
95
  await mesh.dispatch('update-device', { device: { ...device, name: trimmed } });
@@ -100,8 +100,8 @@ export function createDevicesApi(current, deviceId, removeWriter, renameLocal, s
100
100
  }
101
101
  return toEngineDevice(device, { name: trimmed });
102
102
  },
103
- saveDeviceProfile: async ({ capabilityProfile, recommendedModelName, platform }) => {
104
- const mesh = await requireMesh(current);
103
+ saveDeviceProfile: async ({ capabilityProfile, recommendedModelName, platform, meshId }) => {
104
+ const mesh = await requireMesh(pool, meshId);
105
105
  const prior = readLocalProfile();
106
106
  await saveProfileLocal(capabilityProfile, recommendedModelName, platform ?? undefined);
107
107
  try {
@@ -1,3 +1,3 @@
1
- import { type CurrentMesh } from './current-mesh.ts';
1
+ import { type MeshPool } from './current-mesh.ts';
2
2
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
3
- export declare function createExecutionApi(current: CurrentMesh, deviceId: Buffer): Pick<CapabilityHandlers, 'sendMessage' | 'runAgent' | 'stopRun'>;
3
+ export declare function createExecutionApi(pool: MeshPool, deviceId: Buffer): Pick<CapabilityHandlers, 'sendMessage' | 'runAgent' | 'stopRun'>;
@@ -3,9 +3,9 @@ import { randomId } from '../core/id.js';
3
3
  import { parentRequestId, sendMessage } from '../core/send.js';
4
4
  import { requireMesh } from './current-mesh.js';
5
5
  const TERMINAL_STATES = new Set(['completed', 'failed', 'canceled']);
6
- export function createExecutionApi(current, deviceId) {
6
+ export function createExecutionApi(pool, deviceId) {
7
7
  return {
8
- sendMessage: async (input) => sendMessage(await requireMesh(current), {
8
+ sendMessage: async (input) => sendMessage(await requireMesh(pool, input.meshId), {
9
9
  text: input.text,
10
10
  chatId: input.chatId ?? undefined,
11
11
  agentId: input.agentId ?? undefined,
@@ -13,8 +13,8 @@ export function createExecutionApi(current, deviceId) {
13
13
  parentRunId: input.parentRunId ?? undefined,
14
14
  originDeviceId: deviceId
15
15
  }),
16
- runAgent: async ({ chatId, agentId, parentRunId }) => {
17
- const mesh = await requireMesh(current);
16
+ runAgent: async ({ chatId, agentId, parentRunId, meshId }) => {
17
+ const mesh = await requireMesh(pool, meshId);
18
18
  const parentId = parentRunId ? await parentRequestId(mesh, chatId, parentRunId) : undefined;
19
19
  await appendChunk(mesh, {
20
20
  chatId,
@@ -26,8 +26,8 @@ export function createExecutionApi(current, deviceId) {
26
26
  });
27
27
  return { ok: true };
28
28
  },
29
- stopRun: async ({ chatId, runId }) => {
30
- const mesh = await requireMesh(current);
29
+ stopRun: async ({ chatId, runId, meshId }) => {
30
+ const mesh = await requireMesh(pool, meshId);
31
31
  const statuses = await listChunks(mesh, { chatId, type: 'run-status' });
32
32
  const settled = statuses.some((c) => c.runId === runId && TERMINAL_STATES.has(c.runStatus?.state ?? ''));
33
33
  if (settled)
@@ -1,3 +1,3 @@
1
1
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
2
- import { type CurrentMesh } from './current-mesh.ts';
3
- export declare function createFilesApi(current: CurrentMesh): Pick<CapabilityHandlers, 'fileRead' | 'filePreview' | 'fileRetry'>;
2
+ import { type MeshPool } from './current-mesh.ts';
3
+ export declare function createFilesApi(pool: MeshPool): Pick<CapabilityHandlers, 'fileRead' | 'filePreview' | 'fileRetry'>;
@@ -1,19 +1,19 @@
1
1
  import { AbortController } from 'bare-abort-controller';
2
2
  import { Readable } from 'streamx';
3
3
  import { requireMesh } from './current-mesh.js';
4
- export function createFilesApi(current) {
4
+ export function createFilesApi(pool) {
5
5
  return {
6
6
  async filePreview(request) {
7
- return (await requireMesh(current)).files.preview(request);
7
+ return (await requireMesh(pool, request.meshId)).files.preview(request);
8
8
  },
9
9
  async fileRetry(request) {
10
- await (await requireMesh(current)).files.retry(request);
10
+ await (await requireMesh(pool, request.meshId)).files.retry(request);
11
11
  return { ok: true };
12
12
  },
13
13
  fileRead(request) {
14
14
  const abort = new AbortController();
15
15
  async function* read() {
16
- const mesh = await requireMesh(current, request.meshId);
16
+ const mesh = await requireMesh(pool, request.meshId);
17
17
  const close = () => stream.destroy();
18
18
  mesh.files.once('close', close);
19
19
  try {
@@ -1,18 +1,17 @@
1
1
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
2
2
  import type { AssistantCapabilityProfile, AssistantClearModelDownloadRequest, AssistantDeleteModelRequest, AssistantDeleteModelResponse, AssistantCompactChatResponse, AssistantKvCacheDeletionResponse, AssistantListModelsRequest, AssistantModelCatalogRevision, AssistantCopySkillResponse, AssistantDeleteSkillResponse, AssistantManagedSkillsResponse, AssistantModelInfoList, AssistantOkResponse, AssistantPushSkillSecretRequest, AssistantSkillCatalogResponse, AssistantSkillFileResponse, AssistantSpeakRequest, AssistantSpeakResponse, AssistantToolCatalogResponse, AssistantTranscribeRequest, AssistantTranscribeResponse } from '../../spec/hyperschema/types.d.ts';
3
3
  import type { openLocalStore } from '../core/local/index.ts';
4
- import type { CurrentMesh } from './current-mesh.ts';
4
+ import type { Mesh } from '../core/mesh.ts';
5
+ import type { MeshPool } from './current-mesh.ts';
5
6
  import { type DiagnosticsSource } from './diagnostics.ts';
6
7
  import { type InferenceCallReader } from './inference-calls.ts';
7
8
  import { type LogSource } from './logs.ts';
8
9
  import { type MeshStatusSource } from './mesh.ts';
9
10
  import { type NetworkSource } from './network.ts';
10
- import { type NotificationLifetime } from './notifications.ts';
11
11
  import type { IndexingEmbedder, VectorIndex } from '../core/files/index.ts';
12
12
  interface ApiDeps {
13
13
  state?: Awaited<ReturnType<typeof openLocalStore>> | null;
14
- notificationLifetime?: NotificationLifetime;
15
- mesh?: CurrentMesh | null;
14
+ mesh?: MeshPool | null;
16
15
  meshStatus?: MeshStatusSource | null;
17
16
  network?: NetworkSource | null;
18
17
  diagnostics?: DiagnosticsSource | null;
@@ -27,14 +26,14 @@ interface ApiDeps {
27
26
  deleteModel?: ((options: AssistantDeleteModelRequest) => Promise<AssistantDeleteModelResponse>) | null;
28
27
  clearKvCache?: (() => Promise<AssistantKvCacheDeletionResponse>) | null;
29
28
  deleteChatKvCache?: ((chatId: string) => Promise<AssistantKvCacheDeletionResponse>) | null;
30
- compactChat?: ((chatId: string) => Promise<AssistantCompactChatResponse>) | null;
29
+ compactChat?: ((chatId: string, meshId: string) => Promise<AssistantCompactChatResponse>) | null;
31
30
  modelCatalogWatch?: (() => AsyncIterable<AssistantModelCatalogRevision>) | null;
32
31
  retryModelDownload?: ((request: AssistantClearModelDownloadRequest) => Promise<void>) | null;
33
32
  transcribe?: ((request: AssistantTranscribeRequest) => Promise<AssistantTranscribeResponse>) | null;
34
33
  speak?: ((request: AssistantSpeakRequest) => Promise<AssistantSpeakResponse>) | null;
35
34
  speakStream?: ((text: AsyncIterable<string>) => AsyncIterable<AssistantSpeakResponse>) | null;
36
35
  deviceHost?: {
37
- removeWriter: (writerKey: Buffer, deviceId: Buffer) => Promise<void>;
36
+ removeWriter: (writerKey: Buffer, deviceId: Buffer, mesh: Mesh) => Promise<void>;
38
37
  renameLocal: (name: string) => Promise<void>;
39
38
  saveProfileLocal: (capabilityProfile: AssistantCapabilityProfile, recommendedModelName: string, platform?: string) => Promise<void>;
40
39
  readLocalProfile: () => {
@@ -43,14 +42,12 @@ interface ApiDeps {
43
42
  platform?: string;
44
43
  } | null;
45
44
  } | null;
46
- ragIndex?: (() => VectorIndex | null) | null;
47
- ragEmbed?: (() => IndexingEmbedder | null) | null;
45
+ ragIndex?: ((meshId: string) => VectorIndex | null) | null;
46
+ ragEmbed?: ((meshId: string) => IndexingEmbedder | null) | null;
48
47
  platform?: (() => string | null) | null;
49
48
  computeLender?: (() => Promise<Buffer | null>) | null;
50
49
  pushSkillSecret?: ((request: AssistantPushSkillSecretRequest) => Promise<void>) | null;
51
- skills?: ((agentId?: string | null, modelName?: string | null, options?: {
52
- readonly refresh?: boolean;
53
- }) => Promise<unknown>) | null;
50
+ skills?: ((agentId?: string | null, modelName?: string | null, options?: SkillOptions) => Promise<unknown>) | null;
54
51
  skillCatalog?: ((agentId?: string | null, modelName?: string | null, options?: {
55
52
  readonly refresh?: boolean;
56
53
  }) => Promise<AssistantSkillCatalogResponse>) | null;
@@ -62,4 +59,8 @@ interface ApiDeps {
62
59
  deleteOverlaySkill?: ((name: string, agentId?: string | null) => Promise<AssistantDeleteSkillResponse>) | null;
63
60
  }
64
61
  export type { Capabilities, WatchStream } from '../../spec/capabilities.d.ts';
62
+ export interface SkillOptions {
63
+ readonly refresh?: boolean;
64
+ readonly meshId?: string;
65
+ }
65
66
  export declare function createApi(deps?: ApiDeps): Partial<CapabilityHandlers>;
@@ -15,6 +15,7 @@ import { createInferenceCallsApi } from './inference-calls.js';
15
15
  import { createExecutionApi } from './execution.js';
16
16
  import { createKnowledgeApi } from './knowledge.js';
17
17
  import { createFilesApi } from './files.js';
18
+ import { createLocalFilesApi } from './local-files.js';
18
19
  import { createLogsApi } from './logs.js';
19
20
  import { instrument } from './instrument.js';
20
21
  import { watchable } from './watchable.js';
@@ -33,13 +34,16 @@ export function createApi(deps = {}) {
33
34
  const mesh = deps.mesh ?? null;
34
35
  const retryModelDownload = deps.retryModelDownload;
35
36
  const state = deps.state ?? null;
37
+ const members = mesh && deps.meshStatus ? createMembersApi(mesh, deps.meshStatus, state) : null;
36
38
  return instrument({
37
39
  ...(state ? createConfigApi(state) : null),
38
40
  ...(state ? createAppConfigApi(state) : null),
39
41
  ...(state ? createModelDownloadApi(state) : null),
40
42
  ...(state ? createCustomModelApi(state) : null),
41
43
  ...(mesh ? createAgentsApi(mesh, deps.deviceId ?? null, deps.computeLender ?? null) : null),
42
- ...(mesh ? createChatApi(mesh, deps.deviceId ?? null, deps.inferenceCalls ?? null) : null),
44
+ ...(mesh && state
45
+ ? createChatApi(mesh, deps.deviceId ?? null, state, deps.inferenceCalls ?? null)
46
+ : null),
43
47
  ...(mesh ? createChatGroupsApi(mesh) : null),
44
48
  ...(mesh ? createApprovalRulesApi(mesh) : null),
45
49
  ...(mesh ? createChunksApi(mesh, deps.deviceId ?? null) : null),
@@ -49,6 +53,7 @@ export function createApi(deps = {}) {
49
53
  ...(mesh ? createAttachmentsApi(mesh, { deviceId: deps.deviceId }) : null),
50
54
  ...(mesh ? createKnowledgeApi(mesh, { deviceId: deps.deviceId }) : null),
51
55
  ...(mesh ? createFilesApi(mesh) : null),
56
+ ...(state ? createLocalFilesApi(state.files) : null),
52
57
  ...(mesh
53
58
  ? createRagApi(mesh, deps.ragIndex ?? (() => null), deps.ragEmbed ?? (() => null), state
54
59
  ? async (agent) => effectiveCtxSize(agent, (await state.getAppConfigRow())?.ctxSize ?? 0, deps.platform?.() ?? null)
@@ -58,15 +63,9 @@ export function createApi(deps = {}) {
58
63
  ...(mesh ? createSyncApi(mesh) : null),
59
64
  ...(mesh ? createToolConfigsApi(mesh) : null),
60
65
  ...(mesh ? createToolActivityApi(mesh, deps.deviceId ?? null) : null),
61
- ...(mesh && state
62
- ? createNotificationsApi(mesh, state, {
63
- deviceId: deps.deviceId,
64
- lifetime: deps.notificationLifetime,
65
- changes: deps.meshStatus ?? undefined
66
- })
67
- : null),
68
- ...(deps.meshStatus ? createMeshApi(deps.meshStatus) : null),
69
- ...(mesh ? createMembersApi(mesh, state) : null),
66
+ ...(mesh && state ? createNotificationsApi(mesh, state, { deviceId: deps.deviceId }) : null),
67
+ ...members,
68
+ ...(deps.meshStatus && members ? createMeshApi(deps.meshStatus, members.updateMember) : null),
70
69
  ...(deps.network ? createNetworkApi(deps.network) : null),
71
70
  ...(deps.diagnostics ? createDiagnosticsApi(deps.diagnostics) : null),
72
71
  ...(deps.inferenceCalls ? createInferenceCallsApi(deps.inferenceCalls) : null),
@@ -88,10 +87,12 @@ export function createApi(deps = {}) {
88
87
  ...(deps.deleteModel ? { deleteModel: deps.deleteModel } : null),
89
88
  ...(deps.clearKvCache ? { clearKvCache: deps.clearKvCache } : null),
90
89
  ...(deps.deleteChatKvCache
91
- ? { deleteChatKvCache: ({ id }) => deps.deleteChatKvCache(id) }
90
+ ? {
91
+ deleteChatKvCache: ({ chatId }) => deps.deleteChatKvCache(chatId)
92
+ }
92
93
  : null),
93
94
  ...(deps.compactChat
94
- ? { compactChat: ({ id }) => deps.compactChat(id) }
95
+ ? { compactChat: ({ chatId, meshId }) => deps.compactChat(chatId, meshId) }
95
96
  : null),
96
97
  ...(deps.modelCatalogWatch ? { modelCatalogWatch: deps.modelCatalogWatch } : null),
97
98
  ...(retryModelDownload
@@ -128,7 +129,8 @@ export function createApi(deps = {}) {
128
129
  ? {
129
130
  skills: async (req) => ({
130
131
  skills: await deps.skills?.(req?.agentId, req?.modelName, {
131
- refresh: req?.refresh === true
132
+ refresh: req?.refresh === true,
133
+ meshId: req?.meshId || undefined
132
134
  })
133
135
  })
134
136
  }
@@ -12,7 +12,7 @@ export interface InferenceCallAnswer {
12
12
  truncated: boolean;
13
13
  }
14
14
  export interface InferenceCallReader {
15
- list(chatId: string): Promise<InferenceCallAnswer>;
15
+ list(meshId: string, chatId: string): Promise<InferenceCallAnswer>;
16
16
  forget(chatId: string): Promise<void>;
17
17
  }
18
18
  export declare function createInferenceCallsApi(reader: InferenceCallReader): Pick<CapabilityHandlers, 'inferenceCalls'>;
@@ -1,7 +1,7 @@
1
1
  export function createInferenceCallsApi(reader) {
2
2
  return {
3
- inferenceCalls: async ({ chatId }) => {
4
- const answer = await reader.list(chatId);
3
+ inferenceCalls: async ({ chatId, meshId }) => {
4
+ const answer = await reader.list(meshId, chatId);
5
5
  return {
6
6
  calls: answer.calls.map((entry) => ({
7
7
  runId: entry.runId,
@@ -1,7 +1,7 @@
1
1
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
2
- import { type CurrentMesh } from './current-mesh.ts';
2
+ import { type MeshPool } from './current-mesh.ts';
3
3
  export { MAX_KNOWLEDGE_BYTES } from '../core/files/knowledge.ts';
4
- export declare function createKnowledgeApi(current: CurrentMesh, options?: {
4
+ export declare function createKnowledgeApi(pool: MeshPool, options?: {
5
5
  maxBytes?: number;
6
6
  inactivityMs?: number;
7
7
  deviceId?: Buffer | null;
@@ -1,30 +1,41 @@
1
- import { requireMesh, selectionPin } from './current-mesh.js';
1
+ import { meshWatchable, requireMesh } from './current-mesh.js';
2
2
  import { watchable } from './watchable.js';
3
+ import { openUpload, UPLOAD_NAMES_NO_MESH } from './upload-frames.js';
3
4
  export { MAX_KNOWLEDGE_BYTES } from '../core/files/knowledge.js';
4
- export function createKnowledgeApi(current, options = {}) {
5
+ export function createKnowledgeApi(pool, options = {}) {
5
6
  return {
6
7
  async *uploadKnowledge(frames) {
7
- yield* (await requireMesh(current)).files.knowledge(options).uploadKnowledge(frames);
8
+ const upload = await openUpload(frames);
9
+ if (!upload)
10
+ return;
11
+ if (!upload.first.meshId)
12
+ throw new Error(UPLOAD_NAMES_NO_MESH);
13
+ const mesh = await requireMesh(pool, upload.first.meshId);
14
+ yield* mesh.files.knowledge(options).uploadKnowledge(upload.rest);
8
15
  },
9
16
  async *downloadKnowledge(request) {
10
- yield* (await requireMesh(current)).files.knowledge(options).downloadKnowledge(request);
17
+ yield* (await requireMesh(pool, request.meshId)).files
18
+ .knowledge(options)
19
+ .downloadKnowledge(request);
11
20
  },
12
21
  async removeKnowledge(request) {
13
- return (await requireMesh(current)).files.knowledge(options).removeKnowledge(request);
22
+ return (await requireMesh(pool, request.meshId)).files
23
+ .knowledge(options)
24
+ .removeKnowledge(request);
14
25
  },
15
26
  async listKnowledge(request) {
16
- return (await requireMesh(current, request?.meshId)).files
27
+ return (await requireMesh(pool, request.meshId)).files
17
28
  .knowledge(options)
18
29
  .listKnowledge(request);
19
30
  },
20
31
  async listIndexing(request) {
21
- return (await requireMesh(current, request?.meshId)).files
32
+ return (await requireMesh(pool, request.meshId)).files
22
33
  .knowledge(options)
23
34
  .listIndexing(request);
24
35
  },
25
- knowledgeWatch: watchable('knowledgeWatch', (request) => requireMesh(current, request?.meshId), async (request, mesh) => mesh.files.knowledge(options).listKnowledge(request), (request) => selectionPin(current, request?.meshId)),
26
- indexingWatch: watchable('indexingWatch', async (request) => (await requireMesh(current, request?.meshId)).files, ({ chatId }, files) => files.listIndexing(chatId), (request) => selectionPin(current, request?.meshId)),
27
- fileStatusWatch: watchable('fileStatusWatch', async (request) => (await requireMesh(current, request?.meshId)).files, ({ chatId }, files) => files.status(chatId), (request) => selectionPin(current, request?.meshId)),
28
- indexingProgressWatch: watchable('indexingProgressWatch', async (request) => (await requireMesh(current, request?.meshId)).files, ({ chatId }, files) => Promise.resolve({ entries: files.progress(chatId) }), (request) => selectionPin(current, request?.meshId))
36
+ knowledgeWatch: meshWatchable('knowledgeWatch', pool, async (request, mesh) => mesh.files.knowledge(options).listKnowledge(request)),
37
+ indexingWatch: watchable('indexingWatch', async (request) => (await requireMesh(pool, request.meshId)).files, ({ chatId }, files) => files.listIndexing(chatId)),
38
+ fileStatusWatch: watchable('fileStatusWatch', async (request) => (await requireMesh(pool, request.meshId)).files, ({ chatId }, files) => files.status(chatId)),
39
+ indexingProgressWatch: watchable('indexingProgressWatch', async (request) => (await requireMesh(pool, request.meshId)).files, ({ chatId }, files) => Promise.resolve({ entries: files.progress(chatId) }))
29
40
  };
30
41
  }
@@ -0,0 +1,3 @@
1
+ import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
2
+ import type { LocalFiles } from '../core/local/files.ts';
3
+ export declare function createLocalFilesApi(files: LocalFiles): Pick<CapabilityHandlers, 'listLocalFiles'>;
@@ -0,0 +1,23 @@
1
+ import b4a from 'b4a';
2
+ export function createLocalFilesApi(files) {
3
+ return {
4
+ listLocalFiles: async (request) => {
5
+ const meshKey = request?.meshId ? Buffer.from(request.meshId, 'hex') : undefined;
6
+ return { files: (await files.live(meshKey)).map(toEngineFile) };
7
+ }
8
+ };
9
+ }
10
+ function toEngineFile(file) {
11
+ return {
12
+ meshId: b4a.toHex(file.meshKey),
13
+ chatId: file.chatId,
14
+ attachmentId: file.attachmentId,
15
+ blobId: file.blobId,
16
+ fileName: file.fileName,
17
+ mimeType: file.mimeType,
18
+ byteLength: file.byteLength,
19
+ own: file.own,
20
+ lastAccessed: file.lastAccessed,
21
+ cleared: file.cleared
22
+ };
23
+ }
@@ -1,6 +1,10 @@
1
+ import type { AssistantAccount } from '../../spec/hyperschema/types.d.ts';
1
2
  import type { openLocalStore } from '../core/local/index.ts';
2
- import { type CurrentMesh } from './current-mesh.ts';
3
+ import { type MeshPool } from './current-mesh.ts';
3
4
  import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
4
5
  type LocalStore = Awaited<ReturnType<typeof openLocalStore>>;
5
- export declare function createMembersApi(current: CurrentMesh, state?: LocalStore | null): Pick<CapabilityHandlers, 'listMembers' | 'membersWatch' | 'updateMember' | 'removeMember'>;
6
+ export interface OwnMember {
7
+ account(): Promise<AssistantAccount>;
8
+ }
9
+ export declare function createMembersApi(pool: MeshPool, self: OwnMember, state?: LocalStore | null): Pick<CapabilityHandlers, 'listMembers' | 'membersWatch' | 'updateMember' | 'removeMember'>;
6
10
  export {};