@agentvault/muse-bridge 0.1.38 → 0.1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11845,11 +11845,11 @@ async function joinWithFirstMatchingKp(welcomeBytes, candidates) {
11845
11845
  return null;
11846
11846
  }
11847
11847
  function ownIdentity() {
11848
- const v2 = true ? "0.23.65" : FALLBACK;
11848
+ const v2 = true ? "0.23.66" : FALLBACK;
11849
11849
  return `${PACKAGE}@${v2}`;
11850
11850
  }
11851
11851
  function buildSha() {
11852
- const raw = true ? "2ee9fe7" : "";
11852
+ const raw = true ? "f354058" : "";
11853
11853
  const cleaned = (raw ?? "").trim();
11854
11854
  return !cleaned || cleaned === "unknown" ? null : cleaned;
11855
11855
  }
@@ -13641,6 +13641,54 @@ async function checkGateway(options) {
13641
13641
  return { ok: false, error: friendlyError(err) };
13642
13642
  }
13643
13643
  }
13644
+ function asTurnFailureCode(code) {
13645
+ return typeof code === "string" && CODES.has(code) ? code : "model_error";
13646
+ }
13647
+ function clean5(value, max) {
13648
+ if (typeof value !== "string") return "";
13649
+ return value.replace(/@/g, "").replace(/\s+/g, " ").trim().slice(0, max).trim();
13650
+ }
13651
+ function ownerNoticeFor(code, ctx) {
13652
+ const a2 = clean5(ctx?.agentName, 80) || "Your agent";
13653
+ const p2 = clean5(ctx?.provider, 40) || "AI provider";
13654
+ const head = `${a2} couldn't answer this message`;
13655
+ switch (asTurnFailureCode(code)) {
13656
+ case "provider_auth_failed":
13657
+ return `${head}: its ${p2} sign-in expired. Sign in again on the agent's computer.`;
13658
+ case "provider_billing":
13659
+ return `${head}: its ${p2} account is out of credit or has a billing problem.`;
13660
+ case "model_rate_limited":
13661
+ return `${head}: it is being rate-limited by ${p2}. Try again in a few minutes.`;
13662
+ case "model_unavailable":
13663
+ return `${head}: the model it is set to use is no longer available.`;
13664
+ case "provider_unreachable":
13665
+ return `${head}: it can't reach ${p2} right now.`;
13666
+ case "ai_tool_unsupported":
13667
+ return `${head}: its AI tool needs attention on its computer.`;
13668
+ case "plan_limit_reached":
13669
+ return `${head}: it has reached its ${p2} plan's usage limit.`;
13670
+ default:
13671
+ return `${head}.`;
13672
+ }
13673
+ }
13674
+ function isOwnerNotice(text) {
13675
+ return typeof text === "string" && NOTICE_RE.test(text);
13676
+ }
13677
+ function reportModelTurnFailure(sink, report) {
13678
+ try {
13679
+ const code = asTurnFailureCode(report.code);
13680
+ const isPlan = code === "plan_limit_reached";
13681
+ reportToolInvoke(sink, {
13682
+ toolName: "model_turn",
13683
+ outcome: "error",
13684
+ errorKind: code,
13685
+ durationMs: report.durationMs,
13686
+ conversation: isPlan ? { kind: "unknown" } : report.conversation,
13687
+ ...isPlan && report.limitResetsAt !== void 0 ? { limitResetsAt: report.limitResetsAt } : {}
13688
+ });
13689
+ } catch {
13690
+ }
13691
+ }
13644
13692
  function getErrorMap() {
13645
13693
  return overrideErrorMap;
13646
13694
  }
@@ -18542,55 +18590,7 @@ function reportSkillInvocation(opts) {
18542
18590
  spanBuffer.push(span);
18543
18591
  return span;
18544
18592
  }
18545
- function asTurnFailureCode(code) {
18546
- return typeof code === "string" && CODES.has(code) ? code : "model_error";
18547
- }
18548
- function clean5(value, max) {
18549
- if (typeof value !== "string") return "";
18550
- return value.replace(/@/g, "").replace(/\s+/g, " ").trim().slice(0, max).trim();
18551
- }
18552
- function ownerNoticeFor(code, ctx) {
18553
- const a2 = clean5(ctx?.agentName, 80) || "Your agent";
18554
- const p2 = clean5(ctx?.provider, 40) || "AI provider";
18555
- const head = `${a2} couldn't answer this message`;
18556
- switch (asTurnFailureCode(code)) {
18557
- case "provider_auth_failed":
18558
- return `${head}: its ${p2} sign-in expired. Sign in again on the agent's computer.`;
18559
- case "provider_billing":
18560
- return `${head}: its ${p2} account is out of credit or has a billing problem.`;
18561
- case "model_rate_limited":
18562
- return `${head}: it is being rate-limited by ${p2}. Try again in a few minutes.`;
18563
- case "model_unavailable":
18564
- return `${head}: the model it is set to use is no longer available.`;
18565
- case "provider_unreachable":
18566
- return `${head}: it can't reach ${p2} right now.`;
18567
- case "ai_tool_unsupported":
18568
- return `${head}: its AI tool needs attention on its computer.`;
18569
- case "plan_limit_reached":
18570
- return `${head}: it has reached its ${p2} plan's usage limit.`;
18571
- default:
18572
- return `${head}.`;
18573
- }
18574
- }
18575
- function isOwnerNotice(text) {
18576
- return typeof text === "string" && NOTICE_RE.test(text);
18577
- }
18578
- function reportModelTurnFailure(sink, report) {
18579
- try {
18580
- const code = asTurnFailureCode(report.code);
18581
- const isPlan = code === "plan_limit_reached";
18582
- reportToolInvoke(sink, {
18583
- toolName: "model_turn",
18584
- outcome: "error",
18585
- errorKind: code,
18586
- durationMs: report.durationMs,
18587
- conversation: isPlan ? { kind: "unknown" } : report.conversation,
18588
- ...isPlan && report.limitResetsAt !== void 0 ? { limitResetsAt: report.limitResetsAt } : {}
18589
- });
18590
- } catch {
18591
- }
18592
- }
18593
- var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, PRIVATE_ROOM_TURN_NOTE, GENERIC_AGENT_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto3, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, DECRYPTED_IDS_FILE, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, NOT_A_MEMBER_DETAIL, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, _heartbeatFn, init_openclaw_compat, TOOL_INVOKE_SPAN_NAME, UNCLASSIFIED_ERROR, KNOWN_TOOL_ERROR_CODES, KNOWN_CODES, CLASS_NAME_RE, TOOL_NAME_RE, ERROR_TEXT_CODES, _conversation, init_tool_telemetry, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, ROOM_ROSTER_REFRESH_TIMEOUT_MS, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, TURN_FAILURE_CODES, CODES, TurnFailure, NOTICE_RE, init_turn_failure, VERSION, init_index;
18593
+ var __create, __defProp2, __getOwnPropDesc, __getOwnPropNames2, __getProtoOf, __hasOwnProp, __esm2, __commonJS, __export2, __copyProps, __toESM, SENTINEL, WRAPPERS, INSTRUCTION, init_abstention, AMBIGUOUS_OWNER_ERROR, init_owner_routing, init_envelope_text, init_mls_commit_classify, MENTION_RE, BROADCAST_NAMES, PRIVATE_ROOM_TURN_NOTE, GENERIC_AGENT_NAMES, init_room_protocol, __filename, __dirname, url, path, Module, Module, root, window_, crypto_, randomValuesStandard, crypto2, randomValueNodeJS, _Module, libsodium_sumo_default, init_libsodium_sumo, a, r, t, c, libsodium_wrappers_default, init_libsodium_wrappers, init_keys, init_x3dh, MAX_SKIP, CHAIN_KEY_SEED, MSG_KEY_SEED, HEADER_KEY_SEED, DoubleRatchet, init_ratchet, init_file_crypto, DOMAIN_DID_DOCUMENT, DOMAIN_TRANSFER_INTENT, DOMAIN_TRANSFER_ACCEPT, BASE58_ALPHABET, init_did, BUILTIN_PATTERNS, ScanEngine, init_scan_engine, init_merkle, VC_CONTEXT_V2, AV_CREDENTIAL_CONTEXT, CRYPTOSUITE, BASE58_ALPHABET2, init_vc, init_transport, init_telemetry, TelemetryReporter, init_telemetry_reporter, CROCKFORD, ARGON2_OPSLIMIT, ARGON2_MEMLIMIT, SALT_BYTES, NONCE_BYTES, KEY_BYTES, BACKUP_VERSION, MAX_BACKUP_SIZE, init_backup, atitle, aobject, aopts, isLE, swap8IfBE, swap32IfBE, hasHexBuiltin, hexes, oidNist, init_utils, BSIGMA, init_blake, U32_MASK64, _32n, fromNumH, fromNumL, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, add3L, add3H, add4L, add4H, add5L, add5H, init_u64, HashMD, SHA256_IV, SHA384_IV, SHA512_IV, init_md, B2B_IV, BBUF, _BLAKE2, _BLAKE2b, blake2b, init_blake2, CROCKFORD2, SALT_BYTES2, NONCE_BYTES2, KEY_BYTES2, TAG_BYTES, ENVELOPE_OVERHEAD, AAD_PREFIX, UUID_RE, UUID_V4_RE, DIGEST_ID_RE, TIMESTAMP_RE, encoder, decoder, HISTORY_MAGIC, HISTORY_ARCHIVE_VERSION, HISTORY_MAX_ENTRIES, HISTORY_MAX_BLOB_BYTES, HISTORY_KDF_OPSLIMIT, HISTORY_KDF_MEMLIMIT, HistoryEntryTooLargeError, init_history_backup, init_approval, encVoid, init_tlsEncoder, uint8Encoder, encodeUint8, decodeUint8, uint16Encoder, encodeUint16, decodeUint16, uint32Encoder, encodeUint32, decodeUint32, uint64Encoder, encodeUint64, decodeUint64, init_number, init_tlsDecoder, init_enumHelpers, defaultProposalTypes, defaultProposalTypeEncoder, encodeDefaultProposalType, decodeDefaultProposalType, init_defaultProposalType, defaultExtensionTypes, defaultExtensionTypeEncoder, encodeDefaultExtensionType, decodeDefaultExtensionType, init_defaultExtensionType, acceptAll, init_incomingMessageAction, MlsError, ValidationError, CodecError, UsageError, DependencyError, CryptoVerificationError, CryptoError, InternalError, init_mlsError, init_byteArray, varLenDataEncoder, decodeVarLenData, init_variableLength, init_constantTimeCompare, extensionTypeEncoder, encodeExtensionType, decodeExtensionType, extensionEncoder, encodeExtension, decodeExtension, init_extension, credentialTypes, credentialTypeEncoder, encodeCredentialType, decodeCredentialType, init_credentialType, credentialBasicEncoder, encodeCredentialBasic, credentialX509Encoder, encodeCredentialX509, credentialCustomEncoder, encodeCredentialCustom, credentialEncoder, encodeCredential, decodeCredentialBasic, decodeCredentialX509, decodeCredential, init_credential, externalSenderEncoder, encodeExternalSender, decodeExternalSender, init_externalSender, init_hash, init_optional, ciphersuites, ciphersuiteEncoder, encodeCiphersuite, decodeCiphersuite, ciphersuiteValues, init_ciphersuite, init_signature, protocolVersions, protocolVersionEncoder, encodeProtocolVersion, decodeProtocolVersion, init_protocolVersion, capabilitiesEncoder, encodeCapabilities, decodeCapabilities, init_capabilities, leafNodeSources, leafNodeSourceEncoder, encodeLeafNodeSource, decodeLeafNodeSource, init_leafNodeSource, lifetimeEncoder, encodeLifetime, decodeLifetime, defaultLifetime, init_lifetime, leafNodeDataEncoder, encodeLeafNodeData, decodeLeafNodeData, leafNodeInfoKeyPackageEncoder, encodeLeafNodeInfoKeyPackage, leafNodeInfoUpdateOmittedEncoder, encodeLeafNodeInfoUpdateOmitted, leafNodeInfoCommitOmittedEncoder, encodeLeafNodeInfoCommitOmitted, leafNodeInfoOmittedEncoder, encodeLeafNodeInfoOmitted, decodeLeafNodeInfoKeyPackage, decodeLeafNodeInfoUpdateOmitted, decodeLeafNodeInfoCommitOmitted, decodeLeafNodeInfoOmitted, leafNodeInfoUpdateEncoder, encodeLeafNodeInfoUpdate, leafNodeInfoCommitEncoder, encodeLeafNodeInfoCommit, leafNodeInfoEncoder, encodeLeafNodeInfo, decodeLeafNodeInfoUpdate, decodeLeafNodeInfoCommit, decodeLeafNodeInfo, leafNodeTBSEncoder, encodeLeafNodeTBS, leafNodeEncoder, encodeLeafNode, decodeLeafNode, decodeLeafNodeKeyPackage, decodeLeafNodeCommit, decodeLeafNodeUpdate, init_leafNode, keyPackageTBSEncoder, encodeKeyPackageTBS, decodeKeyPackageTBS, keyPackageEncoder, encodeKeyPackage, decodeKeyPackage, init_keyPackage, init_kdf, pskTypes, pskTypeEncoder, encodePskType, decodePskType, resumptionPSKUsages, resumptionPSKUsageEncoder, encodeResumptionPSKUsage, decodeResumptionPSKUsage, encodePskInfoExternal, encodePskInfoResumption, decodePskInfoResumption, pskInfoEncoder, encodePskInfo, decodePskInfo, pskIdEncoder, encodePskId, decodePskId, pskLabelEncoder, encodePskLabel, decodePskLabel, init_presharedkey, addEncoder, encodeAdd, decodeAdd, updateEncoder, encodeUpdate, decodeUpdate, removeEncoder, encodeRemove, decodeRemove, pskEncoder, encodePSK, decodePSK, reinitEncoder, encodeReinit, decodeReinit, externalInitEncoder, encodeExternalInit, decodeExternalInit, groupContextExtensionsEncoder, encodeGroupContextExtensions, decodeGroupContextExtensions, proposalAddEncoder, encodeProposalAdd, proposalUpdateEncoder, encodeProposalUpdate, proposalRemoveEncoder, encodeProposalRemove, proposalPSKEncoder, encodeProposalPSK, proposalReinitEncoder, encodeProposalReinit, proposalExternalInitEncoder, encodeProposalExternalInit, proposalGroupContextExtensionsEncoder, encodeProposalGroupContextExtensions, proposalCustomEncoder, encodeProposalCustom, proposalEncoder, encodeProposal, decodeProposalAdd, decodeProposalUpdate, decodeProposalRemove, decodeProposalPSK, decodeProposalReinit, decodeProposalExternalInit, decodeProposalGroupContextExtensions, decodeProposal, init_proposal, proposalOrRefTypes, proposalOrRefTypeEncoder, encodeProposalOrRefType, decodeProposalOrRefType, proposalOrRefProposalEncoder, encodeProposalOrRefProposal, proposalOrRefProposalRefEncoder, encodeProposalOrRefProposalRef, proposalOrRefEncoder, encodeProposalOrRef, decodeProposalOrRef, init_proposalOrRefType, init_hpke, groupContextEncoder, encodeGroupContext, decodeGroupContext, init_groupContext, nodeTypes, nodeTypeEncoder, encodeNodeType, decodeNodeType, init_nodeType, parentNodeEncoder, encodeParentNode, decodeParentNode, init_parentNode, init_treemath, nodeEncoder, encodeNode, decodeNode, ratchetTreeEncoder, encodeRatchetTree, decodeRatchetTree, init_ratchetTree, leafNodeHashInputEncoder, encodeLeafNodeHashInput, decodeLeafNodeHashInput, parentNodeHashInputEncoder, encodeParentNodeHashInput, decodeParentNodeHashInput, treeHashInputEncoder, encodeTreeHashInput, decodeTreeHashInput, init_treeHash, parentHashInputEncoder, encodeParentHashInput, decodeParentHashInput, init_parentHash, hpkeCiphertextEncoder, encodeHpkeCiphertext, decodeHpkeCiphertext, init_hpkeCiphertext, updatePathNodeEncoder, encodeUpdatePathNode, decodeUpdatePathNode, updatePathEncoder, encodeUpdatePath, decodeUpdatePath, init_updatePath, commitEncoder, encodeCommit, decodeCommit, init_commit, contentTypes, contentTypeEncoder, encodeContentType, decodeContentType, init_contentType, wireformats, wireformatEncoder, encodeWireformat, decodeWireformat, init_wireformat, senderTypes, senderTypeEncoder, encodeSenderType, decodeSenderType, senderEncoder, encodeSender, decodeSender, reuseGuardEncoder, encodeReuseGuard, decodeReuseGuard, senderDataEncoder, encodeSenderData, decodeSenderData, senderDataAADEncoder, encodeSenderDataAAD, decodeSenderDataAAD, init_sender, framedContentApplicationDataEncoder, encodeFramedContentApplicationData, framedContentProposalDataEncoder, encodeFramedContentProposalData, framedContentCommitDataEncoder, encodeFramedContentCommitData, framedContentInfoEncoder, encodeFramedContentInfo, decodeFramedContentApplicationData, decodeFramedContentProposalData, decodeFramedContentCommitData, decodeFramedContentInfo, framedContentEncoder, encodeFramedContent, decodeFramedContent, senderInfoEncoder, encodeSenderInfo, framedContentTBSEncoder, encodeFramedContentTBS, encodeFramedContentAuthDataContent, encodeFramedContentAuthDataCommit, framedContentAuthDataEncoder, encodeFramedContentAuthData, decodeFramedContentAuthDataCommit, init_framedContent, authenticatedContentEncoder, encodeAuthenticatedContent, decodeAuthenticatedContent, authenticatedContentTBMEncoder, encodeAuthenticatedContentTBM, init_authenticatedContent, publicMessageInfoEncoder, encodePublicMessageInfo, publicMessageEncoder, encodePublicMessage, decodePublicMessage, init_publicMessage, init_messageProtectionPublic, init_externalProposal, requiredCapabilitiesEncoder, encodeRequiredCapabilities, decodeRequiredCapabilities, init_requiredCapabilities, defaultAuthenticationService, init_authenticationService, defaultPaddingConfig, init_paddingConfig, defaultKeyPackageEqualityConfig, init_keyPackageEqualityConfig, defaultLifetimeConfig, init_lifetimeConfig, defaultKeyRetentionConfig, init_keyRetentionConfig, groupInfoTBSEncoder, encodeGroupInfoTBS, decodeGroupInfoTBS, groupInfoEncoder, encodeGroupInfo, decodeGroupInfo, init_groupInfo, keyScheduleEncoder, encodeKeySchedule, decodeKeySchedule, init_keySchedule, generationSecretEncoder, decodeGenerationSecret, secretTreeNodeEncoder, decodeSecretTreeNode, secretTreeEncoder, decodeSecretTree, init_secretTree, confirmedTranscriptHashInputEncoder, encodeConfirmedTranscriptHashInput, decodeConfirmedTranscriptHashInput, init_transcriptHash, groupSecretsEncoder, encodeGroupSecrets, decodeGroupSecrets, init_groupSecrets, encryptedGroupSecretsEncoder, encodeEncryptedGroupSecrets, decodeEncryptedGroupSecrets, welcomeEncoder, encodeWelcome, decodeWelcome, init_welcome, init_pathSecrets, privateKeyPathEncoder, decodePrivateKeyPath, init_privateKeyPath, proposalWithSenderEncoder, decodeProposalWithSender, unappliedProposalsEncoder, decodeUnappliedProposals, init_unappliedProposals, emptyPskIndex, init_pskIndex, init_addToMap, defaultClientConfig, init_clientConfig, init_array, stringEncoder, encodeString, decodeString, init_string, activeEncoder, suspendedPendingReinitEncoder, removedFromGroupEncoder, groupActiveStateEncoder, decodeGroupActiveState, init_groupActiveState, epochReceiverDataEncoder, decodeEpochReceiverData, init_epochReceiverData, groupStateEncoder, encodeGroupState, decodeGroupState, groupStateEncoderWithoutTree, encodeGroupStateWithoutTree, emptyProposals, init_clientState, privateMessageEncoder, encodePrivateMessage, decodePrivateMessage, privateContentAADEncoder, encodePrivateContentAAD, decodePrivateContentAAD, init_privateMessage, init_messageProtection, init_createMessage, init_createCommit, init_processMessages, init_makeHashImpl, HpkeError, InvalidParamError, SerializeError, DeserializeError, EncapError, DecapError, ExportError, SealError, OpenError, MessageLimitReachedError, DeriveKeyPairError, NotSupportedError, init_errors, dntGlobals, dntGlobalThis, init_dnt_shims, NativeAlgorithm, init_algorithm, Mode, KemId, KdfId, AeadId, init_identifiers, INPUT_LENGTH_LIMIT, INFO_LENGTH_LIMIT, MINIMUM_PSK_LENGTH, EMPTY, BYTE_TO_BIGINT_256, init_consts, SUITE_ID_HEADER_KEM, init_kemInterface, HPKE_VERSION, HkdfNative, HkdfSha256Native, HkdfSha384Native, HkdfSha512Native, init_hkdf, isCryptoKeyPair, init_misc, LABEL_EAE_PRK, LABEL_SHARED_SECRET, Dhkem, init_dhkem, KEM_USAGES, LABEL_DKP_PRK, LABEL_SK, init_dhkemPrimitives, Bignum, init_bignum, LABEL_CANDIDATE, ORDER_P_256, ORDER_P_384, ORDER_P_521, PKCS8_ALG_ID_P_256, PKCS8_ALG_ID_P_384, PKCS8_ALG_ID_P_521, EC_P_256_PARAMS, EC_P_384_PARAMS, EC_P_521_PARAMS, Ec, init_ec, init_xCryptoKey, init_xCurve, init_hybridkem, AEAD_USAGES, init_aeadEncryptionContext, _endianTestBuffer, _endianTestBytes, isLE2, init_noble, init_hash2, _HMAC, hmac, init_hmac, init_md2, U32_MASK642, _32n2, init_u642, init_sha2, _0n, _1n, _2n, _7n, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, init_sha3, init_modular, init_curve, init_montgomery, init_mod, AesGcmContext, Aes128Gcm, Aes256Gcm, init_aesGcm, init_exportOnly, init_emitNotSupported, LABEL_SEC, ExporterContextImpl, RecipientExporterContextImpl, SenderExporterContextImpl, init_exporterContext, EncryptionContextImpl, init_encryptionContext, __classPrivateFieldGet, __classPrivateFieldSet, _Mutex_locked, Mutex, init_mutex, __classPrivateFieldGet2, __classPrivateFieldSet2, _RecipientContextImpl_mutex, RecipientContextImpl, init_recipientContext, __classPrivateFieldGet3, __classPrivateFieldSet3, _SenderContextImpl_mutex, SenderContextImpl, init_senderContext, LABEL_BASE_NONCE, LABEL_EXP, LABEL_INFO_HASH, LABEL_KEY, LABEL_PSK_ID_HASH, LABEL_SECRET, SUITE_ID_HEADER_HPKE, CipherSuiteNative, init_cipherSuiteNative, DhkemP256HkdfSha256Native, DhkemP384HkdfSha384Native, DhkemP521HkdfSha512Native, init_dhkemNative, CipherSuite, DhkemP256HkdfSha256, DhkemP384HkdfSha384, DhkemP521HkdfSha512, HkdfSha256, HkdfSha384, HkdfSha512, init_native, ALG_NAME, PKCS8_ALG_ID_X25519, BASE_POINT_X25519, X25519, init_x25519, DhkemX25519HkdfSha256, init_dhkemX25519, PKCS8_ALG_ID_X448, init_x448, init_dhkemX448, init_mod2, init_hpke2, isLE3, wrapCipher, init_utils2, encodeStr, sigma16, sigma32, sigma16_32, sigma32_32, BLOCK_LEN, BLOCK_LEN32, MAX_COUNTER, U32_EMPTY, _XorStreamPRG, createPRG, init_arx, Poly1305, poly1305, init_poly1305, chacha_exports, chacha20orig, chacha20, xchacha20, chacha8, chacha12, ZEROS16, updatePadded, ZEROS32, _poly1305_aead, chacha20poly1305, xchacha20poly1305, rngChacha20, rngChacha8, init_chacha, init_makeAead, init_makeKdfImpl, init_makeDhKem, init_makeHpke, defaultRng, init_rng, crypto3, init_cryptoNode, isLE4, swap32IfBE3, hasHexBuiltin2, hexes2, asciis, Hash, init_utils3, HashMD3, SHA256_IV3, SHA384_IV3, SHA512_IV3, init_md3, U32_MASK643, _32n3, shrSH3, shrSL3, rotrSH3, rotrSL3, rotrBH3, rotrBL3, rotlSH2, rotlSL2, rotlBH2, rotlBL2, add3L3, add3H3, add4L3, add4H3, add5L3, add5H3, init_u643, SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, SHA384, sha2563, sha5122, sha3842, init_sha22, _0n2, _1n2, isPosBig, bitMask, notImplemented, init_utils4, _0n3, _1n3, _2n2, _3n, _4n, _5n, _7n2, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS, init_modular2, _0n4, _1n4, pointPrecomputes, pointWindowSizes, wNAF, init_curve2, _0n5, _1n5, _2n3, _8n2, PrimeEdwardsPoint, init_edwards, os2ip, _DST_scalar, init_hash_to_curve, _0n6, _1n6, _2n4, init_montgomery2, ed25519_exports, _0n7, _1n7, _2n5, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, ed25519ctx, ed25519ph, x25519, ELL2_C1, ELL2_C2, ELL2_C3, ELL2_C1_EDWARDS, ed25519_hasher, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint, ristretto255, ristretto255_hasher, ED25519_TORSION_SUBGROUP, edwardsToMontgomery, RistrettoPoint, hashToCurve, encodeToCurve, hashToRistretto255, hash_to_ristretto255, init_ed25519, _0n8, _1n8, _2n6, _7n3, _256n2, _0x71n2, SHA3_PI2, SHA3_ROTL2, _SHA3_IOTA2, IOTAS2, SHA3_IOTA_H2, SHA3_IOTA_L2, rotlH, rotlL, Keccak, genShake, shake2562, init_sha32, ed448_exports, ed448_CURVE, E448_CURVE, shake256_114, shake256_64, _1n9, _2n7, _3n3, _4n2, _11n, _22n, _44n, _88n, _223n, Fp2, Fn2, Fp448, Fn448, ED448_DEF, ed448, ed448ph, E448, x448, ELL2_C12, ELL2_J, ed448_hasher, ONE_MINUS_D, ONE_MINUS_TWO_D, SQRT_MINUS_D, INVSQRT_MINUS_D, invertSqrt2, _DecafPoint, decaf448, decaf448_hasher, ED448_TORSION_SUBGROUP, DecafPoint, hashToCurve2, encodeToCurve2, hashToDecaf448, hash_to_decaf448, edwardsToMontgomery2, init_ed448, HMAC, hmac2, init_hmac2, divNearest, DERErr, DER, _0n9, _1n10, _2n8, _3n4, _4n3, init_weierstrass, init_shortw_utils, nist_exports, p256_CURVE, p384_CURVE, p521_CURVE, Fp256, Fp384, Fp521, p256, p256_hasher, p384, p384_hasher, p521, secp256r1, secp384r1, secp521r1, p521_hasher, init_nist, init_makeNobleSignatureImpl, defaultCryptoProvider, init_provider, init_getCiphersuiteImpl, init_resumption, SHA256_K2, SHA256_W2, SHA2_32B, _SHA256, K5122, SHA512_Kh2, SHA512_Kl2, SHA512_W_H2, SHA512_W_L2, SHA2_64B, _SHA512, _SHA384, sha2564, sha5123, sha3843, init_sha23, _HMAC2, hmac3, init_hmac3, init_makeHashImpl2, init_makeNobleSignatureImpl2, BLOCK_SIZE, ZEROS162, ZEROS322, POLY, mul2, swapLE, estimateWindow, GHASH, Polyval, ghash, polyval, init_polyval, BLOCK_SIZE2, BLOCK_SIZE32, EMPTY_BLOCK, POLY2, sbox, rotr32_8, rotl32_8, tableEncoding, xPowers, gcm, _CMAC, cmac, init_aes, init_makeAead2, init_makeKdfImpl2, init_makeDhKem2, init_makeHpke2, init_rng2, nobleCryptoProvider, init_provider2, mlsPublicMessageEncoder, encodeMlsPublicMessage, mlsWelcomeEncoder, encodeMlsWelcome, mlsPrivateMessageEncoder, encodeMlsPrivateMessage, mlsGroupInfoEncoder, encodeMlsGroupInfo, mlsKeyPackageEncoder, encodeMlsKeyPackage, mlsMessageContentEncoder, encodeMlsMessageContent, decodeMlsMessageContent, mlsMessageEncoder, encodeMlsMessage, decodeMlsMessage, init_message, greaseValues, defaultGreaseConfig, init_grease, init_defaultCapabilities, init_src, DEFAULT_CIPHERSUITE, MLSGroupManager, init_mls_group, DOMAIN, NONCE_BYTES3, init_owner_sync, init_mls_delivery_order, init_mls_presend_epoch, dist_exports2, init_dist2, DIR_MODE, FILE_MODE, init_secure_file, SYNC_LOCK_STALE_MS, pendingKpPath, DECRYPTED_IDS_FILE, init_mls_state, init_mls_kp_pool, PACKAGE, FALLBACK, MAX_LEN, DISALLOWED, init_client_version, CredentialStore, init_credential_store, init_crypto_helpers, STATE_FILE, LEGACY_STATE_FILE, init_state, ACTIVATION_DOMAIN, UUID_RE2, init_transport2, A2ALogGate, init_a2a_log_gate, NOT_A_MEMBER_DETAIL, init_mls_membership_probe, FIRST_DIRTY_DELAY_MS, RETRY_BASE_DELAYS_MS, MAX_RETRY_DELAY_MS, JITTER_FRACTION, HistoryBackupScheduler, init_history_backup_scheduler, FILE_MODE2, init_history_recovery_file, TENANT_ID_PATTERN, DIR_MODE2, FILE_MODE3, HISTORY_RECOVERY_VERIFY_TIMEOUT_MS, VERIFY_TIMEOUT_MESSAGE, HistoryRecoveryVerificationTimeoutError, init_history_recovery_code, ACTIONS, init_decision_reply, KP_BACKOFF_INITIAL_MS, KP_BACKOFF_MAX_MS, KP_RACE_RETRY_MS, KP_RACE_RETRY_LIMIT, consoleLogger, short, WelcomeKeyPackageBackoff, init_welcome_kp_backoff, history_backup_client_exports, HISTORY_RESTORE_TIMEOUT_MS, HISTORY_RESTORE_RESPONSE_MAX_BYTES, HISTORY_ENVELOPE_MIN_BYTES, HISTORY_AAD_PREFIX, UUID_RE3, GENERATION_RESPONSE_KEYS, utf8Encoder, utf8Decoder, HistoryBackupClient, init_history_backup_client, openclaw_compat_exports, defaultImporter, HEARTBEAT_CANDIDATES, _heartbeatFn, init_openclaw_compat, TOOL_INVOKE_SPAN_NAME, UNCLASSIFIED_ERROR, KNOWN_TOOL_ERROR_CODES, KNOWN_CODES, CLASS_NAME_RE, TOOL_NAME_RE, ERROR_TEXT_CODES, _conversation, init_tool_telemetry, http_handlers_exports, init_http_handlers, mcp_proxy_helpers_exports, init_mcp_proxy_helpers, workspace_handlers_exports, MAX_FILE_SIZE, init_workspace_handlers, ROOM_AGENT_TYPES, CREDENTIAL_MESSAGE_TYPES, CATCHUP_MESSAGE_TYPES, POLL_INTERVAL_MS, RECONNECT_BASE_MS, UUID_RE4, RECONNECT_MAX_MS, PENDING_POLL_INTERVAL_MS, HISTORY_RESTORE_TIMEOUT_MS2, ROOM_ROSTER_REFRESH_TIMEOUT_MS, HISTORY_UPLOAD_TIMEOUT_MS, CANONICAL_TIMESTAMP_RE, OUTBOUND_DEDUPE_WINDOW_MS, OUTBOUND_DEDUPE_MAX_SUPPRESS_MS, OUTBOUND_DEDUPE_MAX, OUTBOUND_DEDUPE_TYPES, RETRY_CANDIDATE_TTL_MS, RETRY_CANDIDATE_MAX, _turnConversation, PERSON_INVOLVED_WINDOW_MS, ATTESTED_INBOUND_MAX, UNMAPPED_RECONCILE_COOLDOWN_MS, TOPIC_ID_RE, ROOM_FULFIL_COOLDOWN_MS, SecureChannel, init_channel, init_types, DEFAULT_API_URL, DEFAULT_HTTP_PORT, init_account_config, init_lifecycle, _ocRuntime, _channels, agentVaultPlugin, init_openclaw_plugin, init_gateway_send, init_llm_response_parser, OPENROUTER_PRICING, init_llm_pricing_openrouter, LEGACY_PRICING, PRICING, init_llm_cost, traceStore, init_fetch_interceptor, init_tool_audit, init_harness_compat, TURN_FAILURE_CODES, CODES, TurnFailure, NOTICE_RE, init_turn_failure, AUTH_RE, BILLING_RE, RATE_RE, MODEL_GONE_RE, UNREACHABLE_RE, init_openclaw_turn_failure, managedRoutesRequested, init_openclaw_entry, util, objectUtil, ZodParsedType, getParsedType, init_util, ZodIssueCode, ZodError, init_ZodError, errorMap, en_default, init_en, overrideErrorMap, init_errors2, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, init_parseUtil, init_typeAliases, errorUtil, init_errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, jwtRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv4CidrRegex, ipv6Regex, ipv6CidrRegex, base64Regex, base64urlRegex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType, init_types2, init_external, init_v3, util_exports, Cached, EVALUATING, captureStackTrace, allowsEval, getParsedType2, propertyKeyTypes, primitiveTypes, NUMBER_FORMAT_RANGES, BIGINT_FORMAT_RANGES, highSurrogate, Class, installing, broke, breaker, CONSTANT_CATCH, init_util2, _a2, _zodDesc, _E, $ZodAsyncError, $ZodEncodeError, globalConfig, init_core, _messageDesc, _issuesDesc, _installedToString, initializer, $ZodError, $ZodRealError, init_errors3, _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsync, safeParseAsync, COMPILE_INVALID, COMPILE_FALLBACK, validate, validateAsync, _encode, _decode, _encodeAsync, _decodeAsync, _safeEncode, _safeDecode, _safeEncodeAsync, _safeDecodeAsync, init_parse, cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid, email, _emoji, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource, date, anyString, integer, number, boolean, _null, lowercase, uppercase, init_regexes, $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite, init_checks, Doc, init_doc, version, init_versions, $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodCustom, init_schemas, $ZodCyclicError, STATE, NO_ISSUES, recursive, NONE, ASSUMED, PROVEN, handoff, open4, memo, init_memoizer, error, init_en2, init_locales, _a3, $ZodRegistry, globalRegistry, init_registries, init_compile, init_api, FOLDABLE_KEYS, UNION_KEYS, createToJSONSchemaMethod, createStandardJSONSchemaMethod, init_to_json_schema, narrowMin, narrowMax, narrowBoth, addDivisor, addPattern, intersectMime, setFormat, minContributor, maxContributor, formatContributor, contributors, formatMap, exactPatterns, exactPattern, stringProcessor, numberProcessor, booleanProcessor, bigintProcessor, symbolProcessor, nullProcessor, undefinedProcessor, voidProcessor, neverProcessor, anyProcessor, unknownProcessor, dateProcessor, enumProcessor, literalProcessor, nanProcessor, templateLiteralProcessor, fileProcessor, successProcessor, customProcessor, functionProcessor, transformProcessor, mapProcessor, setProcessor, arrayProcessor, objectProcessor, unionProcessor, intersectionProcessor, tupleProcessor, pendingRecords, recordProcessor, nullableProcessor, nonoptionalProcessor, UNREPRESENTABLE_DEFAULT, defaultProcessor, prefaultProcessor, catchProcessor, pipeProcessor, readonlyProcessor, promiseProcessor, optionalProcessor, lazyProcessor, allProcessors, init_json_schema_processors, init_json_schema, init_core2, init_parse2, ZodMiniType, ZodMiniObject, init_schemas2, init_checks2, init_iso, init_coerce, init_external2, init_v4_mini, init_zod_compat, init_checks3, _installedErrorProtos, initializer2, ZodRealError, init_errors4, parse2, parseAsync2, safeParse3, safeParseAsync3, encode3, decode2, encodeAsync2, decodeAsync2, safeEncode2, safeDecode2, safeEncodeAsync2, safeDecodeAsync2, init_parse3, ZodType2, _ZodString, ZodString2, ZodStringFormat, ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber2, ZodNumberFormat, ZodBoolean2, ZodNull2, ZodUnknown2, ZodNever2, ZodArray2, ZodObject2, ZodUnion2, ZodDiscriminatedUnion2, ZodIntersection2, ZodRecord2, ZodEnum2, ZodLiteral2, ZodTransform, ZodOptional2, ZodExactOptional, ZodNullable2, ZodDefault2, ZodPrefault, ZodNonOptional, ZodCatch2, ZodPipe, ZodPreprocess, ZodReadonly2, ZodCustom, init_schemas3, ZodFirstPartyTypeKind2, init_compat, iso_exports2, init_iso2, init_coerce2, init_external3, init_classic, init_v4, LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, JSONRPC_VERSION, AssertObjectSchema, ProgressTokenSchema, CursorSchema, TaskCreationParamsSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, isTaskAugmentedRequestParams, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, isJSONRPCRequest, JSONRPCNotificationSchema, isJSONRPCNotification, JSONRPCResultResponseSchema, isJSONRPCResultResponse, ErrorCode, JSONRPCErrorResponseSchema, isJSONRPCErrorResponse, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, isInitializeRequest, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, McpError, UrlElicitationRequiredError, init_types3, init_interfaces, ignoreOverride, defaultOptions, getDefaultOptions, init_Options, getRefs, init_Refs, init_errorMessages, getRelativePath, init_getRelativePath, init_any, init_array2, init_bigint, init_boolean, init_branded, parseCatchDef, init_catch, integerDateParser, init_date, init_default, init_effects, init_enum, isJsonSchema7AllOfType, init_intersection, init_literal, emojiRegex2, zodPatterns, ALPHA_NUMERIC, init_string2, init_record, init_map, init_nativeEnum, init_never, init_null, primitiveMappings, asAnyOf, init_union, init_nullable, init_number2, init_object, parseOptionalDef, init_optional2, parsePipelineDef, init_pipeline, init_promise, init_set, init_tuple, init_undefined, init_unknown, parseReadonlyDef, init_readonly, selectParser, init_selectParser, get$ref, addMeta, init_parseDef, init_parseTypes, zodToJsonSchema, init_zodToJsonSchema, init_esm, init_zod_json_schema_compat, DEFAULT_REQUEST_TIMEOUT_MSEC, Protocol, init_protocol, require_code, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code2, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core, require_id, require_ref, require_core2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator, require_format, require_format2, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_formats, require_limit, require_dist, import_ajv, import_ajv_formats, AjvJsonSchemaValidator, init_ajv_provider, ExperimentalServerTasks, init_server, init_helpers, Server, init_server2, COMPLETABLE_SYMBOL, McpZodTypeKind, init_completable, init_uriTemplate, TOOL_NAME_REGEX, init_toolNameValidation, ExperimentalMcpServerTasks, init_mcp_server, init_zod, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT, init_mcp, RequestError, toRequestError, GlobalRequest, Request2, newHeadersFromIncoming, wrapBodyStream, newRequestFromIncoming, getRequestCache, requestCache, incomingKey, urlKey, headersKey, abortControllerKey, getAbortController, requestPrototype, newRequest, responseCache, getResponseCache, cacheKey, GlobalResponse, Response2, buildOutgoingHttpHeaders, X_ALREADY_SENT, outgoingEnded, handleRequestError, handleFetchError, handleResponseError, flushHeaders, responseViaCache, isPromise, responseViaResponseObject, getRequestListener, init_dist22, require_content_type, import_content_type, init_mediaType, DEFAULT_MAX_REQUEST_BODY_SIZE, MAX_BATCH_SIZE, init_requestBody, DEFAULT_SSE_KEEP_ALIVE_MS, MAX_TIMER_DELAY_MS, init_sseKeepAlive, WebStandardStreamableHTTPServerTransport, init_webStandardStreamableHttp, StreamableHTTPServerTransport, init_streamableHttp, AgentVaultMcpServer, init_mcp_server2, init_mcp_handlers, init_skill_manifest, init_skill_invoker, spanBuffer, init_skill_telemetry, PolicyEnforcer, init_policy_enforcer, VERSION, init_index;
18594
18594
  var init_dist = __esm({
18595
18595
  async "../plugin/dist/index.js"() {
18596
18596
  "use strict";
@@ -73431,9 +73431,9 @@ ${text}`,
73431
73431
  HISTORY_RESTORE_TIMEOUT_MS2
73432
73432
  );
73433
73433
  let rejectOnAbort = null;
73434
- const isCurrent = () => !controller.signal.aborted && !this._stopped && lifecycle === this._lifecycleGeneration && this._historyRestoreController === controller;
73434
+ const isCurrent2 = () => !controller.signal.aborted && !this._stopped && lifecycle === this._lifecycleGeneration && this._historyRestoreController === controller;
73435
73435
  const discardLateClient = (client) => {
73436
- if (isCurrent()) return;
73436
+ if (isCurrent2()) return;
73437
73437
  if (this._historyBackupClient === client) {
73438
73438
  this._historyBackupClient = null;
73439
73439
  this._historyKeyCacheIdentity = null;
@@ -73451,7 +73451,7 @@ ${text}`,
73451
73451
  void clientAcquisition.then(discardLateClient, () => {
73452
73452
  });
73453
73453
  const client = await Promise.race([clientAcquisition, abort]);
73454
- if (!isCurrent()) {
73454
+ if (!isCurrent2()) {
73455
73455
  discardLateClient(client);
73456
73456
  return;
73457
73457
  }
@@ -73460,7 +73460,7 @@ ${text}`,
73460
73460
  client.clearHistoryKeyCache();
73461
73461
  this._historyKeyCacheIdentity = null;
73462
73462
  }
73463
- if (!isCurrent()) {
73463
+ if (!isCurrent2()) {
73464
73464
  discardLateClient(client);
73465
73465
  return;
73466
73466
  }
@@ -73468,7 +73468,7 @@ ${text}`,
73468
73468
  client.restore({ code, codeHashHex, signal: controller.signal }),
73469
73469
  abort
73470
73470
  ]);
73471
- if (!restored || !isCurrent()) {
73471
+ if (!restored || !isCurrent2()) {
73472
73472
  return;
73473
73473
  }
73474
73474
  if (state.hubId && state.hubId !== restored.hubId) {
@@ -73489,9 +73489,9 @@ ${text}`,
73489
73489
  restoredHistoryGenerationId: restored.generationId,
73490
73490
  historyRecoveryState: "complete"
73491
73491
  };
73492
- if (!isCurrent()) return;
73492
+ if (!isCurrent2()) return;
73493
73493
  await this._saveHistoryState(restoredState, { controller, lifecycle });
73494
- if (!isCurrent()) return;
73494
+ if (!isCurrent2()) return;
73495
73495
  this._persisted = restoredState;
73496
73496
  this.emit("history_recovery", {
73497
73497
  state: "restored",
@@ -74090,7 +74090,7 @@ ${text}`,
74090
74090
  */
74091
74091
  sendActivitySpan(spanData) {
74092
74092
  if (!this._ws || this._ws.readyState !== WebSocket.OPEN) return;
74093
- const pluginVersion = true ? "0.23.65" : "0.0.0-dev";
74093
+ const pluginVersion = true ? "0.23.66" : "0.0.0-dev";
74094
74094
  const agentName = this.config.agentName ?? "Agent";
74095
74095
  const resource = {
74096
74096
  "service.name": "agentvault-agent",
@@ -76373,7 +76373,7 @@ ${text}`,
76373
76373
  agentVersion: this.config.agentVersion ?? "0.0.0",
76374
76374
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
76375
76375
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
76376
- pluginVersion: true ? "0.23.65" : "0.0.0-dev"
76376
+ pluginVersion: true ? "0.23.66" : "0.0.0-dev"
76377
76377
  });
76378
76378
  this._telemetryReporter.startAutoFlush(3e4);
76379
76379
  }
@@ -76711,7 +76711,7 @@ ${text}`,
76711
76711
  agentVersion: this.config.agentVersion ?? "0.0.0",
76712
76712
  // __AV_VERSION__ is injected by esbuild from package.json at build time.
76713
76713
  // Falls back to "0.0.0-dev" in non-bundled contexts (tests).
76714
- pluginVersion: true ? "0.23.65" : "0.0.0-dev"
76714
+ pluginVersion: true ? "0.23.66" : "0.0.0-dev"
76715
76715
  });
76716
76716
  this._telemetryReporter.startAutoFlush(3e4);
76717
76717
  }
@@ -77282,9 +77282,9 @@ ${text}`,
77282
77282
  ...decisionReply ? { decision: decisionReply } : {}
77283
77283
  };
77284
77284
  this.emit("message", text, metadata);
77285
- if (this.config.onMessage) {
77286
- this.config.onMessage(text, metadata);
77287
- }
77285
+ Promise.resolve(this.config.onMessage?.(text, metadata)).catch((err) => {
77286
+ console.error("[SecureChannel] onMessage callback error (MLS 1:1):", err);
77287
+ });
77288
77288
  } catch (decryptErr) {
77289
77289
  if (classifyCommitFailure(data.epoch, mgr?.epoch) === "already-applied") {
77290
77290
  console.debug(`[SecureChannel] MLS 1:1 message at epoch ${String(data.epoch)} predates our epoch ${String(mgr?.epoch)} \u2014 cannot decrypt, ignoring`);
@@ -80683,7 +80683,9 @@ ${baseText}`;
80683
80683
  console.log(`[SecureChannel] A2A message decrypted for ${a2aChannelId.slice(0, 8)} (epoch=${mlsGroup.epoch}, len=${historyText.length})`);
80684
80684
  this.emit("a2a_message", a2aMsg);
80685
80685
  if (this.config.onA2AMessage) {
80686
- this.config.onA2AMessage(a2aMsg);
80686
+ void Promise.resolve(this.config.onA2AMessage(a2aMsg)).catch((err) => {
80687
+ console.error("[SecureChannel] onA2AMessage callback failed:", err instanceof Error ? err.name : "error");
80688
+ });
80687
80689
  }
80688
80690
  } catch (err) {
80689
80691
  if (classifyCommitFailure(data.epoch, mlsGroup?.epoch) === "already-applied") {
@@ -82567,6 +82569,101 @@ ${actionsText}`);
82567
82569
  "use strict";
82568
82570
  }
82569
82571
  });
82572
+ init_turn_failure = __esm2({
82573
+ "src/turn-failure.ts"() {
82574
+ "use strict";
82575
+ init_tool_telemetry();
82576
+ TURN_FAILURE_CODES = [
82577
+ "provider_auth_failed",
82578
+ "provider_billing",
82579
+ "model_rate_limited",
82580
+ "model_unavailable",
82581
+ "provider_unreachable",
82582
+ "ai_tool_unsupported",
82583
+ "plan_limit_reached",
82584
+ "model_error"
82585
+ ];
82586
+ CODES = new Set(TURN_FAILURE_CODES);
82587
+ TurnFailure = class extends Error {
82588
+ code;
82589
+ exitCode;
82590
+ constructor(code, opts = {}, message = "Codex turn failed") {
82591
+ super(message);
82592
+ this.name = "TurnFailure";
82593
+ this.code = asTurnFailureCode(code);
82594
+ if (opts.exitCode !== void 0) this.exitCode = opts.exitCode;
82595
+ }
82596
+ };
82597
+ NOTICE_RE = /^[^\n@]{1,120} couldn't answer this message(?:\.|: [^\n]{1,200})$/;
82598
+ }
82599
+ });
82600
+ init_openclaw_turn_failure = __esm2({
82601
+ "src/openclaw-turn-failure.ts"() {
82602
+ "use strict";
82603
+ init_turn_failure();
82604
+ init_tool_telemetry();
82605
+ AUTH_RE = new RegExp(
82606
+ [
82607
+ String.raw`^Couldn't sign in to the AI service\. `,
82608
+ // auth, provider_authentication_error
82609
+ String.raw`^The AI service isn't accepting your login\. `,
82610
+ // auth_permanent
82611
+ String.raw`^Your model provider needs a new login\. `,
82612
+ // OAuth login recovery hint
82613
+ String.raw`^Your AI session expired\. `,
82614
+ // session_expired (a login reason in OpenClaw)
82615
+ String.raw`^Couldn't sign in to [^\n]{1,80}\. Your saved login looks expired or no longer works\.`,
82616
+ String.raw`^[^\n]{1,80} isn't accepting your saved login(?: anymore)?\.`,
82617
+ String.raw`^Model login (?:expired|failed) on the gateway\b`,
82618
+ String.raw`^This AI service isn't set up yet\. Sign in under Models`,
82619
+ // missing API key
82620
+ String.raw`^OpenAI needs a different sign-in for this model\.`
82621
+ ].join("|"),
82622
+ "u"
82623
+ );
82624
+ BILLING_RE = new RegExp(
82625
+ [
82626
+ String.raw`^The AI service reported a billing problem\. `,
82627
+ String.raw`^[^\n]{1,160} returned a billing error — check your account`,
82628
+ String.raw`^[^\n]{1,80} rejected the request — looks like a billing issue on the account\.`
82629
+ ].join("|"),
82630
+ "u"
82631
+ );
82632
+ RATE_RE = new RegExp(
82633
+ [
82634
+ String.raw`^The AI service needs a short break\. Please try again in (?:a few minutes|~\d{1,5}(?:s| min))\.$`,
82635
+ String.raw`^The AI services are busy\. Please try again in a few minutes\.$`,
82636
+ String.raw`^[^\n]{1,80} is asking us to slow down\. Please wait a moment before trying again\.`,
82637
+ String.raw`^The AI service can't accept more requests right now\. `
82638
+ // quota-429
82639
+ ].join("|"),
82640
+ "u"
82641
+ );
82642
+ MODEL_GONE_RE = new RegExp(
82643
+ [
82644
+ String.raw`^This model was not found\. Choose another model`,
82645
+ String.raw`^[^\n]{1,80} can't find the model you're using right now\.`
82646
+ ].join("|"),
82647
+ "u"
82648
+ );
82649
+ UNREACHABLE_RE = new RegExp(
82650
+ [
82651
+ String.raw`^The AI service is having trouble\. Please try again in a moment\.$`,
82652
+ String.raw`^The AI service is busy\. Please try again in a moment, or choose another model\.$`,
82653
+ String.raw`^The AI service is temporarily overloaded\. Please try again in a moment\.$`,
82654
+ String.raw`^Selected model is at capacity\. Try a different model, or wait and retry\.$`,
82655
+ String.raw`^[^\n]{1,80} is (?:overloaded|having issues) right now\. Please wait a moment before trying again\.`,
82656
+ String.raw`^[^\n]{1,80} hasn't been responding\. Please wait a moment before trying again\.`,
82657
+ String.raw`^The model provider returned a temporary internal error before replying\. `,
82658
+ String.raw`^I couldn't reach the configured model backend `,
82659
+ String.raw`^Couldn't connect securely to the AI service\. `,
82660
+ String.raw`^LLM request timed out\.$`,
82661
+ String.raw`^The request took too long\. Check the conversation for any completed work before trying again\.$`
82662
+ ].join("|"),
82663
+ "u"
82664
+ );
82665
+ }
82666
+ });
82570
82667
  init_openclaw_entry = __esm2({
82571
82668
  "src/openclaw-entry.ts"() {
82572
82669
  "use strict";
@@ -82579,6 +82676,7 @@ ${actionsText}`);
82579
82676
  init_tool_audit();
82580
82677
  init_tool_telemetry();
82581
82678
  init_harness_compat();
82679
+ init_openclaw_turn_failure();
82582
82680
  init_types();
82583
82681
  managedRoutesRequested = false;
82584
82682
  }
@@ -103284,34 +103382,6 @@ data:
103284
103382
  };
103285
103383
  }
103286
103384
  });
103287
- init_turn_failure = __esm2({
103288
- "src/turn-failure.ts"() {
103289
- "use strict";
103290
- init_tool_telemetry();
103291
- TURN_FAILURE_CODES = [
103292
- "provider_auth_failed",
103293
- "provider_billing",
103294
- "model_rate_limited",
103295
- "model_unavailable",
103296
- "provider_unreachable",
103297
- "ai_tool_unsupported",
103298
- "plan_limit_reached",
103299
- "model_error"
103300
- ];
103301
- CODES = new Set(TURN_FAILURE_CODES);
103302
- TurnFailure = class extends Error {
103303
- code;
103304
- exitCode;
103305
- constructor(code, opts = {}, message = "Codex turn failed") {
103306
- super(message);
103307
- this.name = "TurnFailure";
103308
- this.code = asTurnFailureCode(code);
103309
- if (opts.exitCode !== void 0) this.exitCode = opts.exitCode;
103310
- }
103311
- };
103312
- NOTICE_RE = /^[^\n@]{1,120} couldn't answer this message(?:\.|: [^\n]{1,200})$/;
103313
- }
103314
- });
103315
103385
  init_index = __esm2({
103316
103386
  async "src/index.ts"() {
103317
103387
  await init_channel();
@@ -103333,7 +103403,7 @@ data:
103333
103403
  init_room_protocol();
103334
103404
  init_tool_telemetry();
103335
103405
  init_turn_failure();
103336
- VERSION = true ? "0.23.65" : "0.0.0-dev";
103406
+ VERSION = true ? "0.23.66" : "0.0.0-dev";
103337
103407
  }
103338
103408
  });
103339
103409
  await init_index();
@@ -104036,18 +104106,54 @@ init_fence_auth();
104036
104106
  import { chmodSync as chmodSync5, mkdirSync as mkdirSync6 } from "node:fs";
104037
104107
  import { join as join17 } from "node:path";
104038
104108
 
104109
+ // src/muse-session.ts
104110
+ await init_dist();
104111
+
104112
+ // src/turn-failure.ts
104113
+ function facts(err) {
104114
+ return err !== null && typeof err === "object" ? err : {};
104115
+ }
104116
+ function upstreamStatusOf(err) {
104117
+ const s2 = facts(err).upstreamStatus;
104118
+ return typeof s2 === "number" && Number.isInteger(s2) && s2 >= 400 && s2 <= 599 ? s2 : void 0;
104119
+ }
104120
+ function exitCodeOf(err) {
104121
+ const c2 = facts(err).exitCode;
104122
+ return typeof c2 === "number" && Number.isInteger(c2) ? c2 : void 0;
104123
+ }
104124
+ function classifyMuseFailure(err) {
104125
+ const f2 = facts(err);
104126
+ if (f2.museToolUnsupported === true) return "ai_tool_unsupported";
104127
+ const status = upstreamStatusOf(err);
104128
+ if (status === 401) return "provider_auth_failed";
104129
+ if (status === 402) return "provider_billing";
104130
+ if (status === 429) return "model_rate_limited";
104131
+ if (status === 404) return "model_unavailable";
104132
+ if (status !== void 0 && status >= 500) return "provider_unreachable";
104133
+ if (f2.providerUnreachable === true) return "provider_unreachable";
104134
+ return "model_error";
104135
+ }
104136
+ var EXPIRED_REASONING = /\breasoning ([`'"]?)encrypted_content\1 has expired\b/i;
104137
+ function isStaleSession(err) {
104138
+ if (!(err instanceof Error)) return false;
104139
+ return EXPIRED_REASONING.test(err.message.slice(-2e3));
104140
+ }
104141
+
104039
104142
  // src/muse-session.ts
104040
104143
  var ERROR_TYPE = /\(([a-z][a-z_]{2,40})\)\s*$/;
104041
104144
  function describeTurnFailure(err) {
104042
104145
  const message = err instanceof Error ? err.message : "";
104043
104146
  if (message === "muse turn stopped") return null;
104044
- const status = err?.upstreamStatus;
104147
+ const status = upstreamStatusOf(err);
104045
104148
  const type = ERROR_TYPE.exec(message.slice(-200))?.[1];
104046
104149
  return {
104047
- ...typeof status === "number" && Number.isInteger(status) && status >= 400 && status <= 599 ? { upstreamStatus: status } : {},
104150
+ ...status !== void 0 ? { upstreamStatus: status } : {},
104048
104151
  ...type ? { errorType: type } : {}
104049
104152
  };
104050
104153
  }
104154
+ var LEGACY_FAILURE_NOTICE = "I couldn't complete this reply. Please try again.";
104155
+ var SEED_LIMIT = 8192;
104156
+ var SEED_HEADER = "[AgentVault: your saved session could not be reopened, so this is a new one. Recent messages from this chat, oldest first, for context:]";
104051
104157
  var MuseSession = class {
104052
104158
  constructor(driver, opts = {}) {
104053
104159
  this.driver = driver;
@@ -104059,14 +104165,19 @@ var MuseSession = class {
104059
104165
  running = false;
104060
104166
  current = null;
104061
104167
  saidThisTurn = false;
104168
+ /** One failure notice per turn (re-review N1 split this from saidThisTurn). */
104169
+ noticedThisTurn = false;
104062
104170
  drain = Promise.resolve();
104063
104171
  push(text, reply, opts) {
104172
+ const conv = opts?.conversation;
104064
104173
  this.queue.push({
104065
104174
  text,
104066
104175
  reply,
104067
104176
  autoReplyOnText: opts?.replyExpected ?? opts?.autoReplyOnText,
104068
104177
  sayAllowed: opts?.replyExpected ?? true,
104069
- ownerTurn: opts?.ownerTurn === true
104178
+ ownerTurn: opts?.ownerTurn === true,
104179
+ conversation: conv && (conv.kind === "room" || conv.kind === "direct") && conv.id ? { kind: conv.kind, id: conv.id } : { kind: "unknown" },
104180
+ ...typeof opts?.seed === "string" && opts.seed.trim() ? { seed: opts.seed.slice(-SEED_LIMIT) } : {}
104070
104181
  });
104071
104182
  if (!this.running) this.drain = this.run();
104072
104183
  }
@@ -104113,24 +104224,13 @@ var MuseSession = class {
104113
104224
  const item = this.queue.shift();
104114
104225
  this.current = item;
104115
104226
  this.saidThisTurn = false;
104227
+ this.noticedThisTurn = false;
104228
+ const startedAt = Date.now();
104116
104229
  try {
104117
- const prompt = this.opts.identity ? `${this.opts.identity}
104118
-
104119
- ${item.text}` : item.text;
104120
- const result = await this.driver.runTurn(prompt, { ownerTurn: item.ownerTurn });
104230
+ const result = await this.runWithRecovery(item);
104121
104231
  await this.maybeFallback(item, result);
104122
104232
  } catch (err) {
104123
- const failure2 = describeTurnFailure(err);
104124
- if (failure2) {
104125
- this.log(`turn failed reason=driver${failure2.upstreamStatus ? ` upstream_status=${failure2.upstreamStatus}` : ""}${failure2.errorType ? ` error_type=${failure2.errorType}` : ""}`);
104126
- try {
104127
- this.opts.onTurnFailed?.(failure2);
104128
- } catch {
104129
- }
104130
- } else {
104131
- this.log("turn failed reason=stopped");
104132
- }
104133
- await this.failureNotice(item);
104233
+ await this.turnFailed(item, err, Date.now() - startedAt);
104134
104234
  } finally {
104135
104235
  this.current = null;
104136
104236
  }
@@ -104139,13 +104239,82 @@ ${item.text}` : item.text;
104139
104239
  this.running = false;
104140
104240
  }
104141
104241
  }
104142
- async failureNotice(item) {
104143
- if (!item.autoReplyOnText || this.saidThisTurn) return;
104242
+ prompt(item, seed) {
104243
+ const body = seed ? `${SEED_HEADER}
104244
+ ${seed}
104245
+
104246
+ ${item.text}` : item.text;
104247
+ return this.opts.identity ? `${this.opts.identity}
104248
+
104249
+ ${body}` : body;
104250
+ }
104251
+ /**
104252
+ * #1560: one turn on the stored session. If Meta says that session can no
104253
+ * longer be continued, ONE fresh session, seeded with this chat's recent
104254
+ * messages, answers instead, and the driver keeps it. Once per turn: a
104255
+ * fresh session that fails is a real failure for the caller to report. A
104256
+ * model that already spoke this turn is never re-run (no double answer).
104257
+ */
104258
+ async runWithRecovery(item) {
104259
+ try {
104260
+ return await this.driver.runTurn(this.prompt(item), { ownerTurn: item.ownerTurn });
104261
+ } catch (err) {
104262
+ if (!isStaleSession(err) || this.saidThisTurn) throw err;
104263
+ const lane = item.ownerTurn ? "owner" : "shared";
104264
+ this.log(`session_resume_failed lane=${lane} action=fresh_session seeded=${item.seed ? "yes" : "no"}`);
104265
+ const result = await this.driver.runTurn(this.prompt(item, item.seed), {
104266
+ ownerTurn: item.ownerTurn,
104267
+ freshSession: true
104268
+ });
104269
+ this.log(`turn_recovered code=session_resume_failed lane=${lane}`);
104270
+ return result;
104271
+ }
104272
+ }
104273
+ /**
104274
+ * #1560: RECORD FIRST (the report and the log line), then the notice, so a
104275
+ * notice that stalls or fails cannot lose the record. Only the code, the exit
104276
+ * status and #1467's safe parts (Meta's status number, an error-type token)
104277
+ * are logged; never the error's text.
104278
+ */
104279
+ async turnFailed(item, err, durationMs) {
104280
+ const info = describeTurnFailure(err);
104281
+ if (!info) {
104282
+ this.log("turn_cancelled reason=stopped");
104283
+ await this.failureNotice(item, "model_error");
104284
+ return;
104285
+ }
104286
+ const code = classifyMuseFailure(err);
104287
+ const exitCode = exitCodeOf(err);
104288
+ try {
104289
+ this.opts.onTurnFailed?.({
104290
+ code,
104291
+ ...exitCode !== void 0 ? { exitCode } : {},
104292
+ conversation: item.conversation,
104293
+ durationMs
104294
+ });
104295
+ } catch {
104296
+ }
104297
+ this.log(
104298
+ `turn_failed code=${code} exit=${exitCode ?? "none"}${info.upstreamStatus ? ` upstream_status=${info.upstreamStatus}` : ""}${info.errorType ? ` error_type=${info.errorType}` : ""}`
104299
+ );
104300
+ await this.failureNotice(item, item.conversation.kind === "room" ? "model_error" : code);
104301
+ }
104302
+ async failureNotice(item, code) {
104303
+ if (!item.autoReplyOnText || this.noticedThisTurn) return;
104144
104304
  const sink = item.reply ?? this.opts.onSay;
104145
104305
  if (!sink) return;
104306
+ if (this.saidThisTurn) code = "model_error";
104307
+ this.noticedThisTurn = true;
104146
104308
  this.saidThisTurn = true;
104309
+ let name;
104310
+ try {
104311
+ name = this.opts.agentName?.();
104312
+ } catch {
104313
+ name = void 0;
104314
+ }
104315
+ const notice = ownerNoticeFor(code, { agentName: name ?? "", provider: "Meta" });
104147
104316
  let timer;
104148
- const delivery = Promise.resolve().then(() => sink("I couldn't complete this reply. Please try again.")).then(
104317
+ const delivery = Promise.resolve().then(() => sink(notice)).then(
104149
104318
  () => {
104150
104319
  this.log("failure_notice outcome=delivered");
104151
104320
  },
@@ -104202,7 +104371,7 @@ ${item.text}` : item.text;
104202
104371
  // src/muse-driver.ts
104203
104372
  import { spawn } from "node:child_process";
104204
104373
  import { randomUUID as randomUUID5 } from "node:crypto";
104205
- import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync6, writeFileSync as writeFileSync2 } from "node:fs";
104374
+ import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync6, renameSync, writeFileSync as writeFileSync2 } from "node:fs";
104206
104375
  import { join as join11 } from "node:path";
104207
104376
 
104208
104377
  // src/muse-spawn.ts
@@ -104386,6 +104555,7 @@ async function createMuseProviderAdapter(opts) {
104386
104555
  }
104387
104556
  };
104388
104557
  let lastStatus;
104558
+ let transportFailed = false;
104389
104559
  const server = createServer2((req, res) => {
104390
104560
  const abort = new AbortController();
104391
104561
  const stop = () => abort.abort();
@@ -104464,12 +104634,19 @@ async function createMuseProviderAdapter(opts) {
104464
104634
  }
104465
104635
  }
104466
104636
  }
104637
+ transportFailed = false;
104467
104638
  if (!response.ok) {
104468
104639
  lastStatus = response.status;
104469
104640
  log(`upstream_error status=${response.status}${limitHeaderNote(response.headers)}`);
104641
+ } else {
104642
+ lastStatus = void 0;
104470
104643
  }
104471
104644
  await forward(response, res, abort.signal, inspected);
104472
104645
  })().catch(() => {
104646
+ if (!abort.signal.aborted) {
104647
+ transportFailed = true;
104648
+ lastStatus = void 0;
104649
+ }
104473
104650
  log("request_failed reason=transport");
104474
104651
  error2(502);
104475
104652
  }).finally(() => {
@@ -104512,7 +104689,8 @@ async function createMuseProviderAdapter(opts) {
104512
104689
  return {
104513
104690
  baseUrl: `http://127.0.0.1:${address.port}${route.slice(0, -"/responses".length)}`,
104514
104691
  close,
104515
- upstreamStatus: () => lastStatus
104692
+ upstreamStatus: () => lastStatus,
104693
+ transportFailed: () => transportFailed
104516
104694
  };
104517
104695
  }
104518
104696
 
@@ -104549,6 +104727,12 @@ var MuseDriver = class {
104549
104727
  ownerSessionId() {
104550
104728
  return this.ownerId;
104551
104729
  }
104730
+ /**
104731
+ * One turn on the lane's stored session. `freshSession` (#1560) runs it on a
104732
+ * NEW session id instead, and only when that turn succeeds does the new id
104733
+ * replace the lane's stored one (the first id ever replaced is kept in
104734
+ * `<file>.prev`, never overwritten). A fresh turn that fails changes nothing.
104735
+ */
104552
104736
  runTurn(prompt, opts = {}) {
104553
104737
  if (!this.persistedId || !this.ownerId) {
104554
104738
  throw new Error("MuseDriver.runTurn before start()");
@@ -104557,10 +104741,31 @@ var MuseDriver = class {
104557
104741
  throw new Error("MuseDriver.runTurn called while a turn is in flight");
104558
104742
  }
104559
104743
  this.current = { spoke: false, cancelled: false };
104560
- return this.executeTurn(prompt, opts.ownerTurn === true).finally(() => {
104744
+ const ownerTurn = opts.ownerTurn === true;
104745
+ const fresh = opts.freshSession === true ? randomUUID5() : void 0;
104746
+ return this.executeTurn(prompt, ownerTurn, fresh).then((result) => {
104747
+ if (fresh) this.replaceSession(ownerTurn, fresh);
104748
+ return result;
104749
+ }).finally(() => {
104561
104750
  this.current = null;
104562
104751
  });
104563
104752
  }
104753
+ /** #1560: the lane's stored session is replaced by `id`, which just answered. */
104754
+ replaceSession(ownerTurn, id) {
104755
+ const file = join11(this.opts.dataDir, ownerTurn ? OWNER_SESSION_FILE : SESSION_FILE);
104756
+ const old = ownerTurn ? this.ownerId : this.persistedId;
104757
+ if (ownerTurn) this.ownerId = id;
104758
+ else this.persistedId = id;
104759
+ try {
104760
+ if (old) keepFirst(`${file}.prev`, old);
104761
+ const tmp = `${file}.${id}.tmp`;
104762
+ writeFileSync2(tmp, id + "\n", { encoding: "utf8", mode: 384 });
104763
+ renameSync(tmp, file);
104764
+ } catch (err) {
104765
+ const code = err?.code;
104766
+ this.opts.log?.(`[muse-bridge] session_id_write_failed code=${typeof code === "string" ? code : "unknown"}`);
104767
+ }
104768
+ }
104564
104769
  noteSaid(_text) {
104565
104770
  if (this.current) this.current.spoke = true;
104566
104771
  }
@@ -104580,8 +104785,8 @@ var MuseDriver = class {
104580
104785
  const dead = await waitForExit(child, SIGKILL_GRACE_MS);
104581
104786
  if (!dead) child.kill("SIGKILL");
104582
104787
  }
104583
- async executeTurn(prompt, ownerTurn) {
104584
- const sessionId = ownerTurn ? this.ownerId : this.persistedId;
104788
+ async executeTurn(prompt, ownerTurn, freshId) {
104789
+ const sessionId = freshId ?? (ownerTurn ? this.ownerId : this.persistedId);
104585
104790
  if (!sessionId) {
104586
104791
  throw new Error("MuseDriver.runTurn before start()");
104587
104792
  }
@@ -104615,6 +104820,9 @@ var MuseDriver = class {
104615
104820
  if (typeof status === "number" && err instanceof Error) {
104616
104821
  err.upstreamStatus = status;
104617
104822
  }
104823
+ if (adapter.transportFailed?.() === true && err instanceof Error) {
104824
+ err.providerUnreachable = true;
104825
+ }
104618
104826
  throw err;
104619
104827
  } finally {
104620
104828
  await adapter.close();
@@ -104629,8 +104837,18 @@ var MuseDriver = class {
104629
104837
  });
104630
104838
  this.child = child;
104631
104839
  try {
104632
- const helpText2 = await collectOutput(child);
104633
- assertMuseExec(helpText2);
104840
+ let helpText2;
104841
+ try {
104842
+ helpText2 = await collectOutput(child);
104843
+ } catch (err) {
104844
+ throw markIfMissingBinary(err);
104845
+ }
104846
+ try {
104847
+ assertMuseExec(helpText2);
104848
+ } catch (err) {
104849
+ if (err instanceof Error) err.museToolUnsupported = true;
104850
+ throw err;
104851
+ }
104634
104852
  this.probed = true;
104635
104853
  } finally {
104636
104854
  if (this.child === child) this.child = null;
@@ -104664,8 +104882,12 @@ var MuseDriver = class {
104664
104882
  resolve5({ text: terminal.text, spoke });
104665
104883
  return;
104666
104884
  }
104885
+ const withExit = (e) => {
104886
+ if (typeof exitCode === "number") e.exitCode = exitCode;
104887
+ return e;
104888
+ };
104667
104889
  if (terminal?.ok === false) {
104668
- reject(terminal.error);
104890
+ reject(withExit(terminal.error));
104669
104891
  return;
104670
104892
  }
104671
104893
  if (timedOut) {
@@ -104675,9 +104897,9 @@ var MuseDriver = class {
104675
104897
  const redacted = redactSecrets(stderr).trim();
104676
104898
  const detail = redacted ? ` ${redacted}` : "";
104677
104899
  reject(
104678
- new Error(
104900
+ withExit(new Error(
104679
104901
  `muse exec ended with no terminal event (code=${String(exitCode)} signal=${String(exitSignal)});${detail}`
104680
- )
104902
+ ))
104681
104903
  );
104682
104904
  };
104683
104905
  const timer = setTimeout(() => {
@@ -104732,7 +104954,7 @@ var MuseDriver = class {
104732
104954
  if (!terminal) {
104733
104955
  terminal = {
104734
104956
  ok: false,
104735
- error: err instanceof Error ? err : new Error(String(err))
104957
+ error: markIfMissingBinary(err instanceof Error ? err : new Error(String(err)))
104736
104958
  };
104737
104959
  }
104738
104960
  reap();
@@ -104764,6 +104986,20 @@ function loadOrMintId(file) {
104764
104986
  writeFileSync2(file, id + "\n", { encoding: "utf8" });
104765
104987
  return id;
104766
104988
  }
104989
+ function keepFirst(path2, value) {
104990
+ try {
104991
+ writeFileSync2(path2, value + "\n", { encoding: "utf8", mode: 384, flag: "wx" });
104992
+ } catch (err) {
104993
+ if (err?.code !== "EEXIST") throw err;
104994
+ }
104995
+ }
104996
+ function markIfMissingBinary(err) {
104997
+ const code = err?.code;
104998
+ if (err instanceof Error && (code === "ENOENT" || code === "EACCES")) {
104999
+ err.museToolUnsupported = true;
105000
+ }
105001
+ return err;
105002
+ }
104767
105003
  function readFlag(value) {
104768
105004
  return typeof value === "function" ? value() : value;
104769
105005
  }
@@ -105222,6 +105458,37 @@ function resetOwnerPower() {
105222
105458
  workAllowedFlag = false;
105223
105459
  gatesRemovedFlag = false;
105224
105460
  }
105461
+ function sameInstant(a2, b2) {
105462
+ if (typeof a2 !== "string" || typeof b2 !== "string") return false;
105463
+ const x2 = Date.parse(a2);
105464
+ return Number.isFinite(x2) && x2 === Date.parse(b2);
105465
+ }
105466
+ function isCurrent(last, current) {
105467
+ if (last.sender === "agent") return false;
105468
+ if (current.id && last.id === current.id) return true;
105469
+ const textMatches = last.text === current.text || last.text.length > 0 && current.text.endsWith(`
105470
+
105471
+ ${last.text}`);
105472
+ return textMatches && sameInstant(last.ts, current.ts);
105473
+ }
105474
+ var SEED_MESSAGES = 20;
105475
+ var SEED_CHARS = 8192;
105476
+ function seedFrom(entries, current) {
105477
+ const kept = (Array.isArray(entries) ? entries : []).filter(
105478
+ (e) => e && typeof e.text === "string" && typeof e.sender === "string" && !(e.sender === "agent" && (isOwnerNotice(e.text) || e.text === LEGACY_FAILURE_NOTICE))
105479
+ );
105480
+ const last = kept[kept.length - 1];
105481
+ if (current && last && isCurrent(last, current)) kept.pop();
105482
+ const text = kept.map((e) => `${e.sender}: ${e.text}`).join("\n").slice(-SEED_CHARS);
105483
+ return text.trim() ? text : void 0;
105484
+ }
105485
+ function safeHistory(read) {
105486
+ try {
105487
+ return read();
105488
+ } catch {
105489
+ return void 0;
105490
+ }
105491
+ }
105225
105492
  var RoomHushState = class {
105226
105493
  until = /* @__PURE__ */ new Map();
105227
105494
  set(roomId, hushedUntilIso) {
@@ -105239,14 +105506,13 @@ var RoomHushState = class {
105239
105506
  return t2 !== void 0 && now < t2;
105240
105507
  }
105241
105508
  };
105242
- function reportTurnFailure(channel, failure2) {
105509
+ function reportTurnFailure(channel, report) {
105243
105510
  try {
105244
- reportToolInvoke(channel?.telemetry, {
105245
- toolName: "model_turn",
105246
- outcome: "error",
105247
- errorKind: failure2.upstreamStatus === 429 ? "model_rate_limited" : "model_error",
105248
- durationMs: 0,
105249
- conversation: { kind: "unknown" }
105511
+ const sink = channel?.telemetry;
105512
+ reportModelTurnFailure(sink && typeof sink.reportCustomSpan === "function" ? sink : null, {
105513
+ code: report.code,
105514
+ conversation: report.conversation,
105515
+ durationMs: report.durationMs
105250
105516
  });
105251
105517
  } catch {
105252
105518
  }
@@ -105444,6 +105710,7 @@ function wireBridge(channel, session, target, opts = {}) {
105444
105710
  const body = fileLocked ? `${turnText}
105445
105711
 
105446
105712
  ${FILE_LOCK_NOTE}` : turnText;
105713
+ const seed = workAllowed() && gatesRemoved() ? void 0 : seedFrom(safeHistory(() => channel.getRoomHistory?.(e.roomId, SEED_MESSAGES)), { text: e.plaintext, ts: e.timestamp });
105447
105714
  session.push(
105448
105715
  contextBlock ? `${contextBlock}
105449
105716
 
@@ -105452,7 +105719,9 @@ ${body}` : body,
105452
105719
  {
105453
105720
  autoReplyOnText: false,
105454
105721
  replyExpected: owes,
105455
- ownerTurn: ownerPowered
105722
+ ownerTurn: ownerPowered,
105723
+ conversation: { kind: "room", id: e.roomId },
105724
+ ...seed ? { seed } : {}
105456
105725
  }
105457
105726
  );
105458
105727
  if (ownerPowered) {
@@ -105475,10 +105744,19 @@ ${body}` : body,
105475
105744
  } else {
105476
105745
  log("inbound 1:1 DM from owner");
105477
105746
  }
105478
- target.setDm(metadata?.conversationId, metadata?.conversationGroupId);
105747
+ const conversationId = typeof metadata?.conversationId === "string" ? metadata.conversationId : void 0;
105748
+ const groupId = typeof metadata?.conversationGroupId === "string" ? metadata.conversationGroupId : void 0;
105749
+ target.setDm(conversationId, groupId);
105750
+ const seed = ownerAttested && conversationId ? seedFrom(safeHistory(() => channel.getConversationHistory?.(conversationId, SEED_MESSAGES, { groupId })), {
105751
+ text,
105752
+ ...typeof metadata?.messageId === "string" && metadata.messageId ? { id: metadata.messageId } : {},
105753
+ ...typeof metadata?.timestamp === "string" ? { ts: metadata.timestamp } : {}
105754
+ }) : void 0;
105479
105755
  session.push(text, target.snapshotReply(channel, log), {
105480
105756
  autoReplyOnText: ownerAttested,
105481
- ownerTurn: ownerAttested
105757
+ ownerTurn: ownerAttested,
105758
+ conversation: conversationId ? { kind: "direct", id: conversationId } : { kind: "unknown" },
105759
+ ...seed ? { seed } : {}
105482
105760
  });
105483
105761
  });
105484
105762
  }
@@ -105537,7 +105815,7 @@ function mkdir700(path2) {
105537
105815
  chmodSync5(path2, 448);
105538
105816
  }
105539
105817
  function packageVersion() {
105540
- return true ? "0.1.38" : void 0;
105818
+ return true ? "0.1.40" : void 0;
105541
105819
  }
105542
105820
  function helpText(version2) {
105543
105821
  return [
@@ -105665,9 +105943,12 @@ async function main(opts = {}) {
105665
105943
  session = new MuseSession(driver, {
105666
105944
  log: (m2) => logLine(m2),
105667
105945
  identity,
105668
- // #1467: every failed turn reaches Recent problems (and Admin) — `channel`
105669
- // is read when the failure happens, after it is connected.
105670
- onTurnFailed: (failure2) => reportTurnFailure(channel, failure2)
105946
+ // #1560: the notice names the agent as the app shows it.
105947
+ agentName: () => channel?.ownDisplayName?.toString().trim() || cfg.agentName,
105948
+ // #1467/#1560: every failed turn reaches Recent problems (and Admin) with
105949
+ // its code and conversation — `channel` is read when the failure happens,
105950
+ // after it is connected.
105951
+ onTurnFailed: (report) => reportTurnFailure(channel, report)
105671
105952
  });
105672
105953
  try {
105673
105954
  await driver.start();