@agentvault/agentvault 0.23.30 → 0.23.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/channel.d.ts CHANGED
@@ -14,6 +14,11 @@ interface InternalSendOptions extends SendOptions {
14
14
  * agent saying the same thing twice.
15
15
  */
16
16
  isResend?: boolean;
17
+ /**
18
+ * Skip the #952 MLS hold for this send. Set only when releasing an already
19
+ * held message — without it, a release re-enters the hold and loops forever.
20
+ */
21
+ bypassMlsHold?: boolean;
17
22
  }
18
23
  /** True when `target` addresses this agent's OWN hub address (#499, A2 parity
19
24
  * for OpenClaw). Deterministic self-reference guard for A2A: an agent must
@@ -396,6 +401,56 @@ export declare class SecureChannel extends EventEmitter {
396
401
  * Encrypt and send a message to ALL owner devices (fanout).
397
402
  * Each session gets the same plaintext encrypted independently.
398
403
  */
404
+ /**
405
+ * #952 — sends held because MLS is expected for this conversation but the
406
+ * group is not joined yet.
407
+ *
408
+ * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
409
+ * disk, and the product's entire premise is that plaintext does not rest
410
+ * where it does not have to; a crash losing a held greeting is the correct
411
+ * trade. This is why the existing `outboundQueue` could not be reused — that
412
+ * one is persisted, and holds already-DR-encrypted bytes, which is exactly
413
+ * the encryption we are trying not to perform yet.
414
+ */
415
+ private _mlsHold;
416
+ /** How long a send waits for the Welcome. The two measured bursts were each
417
+ * confined to a single minute, with the group already existing server-side
418
+ * in the same second, so this is generous rather than tight. */
419
+ private static readonly MLS_HOLD_MS;
420
+ /** Bound on held sends per group — see `_holdForMls`. */
421
+ private static readonly MLS_HOLD_MAX;
422
+ /**
423
+ * Should this 1:1 send wait for MLS rather than go out over Double Ratchet?
424
+ *
425
+ * The discriminator exists at the moment of the bug: `_sessionGroupIds`
426
+ * already carries the conversation's group id — the server told us the group
427
+ * exists — while `_mlsGroups` has no usable manager for it. Group expected,
428
+ * group not ready.
429
+ *
430
+ * The negative case is load-bearing. A conversation with NO group id is
431
+ * legitimately Double Ratchet, and holding it would break owner-to-agent
432
+ * messaging outright, which is far worse than the bug this fixes. "Present"
433
+ * is also not "ready": a manager parked at epoch 0 has not joined (#1092),
434
+ * and reading presence as readiness is how #991 shipped.
435
+ */
436
+ private _shouldHoldForMls;
437
+ /** Park a send until the Welcome lands, or until the hold expires. */
438
+ private _holdForMls;
439
+ private _takeHold;
440
+ /** Re-drive one held send through the normal path, now that MLS is ready. */
441
+ private _resendHeld;
442
+ /** The Welcome landed — release everything held for this group, in order. */
443
+ private _flushMlsHold;
444
+ /**
445
+ * The hold expired. Send over Double Ratchet exactly as before.
446
+ *
447
+ * This is deliberately NOT a drop. #853 and #831 are Welcomes that never
448
+ * arrive; under those an unbounded hold turns a lost minute into an agent
449
+ * that never speaks again. The hold removes the race — it must not invent a
450
+ * new failure mode. The warning is the part that is new: today the loss is
451
+ * silent.
452
+ */
453
+ private _releaseHeldOverDr;
399
454
  send(plaintext: string, options?: InternalSendOptions): Promise<void>;
400
455
  /**
401
456
  * Retain one outbound plaintext against the MLS group it was sent to (#732).
@@ -724,6 +779,28 @@ export declare class SecureChannel extends EventEmitter {
724
779
  * Download an encrypted attachment blob, decrypt it, verify integrity,
725
780
  * and save the plaintext file to disk.
726
781
  */
782
+ /** Where an attachment may be written — always directly inside `attachDir` (#1143).
783
+ *
784
+ * The filename arrives INSIDE the envelope and is chosen by whoever sent the
785
+ * message. `join(attachDir, info.filename)` resolves `..` normally, so
786
+ * `../../agentvault.json` wrote over the device credential store. Only the
787
+ * final path component is honoured, and anything that is not a usable name
788
+ * falls back to a fixed one.
789
+ */
790
+ private _safeAttachmentPath;
791
+ /** Download an attachment and fold it into the text the agent sees (#1139).
792
+ *
793
+ * Extracted so the MLS receive path can use it too. It used to live inline in
794
+ * `_handleIncomingMessage`, which meant attachments worked on the Double
795
+ * Ratchet path ONLY — and hermes drops DR by design (`secure_channel.py:594`,
796
+ * "DR fallback is logged-and-dropped"), so no single transport could serve
797
+ * both client families. That is why an attachment reached ohtani and never
798
+ * reached smartcoder2 on 2026-08-31.
799
+ *
800
+ * Returns the text unchanged when there is no attachment or the fetch fails —
801
+ * but a failure is LOGGED and announced in the text, never silent.
802
+ */
803
+ private _augmentWithAttachment;
727
804
  private _downloadAndDecryptAttachment;
728
805
  /**
729
806
  * Upload an attachment file: encrypt, upload to server, return metadata
@@ -1 +1 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAW3C,OAAO,EAWL,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AAe5B,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EAKZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,QAAQ,EAER,UAAU,EAEV,cAAc,EACd,eAAe,EACf,eAAe,EACf,eAAe,EACf,UAAU,EAGX,MAAM,YAAY,CAAC;AAgFpB;;;;;GAKG;AACH,UAAU,mBAAoB,SAAQ,WAAW;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAiED;;;;;;4DAM4D;AAC5D,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAIhF;AAED,qBAAa,aAAc,SAAQ,YAAY;IAmOjC,OAAO,CAAC,MAAM;IAlO1B,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,sBAAsB,CAAc;IAC5C,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,SAAS,CAGH;IACd,OAAO,CAAC,GAAG,CAA0B;IACrC,OAAO,CAAC,UAAU,CAA8C;IAChE,OAAO,CAAC,iBAAiB,CAAK;IAC9B,O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;;;;;;;OAkBG;YACW,yBAAyB;YAwCzB,oBAAoB;IAkDlC;;;OAGG;YACW,aAAa;IA6B3B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;CAqB9B"}
package/dist/cli.js CHANGED
@@ -63251,11 +63251,11 @@ var init_mls_kp_pool = __esm({
63251
63251
 
63252
63252
  // src/client-version.ts
63253
63253
  function ownIdentity() {
63254
- const v2 = true ? "0.23.30" : FALLBACK;
63254
+ const v2 = true ? "0.23.31" : FALLBACK;
63255
63255
  return `${PACKAGE}@${v2}`;
63256
63256
  }
63257
63257
  function buildSha() {
63258
- const raw = true ? "1fff5d6" : "";
63258
+ const raw = true ? "3e1243a-dirty" : "";
63259
63259
  const cleaned = (raw ?? "").trim();
63260
63260
  return !cleaned || cleaned === "unknown" ? null : cleaned;
63261
63261
  }
@@ -65017,6 +65017,118 @@ var init_channel = __esm({
65017
65017
  * Encrypt and send a message to ALL owner devices (fanout).
65018
65018
  * Each session gets the same plaintext encrypted independently.
65019
65019
  */
65020
+ /**
65021
+ * #952 — sends held because MLS is expected for this conversation but the
65022
+ * group is not joined yet.
65023
+ *
65024
+ * ⚠️ IN MEMORY ONLY. These entries hold PLAINTEXT. `_persisted` is written to
65025
+ * disk, and the product's entire premise is that plaintext does not rest
65026
+ * where it does not have to; a crash losing a held greeting is the correct
65027
+ * trade. This is why the existing `outboundQueue` could not be reused — that
65028
+ * one is persisted, and holds already-DR-encrypted bytes, which is exactly
65029
+ * the encryption we are trying not to perform yet.
65030
+ */
65031
+ _mlsHold = /* @__PURE__ */ new Map();
65032
+ /** How long a send waits for the Welcome. The two measured bursts were each
65033
+ * confined to a single minute, with the group already existing server-side
65034
+ * in the same second, so this is generous rather than tight. */
65035
+ static MLS_HOLD_MS = 3e4;
65036
+ /** Bound on held sends per group — see `_holdForMls`. */
65037
+ static MLS_HOLD_MAX = 50;
65038
+ /**
65039
+ * Should this 1:1 send wait for MLS rather than go out over Double Ratchet?
65040
+ *
65041
+ * The discriminator exists at the moment of the bug: `_sessionGroupIds`
65042
+ * already carries the conversation's group id — the server told us the group
65043
+ * exists — while `_mlsGroups` has no usable manager for it. Group expected,
65044
+ * group not ready.
65045
+ *
65046
+ * The negative case is load-bearing. A conversation with NO group id is
65047
+ * legitimately Double Ratchet, and holding it would break owner-to-agent
65048
+ * messaging outright, which is far worse than the bug this fixes. "Present"
65049
+ * is also not "ready": a manager parked at epoch 0 has not joined (#1092),
65050
+ * and reading presence as readiness is how #991 shipped.
65051
+ */
65052
+ _shouldHoldForMls(convGroupId, mlsGroup, mlsGroupId) {
65053
+ if (!convGroupId) return false;
65054
+ const ready = Boolean(mlsGroup?.isInitialized) && Boolean(mlsGroupId) && Number(mlsGroup?.epoch) > 0;
65055
+ return !ready;
65056
+ }
65057
+ /** Park a send until the Welcome lands, or until the hold expires. */
65058
+ _holdForMls(convGroupId, convId, plaintext, options) {
65059
+ let entry = this._mlsHold.get(convGroupId);
65060
+ if (!entry) {
65061
+ const timer = setTimeout(() => {
65062
+ void this._releaseHeldOverDr(convGroupId);
65063
+ }, _SecureChannel.MLS_HOLD_MS);
65064
+ timer.unref?.();
65065
+ entry = { items: [], timer };
65066
+ this._mlsHold.set(convGroupId, entry);
65067
+ }
65068
+ if (entry.items.length >= _SecureChannel.MLS_HOLD_MAX) {
65069
+ entry.items.shift();
65070
+ console.warn(
65071
+ `[SecureChannel] MLS hold full for group ${convGroupId.slice(0, 8)} \u2014 dropped the oldest held message`
65072
+ );
65073
+ }
65074
+ entry.items.push({ convId, plaintext, options });
65075
+ console.log(
65076
+ `[SecureChannel] Holding send for group ${convGroupId.slice(0, 8)} until its Welcome lands (held=${entry.items.length})`
65077
+ );
65078
+ }
65079
+ _takeHold(convGroupId) {
65080
+ const entry = this._mlsHold.get(convGroupId);
65081
+ if (!entry) return null;
65082
+ clearTimeout(entry.timer);
65083
+ this._mlsHold.delete(convGroupId);
65084
+ return entry;
65085
+ }
65086
+ /** Re-drive one held send through the normal path, now that MLS is ready. */
65087
+ async _resendHeld(item) {
65088
+ await this.send(item.plaintext, {
65089
+ ...item.options ?? {},
65090
+ conversationId: item.convId,
65091
+ bypassMlsHold: true
65092
+ });
65093
+ }
65094
+ /** The Welcome landed — release everything held for this group, in order. */
65095
+ async _flushMlsHold(convGroupId) {
65096
+ const entry = this._takeHold(convGroupId);
65097
+ if (!entry) return;
65098
+ console.log(
65099
+ `[SecureChannel] Welcome landed for group ${convGroupId.slice(0, 8)} \u2014 releasing ${entry.items.length} held message(s) over MLS`
65100
+ );
65101
+ for (const item of entry.items) {
65102
+ try {
65103
+ await this._resendHeld(item);
65104
+ } catch (err) {
65105
+ console.warn("[SecureChannel] Held message failed to send after Welcome:", err);
65106
+ }
65107
+ }
65108
+ }
65109
+ /**
65110
+ * The hold expired. Send over Double Ratchet exactly as before.
65111
+ *
65112
+ * This is deliberately NOT a drop. #853 and #831 are Welcomes that never
65113
+ * arrive; under those an unbounded hold turns a lost minute into an agent
65114
+ * that never speaks again. The hold removes the race — it must not invent a
65115
+ * new failure mode. The warning is the part that is new: today the loss is
65116
+ * silent.
65117
+ */
65118
+ async _releaseHeldOverDr(convGroupId) {
65119
+ const entry = this._takeHold(convGroupId);
65120
+ if (!entry) return;
65121
+ console.warn(
65122
+ `[SecureChannel] No Welcome for group ${convGroupId.slice(0, 8)} within ${_SecureChannel.MLS_HOLD_MS}ms \u2014 releasing ${entry.items.length} message(s) over Double Ratchet. The recipient may not hold a ratchet with this device, in which case they are undeliverable (#952).`
65123
+ );
65124
+ for (const item of entry.items) {
65125
+ try {
65126
+ await this._resendHeld(item);
65127
+ } catch (err) {
65128
+ console.warn("[SecureChannel] Held message failed on Double Ratchet release:", err);
65129
+ }
65130
+ }
65131
+ }
65020
65132
  async send(plaintext, options) {
65021
65133
  if (isAbstention(plaintext)) return;
65022
65134
  if (this._state === "error" || this._state === "idle") {
@@ -65178,6 +65290,10 @@ var init_channel = __esm({
65178
65290
  );
65179
65291
  addressedMlsGroupIds.push(mlsGroupId);
65180
65292
  if (convGroupId) sentSharedGroupIds.add(convGroupId);
65293
+ } else if (!options?.bypassMlsHold && this._shouldHoldForMls(convGroupId, mlsGroup, mlsGroupId)) {
65294
+ this._holdForMls(convGroupId, convId, plaintext, options);
65295
+ sentCount++;
65296
+ continue;
65181
65297
  } else {
65182
65298
  const encrypted = session.ratchet.encrypt(plaintext);
65183
65299
  const transport = encryptedMessageToTransport(encrypted);
@@ -65347,7 +65463,7 @@ var init_channel = __esm({
65347
65463
  */
65348
65464
  sendActivitySpan(spanData) {
65349
65465
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
65350
- const pluginVersion = true ? "0.23.30" : "0.0.0-dev";
65466
+ const pluginVersion = true ? "0.23.31" : "0.0.0-dev";
65351
65467
  const agentName = this.config.agentName ?? "Agent";
65352
65468
  const resource = {
65353
65469
  "service.name": "agentvault-agent",
@@ -67285,7 +67401,7 @@ var init_channel = __esm({
67285
67401
  agentVersion: this.config.agentVersion ?? "0.0.0",
67286
67402
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67287
67403
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67288
- pluginVersion: true ? "0.23.30" : "0.0.0-dev"
67404
+ pluginVersion: true ? "0.23.31" : "0.0.0-dev"
67289
67405
  });
67290
67406
  this._telemetryReporter.startAutoFlush(3e4);
67291
67407
  }
@@ -67609,7 +67725,7 @@ var init_channel = __esm({
67609
67725
  agentVersion: this.config.agentVersion ?? "0.0.0",
67610
67726
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
67611
67727
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
67612
- pluginVersion: true ? "0.23.30" : "0.0.0-dev"
67728
+ pluginVersion: true ? "0.23.31" : "0.0.0-dev"
67613
67729
  });
67614
67730
  this._telemetryReporter.startAutoFlush(3e4);
67615
67731
  }
@@ -68025,11 +68141,13 @@ var init_channel = __esm({
68025
68141
  let text = plaintext;
68026
68142
  let messageType = "text";
68027
68143
  let topicId = data.topic_id;
68144
+ let mlsAttachment = null;
68028
68145
  try {
68029
68146
  const parsed = JSON.parse(plaintext);
68030
68147
  text = parsed.text ?? plaintext;
68031
68148
  messageType = parsed.type ?? "text";
68032
68149
  topicId = parsed.topicId ?? topicId;
68150
+ if (parsed.attachment) mlsAttachment = parsed.attachment;
68033
68151
  } catch {
68034
68152
  }
68035
68153
  if (messageType === "history_catchup_request") {
@@ -68096,6 +68214,9 @@ var init_channel = __esm({
68096
68214
  console.log(`[SecureChannel] Session ${convId.slice(0, 8)} activated via MLS message`);
68097
68215
  }
68098
68216
  }
68217
+ if (mlsAttachment) {
68218
+ text = await this._augmentWithAttachment(mlsAttachment, text);
68219
+ }
68099
68220
  const metadata = {
68100
68221
  messageId: data.message_id ?? `mls_${Date.now()}`,
68101
68222
  conversationId: convId ?? this._primaryConversationId,
@@ -68345,6 +68466,65 @@ ${messageText}`;
68345
68466
  * Download an encrypted attachment blob, decrypt it, verify integrity,
68346
68467
  * and save the plaintext file to disk.
68347
68468
  */
68469
+ /** Where an attachment may be written — always directly inside `attachDir` (#1143).
68470
+ *
68471
+ * The filename arrives INSIDE the envelope and is chosen by whoever sent the
68472
+ * message. `join(attachDir, info.filename)` resolves `..` normally, so
68473
+ * `../../agentvault.json` wrote over the device credential store. Only the
68474
+ * final path component is honoured, and anything that is not a usable name
68475
+ * falls back to a fixed one.
68476
+ */
68477
+ _safeAttachmentPath(attachDir, filename) {
68478
+ const raw = String(filename ?? "");
68479
+ const last = raw.split(/[\\/]/).pop() ?? "";
68480
+ const cleaned = last.replace(/\0/g, "").trim();
68481
+ const safe = cleaned === "" || cleaned === "." || cleaned === ".." ? "attachment.bin" : cleaned;
68482
+ return join4(attachDir, safe);
68483
+ }
68484
+ /** Download an attachment and fold it into the text the agent sees (#1139).
68485
+ *
68486
+ * Extracted so the MLS receive path can use it too. It used to live inline in
68487
+ * `_handleIncomingMessage`, which meant attachments worked on the Double
68488
+ * Ratchet path ONLY — and hermes drops DR by design (`secure_channel.py:594`,
68489
+ * "DR fallback is logged-and-dropped"), so no single transport could serve
68490
+ * both client families. That is why an attachment reached ohtani and never
68491
+ * reached smartcoder2 on 2026-08-31.
68492
+ *
68493
+ * Returns the text unchanged when there is no attachment or the fetch fails —
68494
+ * but a failure is LOGGED and announced in the text, never silent.
68495
+ */
68496
+ async _augmentWithAttachment(attachmentInfo, baseText) {
68497
+ if (!attachmentInfo) return baseText;
68498
+ try {
68499
+ const { filePath, decrypted } = await this._downloadAndDecryptAttachment(attachmentInfo);
68500
+ const mime = String(attachmentInfo.mime ?? "application/octet-stream");
68501
+ const name2 = String(attachmentInfo.filename ?? "attachment");
68502
+ const textMimes = ["text/", "application/json", "application/xml", "application/csv"];
68503
+ if (textMimes.some((m2) => mime.startsWith(m2))) {
68504
+ const content = new TextDecoder().decode(decrypted);
68505
+ return `[Attachment: ${name2} (${mime}) saved to ${filePath}]
68506
+ ---
68507
+ ${content}
68508
+ ---
68509
+
68510
+ ${baseText}`;
68511
+ }
68512
+ if (mime.startsWith("image/")) {
68513
+ return `[Image attachment: ${name2} saved to ${filePath}]
68514
+ Use your Read tool to view this image file.
68515
+
68516
+ ${baseText}`;
68517
+ }
68518
+ return `[Attachment: ${name2} saved to ${filePath}]
68519
+
68520
+ ${baseText}`;
68521
+ } catch (err) {
68522
+ console.error("[SecureChannel] Failed to download attachment:", err);
68523
+ return `[Attachment: ${String(attachmentInfo.filename ?? "file")} was sent but could not be retrieved: ${err}]
68524
+
68525
+ ${baseText}`;
68526
+ }
68527
+ }
68348
68528
  async _downloadAndDecryptAttachment(info) {
68349
68529
  const attachDir = join4(this.config.dataDir, "attachments");
68350
68530
  await mkdir3(attachDir, { recursive: true });
@@ -68364,7 +68544,7 @@ ${messageText}`;
68364
68544
  const fileKey = base64ToBytes(info.fileKey);
68365
68545
  const fileNonce = base64ToBytes(info.fileNonce);
68366
68546
  const decrypted = decryptFile(encryptedData, fileKey, fileNonce);
68367
- const filePath = join4(attachDir, info.filename);
68547
+ const filePath = this._safeAttachmentPath(attachDir, info.filename);
68368
68548
  await writeFile3(filePath, decrypted);
68369
68549
  console.log(`[SecureChannel] Attachment saved: ${filePath} (${decrypted.length} bytes)`);
68370
68550
  return { filePath, decrypted };
@@ -69785,6 +69965,7 @@ ${messageText}`;
69785
69965
  await this._persistState();
69786
69966
  }
69787
69967
  console.log(`[SecureChannel] Joined shared 1:1 MLS group for group ${conversationGroupId.slice(0, 8)} via Welcome (epoch=${mgr.epoch})`);
69968
+ await this._flushMlsHold(conversationGroupId);
69788
69969
  return;
69789
69970
  }
69790
69971
  if (conversationId) {
@@ -92272,7 +92453,7 @@ var init_index = __esm({
92272
92453
  await init_skill_telemetry();
92273
92454
  await init_policy_enforcer();
92274
92455
  init_room_protocol();
92275
- VERSION = true ? "0.23.30" : "0.0.0-dev";
92456
+ VERSION = true ? "0.23.31" : "0.0.0-dev";
92276
92457
  }
92277
92458
  });
92278
92459
 
@@ -92369,9 +92550,9 @@ function describeSdkCapabilities(results) {
92369
92550
  function describeBuildIdentity() {
92370
92551
  const name2 = "Build identity";
92371
92552
  try {
92372
- const raw = true ? "1fff5d6" : "";
92553
+ const raw = true ? "3e1243a-dirty" : "";
92373
92554
  const sha = (raw ?? "").trim();
92374
- const at = true ? "2026-08-31T12:25:33.277Z".trim() : "";
92555
+ const at = true ? "2026-08-31T18:35:24.661Z".trim() : "";
92375
92556
  const built = at ? ` built ${at}` : "";
92376
92557
  if (!sha || sha === "unknown") {
92377
92558
  return {
@@ -92422,6 +92603,7 @@ __export(doctor_exports, {
92422
92603
  checkAgentVaultChannel: () => checkAgentVaultChannel,
92423
92604
  checkConfigExists: () => checkConfigExists,
92424
92605
  checkGatewayPort: () => checkGatewayPort,
92606
+ checkKeyMaterialExposure: () => checkKeyMaterialExposure,
92425
92607
  checkOpenClawInstalled: () => checkOpenClawInstalled,
92426
92608
  checkPlist: () => checkPlist,
92427
92609
  checkPluginsAllow: () => checkPluginsAllow,
@@ -92433,7 +92615,7 @@ __export(doctor_exports, {
92433
92615
  validatePlist: () => validatePlist
92434
92616
  });
92435
92617
  import { execSync } from "node:child_process";
92436
- import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync, chmodSync } from "node:fs";
92618
+ import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync, chmodSync, readdirSync, statSync } from "node:fs";
92437
92619
  import { createRequire as createRequire2 } from "node:module";
92438
92620
  import { join as join5 } from "node:path";
92439
92621
  import { createInterface } from "node:readline";
@@ -92588,6 +92770,63 @@ function checkAgentDataDirs(config2) {
92588
92770
  }
92589
92771
  return { name: "Agent data dirs", status: "pass", message: "All data dirs valid" };
92590
92772
  }
92773
+ function checkKeyMaterialExposure(config2) {
92774
+ const name2 = "Key material at rest";
92775
+ try {
92776
+ const dataDirs = resolveAgentDataDirs(config2);
92777
+ if (dataDirs.length === 0) {
92778
+ return { name: name2, status: "skip", message: "No agent data dir configured" };
92779
+ }
92780
+ const loose = [];
92781
+ let mlsFiles = 0;
92782
+ let inspected = 0;
92783
+ for (const dir of dataDirs) {
92784
+ if (!existsSync2(dir)) continue;
92785
+ inspected++;
92786
+ const dirMode = statSync(dir).mode & 511;
92787
+ if (dirMode & 63) {
92788
+ loose.push(`${dir} is ${dirMode.toString(8)} (expected 700)`);
92789
+ }
92790
+ for (const f2 of readdirSync(dir)) {
92791
+ if (f2 !== "agentvault.json" && !(f2.startsWith("mls-") && f2.endsWith(".json"))) continue;
92792
+ if (f2.startsWith("mls-")) mlsFiles++;
92793
+ const mode = statSync(join5(dir, f2)).mode & 511;
92794
+ if (mode & 63) loose.push(`${f2} is ${mode.toString(8)} (expected 600)`);
92795
+ }
92796
+ }
92797
+ if (inspected === 0) {
92798
+ return { name: name2, status: "skip", message: "Agent data dir not present on this machine" };
92799
+ }
92800
+ if (loose.length > 0) {
92801
+ return {
92802
+ name: name2,
92803
+ status: "warn",
92804
+ message: `Key material is readable beyond its owner: ${loose.join("; ")}. Accepting same-user access (#622) assumes 600/700; this is wider than that.`
92805
+ };
92806
+ }
92807
+ return {
92808
+ name: name2,
92809
+ status: "pass",
92810
+ message: `${mlsFiles} MLS key file(s), 600 in a 700 dir. Note: the agent runs as the SAME USER as this bridge, so it can read its own private keys \u2014 that is by design, not a misconfiguration (#622). If you believe an agent was compromised, the remedy is rotation, not cleanup: re-enrol the agent (Recover / replace device) to invalidate the old keys.`
92811
+ };
92812
+ } catch (err) {
92813
+ return { name: name2, status: "skip", message: `Could not inspect key material: ${String(err)}` };
92814
+ }
92815
+ }
92816
+ function resolveAgentDataDirs(config2) {
92817
+ const av = config2?.channels?.agentvault;
92818
+ if (!av) return [];
92819
+ const home = process.env.HOME ?? "";
92820
+ const dirs = [];
92821
+ if (av.accounts && typeof av.accounts === "object") {
92822
+ for (const acct of Object.values(av.accounts)) {
92823
+ if (acct?.dataDir) dirs.push(String(acct.dataDir).replace(/^~/, home));
92824
+ }
92825
+ } else if (av.dataDir) {
92826
+ dirs.push(String(av.dataDir).replace(/^~/, home));
92827
+ }
92828
+ return dirs;
92829
+ }
92591
92830
  function checkPm2Status() {
92592
92831
  try {
92593
92832
  execSync("pm2 --version", { stdio: "pipe", timeout: 5e3 });
@@ -92745,6 +92984,7 @@ async function runDoctorCommand(options) {
92745
92984
  results.push(checkPlist());
92746
92985
  results.push(checkGatewayPort());
92747
92986
  results.push(checkAgentDataDirs(config2));
92987
+ results.push(checkKeyMaterialExposure(config2));
92748
92988
  results.push(checkPm2Status());
92749
92989
  const statusLabels = {
92750
92990
  pass: "pass",