@agentvault/openai-bridge 0.1.8 → 0.1.10

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/index.js CHANGED
@@ -21,12 +21,17 @@ __export(dist_exports, {
21
21
  CredentialStore: () => CredentialStore,
22
22
  PolicyEnforcer: () => PolicyEnforcer,
23
23
  SecureChannel: () => SecureChannel,
24
+ TOOL_INVOKE_SPAN_NAME: () => TOOL_INVOKE_SPAN_NAME,
24
25
  VERSION: () => VERSION,
25
26
  agentVaultPlugin: () => agentVaultPlugin,
27
+ buildToolInvokeSpan: () => buildToolInvokeSpan,
26
28
  checkGateway: () => checkGateway,
29
+ classifyDeliveryReceipt: () => classifyDeliveryReceipt,
30
+ classifyToolError: () => classifyToolError,
27
31
  clearHistoryRecoveryCode: () => clearHistoryRecoveryCode,
28
32
  configureHistoryRecoveryCode: () => configureHistoryRecoveryCode,
29
33
  createMcpHandler: () => createMcpHandler,
34
+ currentToolConversation: () => currentToolConversation,
30
35
  drainSkillSpans: () => drainSkillSpans,
31
36
  getActiveChannel: () => getActiveChannel,
32
37
  getMcpStatus: () => getMcpStatus,
@@ -46,17 +51,18 @@ __export(dist_exports, {
46
51
  managedRoutesRequested: () => managedRoutesRequested,
47
52
  mergeSkills: () => mergeSkills,
48
53
  offerHistoryRecoveryConfiguration: () => offerHistoryRecoveryConfiguration,
49
- onAgentEvent: () => onAgentEvent,
50
- onSessionTranscriptUpdate: () => onSessionTranscriptUpdate,
51
54
  owesRoomReply: () => owesRoomReply,
52
55
  parseMentions: () => parseMentions,
53
56
  parseSkillMd: () => parseSkillMd,
54
57
  parseTarget: () => parseTarget,
55
58
  readMaskedHistoryRecoveryCode: () => readMaskedHistoryRecoveryCode,
56
59
  reportSkillInvocation: () => reportSkillInvocation,
60
+ reportToolInvoke: () => reportToolInvoke,
57
61
  requestHeartbeatNow: () => requestHeartbeatNow,
58
62
  resolveAccount: () => resolveAccount,
59
63
  runHistoryRecoveryCommand: () => runHistoryRecoveryCommand,
64
+ runWithToolConversation: () => runWithToolConversation,
65
+ safeErrorKind: () => safeErrorKind,
60
66
  sendDecisionToOwner: () => sendDecisionToOwner,
61
67
  sendToOwner: () => sendToOwner,
62
68
  sendToRoom: () => sendToRoom,
@@ -89,12 +95,17 @@ import { homedir } from "node:os";
89
95
  import { dirname, join as join4, resolve } from "node:path";
90
96
  import { Writable } from "node:stream";
91
97
  import { createInterface } from "node:readline";
98
+ import { createRequire } from "node:module";
99
+ import { join as joinPath } from "node:path";
100
+ import { pathToFileURL } from "node:url";
101
+ import { AsyncLocalStorage } from "node:async_hooks";
102
+ import { randomBytes as randomBytes3 } from "node:crypto";
92
103
  import { Readable } from "node:stream";
93
104
  import { readdir as readdir2, readFile as readFile4, writeFile as writeFile2, rename as rename4, stat, unlink, mkdir as mkdir3 } from "node:fs/promises";
94
105
  import { join as join5 } from "node:path";
95
106
  import { randomUUID as randomUUID3 } from "node:crypto";
96
107
  import { EventEmitter } from "node:events";
97
- import { AsyncLocalStorage } from "node:async_hooks";
108
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
98
109
  import { createServer } from "node:http";
99
110
  import { randomUUID as randomUUID4, createHash } from "node:crypto";
100
111
  import { readFileSync } from "node:fs";
@@ -104,7 +115,7 @@ import { join as join6 } from "node:path";
104
115
  import { readFile as readFile5 } from "node:fs/promises";
105
116
  import WebSocket from "ws";
106
117
  import { resolve as resolve2 } from "node:path";
107
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
118
+ import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
108
119
  import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
109
120
  import { Http2ServerRequest } from "http2";
110
121
  import { Readable as Readable2 } from "stream";
@@ -9294,7 +9305,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
9294
9305
  });
9295
9306
  const { prehash } = eddsaOpts;
9296
9307
  const { BASE, Fp: Fp3, Fn: Fn3 } = Point;
9297
- const randomBytes3 = eddsaOpts.randomBytes || randomBytes2;
9308
+ const randomBytes4 = eddsaOpts.randomBytes || randomBytes2;
9298
9309
  const adjustScalarBytes3 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes);
9299
9310
  const domain = eddsaOpts.domain || ((data, ctx, phflag) => {
9300
9311
  _abool2(phflag, "phflag");
@@ -9376,7 +9387,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
9376
9387
  signature: 2 * _size2,
9377
9388
  seed: _size2
9378
9389
  };
9379
- function randomSecretKey(seed = randomBytes3(lengths.seed)) {
9390
+ function randomSecretKey(seed = randomBytes4(lengths.seed)) {
9380
9391
  return _abytes2(seed, lengths.seed, "seed");
9381
9392
  }
9382
9393
  function keygen(seed) {
@@ -10755,7 +10766,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
10755
10766
  bits2int: "function",
10756
10767
  bits2int_modN: "function"
10757
10768
  });
10758
- const randomBytes3 = ecdsaOpts.randomBytes || randomBytes2;
10769
+ const randomBytes4 = ecdsaOpts.randomBytes || randomBytes2;
10759
10770
  const hmac4 = ecdsaOpts.hmac || ((key, ...msgs) => hmac2(hash, key, concatBytes2(...msgs)));
10760
10771
  const { Fp: Fp3, Fn: Fn3 } = Point;
10761
10772
  const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn3;
@@ -10910,7 +10921,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
10910
10921
  const d2 = _normFnElement(Fn3, privateKey);
10911
10922
  const seedArgs = [int2octets(d2), int2octets(h1int)];
10912
10923
  if (extraEntropy != null && extraEntropy !== false) {
10913
- const e = extraEntropy === true ? randomBytes3(lengths.secretKey) : extraEntropy;
10924
+ const e = extraEntropy === true ? randomBytes4(lengths.secretKey) : extraEntropy;
10914
10925
  seedArgs.push(ensureBytes("extraEntropy", e));
10915
10926
  }
10916
10927
  const seed = concatBytes2(...seedArgs);
@@ -11788,11 +11799,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11788
11799
  return null;
11789
11800
  }
11790
11801
  function ownIdentity() {
11791
- const v2 = true ? "0.23.53" : FALLBACK;
11802
+ const v2 = true ? "0.23.61" : FALLBACK;
11792
11803
  return `${PACKAGE}@${v2}`;
11793
11804
  }
11794
11805
  function buildSha() {
11795
- const raw = true ? "3f2a933" : "";
11806
+ const raw = true ? "129e537" : "";
11796
11807
  const cleaned = (raw ?? "").trim();
11797
11808
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11798
11809
  }
@@ -11944,13 +11955,18 @@ async function enrollDevice(apiUrl, inviteToken, identityPkHex, ephemeralPkHex,
11944
11955
  return res.json();
11945
11956
  }
11946
11957
  async function pollDeviceStatus(apiUrl, deviceId) {
11947
- const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status`);
11958
+ const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status`, {
11959
+ signal: AbortSignal.timeout(1e4)
11960
+ });
11948
11961
  if (res.status === 429) {
11949
11962
  return { device_id: deviceId, status: "PENDING", fingerprint: "", rateLimited: true };
11950
11963
  }
11951
11964
  if (!res.ok) {
11952
11965
  const detail = await res.text();
11953
- throw new Error(`Status poll failed (${res.status}): ${detail}`);
11966
+ const err = new Error(`Status poll failed (${res.status}): ${detail}`);
11967
+ err.httpStatus = res.status;
11968
+ err.body = detail;
11969
+ throw err;
11954
11970
  }
11955
11971
  return res.json();
11956
11972
  }
@@ -12000,9 +12016,10 @@ function a2aChannelSignature(channels) {
12000
12016
  })).sort((a2, b2) => (a2.id ?? "").localeCompare(b2.id ?? ""))
12001
12017
  );
12002
12018
  }
12003
- function mlsMembershipFromStatus(status) {
12019
+ function mlsMembershipFromStatus(status, detail) {
12004
12020
  if (status === 200) return true;
12005
- if (status === 403 || status === 404) return false;
12021
+ if (status === 404) return false;
12022
+ if (status === 403 && detail === NOT_A_MEMBER_DETAIL) return false;
12006
12023
  return null;
12007
12024
  }
12008
12025
  function sanitizeError(error2) {
@@ -12536,6 +12553,13 @@ function decodeStrictBase64(value) {
12536
12553
  if (decoded.toString("base64") !== value) throw new Error("Invalid history backup encoding");
12537
12554
  return new Uint8Array(decoded);
12538
12555
  }
12556
+ function importerFrom(root3) {
12557
+ const req = createRequire(joinPath(root3, "package.json"));
12558
+ return (specifier) => import(
12559
+ /* @vite-ignore */
12560
+ pathToFileURL(req.resolve(specifier)).href
12561
+ );
12562
+ }
12539
12563
  async function resolveSdkFn(candidates, importer = defaultImporter) {
12540
12564
  for (const { specifier, symbol } of candidates) {
12541
12565
  try {
@@ -12561,40 +12585,105 @@ async function requestHeartbeatNow(opts) {
12561
12585
  }
12562
12586
  return false;
12563
12587
  }
12564
- async function onAgentEvent(callback) {
12565
- if (_agentEventFn === null) {
12566
- _agentEventFn = await resolveSdkFn(AGENT_EVENT_CANDIDATES);
12567
- }
12568
- if (typeof _agentEventFn === "function") {
12569
- try {
12570
- return _agentEventFn(callback);
12571
- } catch {
12572
- return () => {
12573
- };
12588
+ function safeErrorKind(value) {
12589
+ if (typeof value !== "string") return UNCLASSIFIED_ERROR;
12590
+ if (KNOWN_CODES.has(value)) return value;
12591
+ if (!CLASS_NAME_RE.test(value)) return UNCLASSIFIED_ERROR;
12592
+ if ((value.match(/[0-9]/g) ?? []).length > 3) return UNCLASSIFIED_ERROR;
12593
+ return value;
12594
+ }
12595
+ function codeForText(text) {
12596
+ const t2 = text.replace(/^[A-Za-z]*Error: /, "");
12597
+ for (const [re2, code] of ERROR_TEXT_CODES) if (re2.test(t2)) return code;
12598
+ return void 0;
12599
+ }
12600
+ function classifyToolError(err) {
12601
+ try {
12602
+ if (err instanceof Error) {
12603
+ return codeForText(err.message) ?? safeErrorKind(err.constructor?.name);
12574
12604
  }
12605
+ if (typeof err === "string") return codeForText(err) ?? UNCLASSIFIED_ERROR;
12606
+ } catch {
12575
12607
  }
12576
- return () => {
12608
+ return UNCLASSIFIED_ERROR;
12609
+ }
12610
+ function classifyDeliveryReceipt(receipt) {
12611
+ if (!receipt) return "no_receipt";
12612
+ if (receipt.ambiguous) return "ambiguous_target";
12613
+ if (typeof receipt.error === "string") return codeForText(receipt.error) ?? "delivery_failed";
12614
+ return "delivery_failed";
12615
+ }
12616
+ async function runWithToolConversation(conversation, fn) {
12617
+ const store = {
12618
+ conversation: conversation.kind === "unknown" || !conversation.id ? { kind: "unknown" } : { kind: conversation.kind, id: conversation.id },
12619
+ ended: false
12577
12620
  };
12621
+ try {
12622
+ return await _conversation.run(store, fn);
12623
+ } finally {
12624
+ store.ended = true;
12625
+ }
12578
12626
  }
12579
- async function onSessionTranscriptUpdate(callback) {
12580
- if (_transcriptFn === null) {
12581
- _transcriptFn = await resolveSdkFn(TRANSCRIPT_CANDIDATES);
12627
+ function currentToolConversation() {
12628
+ const store = _conversation.getStore();
12629
+ if (!store || store.ended) return { kind: "unknown" };
12630
+ return store.conversation;
12631
+ }
12632
+ function conversationForTarget(target, opts = {}) {
12633
+ if (typeof opts.conversationId === "string" && opts.conversationId) {
12634
+ return { kind: "direct", id: opts.conversationId };
12582
12635
  }
12583
- if (typeof _transcriptFn === "function") {
12584
- try {
12585
- return _transcriptFn(callback);
12586
- } catch {
12587
- return () => {
12588
- };
12589
- }
12636
+ const turn = currentToolConversation();
12637
+ if (!target || target.kind === "context") return turn;
12638
+ switch (target.kind) {
12639
+ case "room":
12640
+ return target.roomId ? { kind: "room", id: target.roomId } : { kind: "unknown" };
12641
+ case "owner":
12642
+ return turn.kind === "direct" ? turn : { kind: "unknown" };
12643
+ default:
12644
+ return { kind: "unknown" };
12590
12645
  }
12591
- return () => {
12646
+ }
12647
+ function buildToolInvokeSpan(report) {
12648
+ const isError = report.outcome === "error";
12649
+ const outcome = isError ? "error" : report.outcome === "cancelled" ? "cancelled" : "success";
12650
+ const durationMs = Math.max(0, Math.round(Number(report.durationMs) || 0));
12651
+ const endTime = report.endTime ?? Date.now();
12652
+ const conv = report.conversation ?? currentToolConversation();
12653
+ const kind = conv.kind === "room" || conv.kind === "direct" ? conv.kind : "unknown";
12654
+ const attributes = {
12655
+ "tool.name": TOOL_NAME_RE.test(report.toolName) ? report.toolName : "unknown",
12656
+ "tool.outcome": outcome,
12657
+ "av.conversation_kind": kind,
12658
+ "tool.duration_ms": durationMs
12659
+ };
12660
+ if (isError) attributes["tool.error_kind"] = safeErrorKind(report.errorKind);
12661
+ const resets = report.limitResetsAt;
12662
+ if (attributes["tool.error_kind"] === "plan_limit_reached" && typeof resets === "number" && Number.isInteger(resets) && resets > 0 && resets < 1e11) {
12663
+ attributes["av.limit_resets_at"] = resets;
12664
+ }
12665
+ if (kind !== "unknown" && typeof conv.id === "string" && conv.id) {
12666
+ attributes["av.conversation_id"] = conv.id.slice(0, 64);
12667
+ }
12668
+ return {
12669
+ traceId: randomBytes3(16).toString("hex"),
12670
+ spanId: randomBytes3(8).toString("hex"),
12671
+ name: TOOL_INVOKE_SPAN_NAME,
12672
+ kind: "internal",
12673
+ startTime: endTime - durationMs,
12674
+ endTime,
12675
+ attributes,
12676
+ // OTLP codes: 1 = ok, 2 = error (the backend stores "ok" / "error").
12677
+ // A cancellation is not a problem: OK status, outcome "cancelled".
12678
+ status: { code: isError ? 2 : 1 }
12592
12679
  };
12593
12680
  }
12594
- function _resetCompatCacheForTest() {
12595
- _heartbeatFn = null;
12596
- _agentEventFn = null;
12597
- _transcriptFn = null;
12681
+ function reportToolInvoke(sink, report) {
12682
+ try {
12683
+ if (!sink || typeof sink.reportCustomSpan !== "function") return;
12684
+ sink.reportCustomSpan(buildToolInvokeSpan(report));
12685
+ } catch {
12686
+ }
12598
12687
  }
12599
12688
  function ownerRoutingFrom(parsed) {
12600
12689
  const out = {};
@@ -12620,6 +12709,34 @@ function statusOf(receipt) {
12620
12709
  return receipt.ok ? 200 : 500;
12621
12710
  }
12622
12711
  async function handleSendRequest(parsed, channel) {
12712
+ const startedAt = Date.now();
12713
+ const result = await _handleSendRequest(parsed, channel);
12714
+ try {
12715
+ const body = result.body;
12716
+ const failed = body?.ok !== true;
12717
+ reportToolInvoke(channel.telemetry, {
12718
+ toolName: "agentvault_send",
12719
+ outcome: failed ? "error" : "success",
12720
+ errorKind: !failed ? void 0 : result.status === 400 ? "invalid_request" : result.status === 409 ? "ambiguous_target" : classifyDeliveryReceipt(body),
12721
+ durationMs: Date.now() - startedAt,
12722
+ conversation: sendConversation(parsed)
12723
+ });
12724
+ } catch {
12725
+ }
12726
+ return result;
12727
+ }
12728
+ function sendConversation(parsed) {
12729
+ const str = (v2) => typeof v2 === "string" && v2 ? v2 : void 0;
12730
+ if (str(parsed.hub_address) ?? str(parsed.a2a_address) ?? str(parsed.a2aAddress) ?? str(parsed.channel_id)) {
12731
+ return { kind: "unknown" };
12732
+ }
12733
+ const roomId = str(parsed.room_id);
12734
+ if (roomId) return conversationForTarget({ kind: "room", roomId });
12735
+ if (parsed.target === "context") return conversationForTarget({ kind: "context" });
12736
+ if (parsed.audience === "everyone") return { kind: "unknown" };
12737
+ return conversationForTarget({ kind: "owner" }, { conversationId: str(parsed.conversation_id) });
12738
+ }
12739
+ async function _handleSendRequest(parsed, channel) {
12623
12740
  const text = parsed.text;
12624
12741
  if (!text || typeof text !== "string") {
12625
12742
  return { status: 400, body: { ok: false, error: "Missing 'text' field" } };
@@ -13075,6 +13192,14 @@ function _isSelfHubAddress(ownHubAddress, target) {
13075
13192
  const tgt = (target ?? "").trim().toLowerCase();
13076
13193
  return own2.length > 0 && own2 === tgt;
13077
13194
  }
13195
+ function keepKnownMemberTenants(previous, next) {
13196
+ const known = /* @__PURE__ */ new Map();
13197
+ for (const m2 of previous) if (m2.tenantId) known.set(m2.deviceId, m2.tenantId);
13198
+ return next.map((m2) => {
13199
+ const tenantId = m2.tenantId ? void 0 : known.get(m2.deviceId);
13200
+ return tenantId ? { ...m2, tenantId } : m2;
13201
+ });
13202
+ }
13078
13203
  function historyErrorReason(error2) {
13079
13204
  let name = "Error";
13080
13205
  let status;
@@ -18371,7 +18496,7 @@ function reportSkillInvocation(opts) {
18371
18496
  spanBuffer.push(span);
18372
18497
  return span;
18373
18498
  }
18374
- var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto3, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
18499
+ var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto3, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, NOT_A_MEMBER_DETAIL, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, _heartbeatFn, init_openclaw_compat, TOOL_INVOKE_SPAN_NAME, UNCLASSIFIED_ERROR, KNOWN_TOOL_ERROR_CODES, KNOWN_CODES, CLASS_NAME_RE, TOOL_NAME_RE, ERROR_TEXT_CODES, _conversation, init_tool_telemetry, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
18375
18500
  var init_dist = __esm({
18376
18501
  async "../plugin/dist/index.js"() {
18377
18502
  "use strict";
@@ -70843,6 +70968,7 @@ var init_dist = __esm({
70843
70968
  init_mls_membership_probe = __esm2({
70844
70969
  "src/mls-membership-probe.ts"() {
70845
70970
  "use strict";
70971
+ NOT_A_MEMBER_DETAIL = "Not authorized for this MLS group";
70846
70972
  }
70847
70973
  });
70848
70974
  init_history_backup_scheduler = __esm2({
@@ -71320,12 +71446,8 @@ var init_dist = __esm({
71320
71446
  });
71321
71447
  openclaw_compat_exports = {};
71322
71448
  __export2(openclaw_compat_exports, {
71323
- AGENT_EVENT_CANDIDATES: () => AGENT_EVENT_CANDIDATES,
71324
71449
  HEARTBEAT_CANDIDATES: () => HEARTBEAT_CANDIDATES,
71325
- TRANSCRIPT_CANDIDATES: () => TRANSCRIPT_CANDIDATES,
71326
- _resetCompatCacheForTest: () => _resetCompatCacheForTest,
71327
- onAgentEvent: () => onAgentEvent,
71328
- onSessionTranscriptUpdate: () => onSessionTranscriptUpdate,
71450
+ importerFrom: () => importerFrom,
71329
71451
  requestHeartbeatNow: () => requestHeartbeatNow,
71330
71452
  resolveSdkFn: () => resolveSdkFn
71331
71453
  });
@@ -71342,23 +71464,61 @@ var init_dist = __esm({
71342
71464
  // <=2026.6.x — deep dist path, original name.
71343
71465
  { specifier: "openclaw/dist/plugin-sdk/infra/heartbeat-wake.js", symbol: "requestHeartbeatNow" }
71344
71466
  ];
71345
- AGENT_EVENT_CANDIDATES = [
71346
- { specifier: "openclaw/plugin-sdk/agent-harness", symbol: "onAgentEvent" },
71347
- { specifier: "openclaw/dist/plugin-sdk/infra/agent-events.js", symbol: "onAgentEvent" }
71467
+ _heartbeatFn = null;
71468
+ }
71469
+ });
71470
+ init_tool_telemetry = __esm2({
71471
+ "src/tool-telemetry.ts"() {
71472
+ "use strict";
71473
+ TOOL_INVOKE_SPAN_NAME = "ai.agent.tool.invoke";
71474
+ UNCLASSIFIED_ERROR = "unclassified";
71475
+ KNOWN_TOOL_ERROR_CODES = [
71476
+ "relay_not_connected",
71477
+ "mls_group_not_initialized",
71478
+ "mls_encrypt_failed",
71479
+ "room_not_found",
71480
+ "a2a_channel_not_found",
71481
+ "channel_not_ready",
71482
+ "channel_not_started",
71483
+ "no_active_sessions",
71484
+ "no_conversation_ready",
71485
+ "blocked_by_policy",
71486
+ "unknown_target",
71487
+ "unsupported_destination",
71488
+ "delivery_timeout",
71489
+ "delivery_cancelled",
71490
+ "delivery_failed",
71491
+ "ambiguous_target",
71492
+ "no_receipt",
71493
+ "invalid_request",
71494
+ // #1467: the owner's own AI plan refused the turn (a bridge on a subscription).
71495
+ "plan_limit_reached",
71496
+ // #1467: a Muse turn failed — Meta answered 429, or anything else.
71497
+ "model_rate_limited",
71498
+ "model_error",
71499
+ UNCLASSIFIED_ERROR
71348
71500
  ];
71349
- TRANSCRIPT_CANDIDATES = [
71350
- {
71351
- specifier: "openclaw/plugin-sdk/memory-core-host-engine-foundation",
71352
- symbol: "onSessionTranscriptUpdate"
71353
- },
71354
- {
71355
- specifier: "openclaw/dist/plugin-sdk/sessions/transcript-events.js",
71356
- symbol: "onSessionTranscriptUpdate"
71357
- }
71501
+ KNOWN_CODES = new Set(KNOWN_TOOL_ERROR_CODES);
71502
+ CLASS_NAME_RE = /^(?:[A-Za-z][A-Za-z0-9_]{0,47})?(?:Error|Exception)$/;
71503
+ TOOL_NAME_RE = /^[A-Za-z0-9_.:-]{1,64}$/;
71504
+ ERROR_TEXT_CODES = [
71505
+ [/relay socket is not open/, "relay_not_connected"],
71506
+ [/has no initialized MLS group/, "mls_group_not_initialized"],
71507
+ [/^MLS encrypt failed/, "mls_encrypt_failed"],
71508
+ [/^Room .+ not found$/, "room_not_found"],
71509
+ [/^No A2A channel found|^A2A channel .+ not found$/, "a2a_channel_not_found"],
71510
+ [/^Channel is not ready$|^Channel is in \w+ state$/, "channel_not_ready"],
71511
+ [/^AgentVault channel not connected$|^Channel not started$/, "channel_not_started"],
71512
+ [/^No active sessions$/, "no_active_sessions"],
71513
+ [/^No conversation is ready to receive/, "no_conversation_ready"],
71514
+ [/^Message blocked by scan rule/, "blocked_by_policy"],
71515
+ [/^Unknown target kind$/, "unknown_target"],
71516
+ [/can only be sent to owner|cannot be sent to A2A targets/, "unsupported_destination"],
71517
+ [/^Delivery timed out$/, "delivery_timeout"],
71518
+ [/^Delivery cancelled$/, "delivery_cancelled"],
71519
+ [/^Delivery failed$/, "delivery_failed"]
71358
71520
  ];
71359
- _heartbeatFn = null;
71360
- _agentEventFn = null;
71361
- _transcriptFn = null;
71521
+ _conversation = new AsyncLocalStorage();
71362
71522
  }
71363
71523
  });
71364
71524
  http_handlers_exports = {};
@@ -71375,6 +71535,7 @@ var init_dist = __esm({
71375
71535
  "src/http-handlers.ts"() {
71376
71536
  "use strict";
71377
71537
  init_owner_routing();
71538
+ init_tool_telemetry();
71378
71539
  }
71379
71540
  });
71380
71541
  mcp_proxy_helpers_exports = {};
@@ -71455,7 +71616,7 @@ var init_dist = __esm({
71455
71616
  OUTBOUND_DEDUPE_TYPES = /* @__PURE__ */ new Set(["text", "status_alert", "artifact", "attachment"]);
71456
71617
  RETRY_CANDIDATE_TTL_MS = 6e4;
71457
71618
  RETRY_CANDIDATE_MAX = 32;
71458
- _turnConversation = new AsyncLocalStorage();
71619
+ _turnConversation = new AsyncLocalStorage2();
71459
71620
  PERSON_INVOLVED_WINDOW_MS = 5 * 6e4;
71460
71621
  ATTESTED_INBOUND_MAX = 64;
71461
71622
  UNMAPPED_RECONCILE_COOLDOWN_MS = 6e4;
@@ -71546,6 +71707,17 @@ var init_dist = __esm({
71546
71707
  * self-heal rather than be logged and dropped. */
71547
71708
  _mlsCommitFailCounts = /* @__PURE__ */ new Map();
71548
71709
  static MAX_MLS_DECRYPT_FAILS = 3;
71710
+ /**
71711
+ * #1518: ids of MLS application frames this process has already decrypted
71712
+ * (server-assigned `mls_messages.id`, the same on the live delivery pull and
71713
+ * on a `/sync` / reconnect replay). A replayed frame cannot be decrypted a
71714
+ * second time — forward secrecy deleted its key — so without this every
71715
+ * reconnect after a backend deploy fed already-read messages into the
71716
+ * decrypt-failure counter and re-admitted the agent (+2 epochs). Insertion
71717
+ * ordered; the oldest ids fall out past DECRYPTED_ID_CAP.
71718
+ */
71719
+ _decryptedMessageIds = /* @__PURE__ */ new Map();
71720
+ static DECRYPTED_ID_CAP = 5e3;
71549
71721
  /**
71550
71722
  * #1084: consecutive resyncs that found NOTHING to apply, per group.
71551
71723
  *
@@ -71618,15 +71790,19 @@ var init_dist = __esm({
71618
71790
  */
71619
71791
  _recentRoomAttachments = /* @__PURE__ */ new Map();
71620
71792
  static RECENT_ROOM_ATTACHMENT_MS = 10 * 60 * 1e3;
71621
- /** #1181: prefix a room turn that carries no attachment with the one saved in this room recently. */
71793
+ /** #1181: prefix a room turn that carries no attachment with the one saved in this room recently.
71794
+ * `from` is who sent that file (#1459), so the turn can be marked as carrying their content. */
71622
71795
  _withRecentRoomAttachmentNote(roomId, text) {
71623
71796
  const recent = this._recentRoomAttachments.get(roomId);
71624
- if (!recent) return text;
71797
+ if (!recent) return { text };
71625
71798
  const ageMs = Date.now() - recent.at;
71626
- if (ageMs > _SecureChannel.RECENT_ROOM_ATTACHMENT_MS) return text;
71627
- return `[Most recent file in this room: ${recent.filePath} (${recent.name}, received ${Math.round(ageMs / 1e3)}s ago). If this message refers to "the file" or "this file", it means that one \u2014 use your Read tool on it.]
71799
+ if (ageMs > _SecureChannel.RECENT_ROOM_ATTACHMENT_MS) return { text };
71800
+ return {
71801
+ text: `[Most recent file in this room: ${recent.filePath} (${recent.name}, received ${Math.round(ageMs / 1e3)}s ago). If this message refers to "the file" or "this file", it means that one \u2014 use your Read tool on it.]
71628
71802
 
71629
- ${text}`;
71803
+ ${text}`,
71804
+ from: recent.senderDeviceId ?? null
71805
+ };
71630
71806
  }
71631
71807
  /**
71632
71808
  * #1161: room attachments whose caption addressed nobody, NOT yet fetched.
@@ -71640,22 +71816,22 @@ ${text}`;
71640
71816
  _deferredRoomAttachments = /* @__PURE__ */ new Map();
71641
71817
  static DEFERRED_ROOM_ATTACHMENT_MAX = 5;
71642
71818
  static DEFERRED_ROOM_ATTACHMENT_MS = 60 * 60 * 1e3;
71643
- _deferRoomAttachment(roomId, info) {
71819
+ _deferRoomAttachment(roomId, info, senderDeviceId) {
71644
71820
  const list = this._deferredRoomAttachments.get(roomId) ?? [];
71645
- list.push({ info, at: Date.now() });
71821
+ list.push({ info, at: Date.now(), senderDeviceId });
71646
71822
  while (list.length > _SecureChannel.DEFERRED_ROOM_ATTACHMENT_MAX) list.shift();
71647
71823
  this._deferredRoomAttachments.set(roomId, list);
71648
71824
  console.log(
71649
71825
  `[SecureChannel] room ${roomId.slice(0, 8)}: attachment ${String(info?.filename ?? "file")} deferred \u2014 caption addresses nobody, fetch on the next @-addressed turn (#1161)`
71650
71826
  );
71651
71827
  }
71652
- /** Drain the room's deferred attachments that are still fresh (oldest first). */
71828
+ /** Drain the room's deferred attachments that are still fresh (oldest first), with who sent each. */
71653
71829
  _takeDeferredRoomAttachments(roomId) {
71654
71830
  const list = this._deferredRoomAttachments.get(roomId);
71655
71831
  if (!list?.length) return [];
71656
71832
  this._deferredRoomAttachments.delete(roomId);
71657
71833
  const cutoff = Date.now() - _SecureChannel.DEFERRED_ROOM_ATTACHMENT_MS;
71658
- return list.filter((d2) => d2.at >= cutoff).map((d2) => d2.info);
71834
+ return list.filter((d2) => d2.at >= cutoff).map((d2) => ({ info: d2.info, senderDeviceId: d2.senderDeviceId }));
71659
71835
  }
71660
71836
  /** In-flight roster-refresh promises (per room) — dedup concurrent refreshes. */
71661
71837
  _roomRosterRefreshInFlight = /* @__PURE__ */ new Map();
@@ -71822,6 +71998,119 @@ ${text}`;
71822
71998
  console.warn("[SecureChannel] failed to post auth_failed:", err);
71823
71999
  }
71824
72000
  }
72001
+ /**
72002
+ * Ask the PUBLIC status endpoint what this device is right now. Used to
72003
+ * CONFIRM a credential rejection before acting on it — a 403 on its own
72004
+ * cannot tell "revoked" from "paused by its owner" (both are non-ACTIVE to
72005
+ * get_device_auth), and treating a pause as a revoke is what removed
72006
+ * loopita's launchd service on 2026-10-25.
72007
+ *
72008
+ * Only two answers are terminal: REVOKED, and a deleted row (404 whose
72009
+ * JSON `detail` is exactly get_device_or_404's "Device not found" — any
72010
+ * other 404 is something in the way, not proof). Everything unreadable or inconclusive (network, 5xx, 429,
72011
+ * PENDING, an ACTIVE device answering 403) is `unknown`, which callers MUST
72012
+ * treat as transient: never terminal, never an uninstall, never a banner.
72013
+ */
72014
+ async _readDeviceStanding() {
72015
+ const deviceId = this._deviceId ?? this._persisted?.deviceId;
72016
+ if (!deviceId) return { kind: "unknown", why: "no device id" };
72017
+ try {
72018
+ const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
72019
+ if (!st || st.rateLimited) return { kind: "unknown", why: "rate limited" };
72020
+ if (st.status === "SUSPENDED") return { kind: "suspended" };
72021
+ if (st.status === "REVOKED") return { kind: "gone", reason: "device_revoked" };
72022
+ if (st.status === "ACTIVE" || st.status === "APPROVED") return { kind: "active" };
72023
+ return { kind: "unknown", why: `status ${String(st.status)}` };
72024
+ } catch (err) {
72025
+ const e = err;
72026
+ if (e?.httpStatus === 404) {
72027
+ try {
72028
+ const parsed = JSON.parse(e.body ?? "");
72029
+ if (parsed?.detail === _SecureChannel.DEVICE_DELETED_DETAIL) {
72030
+ return { kind: "gone", reason: "device_deleted" };
72031
+ }
72032
+ } catch {
72033
+ }
72034
+ }
72035
+ return { kind: "unknown", why: err instanceof Error ? err.message : String(err) };
72036
+ }
72037
+ }
72038
+ /**
72039
+ * A credential path answered 403 (today: /auth/reissue). Confirm before
72040
+ * concluding anything:
72041
+ * - REVOKED / deleted -> terminal: re_enroll health report + `auth_failed`
72042
+ * carrying `deviceGone: true` (the ONLY verdict the
72043
+ * bridges' self-uninstall acts on).
72044
+ * - SUSPENDED -> suspended-wait (idle, keep polling, resume).
72045
+ * - anything else -> transient; nothing is emitted or reported.
72046
+ * Already paused => stay paused without another status read: the
72047
+ * suspended-wait poll owns that question and will see a later revoke.
72048
+ */
72049
+ async _confirmForbidden(source) {
72050
+ if (this._suspended) return "suspended";
72051
+ const standing = await this._readDeviceStanding();
72052
+ if (standing.kind === "gone") {
72053
+ console.warn(
72054
+ `[SecureChannel] ${source}: 403 confirmed by the status endpoint (${standing.reason}) \u2014 terminal`
72055
+ );
72056
+ this._authFailedThisSession = true;
72057
+ await this._postAuthFailedToBackend(standing.reason);
72058
+ this.emit("auth_failed", { reason: standing.reason, deviceGone: true });
72059
+ return "gone";
72060
+ }
72061
+ if (standing.kind === "suspended") {
72062
+ this._enterSuspendedWait(source);
72063
+ return "suspended";
72064
+ }
72065
+ console.warn(
72066
+ `[SecureChannel] ${source}: 403 but the device is not confirmed revoked (${standing.kind === "unknown" ? standing.why : standing.kind}) \u2014 treating as transient`
72067
+ );
72068
+ return "transient";
72069
+ }
72070
+ /** The backend's exact detail for an inactive (paused/revoked/deleted) device. */
72071
+ static INACTIVE_DEVICE_DETAIL = "Device not found or not active";
72072
+ /** get_device_or_404's exact detail — the only 404 that means "row deleted". */
72073
+ static DEVICE_DELETED_DETAIL = "Device not found";
72074
+ /**
72075
+ * After a TRANSIENT inactive-403 verdict, how long before another 403 may
72076
+ * re-read the status endpoint. Long enough that a burst cannot trip the
72077
+ * 1-per-5s limiter (which would itself read as "unknown"); short enough that
72078
+ * a revoke behind an outage is still noticed within the session (dr-evil Q1).
72079
+ */
72080
+ static INACTIVE_403_RECHECK_MS = 3e4;
72081
+ /** Read a FastAPI error `detail` without consuming the caller's body. */
72082
+ async _errorDetail(resp) {
72083
+ try {
72084
+ const body = await resp.clone().json();
72085
+ return typeof body?.detail === "string" ? body.detail : null;
72086
+ } catch {
72087
+ return null;
72088
+ }
72089
+ }
72090
+ // One confirmation per WS session, shared by every caller: a burst of 403s
72091
+ // (the open handler fires several REST calls at once) must not turn into a
72092
+ // burst of status reads against a 1-per-5s rate limit. Reset in _connect.
72093
+ _inactive403Check = null;
72094
+ _inactive403RetryAt = 0;
72095
+ /**
72096
+ * A REST call answered 403 "Device not found or not active". With the
72097
+ * companion backend change this is how EVERY inactive-device auth failure
72098
+ * arrives (401 now means a bad token only, so `_authedFetch`'s reissue never
72099
+ * runs for it). Same rule as the reissue path: confirm, then act.
72100
+ */
72101
+ _confirmInactive403(source) {
72102
+ if (this._inactive403Check) return this._inactive403Check;
72103
+ if (Date.now() < this._inactive403RetryAt) return Promise.resolve("transient");
72104
+ const check = this._confirmForbidden(source).then((verdict) => {
72105
+ if (verdict === "transient" && this._inactive403Check === check) {
72106
+ this._inactive403Check = null;
72107
+ this._inactive403RetryAt = Date.now() + _SecureChannel.INACTIVE_403_RECHECK_MS;
72108
+ }
72109
+ return verdict;
72110
+ });
72111
+ this._inactive403Check = check;
72112
+ return check;
72113
+ }
71825
72114
  /**
71826
72115
  * Proactively reissue the persisted device JWT when its remaining lifetime
71827
72116
  * is under 30 days. Called before each WebSocket connect attempt so the
@@ -71840,6 +72129,9 @@ ${text}`;
71840
72129
  * than read back off `_authFailedThisSession`, whose lifetime is reset per
71841
72130
  * connect and is easy to get subtly wrong.
71842
72131
  */
72132
+ //
72133
+ // 2026-10-25: a TRUE return now also covers "paused by its owner" (a 403
72134
+ // confirmed SUSPENDED). The caller tells the two apart by `_suspended`.
71843
72135
  async _maybeReissueDeviceJwt() {
71844
72136
  const jwt = this._persisted?.deviceJwt ?? this._deviceJwt;
71845
72137
  if (!jwt) return false;
@@ -71867,12 +72159,16 @@ ${text}`;
71867
72159
  }
71868
72160
  return false;
71869
72161
  }
71870
- if (resp.status === 401 || resp.status === 403) {
72162
+ if (resp.status === 403) {
72163
+ console.warn("[SecureChannel] reissue rejected (403); confirming device status");
72164
+ const verdict = await this._confirmForbidden("reissue_forbidden");
72165
+ return verdict !== "transient";
72166
+ }
72167
+ if (resp.status === 401) {
71871
72168
  console.warn(`[SecureChannel] reissue rejected (${resp.status}); credentials need attention`);
71872
72169
  this._authFailedThisSession = true;
71873
- const reason = resp.status === 401 ? "device_jwt_expired" : "device_revoked";
71874
- await this._postAuthFailedToBackend(reason);
71875
- this.emit("auth_failed", { reason });
72170
+ await this._postAuthFailedToBackend("device_jwt_expired");
72171
+ this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
71876
72172
  return true;
71877
72173
  }
71878
72174
  console.warn(`[SecureChannel] reissue ${resp.status}; keeping current jwt`);
@@ -71931,13 +72227,17 @@ ${text}`;
71931
72227
  };
71932
72228
  resp = await fetch(url2, { ...init, headers: retryHeaders });
71933
72229
  }
71934
- } else if (reissueResp.status === 401 || reissueResp.status === 403) {
72230
+ } else if (reissueResp.status === 403) {
72231
+ await this._confirmForbidden("reissue_forbidden");
72232
+ } else if (reissueResp.status === 401) {
71935
72233
  this._authFailedThisSession = true;
71936
- const reason = reissueResp.status === 401 ? "device_jwt_expired" : "device_revoked";
71937
- await this._postAuthFailedToBackend(reason);
71938
- this.emit("auth_failed", { reason });
72234
+ await this._postAuthFailedToBackend("device_jwt_expired");
72235
+ this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
71939
72236
  }
71940
72237
  }
72238
+ if (resp.status === 403 && await this._errorDetail(resp) === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
72239
+ await this._confirmInactive403("rest_forbidden");
72240
+ }
71941
72241
  return resp;
71942
72242
  }
71943
72243
  get state() {
@@ -73623,7 +73923,7 @@ ${text}`;
73623
73923
  */
73624
73924
  sendActivitySpan(spanData) {
73625
73925
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
73626
- const pluginVersion = true ? "0.23.53" : "0.0.0-dev";
73926
+ const pluginVersion = true ? "0.23.61" : "0.0.0-dev";
73627
73927
  const agentName = this.config.agentName ?? "Agent";
73628
73928
  const resource = {
73629
73929
  "service.name": "agentvault-agent",
@@ -73774,11 +74074,15 @@ ${text}`;
73774
74074
  }
73775
74075
  const existingMlsGroupId = this._persisted.rooms[roomData.roomId]?.mlsGroupId;
73776
74076
  const existingMlsTs = this._persisted.rooms[roomData.roomId]?.lastMlsMessageTs;
74077
+ const members2 = keepKnownMemberTenants(
74078
+ this._persisted.rooms[roomData.roomId]?.members ?? [],
74079
+ roomData.members
74080
+ );
73777
74081
  this._persisted.rooms[roomData.roomId] = {
73778
74082
  roomId: roomData.roomId,
73779
74083
  name: roomData.name,
73780
74084
  conversationIds,
73781
- members: roomData.members,
74085
+ members: members2,
73782
74086
  ...existingMlsGroupId && { mlsGroupId: existingMlsGroupId },
73783
74087
  ...existingMlsTs && { lastMlsMessageTs: existingMlsTs }
73784
74088
  };
@@ -73991,15 +74295,27 @@ ${text}`;
73991
74295
  */
73992
74296
  async _quarantineOrphanedMlsGroups() {
73993
74297
  if (!this._deviceJwt) return;
74298
+ let deviceActive = null;
74299
+ const confirmDeviceActive = () => deviceActive ??= this._readDeviceStanding().then((st) => st.kind === "active");
73994
74300
  const quarantined = await quarantineOrphanedMlsState(
73995
74301
  this.config.dataDir,
73996
74302
  async (groupId) => {
73997
74303
  try {
74304
+ if (this._suspended) return null;
73998
74305
  const res = await fetch(
73999
74306
  `${this.config.apiUrl}/api/v1/mls/groups/${encodeURIComponent(groupId)}`,
74000
74307
  { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
74001
74308
  );
74002
- return mlsMembershipFromStatus(res.status);
74309
+ const detail = res.status === 403 ? await this._errorDetail(res) : null;
74310
+ if (detail === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
74311
+ await this._confirmInactive403("mls_probe");
74312
+ return null;
74313
+ }
74314
+ const verdict = mlsMembershipFromStatus(res.status, detail);
74315
+ if (verdict === false && res.status === 403) {
74316
+ if (!await confirmDeviceActive() || this._suspended) return null;
74317
+ }
74318
+ return verdict;
74003
74319
  } catch {
74004
74320
  return null;
74005
74321
  }
@@ -74271,7 +74587,8 @@ ${text}`;
74271
74587
  entityType: m2.entity_type,
74272
74588
  displayName: m2.display_name,
74273
74589
  identityPublicKey: m2.identity_public_key,
74274
- ephemeralPublicKey: m2.ephemeral_public_key
74590
+ ephemeralPublicKey: m2.ephemeral_public_key,
74591
+ ...typeof m2.tenant_id === "string" ? { tenantId: m2.tenant_id } : {}
74275
74592
  }));
74276
74593
  if (members2.length > 0) {
74277
74594
  const roomState = this._persisted.rooms[roomId];
@@ -75734,6 +76051,8 @@ ${text}`;
75734
76051
  async _connect() {
75735
76052
  if (this._stopped) return;
75736
76053
  this._reissueAttempted = false;
76054
+ this._inactive403Check = null;
76055
+ this._inactive403RetryAt = 0;
75737
76056
  this._authFailedThisSession = false;
75738
76057
  if (this._reconnectTimer) {
75739
76058
  clearTimeout(this._reconnectTimer);
@@ -75749,6 +76068,10 @@ ${text}`;
75749
76068
  }
75750
76069
  this._setState("connecting");
75751
76070
  if (await this._maybeReissueDeviceJwt()) {
76071
+ if (this._suspended) {
76072
+ console.log("[SecureChannel] device is paused \u2014 not connecting until it is resumed");
76073
+ return;
76074
+ }
75752
76075
  console.warn(
75753
76076
  "[SecureChannel] credentials are terminally dead \u2014 aborting connect (no WS attempt)"
75754
76077
  );
@@ -75759,16 +76082,26 @@ ${text}`;
75759
76082
  const url2 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(buildClientVersion(this.config.clientVersion))}`;
75760
76083
  const ws = new WebSocket(url2);
75761
76084
  this._ws = ws;
76085
+ const served = this._createServedGate();
75762
76086
  ws.on("open", async () => {
75763
76087
  try {
75764
- this._reconnectAttempt = 0;
75765
76088
  this._lastWsOpenTime = Date.now();
75766
76089
  this._startPing(ws);
75767
76090
  this._startWakeDetector();
76091
+ if (!await served.wait()) {
76092
+ console.log("[SecureChannel] connection rejected before it was served \u2014 skipping connect-time work");
76093
+ return;
76094
+ }
76095
+ const aborted2 = () => this._stopped || this._suspended || this._ws !== ws || served.rejected;
76096
+ if (aborted2()) return;
76097
+ this._reconnectAttempt = 0;
75768
76098
  this._startPendingPoll();
75769
76099
  await this._syncMissedMessages();
76100
+ if (aborted2()) return;
75770
76101
  await this._pullDrDeliveryQueue();
76102
+ if (aborted2()) return;
75771
76103
  await this._flushOutboundQueue();
76104
+ if (aborted2()) return;
75772
76105
  this._setState("ready");
75773
76106
  void this._reconcileConversationGroups().catch((err) => {
75774
76107
  console.warn("[SecureChannel] Conversation-group reconcile failed:", err);
@@ -75800,7 +76133,7 @@ ${text}`;
75800
76133
  agentVersion: this.config.agentVersion ?? "0.0.0",
75801
76134
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
75802
76135
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
75803
- pluginVersion: true ? "0.23.53" : "0.0.0-dev"
76136
+ pluginVersion: true ? "0.23.61" : "0.0.0-dev"
75804
76137
  });
75805
76138
  this._telemetryReporter.startAutoFlush(3e4);
75806
76139
  }
@@ -75808,6 +76141,7 @@ ${text}`;
75808
76141
  await this.listA2AChannels().catch((err) => {
75809
76142
  console.warn("[SecureChannel] A2A channel sync on connect failed:", err);
75810
76143
  });
76144
+ if (aborted2()) return;
75811
76145
  await this._ensureKpPoolPublished();
75812
76146
  this._startKpReplenishTimer();
75813
76147
  this._pullDeliveryQueue().catch((err) => {
@@ -75869,6 +76203,8 @@ ${text}`;
75869
76203
  this._lastWakeTick = Date.now();
75870
76204
  try {
75871
76205
  const data = JSON.parse(raw.toString());
76206
+ if (data?.event === "connection_rejected") served.markRejected();
76207
+ else served.markServed();
75872
76208
  if (data.event && data.event !== "ping" && data.event !== "typing") {
75873
76209
  const d2 = data.data ?? {};
75874
76210
  const conv = (data.conversation_id || d2.conversation_id || "").toString();
@@ -75953,7 +76289,8 @@ ${text}`;
75953
76289
  entityType: m2.entity_type,
75954
76290
  displayName: m2.display_name,
75955
76291
  identityPublicKey: m2.identity_public_key,
75956
- ephemeralPublicKey: m2.ephemeral_public_key
76292
+ ephemeralPublicKey: m2.ephemeral_public_key,
76293
+ ...typeof m2.tenant_id === "string" ? { tenantId: m2.tenant_id } : {}
75957
76294
  })),
75958
76295
  conversations: (d2.conversations || []).map((c2) => ({
75959
76296
  id: c2.id,
@@ -76128,7 +76465,7 @@ ${text}`;
76128
76465
  agentVersion: this.config.agentVersion ?? "0.0.0",
76129
76466
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
76130
76467
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
76131
- pluginVersion: true ? "0.23.53" : "0.0.0-dev"
76468
+ pluginVersion: true ? "0.23.61" : "0.0.0-dev"
76132
76469
  });
76133
76470
  this._telemetryReporter.startAutoFlush(3e4);
76134
76471
  }
@@ -76497,6 +76834,7 @@ ${text}`;
76497
76834
  });
76498
76835
  ws.on("close", (code) => {
76499
76836
  this._lastCloseCode = typeof code === "number" ? code : null;
76837
+ served.markRejected();
76500
76838
  this._stopPing();
76501
76839
  this._stopWakeDetector();
76502
76840
  this._stopPendingPoll();
@@ -76563,9 +76901,14 @@ ${text}`;
76563
76901
  if (groupId) void this._requestWelcomeSelfHeal(groupId);
76564
76902
  return;
76565
76903
  }
76904
+ if (this._alreadyDecrypted(data.message_id)) {
76905
+ console.debug(`[SecureChannel] MLS 1:1 frame ${String(data.message_id).slice(0, 8)} already read \u2014 replay skipped`);
76906
+ return;
76907
+ }
76566
76908
  try {
76567
76909
  const cipherBytes = new Uint8Array(Buffer.from(data.payload, "hex"));
76568
76910
  const result = await mgr.decrypt(cipherBytes);
76911
+ this._rememberDecrypted(data.message_id);
76569
76912
  if (mgrKey) this._mlsDecryptFailCounts.delete(mgrKey);
76570
76913
  const mlsGroupId = (convGroupId ? this._persisted?.mlsGroups?.[convGroupId]?.mlsGroupId : null) ?? this._persisted?.mlsConversations?.[convId]?.mlsGroupId ?? groupId;
76571
76914
  if (mlsGroupId) {
@@ -76984,13 +77327,13 @@ ${messageText}`;
76984
77327
  * Returns the text unchanged when there is no attachment or the fetch fails —
76985
77328
  * but a failure is LOGGED and announced in the text, never silent.
76986
77329
  */
76987
- async _augmentWithAttachment(attachmentInfo, baseText, roomId) {
77330
+ async _augmentWithAttachment(attachmentInfo, baseText, roomId, senderDeviceId) {
76988
77331
  if (!attachmentInfo) return baseText;
76989
77332
  try {
76990
77333
  const { filePath, decrypted } = await this._downloadAndDecryptAttachment(attachmentInfo);
76991
77334
  const mime = String(attachmentInfo.mime ?? "application/octet-stream");
76992
77335
  const name = String(attachmentInfo.filename ?? "attachment");
76993
- if (roomId) this._recentRoomAttachments.set(roomId, { filePath, name, at: Date.now() });
77336
+ if (roomId) this._recentRoomAttachments.set(roomId, { filePath, name, at: Date.now(), senderDeviceId });
76994
77337
  const textMimes = ["text/", "application/json", "application/xml", "application/csv"];
76995
77338
  if (textMimes.some((m2) => mime.startsWith(m2))) {
76996
77339
  const content = new TextDecoder().decode(decrypted);
@@ -77588,9 +77931,14 @@ ${baseText}`;
77588
77931
  }
77589
77932
  return;
77590
77933
  }
77934
+ if (this._alreadyDecrypted(data.message_id)) {
77935
+ console.debug(`[SecureChannel] MLS room frame ${String(data.message_id).slice(0, 8)} already read \u2014 replay skipped`);
77936
+ return;
77937
+ }
77591
77938
  try {
77592
77939
  const ciphertext = Buffer.from(data.payload, "hex");
77593
77940
  const result = await mlsGroup.decrypt(new Uint8Array(ciphertext));
77941
+ this._rememberDecrypted(data.message_id);
77594
77942
  this._mlsDecryptFailCounts.delete(resolvedRoomId);
77595
77943
  await saveMlsState(this.config.dataDir, groupId, JSON.stringify(mlsGroup.exportState()));
77596
77944
  if (result.isHandshake || !result.plaintext) {
@@ -77646,22 +77994,34 @@ ${baseText}`;
77646
77994
  }
77647
77995
  const caption = messageText;
77648
77996
  const addressed = parseMentions(messageText).length > 0;
77997
+ const foldedFrom = [];
77649
77998
  if (roomAttachment && !addressed) {
77650
- this._deferRoomAttachment(resolvedRoomId, roomAttachment);
77999
+ this._deferRoomAttachment(resolvedRoomId, roomAttachment, senderDeviceId);
77651
78000
  } else {
77652
78001
  const deferred = addressed ? this._takeDeferredRoomAttachments(resolvedRoomId) : [];
77653
- for (const info of deferred) {
77654
- messageText = await this._augmentWithAttachment(info, messageText, resolvedRoomId);
78002
+ for (const d2 of deferred) {
78003
+ messageText = await this._augmentWithAttachment(d2.info, messageText, resolvedRoomId, d2.senderDeviceId);
78004
+ foldedFrom.push(d2.senderDeviceId ?? null);
77655
78005
  }
77656
78006
  if (roomAttachment) {
77657
- messageText = await this._augmentWithAttachment(roomAttachment, messageText, resolvedRoomId);
78007
+ messageText = await this._augmentWithAttachment(roomAttachment, messageText, resolvedRoomId, senderDeviceId);
78008
+ foldedFrom.push(senderDeviceId ?? null);
77658
78009
  } else if (deferred.length === 0) {
77659
- messageText = this._withRecentRoomAttachmentNote(resolvedRoomId, messageText);
78010
+ const noted = this._withRecentRoomAttachmentNote(resolvedRoomId, messageText);
78011
+ messageText = noted.text;
78012
+ if (noted.from !== void 0) foldedFrom.push(noted.from);
77660
78013
  }
77661
78014
  }
77662
78015
  const roomMembers = this._persisted?.rooms?.[resolvedRoomId]?.members ?? [];
77663
78016
  const senderMember = roomMembers.find((m2) => m2.deviceId === senderDeviceId);
77664
78017
  const senderIsAgent = senderMember?.entityType === "agent" ? true : senderMember?.entityType === "owner" || senderMember?.entityType === "human" ? false : void 0;
78018
+ const ownTenantId = this._deviceJwt ? this._decodeTenantIdForRecovery(this._deviceJwt) : null;
78019
+ const isOwnerMember = (deviceId) => {
78020
+ const member = deviceId ? roomMembers.find((m2) => m2.deviceId === deviceId) : void 0;
78021
+ return (member?.entityType === "owner" || member?.entityType === "human") && ownTenantId !== null && typeof member?.tenantId === "string" && member.tenantId.toLowerCase() === ownTenantId;
78022
+ };
78023
+ const senderIsOwner = senderIsAgent === false && isOwnerMember(senderDeviceId);
78024
+ const foreignContent = foldedFrom.some((from) => !isOwnerMember(from));
77665
78025
  const metadata = {
77666
78026
  messageId: data.message_id ?? "",
77667
78027
  conversationId: "",
@@ -77670,6 +78030,8 @@ ${baseText}`;
77670
78030
  roomId: resolvedRoomId,
77671
78031
  senderDeviceId,
77672
78032
  senderIsAgent,
78033
+ senderIsOwner,
78034
+ foreignContent,
77673
78035
  senderName: senderMember?.displayName || "unknown",
77674
78036
  roomName: this._persisted?.rooms?.[resolvedRoomId]?.name,
77675
78037
  caption
@@ -77695,7 +78057,10 @@ ${baseText}`;
77695
78057
  timestamp: data.created_at ?? (/* @__PURE__ */ new Date()).toISOString(),
77696
78058
  // Bridges require an explicit human classification for room tools.
77697
78059
  // Reply policy separately uses this field for agent-loop prevention.
77698
- senderIsAgent
78060
+ senderIsAgent,
78061
+ // #1459 — owner-only power keys on these, never on senderIsAgent.
78062
+ senderIsOwner,
78063
+ foreignContent
77699
78064
  });
77700
78065
  const contextualMessage = senderIsAgent ? messageText : `[${senderLabel}]: ${messageText}`;
77701
78066
  Promise.resolve(this.config.onMessage?.(contextualMessage, metadata)).catch((err) => {
@@ -78751,16 +79116,57 @@ ${baseText}`;
78751
79116
  }
78752
79117
  return await mlsGroup.encrypt(plaintextBytes);
78753
79118
  }
79119
+ /** #1518: is the server answering at all? Bounded; any failure is "no". */
79120
+ async _serverReachable() {
79121
+ try {
79122
+ const res = await fetch(`${this.config.apiUrl}/health`, { signal: AbortSignal.timeout(5e3) });
79123
+ return res.ok;
79124
+ } catch {
79125
+ return false;
79126
+ }
79127
+ }
79128
+ /** #1518: the server is down — don't re-key (that needs the same server).
79129
+ * Clear the run so the next failures ask again. Reported as handled. */
79130
+ _deferResync(groupKey, groupId, why) {
79131
+ this._mlsDecryptFailCounts.delete(groupKey);
79132
+ console.warn(
79133
+ `[SecureChannel] Resync for ${groupId.slice(0, 8)}: server unreachable (${why}) \u2014 NOT re-keying; will retry (#1518)`
79134
+ );
79135
+ return true;
79136
+ }
79137
+ /** #1518: has this process already decrypted the frame with this id? */
79138
+ _alreadyDecrypted(messageId) {
79139
+ return typeof messageId === "string" && messageId !== "" && this._decryptedMessageIds.has(messageId);
79140
+ }
79141
+ /** #1518: remember a decrypted frame's id (bounded; oldest dropped). */
79142
+ _rememberDecrypted(messageId) {
79143
+ if (typeof messageId !== "string" || messageId === "") return;
79144
+ this._decryptedMessageIds.set(messageId, true);
79145
+ if (this._decryptedMessageIds.size > _SecureChannel.DECRYPTED_ID_CAP) {
79146
+ const oldest = this._decryptedMessageIds.keys().next().value;
79147
+ if (oldest !== void 0) this._decryptedMessageIds.delete(oldest);
79148
+ }
79149
+ }
78754
79150
  async _resyncOnDivergence(groupKey, groupId) {
78755
79151
  const mgr = this._mlsGroups.get(groupKey);
78756
79152
  if (!mgr?.isInitialized) return false;
78757
79153
  const fromEpoch = Number(mgr.epoch);
78758
79154
  try {
78759
- const res = await fetch(
78760
- `${this.config.apiUrl}/api/v1/mls/groups/${groupId}/sync?last_epoch=${fromEpoch}`,
78761
- { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
78762
- );
79155
+ let res;
79156
+ try {
79157
+ res = await fetch(
79158
+ `${this.config.apiUrl}/api/v1/mls/groups/${groupId}/sync?last_epoch=${fromEpoch}`,
79159
+ { headers: { Authorization: `Bearer ${this._deviceJwt}` } }
79160
+ );
79161
+ } catch (netErr) {
79162
+ if (!await this._serverReachable()) return this._deferResync(groupKey, groupId, String(netErr));
79163
+ console.warn(`[SecureChannel] Resync-on-divergence failed for ${groupId.slice(0, 8)}:`, netErr);
79164
+ return false;
79165
+ }
78763
79166
  if (!res.ok) {
79167
+ if ((res.status >= 500 || res.status === 429) && !await this._serverReachable()) {
79168
+ return this._deferResync(groupKey, groupId, `HTTP ${res.status}`);
79169
+ }
78764
79170
  console.warn(`[SecureChannel] Resync /sync failed for ${groupId.slice(0, 8)}: ${res.status}`);
78765
79171
  return false;
78766
79172
  }
@@ -79875,9 +80281,14 @@ ${baseText}`;
79875
80281
  console.warn(`[SecureChannel] MLS group not loaded for A2A ${a2aChannelId.slice(0, 8)}`);
79876
80282
  return;
79877
80283
  }
80284
+ if (this._alreadyDecrypted(data.message_id)) {
80285
+ console.debug(`[SecureChannel] MLS A2A frame ${String(data.message_id).slice(0, 8)} already read \u2014 replay skipped`);
80286
+ return;
80287
+ }
79878
80288
  try {
79879
80289
  const ciphertext = new Uint8Array(Buffer.from(data.payload, "hex"));
79880
80290
  const result = await mlsGroup.decrypt(ciphertext);
80291
+ this._rememberDecrypted(data.message_id);
79881
80292
  this._mlsDecryptFailCounts.delete(`a2a:${a2aChannelId}`);
79882
80293
  await saveMlsState(this.config.dataDir, groupId, JSON.stringify(mlsGroup.exportState()));
79883
80294
  if (result.isHandshake || !result.plaintext) {
@@ -80586,7 +80997,7 @@ ${baseText}`;
80586
80997
  );
80587
80998
  this._authFailedThisSession = true;
80588
80999
  this._setState("error");
80589
- this.emit("auth_failed", { reason: "ws_auth_rejected" });
81000
+ this.emit("auth_failed", { reason: "ws_auth_rejected", deviceGone: false });
80590
81001
  return;
80591
81002
  }
80592
81003
  if (lastCode === 4e3) {
@@ -80625,7 +81036,7 @@ ${baseText}`;
80625
81036
  this._state = newState;
80626
81037
  this.emit("state", newState);
80627
81038
  this.config.onStateChange?.(newState);
80628
- if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt) {
81039
+ if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt && !this._suspended) {
80629
81040
  this._startPollFallback();
80630
81041
  }
80631
81042
  if (newState === "ready" || newState === "error" || this._stopped) {
@@ -80762,8 +81173,10 @@ ${baseText}`;
80762
81173
  * blindly. We ask the PUBLIC /devices/{id}/status endpoint (no JWT needed, so
80763
81174
  * it answers even when our device JWT is being rejected):
80764
81175
  * - ACTIVE -> reconnect in place (transient); stay online.
80765
- * - non-ACTIVE -> terminal (genuinely revoked; operator must re-enroll).
80766
- * - unreachable/429 -> reconnect (inconclusive; a network blip shouldn't
81176
+ * - SUSPENDED -> suspended-wait (owner paused it; resume later).
81177
+ * - REVOKED/deleted -> terminal via `_terminalDeviceGone` (auth_failed with
81178
+ * deviceGone: the bridges exit and remove their service).
81179
+ * - anything else / unreachable / 429 -> reconnect (inconclusive; a network blip shouldn't
80767
81180
  * permanently kill a healthy agent — the WS is down too,
80768
81181
  * so normal backoff handles it, and the war cap bounds
80769
81182
  * thrash if the device really is dead).
@@ -80803,10 +81216,58 @@ ${baseText}`;
80803
81216
  }
80804
81217
  this._authFailedThisSession = true;
80805
81218
  const authReason = data?.reason ?? "unknown";
81219
+ const standing = await this._readDeviceStanding();
81220
+ if (standing.kind === "suspended") {
81221
+ this._authFailedThisSession = false;
81222
+ this._enterSuspendedWait("connection_rejected");
81223
+ return;
81224
+ }
81225
+ const deviceGone = standing.kind === "gone";
80806
81226
  console.warn(
80807
- `[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed`
81227
+ `[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed (deviceGone=${deviceGone})`
80808
81228
  );
80809
- this.emit("auth_failed", { reason: authReason });
81229
+ this.emit("auth_failed", { reason: authReason, deviceGone });
81230
+ }
81231
+ /**
81232
+ * How long an opened socket may stay silent before we treat it as served.
81233
+ * The backend's reject_connection sends `connection_rejected` immediately
81234
+ * after the accept, so a refused socket's first frame lands well inside
81235
+ * this; a served agent with a hub gets `hub_identity_sync` sooner still.
81236
+ */
81237
+ static OPEN_SETTLE_MS = 1500;
81238
+ /**
81239
+ * Per-socket "has the server agreed to serve this session?" latch. Settles
81240
+ * once: served on the first non-rejection frame or when the settle window
81241
+ * passes quietly; rejected on `connection_rejected` or a close first.
81242
+ * `rejected` stays readable afterwards so long open-handler work can bail.
81243
+ */
81244
+ _createServedGate() {
81245
+ let verdict = null;
81246
+ let rejected = false;
81247
+ let timer = null;
81248
+ const waiters = [];
81249
+ const settle2 = (ok) => {
81250
+ if (!ok) rejected = true;
81251
+ if (verdict !== null) return;
81252
+ verdict = ok;
81253
+ if (timer) {
81254
+ clearTimeout(timer);
81255
+ timer = null;
81256
+ }
81257
+ for (const w2 of waiters.splice(0)) w2(ok);
81258
+ };
81259
+ return {
81260
+ wait: () => {
81261
+ if (verdict !== null) return Promise.resolve(verdict && !rejected);
81262
+ if (!timer) timer = setTimeout(() => settle2(true), _SecureChannel.OPEN_SETTLE_MS);
81263
+ return new Promise((resolve4) => waiters.push(resolve4));
81264
+ },
81265
+ markServed: () => settle2(true),
81266
+ markRejected: () => settle2(false),
81267
+ get rejected() {
81268
+ return rejected;
81269
+ }
81270
+ };
80810
81271
  }
80811
81272
  // --- Owner pause (device SUSPENDED) — NON-final ---------------------------
80812
81273
  //
@@ -80831,6 +81292,7 @@ ${baseText}`;
80831
81292
  this._reconnectTimer = null;
80832
81293
  }
80833
81294
  this._rapidDisconnects = 0;
81295
+ this._stopPollFallback();
80834
81296
  if (!this._suspended) {
80835
81297
  this._suspended = true;
80836
81298
  console.log(
@@ -80857,30 +81319,40 @@ ${baseText}`;
80857
81319
  }
80858
81320
  async _pollWhileSuspended() {
80859
81321
  if (this._stopped || !this._suspended) return;
80860
- const deviceId = this._deviceId ?? this._persisted?.deviceId;
80861
- if (deviceId) {
80862
- try {
80863
- const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
80864
- if (this._stopped || !this._suspended) return;
80865
- if (!st.rateLimited && (st.status === "ACTIVE" || st.status === "APPROVED")) {
80866
- this._clearSuspendedWait();
80867
- this._reconnectAttempt = 0;
80868
- console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
80869
- this.emit("resumed");
80870
- this._connect();
80871
- return;
80872
- }
80873
- if (!st.rateLimited && st.status === "REVOKED") {
80874
- this._clearSuspendedWait();
80875
- this._handleError(new Error("Device was revoked"));
80876
- return;
80877
- }
80878
- } catch (err) {
80879
- console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
80880
- }
81322
+ const standing = await this._readDeviceStanding();
81323
+ if (this._stopped || !this._suspended) return;
81324
+ if (standing.kind === "active") {
81325
+ this._clearSuspendedWait();
81326
+ this._reconnectAttempt = 0;
81327
+ console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
81328
+ this.emit("resumed");
81329
+ this._connect();
81330
+ return;
81331
+ }
81332
+ if (standing.kind === "gone") {
81333
+ await this._terminalDeviceGone(standing.reason, "suspended_wait");
81334
+ return;
81335
+ }
81336
+ if (standing.kind === "unknown") {
81337
+ console.warn(`[SecureChannel] status check while paused inconclusive (${standing.why}); still waiting`);
80881
81338
  }
80882
81339
  this._scheduleSuspendedPoll();
80883
81340
  }
81341
+ /**
81342
+ * The device is CONFIRMED gone (status endpoint: REVOKED, or the row is
81343
+ * deleted). Stop for good through the documented terminal surface:
81344
+ * re_enroll report, `auth_failed{deviceGone:true}` (bridges exit and remove
81345
+ * their service), then the legacy `error("Device was revoked")` the OpenClaw
81346
+ * lifecycle and older listeners key on.
81347
+ */
81348
+ async _terminalDeviceGone(reason, source) {
81349
+ this._clearSuspendedWait();
81350
+ this._authFailedThisSession = true;
81351
+ console.warn(`[SecureChannel] ${source}: device confirmed gone (${reason}) \u2014 terminal`);
81352
+ await this._postAuthFailedToBackend(reason);
81353
+ this.emit("auth_failed", { reason, deviceGone: true });
81354
+ this._handleError(new Error("Device was revoked"));
81355
+ }
80884
81356
  async _handleDeviceRevoked() {
80885
81357
  const now = Date.now();
80886
81358
  this._revokeRecoveries = this._revokeRecoveries.filter(
@@ -80898,35 +81370,25 @@ ${baseText}`;
80898
81370
  this._handleError(new Error("Device was revoked"));
80899
81371
  return;
80900
81372
  }
80901
- let reconnect;
80902
- try {
80903
- const status = await pollDeviceStatus(this.config.apiUrl, deviceId);
80904
- if (status.status === "SUSPENDED") {
80905
- this._enterSuspendedWait("device_revoked");
80906
- return;
80907
- }
80908
- reconnect = status.rateLimited === true || status.status === "ACTIVE";
80909
- if (!reconnect) {
80910
- console.warn(
80911
- `[SecureChannel] device_revoked confirmed by server (status=${status.status}) \u2014 terminal`
80912
- );
80913
- }
80914
- } catch (err) {
80915
- console.warn(
80916
- "[SecureChannel] device_revoked status check failed; reconnecting (inconclusive):",
80917
- err
80918
- );
80919
- reconnect = true;
81373
+ const standing = await this._readDeviceStanding();
81374
+ if (standing.kind === "suspended") {
81375
+ this._enterSuspendedWait("device_revoked");
81376
+ return;
80920
81377
  }
80921
- if (reconnect) {
80922
- this._revokeRecoveries.push(now);
80923
- console.log(
80924
- "[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
80925
- );
80926
- this._scheduleReconnect();
81378
+ if (standing.kind === "gone") {
81379
+ await this._terminalDeviceGone(standing.reason, "device_revoked");
80927
81380
  return;
80928
81381
  }
80929
- this._handleError(new Error("Device was revoked"));
81382
+ if (standing.kind === "unknown") {
81383
+ console.warn(
81384
+ `[SecureChannel] device_revoked status check inconclusive (${standing.why}); reconnecting`
81385
+ );
81386
+ }
81387
+ this._revokeRecoveries.push(now);
81388
+ console.log(
81389
+ "[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
81390
+ );
81391
+ this._scheduleReconnect();
80930
81392
  }
80931
81393
  /**
80932
81394
  * Persist all ratchet session states to disk.
@@ -80990,7 +81452,8 @@ ${baseText}`;
80990
81452
  aliases: ["av", "agent-vault"]
80991
81453
  },
80992
81454
  capabilities: {
80993
- chatTypes: ["direct", "room"]
81455
+ chatTypes: ["direct", "group"]
81456
+ // #1474: a room is OpenClaw's "group"
80994
81457
  },
80995
81458
  config: {
80996
81459
  listAccountIds,
@@ -81726,7 +82189,7 @@ ${actionsText}`);
81726
82189
  "use strict";
81727
82190
  init_llm_response_parser();
81728
82191
  init_llm_cost();
81729
- traceStore = new AsyncLocalStorage2();
82192
+ traceStore = new AsyncLocalStorage3();
81730
82193
  }
81731
82194
  });
81732
82195
  init_tool_audit = __esm2({
@@ -81749,6 +82212,7 @@ ${actionsText}`);
81749
82212
  init_openclaw_compat();
81750
82213
  init_lifecycle();
81751
82214
  init_tool_audit();
82215
+ init_tool_telemetry();
81752
82216
  init_harness_compat();
81753
82217
  init_types();
81754
82218
  managedRoutesRequested = false;
@@ -102474,7 +102938,8 @@ data:
102474
102938
  await init_skill_telemetry();
102475
102939
  await init_policy_enforcer();
102476
102940
  init_room_protocol();
102477
- VERSION = true ? "0.23.53" : "0.0.0-dev";
102941
+ init_tool_telemetry();
102942
+ VERSION = true ? "0.23.61" : "0.0.0-dev";
102478
102943
  }
102479
102944
  });
102480
102945
  await init_index();
@@ -103126,7 +103591,7 @@ var init_cli = __esm({
103126
103591
  "use strict";
103127
103592
  await init_dist();
103128
103593
  init_driver();
103129
- VERSION2 = "0.1.8";
103594
+ VERSION2 = "0.1.10";
103130
103595
  HELP = `AgentVault OpenAI Bridge ${VERSION2}
103131
103596
  Usage: AV_AGENT_NAME=<name> agentvault-openai-bridge <command>
103132
103597
 
@@ -103294,7 +103759,39 @@ ${text}`, controller.signal);
103294
103759
  } catch {
103295
103760
  }
103296
103761
  }
103762
+ /** "Recent problems" (2026-10-26): every reply delivery is one
103763
+ * `ai.agent.tool.invoke` span (tool `reply` — this bridge has no say tool;
103764
+ * the model's text IS the post). Outcome, machine error code, duration and
103765
+ * the conversation only — never the text or an error message. Never throws. */
103766
+ reportReply(target, startedAt, failure2) {
103767
+ try {
103768
+ const sink = this.channel.telemetry;
103769
+ const kind = failure2 ? classifyToolError(failure2.err) : void 0;
103770
+ const outcome = !failure2 ? "success" : kind === "delivery_cancelled" ? "cancelled" : "error";
103771
+ reportToolInvoke(sink && typeof sink.reportCustomSpan === "function" ? sink : null, {
103772
+ toolName: "reply",
103773
+ outcome,
103774
+ errorKind: outcome === "error" ? kind : void 0,
103775
+ durationMs: Date.now() - startedAt,
103776
+ conversation: { kind: target.kind === "room" ? "room" : "direct", id: target.id }
103777
+ });
103778
+ } catch {
103779
+ }
103780
+ }
103297
103781
  async deliver(target, text, signal) {
103782
+ const startedAt = Date.now();
103783
+ let cause;
103784
+ try {
103785
+ await this.deliverOnce(target, text, signal, (e) => {
103786
+ cause = e;
103787
+ });
103788
+ } catch (err) {
103789
+ this.reportReply(target, startedAt, { err: cause ?? err });
103790
+ throw err;
103791
+ }
103792
+ this.reportReply(target, startedAt);
103793
+ }
103794
+ async deliverOnce(target, text, signal, onSendError) {
103298
103795
  const delivery = target.kind === "room" ? this.channel.sendToRoom(target.id, text) : this.channel.send(text, { conversationId: target.id });
103299
103796
  await new Promise((resolve4, reject) => {
103300
103797
  let settled = false;
@@ -103308,15 +103805,18 @@ ${text}`, controller.signal);
103308
103805
  };
103309
103806
  const abort = () => finish(new Error("Delivery cancelled"));
103310
103807
  const timer = setTimeout(() => {
103808
+ finish(new Error("Delivery timed out"));
103311
103809
  this.stopped = true;
103312
103810
  this.invalidate();
103313
103811
  this.report("delivery_timeout");
103314
- finish(new Error("Delivery timed out"));
103315
103812
  }, this.deliveryTimeoutMs);
103316
103813
  signal.addEventListener("abort", abort, { once: true });
103317
103814
  if (signal.aborted)
103318
103815
  abort();
103319
- delivery.then(() => finish(), () => finish(new Error("Delivery failed")));
103816
+ delivery.then(() => finish(), (e) => {
103817
+ onSendError(e);
103818
+ finish(new Error("Delivery failed"));
103819
+ });
103320
103820
  });
103321
103821
  }
103322
103822
  async idle() {