@agentvault/grok-bridge 0.4.24 → 0.4.25
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 +10 -1
- package/dist/index.js +495 -96
- package/dist/service/self-uninstall.d.ts +30 -2
- package/dist/service/self-uninstall.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/bridge.d.ts
CHANGED
|
@@ -9,7 +9,12 @@
|
|
|
9
9
|
* Those are Claude-shaped; Grok's gate is the pre_tool_use hook and arrives with
|
|
10
10
|
* the tools-on posture.
|
|
11
11
|
*/
|
|
12
|
+
/** `RoomSession` is declared ONCE in this package, by grok-session.ts. The Claude
|
|
13
|
+
* bridge declares its own in its bridge.ts; that declaration was NOT copied.
|
|
14
|
+
* Type-only, so this cannot create a runtime import cycle. */
|
|
15
|
+
import { type ToolSpanSink } from "@agentvault/agentvault";
|
|
12
16
|
import type { RoomSession } from "./grok-session.js";
|
|
17
|
+
import { type TerminalVerdict } from "./service/self-uninstall.js";
|
|
13
18
|
export interface RoomMessage {
|
|
14
19
|
roomId: string;
|
|
15
20
|
senderName: string;
|
|
@@ -88,6 +93,9 @@ export type BridgeTarget = {
|
|
|
88
93
|
export interface ReplyChannel {
|
|
89
94
|
sendToRoom(roomId: string, text: string): Promise<void>;
|
|
90
95
|
send(text: string): Promise<void>;
|
|
96
|
+
/** SecureChannel's TelemetryReporter (device JWT, buffered). Optional so
|
|
97
|
+
* fixtures and a channel without telemetry keep working. */
|
|
98
|
+
readonly telemetry?: ToolSpanSink | null;
|
|
91
99
|
/** #1418 — SecureChannel: run `fn` as `conversationId`'s turn, so an
|
|
92
100
|
* untargeted send inside it reaches that conversation's person only. */
|
|
93
101
|
runForConversation?<T>(conversationId: string | undefined, fn: () => Promise<T>, opts?: {
|
|
@@ -125,6 +133,7 @@ export declare class ActiveTarget {
|
|
|
125
133
|
export interface LifecycleChannel {
|
|
126
134
|
on(ev: "auth_failed", cb: (e: {
|
|
127
135
|
reason: string;
|
|
136
|
+
deviceGone?: boolean;
|
|
128
137
|
}) => void): unknown;
|
|
129
138
|
on(ev: "session_replaced", cb: (e: {
|
|
130
139
|
code?: number;
|
|
@@ -157,7 +166,7 @@ export declare function attachLifecycle(channel: LifecycleChannel, opts?: {
|
|
|
157
166
|
* well would put the same rule in two files, and the two would eventually
|
|
158
167
|
* disagree — which is how `session_replaced` (device still alive) would end
|
|
159
168
|
* up removing a healthy install. */
|
|
160
|
-
selfUninstall?: (
|
|
169
|
+
selfUninstall?: (verdict: TerminalVerdict, env: NodeJS.ProcessEnv) => boolean;
|
|
161
170
|
}): void;
|
|
162
171
|
/**
|
|
163
172
|
* How a ROOM turn is announced to the model (#366 / #499 Facet A).
|
package/dist/index.js
CHANGED
|
@@ -38,12 +38,14 @@ import { homedir } from "node:os";
|
|
|
38
38
|
import { dirname, join as join4, resolve } from "node:path";
|
|
39
39
|
import { Writable } from "node:stream";
|
|
40
40
|
import { createInterface } from "node:readline";
|
|
41
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
42
|
+
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
41
43
|
import { Readable } from "node:stream";
|
|
42
44
|
import { readdir as readdir2, readFile as readFile4, writeFile as writeFile2, rename as rename4, stat, unlink, mkdir as mkdir3 } from "node:fs/promises";
|
|
43
45
|
import { join as join5 } from "node:path";
|
|
44
46
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
45
47
|
import { EventEmitter } from "node:events";
|
|
46
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
48
|
+
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
47
49
|
import { createServer } from "node:http";
|
|
48
50
|
import { randomUUID as randomUUID4, createHash } from "node:crypto";
|
|
49
51
|
import { readFileSync } from "node:fs";
|
|
@@ -53,7 +55,7 @@ import { join as join6 } from "node:path";
|
|
|
53
55
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
54
56
|
import WebSocket from "ws";
|
|
55
57
|
import { resolve as resolve2 } from "node:path";
|
|
56
|
-
import { AsyncLocalStorage as
|
|
58
|
+
import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
|
|
57
59
|
import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
|
|
58
60
|
import { Http2ServerRequest } from "http2";
|
|
59
61
|
import { Readable as Readable2 } from "stream";
|
|
@@ -9219,7 +9221,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
|
9219
9221
|
});
|
|
9220
9222
|
const { prehash } = eddsaOpts;
|
|
9221
9223
|
const { BASE, Fp: Fp3, Fn: Fn3 } = Point;
|
|
9222
|
-
const
|
|
9224
|
+
const randomBytes42 = eddsaOpts.randomBytes || randomBytes2;
|
|
9223
9225
|
const adjustScalarBytes3 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes);
|
|
9224
9226
|
const domain = eddsaOpts.domain || ((data, ctx, phflag) => {
|
|
9225
9227
|
_abool2(phflag, "phflag");
|
|
@@ -9301,7 +9303,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
|
|
9301
9303
|
signature: 2 * _size2,
|
|
9302
9304
|
seed: _size2
|
|
9303
9305
|
};
|
|
9304
|
-
function randomSecretKey(seed =
|
|
9306
|
+
function randomSecretKey(seed = randomBytes42(lengths.seed)) {
|
|
9305
9307
|
return _abytes2(seed, lengths.seed, "seed");
|
|
9306
9308
|
}
|
|
9307
9309
|
function keygen(seed) {
|
|
@@ -10680,7 +10682,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
|
|
|
10680
10682
|
bits2int: "function",
|
|
10681
10683
|
bits2int_modN: "function"
|
|
10682
10684
|
});
|
|
10683
|
-
const
|
|
10685
|
+
const randomBytes42 = ecdsaOpts.randomBytes || randomBytes2;
|
|
10684
10686
|
const hmac4 = ecdsaOpts.hmac || ((key, ...msgs) => hmac2(hash, key, concatBytes2(...msgs)));
|
|
10685
10687
|
const { Fp: Fp3, Fn: Fn3 } = Point;
|
|
10686
10688
|
const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn3;
|
|
@@ -10835,7 +10837,7 @@ function ecdsa(Point, hash, ecdsaOpts = {}) {
|
|
|
10835
10837
|
const d2 = _normFnElement(Fn3, privateKey);
|
|
10836
10838
|
const seedArgs = [int2octets(d2), int2octets(h1int)];
|
|
10837
10839
|
if (extraEntropy != null && extraEntropy !== false) {
|
|
10838
|
-
const e = extraEntropy === true ?
|
|
10840
|
+
const e = extraEntropy === true ? randomBytes42(lengths.secretKey) : extraEntropy;
|
|
10839
10841
|
seedArgs.push(ensureBytes("extraEntropy", e));
|
|
10840
10842
|
}
|
|
10841
10843
|
const seed = concatBytes2(...seedArgs);
|
|
@@ -11713,11 +11715,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11713
11715
|
return null;
|
|
11714
11716
|
}
|
|
11715
11717
|
function ownIdentity() {
|
|
11716
|
-
const v2 = true ? "0.23.
|
|
11718
|
+
const v2 = true ? "0.23.54" : FALLBACK;
|
|
11717
11719
|
return `${PACKAGE}@${v2}`;
|
|
11718
11720
|
}
|
|
11719
11721
|
function buildSha() {
|
|
11720
|
-
const raw = true ? "
|
|
11722
|
+
const raw = true ? "429977f" : "";
|
|
11721
11723
|
const cleaned = (raw ?? "").trim();
|
|
11722
11724
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
11723
11725
|
}
|
|
@@ -11869,13 +11871,18 @@ async function enrollDevice(apiUrl, inviteToken, identityPkHex, ephemeralPkHex,
|
|
|
11869
11871
|
return res.json();
|
|
11870
11872
|
}
|
|
11871
11873
|
async function pollDeviceStatus(apiUrl, deviceId) {
|
|
11872
|
-
const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status
|
|
11874
|
+
const res = await fetch(`${apiUrl}/api/v1/devices/${deviceId}/status`, {
|
|
11875
|
+
signal: AbortSignal.timeout(1e4)
|
|
11876
|
+
});
|
|
11873
11877
|
if (res.status === 429) {
|
|
11874
11878
|
return { device_id: deviceId, status: "PENDING", fingerprint: "", rateLimited: true };
|
|
11875
11879
|
}
|
|
11876
11880
|
if (!res.ok) {
|
|
11877
11881
|
const detail = await res.text();
|
|
11878
|
-
|
|
11882
|
+
const err = new Error(`Status poll failed (${res.status}): ${detail}`);
|
|
11883
|
+
err.httpStatus = res.status;
|
|
11884
|
+
err.body = detail;
|
|
11885
|
+
throw err;
|
|
11879
11886
|
}
|
|
11880
11887
|
return res.json();
|
|
11881
11888
|
}
|
|
@@ -11925,9 +11932,10 @@ function a2aChannelSignature(channels) {
|
|
|
11925
11932
|
})).sort((a2, b2) => (a2.id ?? "").localeCompare(b2.id ?? ""))
|
|
11926
11933
|
);
|
|
11927
11934
|
}
|
|
11928
|
-
function mlsMembershipFromStatus(status) {
|
|
11935
|
+
function mlsMembershipFromStatus(status, detail) {
|
|
11929
11936
|
if (status === 200) return true;
|
|
11930
|
-
if (status ===
|
|
11937
|
+
if (status === 404) return false;
|
|
11938
|
+
if (status === 403 && detail === NOT_A_MEMBER_DETAIL) return false;
|
|
11931
11939
|
return null;
|
|
11932
11940
|
}
|
|
11933
11941
|
function sanitizeError(error2) {
|
|
@@ -12495,6 +12503,91 @@ function _resetCompatCacheForTest() {
|
|
|
12495
12503
|
_agentEventFn = null;
|
|
12496
12504
|
_transcriptFn = null;
|
|
12497
12505
|
}
|
|
12506
|
+
function safeErrorKind(value) {
|
|
12507
|
+
if (typeof value !== "string") return UNCLASSIFIED_ERROR;
|
|
12508
|
+
if (KNOWN_CODES.has(value)) return value;
|
|
12509
|
+
if (!CLASS_NAME_RE.test(value)) return UNCLASSIFIED_ERROR;
|
|
12510
|
+
if ((value.match(/[0-9]/g) ?? []).length > 3) return UNCLASSIFIED_ERROR;
|
|
12511
|
+
return value;
|
|
12512
|
+
}
|
|
12513
|
+
function codeForText(text) {
|
|
12514
|
+
const t2 = text.replace(/^[A-Za-z]*Error: /, "");
|
|
12515
|
+
for (const [re2, code] of ERROR_TEXT_CODES) if (re2.test(t2)) return code;
|
|
12516
|
+
return void 0;
|
|
12517
|
+
}
|
|
12518
|
+
function classifyToolError(err) {
|
|
12519
|
+
try {
|
|
12520
|
+
if (err instanceof Error) {
|
|
12521
|
+
return codeForText(err.message) ?? safeErrorKind(err.constructor?.name);
|
|
12522
|
+
}
|
|
12523
|
+
if (typeof err === "string") return codeForText(err) ?? UNCLASSIFIED_ERROR;
|
|
12524
|
+
} catch {
|
|
12525
|
+
}
|
|
12526
|
+
return UNCLASSIFIED_ERROR;
|
|
12527
|
+
}
|
|
12528
|
+
function classifyDeliveryReceipt(receipt) {
|
|
12529
|
+
if (!receipt) return "no_receipt";
|
|
12530
|
+
if (receipt.ambiguous) return "ambiguous_target";
|
|
12531
|
+
if (typeof receipt.error === "string") return codeForText(receipt.error) ?? "delivery_failed";
|
|
12532
|
+
return "delivery_failed";
|
|
12533
|
+
}
|
|
12534
|
+
function currentToolConversation() {
|
|
12535
|
+
const store = _conversation.getStore();
|
|
12536
|
+
if (!store || store.ended) return { kind: "unknown" };
|
|
12537
|
+
return store.conversation;
|
|
12538
|
+
}
|
|
12539
|
+
function conversationForTarget(target, opts = {}) {
|
|
12540
|
+
if (typeof opts.conversationId === "string" && opts.conversationId) {
|
|
12541
|
+
return { kind: "direct", id: opts.conversationId };
|
|
12542
|
+
}
|
|
12543
|
+
const turn = currentToolConversation();
|
|
12544
|
+
if (!target || target.kind === "context") return turn;
|
|
12545
|
+
switch (target.kind) {
|
|
12546
|
+
case "room":
|
|
12547
|
+
return target.roomId ? { kind: "room", id: target.roomId } : { kind: "unknown" };
|
|
12548
|
+
case "owner":
|
|
12549
|
+
return turn.kind === "direct" ? turn : { kind: "unknown" };
|
|
12550
|
+
default:
|
|
12551
|
+
return { kind: "unknown" };
|
|
12552
|
+
}
|
|
12553
|
+
}
|
|
12554
|
+
function buildToolInvokeSpan(report) {
|
|
12555
|
+
const isError = report.outcome === "error";
|
|
12556
|
+
const outcome = isError ? "error" : report.outcome === "cancelled" ? "cancelled" : "success";
|
|
12557
|
+
const durationMs = Math.max(0, Math.round(Number(report.durationMs) || 0));
|
|
12558
|
+
const endTime = report.endTime ?? Date.now();
|
|
12559
|
+
const conv = report.conversation ?? currentToolConversation();
|
|
12560
|
+
const kind = conv.kind === "room" || conv.kind === "direct" ? conv.kind : "unknown";
|
|
12561
|
+
const attributes = {
|
|
12562
|
+
"tool.name": TOOL_NAME_RE.test(report.toolName) ? report.toolName : "unknown",
|
|
12563
|
+
"tool.outcome": outcome,
|
|
12564
|
+
"av.conversation_kind": kind,
|
|
12565
|
+
"tool.duration_ms": durationMs
|
|
12566
|
+
};
|
|
12567
|
+
if (isError) attributes["tool.error_kind"] = safeErrorKind(report.errorKind);
|
|
12568
|
+
if (kind !== "unknown" && typeof conv.id === "string" && conv.id) {
|
|
12569
|
+
attributes["av.conversation_id"] = conv.id.slice(0, 64);
|
|
12570
|
+
}
|
|
12571
|
+
return {
|
|
12572
|
+
traceId: randomBytes3(16).toString("hex"),
|
|
12573
|
+
spanId: randomBytes3(8).toString("hex"),
|
|
12574
|
+
name: TOOL_INVOKE_SPAN_NAME,
|
|
12575
|
+
kind: "internal",
|
|
12576
|
+
startTime: endTime - durationMs,
|
|
12577
|
+
endTime,
|
|
12578
|
+
attributes,
|
|
12579
|
+
// OTLP codes: 1 = ok, 2 = error (the backend stores "ok" / "error").
|
|
12580
|
+
// A cancellation is not a problem: OK status, outcome "cancelled".
|
|
12581
|
+
status: { code: isError ? 2 : 1 }
|
|
12582
|
+
};
|
|
12583
|
+
}
|
|
12584
|
+
function reportToolInvoke(sink, report) {
|
|
12585
|
+
try {
|
|
12586
|
+
if (!sink || typeof sink.reportCustomSpan !== "function") return;
|
|
12587
|
+
sink.reportCustomSpan(buildToolInvokeSpan(report));
|
|
12588
|
+
} catch {
|
|
12589
|
+
}
|
|
12590
|
+
}
|
|
12498
12591
|
function ownerRoutingFrom(parsed) {
|
|
12499
12592
|
const out = {};
|
|
12500
12593
|
if (parsed.conversation_id !== void 0) {
|
|
@@ -12519,6 +12612,34 @@ function statusOf(receipt) {
|
|
|
12519
12612
|
return receipt.ok ? 200 : 500;
|
|
12520
12613
|
}
|
|
12521
12614
|
async function handleSendRequest(parsed, channel) {
|
|
12615
|
+
const startedAt = Date.now();
|
|
12616
|
+
const result = await _handleSendRequest(parsed, channel);
|
|
12617
|
+
try {
|
|
12618
|
+
const body = result.body;
|
|
12619
|
+
const failed = body?.ok !== true;
|
|
12620
|
+
reportToolInvoke(channel.telemetry, {
|
|
12621
|
+
toolName: "agentvault_send",
|
|
12622
|
+
outcome: failed ? "error" : "success",
|
|
12623
|
+
errorKind: !failed ? void 0 : result.status === 400 ? "invalid_request" : result.status === 409 ? "ambiguous_target" : classifyDeliveryReceipt(body),
|
|
12624
|
+
durationMs: Date.now() - startedAt,
|
|
12625
|
+
conversation: sendConversation(parsed)
|
|
12626
|
+
});
|
|
12627
|
+
} catch {
|
|
12628
|
+
}
|
|
12629
|
+
return result;
|
|
12630
|
+
}
|
|
12631
|
+
function sendConversation(parsed) {
|
|
12632
|
+
const str = (v2) => typeof v2 === "string" && v2 ? v2 : void 0;
|
|
12633
|
+
if (str(parsed.hub_address) ?? str(parsed.a2a_address) ?? str(parsed.a2aAddress) ?? str(parsed.channel_id)) {
|
|
12634
|
+
return { kind: "unknown" };
|
|
12635
|
+
}
|
|
12636
|
+
const roomId = str(parsed.room_id);
|
|
12637
|
+
if (roomId) return conversationForTarget({ kind: "room", roomId });
|
|
12638
|
+
if (parsed.target === "context") return conversationForTarget({ kind: "context" });
|
|
12639
|
+
if (parsed.audience === "everyone") return { kind: "unknown" };
|
|
12640
|
+
return conversationForTarget({ kind: "owner" }, { conversationId: str(parsed.conversation_id) });
|
|
12641
|
+
}
|
|
12642
|
+
async function _handleSendRequest(parsed, channel) {
|
|
12522
12643
|
const text = parsed.text;
|
|
12523
12644
|
if (!text || typeof text !== "string") {
|
|
12524
12645
|
return { status: 400, body: { ok: false, error: "Missing 'text' field" } };
|
|
@@ -17681,7 +17802,7 @@ function armSseKeepAlive(intervalMs, onTick) {
|
|
|
17681
17802
|
timer.unref?.();
|
|
17682
17803
|
return timer;
|
|
17683
17804
|
}
|
|
17684
|
-
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_exports, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, AGENT_EVENT_CANDIDATES, TRANSCRIPT_CANDIDATES, _heartbeatFn, _agentEventFn, _transcriptFn, init_openclaw_compat, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
|
|
17805
|
+
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_exports, 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;
|
|
17685
17806
|
var init_dist = __esm({
|
|
17686
17807
|
async "../plugin/dist/index.js"() {
|
|
17687
17808
|
"use strict";
|
|
@@ -70153,6 +70274,7 @@ var init_dist = __esm({
|
|
|
70153
70274
|
init_mls_membership_probe = __esm2({
|
|
70154
70275
|
"src/mls-membership-probe.ts"() {
|
|
70155
70276
|
"use strict";
|
|
70277
|
+
NOT_A_MEMBER_DETAIL = "Not authorized for this MLS group";
|
|
70156
70278
|
}
|
|
70157
70279
|
});
|
|
70158
70280
|
init_history_backup_scheduler = __esm2({
|
|
@@ -70671,6 +70793,55 @@ var init_dist = __esm({
|
|
|
70671
70793
|
_transcriptFn = null;
|
|
70672
70794
|
}
|
|
70673
70795
|
});
|
|
70796
|
+
init_tool_telemetry = __esm2({
|
|
70797
|
+
"src/tool-telemetry.ts"() {
|
|
70798
|
+
"use strict";
|
|
70799
|
+
TOOL_INVOKE_SPAN_NAME = "ai.agent.tool.invoke";
|
|
70800
|
+
UNCLASSIFIED_ERROR = "unclassified";
|
|
70801
|
+
KNOWN_TOOL_ERROR_CODES = [
|
|
70802
|
+
"relay_not_connected",
|
|
70803
|
+
"mls_group_not_initialized",
|
|
70804
|
+
"mls_encrypt_failed",
|
|
70805
|
+
"room_not_found",
|
|
70806
|
+
"a2a_channel_not_found",
|
|
70807
|
+
"channel_not_ready",
|
|
70808
|
+
"channel_not_started",
|
|
70809
|
+
"no_active_sessions",
|
|
70810
|
+
"no_conversation_ready",
|
|
70811
|
+
"blocked_by_policy",
|
|
70812
|
+
"unknown_target",
|
|
70813
|
+
"unsupported_destination",
|
|
70814
|
+
"delivery_timeout",
|
|
70815
|
+
"delivery_cancelled",
|
|
70816
|
+
"delivery_failed",
|
|
70817
|
+
"ambiguous_target",
|
|
70818
|
+
"no_receipt",
|
|
70819
|
+
"invalid_request",
|
|
70820
|
+
UNCLASSIFIED_ERROR
|
|
70821
|
+
];
|
|
70822
|
+
KNOWN_CODES = new Set(KNOWN_TOOL_ERROR_CODES);
|
|
70823
|
+
CLASS_NAME_RE = /^(?:[A-Za-z][A-Za-z0-9_]{0,47})?(?:Error|Exception)$/;
|
|
70824
|
+
TOOL_NAME_RE = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
70825
|
+
ERROR_TEXT_CODES = [
|
|
70826
|
+
[/relay socket is not open/, "relay_not_connected"],
|
|
70827
|
+
[/has no initialized MLS group/, "mls_group_not_initialized"],
|
|
70828
|
+
[/^MLS encrypt failed/, "mls_encrypt_failed"],
|
|
70829
|
+
[/^Room .+ not found$/, "room_not_found"],
|
|
70830
|
+
[/^No A2A channel found|^A2A channel .+ not found$/, "a2a_channel_not_found"],
|
|
70831
|
+
[/^Channel is not ready$|^Channel is in \w+ state$/, "channel_not_ready"],
|
|
70832
|
+
[/^AgentVault channel not connected$|^Channel not started$/, "channel_not_started"],
|
|
70833
|
+
[/^No active sessions$/, "no_active_sessions"],
|
|
70834
|
+
[/^No conversation is ready to receive/, "no_conversation_ready"],
|
|
70835
|
+
[/^Message blocked by scan rule/, "blocked_by_policy"],
|
|
70836
|
+
[/^Unknown target kind$/, "unknown_target"],
|
|
70837
|
+
[/can only be sent to owner|cannot be sent to A2A targets/, "unsupported_destination"],
|
|
70838
|
+
[/^Delivery timed out$/, "delivery_timeout"],
|
|
70839
|
+
[/^Delivery cancelled$/, "delivery_cancelled"],
|
|
70840
|
+
[/^Delivery failed$/, "delivery_failed"]
|
|
70841
|
+
];
|
|
70842
|
+
_conversation = new AsyncLocalStorage();
|
|
70843
|
+
}
|
|
70844
|
+
});
|
|
70674
70845
|
http_handlers_exports = {};
|
|
70675
70846
|
__export2(http_handlers_exports, {
|
|
70676
70847
|
handleActionRequest: () => handleActionRequest,
|
|
@@ -70685,6 +70856,7 @@ var init_dist = __esm({
|
|
|
70685
70856
|
"src/http-handlers.ts"() {
|
|
70686
70857
|
"use strict";
|
|
70687
70858
|
init_owner_routing();
|
|
70859
|
+
init_tool_telemetry();
|
|
70688
70860
|
}
|
|
70689
70861
|
});
|
|
70690
70862
|
mcp_proxy_helpers_exports = {};
|
|
@@ -70765,7 +70937,7 @@ var init_dist = __esm({
|
|
|
70765
70937
|
OUTBOUND_DEDUPE_TYPES = /* @__PURE__ */ new Set(["text", "status_alert", "artifact", "attachment"]);
|
|
70766
70938
|
RETRY_CANDIDATE_TTL_MS = 6e4;
|
|
70767
70939
|
RETRY_CANDIDATE_MAX = 32;
|
|
70768
|
-
_turnConversation = new
|
|
70940
|
+
_turnConversation = new AsyncLocalStorage2();
|
|
70769
70941
|
PERSON_INVOLVED_WINDOW_MS = 5 * 6e4;
|
|
70770
70942
|
ATTESTED_INBOUND_MAX = 64;
|
|
70771
70943
|
UNMAPPED_RECONCILE_COOLDOWN_MS = 6e4;
|
|
@@ -71132,6 +71304,119 @@ ${text}`;
|
|
|
71132
71304
|
console.warn("[SecureChannel] failed to post auth_failed:", err);
|
|
71133
71305
|
}
|
|
71134
71306
|
}
|
|
71307
|
+
/**
|
|
71308
|
+
* Ask the PUBLIC status endpoint what this device is right now. Used to
|
|
71309
|
+
* CONFIRM a credential rejection before acting on it — a 403 on its own
|
|
71310
|
+
* cannot tell "revoked" from "paused by its owner" (both are non-ACTIVE to
|
|
71311
|
+
* get_device_auth), and treating a pause as a revoke is what removed
|
|
71312
|
+
* loopita's launchd service on 2026-10-25.
|
|
71313
|
+
*
|
|
71314
|
+
* Only two answers are terminal: REVOKED, and a deleted row (404 whose
|
|
71315
|
+
* JSON `detail` is exactly get_device_or_404's "Device not found" — any
|
|
71316
|
+
* other 404 is something in the way, not proof). Everything unreadable or inconclusive (network, 5xx, 429,
|
|
71317
|
+
* PENDING, an ACTIVE device answering 403) is `unknown`, which callers MUST
|
|
71318
|
+
* treat as transient: never terminal, never an uninstall, never a banner.
|
|
71319
|
+
*/
|
|
71320
|
+
async _readDeviceStanding() {
|
|
71321
|
+
const deviceId = this._deviceId ?? this._persisted?.deviceId;
|
|
71322
|
+
if (!deviceId) return { kind: "unknown", why: "no device id" };
|
|
71323
|
+
try {
|
|
71324
|
+
const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
|
|
71325
|
+
if (!st || st.rateLimited) return { kind: "unknown", why: "rate limited" };
|
|
71326
|
+
if (st.status === "SUSPENDED") return { kind: "suspended" };
|
|
71327
|
+
if (st.status === "REVOKED") return { kind: "gone", reason: "device_revoked" };
|
|
71328
|
+
if (st.status === "ACTIVE" || st.status === "APPROVED") return { kind: "active" };
|
|
71329
|
+
return { kind: "unknown", why: `status ${String(st.status)}` };
|
|
71330
|
+
} catch (err) {
|
|
71331
|
+
const e = err;
|
|
71332
|
+
if (e?.httpStatus === 404) {
|
|
71333
|
+
try {
|
|
71334
|
+
const parsed = JSON.parse(e.body ?? "");
|
|
71335
|
+
if (parsed?.detail === _SecureChannel.DEVICE_DELETED_DETAIL) {
|
|
71336
|
+
return { kind: "gone", reason: "device_deleted" };
|
|
71337
|
+
}
|
|
71338
|
+
} catch {
|
|
71339
|
+
}
|
|
71340
|
+
}
|
|
71341
|
+
return { kind: "unknown", why: err instanceof Error ? err.message : String(err) };
|
|
71342
|
+
}
|
|
71343
|
+
}
|
|
71344
|
+
/**
|
|
71345
|
+
* A credential path answered 403 (today: /auth/reissue). Confirm before
|
|
71346
|
+
* concluding anything:
|
|
71347
|
+
* - REVOKED / deleted -> terminal: re_enroll health report + `auth_failed`
|
|
71348
|
+
* carrying `deviceGone: true` (the ONLY verdict the
|
|
71349
|
+
* bridges' self-uninstall acts on).
|
|
71350
|
+
* - SUSPENDED -> suspended-wait (idle, keep polling, resume).
|
|
71351
|
+
* - anything else -> transient; nothing is emitted or reported.
|
|
71352
|
+
* Already paused => stay paused without another status read: the
|
|
71353
|
+
* suspended-wait poll owns that question and will see a later revoke.
|
|
71354
|
+
*/
|
|
71355
|
+
async _confirmForbidden(source) {
|
|
71356
|
+
if (this._suspended) return "suspended";
|
|
71357
|
+
const standing = await this._readDeviceStanding();
|
|
71358
|
+
if (standing.kind === "gone") {
|
|
71359
|
+
console.warn(
|
|
71360
|
+
`[SecureChannel] ${source}: 403 confirmed by the status endpoint (${standing.reason}) \u2014 terminal`
|
|
71361
|
+
);
|
|
71362
|
+
this._authFailedThisSession = true;
|
|
71363
|
+
await this._postAuthFailedToBackend(standing.reason);
|
|
71364
|
+
this.emit("auth_failed", { reason: standing.reason, deviceGone: true });
|
|
71365
|
+
return "gone";
|
|
71366
|
+
}
|
|
71367
|
+
if (standing.kind === "suspended") {
|
|
71368
|
+
this._enterSuspendedWait(source);
|
|
71369
|
+
return "suspended";
|
|
71370
|
+
}
|
|
71371
|
+
console.warn(
|
|
71372
|
+
`[SecureChannel] ${source}: 403 but the device is not confirmed revoked (${standing.kind === "unknown" ? standing.why : standing.kind}) \u2014 treating as transient`
|
|
71373
|
+
);
|
|
71374
|
+
return "transient";
|
|
71375
|
+
}
|
|
71376
|
+
/** The backend's exact detail for an inactive (paused/revoked/deleted) device. */
|
|
71377
|
+
static INACTIVE_DEVICE_DETAIL = "Device not found or not active";
|
|
71378
|
+
/** get_device_or_404's exact detail — the only 404 that means "row deleted". */
|
|
71379
|
+
static DEVICE_DELETED_DETAIL = "Device not found";
|
|
71380
|
+
/**
|
|
71381
|
+
* After a TRANSIENT inactive-403 verdict, how long before another 403 may
|
|
71382
|
+
* re-read the status endpoint. Long enough that a burst cannot trip the
|
|
71383
|
+
* 1-per-5s limiter (which would itself read as "unknown"); short enough that
|
|
71384
|
+
* a revoke behind an outage is still noticed within the session (dr-evil Q1).
|
|
71385
|
+
*/
|
|
71386
|
+
static INACTIVE_403_RECHECK_MS = 3e4;
|
|
71387
|
+
/** Read a FastAPI error `detail` without consuming the caller's body. */
|
|
71388
|
+
async _errorDetail(resp) {
|
|
71389
|
+
try {
|
|
71390
|
+
const body = await resp.clone().json();
|
|
71391
|
+
return typeof body?.detail === "string" ? body.detail : null;
|
|
71392
|
+
} catch {
|
|
71393
|
+
return null;
|
|
71394
|
+
}
|
|
71395
|
+
}
|
|
71396
|
+
// One confirmation per WS session, shared by every caller: a burst of 403s
|
|
71397
|
+
// (the open handler fires several REST calls at once) must not turn into a
|
|
71398
|
+
// burst of status reads against a 1-per-5s rate limit. Reset in _connect.
|
|
71399
|
+
_inactive403Check = null;
|
|
71400
|
+
_inactive403RetryAt = 0;
|
|
71401
|
+
/**
|
|
71402
|
+
* A REST call answered 403 "Device not found or not active". With the
|
|
71403
|
+
* companion backend change this is how EVERY inactive-device auth failure
|
|
71404
|
+
* arrives (401 now means a bad token only, so `_authedFetch`'s reissue never
|
|
71405
|
+
* runs for it). Same rule as the reissue path: confirm, then act.
|
|
71406
|
+
*/
|
|
71407
|
+
_confirmInactive403(source) {
|
|
71408
|
+
if (this._inactive403Check) return this._inactive403Check;
|
|
71409
|
+
if (Date.now() < this._inactive403RetryAt) return Promise.resolve("transient");
|
|
71410
|
+
const check = this._confirmForbidden(source).then((verdict) => {
|
|
71411
|
+
if (verdict === "transient" && this._inactive403Check === check) {
|
|
71412
|
+
this._inactive403Check = null;
|
|
71413
|
+
this._inactive403RetryAt = Date.now() + _SecureChannel.INACTIVE_403_RECHECK_MS;
|
|
71414
|
+
}
|
|
71415
|
+
return verdict;
|
|
71416
|
+
});
|
|
71417
|
+
this._inactive403Check = check;
|
|
71418
|
+
return check;
|
|
71419
|
+
}
|
|
71135
71420
|
/**
|
|
71136
71421
|
* Proactively reissue the persisted device JWT when its remaining lifetime
|
|
71137
71422
|
* is under 30 days. Called before each WebSocket connect attempt so the
|
|
@@ -71150,6 +71435,9 @@ ${text}`;
|
|
|
71150
71435
|
* than read back off `_authFailedThisSession`, whose lifetime is reset per
|
|
71151
71436
|
* connect and is easy to get subtly wrong.
|
|
71152
71437
|
*/
|
|
71438
|
+
//
|
|
71439
|
+
// 2026-10-25: a TRUE return now also covers "paused by its owner" (a 403
|
|
71440
|
+
// confirmed SUSPENDED). The caller tells the two apart by `_suspended`.
|
|
71153
71441
|
async _maybeReissueDeviceJwt() {
|
|
71154
71442
|
const jwt = this._persisted?.deviceJwt ?? this._deviceJwt;
|
|
71155
71443
|
if (!jwt) return false;
|
|
@@ -71177,12 +71465,16 @@ ${text}`;
|
|
|
71177
71465
|
}
|
|
71178
71466
|
return false;
|
|
71179
71467
|
}
|
|
71180
|
-
if (resp.status ===
|
|
71468
|
+
if (resp.status === 403) {
|
|
71469
|
+
console.warn("[SecureChannel] reissue rejected (403); confirming device status");
|
|
71470
|
+
const verdict = await this._confirmForbidden("reissue_forbidden");
|
|
71471
|
+
return verdict !== "transient";
|
|
71472
|
+
}
|
|
71473
|
+
if (resp.status === 401) {
|
|
71181
71474
|
console.warn(`[SecureChannel] reissue rejected (${resp.status}); credentials need attention`);
|
|
71182
71475
|
this._authFailedThisSession = true;
|
|
71183
|
-
|
|
71184
|
-
|
|
71185
|
-
this.emit("auth_failed", { reason });
|
|
71476
|
+
await this._postAuthFailedToBackend("device_jwt_expired");
|
|
71477
|
+
this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
|
|
71186
71478
|
return true;
|
|
71187
71479
|
}
|
|
71188
71480
|
console.warn(`[SecureChannel] reissue ${resp.status}; keeping current jwt`);
|
|
@@ -71241,13 +71533,17 @@ ${text}`;
|
|
|
71241
71533
|
};
|
|
71242
71534
|
resp = await fetch(url2, { ...init, headers: retryHeaders });
|
|
71243
71535
|
}
|
|
71244
|
-
} else if (reissueResp.status ===
|
|
71536
|
+
} else if (reissueResp.status === 403) {
|
|
71537
|
+
await this._confirmForbidden("reissue_forbidden");
|
|
71538
|
+
} else if (reissueResp.status === 401) {
|
|
71245
71539
|
this._authFailedThisSession = true;
|
|
71246
|
-
|
|
71247
|
-
|
|
71248
|
-
this.emit("auth_failed", { reason });
|
|
71540
|
+
await this._postAuthFailedToBackend("device_jwt_expired");
|
|
71541
|
+
this.emit("auth_failed", { reason: "device_jwt_expired", deviceGone: false });
|
|
71249
71542
|
}
|
|
71250
71543
|
}
|
|
71544
|
+
if (resp.status === 403 && await this._errorDetail(resp) === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
|
|
71545
|
+
await this._confirmInactive403("rest_forbidden");
|
|
71546
|
+
}
|
|
71251
71547
|
return resp;
|
|
71252
71548
|
}
|
|
71253
71549
|
get state() {
|
|
@@ -72933,7 +73229,7 @@ ${text}`;
|
|
|
72933
73229
|
*/
|
|
72934
73230
|
sendActivitySpan(spanData) {
|
|
72935
73231
|
if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
|
|
72936
|
-
const pluginVersion = true ? "0.23.
|
|
73232
|
+
const pluginVersion = true ? "0.23.54" : "0.0.0-dev";
|
|
72937
73233
|
const agentName = this.config.agentName ?? "Agent";
|
|
72938
73234
|
const resource = {
|
|
72939
73235
|
"service.name": "agentvault-agent",
|
|
@@ -73301,15 +73597,27 @@ ${text}`;
|
|
|
73301
73597
|
*/
|
|
73302
73598
|
async _quarantineOrphanedMlsGroups() {
|
|
73303
73599
|
if (!this._deviceJwt) return;
|
|
73600
|
+
let deviceActive = null;
|
|
73601
|
+
const confirmDeviceActive = () => deviceActive ??= this._readDeviceStanding().then((st) => st.kind === "active");
|
|
73304
73602
|
const quarantined = await quarantineOrphanedMlsState(
|
|
73305
73603
|
this.config.dataDir,
|
|
73306
73604
|
async (groupId) => {
|
|
73307
73605
|
try {
|
|
73606
|
+
if (this._suspended) return null;
|
|
73308
73607
|
const res = await fetch(
|
|
73309
73608
|
`${this.config.apiUrl}/api/v1/mls/groups/${encodeURIComponent(groupId)}`,
|
|
73310
73609
|
{ headers: { Authorization: `Bearer ${this._deviceJwt}` } }
|
|
73311
73610
|
);
|
|
73312
|
-
|
|
73611
|
+
const detail = res.status === 403 ? await this._errorDetail(res) : null;
|
|
73612
|
+
if (detail === _SecureChannel.INACTIVE_DEVICE_DETAIL) {
|
|
73613
|
+
await this._confirmInactive403("mls_probe");
|
|
73614
|
+
return null;
|
|
73615
|
+
}
|
|
73616
|
+
const verdict = mlsMembershipFromStatus(res.status, detail);
|
|
73617
|
+
if (verdict === false && res.status === 403) {
|
|
73618
|
+
if (!await confirmDeviceActive() || this._suspended) return null;
|
|
73619
|
+
}
|
|
73620
|
+
return verdict;
|
|
73313
73621
|
} catch {
|
|
73314
73622
|
return null;
|
|
73315
73623
|
}
|
|
@@ -75044,6 +75352,8 @@ ${text}`;
|
|
|
75044
75352
|
async _connect() {
|
|
75045
75353
|
if (this._stopped) return;
|
|
75046
75354
|
this._reissueAttempted = false;
|
|
75355
|
+
this._inactive403Check = null;
|
|
75356
|
+
this._inactive403RetryAt = 0;
|
|
75047
75357
|
this._authFailedThisSession = false;
|
|
75048
75358
|
if (this._reconnectTimer) {
|
|
75049
75359
|
clearTimeout(this._reconnectTimer);
|
|
@@ -75059,6 +75369,10 @@ ${text}`;
|
|
|
75059
75369
|
}
|
|
75060
75370
|
this._setState("connecting");
|
|
75061
75371
|
if (await this._maybeReissueDeviceJwt()) {
|
|
75372
|
+
if (this._suspended) {
|
|
75373
|
+
console.log("[SecureChannel] device is paused \u2014 not connecting until it is resumed");
|
|
75374
|
+
return;
|
|
75375
|
+
}
|
|
75062
75376
|
console.warn(
|
|
75063
75377
|
"[SecureChannel] credentials are terminally dead \u2014 aborting connect (no WS attempt)"
|
|
75064
75378
|
);
|
|
@@ -75069,16 +75383,26 @@ ${text}`;
|
|
|
75069
75383
|
const url2 = `${wsUrl}/api/v1/ws?token=${encodeURIComponent(this._deviceJwt)}&device_id=${this._deviceId}&client_version=${encodeURIComponent(buildClientVersion(this.config.clientVersion))}`;
|
|
75070
75384
|
const ws = new WebSocket(url2);
|
|
75071
75385
|
this._ws = ws;
|
|
75386
|
+
const served = this._createServedGate();
|
|
75072
75387
|
ws.on("open", async () => {
|
|
75073
75388
|
try {
|
|
75074
|
-
this._reconnectAttempt = 0;
|
|
75075
75389
|
this._lastWsOpenTime = Date.now();
|
|
75076
75390
|
this._startPing(ws);
|
|
75077
75391
|
this._startWakeDetector();
|
|
75392
|
+
if (!await served.wait()) {
|
|
75393
|
+
console.log("[SecureChannel] connection rejected before it was served \u2014 skipping connect-time work");
|
|
75394
|
+
return;
|
|
75395
|
+
}
|
|
75396
|
+
const aborted2 = () => this._stopped || this._suspended || this._ws !== ws || served.rejected;
|
|
75397
|
+
if (aborted2()) return;
|
|
75398
|
+
this._reconnectAttempt = 0;
|
|
75078
75399
|
this._startPendingPoll();
|
|
75079
75400
|
await this._syncMissedMessages();
|
|
75401
|
+
if (aborted2()) return;
|
|
75080
75402
|
await this._pullDrDeliveryQueue();
|
|
75403
|
+
if (aborted2()) return;
|
|
75081
75404
|
await this._flushOutboundQueue();
|
|
75405
|
+
if (aborted2()) return;
|
|
75082
75406
|
this._setState("ready");
|
|
75083
75407
|
void this._reconcileConversationGroups().catch((err) => {
|
|
75084
75408
|
console.warn("[SecureChannel] Conversation-group reconcile failed:", err);
|
|
@@ -75110,7 +75434,7 @@ ${text}`;
|
|
|
75110
75434
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
75111
75435
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
75112
75436
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
75113
|
-
pluginVersion: true ? "0.23.
|
|
75437
|
+
pluginVersion: true ? "0.23.54" : "0.0.0-dev"
|
|
75114
75438
|
});
|
|
75115
75439
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
75116
75440
|
}
|
|
@@ -75118,6 +75442,7 @@ ${text}`;
|
|
|
75118
75442
|
await this.listA2AChannels().catch((err) => {
|
|
75119
75443
|
console.warn("[SecureChannel] A2A channel sync on connect failed:", err);
|
|
75120
75444
|
});
|
|
75445
|
+
if (aborted2()) return;
|
|
75121
75446
|
await this._ensureKpPoolPublished();
|
|
75122
75447
|
this._startKpReplenishTimer();
|
|
75123
75448
|
this._pullDeliveryQueue().catch((err) => {
|
|
@@ -75179,6 +75504,8 @@ ${text}`;
|
|
|
75179
75504
|
this._lastWakeTick = Date.now();
|
|
75180
75505
|
try {
|
|
75181
75506
|
const data = JSON.parse(raw.toString());
|
|
75507
|
+
if (data?.event === "connection_rejected") served.markRejected();
|
|
75508
|
+
else served.markServed();
|
|
75182
75509
|
if (data.event && data.event !== "ping" && data.event !== "typing") {
|
|
75183
75510
|
const d2 = data.data ?? {};
|
|
75184
75511
|
const conv = (data.conversation_id || d2.conversation_id || "").toString();
|
|
@@ -75438,7 +75765,7 @@ ${text}`;
|
|
|
75438
75765
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
75439
75766
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
75440
75767
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
75441
|
-
pluginVersion: true ? "0.23.
|
|
75768
|
+
pluginVersion: true ? "0.23.54" : "0.0.0-dev"
|
|
75442
75769
|
});
|
|
75443
75770
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
75444
75771
|
}
|
|
@@ -75807,6 +76134,7 @@ ${text}`;
|
|
|
75807
76134
|
});
|
|
75808
76135
|
ws.on("close", (code) => {
|
|
75809
76136
|
this._lastCloseCode = typeof code === "number" ? code : null;
|
|
76137
|
+
served.markRejected();
|
|
75810
76138
|
this._stopPing();
|
|
75811
76139
|
this._stopWakeDetector();
|
|
75812
76140
|
this._stopPendingPoll();
|
|
@@ -79896,7 +80224,7 @@ ${baseText}`;
|
|
|
79896
80224
|
);
|
|
79897
80225
|
this._authFailedThisSession = true;
|
|
79898
80226
|
this._setState("error");
|
|
79899
|
-
this.emit("auth_failed", { reason: "ws_auth_rejected" });
|
|
80227
|
+
this.emit("auth_failed", { reason: "ws_auth_rejected", deviceGone: false });
|
|
79900
80228
|
return;
|
|
79901
80229
|
}
|
|
79902
80230
|
if (lastCode === 4e3) {
|
|
@@ -79935,7 +80263,7 @@ ${baseText}`;
|
|
|
79935
80263
|
this._state = newState;
|
|
79936
80264
|
this.emit("state", newState);
|
|
79937
80265
|
this.config.onStateChange?.(newState);
|
|
79938
|
-
if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt) {
|
|
80266
|
+
if (newState === "disconnected" && !this._pollFallbackTimer && this._deviceJwt && !this._suspended) {
|
|
79939
80267
|
this._startPollFallback();
|
|
79940
80268
|
}
|
|
79941
80269
|
if (newState === "ready" || newState === "error" || this._stopped) {
|
|
@@ -80072,8 +80400,10 @@ ${baseText}`;
|
|
|
80072
80400
|
* blindly. We ask the PUBLIC /devices/{id}/status endpoint (no JWT needed, so
|
|
80073
80401
|
* it answers even when our device JWT is being rejected):
|
|
80074
80402
|
* - ACTIVE -> reconnect in place (transient); stay online.
|
|
80075
|
-
* -
|
|
80076
|
-
* -
|
|
80403
|
+
* - SUSPENDED -> suspended-wait (owner paused it; resume later).
|
|
80404
|
+
* - REVOKED/deleted -> terminal via `_terminalDeviceGone` (auth_failed with
|
|
80405
|
+
* deviceGone: the bridges exit and remove their service).
|
|
80406
|
+
* - anything else / unreachable / 429 -> reconnect (inconclusive; a network blip shouldn't
|
|
80077
80407
|
* permanently kill a healthy agent — the WS is down too,
|
|
80078
80408
|
* so normal backoff handles it, and the war cap bounds
|
|
80079
80409
|
* thrash if the device really is dead).
|
|
@@ -80113,10 +80443,58 @@ ${baseText}`;
|
|
|
80113
80443
|
}
|
|
80114
80444
|
this._authFailedThisSession = true;
|
|
80115
80445
|
const authReason = data?.reason ?? "unknown";
|
|
80446
|
+
const standing = await this._readDeviceStanding();
|
|
80447
|
+
if (standing.kind === "suspended") {
|
|
80448
|
+
this._authFailedThisSession = false;
|
|
80449
|
+
this._enterSuspendedWait("connection_rejected");
|
|
80450
|
+
return;
|
|
80451
|
+
}
|
|
80452
|
+
const deviceGone = standing.kind === "gone";
|
|
80116
80453
|
console.warn(
|
|
80117
|
-
`[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed`
|
|
80454
|
+
`[SecureChannel] connection_rejected (reason=${data?.reason ?? "unknown"}, retryable=false) \u2014 terminal; surfacing auth_failed (deviceGone=${deviceGone})`
|
|
80118
80455
|
);
|
|
80119
|
-
this.emit("auth_failed", { reason: authReason });
|
|
80456
|
+
this.emit("auth_failed", { reason: authReason, deviceGone });
|
|
80457
|
+
}
|
|
80458
|
+
/**
|
|
80459
|
+
* How long an opened socket may stay silent before we treat it as served.
|
|
80460
|
+
* The backend's reject_connection sends `connection_rejected` immediately
|
|
80461
|
+
* after the accept, so a refused socket's first frame lands well inside
|
|
80462
|
+
* this; a served agent with a hub gets `hub_identity_sync` sooner still.
|
|
80463
|
+
*/
|
|
80464
|
+
static OPEN_SETTLE_MS = 1500;
|
|
80465
|
+
/**
|
|
80466
|
+
* Per-socket "has the server agreed to serve this session?" latch. Settles
|
|
80467
|
+
* once: served on the first non-rejection frame or when the settle window
|
|
80468
|
+
* passes quietly; rejected on `connection_rejected` or a close first.
|
|
80469
|
+
* `rejected` stays readable afterwards so long open-handler work can bail.
|
|
80470
|
+
*/
|
|
80471
|
+
_createServedGate() {
|
|
80472
|
+
let verdict = null;
|
|
80473
|
+
let rejected = false;
|
|
80474
|
+
let timer = null;
|
|
80475
|
+
const waiters = [];
|
|
80476
|
+
const settle2 = (ok) => {
|
|
80477
|
+
if (!ok) rejected = true;
|
|
80478
|
+
if (verdict !== null) return;
|
|
80479
|
+
verdict = ok;
|
|
80480
|
+
if (timer) {
|
|
80481
|
+
clearTimeout(timer);
|
|
80482
|
+
timer = null;
|
|
80483
|
+
}
|
|
80484
|
+
for (const w2 of waiters.splice(0)) w2(ok);
|
|
80485
|
+
};
|
|
80486
|
+
return {
|
|
80487
|
+
wait: () => {
|
|
80488
|
+
if (verdict !== null) return Promise.resolve(verdict && !rejected);
|
|
80489
|
+
if (!timer) timer = setTimeout(() => settle2(true), _SecureChannel.OPEN_SETTLE_MS);
|
|
80490
|
+
return new Promise((resolve4) => waiters.push(resolve4));
|
|
80491
|
+
},
|
|
80492
|
+
markServed: () => settle2(true),
|
|
80493
|
+
markRejected: () => settle2(false),
|
|
80494
|
+
get rejected() {
|
|
80495
|
+
return rejected;
|
|
80496
|
+
}
|
|
80497
|
+
};
|
|
80120
80498
|
}
|
|
80121
80499
|
// --- Owner pause (device SUSPENDED) — NON-final ---------------------------
|
|
80122
80500
|
//
|
|
@@ -80141,6 +80519,7 @@ ${baseText}`;
|
|
|
80141
80519
|
this._reconnectTimer = null;
|
|
80142
80520
|
}
|
|
80143
80521
|
this._rapidDisconnects = 0;
|
|
80522
|
+
this._stopPollFallback();
|
|
80144
80523
|
if (!this._suspended) {
|
|
80145
80524
|
this._suspended = true;
|
|
80146
80525
|
console.log(
|
|
@@ -80167,30 +80546,40 @@ ${baseText}`;
|
|
|
80167
80546
|
}
|
|
80168
80547
|
async _pollWhileSuspended() {
|
|
80169
80548
|
if (this._stopped || !this._suspended) return;
|
|
80170
|
-
const
|
|
80171
|
-
if (
|
|
80172
|
-
|
|
80173
|
-
|
|
80174
|
-
|
|
80175
|
-
|
|
80176
|
-
|
|
80177
|
-
|
|
80178
|
-
|
|
80179
|
-
|
|
80180
|
-
|
|
80181
|
-
|
|
80182
|
-
|
|
80183
|
-
|
|
80184
|
-
|
|
80185
|
-
|
|
80186
|
-
return;
|
|
80187
|
-
}
|
|
80188
|
-
} catch (err) {
|
|
80189
|
-
console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
|
|
80190
|
-
}
|
|
80549
|
+
const standing = await this._readDeviceStanding();
|
|
80550
|
+
if (this._stopped || !this._suspended) return;
|
|
80551
|
+
if (standing.kind === "active") {
|
|
80552
|
+
this._clearSuspendedWait();
|
|
80553
|
+
this._reconnectAttempt = 0;
|
|
80554
|
+
console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
|
|
80555
|
+
this.emit("resumed");
|
|
80556
|
+
this._connect();
|
|
80557
|
+
return;
|
|
80558
|
+
}
|
|
80559
|
+
if (standing.kind === "gone") {
|
|
80560
|
+
await this._terminalDeviceGone(standing.reason, "suspended_wait");
|
|
80561
|
+
return;
|
|
80562
|
+
}
|
|
80563
|
+
if (standing.kind === "unknown") {
|
|
80564
|
+
console.warn(`[SecureChannel] status check while paused inconclusive (${standing.why}); still waiting`);
|
|
80191
80565
|
}
|
|
80192
80566
|
this._scheduleSuspendedPoll();
|
|
80193
80567
|
}
|
|
80568
|
+
/**
|
|
80569
|
+
* The device is CONFIRMED gone (status endpoint: REVOKED, or the row is
|
|
80570
|
+
* deleted). Stop for good through the documented terminal surface:
|
|
80571
|
+
* re_enroll report, `auth_failed{deviceGone:true}` (bridges exit and remove
|
|
80572
|
+
* their service), then the legacy `error("Device was revoked")` the OpenClaw
|
|
80573
|
+
* lifecycle and older listeners key on.
|
|
80574
|
+
*/
|
|
80575
|
+
async _terminalDeviceGone(reason, source) {
|
|
80576
|
+
this._clearSuspendedWait();
|
|
80577
|
+
this._authFailedThisSession = true;
|
|
80578
|
+
console.warn(`[SecureChannel] ${source}: device confirmed gone (${reason}) \u2014 terminal`);
|
|
80579
|
+
await this._postAuthFailedToBackend(reason);
|
|
80580
|
+
this.emit("auth_failed", { reason, deviceGone: true });
|
|
80581
|
+
this._handleError(new Error("Device was revoked"));
|
|
80582
|
+
}
|
|
80194
80583
|
async _handleDeviceRevoked() {
|
|
80195
80584
|
const now = Date.now();
|
|
80196
80585
|
this._revokeRecoveries = this._revokeRecoveries.filter(
|
|
@@ -80208,35 +80597,25 @@ ${baseText}`;
|
|
|
80208
80597
|
this._handleError(new Error("Device was revoked"));
|
|
80209
80598
|
return;
|
|
80210
80599
|
}
|
|
80211
|
-
|
|
80212
|
-
|
|
80213
|
-
|
|
80214
|
-
|
|
80215
|
-
this._enterSuspendedWait("device_revoked");
|
|
80216
|
-
return;
|
|
80217
|
-
}
|
|
80218
|
-
reconnect = status.rateLimited === true || status.status === "ACTIVE";
|
|
80219
|
-
if (!reconnect) {
|
|
80220
|
-
console.warn(
|
|
80221
|
-
`[SecureChannel] device_revoked confirmed by server (status=${status.status}) \u2014 terminal`
|
|
80222
|
-
);
|
|
80223
|
-
}
|
|
80224
|
-
} catch (err) {
|
|
80225
|
-
console.warn(
|
|
80226
|
-
"[SecureChannel] device_revoked status check failed; reconnecting (inconclusive):",
|
|
80227
|
-
err
|
|
80228
|
-
);
|
|
80229
|
-
reconnect = true;
|
|
80600
|
+
const standing = await this._readDeviceStanding();
|
|
80601
|
+
if (standing.kind === "suspended") {
|
|
80602
|
+
this._enterSuspendedWait("device_revoked");
|
|
80603
|
+
return;
|
|
80230
80604
|
}
|
|
80231
|
-
if (
|
|
80232
|
-
this.
|
|
80233
|
-
console.log(
|
|
80234
|
-
"[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
|
|
80235
|
-
);
|
|
80236
|
-
this._scheduleReconnect();
|
|
80605
|
+
if (standing.kind === "gone") {
|
|
80606
|
+
await this._terminalDeviceGone(standing.reason, "device_revoked");
|
|
80237
80607
|
return;
|
|
80238
80608
|
}
|
|
80239
|
-
|
|
80609
|
+
if (standing.kind === "unknown") {
|
|
80610
|
+
console.warn(
|
|
80611
|
+
`[SecureChannel] device_revoked status check inconclusive (${standing.why}); reconnecting`
|
|
80612
|
+
);
|
|
80613
|
+
}
|
|
80614
|
+
this._revokeRecoveries.push(now);
|
|
80615
|
+
console.log(
|
|
80616
|
+
"[SecureChannel] device_revoked but device not confirmed dead \u2014 reconnecting (self-heal)"
|
|
80617
|
+
);
|
|
80618
|
+
this._scheduleReconnect();
|
|
80240
80619
|
}
|
|
80241
80620
|
/**
|
|
80242
80621
|
* Persist all ratchet session states to disk.
|
|
@@ -81036,7 +81415,7 @@ ${actionsText}`);
|
|
|
81036
81415
|
"use strict";
|
|
81037
81416
|
init_llm_response_parser();
|
|
81038
81417
|
init_llm_cost();
|
|
81039
|
-
traceStore = new
|
|
81418
|
+
traceStore = new AsyncLocalStorage3();
|
|
81040
81419
|
}
|
|
81041
81420
|
});
|
|
81042
81421
|
init_tool_audit = __esm2({
|
|
@@ -81059,6 +81438,7 @@ ${actionsText}`);
|
|
|
81059
81438
|
init_openclaw_compat();
|
|
81060
81439
|
init_lifecycle();
|
|
81061
81440
|
init_tool_audit();
|
|
81441
|
+
init_tool_telemetry();
|
|
81062
81442
|
init_harness_compat();
|
|
81063
81443
|
init_types();
|
|
81064
81444
|
managedRoutesRequested = false;
|
|
@@ -101784,7 +102164,8 @@ data:
|
|
|
101784
102164
|
await init_skill_telemetry();
|
|
101785
102165
|
await init_policy_enforcer();
|
|
101786
102166
|
init_room_protocol();
|
|
101787
|
-
|
|
102167
|
+
init_tool_telemetry();
|
|
102168
|
+
VERSION = true ? "0.23.54" : "0.0.0-dev";
|
|
101788
102169
|
}
|
|
101789
102170
|
});
|
|
101790
102171
|
await init_index();
|
|
@@ -103465,7 +103846,7 @@ function describeChildExit(shuttingDown2, code, signal) {
|
|
|
103465
103846
|
|
|
103466
103847
|
// src/grok-room-http.ts
|
|
103467
103848
|
import { createServer as createServer2 } from "node:http";
|
|
103468
|
-
import { randomBytes as
|
|
103849
|
+
import { randomBytes as randomBytes4, timingSafeEqual } from "node:crypto";
|
|
103469
103850
|
|
|
103470
103851
|
// src/grok-room-mcp.ts
|
|
103471
103852
|
var TOOL = {
|
|
@@ -103520,7 +103901,7 @@ function redactCredential(text, secret) {
|
|
|
103520
103901
|
}
|
|
103521
103902
|
async function startRoomMcpServer(opts) {
|
|
103522
103903
|
const seen = [];
|
|
103523
|
-
const token =
|
|
103904
|
+
const token = randomBytes4(24).toString("base64url");
|
|
103524
103905
|
const path2 = `/mcp/${token}`;
|
|
103525
103906
|
const log = opts.log ?? (() => {
|
|
103526
103907
|
});
|
|
@@ -103597,16 +103978,15 @@ await init_dist();
|
|
|
103597
103978
|
init_subcommand();
|
|
103598
103979
|
init_backend();
|
|
103599
103980
|
init_log();
|
|
103600
|
-
|
|
103601
|
-
|
|
103602
|
-
if (reason !== DEVICE_IS_GONE) return false;
|
|
103981
|
+
function selfUninstallOnTerminal(verdict, env, deps = {}) {
|
|
103982
|
+
if (verdict?.deviceGone !== true) return false;
|
|
103603
103983
|
const log = deps.log ?? ((m2) => logLine("[grok-bridge] " + m2));
|
|
103604
103984
|
let label;
|
|
103605
103985
|
try {
|
|
103606
103986
|
label = labelFor(env);
|
|
103607
103987
|
} catch (e) {
|
|
103608
103988
|
log(
|
|
103609
|
-
`device
|
|
103989
|
+
`device is gone (${verdict.reason}), but ${e.message} \u2014 cannot tell which service to remove. Remove it by hand with: AV_AGENT_NAME=<agent-name> agentvault-grok-bridge uninstall`
|
|
103610
103990
|
);
|
|
103611
103991
|
return false;
|
|
103612
103992
|
}
|
|
@@ -103616,12 +103996,12 @@ function selfUninstallOnTerminal(reason, env, deps = {}) {
|
|
|
103616
103996
|
if (!backend.status(label).loaded) return false;
|
|
103617
103997
|
backend.uninstall(label);
|
|
103618
103998
|
log(
|
|
103619
|
-
`device
|
|
103999
|
+
`device is gone (${verdict.reason}) \u2014 removed the supervised service ${label} so it does not sit installed on this machine pointing at an agent that no longer exists. Your credentials are still on disk and were NOT touched; re-install with a fresh invite token from AgentVault to reconnect.`
|
|
103620
104000
|
);
|
|
103621
104001
|
return true;
|
|
103622
104002
|
} catch (e) {
|
|
103623
104003
|
log(
|
|
103624
|
-
`device
|
|
104004
|
+
`device is gone (${verdict.reason}), but removing the service ${label} failed: ${e.message}. Remove it by hand with: AV_AGENT_NAME=<agent-name> agentvault-grok-bridge uninstall`
|
|
103625
104005
|
);
|
|
103626
104006
|
return false;
|
|
103627
104007
|
}
|
|
@@ -103645,6 +104025,18 @@ var RoomHushState = class {
|
|
|
103645
104025
|
return t2 !== void 0 && now < t2;
|
|
103646
104026
|
}
|
|
103647
104027
|
};
|
|
104028
|
+
function reportSay(channel, t2, startedAt, failure2) {
|
|
104029
|
+
try {
|
|
104030
|
+
reportToolInvoke(channel.telemetry, {
|
|
104031
|
+
toolName: "say",
|
|
104032
|
+
outcome: failure2 ? "error" : "success",
|
|
104033
|
+
errorKind: failure2 ? classifyToolError(failure2.err) : void 0,
|
|
104034
|
+
durationMs: Date.now() - startedAt,
|
|
104035
|
+
conversation: t2.kind === "room" ? { kind: "room", id: t2.roomId } : t2.conversationId ? { kind: "direct", id: t2.conversationId } : { kind: "unknown" }
|
|
104036
|
+
});
|
|
104037
|
+
} catch {
|
|
104038
|
+
}
|
|
104039
|
+
}
|
|
103648
104040
|
async function sendDm(channel, t2, text) {
|
|
103649
104041
|
if ((t2.conversationId || t2.groupId) && typeof channel.runForConversation === "function") {
|
|
103650
104042
|
await channel.runForConversation(
|
|
@@ -103684,13 +104076,17 @@ var ActiveTarget = class {
|
|
|
103684
104076
|
const where = !t2 ? "nowhere" : t2.kind === "room" ? `room ${t2.roomId.slice(0, 8)}` : "1:1 owner";
|
|
103685
104077
|
return async (text) => {
|
|
103686
104078
|
if (!t2) return;
|
|
104079
|
+
const startedAt = Date.now();
|
|
103687
104080
|
try {
|
|
103688
104081
|
if (t2.kind === "room") await channel.sendToRoom(t2.roomId, text);
|
|
103689
104082
|
else await sendDm(channel, t2, text);
|
|
103690
104083
|
log(`said to ${where}`);
|
|
103691
104084
|
} catch (err) {
|
|
103692
104085
|
log(`send failed to ${where}: ${err instanceof Error ? err.message : String(err)}`);
|
|
104086
|
+
reportSay(channel, t2, startedAt, { err });
|
|
104087
|
+
return;
|
|
103693
104088
|
}
|
|
104089
|
+
reportSay(channel, t2, startedAt);
|
|
103694
104090
|
};
|
|
103695
104091
|
}
|
|
103696
104092
|
};
|
|
@@ -103699,14 +104095,17 @@ function attachLifecycle2(channel, opts = {}) {
|
|
|
103699
104095
|
});
|
|
103700
104096
|
const selfUninstall = opts.selfUninstall ?? selfUninstallOnTerminal;
|
|
103701
104097
|
const onTerminal = opts.onTerminal ?? ((_reason, o2) => process.exit(o2.restart ? 1 : 0));
|
|
103702
|
-
const terminal = (reason, restart) => {
|
|
104098
|
+
const terminal = (reason, restart, deviceGone = false) => {
|
|
103703
104099
|
log(
|
|
103704
104100
|
`terminal condition (${reason}) \u2014 ${restart ? "gave up reconnecting; supervisor may respawn" : "this device must re-enroll or another session has taken over"}. Re-run/re-install with a fresh invite token from AgentVault if this persists.`
|
|
103705
104101
|
);
|
|
103706
|
-
selfUninstall(reason, process.env);
|
|
104102
|
+
selfUninstall({ reason, deviceGone }, process.env);
|
|
103707
104103
|
onTerminal(reason, { restart });
|
|
103708
104104
|
};
|
|
103709
|
-
channel.on(
|
|
104105
|
+
channel.on(
|
|
104106
|
+
"auth_failed",
|
|
104107
|
+
(e) => terminal(e.reason, false, e?.deviceGone === true)
|
|
104108
|
+
);
|
|
103710
104109
|
channel.on(
|
|
103711
104110
|
"session_replaced",
|
|
103712
104111
|
(e) => terminal(e?.code ? `session_replaced (${e.code})` : "session_replaced", false)
|
|
@@ -103900,7 +104299,7 @@ async function main() {
|
|
|
103900
104299
|
const info = parseInfoFlags(process.argv.slice(2));
|
|
103901
104300
|
if (info.showVersion || info.showHelp) {
|
|
103902
104301
|
const version2 = buildClientVersion2(
|
|
103903
|
-
true ? "0.4.
|
|
104302
|
+
true ? "0.4.25" : void 0
|
|
103904
104303
|
);
|
|
103905
104304
|
if (info.showVersion) printLine(version2);
|
|
103906
104305
|
if (info.showHelp) {
|
|
@@ -103939,7 +104338,7 @@ async function main() {
|
|
|
103939
104338
|
process.exit(0);
|
|
103940
104339
|
}
|
|
103941
104340
|
const cfg = loadConfig(process.env, process.argv.slice(2));
|
|
103942
|
-
logLine(`[grok-bridge] version: ${true ? "0.4.
|
|
104341
|
+
logLine(`[grok-bridge] version: ${true ? "0.4.25" : "dev"}`);
|
|
103943
104342
|
mkdirSync7(cfg.workspaceDir, { recursive: true });
|
|
103944
104343
|
mkdirSync7(cfg.fenceHome, { recursive: true });
|
|
103945
104344
|
seedFenceCredential({
|
|
@@ -103954,7 +104353,7 @@ async function main() {
|
|
|
103954
104353
|
agentName: cfg.agentName,
|
|
103955
104354
|
platform: "node",
|
|
103956
104355
|
clientVersion: buildClientVersion2(
|
|
103957
|
-
true ? "0.4.
|
|
104356
|
+
true ? "0.4.25" : void 0
|
|
103958
104357
|
)
|
|
103959
104358
|
});
|
|
103960
104359
|
channelRef = channel;
|
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
import { type ServiceBackend } from "./backend.js";
|
|
2
|
+
/**
|
|
3
|
+
* #913 item 2 / 2026-10-25 — what it takes to remove this agent's service.
|
|
4
|
+
*
|
|
5
|
+
* `attachLifecycle` routes every terminal signal here, and most of them mean
|
|
6
|
+
* the device is ALIVE:
|
|
7
|
+
*
|
|
8
|
+
* session_replaced another session took over — the device still exists
|
|
9
|
+
* device_jwt_expired the JWT aged out — the device still exists
|
|
10
|
+
* reconnect_loop gave up reconnecting — the device still exists
|
|
11
|
+
*
|
|
12
|
+
* This used to key on the reason string `device_revoked`. That was not proof:
|
|
13
|
+
* on 2026-10-25 a PAUSED (suspended) device's reissue 403 was mapped to
|
|
14
|
+
* "device_revoked" and this function removed loopita's launchd service — the
|
|
15
|
+
* owner switched the agent back on and nothing was installed to resume.
|
|
16
|
+
*
|
|
17
|
+
* So it now keys on the channel's CONFIRMED verdict only. SecureChannel sets
|
|
18
|
+
* `deviceGone: true` on `auth_failed` exclusively after the public status
|
|
19
|
+
* endpoint answered REVOKED or the device row is gone (404). Any reason string
|
|
20
|
+
* without that verdict — including `device_revoked` — leaves the service alone.
|
|
21
|
+
* An older channel that never sets the flag therefore never uninstalls: the
|
|
22
|
+
* safe direction.
|
|
23
|
+
*/
|
|
24
|
+
export interface TerminalVerdict {
|
|
25
|
+
reason: string;
|
|
26
|
+
/** Set by SecureChannel only when the status endpoint CONFIRMED revoked/deleted. */
|
|
27
|
+
deviceGone?: boolean;
|
|
28
|
+
}
|
|
2
29
|
export interface SelfUninstallDeps {
|
|
3
30
|
backend?: ServiceBackend;
|
|
4
31
|
log?: (msg: string) => void;
|
|
5
32
|
}
|
|
6
33
|
/**
|
|
7
|
-
* Remove this agent's supervised service after its device was
|
|
34
|
+
* Remove this agent's supervised service after its device was CONFIRMED
|
|
35
|
+
* revoked or deleted.
|
|
8
36
|
*
|
|
9
37
|
* Returns whether a service was actually removed. NEVER throws: this runs on
|
|
10
38
|
* the shutdown path, and a cleanup that cannot happen must not stop the bridge
|
|
@@ -15,5 +43,5 @@ export interface SelfUninstallDeps {
|
|
|
15
43
|
* and LEAVES the credentials on disk. A false positive therefore costs the
|
|
16
44
|
* customer a re-install, not their identity.
|
|
17
45
|
*/
|
|
18
|
-
export declare function selfUninstallOnTerminal(
|
|
46
|
+
export declare function selfUninstallOnTerminal(verdict: TerminalVerdict, env: NodeJS.ProcessEnv, deps?: SelfUninstallDeps): boolean;
|
|
19
47
|
//# sourceMappingURL=self-uninstall.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self-uninstall.d.ts","sourceRoot":"","sources":["../../src/service/self-uninstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"self-uninstall.d.ts","sourceRoot":"","sources":["../../src/service/self-uninstall.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAGlE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,GAAE,iBAAsB,GAC3B,OAAO,CAyCT"}
|
package/package.json
CHANGED