@agentvault/openai-bridge 0.1.7 → 0.1.9
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/bridge.d.ts +9 -2
- package/dist/cli.d.ts +1 -1
- package/dist/index.js +794 -107
- package/package.json +1 -1
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,
|
|
@@ -54,9 +59,12 @@ __export(dist_exports, {
|
|
|
54
59
|
parseTarget: () => parseTarget,
|
|
55
60
|
readMaskedHistoryRecoveryCode: () => readMaskedHistoryRecoveryCode,
|
|
56
61
|
reportSkillInvocation: () => reportSkillInvocation,
|
|
62
|
+
reportToolInvoke: () => reportToolInvoke,
|
|
57
63
|
requestHeartbeatNow: () => requestHeartbeatNow,
|
|
58
64
|
resolveAccount: () => resolveAccount,
|
|
59
65
|
runHistoryRecoveryCommand: () => runHistoryRecoveryCommand,
|
|
66
|
+
runWithToolConversation: () => runWithToolConversation,
|
|
67
|
+
safeErrorKind: () => safeErrorKind,
|
|
60
68
|
sendDecisionToOwner: () => sendDecisionToOwner,
|
|
61
69
|
sendToOwner: () => sendToOwner,
|
|
62
70
|
sendToRoom: () => sendToRoom,
|
|
@@ -89,12 +97,14 @@ import { homedir } from "node:os";
|
|
|
89
97
|
import { dirname, join as join4, resolve } from "node:path";
|
|
90
98
|
import { Writable } from "node:stream";
|
|
91
99
|
import { createInterface } from "node:readline";
|
|
100
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
101
|
+
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
92
102
|
import { Readable } from "node:stream";
|
|
93
103
|
import { readdir as readdir2, readFile as readFile4, writeFile as writeFile2, rename as rename4, stat, unlink, mkdir as mkdir3 } from "node:fs/promises";
|
|
94
104
|
import { join as join5 } from "node:path";
|
|
95
105
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
96
106
|
import { EventEmitter } from "node:events";
|
|
97
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
107
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
98
108
|
import { createServer } from "node:http";
|
|
99
109
|
import { randomUUID as randomUUID4, createHash } from "node:crypto";
|
|
100
110
|
import { readFileSync } from "node:fs";
|
|
@@ -104,7 +114,7 @@ import { join as join6 } from "node:path";
|
|
|
104
114
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
105
115
|
import WebSocket from "ws";
|
|
106
116
|
import { resolve as resolve2 } from "node:path";
|
|
107
|
-
import { AsyncLocalStorage as
|
|
117
|
+
import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
|
|
108
118
|
import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
|
|
109
119
|
import { Http2ServerRequest } from "http2";
|
|
110
120
|
import { Readable as Readable2 } from "stream";
|
|
@@ -9294,7 +9304,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
|
9294
9304
|
});
|
|
9295
9305
|
const { prehash } = eddsaOpts;
|
|
9296
9306
|
const { BASE, Fp: Fp3, Fn: Fn3 } = Point;
|
|
9297
|
-
const
|
|
9307
|
+
const randomBytes4 = eddsaOpts.randomBytes || randomBytes2;
|
|
9298
9308
|
const adjustScalarBytes3 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes);
|
|
9299
9309
|
const domain = eddsaOpts.domain || ((data, ctx, phflag) => {
|
|
9300
9310
|
_abool2(phflag, "phflag");
|
|
@@ -9376,7 +9386,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
|
9376
9386
|
signature: 2 * _size2,
|
|
9377
9387
|
seed: _size2
|
|
9378
9388
|
};
|
|
9379
|
-
function randomSecretKey(seed =
|
|
9389
|
+
function randomSecretKey(seed = randomBytes4(lengths.seed)) {
|
|
9380
9390
|
return _abytes2(seed, lengths.seed, "seed");
|
|
9381
9391
|
}
|
|
9382
9392
|
function keygen(seed) {
|
|
@@ -10755,7 +10765,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
|
|
|
10755
10765
|
bits2int: "function",
|
|
10756
10766
|
bits2int_modN: "function"
|
|
10757
10767
|
});
|
|
10758
|
-
const
|
|
10768
|
+
const randomBytes4 = ecdsaOpts.randomBytes || randomBytes2;
|
|
10759
10769
|
const hmac4 = ecdsaOpts.hmac || ((key, ...msgs) => hmac2(hash, key, concatBytes2(...msgs)));
|
|
10760
10770
|
const { Fp: Fp3, Fn: Fn3 } = Point;
|
|
10761
10771
|
const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn3;
|
|
@@ -10910,7 +10920,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
|
|
|
10910
10920
|
const d2 = _normFnElement(Fn3, privateKey);
|
|
10911
10921
|
const seedArgs = [int2octets(d2), int2octets(h1int)];
|
|
10912
10922
|
if (extraEntropy != null && extraEntropy !== false) {
|
|
10913
|
-
const e = extraEntropy === true ?
|
|
10923
|
+
const e = extraEntropy === true ? randomBytes4(lengths.secretKey) : extraEntropy;
|
|
10914
10924
|
seedArgs.push(ensureBytes("extraEntropy", e));
|
|
10915
10925
|
}
|
|
10916
10926
|
const seed = concatBytes2(...seedArgs);
|
|
@@ -11788,11 +11798,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11788
11798
|
return null;
|
|
11789
11799
|
}
|
|
11790
11800
|
function ownIdentity() {
|
|
11791
|
-
const v2 = true ? "0.23.
|
|
11801
|
+
const v2 = true ? "0.23.54" : FALLBACK;
|
|
11792
11802
|
return `${PACKAGE}@${v2}`;
|
|
11793
11803
|
}
|
|
11794
11804
|
function buildSha() {
|
|
11795
|
-
const raw = true ? "
|
|
11805
|
+
const raw = true ? "429977f" : "";
|
|
11796
11806
|
const cleaned = (raw ?? "").trim();
|
|
11797
11807
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
11798
11808
|
}
|
|
@@ -11944,13 +11954,18 @@ async function enrollDevice(apiUrl, inviteToken, identityPkHex, ephemeralPkHex,
|
|
|
11944
11954
|
return res.json();
|
|
11945
11955
|
}
|
|
11946
11956
|
async function pollDeviceStatus(apiUrl, deviceId) {
|
|
11947
|
-
const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status
|
|
11957
|
+
const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status`, {
|
|
11958
|
+
signal: AbortSignal.timeout(1e4)
|
|
11959
|
+
});
|
|
11948
11960
|
if (res.status === 429) {
|
|
11949
11961
|
return { device_id: deviceId, status: "PENDING", fingerprint: "", rateLimited: true };
|
|
11950
11962
|
}
|
|
11951
11963
|
if (!res.ok) {
|
|
11952
11964
|
const detail = await res.text();
|
|
11953
|
-
|
|
11965
|
+
const err = new Error(`Status poll failed (${res.status}): ${detail}`);
|
|
11966
|
+
err.httpStatus = res.status;
|
|
11967
|
+
err.body = detail;
|
|
11968
|
+
throw err;
|
|
11954
11969
|
}
|
|
11955
11970
|
return res.json();
|
|
11956
11971
|
}
|
|
@@ -12000,9 +12015,10 @@ function a2aChannelSignature(channels) {
|
|
|
12000
12015
|
})).sort((a2, b2) => (a2.id ?? "").localeCompare(b2.id ?? ""))
|
|
12001
12016
|
);
|
|
12002
12017
|
}
|
|
12003
|
-
function mlsMembershipFromStatus(status) {
|
|
12018
|
+
function mlsMembershipFromStatus(status, detail) {
|
|
12004
12019
|
if (status === 200) return true;
|
|
12005
|
-
if (status ===
|
|
12020
|
+
if (status === 404) return false;
|
|
12021
|
+
if (status === 403 && detail === NOT_A_MEMBER_DETAIL) return false;
|
|
12006
12022
|
return null;
|
|
12007
12023
|
}
|
|
12008
12024
|
function sanitizeError(error2) {
|
|
@@ -12596,6 +12612,102 @@ function _resetCompatCacheForTest() {
|
|
|
12596
12612
|
_agentEventFn = null;
|
|
12597
12613
|
_transcriptFn = null;
|
|
12598
12614
|
}
|
|
12615
|
+
function safeErrorKind(value) {
|
|
12616
|
+
if (typeof value !== "string") return UNCLASSIFIED_ERROR;
|
|
12617
|
+
if (KNOWN_CODES.has(value)) return value;
|
|
12618
|
+
if (!CLASS_NAME_RE.test(value)) return UNCLASSIFIED_ERROR;
|
|
12619
|
+
if ((value.match(/[0-9]/g) ?? []).length > 3) return UNCLASSIFIED_ERROR;
|
|
12620
|
+
return value;
|
|
12621
|
+
}
|
|
12622
|
+
function codeForText(text) {
|
|
12623
|
+
const t2 = text.replace(/^[A-Za-z]*Error: /, "");
|
|
12624
|
+
for (const [re2, code] of ERROR_TEXT_CODES) if (re2.test(t2)) return code;
|
|
12625
|
+
return void 0;
|
|
12626
|
+
}
|
|
12627
|
+
function classifyToolError(err) {
|
|
12628
|
+
try {
|
|
12629
|
+
if (err instanceof Error) {
|
|
12630
|
+
return codeForText(err.message) ?? safeErrorKind(err.constructor?.name);
|
|
12631
|
+
}
|
|
12632
|
+
if (typeof err === "string") return codeForText(err) ?? UNCLASSIFIED_ERROR;
|
|
12633
|
+
} catch {
|
|
12634
|
+
}
|
|
12635
|
+
return UNCLASSIFIED_ERROR;
|
|
12636
|
+
}
|
|
12637
|
+
function classifyDeliveryReceipt(receipt) {
|
|
12638
|
+
if (!receipt) return "no_receipt";
|
|
12639
|
+
if (receipt.ambiguous) return "ambiguous_target";
|
|
12640
|
+
if (typeof receipt.error === "string") return codeForText(receipt.error) ?? "delivery_failed";
|
|
12641
|
+
return "delivery_failed";
|
|
12642
|
+
}
|
|
12643
|
+
async function runWithToolConversation(conversation, fn) {
|
|
12644
|
+
const store = {
|
|
12645
|
+
conversation: conversation.kind === "unknown" || !conversation.id ? { kind: "unknown" } : { kind: conversation.kind, id: conversation.id },
|
|
12646
|
+
ended: false
|
|
12647
|
+
};
|
|
12648
|
+
try {
|
|
12649
|
+
return await _conversation.run(store, fn);
|
|
12650
|
+
} finally {
|
|
12651
|
+
store.ended = true;
|
|
12652
|
+
}
|
|
12653
|
+
}
|
|
12654
|
+
function currentToolConversation() {
|
|
12655
|
+
const store = _conversation.getStore();
|
|
12656
|
+
if (!store || store.ended) return { kind: "unknown" };
|
|
12657
|
+
return store.conversation;
|
|
12658
|
+
}
|
|
12659
|
+
function conversationForTarget(target, opts = {}) {
|
|
12660
|
+
if (typeof opts.conversationId === "string" && opts.conversationId) {
|
|
12661
|
+
return { kind: "direct", id: opts.conversationId };
|
|
12662
|
+
}
|
|
12663
|
+
const turn = currentToolConversation();
|
|
12664
|
+
if (!target || target.kind === "context") return turn;
|
|
12665
|
+
switch (target.kind) {
|
|
12666
|
+
case "room":
|
|
12667
|
+
return target.roomId ? { kind: "room", id: target.roomId } : { kind: "unknown" };
|
|
12668
|
+
case "owner":
|
|
12669
|
+
return turn.kind === "direct" ? turn : { kind: "unknown" };
|
|
12670
|
+
default:
|
|
12671
|
+
return { kind: "unknown" };
|
|
12672
|
+
}
|
|
12673
|
+
}
|
|
12674
|
+
function buildToolInvokeSpan(report) {
|
|
12675
|
+
const isError = report.outcome === "error";
|
|
12676
|
+
const outcome = isError ? "error" : report.outcome === "cancelled" ? "cancelled" : "success";
|
|
12677
|
+
const durationMs = Math.max(0, Math.round(Number(report.durationMs) || 0));
|
|
12678
|
+
const endTime = report.endTime ?? Date.now();
|
|
12679
|
+
const conv = report.conversation ?? currentToolConversation();
|
|
12680
|
+
const kind = conv.kind === "room" || conv.kind === "direct" ? conv.kind : "unknown";
|
|
12681
|
+
const attributes = {
|
|
12682
|
+
"tool.name": TOOL_NAME_RE.test(report.toolName) ? report.toolName : "unknown",
|
|
12683
|
+
"tool.outcome": outcome,
|
|
12684
|
+
"av.conversation_kind": kind,
|
|
12685
|
+
"tool.duration_ms": durationMs
|
|
12686
|
+
};
|
|
12687
|
+
if (isError) attributes["tool.error_kind"] = safeErrorKind(report.errorKind);
|
|
12688
|
+
if (kind !== "unknown" && typeof conv.id === "string" && conv.id) {
|
|
12689
|
+
attributes["av.conversation_id"] = conv.id.slice(0, 64);
|
|
12690
|
+
}
|
|
12691
|
+
return {
|
|
12692
|
+
traceId: randomBytes3(16).toString("hex"),
|
|
12693
|
+
spanId: randomBytes3(8).toString("hex"),
|
|
12694
|
+
name: TOOL_INVOKE_SPAN_NAME,
|
|
12695
|
+
kind: "internal",
|
|
12696
|
+
startTime: endTime - durationMs,
|
|
12697
|
+
endTime,
|
|
12698
|
+
attributes,
|
|
12699
|
+
// OTLP codes: 1 = ok, 2 = error (the backend stores "ok" / "error").
|
|
12700
|
+
// A cancellation is not a problem: OK status, outcome "cancelled".
|
|
12701
|
+
status: { code: isError ? 2 : 1 }
|
|
12702
|
+
};
|
|
12703
|
+
}
|
|
12704
|
+
function reportToolInvoke(sink, report) {
|
|
12705
|
+
try {
|
|
12706
|
+
if (!sink || typeof sink.reportCustomSpan !== "function") return;
|
|
12707
|
+
sink.reportCustomSpan(buildToolInvokeSpan(report));
|
|
12708
|
+
} catch {
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12599
12711
|
function ownerRoutingFrom(parsed) {
|
|
12600
12712
|
const out = {};
|
|
12601
12713
|
if (parsed.conversation_id !== void 0) {
|
|
@@ -12620,6 +12732,34 @@ function statusOf(receipt) {
|
|
|
12620
12732
|
return receipt.ok ? 200 : 500;
|
|
12621
12733
|
}
|
|
12622
12734
|
async function handleSendRequest(parsed, channel) {
|
|
12735
|
+
const startedAt = Date.now();
|
|
12736
|
+
const result = await _handleSendRequest(parsed, channel);
|
|
12737
|
+
try {
|
|
12738
|
+
const body = result.body;
|
|
12739
|
+
const failed = body?.ok !== true;
|
|
12740
|
+
reportToolInvoke(channel.telemetry, {
|
|
12741
|
+
toolName: "agentvault_send",
|
|
12742
|
+
outcome: failed ? "error" : "success",
|
|
12743
|
+
errorKind: !failed ? void 0 : result.status === 400 ? "invalid_request" : result.status === 409 ? "ambiguous_target" : classifyDeliveryReceipt(body),
|
|
12744
|
+
durationMs: Date.now() - startedAt,
|
|
12745
|
+
conversation: sendConversation(parsed)
|
|
12746
|
+
});
|
|
12747
|
+
} catch {
|
|
12748
|
+
}
|
|
12749
|
+
return result;
|
|
12750
|
+
}
|
|
12751
|
+
function sendConversation(parsed) {
|
|
12752
|
+
const str = (v2) => typeof v2 === "string" && v2 ? v2 : void 0;
|
|
12753
|
+
if (str(parsed.hub_address) ?? str(parsed.a2a_address) ?? str(parsed.a2aAddress) ?? str(parsed.channel_id)) {
|
|
12754
|
+
return { kind: "unknown" };
|
|
12755
|
+
}
|
|
12756
|
+
const roomId = str(parsed.room_id);
|
|
12757
|
+
if (roomId) return conversationForTarget({ kind: "room", roomId });
|
|
12758
|
+
if (parsed.target === "context") return conversationForTarget({ kind: "context" });
|
|
12759
|
+
if (parsed.audience === "everyone") return { kind: "unknown" };
|
|
12760
|
+
return conversationForTarget({ kind: "owner" }, { conversationId: str(parsed.conversation_id) });
|
|
12761
|
+
}
|
|
12762
|
+
async function _handleSendRequest(parsed, channel) {
|
|
12623
12763
|
const text = parsed.text;
|
|
12624
12764
|
if (!text || typeof text !== "string") {
|
|
12625
12765
|
return { status: 400, body: { ok: false, error: "Missing 'text' field" } };
|
|
@@ -18371,7 +18511,7 @@ function reportSkillInvocation(opts) {
|
|
|
18371
18511
|
spanBuffer.push(span);
|
|
18372
18512
|
return span;
|
|
18373
18513
|
}
|
|
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, 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;
|
|
18514
|
+
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, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, 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
18515
|
var init_dist = __esm({
|
|
18376
18516
|
async "../plugin/dist/index.js"() {
|
|
18377
18517
|
"use strict";
|
|
@@ -70843,6 +70983,7 @@ var init_dist = __esm({
|
|
|
70843
70983
|
init_mls_membership_probe = __esm2({
|
|
70844
70984
|
"src/mls-membership-probe.ts"() {
|
|
70845
70985
|
"use strict";
|
|
70986
|
+
NOT_A_MEMBER_DETAIL = "Not authorized for this MLS group";
|
|
70846
70987
|
}
|
|
70847
70988
|
});
|
|
70848
70989
|
init_history_backup_scheduler = __esm2({
|
|
@@ -70961,6 +71102,119 @@ var init_dist = __esm({
|
|
|
70961
71102
|
ACTIONS = /* @__PURE__ */ new Set(["approve", "deny", "defer", "cancel"]);
|
|
70962
71103
|
}
|
|
70963
71104
|
});
|
|
71105
|
+
init_welcome_kp_backoff = __esm2({
|
|
71106
|
+
"src/welcome-kp-backoff.ts"() {
|
|
71107
|
+
"use strict";
|
|
71108
|
+
KP_BACKOFF_INITIAL_MS = 10 * 6e4;
|
|
71109
|
+
KP_BACKOFF_MAX_MS = 60 * 6e4;
|
|
71110
|
+
KP_RACE_RETRY_MS = 6e4;
|
|
71111
|
+
KP_RACE_RETRY_LIMIT = 3;
|
|
71112
|
+
consoleLogger = {
|
|
71113
|
+
warn: (m2) => console.warn(m2),
|
|
71114
|
+
info: (m2) => console.log(m2)
|
|
71115
|
+
};
|
|
71116
|
+
short = (id) => id.slice(0, 8);
|
|
71117
|
+
WelcomeKeyPackageBackoff = class {
|
|
71118
|
+
constructor(log = consoleLogger) {
|
|
71119
|
+
this.log = log;
|
|
71120
|
+
}
|
|
71121
|
+
log;
|
|
71122
|
+
entries = /* @__PURE__ */ new Map();
|
|
71123
|
+
pendingSig = /* @__PURE__ */ new Map();
|
|
71124
|
+
failing = /* @__PURE__ */ new Set();
|
|
71125
|
+
key(groupId, deviceId) {
|
|
71126
|
+
return `${groupId}:${deviceId}`;
|
|
71127
|
+
}
|
|
71128
|
+
/**
|
|
71129
|
+
* Record this pull's pending list for a group. Returns true when the set of
|
|
71130
|
+
* requests differs from the previous pull's — the caller logs its "N pending"
|
|
71131
|
+
* line only then. Backoffs for devices whose request is gone are dropped.
|
|
71132
|
+
*/
|
|
71133
|
+
observePending(groupId, pending) {
|
|
71134
|
+
const sig = pending.map((r2) => r2.id).sort().join(",");
|
|
71135
|
+
const changed = this.pendingSig.get(groupId) !== sig;
|
|
71136
|
+
if (pending.length === 0) this.pendingSig.delete(groupId);
|
|
71137
|
+
else this.pendingSig.set(groupId, sig);
|
|
71138
|
+
const live = new Set(pending.map((r2) => r2.requesting_device_id));
|
|
71139
|
+
const prefix = `${groupId}:`;
|
|
71140
|
+
for (const k2 of [...this.entries.keys()]) {
|
|
71141
|
+
if (k2.startsWith(prefix) && !live.has(k2.slice(prefix.length))) this.entries.delete(k2);
|
|
71142
|
+
}
|
|
71143
|
+
return changed && pending.length > 0;
|
|
71144
|
+
}
|
|
71145
|
+
/** Should this pull ask the batch for this device's KeyPackage? */
|
|
71146
|
+
shouldAsk(groupId, deviceId, available, label, now = Date.now()) {
|
|
71147
|
+
const k2 = this.key(groupId, deviceId);
|
|
71148
|
+
const entry = this.entries.get(k2);
|
|
71149
|
+
if (available === false) {
|
|
71150
|
+
if (!entry) {
|
|
71151
|
+
this.entries.set(k2, { untilMs: now + KP_BACKOFF_INITIAL_MS, delayMs: KP_BACKOFF_INITIAL_MS, lastAvailable: false, raceRetries: 0 });
|
|
71152
|
+
this.log.warn(
|
|
71153
|
+
`[SecureChannel] No KeyPackage for ${short(deviceId)} in ${label} \u2014 waiting for the device to come back online; not asking again until it publishes one`
|
|
71154
|
+
);
|
|
71155
|
+
} else {
|
|
71156
|
+
entry.lastAvailable = false;
|
|
71157
|
+
}
|
|
71158
|
+
return false;
|
|
71159
|
+
}
|
|
71160
|
+
if (!entry) return true;
|
|
71161
|
+
if (available === true && entry.lastAvailable === false) return true;
|
|
71162
|
+
return now >= entry.untilMs;
|
|
71163
|
+
}
|
|
71164
|
+
/** The outcome of an ask. `found` = the batch returned a KeyPackage. */
|
|
71165
|
+
recordKeyPackage(groupId, deviceId, found, available, label, now = Date.now()) {
|
|
71166
|
+
const k2 = this.key(groupId, deviceId);
|
|
71167
|
+
const entry = this.entries.get(k2);
|
|
71168
|
+
if (found) {
|
|
71169
|
+
if (entry) {
|
|
71170
|
+
this.entries.delete(k2);
|
|
71171
|
+
this.log.info(`[SecureChannel] KeyPackage for ${short(deviceId)} is available again in ${label} \u2014 admitting`);
|
|
71172
|
+
}
|
|
71173
|
+
return;
|
|
71174
|
+
}
|
|
71175
|
+
const raced = available === true && (entry?.raceRetries ?? 0) < KP_RACE_RETRY_LIMIT;
|
|
71176
|
+
if (!entry) {
|
|
71177
|
+
if (raced) {
|
|
71178
|
+
this.entries.set(k2, { untilMs: now + KP_RACE_RETRY_MS, delayMs: 0, lastAvailable: available, raceRetries: 1 });
|
|
71179
|
+
this.log.warn(
|
|
71180
|
+
`[SecureChannel] No KeyPackage for ${short(deviceId)} in ${label} although the server listed one (claimed elsewhere?) \u2014 retrying in ${KP_RACE_RETRY_MS / 1e3} s`
|
|
71181
|
+
);
|
|
71182
|
+
return;
|
|
71183
|
+
}
|
|
71184
|
+
this.entries.set(k2, { untilMs: now + KP_BACKOFF_INITIAL_MS, delayMs: KP_BACKOFF_INITIAL_MS, lastAvailable: available, raceRetries: 0 });
|
|
71185
|
+
this.log.warn(
|
|
71186
|
+
`[SecureChannel] No KeyPackage for ${short(deviceId)} in ${label}, skipping \u2014 not asking again for ${KP_BACKOFF_INITIAL_MS / 6e4} min (the device has to come back online)`
|
|
71187
|
+
);
|
|
71188
|
+
return;
|
|
71189
|
+
}
|
|
71190
|
+
entry.lastAvailable = available;
|
|
71191
|
+
if (raced) {
|
|
71192
|
+
entry.raceRetries += 1;
|
|
71193
|
+
entry.untilMs = now + KP_RACE_RETRY_MS;
|
|
71194
|
+
return;
|
|
71195
|
+
}
|
|
71196
|
+
entry.raceRetries = available === true ? entry.raceRetries : 0;
|
|
71197
|
+
entry.delayMs = entry.delayMs === 0 ? KP_BACKOFF_INITIAL_MS : Math.min(entry.delayMs * 2, KP_BACKOFF_MAX_MS);
|
|
71198
|
+
entry.untilMs = now + entry.delayMs;
|
|
71199
|
+
}
|
|
71200
|
+
/** A non-OK response for `scope`: warn once until it recovers. */
|
|
71201
|
+
noteFetchFailure(scope, status) {
|
|
71202
|
+
if (this.failing.has(scope)) return;
|
|
71203
|
+
this.failing.add(scope);
|
|
71204
|
+
this.log.warn(`[SecureChannel] ${scope} failed (${status}) \u2014 will retry each pull; logging once until it recovers`);
|
|
71205
|
+
}
|
|
71206
|
+
noteFetchOk(scope) {
|
|
71207
|
+
if (!this.failing.delete(scope)) return;
|
|
71208
|
+
this.log.info(`[SecureChannel] ${scope} recovered`);
|
|
71209
|
+
}
|
|
71210
|
+
/** Test/diagnostic view. */
|
|
71211
|
+
backoffFor(groupId, deviceId) {
|
|
71212
|
+
const e = this.entries.get(this.key(groupId, deviceId));
|
|
71213
|
+
return e ? { untilMs: e.untilMs, delayMs: e.delayMs } : void 0;
|
|
71214
|
+
}
|
|
71215
|
+
};
|
|
71216
|
+
}
|
|
71217
|
+
});
|
|
70964
71218
|
history_backup_client_exports = {};
|
|
70965
71219
|
__export2(history_backup_client_exports, {
|
|
70966
71220
|
HISTORY_RESTORE_RESPONSE_MAX_BYTES: () => HISTORY_RESTORE_RESPONSE_MAX_BYTES,
|
|
@@ -71248,6 +71502,55 @@ var init_dist = __esm({
|
|
|
71248
71502
|
_transcriptFn = null;
|
|
71249
71503
|
}
|
|
71250
71504
|
});
|
|
71505
|
+
init_tool_telemetry = __esm2({
|
|
71506
|
+
"src/tool-telemetry.ts"() {
|
|
71507
|
+
"use strict";
|
|
71508
|
+
TOOL_INVOKE_SPAN_NAME = "ai.agent.tool.invoke";
|
|
71509
|
+
UNCLASSIFIED_ERROR = "unclassified";
|
|
71510
|
+
KNOWN_TOOL_ERROR_CODES = [
|
|
71511
|
+
"relay_not_connected",
|
|
71512
|
+
"mls_group_not_initialized",
|
|
71513
|
+
"mls_encrypt_failed",
|
|
71514
|
+
"room_not_found",
|
|
71515
|
+
"a2a_channel_not_found",
|
|
71516
|
+
"channel_not_ready",
|
|
71517
|
+
"channel_not_started",
|
|
71518
|
+
"no_active_sessions",
|
|
71519
|
+
"no_conversation_ready",
|
|
71520
|
+
"blocked_by_policy",
|
|
71521
|
+
"unknown_target",
|
|
71522
|
+
"unsupported_destination",
|
|
71523
|
+
"delivery_timeout",
|
|
71524
|
+
"delivery_cancelled",
|
|
71525
|
+
"delivery_failed",
|
|
71526
|
+
"ambiguous_target",
|
|
71527
|
+
"no_receipt",
|
|
71528
|
+
"invalid_request",
|
|
71529
|
+
UNCLASSIFIED_ERROR
|
|
71530
|
+
];
|
|
71531
|
+
KNOWN_CODES = new Set(KNOWN_TOOL_ERROR_CODES);
|
|
71532
|
+
CLASS_NAME_RE = /^(?:[A-Za-z][A-Za-z0-9_]{0,47})?(?:Error|Exception)$/;
|
|
71533
|
+
TOOL_NAME_RE = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
71534
|
+
ERROR_TEXT_CODES = [
|
|
71535
|
+
[/relay socket is not open/, "relay_not_connected"],
|
|
71536
|
+
[/has no initialized MLS group/, "mls_group_not_initialized"],
|
|
71537
|
+
[/^MLS encrypt failed/, "mls_encrypt_failed"],
|
|
71538
|
+
[/^Room .+ not found$/, "room_not_found"],
|
|
71539
|
+
[/^No A2A channel found|^A2A channel .+ not found$/, "a2a_channel_not_found"],
|
|
71540
|
+
[/^Channel is not ready$|^Channel is in \w+ state$/, "channel_not_ready"],
|
|
71541
|
+
[/^AgentVault channel not connected$|^Channel not started$/, "channel_not_started"],
|
|
71542
|
+
[/^No active sessions$/, "no_active_sessions"],
|
|
71543
|
+
[/^No conversation is ready to receive/, "no_conversation_ready"],
|
|
71544
|
+
[/^Message blocked by scan rule/, "blocked_by_policy"],
|
|
71545
|
+
[/^Unknown target kind$/, "unknown_target"],
|
|
71546
|
+
[/can only be sent to owner|cannot be sent to A2A targets/, "unsupported_destination"],
|
|
71547
|
+
[/^Delivery timed out$/, "delivery_timeout"],
|
|
71548
|
+
[/^Delivery cancelled$/, "delivery_cancelled"],
|
|
71549
|
+
[/^Delivery failed$/, "delivery_failed"]
|
|
71550
|
+
];
|
|
71551
|
+
_conversation = new AsyncLocalStorage();
|
|
71552
|
+
}
|
|
71553
|
+
});
|
|
71251
71554
|
http_handlers_exports = {};
|
|
71252
71555
|
__export2(http_handlers_exports, {
|
|
71253
71556
|
handleActionRequest: () => handleActionRequest,
|
|
@@ -71262,6 +71565,7 @@ var init_dist = __esm({
|
|
|
71262
71565
|
"src/http-handlers.ts"() {
|
|
71263
71566
|
"use strict";
|
|
71264
71567
|
init_owner_routing();
|
|
71568
|
+
init_tool_telemetry();
|
|
71265
71569
|
}
|
|
71266
71570
|
});
|
|
71267
71571
|
mcp_proxy_helpers_exports = {};
|
|
@@ -71311,6 +71615,7 @@ var init_dist = __esm({
|
|
|
71311
71615
|
init_history_backup_scheduler();
|
|
71312
71616
|
await init_history_recovery_code();
|
|
71313
71617
|
init_decision_reply();
|
|
71618
|
+
init_welcome_kp_backoff();
|
|
71314
71619
|
ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
|
|
71315
71620
|
"message",
|
|
71316
71621
|
"text",
|
|
@@ -71341,7 +71646,7 @@ var init_dist = __esm({
|
|
|
71341
71646
|
OUTBOUND_DEDUPE_TYPES = /* @__PURE__ */ new Set(["text", "status_alert", "artifact", "attachment"]);
|
|
71342
71647
|
RETRY_CANDIDATE_TTL_MS = 6e4;
|
|
71343
71648
|
RETRY_CANDIDATE_MAX = 32;
|
|
71344
|
-
_turnConversation = new
|
|
71649
|
+
_turnConversation = new AsyncLocalStorage2();
|
|
71345
71650
|
PERSON_INVOLVED_WINDOW_MS = 5 * 6e4;
|
|
71346
71651
|
ATTESTED_INBOUND_MAX = 64;
|
|
71347
71652
|
UNMAPPED_RECONCILE_COOLDOWN_MS = 6e4;
|
|
@@ -71421,6 +71726,8 @@ var init_dist = __esm({
|
|
|
71421
71726
|
_mlsGroups = /* @__PURE__ */ new Map();
|
|
71422
71727
|
/** `${mlsGroupId}:${deviceId}` -> last re-admit ms (#1171). */
|
|
71423
71728
|
_roomFulfilCooldown = /* @__PURE__ */ new Map();
|
|
71729
|
+
/** #1428: per (group, device) KeyPackage backoff for the pending-Welcome pulls. */
|
|
71730
|
+
_welcomeKpBackoff = new WelcomeKeyPackageBackoff();
|
|
71424
71731
|
/** Maps conversationId -> conversation_group_id for shared 1:1 MLS groups */
|
|
71425
71732
|
_sessionGroupIds = /* @__PURE__ */ new Map();
|
|
71426
71733
|
/** Consecutive MLS decrypt failure count per group key for epoch recovery. */
|
|
@@ -71706,6 +72013,119 @@ ${text}`;
|
|
|
71706
72013
|
console.warn("[SecureChannel] failed to post auth_failed:", err);
|
|
71707
72014
|
}
|
|
71708
72015
|
}
|
|
72016
|
+
/**
|
|
72017
|
+
* Ask the PUBLIC status endpoint what this device is right now. Used to
|
|
72018
|
+
* CONFIRM a credential rejection before acting on it — a 403 on its own
|
|
72019
|
+
* cannot tell "revoked" from "paused by its owner" (both are non-ACTIVE to
|
|
72020
|
+
* get_device_auth), and treating a pause as a revoke is what removed
|
|
72021
|
+
* loopita's launchd service on 2026-10-25.
|
|
72022
|
+
*
|
|
72023
|
+
* Only two answers are terminal: REVOKED, and a deleted row (404 whose
|
|
72024
|
+
* JSON `detail` is exactly get_device_or_404's "Device not found" — any
|
|
72025
|
+
* other 404 is something in the way, not proof). Everything unreadable or inconclusive (network, 5xx, 429,
|
|
72026
|
+
* PENDING, an ACTIVE device answering 403) is `unknown`, which callers MUST
|
|
72027
|
+
* treat as transient: never terminal, never an uninstall, never a banner.
|
|
72028
|
+
*/
|
|
72029
|
+
async _readDeviceStanding() {
|
|
72030
|
+
const deviceId = this._deviceId ?? this._persisted?.deviceId;
|
|
72031
|
+
if (!deviceId) return { kind: "unknown", why: "no device id" };
|
|
72032
|
+
try {
|
|
72033
|
+
const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
|
|
72034
|
+
if (!st || st.rateLimited) return { kind: "unknown", why: "rate limited" };
|
|
72035
|
+
if (st.status === "SUSPENDED") return { kind: "suspended" };
|
|
72036
|
+
if (st.status === "REVOKED") return { kind: "gone", reason: "device_revoked" };
|
|
72037
|
+
if (st.status === "ACTIVE" || st.status === "APPROVED") return { kind: "active" };
|
|
72038
|
+
return { kind: "unknown", why: `status ${String(st.status)}` };
|
|
72039
|
+
} catch (err) {
|
|
72040
|
+
const e = err;
|
|
72041
|
+
if (e?.httpStatus === 404) {
|
|
72042
|
+
try {
|
|
72043
|
+
const parsed = JSON.parse(e.body ?? "");
|
|
72044
|
+
if (parsed?.detail === _SecureChannel.DEVICE_DELETED_DETAIL) {
|
|
72045
|
+
return { kind: "gone", reason: "device_deleted" };
|
|
72046
|
+
}
|
|
72047
|
+
} catch {
|
|
72048
|
+
}
|
|
72049
|
+
}
|
|
72050
|
+
return { kind: "unknown", why: err instanceof Error ? err.message : String(err) };
|
|
72051
|
+
}
|
|
72052
|
+
}
|
|
72053
|
+
/**
|
|
72054
|
+
* A credential path answered 403 (today: /auth/reissue). Confirm before
|
|
72055
|
+
* concluding anything:
|
|
72056
|
+
* - REVOKED / deleted -> terminal: re_enroll health report + `auth_failed`
|
|
72057
|
+
* carrying `deviceGone: true` (the ONLY verdict the
|
|
72058
|
+
* bridges' self-uninstall acts on).
|
|
72059
|
+
* - SUSPENDED -> suspended-wait (idle, keep polling, resume).
|
|
72060
|
+
* - anything else -> transient; nothing is emitted or reported.
|
|
72061
|
+
* Already paused => stay paused without another status read: the
|
|
72062
|
+
* suspended-wait poll owns that question and will see a later revoke.
|
|
72063
|
+
*/
|
|
72064
|
+
async _confirmForbidden(source) {
|
|
72065
|
+
if (this._suspended) return "suspended";
|
|
72066
|
+
const standing = await this._readDeviceStanding();
|
|
72067
|
+
if (standing.kind === "gone") {
|
|
72068
|
+
console.warn(
|
|
72069
|
+
`[SecureChannel] ${source}: 403 confirmed by the status endpoint (${standing.reason}) \u2014 terminal`
|
|
72070
|
+
);
|
|
72071
|
+
this._authFailedThisSession = true;
|
|
72072
|
+
await this._postAuthFailedToBackend(standing.reason);
|
|
72073
|
+
this.emit("auth_failed", { reason: standing.reason, deviceGone: true });
|
|
72074
|
+
return "gone";
|
|
72075
|
+
}
|
|
72076
|
+
if (standing.kind === "suspended") {
|
|
72077
|
+
this._enterSuspendedWait(source);
|
|
72078
|
+
return "suspended";
|
|
72079
|
+
}
|
|
72080
|
+
console.warn(
|
|
72081
|
+
`[SecureChannel] ${source}: 403 but the device is not confirmed revoked (${standing.kind === "unknown" ? standing.why : standing.kind}) \u2014 treating as transient`
|
|
72082
|
+
);
|
|
72083
|
+
return "transient";
|
|
72084
|
+
}
|
|
72085
|
+
/** The backend's exact detail for an inactive (paused/revoked/deleted) device. */
|
|
72086
|
+
static INACTIVE_DEVICE_DETAIL = "Device not found or not active";
|
|
72087
|
+
/** get_device_or_404's exact detail — the only 404 that means "row deleted". */
|
|
72088
|
+
static DEVICE_DELETED_DETAIL = "Device not found";
|
|
72089
|
+
/**
|
|
72090
|
+
* After a TRANSIENT inactive-403 verdict, how long before another 403 may
|
|
72091
|
+
* re-read the status endpoint. Long enough that a burst cannot trip the
|
|
72092
|
+
* 1-per-5s limiter (which would itself read as "unknown"); short enough that
|
|
72093
|
+
* a revoke behind an outage is still noticed within the session (dr-evil Q1).
|
|
72094
|
+
*/
|
|
72095
|
+
static INACTIVE_403_RECHECK_MS = 3e4;
|
|
72096
|
+
/** Read a FastAPI error `detail` without consuming the caller's body. */
|
|
72097
|
+
async _errorDetail(resp) {
|
|
72098
|
+
try {
|
|
72099
|
+
const body = await resp.clone().json();
|
|
72100
|
+
return typeof body?.detail === "string" ? body.detail : null;
|
|
72101
|
+
} catch {
|
|
72102
|
+
return null;
|
|
72103
|
+
}
|
|
72104
|
+
}
|
|
72105
|
+
// One confirmation per WS session, shared by every caller: a burst of 403s
|
|
72106
|
+
// (the open handler fires several REST calls at once) must not turn into a
|
|
72107
|
+
// burst of status reads against a 1-per-5s rate limit. Reset in _connect.
|
|
72108
|
+
_inactive403Check = null;
|
|
72109
|
+
_inactive403RetryAt = 0;
|
|
72110
|
+
/**
|
|
72111
|
+
* A REST call answered 403 "Device not found or not active". With the
|
|
72112
|
+
* companion backend change this is how EVERY inactive-device auth failure
|
|
72113
|
+
* arrives (401 now means a bad token only, so `_authedFetch`'s reissue never
|
|
72114
|
+
* runs for it). Same rule as the reissue path: confirm, then act.
|
|
72115
|
+
*/
|
|
72116
|
+
_confirmInactive403(source) {
|
|
72117
|
+
if (this._inactive403Check) return this._inactive403Check;
|
|
72118
|
+
if (Date.now() < this._inactive403RetryAt) return Promise.resolve("transient");
|
|
72119
|
+
const check = this._confirmForbidden(source).then((verdict) => {
|
|
72120
|
+
if (verdict === "transient" && this._inactive403Check === check) {
|
|
72121
|
+
this._inactive403Check = null;
|
|
72122
|
+
this._inactive403RetryAt = Date.now() + _SecureChannel.INACTIVE_403_RECHECK_MS;
|
|
72123
|
+
}
|
|
72124
|
+
return verdict;
|
|
72125
|
+
});
|
|
72126
|
+
this._inactive403Check = check;
|
|
72127
|
+
return check;
|
|
72128
|
+
}
|
|
71709
72129
|
/**
|
|
71710
72130
|
* Proactively reissue the persisted device JWT when its remaining lifetime
|
|
71711
72131
|
* is under 30 days. Called before each WebSocket connect attempt so the
|
|
@@ -71724,6 +72144,9 @@ ${text}`;
|
|
|
71724
72144
|
* than read back off `_authFailedThisSession`, whose lifetime is reset per
|
|
71725
72145
|
* connect and is easy to get subtly wrong.
|
|
71726
72146
|
*/
|
|
72147
|
+
//
|
|
72148
|
+
// 2026-10-25: a TRUE return now also covers "paused by its owner" (a 403
|
|
72149
|
+
// confirmed SUSPENDED). The caller tells the two apart by `_suspended`.
|
|
71727
72150
|
async _maybeReissueDeviceJwt() {
|
|
71728
72151
|
const jwt = this._persisted?.deviceJwt ?? this._deviceJwt;
|
|
71729
72152
|
if (!jwt) return false;
|
|
@@ -71751,12 +72174,16 @@ ${text}`;
|
|
|
71751
72174
|
}
|
|
71752
72175
|
return false;
|
|
71753
72176
|
}
|
|
71754
|
-
if (resp.status ===
|
|
72177
|
+
if (resp.status === 403) {
|
|
72178
|
+
console.warn("[SecureChannel] reissue rejected (403); confirming device status");
|
|
72179
|
+
const verdict = await this._confirmForbidden("reissue_forbidden");
|
|
72180
|
+
return verdict !== "transient";
|
|
72181
|
+
}
|
|
72182
|
+
if (resp.status === 401) {
|
|
71755
72183
|
console.warn(`[SecureChannel] reissue rejected (${resp.status}); credentials need attention`);
|
|
71756
72184
|
this._authFailedThisSession = true;
|
|
71757
|
-
|
|
71758
|
-
|
|
71759
|
-
this.emit("auth_failed", { reason });
|
|
72185
|
+
await this._postAuthFailedToBackend("device_jwt_expired");
|
|
72186
|
+
this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
|
|
71760
72187
|
return true;
|
|
71761
72188
|
}
|
|
71762
72189
|
console.warn(`[SecureChannel] reissue ${resp.status}; keeping current jwt`);
|
|
@@ -71815,13 +72242,17 @@ ${text}`;
|
|
|
71815
72242
|
};
|
|
71816
72243
|
resp = await fetch(url2, { ...init, headers: retryHeaders });
|
|
71817
72244
|
}
|
|
71818
|
-
} else if (reissueResp.status ===
|
|
72245
|
+
} else if (reissueResp.status === 403) {
|
|
72246
|
+
await this._confirmForbidden("reissue_forbidden");
|
|
72247
|
+
} else if (reissueResp.status === 401) {
|
|
71819
72248
|
this._authFailedThisSession = true;
|
|
71820
|
-
|
|
71821
|
-
|
|
71822
|
-
this.emit("auth_failed", { reason });
|
|
72249
|
+
await this._postAuthFailedToBackend("device_jwt_expired");
|
|
72250
|
+
this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
|
|
71823
72251
|
}
|
|
71824
72252
|
}
|
|
72253
|
+
if (resp.status === 403 && await this._errorDetail(resp) === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
|
|
72254
|
+
await this._confirmInactive403("rest_forbidden");
|
|
72255
|
+
}
|
|
71825
72256
|
return resp;
|
|
71826
72257
|
}
|
|
71827
72258
|
get state() {
|
|
@@ -73507,7 +73938,7 @@ ${text}`;
|
|
|
73507
73938
|
*/
|
|
73508
73939
|
sendActivitySpan(spanData) {
|
|
73509
73940
|
if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
|
|
73510
|
-
const pluginVersion = true ? "0.23.
|
|
73941
|
+
const pluginVersion = true ? "0.23.54" : "0.0.0-dev";
|
|
73511
73942
|
const agentName = this.config.agentName ?? "Agent";
|
|
73512
73943
|
const resource = {
|
|
73513
73944
|
"service.name": "agentvault-agent",
|
|
@@ -73875,15 +74306,27 @@ ${text}`;
|
|
|
73875
74306
|
*/
|
|
73876
74307
|
async _quarantineOrphanedMlsGroups() {
|
|
73877
74308
|
if (!this._deviceJwt) return;
|
|
74309
|
+
let deviceActive = null;
|
|
74310
|
+
const confirmDeviceActive = () => deviceActive ??= this._readDeviceStanding().then((st) => st.kind === "active");
|
|
73878
74311
|
const quarantined = await quarantineOrphanedMlsState(
|
|
73879
74312
|
this.config.dataDir,
|
|
73880
74313
|
async (groupId) => {
|
|
73881
74314
|
try {
|
|
74315
|
+
if (this._suspended) return null;
|
|
73882
74316
|
const res = await fetch(
|
|
73883
74317
|
`${this.config.apiUrl}/api/v1/mls/groups/${encodeURIComponent(groupId)}`,
|
|
73884
74318
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
73885
74319
|
);
|
|
73886
|
-
|
|
74320
|
+
const detail = res.status === 403 ? await this._errorDetail(res) : null;
|
|
74321
|
+
if (detail === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
|
|
74322
|
+
await this._confirmInactive403("mls_probe");
|
|
74323
|
+
return null;
|
|
74324
|
+
}
|
|
74325
|
+
const verdict = mlsMembershipFromStatus(res.status, detail);
|
|
74326
|
+
if (verdict === false && res.status === 403) {
|
|
74327
|
+
if (!await confirmDeviceActive() || this._suspended) return null;
|
|
74328
|
+
}
|
|
74329
|
+
return verdict;
|
|
73887
74330
|
} catch {
|
|
73888
74331
|
return null;
|
|
73889
74332
|
}
|
|
@@ -75618,6 +76061,8 @@ ${text}`;
|
|
|
75618
76061
|
async _connect() {
|
|
75619
76062
|
if (this._stopped) return;
|
|
75620
76063
|
this._reissueAttempted = false;
|
|
76064
|
+
this._inactive403Check = null;
|
|
76065
|
+
this._inactive403RetryAt = 0;
|
|
75621
76066
|
this._authFailedThisSession = false;
|
|
75622
76067
|
if (this._reconnectTimer) {
|
|
75623
76068
|
clearTimeout(this._reconnectTimer);
|
|
@@ -75633,6 +76078,10 @@ ${text}`;
|
|
|
75633
76078
|
}
|
|
75634
76079
|
this._setState("connecting");
|
|
75635
76080
|
if (await this._maybeReissueDeviceJwt()) {
|
|
76081
|
+
if (this._suspended) {
|
|
76082
|
+
console.log("[SecureChannel] device is paused \u2014 not connecting until it is resumed");
|
|
76083
|
+
return;
|
|
76084
|
+
}
|
|
75636
76085
|
console.warn(
|
|
75637
76086
|
"[SecureChannel] credentials are terminally dead \u2014 aborting connect (no WS attempt)"
|
|
75638
76087
|
);
|
|
@@ -75643,16 +76092,26 @@ ${text}`;
|
|
|
75643
76092
|
const url2 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(buildClientVersion(this.config.clientVersion))}`;
|
|
75644
76093
|
const ws = new WebSocket(url2);
|
|
75645
76094
|
this._ws = ws;
|
|
76095
|
+
const served = this._createServedGate();
|
|
75646
76096
|
ws.on("open", async () => {
|
|
75647
76097
|
try {
|
|
75648
|
-
this._reconnectAttempt = 0;
|
|
75649
76098
|
this._lastWsOpenTime = Date.now();
|
|
75650
76099
|
this._startPing(ws);
|
|
75651
76100
|
this._startWakeDetector();
|
|
76101
|
+
if (!await served.wait()) {
|
|
76102
|
+
console.log("[SecureChannel] connection rejected before it was served \u2014 skipping connect-time work");
|
|
76103
|
+
return;
|
|
76104
|
+
}
|
|
76105
|
+
const aborted2 = () => this._stopped || this._suspended || this._ws !== ws || served.rejected;
|
|
76106
|
+
if (aborted2()) return;
|
|
76107
|
+
this._reconnectAttempt = 0;
|
|
75652
76108
|
this._startPendingPoll();
|
|
75653
76109
|
await this._syncMissedMessages();
|
|
76110
|
+
if (aborted2()) return;
|
|
75654
76111
|
await this._pullDrDeliveryQueue();
|
|
76112
|
+
if (aborted2()) return;
|
|
75655
76113
|
await this._flushOutboundQueue();
|
|
76114
|
+
if (aborted2()) return;
|
|
75656
76115
|
this._setState("ready");
|
|
75657
76116
|
void this._reconcileConversationGroups().catch((err) => {
|
|
75658
76117
|
console.warn("[SecureChannel] Conversation-group reconcile failed:", err);
|
|
@@ -75684,7 +76143,7 @@ ${text}`;
|
|
|
75684
76143
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
75685
76144
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
75686
76145
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
75687
|
-
pluginVersion: true ? "0.23.
|
|
76146
|
+
pluginVersion: true ? "0.23.54" : "0.0.0-dev"
|
|
75688
76147
|
});
|
|
75689
76148
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
75690
76149
|
}
|
|
@@ -75692,6 +76151,7 @@ ${text}`;
|
|
|
75692
76151
|
await this.listA2AChannels().catch((err) => {
|
|
75693
76152
|
console.warn("[SecureChannel] A2A channel sync on connect failed:", err);
|
|
75694
76153
|
});
|
|
76154
|
+
if (aborted2()) return;
|
|
75695
76155
|
await this._ensureKpPoolPublished();
|
|
75696
76156
|
this._startKpReplenishTimer();
|
|
75697
76157
|
this._pullDeliveryQueue().catch((err) => {
|
|
@@ -75753,6 +76213,8 @@ ${text}`;
|
|
|
75753
76213
|
this._lastWakeTick = Date.now();
|
|
75754
76214
|
try {
|
|
75755
76215
|
const data = JSON.parse(raw.toString());
|
|
76216
|
+
if (data?.event === "connection_rejected") served.markRejected();
|
|
76217
|
+
else served.markServed();
|
|
75756
76218
|
if (data.event && data.event !== "ping" && data.event !== "typing") {
|
|
75757
76219
|
const d2 = data.data ?? {};
|
|
75758
76220
|
const conv = (data.conversation_id || d2.conversation_id || "").toString();
|
|
@@ -76012,7 +76474,7 @@ ${text}`;
|
|
|
76012
76474
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
76013
76475
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
76014
76476
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
76015
|
-
pluginVersion: true ? "0.23.
|
|
76477
|
+
pluginVersion: true ? "0.23.54" : "0.0.0-dev"
|
|
76016
76478
|
});
|
|
76017
76479
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
76018
76480
|
}
|
|
@@ -76381,6 +76843,7 @@ ${text}`;
|
|
|
76381
76843
|
});
|
|
76382
76844
|
ws.on("close", (code) => {
|
|
76383
76845
|
this._lastCloseCode = typeof code === "number" ? code : null;
|
|
76846
|
+
served.markRejected();
|
|
76384
76847
|
this._stopPing();
|
|
76385
76848
|
this._stopWakeDetector();
|
|
76386
76849
|
this._stopPendingPoll();
|
|
@@ -77948,7 +78411,7 @@ ${baseText}`;
|
|
|
77948
78411
|
return 0;
|
|
77949
78412
|
}
|
|
77950
78413
|
const snapshot = mlsGroup.exportState();
|
|
77951
|
-
const preHead = await this._readGroupHead(mlsGroupId);
|
|
78414
|
+
const preHead = opts.preHead ?? await this._readGroupHead(mlsGroupId);
|
|
77952
78415
|
if (preHead.ok && preHead.epoch !== Number(mlsGroup.epoch)) {
|
|
77953
78416
|
console.warn(
|
|
77954
78417
|
`[SecureChannel] ${label}: server head is at epoch ${preHead.epoch}, we are at ${Number(mlsGroup.epoch)} \u2014 NOT committing (it would be refused, #1184); ${targets.length} request(s) stay pending`
|
|
@@ -78135,6 +78598,40 @@ ${baseText}`;
|
|
|
78135
78598
|
_wsIsOpen() {
|
|
78136
78599
|
return this._ws?.readyState === 1;
|
|
78137
78600
|
}
|
|
78601
|
+
/**
|
|
78602
|
+
* #1429 review: the cheap checks `_fulfilWelcomeRequests` makes, run BEFORE a
|
|
78603
|
+
* pending-Welcome site claims KeyPackages — the order #1225 S4 gave the A2A
|
|
78604
|
+
* path. `GET /key-packages/batch` CONSUMES; the room, shared-1:1 and conv
|
|
78605
|
+
* sites used to claim one per pending device and only then find the socket
|
|
78606
|
+
* closed, another commit in flight, or the server head elsewhere — burning a
|
|
78607
|
+
* package per device per failed pull (and the shared/conv sites have no
|
|
78608
|
+
* cooldown). `_fulfilWelcomeRequests` keeps its own checks: this is a gate on
|
|
78609
|
+
* spending, not a replacement for the guard at the point of commit.
|
|
78610
|
+
*/
|
|
78611
|
+
/**
|
|
78612
|
+
* Returns the head it read (handed on to `_fulfilWelcomeRequests` as its
|
|
78613
|
+
* pre-flight, so a pull still reads the head once before committing), or
|
|
78614
|
+
* `null` when nothing should be claimed this pull.
|
|
78615
|
+
*/
|
|
78616
|
+
async _welcomeCommitPreflight(mlsGroupId, mlsGroup, label) {
|
|
78617
|
+
if (!this._wsIsOpen()) {
|
|
78618
|
+
console.warn(`[SecureChannel] ${label}: socket is not OPEN \u2014 not claiming KeyPackages; requests stay pending for the next pull`);
|
|
78619
|
+
return null;
|
|
78620
|
+
}
|
|
78621
|
+
if (this._commitInFlight.has(mlsGroupId)) {
|
|
78622
|
+
console.warn(`[SecureChannel] ${label}: another commit for this group is in flight \u2014 not claiming KeyPackages this pull`);
|
|
78623
|
+
return null;
|
|
78624
|
+
}
|
|
78625
|
+
const head = await this._readGroupHead(mlsGroupId);
|
|
78626
|
+
if (head.ok && head.epoch !== Number(mlsGroup.epoch)) {
|
|
78627
|
+
console.warn(
|
|
78628
|
+
`[SecureChannel] ${label}: server head is at epoch ${head.epoch}, we are at ${Number(mlsGroup.epoch)} \u2014 not claiming KeyPackages (the commit would be refused, #1184); requests stay pending`
|
|
78629
|
+
);
|
|
78630
|
+
await this._catchUpAfterPreflightSkip(mlsGroupId, head.epoch, Number(mlsGroup.epoch), label);
|
|
78631
|
+
return null;
|
|
78632
|
+
}
|
|
78633
|
+
return head;
|
|
78634
|
+
}
|
|
78138
78635
|
/** SHA-256 hex of a commit's bytes — its identity on the server (#1175/#1177). */
|
|
78139
78636
|
/**
|
|
78140
78637
|
* #1225: send ONE commit over the socket and wait for the server's verdict,
|
|
@@ -79160,14 +79657,27 @@ ${baseText}`;
|
|
|
79160
79657
|
const roomState = this._persisted?.rooms?.[roomId];
|
|
79161
79658
|
if (!roomState?.mlsGroupId) continue;
|
|
79162
79659
|
try {
|
|
79660
|
+
const roomLabel = `room ${roomId.slice(0, 8)}`;
|
|
79163
79661
|
const pendingRes = await fetch(
|
|
79164
79662
|
`${this.config.apiUrl}/api/v1/mls/groups/${roomState.mlsGroupId}/pending-welcomes`,
|
|
79165
79663
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79166
79664
|
);
|
|
79167
|
-
if (!pendingRes.ok)
|
|
79665
|
+
if (!pendingRes.ok) {
|
|
79666
|
+
this._welcomeKpBackoff.noteFetchFailure(`pending-welcomes for ${roomLabel}`, pendingRes.status);
|
|
79667
|
+
continue;
|
|
79668
|
+
}
|
|
79669
|
+
this._welcomeKpBackoff.noteFetchOk(`pending-welcomes for ${roomLabel}`);
|
|
79168
79670
|
let pending = await pendingRes.json();
|
|
79671
|
+
if (this._welcomeKpBackoff.observePending(roomState.mlsGroupId, pending)) {
|
|
79672
|
+
console.log(`[SecureChannel] ${pending.length} pending Welcome requests for room ${roomId.slice(0, 8)}`);
|
|
79673
|
+
}
|
|
79674
|
+
if (pending.length === 0) continue;
|
|
79675
|
+
const nowKp = Date.now();
|
|
79676
|
+
const roomMlsGroupId = roomState.mlsGroupId;
|
|
79677
|
+
pending = pending.filter(
|
|
79678
|
+
(r2) => this._welcomeKpBackoff.shouldAsk(roomMlsGroupId, r2.requesting_device_id, r2.key_package_available, roomLabel, nowKp)
|
|
79679
|
+
);
|
|
79169
79680
|
if (pending.length === 0) continue;
|
|
79170
|
-
console.log(`[SecureChannel] ${pending.length} pending Welcome requests for room ${roomId.slice(0, 8)}`);
|
|
79171
79681
|
const nowMs = Date.now();
|
|
79172
79682
|
const fresh = pending.filter((r2) => {
|
|
79173
79683
|
const key = `${roomState.mlsGroupId}:${r2.requesting_device_id}`;
|
|
@@ -79181,6 +79691,8 @@ ${baseText}`;
|
|
|
79181
79691
|
return true;
|
|
79182
79692
|
});
|
|
79183
79693
|
if (fresh.length === 0) continue;
|
|
79694
|
+
const roomPreHead = await this._welcomeCommitPreflight(roomState.mlsGroupId, mlsGroup, roomLabel);
|
|
79695
|
+
if (!roomPreHead) continue;
|
|
79184
79696
|
for (const r2 of fresh) {
|
|
79185
79697
|
this._roomFulfilCooldown.set(`${roomState.mlsGroupId}:${r2.requesting_device_id}`, nowMs);
|
|
79186
79698
|
}
|
|
@@ -79190,13 +79702,23 @@ ${baseText}`;
|
|
|
79190
79702
|
`${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${deviceIds.join(",")}`,
|
|
79191
79703
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79192
79704
|
);
|
|
79193
|
-
if (!kpRes.ok)
|
|
79705
|
+
if (!kpRes.ok) {
|
|
79706
|
+
this._welcomeKpBackoff.noteFetchFailure(`KeyPackage batch for ${roomLabel}`, kpRes.status);
|
|
79707
|
+
continue;
|
|
79708
|
+
}
|
|
79709
|
+
this._welcomeKpBackoff.noteFetchOk(`KeyPackage batch for ${roomLabel}`);
|
|
79194
79710
|
const kpData = await kpRes.json();
|
|
79195
79711
|
const roomTargets = [];
|
|
79196
79712
|
for (const req of pending) {
|
|
79197
79713
|
const kpHex = kpData[req.requesting_device_id];
|
|
79714
|
+
this._welcomeKpBackoff.recordKeyPackage(
|
|
79715
|
+
roomState.mlsGroupId,
|
|
79716
|
+
req.requesting_device_id,
|
|
79717
|
+
Boolean(kpHex),
|
|
79718
|
+
req.key_package_available,
|
|
79719
|
+
roomLabel
|
|
79720
|
+
);
|
|
79198
79721
|
if (!kpHex) {
|
|
79199
|
-
console.warn(`[SecureChannel] No KeyPackage for ${req.requesting_device_id.slice(0, 8)}, skipping`);
|
|
79200
79722
|
continue;
|
|
79201
79723
|
}
|
|
79202
79724
|
const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
|
|
@@ -79214,8 +79736,10 @@ ${baseText}`;
|
|
|
79214
79736
|
label: `room ${roomId.slice(0, 8)}`,
|
|
79215
79737
|
welcomeFields: { room_id: roomId },
|
|
79216
79738
|
targets: roomTargets,
|
|
79217
|
-
memberDeviceIds: (roomState.members ?? []).map((m2) => m2.deviceId)
|
|
79739
|
+
memberDeviceIds: (roomState.members ?? []).map((m2) => m2.deviceId),
|
|
79218
79740
|
// #1226
|
|
79741
|
+
preHead: roomPreHead
|
|
79742
|
+
// #1429
|
|
79219
79743
|
});
|
|
79220
79744
|
if (done > 0) {
|
|
79221
79745
|
console.log(
|
|
@@ -79233,28 +79757,49 @@ ${baseText}`;
|
|
|
79233
79757
|
const mlsGroup = this._mlsGroups.get(`1to1-group:${gid}`);
|
|
79234
79758
|
if (!mlsGroup?.isInitialized) continue;
|
|
79235
79759
|
try {
|
|
79760
|
+
const sharedLabel = `shared group ${gid.slice(0, 8)}`;
|
|
79236
79761
|
const pendingRes = await fetch(
|
|
79237
79762
|
`${this.config.apiUrl}/api/v1/mls/groups/${entry.mlsGroupId}/pending-welcomes`,
|
|
79238
79763
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79239
79764
|
);
|
|
79240
|
-
if (!pendingRes.ok)
|
|
79241
|
-
|
|
79765
|
+
if (!pendingRes.ok) {
|
|
79766
|
+
this._welcomeKpBackoff.noteFetchFailure(`pending-welcomes for ${sharedLabel}`, pendingRes.status);
|
|
79767
|
+
continue;
|
|
79768
|
+
}
|
|
79769
|
+
this._welcomeKpBackoff.noteFetchOk(`pending-welcomes for ${sharedLabel}`);
|
|
79770
|
+
const allPending = await pendingRes.json();
|
|
79771
|
+
if (this._welcomeKpBackoff.observePending(entry.mlsGroupId, allPending)) {
|
|
79772
|
+
console.log(`[SecureChannel] ${allPending.length} pending Welcome requests for shared group ${gid.slice(0, 8)}`);
|
|
79773
|
+
}
|
|
79774
|
+
const nowKp = Date.now();
|
|
79775
|
+
const pending = allPending.filter(
|
|
79776
|
+
(r2) => this._welcomeKpBackoff.shouldAsk(entry.mlsGroupId, r2.requesting_device_id, r2.key_package_available, sharedLabel, nowKp)
|
|
79777
|
+
);
|
|
79242
79778
|
if (pending.length === 0) continue;
|
|
79243
|
-
|
|
79779
|
+
const sharedPreHead = await this._welcomeCommitPreflight(entry.mlsGroupId, mlsGroup, sharedLabel);
|
|
79780
|
+
if (!sharedPreHead) continue;
|
|
79244
79781
|
const deviceIds = pending.map((r2) => r2.requesting_device_id);
|
|
79245
79782
|
const kpRes = await fetch(
|
|
79246
79783
|
`${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${deviceIds.join(",")}`,
|
|
79247
79784
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79248
79785
|
);
|
|
79249
|
-
if (!kpRes.ok)
|
|
79786
|
+
if (!kpRes.ok) {
|
|
79787
|
+
this._welcomeKpBackoff.noteFetchFailure(`KeyPackage batch for ${sharedLabel}`, kpRes.status);
|
|
79788
|
+
continue;
|
|
79789
|
+
}
|
|
79790
|
+
this._welcomeKpBackoff.noteFetchOk(`KeyPackage batch for ${sharedLabel}`);
|
|
79250
79791
|
const kpData = await kpRes.json();
|
|
79251
79792
|
const validReqs = [];
|
|
79252
79793
|
for (const req of pending) {
|
|
79253
79794
|
const kpHex = kpData[req.requesting_device_id];
|
|
79254
|
-
|
|
79255
|
-
|
|
79256
|
-
|
|
79257
|
-
|
|
79795
|
+
this._welcomeKpBackoff.recordKeyPackage(
|
|
79796
|
+
entry.mlsGroupId,
|
|
79797
|
+
req.requesting_device_id,
|
|
79798
|
+
Boolean(kpHex),
|
|
79799
|
+
req.key_package_available,
|
|
79800
|
+
sharedLabel
|
|
79801
|
+
);
|
|
79802
|
+
if (!kpHex) continue;
|
|
79258
79803
|
const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
|
|
79259
79804
|
validReqs.push({ req, kp: MLSGroupManager.deserializeKeyPackage(kpBytes) });
|
|
79260
79805
|
}
|
|
@@ -79271,8 +79816,10 @@ ${baseText}`;
|
|
|
79271
79816
|
label: `shared group ${gid.slice(0, 8)}`,
|
|
79272
79817
|
welcomeFields: { conversation_group_id: gid },
|
|
79273
79818
|
targets: sharedTargets,
|
|
79274
|
-
memberDeviceIds: entry.memberDeviceIds ?? []
|
|
79819
|
+
memberDeviceIds: entry.memberDeviceIds ?? [],
|
|
79275
79820
|
// #1226
|
|
79821
|
+
preHead: sharedPreHead
|
|
79822
|
+
// #1429
|
|
79276
79823
|
});
|
|
79277
79824
|
if (done > 0) {
|
|
79278
79825
|
console.log(`[SecureChannel] Batched Welcome for ${done}/${validReqs.length} devices in shared group ${gid.slice(0, 8)} (epoch=${mlsGroup.epoch})`);
|
|
@@ -79306,23 +79853,49 @@ ${baseText}`;
|
|
|
79306
79853
|
const mlsGroup = this._mlsGroups.get(`conv:${convId}`);
|
|
79307
79854
|
if (!mlsGroup?.isInitialized) continue;
|
|
79308
79855
|
try {
|
|
79856
|
+
const convLabel = `conv ${convId.slice(0, 8)}`;
|
|
79309
79857
|
const pendingRes = await fetch(
|
|
79310
79858
|
`${this.config.apiUrl}/api/v1/mls/groups/${convEntry.mlsGroupId}/pending-welcomes`,
|
|
79311
79859
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79312
79860
|
);
|
|
79313
|
-
if (!pendingRes.ok)
|
|
79861
|
+
if (!pendingRes.ok) {
|
|
79862
|
+
this._welcomeKpBackoff.noteFetchFailure(`pending-welcomes for ${convLabel}`, pendingRes.status);
|
|
79863
|
+
continue;
|
|
79864
|
+
}
|
|
79865
|
+
this._welcomeKpBackoff.noteFetchOk(`pending-welcomes for ${convLabel}`);
|
|
79314
79866
|
const pending = await pendingRes.json();
|
|
79867
|
+
if (this._welcomeKpBackoff.observePending(convEntry.mlsGroupId, pending)) {
|
|
79868
|
+
console.log(`[SecureChannel] ${pending.length} pending Welcome requests for conv ${convId.slice(0, 8)}`);
|
|
79869
|
+
}
|
|
79315
79870
|
if (pending.length === 0) continue;
|
|
79316
|
-
console.log(`[SecureChannel] ${pending.length} pending Welcome requests for conv ${convId.slice(0, 8)}`);
|
|
79317
79871
|
for (const req of pending) {
|
|
79318
79872
|
try {
|
|
79873
|
+
if (!this._welcomeKpBackoff.shouldAsk(
|
|
79874
|
+
convEntry.mlsGroupId,
|
|
79875
|
+
req.requesting_device_id,
|
|
79876
|
+
req.key_package_available,
|
|
79877
|
+
convLabel
|
|
79878
|
+
)) continue;
|
|
79879
|
+
const convPreHead = await this._welcomeCommitPreflight(convEntry.mlsGroupId, mlsGroup, convLabel);
|
|
79880
|
+
if (!convPreHead) break;
|
|
79319
79881
|
const kpRes = await fetch(
|
|
79320
79882
|
`${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
|
|
79321
79883
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79322
79884
|
);
|
|
79323
|
-
if (!kpRes.ok)
|
|
79885
|
+
if (!kpRes.ok) {
|
|
79886
|
+
this._welcomeKpBackoff.noteFetchFailure(`KeyPackage batch for ${convLabel}`, kpRes.status);
|
|
79887
|
+
continue;
|
|
79888
|
+
}
|
|
79889
|
+
this._welcomeKpBackoff.noteFetchOk(`KeyPackage batch for ${convLabel}`);
|
|
79324
79890
|
const kpData = await kpRes.json();
|
|
79325
79891
|
const kpHex = kpData[req.requesting_device_id];
|
|
79892
|
+
this._welcomeKpBackoff.recordKeyPackage(
|
|
79893
|
+
convEntry.mlsGroupId,
|
|
79894
|
+
req.requesting_device_id,
|
|
79895
|
+
Boolean(kpHex),
|
|
79896
|
+
req.key_package_available,
|
|
79897
|
+
convLabel
|
|
79898
|
+
);
|
|
79326
79899
|
if (!kpHex) continue;
|
|
79327
79900
|
const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
|
|
79328
79901
|
const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
|
|
@@ -79339,7 +79912,9 @@ ${baseText}`;
|
|
|
79339
79912
|
// #1226: a 1:1 roster is [self, owner] — the web's shape too.
|
|
79340
79913
|
memberDeviceIds: [this._persisted?.sessions?.[convId]?.ownerDeviceId].filter(
|
|
79341
79914
|
(d2) => typeof d2 === "string"
|
|
79342
|
-
)
|
|
79915
|
+
),
|
|
79916
|
+
preHead: convPreHead
|
|
79917
|
+
// #1429
|
|
79343
79918
|
});
|
|
79344
79919
|
if (done > 0) {
|
|
79345
79920
|
console.log(`[SecureChannel] Fulfilled Welcome for ${req.requesting_device_id.slice(0, 8)} in conv ${convId.slice(0, 8)}`);
|
|
@@ -79387,15 +79962,28 @@ ${baseText}`;
|
|
|
79387
79962
|
if (!mlsGroup?.isInitialized) continue;
|
|
79388
79963
|
if (chState.role !== "creator") continue;
|
|
79389
79964
|
try {
|
|
79965
|
+
const a2aPendingLabel = `A2A ${chId.slice(0, 8)}`;
|
|
79390
79966
|
const pendingRes = await fetch(
|
|
79391
79967
|
`${this.config.apiUrl}/api/v1/mls/groups/${chState.mlsGroupId}/pending-welcomes`,
|
|
79392
79968
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79393
79969
|
);
|
|
79394
|
-
if (!pendingRes.ok)
|
|
79970
|
+
if (!pendingRes.ok) {
|
|
79971
|
+
this._welcomeKpBackoff.noteFetchFailure(`pending-welcomes for ${a2aPendingLabel}`, pendingRes.status);
|
|
79972
|
+
continue;
|
|
79973
|
+
}
|
|
79974
|
+
this._welcomeKpBackoff.noteFetchOk(`pending-welcomes for ${a2aPendingLabel}`);
|
|
79395
79975
|
const pending = await pendingRes.json();
|
|
79976
|
+
if (this._welcomeKpBackoff.observePending(chState.mlsGroupId, pending)) {
|
|
79977
|
+
console.log(`[SecureChannel] ${pending.length} pending A2A Welcome requests for channel ${chId.slice(0, 8)}`);
|
|
79978
|
+
}
|
|
79396
79979
|
if (pending.length === 0) continue;
|
|
79397
|
-
console.log(`[SecureChannel] ${pending.length} pending A2A Welcome requests for channel ${chId.slice(0, 8)}`);
|
|
79398
79980
|
for (const req of pending) {
|
|
79981
|
+
if (!this._welcomeKpBackoff.shouldAsk(
|
|
79982
|
+
chState.mlsGroupId,
|
|
79983
|
+
req.requesting_device_id,
|
|
79984
|
+
req.key_package_available,
|
|
79985
|
+
a2aPendingLabel
|
|
79986
|
+
)) continue;
|
|
79399
79987
|
try {
|
|
79400
79988
|
const next = await this._fulfilA2AWelcome(chId, chState, mlsGroup, req);
|
|
79401
79989
|
if (next === "stop") break;
|
|
@@ -79707,9 +80295,20 @@ ${baseText}`;
|
|
|
79707
80295
|
`${this.config.apiUrl}/api/v1/mls/key-packages/batch?device_ids=${req.requesting_device_id}`,
|
|
79708
80296
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
79709
80297
|
);
|
|
79710
|
-
if (!kpRes.ok)
|
|
80298
|
+
if (!kpRes.ok) {
|
|
80299
|
+
this._welcomeKpBackoff.noteFetchFailure(`KeyPackage batch for ${a2aLabel}`, kpRes.status);
|
|
80300
|
+
return "next";
|
|
80301
|
+
}
|
|
80302
|
+
this._welcomeKpBackoff.noteFetchOk(`KeyPackage batch for ${a2aLabel}`);
|
|
79711
80303
|
const kpData = await kpRes.json();
|
|
79712
80304
|
const kpHex = kpData[req.requesting_device_id];
|
|
80305
|
+
this._welcomeKpBackoff.recordKeyPackage(
|
|
80306
|
+
chState.mlsGroupId,
|
|
80307
|
+
req.requesting_device_id,
|
|
80308
|
+
Boolean(kpHex),
|
|
80309
|
+
req.key_package_available,
|
|
80310
|
+
a2aLabel
|
|
80311
|
+
);
|
|
79713
80312
|
if (!kpHex) return "next";
|
|
79714
80313
|
const kpBytes = new Uint8Array(Buffer.from(kpHex, "hex"));
|
|
79715
80314
|
const memberKp = MLSGroupManager.deserializeKeyPackage(kpBytes);
|
|
@@ -80334,7 +80933,7 @@ ${baseText}`;
|
|
|
80334
80933
|
);
|
|
80335
80934
|
this._authFailedThisSession = true;
|
|
80336
80935
|
this._setState("error");
|
|
80337
|
-
this.emit("auth_failed", { reason: "ws_auth_rejected" });
|
|
80936
|
+
this.emit("auth_failed", { reason: "ws_auth_rejected", deviceGone: false });
|
|
80338
80937
|
return;
|
|
80339
80938
|
}
|
|
80340
80939
|
if (lastCode === 4e3) {
|
|
@@ -80373,7 +80972,7 @@ ${baseText}`;
|
|
|
80373
80972
|
this._state = newState;
|
|
80374
80973
|
this.emit("state", newState);
|
|
80375
80974
|
this.config.onStateChange?.(newState);
|
|
80376
|
-
if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt) {
|
|
80975
|
+
if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt && !this._suspended) {
|
|
80377
80976
|
this._startPollFallback();
|
|
80378
80977
|
}
|
|
80379
80978
|
if (newState === "ready" || newState === "error" || this._stopped) {
|
|
@@ -80510,8 +81109,10 @@ ${baseText}`;
|
|
|
80510
81109
|
* blindly. We ask the PUBLIC /devices/{id}/status endpoint (no JWT needed, so
|
|
80511
81110
|
* it answers even when our device JWT is being rejected):
|
|
80512
81111
|
* - ACTIVE -> reconnect in place (transient); stay online.
|
|
80513
|
-
* -
|
|
80514
|
-
* -
|
|
81112
|
+
* - SUSPENDED -> suspended-wait (owner paused it; resume later).
|
|
81113
|
+
* - REVOKED/deleted -> terminal via `_terminalDeviceGone` (auth_failed with
|
|
81114
|
+
* deviceGone: the bridges exit and remove their service).
|
|
81115
|
+
* - anything else / unreachable / 429 -> reconnect (inconclusive; a network blip shouldn't
|
|
80515
81116
|
* permanently kill a healthy agent — the WS is down too,
|
|
80516
81117
|
* so normal backoff handles it, and the war cap bounds
|
|
80517
81118
|
* thrash if the device really is dead).
|
|
@@ -80551,10 +81152,58 @@ ${baseText}`;
|
|
|
80551
81152
|
}
|
|
80552
81153
|
this._authFailedThisSession = true;
|
|
80553
81154
|
const authReason = data?.reason ?? "unknown";
|
|
81155
|
+
const standing = await this._readDeviceStanding();
|
|
81156
|
+
if (standing.kind === "suspended") {
|
|
81157
|
+
this._authFailedThisSession = false;
|
|
81158
|
+
this._enterSuspendedWait("connection_rejected");
|
|
81159
|
+
return;
|
|
81160
|
+
}
|
|
81161
|
+
const deviceGone = standing.kind === "gone";
|
|
80554
81162
|
console.warn(
|
|
80555
|
-
`[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed`
|
|
81163
|
+
`[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed (deviceGone=${deviceGone})`
|
|
80556
81164
|
);
|
|
80557
|
-
this.emit("auth_failed", { reason: authReason });
|
|
81165
|
+
this.emit("auth_failed", { reason: authReason, deviceGone });
|
|
81166
|
+
}
|
|
81167
|
+
/**
|
|
81168
|
+
* How long an opened socket may stay silent before we treat it as served.
|
|
81169
|
+
* The backend's reject_connection sends `connection_rejected` immediately
|
|
81170
|
+
* after the accept, so a refused socket's first frame lands well inside
|
|
81171
|
+
* this; a served agent with a hub gets `hub_identity_sync` sooner still.
|
|
81172
|
+
*/
|
|
81173
|
+
static OPEN_SETTLE_MS = 1500;
|
|
81174
|
+
/**
|
|
81175
|
+
* Per-socket "has the server agreed to serve this session?" latch. Settles
|
|
81176
|
+
* once: served on the first non-rejection frame or when the settle window
|
|
81177
|
+
* passes quietly; rejected on `connection_rejected` or a close first.
|
|
81178
|
+
* `rejected` stays readable afterwards so long open-handler work can bail.
|
|
81179
|
+
*/
|
|
81180
|
+
_createServedGate() {
|
|
81181
|
+
let verdict = null;
|
|
81182
|
+
let rejected = false;
|
|
81183
|
+
let timer = null;
|
|
81184
|
+
const waiters = [];
|
|
81185
|
+
const settle2 = (ok) => {
|
|
81186
|
+
if (!ok) rejected = true;
|
|
81187
|
+
if (verdict !== null) return;
|
|
81188
|
+
verdict = ok;
|
|
81189
|
+
if (timer) {
|
|
81190
|
+
clearTimeout(timer);
|
|
81191
|
+
timer = null;
|
|
81192
|
+
}
|
|
81193
|
+
for (const w2 of waiters.splice(0)) w2(ok);
|
|
81194
|
+
};
|
|
81195
|
+
return {
|
|
81196
|
+
wait: () => {
|
|
81197
|
+
if (verdict !== null) return Promise.resolve(verdict && !rejected);
|
|
81198
|
+
if (!timer) timer = setTimeout(() => settle2(true), _SecureChannel.OPEN_SETTLE_MS);
|
|
81199
|
+
return new Promise((resolve4) => waiters.push(resolve4));
|
|
81200
|
+
},
|
|
81201
|
+
markServed: () => settle2(true),
|
|
81202
|
+
markRejected: () => settle2(false),
|
|
81203
|
+
get rejected() {
|
|
81204
|
+
return rejected;
|
|
81205
|
+
}
|
|
81206
|
+
};
|
|
80558
81207
|
}
|
|
80559
81208
|
// --- Owner pause (device SUSPENDED) — NON-final ---------------------------
|
|
80560
81209
|
//
|
|
@@ -80579,6 +81228,7 @@ ${baseText}`;
|
|
|
80579
81228
|
this._reconnectTimer = null;
|
|
80580
81229
|
}
|
|
80581
81230
|
this._rapidDisconnects = 0;
|
|
81231
|
+
this._stopPollFallback();
|
|
80582
81232
|
if (!this._suspended) {
|
|
80583
81233
|
this._suspended = true;
|
|
80584
81234
|
console.log(
|
|
@@ -80605,30 +81255,40 @@ ${baseText}`;
|
|
|
80605
81255
|
}
|
|
80606
81256
|
async _pollWhileSuspended() {
|
|
80607
81257
|
if (this._stopped || !this._suspended) return;
|
|
80608
|
-
const
|
|
80609
|
-
if (
|
|
80610
|
-
|
|
80611
|
-
|
|
80612
|
-
|
|
80613
|
-
|
|
80614
|
-
|
|
80615
|
-
|
|
80616
|
-
|
|
80617
|
-
|
|
80618
|
-
|
|
80619
|
-
|
|
80620
|
-
|
|
80621
|
-
|
|
80622
|
-
|
|
80623
|
-
|
|
80624
|
-
return;
|
|
80625
|
-
}
|
|
80626
|
-
} catch (err) {
|
|
80627
|
-
console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
|
|
80628
|
-
}
|
|
81258
|
+
const standing = await this._readDeviceStanding();
|
|
81259
|
+
if (this._stopped || !this._suspended) return;
|
|
81260
|
+
if (standing.kind === "active") {
|
|
81261
|
+
this._clearSuspendedWait();
|
|
81262
|
+
this._reconnectAttempt = 0;
|
|
81263
|
+
console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
|
|
81264
|
+
this.emit("resumed");
|
|
81265
|
+
this._connect();
|
|
81266
|
+
return;
|
|
81267
|
+
}
|
|
81268
|
+
if (standing.kind === "gone") {
|
|
81269
|
+
await this._terminalDeviceGone(standing.reason, "suspended_wait");
|
|
81270
|
+
return;
|
|
81271
|
+
}
|
|
81272
|
+
if (standing.kind === "unknown") {
|
|
81273
|
+
console.warn(`[SecureChannel] status check while paused inconclusive (${standing.why}); still waiting`);
|
|
80629
81274
|
}
|
|
80630
81275
|
this._scheduleSuspendedPoll();
|
|
80631
81276
|
}
|
|
81277
|
+
/**
|
|
81278
|
+
* The device is CONFIRMED gone (status endpoint: REVOKED, or the row is
|
|
81279
|
+
* deleted). Stop for good through the documented terminal surface:
|
|
81280
|
+
* re_enroll report, `auth_failed{deviceGone:true}` (bridges exit and remove
|
|
81281
|
+
* their service), then the legacy `error("Device was revoked")` the OpenClaw
|
|
81282
|
+
* lifecycle and older listeners key on.
|
|
81283
|
+
*/
|
|
81284
|
+
async _terminalDeviceGone(reason, source) {
|
|
81285
|
+
this._clearSuspendedWait();
|
|
81286
|
+
this._authFailedThisSession = true;
|
|
81287
|
+
console.warn(`[SecureChannel] ${source}: device confirmed gone (${reason}) \u2014 terminal`);
|
|
81288
|
+
await this._postAuthFailedToBackend(reason);
|
|
81289
|
+
this.emit("auth_failed", { reason, deviceGone: true });
|
|
81290
|
+
this._handleError(new Error("Device was revoked"));
|
|
81291
|
+
}
|
|
80632
81292
|
async _handleDeviceRevoked() {
|
|
80633
81293
|
const now = Date.now();
|
|
80634
81294
|
this._revokeRecoveries = this._revokeRecoveries.filter(
|
|
@@ -80646,35 +81306,25 @@ ${baseText}`;
|
|
|
80646
81306
|
this._handleError(new Error("Device was revoked"));
|
|
80647
81307
|
return;
|
|
80648
81308
|
}
|
|
80649
|
-
|
|
80650
|
-
|
|
80651
|
-
|
|
80652
|
-
|
|
80653
|
-
this._enterSuspendedWait("device_revoked");
|
|
80654
|
-
return;
|
|
80655
|
-
}
|
|
80656
|
-
reconnect = status.rateLimited === true || status.status === "ACTIVE";
|
|
80657
|
-
if (!reconnect) {
|
|
80658
|
-
console.warn(
|
|
80659
|
-
`[SecureChannel] device_revoked confirmed by server (status=${status.status}) \u2014 terminal`
|
|
80660
|
-
);
|
|
80661
|
-
}
|
|
80662
|
-
} catch (err) {
|
|
80663
|
-
console.warn(
|
|
80664
|
-
"[SecureChannel] device_revoked status check failed; reconnecting (inconclusive):",
|
|
80665
|
-
err
|
|
80666
|
-
);
|
|
80667
|
-
reconnect = true;
|
|
81309
|
+
const standing = await this._readDeviceStanding();
|
|
81310
|
+
if (standing.kind === "suspended") {
|
|
81311
|
+
this._enterSuspendedWait("device_revoked");
|
|
81312
|
+
return;
|
|
80668
81313
|
}
|
|
80669
|
-
if (
|
|
80670
|
-
this.
|
|
80671
|
-
console.log(
|
|
80672
|
-
"[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
|
|
80673
|
-
);
|
|
80674
|
-
this._scheduleReconnect();
|
|
81314
|
+
if (standing.kind === "gone") {
|
|
81315
|
+
await this._terminalDeviceGone(standing.reason, "device_revoked");
|
|
80675
81316
|
return;
|
|
80676
81317
|
}
|
|
80677
|
-
|
|
81318
|
+
if (standing.kind === "unknown") {
|
|
81319
|
+
console.warn(
|
|
81320
|
+
`[SecureChannel] device_revoked status check inconclusive (${standing.why}); reconnecting`
|
|
81321
|
+
);
|
|
81322
|
+
}
|
|
81323
|
+
this._revokeRecoveries.push(now);
|
|
81324
|
+
console.log(
|
|
81325
|
+
"[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
|
|
81326
|
+
);
|
|
81327
|
+
this._scheduleReconnect();
|
|
80678
81328
|
}
|
|
80679
81329
|
/**
|
|
80680
81330
|
* Persist all ratchet session states to disk.
|
|
@@ -81474,7 +82124,7 @@ ${actionsText}`);
|
|
|
81474
82124
|
"use strict";
|
|
81475
82125
|
init_llm_response_parser();
|
|
81476
82126
|
init_llm_cost();
|
|
81477
|
-
traceStore = new
|
|
82127
|
+
traceStore = new AsyncLocalStorage3();
|
|
81478
82128
|
}
|
|
81479
82129
|
});
|
|
81480
82130
|
init_tool_audit = __esm2({
|
|
@@ -81497,6 +82147,7 @@ ${actionsText}`);
|
|
|
81497
82147
|
init_openclaw_compat();
|
|
81498
82148
|
init_lifecycle();
|
|
81499
82149
|
init_tool_audit();
|
|
82150
|
+
init_tool_telemetry();
|
|
81500
82151
|
init_harness_compat();
|
|
81501
82152
|
init_types();
|
|
81502
82153
|
managedRoutesRequested = false;
|
|
@@ -102222,7 +102873,8 @@ data:
|
|
|
102222
102873
|
await init_skill_telemetry();
|
|
102223
102874
|
await init_policy_enforcer();
|
|
102224
102875
|
init_room_protocol();
|
|
102225
|
-
|
|
102876
|
+
init_tool_telemetry();
|
|
102877
|
+
VERSION = true ? "0.23.54" : "0.0.0-dev";
|
|
102226
102878
|
}
|
|
102227
102879
|
});
|
|
102228
102880
|
await init_index();
|
|
@@ -102874,7 +103526,7 @@ var init_cli = __esm({
|
|
|
102874
103526
|
"use strict";
|
|
102875
103527
|
await init_dist();
|
|
102876
103528
|
init_driver();
|
|
102877
|
-
VERSION2 = "0.1.
|
|
103529
|
+
VERSION2 = "0.1.9";
|
|
102878
103530
|
HELP = `AgentVault OpenAI Bridge ${VERSION2}
|
|
102879
103531
|
Usage: AV_AGENT_NAME=<name> agentvault-openai-bridge <command>
|
|
102880
103532
|
|
|
@@ -103042,7 +103694,39 @@ ${text}`, controller.signal);
|
|
|
103042
103694
|
} catch {
|
|
103043
103695
|
}
|
|
103044
103696
|
}
|
|
103697
|
+
/** "Recent problems" (2026-10-26): every reply delivery is one
|
|
103698
|
+
* `ai.agent.tool.invoke` span (tool `reply` — this bridge has no say tool;
|
|
103699
|
+
* the model's text IS the post). Outcome, machine error code, duration and
|
|
103700
|
+
* the conversation only — never the text or an error message. Never throws. */
|
|
103701
|
+
reportReply(target, startedAt, failure2) {
|
|
103702
|
+
try {
|
|
103703
|
+
const sink = this.channel.telemetry;
|
|
103704
|
+
const kind = failure2 ? classifyToolError(failure2.err) : void 0;
|
|
103705
|
+
const outcome = !failure2 ? "success" : kind === "delivery_cancelled" ? "cancelled" : "error";
|
|
103706
|
+
reportToolInvoke(sink && typeof sink.reportCustomSpan === "function" ? sink : null, {
|
|
103707
|
+
toolName: "reply",
|
|
103708
|
+
outcome,
|
|
103709
|
+
errorKind: outcome === "error" ? kind : void 0,
|
|
103710
|
+
durationMs: Date.now() - startedAt,
|
|
103711
|
+
conversation: { kind: target.kind === "room" ? "room" : "direct", id: target.id }
|
|
103712
|
+
});
|
|
103713
|
+
} catch {
|
|
103714
|
+
}
|
|
103715
|
+
}
|
|
103045
103716
|
async deliver(target, text, signal) {
|
|
103717
|
+
const startedAt = Date.now();
|
|
103718
|
+
let cause;
|
|
103719
|
+
try {
|
|
103720
|
+
await this.deliverOnce(target, text, signal, (e) => {
|
|
103721
|
+
cause = e;
|
|
103722
|
+
});
|
|
103723
|
+
} catch (err) {
|
|
103724
|
+
this.reportReply(target, startedAt, { err: cause ?? err });
|
|
103725
|
+
throw err;
|
|
103726
|
+
}
|
|
103727
|
+
this.reportReply(target, startedAt);
|
|
103728
|
+
}
|
|
103729
|
+
async deliverOnce(target, text, signal, onSendError) {
|
|
103046
103730
|
const delivery = target.kind === "room" ? this.channel.sendToRoom(target.id, text) : this.channel.send(text, { conversationId: target.id });
|
|
103047
103731
|
await new Promise((resolve4, reject) => {
|
|
103048
103732
|
let settled = false;
|
|
@@ -103056,15 +103740,18 @@ ${text}`, controller.signal);
|
|
|
103056
103740
|
};
|
|
103057
103741
|
const abort = () => finish(new Error("Delivery cancelled"));
|
|
103058
103742
|
const timer = setTimeout(() => {
|
|
103743
|
+
finish(new Error("Delivery timed out"));
|
|
103059
103744
|
this.stopped = true;
|
|
103060
103745
|
this.invalidate();
|
|
103061
103746
|
this.report("delivery_timeout");
|
|
103062
|
-
finish(new Error("Delivery timed out"));
|
|
103063
103747
|
}, this.deliveryTimeoutMs);
|
|
103064
103748
|
signal.addEventListener("abort", abort, { once: true });
|
|
103065
103749
|
if (signal.aborted)
|
|
103066
103750
|
abort();
|
|
103067
|
-
delivery.then(() => finish(), () =>
|
|
103751
|
+
delivery.then(() => finish(), (e) => {
|
|
103752
|
+
onSendError(e);
|
|
103753
|
+
finish(new Error("Delivery failed"));
|
|
103754
|
+
});
|
|
103068
103755
|
});
|
|
103069
103756
|
}
|
|
103070
103757
|
async idle() {
|