@agentvault/claude-bridge 0.8.18 → 0.8.19
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/cli-hint.d.ts +17 -0
- package/dist/enrollment-fingerprint.d.ts +28 -0
- package/dist/index.js +390 -83
- package/dist/service/subcommand.d.ts +4 -0
- package/dist/service/subcommand.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A runnable command line for one of this bridge's own subcommands.
|
|
3
|
+
*
|
|
4
|
+
* The bridge used to print `av-bridge trust-host` and friends — there is no
|
|
5
|
+
* `av-bridge` binary. The installed one is `agentvault-claude-bridge`, and every
|
|
6
|
+
* subcommand needs AV_AGENT_NAME to resolve the agent's data dir (#921), so a
|
|
7
|
+
* hint without it fails even with the right binary name.
|
|
8
|
+
*
|
|
9
|
+
* Leaf module (no bridge imports) so bridge.ts and approve-cli.ts can share it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const BRIDGE_BINARY = "agentvault-claude-bridge";
|
|
12
|
+
/** POSIX single-quote escaping: safe to paste into a shell whatever `value`
|
|
13
|
+
* holds ($, backticks and double quotes are inert inside single quotes). */
|
|
14
|
+
export declare function shellQuote(value: string): string;
|
|
15
|
+
export declare function isHintSafeId(value: unknown): value is string;
|
|
16
|
+
export declare function bridgeCommand(subcommand: string, agentName: string | undefined): string;
|
|
17
|
+
//# sourceMappingURL=cli-hint.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The lines shown to the customer — same wording as the OpenClaw setup. */
|
|
2
|
+
export declare function fingerprintLines(fingerprint: string): string[];
|
|
3
|
+
export declare function pendingFingerprintPath(dataDir: string): string;
|
|
4
|
+
export declare function writePendingFingerprint(dataDir: string, fingerprint: string): void;
|
|
5
|
+
export declare function readPendingFingerprint(dataDir: string): string | undefined;
|
|
6
|
+
export declare function clearPendingFingerprint(dataDir: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Block (synchronously — the service subcommands are sync) until the daemon has
|
|
9
|
+
* written the fingerprint, or `timeoutMs` passes. Enrolment is one HTTP round
|
|
10
|
+
* trip after the service boots, so this normally returns within seconds.
|
|
11
|
+
*/
|
|
12
|
+
export declare function waitForPendingFingerprint(dataDir: string, opts?: {
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
intervalMs?: number;
|
|
15
|
+
sleep?: (ms: number) => void;
|
|
16
|
+
now?: () => number;
|
|
17
|
+
}): string | undefined;
|
|
18
|
+
interface FingerprintChannel {
|
|
19
|
+
on(ev: "state", cb: (s: string) => void): unknown;
|
|
20
|
+
readonly fingerprint: string | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Daemon side: when the channel starts waiting for approval, log the
|
|
24
|
+
* fingerprint and publish it for `install` / `status`; drop it once approved.
|
|
25
|
+
*/
|
|
26
|
+
export declare function watchEnrollmentFingerprint(channel: FingerprintChannel, dataDir: string, log: (msg: string) => void): void;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=enrollment-fingerprint.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -4022,6 +4022,9 @@ function spanToOtlp(span) {
|
|
|
4022
4022
|
}
|
|
4023
4023
|
return otlp;
|
|
4024
4024
|
}
|
|
4025
|
+
function isRetryableStatus(status) {
|
|
4026
|
+
return status >= 500 || status === 408 || status === 429;
|
|
4027
|
+
}
|
|
4025
4028
|
async function generateBackupCode() {
|
|
4026
4029
|
await libsodium_wrappers_default.ready;
|
|
4027
4030
|
const bytes = libsodium_wrappers_default.randombytes_buf(13);
|
|
@@ -11666,11 +11669,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
|
|
|
11666
11669
|
return null;
|
|
11667
11670
|
}
|
|
11668
11671
|
function ownIdentity() {
|
|
11669
|
-
const v22 = true ? "0.23.
|
|
11672
|
+
const v22 = true ? "0.23.47" : FALLBACK;
|
|
11670
11673
|
return `${PACKAGE}@${v22}`;
|
|
11671
11674
|
}
|
|
11672
11675
|
function buildSha() {
|
|
11673
|
-
const raw = true ? "
|
|
11676
|
+
const raw = true ? "f1debc4" : "";
|
|
11674
11677
|
const cleaned = (raw ?? "").trim();
|
|
11675
11678
|
return !cleaned || cleaned === "unknown" ? null : cleaned;
|
|
11676
11679
|
}
|
|
@@ -12176,6 +12179,25 @@ async function runHistoryRecoveryCommand(input) {
|
|
|
12176
12179
|
});
|
|
12177
12180
|
output("Agent history recovery: configured");
|
|
12178
12181
|
}
|
|
12182
|
+
function decisionReplyFromEnvelope(parsed) {
|
|
12183
|
+
if (parsed === null || typeof parsed !== "object") return void 0;
|
|
12184
|
+
const decision = parsed.decision;
|
|
12185
|
+
if (decision === null || typeof decision !== "object") return void 0;
|
|
12186
|
+
const d22 = decision;
|
|
12187
|
+
if (typeof d22.decision_id !== "string" || d22.decision_id.length === 0) return void 0;
|
|
12188
|
+
if (Array.isArray(d22.options)) return void 0;
|
|
12189
|
+
const selected = typeof d22.selected_option_id === "string" ? d22.selected_option_id : void 0;
|
|
12190
|
+
const action = typeof d22.action === "string" && ACTIONS.has(d22.action) ? d22.action : void 0;
|
|
12191
|
+
if (selected === void 0 && action === void 0) return void 0;
|
|
12192
|
+
const reply = { decision_id: d22.decision_id };
|
|
12193
|
+
if (selected !== void 0) reply.selected_option_id = selected;
|
|
12194
|
+
if (action !== void 0) reply.action = action;
|
|
12195
|
+
if (typeof d22.resolved_at === "string") reply.resolved_at = d22.resolved_at;
|
|
12196
|
+
if (typeof d22.defer_until === "string") reply.defer_until = d22.defer_until;
|
|
12197
|
+
if (typeof d22.defer_reason === "string") reply.defer_reason = d22.defer_reason;
|
|
12198
|
+
if (typeof d22.reason === "string") reply.reason = d22.reason;
|
|
12199
|
+
return reply;
|
|
12200
|
+
}
|
|
12179
12201
|
async function readBoundedRestoreJson(response, signal, checkpoint) {
|
|
12180
12202
|
const contentLength = response.headers?.get("content-length");
|
|
12181
12203
|
if (contentLength && /^\d+$/.test(contentLength)) {
|
|
@@ -17164,7 +17186,7 @@ function writeFromReadableStream(stream, writable) {
|
|
|
17164
17186
|
}
|
|
17165
17187
|
return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
|
|
17166
17188
|
}
|
|
17167
|
-
var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, 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, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, 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, crypto2, 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, 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, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE2, 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_RE3, 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, 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, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, 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, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, 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, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, 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, 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;
|
|
17189
|
+
var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, init_room_protocol, __filename, __dirname, url2, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto4, 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, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, 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, crypto2, 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, init_transport2, A2ALogGate, init_a2a_log_gate, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE2, 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_RE3, 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, 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, NEVER, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, util_exports, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, Class, init_util2, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, regexes_exports, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uuid, uuid4, uuid6, uuid7, email, html5Email, rfc5322Email, unicodeEmail, idnEmail, browserEmail, _emoji, ipv4, ipv6, mac, cidrv4, cidrv6, base64, base64url, hostname, domain, e164, dateSource, date, string, bigint, integer, number, boolean, _null, _undefined, lowercase, uppercase, hex, md5_hex, md5_base64, md5_base64url, sha1_hex, sha1_base64, sha1_base64url, sha256_hex, sha256_base64, sha256_base64url, sha384_hex, sha384_base64, sha384_base64url, sha512_hex, sha512_base64, sha512_base64url, init_regexes, $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodMAC, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodCustomStringFormat, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodBigInt, $ZodBigIntFormat, $ZodSymbol, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodVoid, $ZodDate, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodXor, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodMap, $ZodSet, $ZodEnum, $ZodLiteral, $ZodFile, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodSuccess, $ZodCatch, $ZodNaN, $ZodPipe, $ZodCodec, $ZodReadonly, $ZodTemplateLiteral, $ZodFunction, $ZodPromise, $ZodLazy, $ZodCustom, init_schemas, init_ar, init_az, init_be, init_bg, init_ca, init_cs, init_da, init_de, error, init_en2, init_eo, init_es, init_fa, init_fi, init_fr, init_fr_CA, init_he, init_hu, init_hy, init_id, init_is, init_it, init_ja, init_ka, init_km, init_kh, init_ko, init_lt, init_mk, init_ms, init_nl, init_no, init_ota, init_ps, init_pl, init_pt, init_ru, init_sl, init_sv, init_ta, init_th, init_tr, init_uk, init_ua, init_ur, init_uz, init_vi, init_zh_CN, init_zh_TW, init_yo, init_locales, _a2, $ZodRegistry, globalRegistry, init_registries, init_api, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, formatMap, 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, recordProcessor, nullableProcessor, nonoptionalProcessor, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema_generator, 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, checks_exports2, init_checks3, iso_exports2, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, init_iso2, initializer2, ZodError2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, schemas_exports3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodMAC, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodCustomStringFormat, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodBigInt2, ZodBigIntFormat, ZodSymbol2, ZodUndefined2, ZodNull2, ZodAny2, ZodUnknown2, ZodNever2, ZodVoid2, ZodDate2, ZodArray2, ZodObject2, ZodUnion2, ZodXor, ZodDiscriminatedUnion2, ZodIntersection2, ZodTuple2, ZodRecord2, ZodMap2, ZodSet2, ZodEnum2, ZodLiteral2, ZodFile, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodSuccess, ZodCatch2, ZodNaN2, ZodPipe, ZodCodec, ZodReadonly2, ZodTemplateLiteral, ZodLazy2, ZodPromise2, ZodFunction2, ZodCustom, describe2, meta2, stringbool, init_schemas3, ZodFirstPartyTypeKind2, init_compat, z2, init_from_json_schema, 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, 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;
|
|
17168
17190
|
var init_dist = __esm({
|
|
17169
17191
|
async "../plugin/dist/index.js"() {
|
|
17170
17192
|
"use strict";
|
|
@@ -59987,7 +60009,11 @@ var init_dist = __esm({
|
|
|
59987
60009
|
_agentName;
|
|
59988
60010
|
_agentVersion;
|
|
59989
60011
|
_pluginVersion;
|
|
60012
|
+
_maxRetries;
|
|
60013
|
+
_maxBufferedSpans;
|
|
59990
60014
|
_buffer = [];
|
|
60015
|
+
/** Failed send attempts per buffered span. */
|
|
60016
|
+
_attempts = /* @__PURE__ */ new WeakMap();
|
|
59991
60017
|
_timer = null;
|
|
59992
60018
|
constructor(config22) {
|
|
59993
60019
|
this._apiBase = config22.apiBase.replace(/\/+$/, "");
|
|
@@ -59997,6 +60023,8 @@ var init_dist = __esm({
|
|
|
59997
60023
|
this._agentName = config22.agentName ?? "unknown";
|
|
59998
60024
|
this._agentVersion = config22.agentVersion ?? "0.0.0";
|
|
59999
60025
|
this._pluginVersion = config22.pluginVersion ?? "0.0.0";
|
|
60026
|
+
this._maxRetries = Math.max(1, config22.maxRetries ?? 5);
|
|
60027
|
+
this._maxBufferedSpans = Math.max(1, config22.maxBufferedSpans ?? 1e3);
|
|
60000
60028
|
}
|
|
60001
60029
|
/** Number of spans waiting to be flushed. */
|
|
60002
60030
|
get pendingCount() {
|
|
@@ -60044,7 +60072,9 @@ var init_dist = __esm({
|
|
|
60044
60072
|
* POST all buffered spans to the backend ingest endpoint.
|
|
60045
60073
|
*
|
|
60046
60074
|
* - On success (HTTP 2xx): clears the buffer.
|
|
60047
|
-
* - On failure: keeps spans
|
|
60075
|
+
* - On a retryable failure (network, 5xx, 408, 429): keeps spans for retry,
|
|
60076
|
+
* bounded by `maxRetries` per span and `maxBufferedSpans` overall.
|
|
60077
|
+
* - On any other 4xx: drops the batch (it can never be accepted).
|
|
60048
60078
|
* - Never throws — telemetry is best-effort.
|
|
60049
60079
|
*/
|
|
60050
60080
|
async flush() {
|
|
@@ -60073,13 +60103,23 @@ var init_dist = __esm({
|
|
|
60073
60103
|
spans: spans.map(spanToOtlp)
|
|
60074
60104
|
})
|
|
60075
60105
|
});
|
|
60076
|
-
if (!response.ok) {
|
|
60077
|
-
this.
|
|
60106
|
+
if (!response.ok && isRetryableStatus(response.status)) {
|
|
60107
|
+
this._requeue(spans);
|
|
60078
60108
|
}
|
|
60079
60109
|
} catch {
|
|
60080
|
-
this.
|
|
60110
|
+
this._requeue(spans);
|
|
60081
60111
|
}
|
|
60082
60112
|
}
|
|
60113
|
+
/** Put a failed batch back in front of newer spans, within both caps. */
|
|
60114
|
+
_requeue(spans) {
|
|
60115
|
+
const retained = spans.filter((span) => {
|
|
60116
|
+
const attempts = (this._attempts.get(span) ?? 0) + 1;
|
|
60117
|
+
this._attempts.set(span, attempts);
|
|
60118
|
+
return attempts < this._maxRetries;
|
|
60119
|
+
});
|
|
60120
|
+
const merged = retained.concat(this._buffer);
|
|
60121
|
+
this._buffer = merged.length > this._maxBufferedSpans ? merged.slice(merged.length - this._maxBufferedSpans) : merged;
|
|
60122
|
+
}
|
|
60083
60123
|
// -- Auto-flush -------------------------------------------------------------
|
|
60084
60124
|
/**
|
|
60085
60125
|
* Start a periodic flush timer.
|
|
@@ -69601,6 +69641,12 @@ var init_dist = __esm({
|
|
|
69601
69641
|
};
|
|
69602
69642
|
}
|
|
69603
69643
|
});
|
|
69644
|
+
init_decision_reply = __esm2({
|
|
69645
|
+
"src/decision-reply.ts"() {
|
|
69646
|
+
"use strict";
|
|
69647
|
+
ACTIONS = /* @__PURE__ */ new Set(["approve", "deny", "defer", "cancel"]);
|
|
69648
|
+
}
|
|
69649
|
+
});
|
|
69604
69650
|
history_backup_client_exports = {};
|
|
69605
69651
|
__export2(history_backup_client_exports, {
|
|
69606
69652
|
HISTORY_RESTORE_RESPONSE_MAX_BYTES: () => HISTORY_RESTORE_RESPONSE_MAX_BYTES,
|
|
@@ -69944,6 +69990,7 @@ var init_dist = __esm({
|
|
|
69944
69990
|
init_mls_membership_probe();
|
|
69945
69991
|
init_history_backup_scheduler();
|
|
69946
69992
|
await init_history_recovery_code();
|
|
69993
|
+
init_decision_reply();
|
|
69947
69994
|
ROOM_AGENT_TYPES = /* @__PURE__ */ new Set([
|
|
69948
69995
|
"message",
|
|
69949
69996
|
"text",
|
|
@@ -70229,9 +70276,12 @@ ${text}`;
|
|
|
70229
70276
|
// Reset at the start of every `_connect`.
|
|
70230
70277
|
_authFailedThisSession = false;
|
|
70231
70278
|
// Last observed WebSocket close code, captured by the ws.on("close", ...)
|
|
70232
|
-
// handler. Used by the rapid-disconnect classifier
|
|
70233
|
-
//
|
|
70279
|
+
// handler. Used by the rapid-disconnect classifier: 4001 = server rejected
|
|
70280
|
+
// the credentials (auth_failed); 4000 = reserved "session_replaced".
|
|
70234
70281
|
_lastCloseCode = null;
|
|
70282
|
+
// True while a once("ready") listener is waiting to honour config.httpPort,
|
|
70283
|
+
// so repeated start() calls do not stack listeners.
|
|
70284
|
+
_httpPortListenerArmed = false;
|
|
70235
70285
|
// Liveness detection: server sends app-level {"event":"ping"} every 30s.
|
|
70236
70286
|
// We check every 30s; if no data received in 90s (3 missed pings), connection is dead.
|
|
70237
70287
|
static PING_INTERVAL_MS = 3e4;
|
|
@@ -70533,10 +70583,19 @@ ${text}`;
|
|
|
70533
70583
|
async start() {
|
|
70534
70584
|
await this._stateSaveQueue;
|
|
70535
70585
|
this._stopped = false;
|
|
70586
|
+
this._clearSuspendedWait();
|
|
70536
70587
|
this._lifecycleGeneration += 1;
|
|
70537
70588
|
this._historyBackupScheduler.stop();
|
|
70538
70589
|
this._historyBackupScheduler = this._createHistoryBackupScheduler();
|
|
70539
70590
|
await libsodium_wrappers_default.ready;
|
|
70591
|
+
const httpPort = this.config.httpPort;
|
|
70592
|
+
if (typeof httpPort === "number" && !this._httpPortListenerArmed) {
|
|
70593
|
+
this._httpPortListenerArmed = true;
|
|
70594
|
+
this.once("ready", () => {
|
|
70595
|
+
this._httpPortListenerArmed = false;
|
|
70596
|
+
if (!this._stopped) this.startHttpServer(httpPort);
|
|
70597
|
+
});
|
|
70598
|
+
}
|
|
70540
70599
|
if (this._forceReEnroll) {
|
|
70541
70600
|
console.log("[SecureChannel] forceReEnroll set \u2014 clearing cached credentials, will enroll fresh");
|
|
70542
70601
|
await clearState(this.config.dataDir);
|
|
@@ -71626,7 +71685,7 @@ ${text}`;
|
|
|
71626
71685
|
*/
|
|
71627
71686
|
sendActivitySpan(spanData) {
|
|
71628
71687
|
if (!this._ws || this._ws.readyState !== WebSocket2.OPEN) return;
|
|
71629
|
-
const pluginVersion = true ? "0.23.
|
|
71688
|
+
const pluginVersion = true ? "0.23.47" : "0.0.0-dev";
|
|
71630
71689
|
const agentName = this.config.agentName ?? "Agent";
|
|
71631
71690
|
const resource = {
|
|
71632
71691
|
"service.name": "agentvault-agent",
|
|
@@ -71705,16 +71764,27 @@ ${text}`;
|
|
|
71705
71764
|
}
|
|
71706
71765
|
/**
|
|
71707
71766
|
* Wait for a decision response matching the given decisionId.
|
|
71708
|
-
* Listens on the "message" event
|
|
71709
|
-
* metadata.
|
|
71710
|
-
*
|
|
71767
|
+
* Listens on the "message" event. Resolves when either:
|
|
71768
|
+
* - metadata.decision carries an answer for this decisionId — what every
|
|
71769
|
+
* receive path now lifts out of the app's envelope (an option selected,
|
|
71770
|
+
* or action "defer" / "cancel"); or
|
|
71771
|
+
* - legacy: metadata.messageType === "decision_response" and the
|
|
71772
|
+
* plaintext is the JSON envelope with a matching decision.decision_id.
|
|
71711
71773
|
* Optional timeout rejects with an Error.
|
|
71712
71774
|
*/
|
|
71713
71775
|
waitForDecision(decisionId, timeoutMs) {
|
|
71714
71776
|
return new Promise((resolve42, reject) => {
|
|
71715
71777
|
let timer = null;
|
|
71716
71778
|
const handler = (plaintext, metadata) => {
|
|
71717
|
-
if (metadata
|
|
71779
|
+
if (metadata?.roomId) return;
|
|
71780
|
+
const reply = metadata?.decision;
|
|
71781
|
+
if (reply && reply.decision_id === decisionId) {
|
|
71782
|
+
if (timer) clearTimeout(timer);
|
|
71783
|
+
this.removeListener("message", handler);
|
|
71784
|
+
resolve42(reply);
|
|
71785
|
+
return;
|
|
71786
|
+
}
|
|
71787
|
+
if (metadata?.messageType !== "decision_response") return;
|
|
71718
71788
|
try {
|
|
71719
71789
|
const parsed = JSON.parse(plaintext);
|
|
71720
71790
|
if (parsed.decision?.decision_id === decisionId) {
|
|
@@ -72713,6 +72783,7 @@ ${text}`;
|
|
|
72713
72783
|
clearTimeout(this._reconnectTimer);
|
|
72714
72784
|
this._reconnectTimer = null;
|
|
72715
72785
|
}
|
|
72786
|
+
this._clearSuspendedWait();
|
|
72716
72787
|
if (this._telemetryReporter) {
|
|
72717
72788
|
this._telemetryReporter.stopAutoFlush();
|
|
72718
72789
|
await this._telemetryReporter.flush();
|
|
@@ -72826,7 +72897,12 @@ ${text}`;
|
|
|
72826
72897
|
res.end(JSON.stringify({ ok: false, error: "Not found. Use POST /send, POST /decision, POST /action, GET /status, GET /targets, or /mcp" }));
|
|
72827
72898
|
}
|
|
72828
72899
|
});
|
|
72829
|
-
this._httpServer
|
|
72900
|
+
const server = this._httpServer;
|
|
72901
|
+
server.on("error", (err) => {
|
|
72902
|
+
console.error(`[SecureChannel] local HTTP server on 127.0.0.1:${port} failed: ${err.message}`);
|
|
72903
|
+
if (this._httpServer === server) this._httpServer = null;
|
|
72904
|
+
});
|
|
72905
|
+
server.listen(port, "127.0.0.1", () => {
|
|
72830
72906
|
this.emit("http-ready", port);
|
|
72831
72907
|
});
|
|
72832
72908
|
}
|
|
@@ -73366,8 +73442,13 @@ ${text}`;
|
|
|
73366
73442
|
this.config.platform,
|
|
73367
73443
|
this.config.expectedFramework
|
|
73368
73444
|
);
|
|
73445
|
+
if (result.fingerprint && result.fingerprint !== fingerprint) {
|
|
73446
|
+
throw new Error(
|
|
73447
|
+
`Enrollment fingerprint mismatch: this agent's key is ${fingerprint} but the server reported ${result.fingerprint}. Not continuing \u2014 do not approve this device.`
|
|
73448
|
+
);
|
|
73449
|
+
}
|
|
73369
73450
|
this._deviceId = result.device_id;
|
|
73370
|
-
this._fingerprint =
|
|
73451
|
+
this._fingerprint = fingerprint;
|
|
73371
73452
|
this._persisted = {
|
|
73372
73453
|
deviceId: result.device_id,
|
|
73373
73454
|
deviceJwt: "",
|
|
@@ -73384,7 +73465,7 @@ ${text}`;
|
|
|
73384
73465
|
publicKey: bytesToHex2(ephemeral.publicKey),
|
|
73385
73466
|
privateKey: bytesToHex2(ephemeral.privateKey)
|
|
73386
73467
|
},
|
|
73387
|
-
fingerprint
|
|
73468
|
+
fingerprint,
|
|
73388
73469
|
messageHistory: []
|
|
73389
73470
|
};
|
|
73390
73471
|
this._poll();
|
|
@@ -73599,7 +73680,7 @@ ${text}`;
|
|
|
73599
73680
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
73600
73681
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
73601
73682
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
73602
|
-
pluginVersion: true ? "0.23.
|
|
73683
|
+
pluginVersion: true ? "0.23.47" : "0.0.0-dev"
|
|
73603
73684
|
});
|
|
73604
73685
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
73605
73686
|
}
|
|
@@ -73684,6 +73765,10 @@ ${text}`;
|
|
|
73684
73765
|
await this._handleDeviceRevoked();
|
|
73685
73766
|
return;
|
|
73686
73767
|
}
|
|
73768
|
+
if (data.event === "device_suspended") {
|
|
73769
|
+
await this._handleDeviceSuspended();
|
|
73770
|
+
return;
|
|
73771
|
+
}
|
|
73687
73772
|
if (data.event === "connection_rejected") {
|
|
73688
73773
|
await this._handleConnectionRejected(data);
|
|
73689
73774
|
return;
|
|
@@ -73923,7 +74008,7 @@ ${text}`;
|
|
|
73923
74008
|
agentVersion: this.config.agentVersion ?? "0.0.0",
|
|
73924
74009
|
// __AV_VERSION__ is injected by esbuild from package.json at build time.
|
|
73925
74010
|
// Falls back to "0.0.0-dev" in non-bundled contexts (tests).
|
|
73926
|
-
pluginVersion: true ? "0.23.
|
|
74011
|
+
pluginVersion: true ? "0.23.47" : "0.0.0-dev"
|
|
73927
74012
|
});
|
|
73928
74013
|
this._telemetryReporter.startAutoFlush(3e4);
|
|
73929
74014
|
}
|
|
@@ -74375,12 +74460,15 @@ ${text}`;
|
|
|
74375
74460
|
let messageType = "text";
|
|
74376
74461
|
let topicId = data.topic_id;
|
|
74377
74462
|
let mlsAttachment = null;
|
|
74463
|
+
let decisionReply;
|
|
74378
74464
|
try {
|
|
74379
74465
|
const parsed = JSON.parse(plaintext);
|
|
74380
74466
|
text = envelopeText(parsed, plaintext);
|
|
74381
74467
|
messageType = parsed.type ?? "text";
|
|
74382
74468
|
topicId = parsed.topicId ?? topicId;
|
|
74383
74469
|
if (parsed.attachment) mlsAttachment = parsed.attachment;
|
|
74470
|
+
decisionReply = decisionReplyFromEnvelope(parsed);
|
|
74471
|
+
if (decisionReply) messageType = "decision_response";
|
|
74384
74472
|
} catch {
|
|
74385
74473
|
}
|
|
74386
74474
|
if (messageType === "history_catchup_request") {
|
|
@@ -74462,7 +74550,8 @@ ${text}`;
|
|
|
74462
74550
|
// material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
|
|
74463
74551
|
// that a roomId was absent. The bridge's full-access DM lane requires it.
|
|
74464
74552
|
ownerDm1to1: true,
|
|
74465
|
-
messageType
|
|
74553
|
+
messageType,
|
|
74554
|
+
...decisionReply ? { decision: decisionReply } : {}
|
|
74466
74555
|
};
|
|
74467
74556
|
this.emit("message", text, metadata);
|
|
74468
74557
|
if (this.config.onMessage) {
|
|
@@ -74572,6 +74661,7 @@ ${text}`;
|
|
|
74572
74661
|
let messageText;
|
|
74573
74662
|
let messageType;
|
|
74574
74663
|
let attachmentInfo = null;
|
|
74664
|
+
let decisionReply;
|
|
74575
74665
|
try {
|
|
74576
74666
|
const parsed = JSON.parse(plaintext);
|
|
74577
74667
|
messageType = parsed.type || "message";
|
|
@@ -74579,6 +74669,7 @@ ${text}`;
|
|
|
74579
74669
|
if (parsed.attachment) {
|
|
74580
74670
|
attachmentInfo = parsed.attachment;
|
|
74581
74671
|
}
|
|
74672
|
+
decisionReply = decisionReplyFromEnvelope(parsed);
|
|
74582
74673
|
} catch {
|
|
74583
74674
|
messageType = "message";
|
|
74584
74675
|
messageText = plaintext;
|
|
@@ -74631,7 +74722,7 @@ ${text}`;
|
|
|
74631
74722
|
return;
|
|
74632
74723
|
}
|
|
74633
74724
|
}
|
|
74634
|
-
if (messageType === "message") {
|
|
74725
|
+
if (messageType === "message" || messageType === "decision_response" && decisionReply) {
|
|
74635
74726
|
const topicId = msgData.topic_id;
|
|
74636
74727
|
this._lastIncomingTopicId = topicId;
|
|
74637
74728
|
let attachData;
|
|
@@ -74693,10 +74784,12 @@ ${messageText}`;
|
|
|
74693
74784
|
attachment: attachData,
|
|
74694
74785
|
spanId: msgData.span_id,
|
|
74695
74786
|
parentSpanId: msgData.parent_span_id,
|
|
74696
|
-
|
|
74787
|
+
// A decision answer only counts from the owner's 1:1 — never a room.
|
|
74788
|
+
messageType: decisionReply && !roomId ? "decision_response" : msgData.message_type ?? "text",
|
|
74697
74789
|
priority: msgData.priority ?? "normal",
|
|
74698
74790
|
envelopeVersion: msgData.envelope_version ?? "1.0.0",
|
|
74699
74791
|
roomId,
|
|
74792
|
+
...decisionReply && !roomId ? { decision: decisionReply } : {},
|
|
74700
74793
|
// #1223 — the pre-fold text. This DR `message` path also sets `roomId`
|
|
74701
74794
|
// and folds an attachment into `emitText`, so without this a room
|
|
74702
74795
|
// message that reaches the gate here would fall back to the folded
|
|
@@ -77346,10 +77439,12 @@ ${baseText}`;
|
|
|
77346
77439
|
}
|
|
77347
77440
|
let messageText;
|
|
77348
77441
|
let messageType;
|
|
77442
|
+
let decisionReply;
|
|
77349
77443
|
try {
|
|
77350
77444
|
const parsed = JSON.parse(plaintext);
|
|
77351
77445
|
messageType = parsed.type || "message";
|
|
77352
77446
|
messageText = envelopeText(parsed, plaintext);
|
|
77447
|
+
decisionReply = decisionReplyFromEnvelope(parsed);
|
|
77353
77448
|
} catch {
|
|
77354
77449
|
messageType = "message";
|
|
77355
77450
|
messageText = plaintext;
|
|
@@ -77361,7 +77456,7 @@ ${baseText}`;
|
|
|
77361
77456
|
ackedIds.push(msg.queue_id);
|
|
77362
77457
|
continue;
|
|
77363
77458
|
}
|
|
77364
|
-
if (messageType === "message") {
|
|
77459
|
+
if (messageType === "message" || messageType === "decision_response" && decisionReply) {
|
|
77365
77460
|
const topicId = msg.topic_id;
|
|
77366
77461
|
await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.message_id);
|
|
77367
77462
|
const metadata = {
|
|
@@ -77372,7 +77467,8 @@ ${baseText}`;
|
|
|
77372
77467
|
// #621: positive attestation that this decrypted under the OWNER'S 1:1
|
|
77373
77468
|
// material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
|
|
77374
77469
|
// that a roomId was absent. The bridge's full-access DM lane requires it.
|
|
77375
|
-
ownerDm1to1: true
|
|
77470
|
+
ownerDm1to1: true,
|
|
77471
|
+
...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
|
|
77376
77472
|
};
|
|
77377
77473
|
this.emit("message", messageText, metadata);
|
|
77378
77474
|
Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
|
|
@@ -77956,15 +78052,17 @@ ${baseText}`;
|
|
|
77956
78052
|
}
|
|
77957
78053
|
let messageText;
|
|
77958
78054
|
let messageType;
|
|
78055
|
+
let decisionReply;
|
|
77959
78056
|
try {
|
|
77960
78057
|
const parsed = JSON.parse(plaintext);
|
|
77961
78058
|
messageType = parsed.type || "message";
|
|
77962
78059
|
messageText = envelopeText(parsed, plaintext);
|
|
78060
|
+
decisionReply = decisionReplyFromEnvelope(parsed);
|
|
77963
78061
|
} catch {
|
|
77964
78062
|
messageType = "message";
|
|
77965
78063
|
messageText = plaintext;
|
|
77966
78064
|
}
|
|
77967
|
-
if (messageType === "message") {
|
|
78065
|
+
if (messageType === "message" || messageType === "decision_response" && decisionReply) {
|
|
77968
78066
|
const topicId = msg.topic_id;
|
|
77969
78067
|
await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
|
|
77970
78068
|
const metadata = {
|
|
@@ -77975,7 +78073,8 @@ ${baseText}`;
|
|
|
77975
78073
|
// #621: positive attestation that this decrypted under the OWNER'S 1:1
|
|
77976
78074
|
// material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
|
|
77977
78075
|
// that a roomId was absent. The bridge's full-access DM lane requires it.
|
|
77978
|
-
ownerDm1to1: true
|
|
78076
|
+
ownerDm1to1: true,
|
|
78077
|
+
...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
|
|
77979
78078
|
};
|
|
77980
78079
|
this.emit("message", messageText, metadata);
|
|
77981
78080
|
Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
|
|
@@ -78151,6 +78250,7 @@ ${baseText}`;
|
|
|
78151
78250
|
}
|
|
78152
78251
|
_scheduleReconnect() {
|
|
78153
78252
|
if (this._stopped) return;
|
|
78253
|
+
if (this._suspended) return;
|
|
78154
78254
|
if (this._reconnectTimer) return;
|
|
78155
78255
|
const sinceOpen = Date.now() - this._lastWsOpenTime;
|
|
78156
78256
|
if (this._lastWsOpenTime > 0 && sinceOpen < 1e4) {
|
|
@@ -78171,7 +78271,16 @@ ${baseText}`;
|
|
|
78171
78271
|
return;
|
|
78172
78272
|
}
|
|
78173
78273
|
const lastCode = this._lastCloseCode;
|
|
78174
|
-
if (lastCode ===
|
|
78274
|
+
if (lastCode === 4001) {
|
|
78275
|
+
console.log(
|
|
78276
|
+
"[SecureChannel] Server rejected our credentials on every reconnect (close code 4001). Stopping; the device needs re-enrolling or a fresh token."
|
|
78277
|
+
);
|
|
78278
|
+
this._authFailedThisSession = true;
|
|
78279
|
+
this._setState("error");
|
|
78280
|
+
this.emit("auth_failed", { reason: "ws_auth_rejected" });
|
|
78281
|
+
return;
|
|
78282
|
+
}
|
|
78283
|
+
if (lastCode === 4e3) {
|
|
78175
78284
|
console.log(
|
|
78176
78285
|
`[SecureChannel] Server reports our session was replaced by a newer one (close code ${lastCode}). Stopping reconnect.`
|
|
78177
78286
|
);
|
|
@@ -78263,15 +78372,17 @@ ${baseText}`;
|
|
|
78263
78372
|
}
|
|
78264
78373
|
let messageText;
|
|
78265
78374
|
let messageType;
|
|
78375
|
+
let decisionReply;
|
|
78266
78376
|
try {
|
|
78267
78377
|
const parsed = JSON.parse(plaintext);
|
|
78268
78378
|
messageType = parsed.type || "message";
|
|
78269
78379
|
messageText = envelopeText(parsed, plaintext);
|
|
78380
|
+
decisionReply = decisionReplyFromEnvelope(parsed);
|
|
78270
78381
|
} catch {
|
|
78271
78382
|
messageType = "message";
|
|
78272
78383
|
messageText = plaintext;
|
|
78273
78384
|
}
|
|
78274
|
-
if (messageType === "message") {
|
|
78385
|
+
if (messageType === "message" || messageType === "decision_response" && decisionReply) {
|
|
78275
78386
|
const topicId = msg.topic_id;
|
|
78276
78387
|
await this._appendHistory("owner", messageText, this._historyContext("dm", topicId), msg.created_at, msg.id);
|
|
78277
78388
|
const metadata = {
|
|
@@ -78282,7 +78393,8 @@ ${baseText}`;
|
|
|
78282
78393
|
// #621: positive attestation that this decrypted under the OWNER'S 1:1
|
|
78283
78394
|
// material (MLS 1to1-group map, or a Double Ratchet session), NOT merely
|
|
78284
78395
|
// that a roomId was absent. The bridge's full-access DM lane requires it.
|
|
78285
|
-
ownerDm1to1: true
|
|
78396
|
+
ownerDm1to1: true,
|
|
78397
|
+
...decisionReply ? { messageType: "decision_response", decision: decisionReply } : {}
|
|
78286
78398
|
};
|
|
78287
78399
|
this.emit("message", messageText, metadata);
|
|
78288
78400
|
Promise.resolve(this.config.onMessage?.(messageText, metadata)).catch((err) => {
|
|
@@ -78371,6 +78483,10 @@ ${baseText}`;
|
|
|
78371
78483
|
* `retryable` rejection is transient — fall through to a normal reconnect.
|
|
78372
78484
|
*/
|
|
78373
78485
|
async _handleConnectionRejected(data) {
|
|
78486
|
+
if (data?.reason === "device_suspended") {
|
|
78487
|
+
this._enterSuspendedWait("connection_rejected");
|
|
78488
|
+
return;
|
|
78489
|
+
}
|
|
78374
78490
|
if (data?.retryable === true) {
|
|
78375
78491
|
this._scheduleReconnect();
|
|
78376
78492
|
return;
|
|
@@ -78382,6 +78498,79 @@ ${baseText}`;
|
|
|
78382
78498
|
);
|
|
78383
78499
|
this.emit("auth_failed", { reason: authReason });
|
|
78384
78500
|
}
|
|
78501
|
+
// --- Owner pause (device SUSPENDED) — NON-final ---------------------------
|
|
78502
|
+
//
|
|
78503
|
+
// Suspension is reversible ("Agent active" off/on in the app). While
|
|
78504
|
+
// suspended the server will not serve this device (it rejects the handshake
|
|
78505
|
+
// with a retryable `device_suspended`), so reconnecting is pointless and,
|
|
78506
|
+
// through the rapid-disconnect classifier, used to end in a terminal error.
|
|
78507
|
+
// Instead: stay in "disconnected", poll the public status endpoint, and
|
|
78508
|
+
// reconnect as soon as the device is ACTIVE again. REVOKED ends the wait as
|
|
78509
|
+
// terminal; anything inconclusive (rate limit, network) keeps waiting.
|
|
78510
|
+
static SUSPENDED_POLL_MS = 3e4;
|
|
78511
|
+
_suspended = false;
|
|
78512
|
+
_suspendedPollTimer = null;
|
|
78513
|
+
/** Handle a WS `device_suspended` frame (owner paused this agent). */
|
|
78514
|
+
async _handleDeviceSuspended() {
|
|
78515
|
+
this._enterSuspendedWait("device_suspended");
|
|
78516
|
+
}
|
|
78517
|
+
_enterSuspendedWait(source) {
|
|
78518
|
+
if (this._stopped) return;
|
|
78519
|
+
if (this._reconnectTimer) {
|
|
78520
|
+
clearTimeout(this._reconnectTimer);
|
|
78521
|
+
this._reconnectTimer = null;
|
|
78522
|
+
}
|
|
78523
|
+
this._rapidDisconnects = 0;
|
|
78524
|
+
if (!this._suspended) {
|
|
78525
|
+
this._suspended = true;
|
|
78526
|
+
console.log(
|
|
78527
|
+
`[SecureChannel] Agent paused by its owner (${source}) \u2014 idling; will reconnect when resumed`
|
|
78528
|
+
);
|
|
78529
|
+
this._setState("disconnected");
|
|
78530
|
+
this.emit("suspended", { source });
|
|
78531
|
+
}
|
|
78532
|
+
this._scheduleSuspendedPoll();
|
|
78533
|
+
}
|
|
78534
|
+
_scheduleSuspendedPoll() {
|
|
78535
|
+
if (this._stopped || !this._suspended || this._suspendedPollTimer) return;
|
|
78536
|
+
this._suspendedPollTimer = setTimeout(() => {
|
|
78537
|
+
this._suspendedPollTimer = null;
|
|
78538
|
+
void this._pollWhileSuspended();
|
|
78539
|
+
}, _SecureChannel.SUSPENDED_POLL_MS);
|
|
78540
|
+
}
|
|
78541
|
+
_clearSuspendedWait() {
|
|
78542
|
+
this._suspended = false;
|
|
78543
|
+
if (this._suspendedPollTimer) {
|
|
78544
|
+
clearTimeout(this._suspendedPollTimer);
|
|
78545
|
+
this._suspendedPollTimer = null;
|
|
78546
|
+
}
|
|
78547
|
+
}
|
|
78548
|
+
async _pollWhileSuspended() {
|
|
78549
|
+
if (this._stopped || !this._suspended) return;
|
|
78550
|
+
const deviceId = this._deviceId ?? this._persisted?.deviceId;
|
|
78551
|
+
if (deviceId) {
|
|
78552
|
+
try {
|
|
78553
|
+
const st = await pollDeviceStatus(this.config.apiUrl, deviceId);
|
|
78554
|
+
if (this._stopped || !this._suspended) return;
|
|
78555
|
+
if (!st.rateLimited && (st.status === "ACTIVE" || st.status === "APPROVED")) {
|
|
78556
|
+
this._clearSuspendedWait();
|
|
78557
|
+
this._reconnectAttempt = 0;
|
|
78558
|
+
console.log("[SecureChannel] Agent resumed by its owner \u2014 reconnecting");
|
|
78559
|
+
this.emit("resumed");
|
|
78560
|
+
this._connect();
|
|
78561
|
+
return;
|
|
78562
|
+
}
|
|
78563
|
+
if (!st.rateLimited && st.status === "REVOKED") {
|
|
78564
|
+
this._clearSuspendedWait();
|
|
78565
|
+
this._handleError(new Error("Device was revoked"));
|
|
78566
|
+
return;
|
|
78567
|
+
}
|
|
78568
|
+
} catch (err) {
|
|
78569
|
+
console.warn("[SecureChannel] status check while paused failed; still waiting:", err);
|
|
78570
|
+
}
|
|
78571
|
+
}
|
|
78572
|
+
this._scheduleSuspendedPoll();
|
|
78573
|
+
}
|
|
78385
78574
|
async _handleDeviceRevoked() {
|
|
78386
78575
|
const now = Date.now();
|
|
78387
78576
|
this._revokeRecoveries = this._revokeRecoveries.filter(
|
|
@@ -78402,6 +78591,10 @@ ${baseText}`;
|
|
|
78402
78591
|
let reconnect;
|
|
78403
78592
|
try {
|
|
78404
78593
|
const status = await pollDeviceStatus(this.config.apiUrl, deviceId);
|
|
78594
|
+
if (status.status === "SUSPENDED") {
|
|
78595
|
+
this._enterSuspendedWait("device_revoked");
|
|
78596
|
+
return;
|
|
78597
|
+
}
|
|
78405
78598
|
reconnect = status.rateLimited === true || status.status === "ACTIVE";
|
|
78406
78599
|
if (!reconnect) {
|
|
78407
78600
|
console.warn(
|
|
@@ -78483,7 +78676,7 @@ ${baseText}`;
|
|
|
78483
78676
|
label: "AgentVault",
|
|
78484
78677
|
selectionLabel: "AgentVault (E2E Encrypted)",
|
|
78485
78678
|
docsPath: "https://agentvault.chat/docs",
|
|
78486
|
-
blurb: "
|
|
78679
|
+
blurb: "End-to-end encrypted messaging between owners and their AI agents.",
|
|
78487
78680
|
aliases: ["av", "agent-vault"]
|
|
78488
78681
|
},
|
|
78489
78682
|
capabilities: {
|
|
@@ -100464,7 +100657,7 @@ data:
|
|
|
100464
100657
|
await init_skill_telemetry();
|
|
100465
100658
|
await init_policy_enforcer();
|
|
100466
100659
|
init_room_protocol();
|
|
100467
|
-
VERSION = true ? "0.23.
|
|
100660
|
+
VERSION = true ? "0.23.47" : "0.0.0-dev";
|
|
100468
100661
|
}
|
|
100469
100662
|
});
|
|
100470
100663
|
await init_index();
|
|
@@ -100672,6 +100865,77 @@ var init_config = __esm({
|
|
|
100672
100865
|
}
|
|
100673
100866
|
});
|
|
100674
100867
|
|
|
100868
|
+
// src/enrollment-fingerprint.ts
|
|
100869
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
100870
|
+
import { join as join9 } from "node:path";
|
|
100871
|
+
function fingerprintLines(fingerprint) {
|
|
100872
|
+
return [
|
|
100873
|
+
`Fingerprint: ${fingerprint}`,
|
|
100874
|
+
"Verify this fingerprint matches the one shown in your AgentVault dashboard before clicking Approve."
|
|
100875
|
+
];
|
|
100876
|
+
}
|
|
100877
|
+
function pendingFingerprintPath(dataDir) {
|
|
100878
|
+
return join9(dataDir, PENDING_FINGERPRINT_FILE);
|
|
100879
|
+
}
|
|
100880
|
+
function writePendingFingerprint(dataDir, fingerprint) {
|
|
100881
|
+
try {
|
|
100882
|
+
mkdirSync3(dataDir, { recursive: true, mode: 448 });
|
|
100883
|
+
writeFileSync2(pendingFingerprintPath(dataDir), fingerprint, { mode: 384 });
|
|
100884
|
+
} catch {
|
|
100885
|
+
}
|
|
100886
|
+
}
|
|
100887
|
+
function readPendingFingerprint(dataDir) {
|
|
100888
|
+
const p2 = pendingFingerprintPath(dataDir);
|
|
100889
|
+
if (!existsSync3(p2)) return void 0;
|
|
100890
|
+
try {
|
|
100891
|
+
const raw = readFileSync4(p2, "utf-8").trim();
|
|
100892
|
+
return raw.length > 0 ? raw : void 0;
|
|
100893
|
+
} catch {
|
|
100894
|
+
return void 0;
|
|
100895
|
+
}
|
|
100896
|
+
}
|
|
100897
|
+
function clearPendingFingerprint(dataDir) {
|
|
100898
|
+
try {
|
|
100899
|
+
rmSync2(pendingFingerprintPath(dataDir), { force: true });
|
|
100900
|
+
} catch {
|
|
100901
|
+
}
|
|
100902
|
+
}
|
|
100903
|
+
function sleepSync(ms2) {
|
|
100904
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms2);
|
|
100905
|
+
}
|
|
100906
|
+
function waitForPendingFingerprint(dataDir, opts = {}) {
|
|
100907
|
+
const timeoutMs = opts.timeoutMs ?? 3e4;
|
|
100908
|
+
const intervalMs = opts.intervalMs ?? 250;
|
|
100909
|
+
const sleep = opts.sleep ?? sleepSync;
|
|
100910
|
+
const now = opts.now ?? Date.now;
|
|
100911
|
+
const deadline = now() + timeoutMs;
|
|
100912
|
+
for (; ; ) {
|
|
100913
|
+
const fp = readPendingFingerprint(dataDir);
|
|
100914
|
+
if (fp) return fp;
|
|
100915
|
+
if (now() >= deadline) return void 0;
|
|
100916
|
+
sleep(intervalMs);
|
|
100917
|
+
}
|
|
100918
|
+
}
|
|
100919
|
+
function watchEnrollmentFingerprint(channel, dataDir, log) {
|
|
100920
|
+
channel.on("state", (s10) => {
|
|
100921
|
+
if (s10 === "polling") {
|
|
100922
|
+
const fp = channel.fingerprint;
|
|
100923
|
+
if (!fp) return;
|
|
100924
|
+
for (const line of fingerprintLines(fp)) log(line);
|
|
100925
|
+
writePendingFingerprint(dataDir, fp);
|
|
100926
|
+
} else if (s10 === "ready") {
|
|
100927
|
+
clearPendingFingerprint(dataDir);
|
|
100928
|
+
}
|
|
100929
|
+
});
|
|
100930
|
+
}
|
|
100931
|
+
var PENDING_FINGERPRINT_FILE;
|
|
100932
|
+
var init_enrollment_fingerprint = __esm({
|
|
100933
|
+
"src/enrollment-fingerprint.ts"() {
|
|
100934
|
+
"use strict";
|
|
100935
|
+
PENDING_FINGERPRINT_FILE = "pending-fingerprint";
|
|
100936
|
+
}
|
|
100937
|
+
});
|
|
100938
|
+
|
|
100675
100939
|
// src/service/launcher.ts
|
|
100676
100940
|
import { dirname as dirname4 } from "node:path";
|
|
100677
100941
|
function sq2(s10) {
|
|
@@ -100724,7 +100988,7 @@ var init_launcher = __esm({
|
|
|
100724
100988
|
});
|
|
100725
100989
|
|
|
100726
100990
|
// src/service/spec.ts
|
|
100727
|
-
import { join as
|
|
100991
|
+
import { join as join11 } from "node:path";
|
|
100728
100992
|
function buildServiceSpec(cfg, opts) {
|
|
100729
100993
|
const env = {
|
|
100730
100994
|
AV_AGENT_NAME: cfg.agentName,
|
|
@@ -100737,7 +101001,7 @@ function buildServiceSpec(cfg, opts) {
|
|
|
100737
101001
|
if (cfg.armRoom) env.AV_ARM_ROOM = "1";
|
|
100738
101002
|
if (cfg.model) env.AV_CLAUDE_MODEL = cfg.model;
|
|
100739
101003
|
if (cfg.systemPrompt) env.AV_SYSTEM_PROMPT = cfg.systemPrompt;
|
|
100740
|
-
const launcherPath =
|
|
101004
|
+
const launcherPath = join11(cfg.dataDir, "launch-bridge.sh");
|
|
100741
101005
|
return {
|
|
100742
101006
|
label: `dev.agentvault.bridge-${slugify2(cfg.agentName)}`,
|
|
100743
101007
|
programArgs: [launcherPath],
|
|
@@ -100745,8 +101009,8 @@ function buildServiceSpec(cfg, opts) {
|
|
|
100745
101009
|
launcherScript: renderLauncher({ installPath: opts.path, entrypoint: opts.entrypoint }),
|
|
100746
101010
|
env,
|
|
100747
101011
|
workingDir: cfg.workspaceDir ? cfg.workspaceDir : opts.home,
|
|
100748
|
-
logOut:
|
|
100749
|
-
logErr:
|
|
101012
|
+
logOut: join11(cfg.dataDir, "logs", "bridge.log"),
|
|
101013
|
+
logErr: join11(cfg.dataDir, "logs", "bridge.error.log"),
|
|
100750
101014
|
keepAliveUnlessCleanExit: true,
|
|
100751
101015
|
runAtLoad: true
|
|
100752
101016
|
};
|
|
@@ -100760,7 +101024,7 @@ var init_spec = __esm({
|
|
|
100760
101024
|
});
|
|
100761
101025
|
|
|
100762
101026
|
// src/service/launchd.ts
|
|
100763
|
-
import { dirname as dirname5, join as
|
|
101027
|
+
import { dirname as dirname5, join as join12 } from "node:path";
|
|
100764
101028
|
function esc3(s10) {
|
|
100765
101029
|
return s10.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
100766
101030
|
}
|
|
@@ -100838,7 +101102,7 @@ var init_launchd = __esm({
|
|
|
100838
101102
|
}
|
|
100839
101103
|
deps;
|
|
100840
101104
|
plistPath(label) {
|
|
100841
|
-
return
|
|
101105
|
+
return join12(this.deps.home, "Library", "LaunchAgents", `${label}.plist`);
|
|
100842
101106
|
}
|
|
100843
101107
|
domain() {
|
|
100844
101108
|
return `gui/${this.deps.uid}`;
|
|
@@ -100888,11 +101152,11 @@ var init_launchd = __esm({
|
|
|
100888
101152
|
* KeepAlive leaves it down. `launchctl list` would not show the very thing
|
|
100889
101153
|
* doctor exists to find. */
|
|
100890
101154
|
list(prefix) {
|
|
100891
|
-
const dir =
|
|
101155
|
+
const dir = join12(this.deps.home, "Library", "LaunchAgents");
|
|
100892
101156
|
const out = [];
|
|
100893
101157
|
for (const name of this.deps.readdir(dir)) {
|
|
100894
101158
|
if (!name.startsWith(prefix) || !name.endsWith(".plist")) continue;
|
|
100895
|
-
const path2 =
|
|
101159
|
+
const path2 = join12(dir, name);
|
|
100896
101160
|
out.push({
|
|
100897
101161
|
label: name.slice(0, -".plist".length),
|
|
100898
101162
|
path: path2,
|
|
@@ -100906,7 +101170,7 @@ var init_launchd = __esm({
|
|
|
100906
101170
|
});
|
|
100907
101171
|
|
|
100908
101172
|
// src/service/systemd.ts
|
|
100909
|
-
import { dirname as dirname6, join as
|
|
101173
|
+
import { dirname as dirname6, join as join13 } from "node:path";
|
|
100910
101174
|
function q5(s10) {
|
|
100911
101175
|
const esc4 = s10.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/%/g, "%%");
|
|
100912
101176
|
return `"${esc4}"`;
|
|
@@ -100961,7 +101225,7 @@ var init_systemd = __esm({
|
|
|
100961
101225
|
}
|
|
100962
101226
|
deps;
|
|
100963
101227
|
unitPath(label) {
|
|
100964
|
-
return
|
|
101228
|
+
return join13(this.deps.home, ".config", "systemd", "user", `${label}.service`);
|
|
100965
101229
|
}
|
|
100966
101230
|
install(spec) {
|
|
100967
101231
|
const path2 = this.unitPath(spec.label);
|
|
@@ -100998,11 +101262,11 @@ var init_systemd = __esm({
|
|
|
100998
101262
|
* SuccessExitStatus=0 treats as success, so it is never restarted. A
|
|
100999
101263
|
* running-units listing would not show the thing doctor exists to find. */
|
|
101000
101264
|
list(prefix) {
|
|
101001
|
-
const dir =
|
|
101265
|
+
const dir = join13(this.deps.home, ".config", "systemd", "user");
|
|
101002
101266
|
const out = [];
|
|
101003
101267
|
for (const name of this.deps.readdir(dir)) {
|
|
101004
101268
|
if (!name.startsWith(prefix) || !name.endsWith(".service")) continue;
|
|
101005
|
-
const path2 =
|
|
101269
|
+
const path2 = join13(dir, name);
|
|
101006
101270
|
out.push({
|
|
101007
101271
|
label: name.slice(0, -".service".length),
|
|
101008
101272
|
path: path2,
|
|
@@ -101017,7 +101281,7 @@ var init_systemd = __esm({
|
|
|
101017
101281
|
|
|
101018
101282
|
// src/service/backend.ts
|
|
101019
101283
|
import { spawnSync } from "node:child_process";
|
|
101020
|
-
import { mkdirSync as
|
|
101284
|
+
import { mkdirSync as mkdirSync6, writeFileSync as writeFileSync4, rmSync as rmSync5, existsSync as existsSync5, chmodSync as chmodSync4, readdirSync as readdirSync3, readFileSync as readFileSync7 } from "node:fs";
|
|
101021
101285
|
import { userInfo } from "node:os";
|
|
101022
101286
|
function defaultDeps() {
|
|
101023
101287
|
return {
|
|
@@ -101028,11 +101292,11 @@ function defaultDeps() {
|
|
|
101028
101292
|
const r7 = spawnSync(cmd, args, { encoding: "utf8" });
|
|
101029
101293
|
return { code: r7.status ?? 1, stdout: r7.stdout ?? "" };
|
|
101030
101294
|
},
|
|
101031
|
-
writeFile: (p2, d10) =>
|
|
101032
|
-
mkdir: (p2) =>
|
|
101295
|
+
writeFile: (p2, d10) => writeFileSync4(p2, d10),
|
|
101296
|
+
mkdir: (p2) => mkdirSync6(p2, { recursive: true }),
|
|
101033
101297
|
chmod: (p2, m6) => chmodSync4(p2, m6),
|
|
101034
|
-
rm: (p2) =>
|
|
101035
|
-
exists: (p2) =>
|
|
101298
|
+
rm: (p2) => rmSync5(p2, { force: true }),
|
|
101299
|
+
exists: (p2) => existsSync5(p2),
|
|
101036
101300
|
readdir: (p2) => {
|
|
101037
101301
|
try {
|
|
101038
101302
|
return readdirSync3(p2);
|
|
@@ -101042,7 +101306,7 @@ function defaultDeps() {
|
|
|
101042
101306
|
},
|
|
101043
101307
|
readFile: (p2) => {
|
|
101044
101308
|
try {
|
|
101045
|
-
return
|
|
101309
|
+
return readFileSync7(p2, "utf8");
|
|
101046
101310
|
} catch {
|
|
101047
101311
|
return "";
|
|
101048
101312
|
}
|
|
@@ -101120,6 +101384,7 @@ function maybeRunServiceSubcommand(argv, env, deps) {
|
|
|
101120
101384
|
const firstBoot = !hasPersistedCreds(cfg.dataDir) && !!cfg.inviteToken;
|
|
101121
101385
|
if (firstBoot) {
|
|
101122
101386
|
writePendingInvite(cfg.dataDir, cfg.inviteToken);
|
|
101387
|
+
clearPendingFingerprint(cfg.dataDir);
|
|
101123
101388
|
}
|
|
101124
101389
|
const spec = buildServiceSpec(cfg, {
|
|
101125
101390
|
entrypoint,
|
|
@@ -101132,6 +101397,15 @@ function maybeRunServiceSubcommand(argv, env, deps) {
|
|
|
101132
101397
|
backend.install(spec);
|
|
101133
101398
|
log(`installed service ${spec.label} \u2014 logs: ${spec.logErr}`);
|
|
101134
101399
|
if (firstBoot) {
|
|
101400
|
+
const waitFp = deps?.waitForFingerprint ?? (deps?.backend ? () => void 0 : waitForPendingFingerprint);
|
|
101401
|
+
const fp = waitFp(cfg.dataDir);
|
|
101402
|
+
if (fp) {
|
|
101403
|
+
for (const line of fingerprintLines(fp)) log(line);
|
|
101404
|
+
} else {
|
|
101405
|
+
log(
|
|
101406
|
+
`the device fingerprint is not available yet \u2014 see it with: AV_AGENT_NAME=${cfg.agentName} agentvault-claude-bridge status`
|
|
101407
|
+
);
|
|
101408
|
+
}
|
|
101135
101409
|
log("now APPROVE the device in AgentVault \u2014 the service is waiting to enrol");
|
|
101136
101410
|
log("if it does not connect within a minute, the log above says why");
|
|
101137
101411
|
}
|
|
@@ -101150,6 +101424,15 @@ function maybeRunServiceSubcommand(argv, env, deps) {
|
|
|
101150
101424
|
const label = resolveLabel(backend, env);
|
|
101151
101425
|
const st = backend.status(label);
|
|
101152
101426
|
log(`${label}: ${st.loaded ? "loaded" : "not loaded"}`);
|
|
101427
|
+
let pendingFp;
|
|
101428
|
+
try {
|
|
101429
|
+
pendingFp = readPendingFingerprint(resolveDataDir(env).dataDir);
|
|
101430
|
+
} catch {
|
|
101431
|
+
pendingFp = void 0;
|
|
101432
|
+
}
|
|
101433
|
+
if (pendingFp) {
|
|
101434
|
+
for (const line of fingerprintLines(pendingFp)) log(line);
|
|
101435
|
+
}
|
|
101153
101436
|
} else if (cmd === "logs") {
|
|
101154
101437
|
const label = resolveLabel(backend, env);
|
|
101155
101438
|
log(`logs for ${label} are at <dataDir>/logs/bridge.log (tail -f it)`);
|
|
@@ -101167,6 +101450,7 @@ var init_subcommand = __esm({
|
|
|
101167
101450
|
init_config();
|
|
101168
101451
|
init_spec();
|
|
101169
101452
|
init_pending_invite();
|
|
101453
|
+
init_enrollment_fingerprint();
|
|
101170
101454
|
init_backend();
|
|
101171
101455
|
SERVICE_CMDS = /* @__PURE__ */ new Set(["install", "uninstall", "restart", "status", "logs"]);
|
|
101172
101456
|
}
|
|
@@ -101401,7 +101685,7 @@ __export(doctor_cli_exports, {
|
|
|
101401
101685
|
maybeRunDoctorSubcommand: () => maybeRunDoctorSubcommand,
|
|
101402
101686
|
realDoctorDeps: () => realDoctorDeps
|
|
101403
101687
|
});
|
|
101404
|
-
import { join as
|
|
101688
|
+
import { join as join15 } from "node:path";
|
|
101405
101689
|
import { readdirSync as readdirSync5 } from "node:fs";
|
|
101406
101690
|
async function fetchDeviceStatus(apiUrl, deviceId, doFetch = fetch) {
|
|
101407
101691
|
const res = await doFetch(`${apiUrl}/api/v1/devices/${deviceId}/status`, {
|
|
@@ -101437,7 +101721,7 @@ function listCredDirs(base) {
|
|
|
101437
101721
|
return out;
|
|
101438
101722
|
}
|
|
101439
101723
|
for (const name of names) {
|
|
101440
|
-
const dir =
|
|
101724
|
+
const dir = join15(base, name);
|
|
101441
101725
|
if (hasPersistedCreds(dir)) out.push(dir);
|
|
101442
101726
|
}
|
|
101443
101727
|
return out;
|
|
@@ -101454,7 +101738,7 @@ function otherFamilyLabels(backend) {
|
|
|
101454
101738
|
}
|
|
101455
101739
|
function realDoctorDeps(env) {
|
|
101456
101740
|
const backend = selectBackend(process.platform);
|
|
101457
|
-
const base =
|
|
101741
|
+
const base = join15(env.HOME ?? "", ".agentvault", "claude-room-bridge");
|
|
101458
101742
|
return {
|
|
101459
101743
|
backend,
|
|
101460
101744
|
labelPrefixes: [LABEL_PREFIX, LEGACY_LABEL_PREFIX],
|
|
@@ -101511,8 +101795,9 @@ var init_doctor_cli = __esm({
|
|
|
101511
101795
|
await init_dist();
|
|
101512
101796
|
init_config();
|
|
101513
101797
|
init_pending_invite();
|
|
101514
|
-
|
|
101515
|
-
import {
|
|
101798
|
+
init_enrollment_fingerprint();
|
|
101799
|
+
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync8 } from "node:fs";
|
|
101800
|
+
import { join as join16 } from "node:path";
|
|
101516
101801
|
|
|
101517
101802
|
// ../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
101518
101803
|
import { createRequire as $S } from "node:module";
|
|
@@ -122813,8 +123098,8 @@ import { realpathSync as realpathSync2 } from "node:fs";
|
|
|
122813
123098
|
import { resolve as resolve4, dirname as dirname3, basename, sep as sep2, isAbsolute } from "node:path";
|
|
122814
123099
|
|
|
122815
123100
|
// src/host-trust.ts
|
|
122816
|
-
import { mkdirSync as
|
|
122817
|
-
import { join as
|
|
123101
|
+
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync3, rmSync as rmSync4, readdirSync as readdirSync2, lstatSync as lstatSync2, readFileSync as readFileSync6, chmodSync as chmodSync3 } from "node:fs";
|
|
123102
|
+
import { join as join10 } from "node:path";
|
|
122818
123103
|
import { homedir as homedir2, hostname as hostname3 } from "node:os";
|
|
122819
123104
|
var TRUST_SUBDIR = "host-trust";
|
|
122820
123105
|
var DIR_MODE4 = 448;
|
|
@@ -122824,7 +123109,7 @@ var IDENTITY_FILES = ["agentvault.json", "secure-channel.json", "agentvault.json
|
|
|
122824
123109
|
var HostTrustError = class extends Error {
|
|
122825
123110
|
};
|
|
122826
123111
|
function trustDir(root3) {
|
|
122827
|
-
return
|
|
123112
|
+
return join10(root3 ?? join10(homedir2(), ".agentvault"), TRUST_SUBDIR);
|
|
122828
123113
|
}
|
|
122829
123114
|
function sanitize(deviceId) {
|
|
122830
123115
|
if (typeof deviceId !== "string" || !ID_RE.test(deviceId)) {
|
|
@@ -122835,7 +123120,7 @@ function sanitize(deviceId) {
|
|
|
122835
123120
|
function isTrusted(deviceId, root3) {
|
|
122836
123121
|
try {
|
|
122837
123122
|
if (typeof deviceId !== "string" || !ID_RE.test(deviceId)) return false;
|
|
122838
|
-
const p2 =
|
|
123123
|
+
const p2 = join10(trustDir(root3), deviceId);
|
|
122839
123124
|
return lstatSync2(p2).isFile();
|
|
122840
123125
|
} catch {
|
|
122841
123126
|
return false;
|
|
@@ -122844,9 +123129,9 @@ function isTrusted(deviceId, root3) {
|
|
|
122844
123129
|
function grant(deviceId, root3) {
|
|
122845
123130
|
const id = sanitize(deviceId);
|
|
122846
123131
|
const dir = trustDir(root3);
|
|
122847
|
-
const p2 =
|
|
122848
|
-
|
|
122849
|
-
|
|
123132
|
+
const p2 = join10(dir, id);
|
|
123133
|
+
mkdirSync5(dir, { recursive: true, mode: DIR_MODE4 });
|
|
123134
|
+
writeFileSync3(
|
|
122850
123135
|
p2,
|
|
122851
123136
|
`granted_at=${(/* @__PURE__ */ new Date()).toISOString()} host=${hostname3()}
|
|
122852
123137
|
`,
|
|
@@ -122857,13 +123142,13 @@ function grant(deviceId, root3) {
|
|
|
122857
123142
|
}
|
|
122858
123143
|
function revoke(deviceId, root3) {
|
|
122859
123144
|
const id = sanitize(deviceId);
|
|
122860
|
-
const p2 =
|
|
123145
|
+
const p2 = join10(trustDir(root3), id);
|
|
122861
123146
|
try {
|
|
122862
123147
|
if (!lstatSync2(p2).isFile()) return false;
|
|
122863
123148
|
} catch {
|
|
122864
123149
|
return false;
|
|
122865
123150
|
}
|
|
122866
|
-
|
|
123151
|
+
rmSync4(p2, { force: true });
|
|
122867
123152
|
return true;
|
|
122868
123153
|
}
|
|
122869
123154
|
function listTrusted(root3) {
|
|
@@ -122878,7 +123163,7 @@ function listTrusted(root3) {
|
|
|
122878
123163
|
function readDeviceId(dataDir) {
|
|
122879
123164
|
for (const f7 of IDENTITY_FILES) {
|
|
122880
123165
|
try {
|
|
122881
|
-
const parsed = JSON.parse(
|
|
123166
|
+
const parsed = JSON.parse(readFileSync6(join10(dataDir, f7), "utf-8"));
|
|
122882
123167
|
if (parsed?.deviceId && ID_RE.test(parsed.deviceId)) return parsed.deviceId;
|
|
122883
123168
|
} catch {
|
|
122884
123169
|
}
|
|
@@ -137497,8 +137782,25 @@ function selfUninstallOnTerminal(reason, env, deps = {}) {
|
|
|
137497
137782
|
}
|
|
137498
137783
|
|
|
137499
137784
|
// src/approve-cli.ts
|
|
137500
|
-
import { mkdirSync as
|
|
137501
|
-
import { join as
|
|
137785
|
+
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync5, readFileSync as readFileSync8, readdirSync as readdirSync4, rmSync as rmSync6, existsSync as existsSync6 } from "node:fs";
|
|
137786
|
+
import { join as join14 } from "node:path";
|
|
137787
|
+
|
|
137788
|
+
// src/cli-hint.ts
|
|
137789
|
+
var BRIDGE_BINARY = "agentvault-claude-bridge";
|
|
137790
|
+
function shellQuote(value) {
|
|
137791
|
+
return /^[A-Za-z0-9._-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
137792
|
+
}
|
|
137793
|
+
var HINT_ID_RE = /^[A-Za-z0-9_-]{1,128}$/;
|
|
137794
|
+
function isHintSafeId(value) {
|
|
137795
|
+
return typeof value === "string" && HINT_ID_RE.test(value);
|
|
137796
|
+
}
|
|
137797
|
+
function bridgeCommand(subcommand, agentName) {
|
|
137798
|
+
const name = agentName?.trim();
|
|
137799
|
+
const value = !name ? "<name>" : shellQuote(name);
|
|
137800
|
+
return `AV_AGENT_NAME=${value} ${BRIDGE_BINARY} ${subcommand}`;
|
|
137801
|
+
}
|
|
137802
|
+
|
|
137803
|
+
// src/approve-cli.ts
|
|
137502
137804
|
var APPROVALS_SUBDIR = "arm-approvals";
|
|
137503
137805
|
var ID_RE2 = /^[A-Za-z0-9_-]{1,128}$/;
|
|
137504
137806
|
var ApproveArmError = class extends Error {
|
|
@@ -137518,24 +137820,24 @@ function sanitizeRoomId(roomId) {
|
|
|
137518
137820
|
function writeApproval(dataDir, requestId, roomId) {
|
|
137519
137821
|
const id = sanitizeRequestId(requestId);
|
|
137520
137822
|
const room = sanitizeRoomId(roomId);
|
|
137521
|
-
const dir =
|
|
137522
|
-
|
|
137523
|
-
|
|
137823
|
+
const dir = join14(dataDir, APPROVALS_SUBDIR);
|
|
137824
|
+
mkdirSync7(dir, { recursive: true });
|
|
137825
|
+
writeFileSync5(join14(dir, id), room);
|
|
137524
137826
|
}
|
|
137525
137827
|
function drainApprovals(dataDir) {
|
|
137526
|
-
const dir =
|
|
137527
|
-
if (!
|
|
137828
|
+
const dir = join14(dataDir, APPROVALS_SUBDIR);
|
|
137829
|
+
if (!existsSync6(dir)) return [];
|
|
137528
137830
|
const out = [];
|
|
137529
137831
|
for (const name of readdirSync4(dir)) {
|
|
137530
137832
|
if (!ID_RE2.test(name)) continue;
|
|
137531
137833
|
let roomId = "";
|
|
137532
137834
|
try {
|
|
137533
|
-
roomId =
|
|
137835
|
+
roomId = readFileSync8(join14(dir, name), "utf8").trim();
|
|
137534
137836
|
} catch {
|
|
137535
137837
|
}
|
|
137536
137838
|
out.push({ requestId: name, roomId: ID_RE2.test(roomId) ? roomId : "" });
|
|
137537
137839
|
try {
|
|
137538
|
-
|
|
137840
|
+
rmSync6(join14(dir, name), { force: true, recursive: true });
|
|
137539
137841
|
} catch {
|
|
137540
137842
|
}
|
|
137541
137843
|
}
|
|
@@ -137588,7 +137890,7 @@ function maybeRunHostTrustSubcommand(argv, dataDir, root3) {
|
|
|
137588
137890
|
console.log(
|
|
137589
137891
|
`This machine will trust web-granted full access for device ${deviceId}.
|
|
137590
137892
|
Writes: ${trustDir(root3)}/${deviceId}
|
|
137591
|
-
Revoke:
|
|
137893
|
+
Revoke: ${bridgeCommand("untrust-host", process.env.AV_AGENT_NAME)}
|
|
137592
137894
|
Re-run with --yes to confirm.`
|
|
137593
137895
|
);
|
|
137594
137896
|
return true;
|
|
@@ -137842,7 +138144,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
137842
138144
|
const trustChanged = hostTrusted !== prevHostTrusted || gatesRemoved !== prevGatesEffective;
|
|
137843
138145
|
if (s10?.gatesRemoved === true && !decision.hostTrusted) {
|
|
137844
138146
|
log(
|
|
137845
|
-
`"Remove all gates" is ON for this device but this HOST has not approved it. Full access is NOT in effect. Grant on this machine:
|
|
138147
|
+
`"Remove all gates" is ON for this device but this HOST has not approved it. Full access is NOT in effect. Grant on this machine: ${bridgeCommand("trust-host", opts.agentName)}`
|
|
137846
138148
|
);
|
|
137847
138149
|
}
|
|
137848
138150
|
if (!workerCapable) {
|
|
@@ -137867,7 +138169,7 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
137867
138169
|
const dropped = arming.reconcileDisarm(roomIds);
|
|
137868
138170
|
if (dropped.length > 0) {
|
|
137869
138171
|
log(
|
|
137870
|
-
`arming_snapshot: OS-isolated worker \u2014 disarm-only without host trust (
|
|
138172
|
+
`arming_snapshot: OS-isolated worker \u2014 disarm-only without host trust (${bridgeCommand("trust-host", opts.agentName)}); disarmed: [${dropped.map((r7) => r7.slice(0, 8)).join(", ")}]`
|
|
137871
138173
|
);
|
|
137872
138174
|
}
|
|
137873
138175
|
} else {
|
|
@@ -137903,9 +138205,13 @@ function wireBridge(channel, session, target, opts = {}) {
|
|
|
137903
138205
|
return;
|
|
137904
138206
|
}
|
|
137905
138207
|
try {
|
|
137906
|
-
|
|
138208
|
+
if (!isHintSafeId(r7?.requestId) || !isHintSafeId(r7?.roomId)) {
|
|
138209
|
+
log("arm_requested ignored \u2014 request-id or room-id is not a plain id");
|
|
138210
|
+
return;
|
|
138211
|
+
}
|
|
138212
|
+
arming.registerArmRequest(r7.roomId, r7.requestId);
|
|
137907
138213
|
log(
|
|
137908
|
-
`[worker-gate] arm requested for room ${r7
|
|
138214
|
+
`[worker-gate] arm requested for room ${r7.roomId} \u2014 approve locally on the host: ` + bridgeCommand(`approve-arm ${r7.requestId} ${r7.roomId}`, opts.agentName)
|
|
137909
138215
|
);
|
|
137910
138216
|
} catch (err) {
|
|
137911
138217
|
log(`arm_requested handling failed (ignored): ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -137956,7 +138262,7 @@ async function main() {
|
|
|
137956
138262
|
"[bridge] warning: passing the invite token on the command line is visible to other local users via 'ps'. Prefer: AV_INVITE_TOKEN=\u2026 npx @agentvault/claude-bridge"
|
|
137957
138263
|
);
|
|
137958
138264
|
}
|
|
137959
|
-
logLine(`[bridge] version: ${true ? "0.8.
|
|
138265
|
+
logLine(`[bridge] version: ${true ? "0.8.19" : "dev"}`);
|
|
137960
138266
|
logLine(`[bridge] data dir: ${cfg.dataDir} (${cfg.dataDirSource})`);
|
|
137961
138267
|
logLine(`[bridge] workspace: ${cfg.workspaceDir} \xB7 permissions: ${cfg.permissionMode} \xB7 enclave dir fenced`);
|
|
137962
138268
|
if (cfg.armRoom) {
|
|
@@ -137988,7 +138294,7 @@ async function main() {
|
|
|
137988
138294
|
// its default would render "@agentvault/agentvault@0.7.x" — the wrong
|
|
137989
138295
|
// package name attached to the bridge's version number, which is worse
|
|
137990
138296
|
// than either alone.
|
|
137991
|
-
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.
|
|
138297
|
+
clientVersion: `@agentvault/claude-bridge@${true ? "0.8.19" : "dev"}`
|
|
137992
138298
|
});
|
|
137993
138299
|
const agentSystemPrompt = cfg.systemPrompt ?? `You are ${cfg.agentName}, an AI agent on AgentVault. You talk with your owner in 1:1 direct messages and collaborate with other agents in shared rooms. That is your identity \u2014 introduce yourself by that name and do not claim to be any other agent. To speak, call the say tool. In a 1:1 with your owner, reply to what they say. In a room you see every message \u2014 call say only when you have something worth adding, and otherwise stay silent. Keep messages concise.`;
|
|
137994
138300
|
const deviceJwt = () => {
|
|
@@ -138068,9 +138374,9 @@ async function main() {
|
|
|
138068
138374
|
`[worker-trap] ${rec.at} ${rec.outcome} after ${rec.ranMs}ms (waited ${rec.waitedMs}ms behind ${rec.queueDepthAtEnqueue}, ${rec.queueDepthAtStart} still queued) replyExpected=${rec.replyExpected}` + (rec.session ? ` composed=${rec.session.composedChars} result=${rec.session.sawResult} said=${rec.session.said}` : "")
|
|
138069
138375
|
);
|
|
138070
138376
|
try {
|
|
138071
|
-
const dir =
|
|
138072
|
-
|
|
138073
|
-
appendFileSync2(
|
|
138377
|
+
const dir = join16(cfg.dataDir, "logs");
|
|
138378
|
+
mkdirSync8(dir, { recursive: true });
|
|
138379
|
+
appendFileSync2(join16(dir, "worker-incidents.jsonl"), JSON.stringify(rec) + "\n");
|
|
138074
138380
|
} catch (err) {
|
|
138075
138381
|
logLine(`[worker-trap] could not persist incident: ${err.message}`);
|
|
138076
138382
|
}
|
|
@@ -138111,6 +138417,7 @@ async function main() {
|
|
|
138111
138417
|
}
|
|
138112
138418
|
});
|
|
138113
138419
|
channel.on("state", (s10) => logLine(`[bridge] channel state: ${JSON.stringify(s10)}`));
|
|
138420
|
+
watchEnrollmentFingerprint(channel, cfg.dataDir, (m6) => logLine(`[bridge] ${m6}`));
|
|
138114
138421
|
channel.on(
|
|
138115
138422
|
"room_joined",
|
|
138116
138423
|
(e7) => logLine(`[bridge] joined room ${e7.name} (${e7.roomId})`)
|
|
@@ -3,6 +3,10 @@ export interface ServiceCmdDeps {
|
|
|
3
3
|
backend: ServiceBackend;
|
|
4
4
|
entrypoint: string;
|
|
5
5
|
log: (msg: string) => void;
|
|
6
|
+
/** Wait for the freshly installed service to publish its enrolment
|
|
7
|
+
* fingerprint. Defaults to polling the data dir — but only for the REAL
|
|
8
|
+
* backend: an injected backend starts no daemon, so nothing would come. */
|
|
9
|
+
waitForFingerprint?: (dataDir: string) => string | undefined;
|
|
6
10
|
}
|
|
7
11
|
/**
|
|
8
12
|
* #837: resolve the label that is ACTUALLY loaded rather than assuming the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subcommand.d.ts","sourceRoot":"","sources":["../../src/service/subcommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subcommand.d.ts","sourceRoot":"","sources":["../../src/service/subcommand.ts"],"names":[],"mappings":"AASA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3B;;gFAE4E;IAC5E,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC9D;AAoCD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAMpF;AAED;;uFAEuF;AACvF,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAiJT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentvault/claude-bridge",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgentVault Claude Bridge — daemon for bridging a Claude agent into secure E2E-encrypted AgentVault 1:1 direct messages and rooms.",
|
|
6
6
|
"main": "dist/index.js",
|