@qvac/core 0.1.4 → 0.2.0

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 (105) hide show
  1. package/.claude/skills/asana/SKILL.md +86 -0
  2. package/.claude/skills/compaction/SKILL.md +127 -0
  3. package/.claude/skills/device-mesh-debug/SKILL.md +328 -0
  4. package/.claude/skills/gh-stack/SKILL.md +181 -0
  5. package/.claude/skills/gh-stack/references/commands.md +177 -0
  6. package/.claude/skills/gh-stack/references/stack-design.md +97 -0
  7. package/.claude/skills/gh-stack/references/troubleshooting.md +159 -0
  8. package/.claude/skills/js-house-style/SKILL.md +670 -0
  9. package/.claude/skills/pr-create/SKILL.md +180 -0
  10. package/.claude/skills/pr-review/SKILL.md +216 -0
  11. package/CLAUDE.md +45 -0
  12. package/README.md +10 -5
  13. package/dist-lib/lib/api/agents.js +3 -3
  14. package/dist-lib/lib/api/chat-groups.d.ts +1 -1
  15. package/dist-lib/lib/api/chat-groups.js +5 -3
  16. package/dist-lib/lib/api/chat.js +2 -2
  17. package/dist-lib/lib/api/current-mesh.d.ts +3 -2
  18. package/dist-lib/lib/api/current-mesh.js +4 -3
  19. package/dist-lib/lib/api/devices.js +1 -0
  20. package/dist-lib/lib/api/index.js +2 -0
  21. package/dist-lib/lib/api/members.d.ts +3 -0
  22. package/dist-lib/lib/api/members.js +23 -0
  23. package/dist-lib/lib/api/mesh.d.ts +14 -3
  24. package/dist-lib/lib/api/mesh.js +20 -3
  25. package/dist-lib/lib/api/watchable.d.ts +1 -1
  26. package/dist-lib/lib/api/watchable.js +1 -1
  27. package/dist-lib/lib/assistant.js +2 -1
  28. package/dist-lib/lib/core/agent.d.ts +1 -0
  29. package/dist-lib/lib/core/agent.js +29 -1
  30. package/dist-lib/lib/core/chat-group.d.ts +4 -0
  31. package/dist-lib/lib/core/chat-group.js +43 -1
  32. package/dist-lib/lib/core/chat.d.ts +10 -0
  33. package/dist-lib/lib/core/chat.js +75 -9
  34. package/dist-lib/lib/core/contract/index.js +2 -0
  35. package/dist-lib/lib/core/contract/joined-meshes.d.ts +2 -0
  36. package/dist-lib/lib/core/contract/joined-meshes.js +41 -0
  37. package/dist-lib/lib/core/contract/members.js +68 -2
  38. package/dist-lib/lib/core/contract/writers.js +19 -3
  39. package/dist-lib/lib/core/departures.d.ts +3 -1
  40. package/dist-lib/lib/core/departures.js +6 -4
  41. package/dist-lib/lib/core/device-attestation.d.ts +8 -0
  42. package/dist-lib/lib/core/device-attestation.js +25 -0
  43. package/dist-lib/lib/core/device-invites.d.ts +9 -0
  44. package/dist-lib/lib/core/device-invites.js +40 -0
  45. package/dist-lib/lib/core/files/index.d.ts +2 -1
  46. package/dist-lib/lib/core/files/index.js +1 -1
  47. package/dist-lib/lib/core/files/store/index.d.ts +1 -0
  48. package/dist-lib/lib/core/files/store/server.d.ts +5 -4
  49. package/dist-lib/lib/core/files/store/server.js +10 -6
  50. package/dist-lib/lib/core/helpers/index.d.ts +1 -1
  51. package/dist-lib/lib/core/hosted-agents.d.ts +3 -1
  52. package/dist-lib/lib/core/hosted-agents.js +9 -3
  53. package/dist-lib/lib/core/identity.d.ts +10 -0
  54. package/dist-lib/lib/core/identity.js +45 -0
  55. package/dist-lib/lib/core/invite.d.ts +3 -0
  56. package/dist-lib/lib/core/invite.js +8 -2
  57. package/dist-lib/lib/core/local/index.d.ts +22 -7
  58. package/dist-lib/lib/core/local/index.js +202 -66
  59. package/dist-lib/lib/core/membership.d.ts +8 -2
  60. package/dist-lib/lib/core/membership.js +33 -9
  61. package/dist-lib/lib/core/mesh-seed-handoff.d.ts +17 -0
  62. package/dist-lib/lib/core/mesh-seed-handoff.js +34 -0
  63. package/dist-lib/lib/core/mesh.d.ts +13 -1
  64. package/dist-lib/lib/core/mesh.js +61 -8
  65. package/dist-lib/lib/core/migrations/index.d.ts +3 -1
  66. package/dist-lib/lib/core/migrations/index.js +2 -2
  67. package/dist-lib/lib/core/migrations/membership.js +27 -15
  68. package/dist-lib/lib/core/rank.d.ts +14 -0
  69. package/dist-lib/lib/core/rank.js +23 -0
  70. package/dist-lib/lib/core/sync/index.js +6 -0
  71. package/dist-lib/lib/core.d.ts +91 -13
  72. package/dist-lib/lib/core.js +1051 -207
  73. package/dist-lib/schema/build.js +3 -2
  74. package/dist-lib/schema/engine.js +153 -9
  75. package/dist-lib/schema/field-order.js +4 -1
  76. package/dist-lib/schema/local.js +32 -0
  77. package/dist-lib/schema/qvac.js +45 -6
  78. package/dist-lib/spec/bind.js +35 -0
  79. package/dist-lib/spec/calls.js +37 -27
  80. package/dist-lib/spec/capabilities.d.ts +30 -10
  81. package/dist-lib/spec/hrpc/hrpc.json +135 -5
  82. package/dist-lib/spec/hrpc/index.js +130 -9
  83. package/dist-lib/spec/hrpc/messages.js +408 -14
  84. package/dist-lib/spec/hyperschema/index.js +408 -14
  85. package/dist-lib/spec/hyperschema/schema.json +309 -1
  86. package/dist-lib/spec/hyperschema/types.d.ts +90 -1
  87. package/dist-lib/spec/local/hyperdb/db.json +46 -1
  88. package/dist-lib/spec/local/hyperdb/index.js +209 -2
  89. package/dist-lib/spec/local/hyperdb/messages.js +557 -90
  90. package/dist-lib/spec/local/hyperschema/index.js +240 -2
  91. package/dist-lib/spec/local/hyperschema/schema.json +120 -1
  92. package/dist-lib/spec/local/hyperschema/types.d.ts +33 -1
  93. package/dist-lib/spec/mesh/hyperdb/db.json +16 -1
  94. package/dist-lib/spec/mesh/hyperdb/index.js +71 -2
  95. package/dist-lib/spec/mesh/hyperdb/messages.js +571 -192
  96. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +13 -1
  97. package/dist-lib/spec/mesh/hyperdispatch/index.js +35 -1
  98. package/dist-lib/spec/mesh/hyperdispatch/messages.js +283 -20
  99. package/dist-lib/spec/mesh/hyperschema/index.js +283 -20
  100. package/dist-lib/spec/mesh/hyperschema/schema.json +179 -1
  101. package/dist-lib/spec/mesh/hyperschema/types.d.ts +45 -1
  102. package/package.json +6 -6
  103. package/tui/app.mjs +416 -50
  104. package/tui/boot.mjs +1 -1
  105. package/tui/lib/sidebar.mjs +3 -2
@@ -12,13 +12,20 @@ import { Router, encode } from '../../spec/mesh/hyperdispatch/index.js';
12
12
  import { syncChanges } from "./sync/index.js";
13
13
  import { buildDefaultSeed, isOwnKickedRow, isOwnRevokedRow } from "./helpers/index.js";
14
14
  import { raceResource } from "../race-resource.js";
15
- import { signDeviceAttestation } from "./device-attestation.js";
15
+ import { signDeviceAttestation, signWriterClaim } from "./device-attestation.js";
16
+ import { deviceInviteToken } from "./identity.js";
16
17
  import { liveDeviceForWriter } from "./contract/activity.js";
17
18
  import { registerRoutes } from "./contract/index.js";
18
19
  import { createSyncActivity } from "./sync-status.js";
19
20
  import { buildHealthAssistant } from "./health-assistant.js";
20
- const [MESH_KEYPAIR, MESH_ENCRYPTION, MESH_DEVICE] = crypto.namespace('@qvac/core/mesh', 3);
21
+ const [MESH_KEYPAIR, MESH_ENCRYPTION, MESH_DEVICE] = crypto.namespace('qvac-assistant/mesh', 3);
21
22
  const LIVE_WRITERS_BY_MOST_RECENT = '@qvac/live-writers-by-most-recent';
23
+ const WARMUP_COLLECTIONS = [
24
+ '@qvac/devices',
25
+ '@qvac/active-agents',
26
+ '@qvac/members',
27
+ '@qvac/active-chats'
28
+ ];
22
29
  export async function isOurTrustedWriter(snap, writerKey, ourMemberId) {
23
30
  const device = await liveDeviceForWriter(snap, writerKey);
24
31
  if (!device)
@@ -85,6 +92,9 @@ export class Mesh extends ReadyResource {
85
92
  get encryptionKey() {
86
93
  return this._encryptionKey;
87
94
  }
95
+ get seed() {
96
+ return this._seed;
97
+ }
88
98
  get blindPeerKeys() {
89
99
  return this._blindPeerKeys;
90
100
  }
@@ -105,6 +115,9 @@ export class Mesh extends ReadyResource {
105
115
  get ourMemberId() {
106
116
  return this._ourMemberId;
107
117
  }
118
+ get ourDeviceId() {
119
+ return this._deviceId;
120
+ }
108
121
  get membership() {
109
122
  return this._membership;
110
123
  }
@@ -184,6 +197,7 @@ export class Mesh extends ReadyResource {
184
197
  open: this._autobeeOpen.bind(this),
185
198
  apply: this._autobeeApply.bind(this),
186
199
  update: this._autobeeUpdate.bind(this),
200
+ warmup: this._autobeeWarmup.bind(this),
187
201
  isTrusted: this._autobeeIsTrusted.bind(this),
188
202
  mostRecentTrusted: this._autobeeMostRecentTrusted.bind(this),
189
203
  keyPair: writerKeyPair,
@@ -278,6 +292,9 @@ export class Mesh extends ReadyResource {
278
292
  get localWriterKey() {
279
293
  return this.autobee.local.key;
280
294
  }
295
+ get minted() {
296
+ return this.autobee.key.equals(this.autobee.local.key);
297
+ }
281
298
  get writable() {
282
299
  return this.autobee.writable;
283
300
  }
@@ -290,7 +307,7 @@ export class Mesh extends ReadyResource {
290
307
  batch() {
291
308
  return new MeshBatch(this.autobee);
292
309
  }
293
- async appendBirthOp(deviceId, device, member) {
310
+ async appendBirthOp(deviceId, device, member, claim, { room = false } = {}) {
294
311
  if (this.autobee.local.length > 0)
295
312
  return;
296
313
  const localKey = this.autobee.local.key;
@@ -305,18 +322,37 @@ export class Mesh extends ReadyResource {
305
322
  if (member)
306
323
  birth.dispatch('mint-member', member);
307
324
  birth.dispatch('seed-defaults', buildDefaultSeed(row, this._blindPeerKeys));
308
- birth.dispatch('put-agent', { agent: buildHealthAssistant(row) });
325
+ if (!room)
326
+ birth.dispatch('put-agent', { agent: buildHealthAssistant(row) });
309
327
  }
310
328
  await birth.flush();
311
329
  }
312
330
  else if (!this.autobee.writable) {
313
331
  const signature = this.sign(localKey);
314
332
  const device = row ? claimableDevice(row) : undefined;
315
- const claim = this.batch();
316
- claim.dispatch('join', { signature, deviceId, device });
333
+ const join = this.batch();
334
+ join.dispatch('join', {
335
+ signature,
336
+ deviceId,
337
+ device,
338
+ claimedMemberId: claim?.memberId,
339
+ inviteToken: claim?.inviteNonce
340
+ ? deviceInviteToken(claim.inviteNonce, deviceId)
341
+ : undefined,
342
+ deviceSignature: claim?.deviceKeyPair && row
343
+ ? signWriterClaim(claim.deviceKeyPair.secretKey, {
344
+ meshPublicKey: this.publicKey,
345
+ deviceId,
346
+ writerKey: localKey,
347
+ joinedAt: row.joinedAt
348
+ })
349
+ : undefined
350
+ });
317
351
  if (row)
318
- claim.dispatch('attest-device', this.attestDevice(deviceId));
319
- await claim.flush({ optimistic: true });
352
+ join.dispatch('attest-device', this.attestDevice(deviceId));
353
+ if (row && member)
354
+ join.dispatch('join-member', member);
355
+ await join.flush({ optimistic: true });
320
356
  }
321
357
  await this.autobee.update();
322
358
  this.throwIfInterrupted();
@@ -408,6 +444,17 @@ export class Mesh extends ReadyResource {
408
444
  const db = HyperDB.bee2(bee, MeshDefinition, { autoUpdate: true });
409
445
  return { db };
410
446
  }
447
+ async _autobeeWarmup(view) {
448
+ try {
449
+ const counts = await Promise.all(WARMUP_COLLECTIONS.map((collection) => drain(view.db.find(collection))));
450
+ const warmed = counts.reduce((total, count) => total + count, 0);
451
+ this._log?.info(this._scope, 'warmed candidate view', { warmed });
452
+ this.emit('warmup', { warmed });
453
+ }
454
+ catch (err) {
455
+ this._log?.warn(this._scope, 'warmup failed', err);
456
+ }
457
+ }
411
458
  async _autobeeApply(nodes, view, host) {
412
459
  const tx = view.db.transaction();
413
460
  try {
@@ -497,6 +544,12 @@ export class MeshBatch {
497
544
  }
498
545
  }
499
546
  function noop() { }
547
+ async function drain(stream) {
548
+ let count = 0;
549
+ for await (const _row of stream)
550
+ count++;
551
+ return count;
552
+ }
500
553
  const NEWER_BUILD_MESSAGES = new Set(['Unsupported version', 'Unknown enum', 'Out of bounds']);
501
554
  function isInterrupt(err) {
502
555
  return err instanceof Error && err.message === 'Apply interrupted';
@@ -2,4 +2,6 @@ import type { Mesh } from '../mesh.ts';
2
2
  import { type AgentCatalogMigrationContext } from './agent-catalog.ts';
3
3
  import { type MembershipMigrationContext } from './membership.ts';
4
4
  export type MigrationContext = MembershipMigrationContext & AgentCatalogMigrationContext;
5
- export declare function runMigrations(mesh: Mesh, context: MigrationContext): Promise<boolean>;
5
+ export declare function runMigrations(mesh: Mesh, context: MigrationContext, { catalog }?: {
6
+ catalog?: boolean;
7
+ }): Promise<boolean>;
@@ -1,7 +1,7 @@
1
1
  import { migrateAgentCatalog } from "./agent-catalog.js";
2
2
  import { migrateMembership } from "./membership.js";
3
- export async function runMigrations(mesh, context) {
3
+ export async function runMigrations(mesh, context, { catalog = true } = {}) {
4
4
  const membership = await migrateMembership(mesh, context);
5
- const agents = await migrateAgentCatalog(mesh, context);
5
+ const agents = catalog && (await migrateAgentCatalog(mesh, context));
6
6
  return membership || agents;
7
7
  }
@@ -2,25 +2,37 @@ import { attestDeviceProof } from "../identity.js";
2
2
  import { membershipView } from "../membership.js";
3
3
  export async function migrateMembership(mesh, { deviceKeyPair, deviceName, mintRoot, log }) {
4
4
  const { members, own, unattested } = await membershipView(mesh, deviceKeyPair.publicKey);
5
- if (members > 0 || !own || own.memberId)
5
+ if (!own)
6
+ return false;
7
+ const resuming = Boolean(own.memberId) && members === 1 && unattested.length > 0;
8
+ if (!resuming && (members > 0 || own.memberId))
6
9
  return false;
7
10
  const now = Date.now();
8
11
  const root = await mintRoot(own.id, now);
9
- const batch = mesh.batch();
10
- batch.dispatch('mint-member', {
11
- member: { id: root.publicKey, name: deviceName, joinedAt: now, updatedAt: now },
12
- proof: root.proof
13
- });
14
- for (const id of unattested) {
15
- batch.dispatch('attest-member-device', {
16
- deviceId: id,
17
- memberId: root.publicKey,
18
- proof: await attestDeviceProof(id, deviceKeyPair, root.proof),
19
- attestedAt: now
12
+ if (resuming && !own.memberId.equals(root.publicKey))
13
+ return false;
14
+ if (!resuming) {
15
+ await mesh.dispatch('mint-member', {
16
+ member: { id: root.publicKey, name: deviceName, joinedAt: now, updatedAt: now },
17
+ proof: root.proof
20
18
  });
19
+ await mesh.refreshOurMember();
21
20
  }
22
- await batch.flush();
23
- await mesh.refreshOurMember();
24
- log?.info(['p2p', 'mesh'], 'migrated: minted the member this mesh predates, every device we hold is attested to our member', { attested: unattested.length });
21
+ if (unattested.length > 0) {
22
+ const batch = mesh.batch();
23
+ for (const device of unattested) {
24
+ batch.dispatch('attest-member-device', {
25
+ deviceId: device.id,
26
+ memberId: root.publicKey,
27
+ proof: await attestDeviceProof(device.id, deviceKeyPair, root.proof),
28
+ attestedAt: now
29
+ });
30
+ }
31
+ await batch.flush();
32
+ }
33
+ log?.info(['p2p', 'mesh'], 'migrated: minted the member this mesh predates', {
34
+ attested: unattested.length,
35
+ resumed: resuming
36
+ });
25
37
  return true;
26
38
  }
@@ -0,0 +1,14 @@
1
+ export declare const STEP = 1000;
2
+ export interface Placement<T> {
3
+ rank: number;
4
+ respaced: Array<{
5
+ row: T;
6
+ rank: number;
7
+ }>;
8
+ }
9
+ export declare function rankBetween(anchor: number, next: number | undefined): number;
10
+ export declare function rankOnTop(top: number | undefined, now: number): number;
11
+ export declare function place<T>(siblings: readonly T[], keyOf: (row: T) => number, { at, now }: {
12
+ at: number;
13
+ now: number;
14
+ }): Placement<T>;
@@ -0,0 +1,23 @@
1
+ const FLOOR = 1;
2
+ export const STEP = 1_000;
3
+ const TOP_STEP = 1;
4
+ export function rankBetween(anchor, next) {
5
+ if (next === undefined)
6
+ return Math.max(anchor - STEP, FLOOR);
7
+ return anchor + (next - anchor) / 2;
8
+ }
9
+ export function rankOnTop(top, now) {
10
+ return top === undefined ? now : Math.max(top + TOP_STEP, now);
11
+ }
12
+ export function place(siblings, keyOf, { at, now }) {
13
+ const upper = at >= 0 ? keyOf(siblings[at]) : undefined;
14
+ const below = siblings[at + 1];
15
+ const lower = below === undefined ? undefined : keyOf(below);
16
+ const rank = upper === undefined ? rankOnTop(lower, now) : rankBetween(upper, lower);
17
+ if ((upper === undefined || rank < upper) && (lower === undefined || rank > lower)) {
18
+ return { rank, respaced: [] };
19
+ }
20
+ const top = Math.max(now, keyOf(siblings[0]));
21
+ const respaced = siblings.map((row, i) => ({ row, rank: top - (i > at ? i + 1 : i) * STEP }));
22
+ return { rank: top - (at + 1) * STEP, respaced };
23
+ }
@@ -9,6 +9,7 @@ export async function syncChanges(mesh, view, from) {
9
9
  let unattestedDevice = false;
10
10
  let membershipMoved = false;
11
11
  let agentsDirty = false;
12
+ let roomsChanged = false;
12
13
  const snap = view.db.snapshot();
13
14
  const files = new FileChanges(snap, from);
14
15
  try {
@@ -45,6 +46,9 @@ export async function syncChanges(mesh, view, from) {
45
46
  case '@qvac/knowledge-artifacts':
46
47
  await mesh.files.syncArtifact(change.value);
47
48
  break;
49
+ case '@qvac/joined-meshes':
50
+ roomsChanged = true;
51
+ break;
48
52
  }
49
53
  }
50
54
  indexingDirty = await files.ids();
@@ -60,4 +64,6 @@ export async function syncChanges(mesh, view, from) {
60
64
  await mesh.refreshMembership();
61
65
  if (agentsDirty)
62
66
  mesh.emit('agents-dirty');
67
+ if (roomsChanged)
68
+ mesh.emit('rooms-dirty');
63
69
  }
@@ -4,7 +4,7 @@ import type { BootstrapNode } from 'hyperswarm';
4
4
  import ReadyGuard from 'ready-guard';
5
5
  import ReadyResource from 'ready-resource';
6
6
  import type { Logger } from '../index.ts';
7
- import type { AssistantCompactChatResponse, AssistantCopySkillResponse, AssistantDeleteModelRequest, AssistantDeleteModelResponse, AssistantDeleteSkillResponse, AssistantKvCacheDeletionResponse, AssistantListModelsRequest, AssistantManagedSkillsResponse, AssistantModelCatalogRevision, AssistantModelInfoList, AssistantOkResponse, AssistantSkillCatalogResponse, AssistantSkillFileResponse, AssistantSpeakRequest, AssistantSpeakResponse, AssistantToolCatalogResponse, AssistantTranscribeRequest, AssistantTranscribeResponse } from '../spec/index.d.ts';
7
+ import type { AssistantCompactChatResponse, AssistantCopySkillResponse, AssistantDeleteModelRequest, AssistantDeleteModelResponse, AssistantDeleteSkillResponse, AssistantKvCacheDeletionResponse, AssistantListModelsRequest, AssistantManagedSkillsResponse, AssistantMeshList, AssistantModelCatalogRevision, AssistantModelInfoList, AssistantOkResponse, AssistantSkillCatalogResponse, AssistantSkillFileResponse, AssistantSpeakRequest, AssistantSpeakResponse, AssistantToolCatalogResponse, AssistantTranscribeRequest, AssistantTranscribeResponse } from '../spec/index.d.ts';
8
8
  import { type BlindPeeringOpts } from './core/blind-peers.ts';
9
9
  import { type IndexingEmbedder, type RagExtractors, type VectorIndex } from './core/files/index.ts';
10
10
  import { type DriveHost } from './core/fs-drives.ts';
@@ -62,6 +62,18 @@ export interface CoreOptions {
62
62
  readonly resume: () => Promise<void>;
63
63
  };
64
64
  }
65
+ export declare const MEMBER_INVITE_HOME_REFUSED = "An account mesh cannot be invited into";
66
+ export declare const DEVICE_INVITE_ROOM_REFUSED = "Only an account mesh can take a device invite";
67
+ export declare const INVITE_ACCOUNT_UNREADABLE = "This device cannot reach its account to check";
68
+ export declare const ROOM_HELD_BY_SIBLING = "Another of your devices holds this room: bring that device online, or invite from it instead";
69
+ export interface SharedRoom {
70
+ readonly meshId: string;
71
+ readonly notice?: string;
72
+ }
73
+ export interface MeshInviteOptions {
74
+ memberInvite?: boolean;
75
+ meshId?: string;
76
+ }
65
77
  export interface SkillManagementHooks {
66
78
  listManagedSkills(): Promise<AssistantManagedSkillsResponse>;
67
79
  readSkillFile(name: string): Promise<AssistantSkillFileResponse>;
@@ -75,6 +87,7 @@ export declare class Core extends ReadyResource {
75
87
  rootCorestore: Corestore;
76
88
  storage: CorestoreStorage;
77
89
  local: ReturnType<typeof openLocalStore>;
90
+ private readonly _deviceInvites;
78
91
  state: LocalQvacState;
79
92
  private readonly _transport;
80
93
  private readonly _apiLifecycle;
@@ -109,42 +122,42 @@ export declare class Core extends ReadyResource {
109
122
  private _indexedEmbedder;
110
123
  private readonly _indexingLock;
111
124
  private readonly _meshTransitionLock;
112
- private _processingFiles;
125
+ private readonly _opening;
113
126
  private _skills;
114
127
  private _skillCatalog;
115
128
  private _skillManagement;
116
129
  private readonly _catalogHooks;
117
130
  private _tools;
118
131
  private readonly _hostsModelSource;
119
- private _vectorIndex;
132
+ private _spareVectorIndex;
120
133
  private readonly _closeSignal;
121
134
  private _signalClose;
122
135
  private readonly _closeListeners;
123
136
  private _closeSignaled;
124
- private _mesh;
137
+ private readonly _meshes;
138
+ private readonly _blobCoreMeshes;
139
+ private _activeMeshKey;
125
140
  private readonly _offlineBoot;
126
141
  readonly onlineBoot: ReadyGuard;
127
142
  private _candidateMesh;
128
143
  private _cancelCandidateJoin;
129
144
  private _joinCancellation;
130
- private _meshSecretSeed;
131
145
  private readonly _rpcs;
132
146
  private _stream;
133
147
  private _api;
134
148
  private readonly _clients;
135
149
  private _deviceKeyPair;
136
- private readonly _memberLock;
137
150
  private _identityPhrase;
138
151
  private _identityPublicKey;
139
152
  private _swarm;
140
153
  private _departures;
141
154
  private _fsDrives;
142
155
  private _blobServer;
143
- private readonly _attachmentUrl;
144
156
  private readonly _wakeup;
157
+ private readonly _meshSeedHandoff;
158
+ private readonly _following;
145
159
  private readonly _secretHandoff;
146
160
  private readonly _skillOverlayHandoff;
147
- private _hostedAgents;
148
161
  private _minting;
149
162
  private _leaving;
150
163
  private _kicked;
@@ -153,9 +166,6 @@ export declare class Core extends ReadyResource {
153
166
  private readonly _statusListeners;
154
167
  private readonly _diagnosticsProviders;
155
168
  private _systemInfo;
156
- private readonly _onMeshWritable;
157
- private readonly _onMeshDead;
158
- private readonly _onMeshStalled;
159
169
  private _statusError;
160
170
  private _upgradeRequired;
161
171
  constructor(transport: Transport, { storagePath, logger, spec, bootstrapNodes, device, app, minSupportedVersion, otaConfigCore, blindPeerKeys, blindPeeringOpts, meshSeed, meshKey, additionalNodes, listModels, deleteModel, clearKvCache, deleteChatKvCache, compactChat, modelCatalogWatch, retryModelDownload, transcribe, speak, speakStream, embedder, extractors, skills, skillCatalog, tools, hostsModelSource, vectorIndex, apiLifecycle }: CoreOptions);
@@ -193,8 +203,11 @@ export declare class Core extends ReadyResource {
193
203
  private _openSwarm;
194
204
  private _resolveBlindPeerKeys;
195
205
  private _startMesh;
206
+ private _switchToMesh;
196
207
  private _openMesh;
208
+ private _openMeshSession;
197
209
  private _mintBirthMember;
210
+ private _joinBirthMember;
198
211
  private _holdIdentityPhrase;
199
212
  private _pushIdentityPhrase;
200
213
  private _offerIdentityPhrase;
@@ -202,12 +215,21 @@ export declare class Core extends ReadyResource {
202
215
  private _advertiseDeviceProfile;
203
216
  private _advertiseAppVersion;
204
217
  private _settleMembership;
218
+ private _claimOwnMembership;
219
+ private _knownMember;
205
220
  private _migrationContext;
206
- private _recordMembership;
221
+ private _recordMemberProof;
207
222
  private _ensureNotRevoked;
208
223
  private _retireMesh;
224
+ private _retirePooledMesh;
225
+ private _stopMeshServices;
226
+ private _stopEntryIndexing;
227
+ private _releaseVectorIndex;
209
228
  private _withdrawFromMesh;
210
229
  private _onKicked;
230
+ private _replaceRevokedActiveMesh;
231
+ private _departRevokedMesh;
232
+ private _archiveMembership;
211
233
  private _requestFreshMesh;
212
234
  private _onClose;
213
235
  private _waitForMeshChange;
@@ -217,10 +239,33 @@ export declare class Core extends ReadyResource {
217
239
  private _joinMesh;
218
240
  private _runJoinMesh;
219
241
  private _joinParkedMesh;
242
+ private _departOldAccount;
243
+ private _departIfPooled;
244
+ private _seedMemberDefaults;
245
+ private _hasOwnDefaultAgent;
246
+ private _recordJoinedRoom;
247
+ private _registerRoom;
248
+ private _releaseJoinedRoom;
249
+ private _accountMesh;
220
250
  private _openCandidateMesh;
221
251
  private _waitForCandidateWritable;
252
+ private _onMeshWritable;
253
+ private _onMeshDead;
254
+ private _onMeshStalled;
255
+ private _wireMesh;
256
+ private _handOffActive;
222
257
  private _activateMesh;
223
258
  private _currentMesh;
259
+ private _poolKey;
260
+ private _poolEntry;
261
+ private _meshFor;
262
+ private _activeEntry;
263
+ private _meshForBlobCore;
264
+ private _linkAttachment;
265
+ private _isPooled;
266
+ private _isActive;
267
+ private _unpoolMesh;
268
+ private _unwireMesh;
224
269
  private _awaitMesh;
225
270
  private _startMeshServices;
226
271
  private _stopHostedAgents;
@@ -228,14 +273,45 @@ export declare class Core extends ReadyResource {
228
273
  private _departureHasAudience;
229
274
  private _announceDeparture;
230
275
  leaveMesh(): Promise<void>;
276
+ private _isHomeMesh;
277
+ private _homeMeshKey;
278
+ private _writableFallback;
279
+ listMeshes(): Promise<AssistantMeshList>;
280
+ private _meshLabels;
281
+ private _isOwnRoomIn;
282
+ setMeshLabel(meshId: string, label: string): Promise<void>;
283
+ createRoom({ shared }?: {
284
+ shared?: boolean;
285
+ }): Promise<string>;
286
+ sharedRoom(): Promise<SharedRoom>;
287
+ private _occupancyNotice;
288
+ private _resolveSharedRoom;
289
+ private _unmarkSharedRoom;
290
+ private _mintRoom;
291
+ private _discardRoom;
292
+ openMesh(meshId: string): Promise<void>;
293
+ selectMesh(meshId: string): Promise<void>;
294
+ closeMesh(meshId: string): Promise<void>;
295
+ private _openPooledMesh;
296
+ private _openRecordedMesh;
297
+ private _meshEntry;
298
+ private _meshEntryState;
299
+ private _meshKeyOf;
231
300
  removeDeviceWriter(writerKey: Buffer, deviceId: Buffer): Promise<void>;
232
301
  renameLocalDevice(name: string): Promise<void>;
233
302
  saveDeviceProfileLocal(capabilityProfile: DeviceMetadata['capabilityProfile'], recommendedModelName: string, platform?: string): Promise<void>;
234
303
  waitForWritable(): Promise<void>;
235
- getMeshInvite(): Promise<MeshInvite | null>;
304
+ private _assertRoomIsHere;
305
+ getMeshInvite(opts?: MeshInviteOptions): Promise<MeshInvite | null>;
236
306
  private _closeSwarm;
237
307
  pushSkillSecret(request: SecretRequest): Promise<void>;
238
308
  private _storeHandedOffSecret;
309
+ private _followJoinedRooms;
310
+ private _openFollowedRoom;
311
+ private _requestRoomSeed;
312
+ private _serveMeshSeed;
313
+ private _isJoinedRoomKey;
314
+ private _isOwnMemberDevice;
239
315
  private _skillOverlayOp;
240
316
  private _resolveSkillOverlayHost;
241
317
  private _serveSkillOverlayOp;
@@ -277,6 +353,8 @@ export declare class Core extends ReadyResource {
277
353
  registerEmbedder(embedder: IndexingEmbedder, extractors?: RagExtractors): () => Promise<void>;
278
354
  private _reconcileIndexing;
279
355
  private _startIndexing;
356
+ private _startEntryIndexing;
357
+ private _takeVectorIndex;
280
358
  private _stopIndexing;
281
359
  registerTranscribe(hook: (request: AssistantTranscribeRequest) => Promise<AssistantTranscribeResponse>): () => void;
282
360
  registerSpeak(hook: (request: AssistantSpeakRequest) => Promise<AssistantSpeakResponse>): () => void;