@capxul/mcp 4.20.0-beta.30 → 4.20.0-beta.32

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/main.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as __exportAll, o as __require, r as __commonJSMin, s as __toESM } from "./lib-DnmstTkB.mjs";
3
- import { $ as isSignerNotReadySignal, $t as ChainIdSchema, A as makeApprovalsMethods, An as detectAuthCacheAdapter, At as publicKeyToAddress, B as BASE_SEPOLIA_CHAIN_ID, Bn as redactUrlSecrets, Bt as toBytes, C as makeAccountsMethods, Cn as copyInvocationObservation, Ct as toOrgId, D as ConvexCallPortTag, Dn as toPublishableKey, Dt as isBytes32, E as TelemetryPortTag, En as toAllowedOrigin, Et as images, F as makeDestinationsMethods, Fn as AuthCachePortTag, Ft as concatHex, G as failureEvidenceProps, Gn as CapxulError, Gt as hexToBigInt, H as asCapxulError, Hn as isRecord, Ht as numberToHex, I as makeCheckoutMethods, In as deserializeCapxulError, It as isAddress, J as withCapturedAttemptContext, Jn as isFailureMode, Jt as BaseError, K as observeFailedResult, Kn as isCapxulError, Kt as hexToNumber, L as makeTargetsMethods, Ln as serializeCapxulError, Lt as InvalidAddressError, M as logDroppedEvent, Mn as toEpochMs, Mt as createCursor, N as makeOfframpMethods, Nn as toAuthUserId, Nt as slice, O as convexCallErrorFromCapxul, On as AuthClientError, Ot as hashTypedData, P as makePaymentsMethods, Pn as toEmail, Pt as concat, Q as isEcdsaSignatureHex, Qt as EpochMsSchema, Rn as decodeChainCause, Rt as keccak256, S as PonderIndexerAdapter, Sn as attachInvocationObservation, St as ORGANIZATION_SETUP_STATUSES, T as AccountReadPortTag, Tn as sanitizeObservationContext, Tt as AppIdSchema, U as toPublicError, Un as readField, Ut as stringToHex, V as callOperation, Vn as isCredentialField, Vt as bytesToHex, W as failureDetail, Wn as Errors, Wt as toHex, X as UNOBSERVABLE_SIGNER_STATUS, Xt as isHex, Y as version$2, Yt as size, Z as causeChain, Zt as DurationMsSchema, _ as makePaymentDocumentsMethods, _n as SystemClockLayer, _t as OPERATIONS, an as askIdentity, at as toCountryCode, b as SmartAccountPortTag, bn as BetterAuthBrowserLayer, bt as setups, cn as runPortEffect, ct as toHandle, dn as toCapxulResult, dt as CLI_CAPABILITIES, en as isEvmAddress, et as openfortSignerNotReadyCode, fn as formatTraceparent, ft as CLI_COMMAND_NAMES, g as makeActivityMethods, gn as oauthBearerAuthClient, gt as normalizeCapxulOperation, h as makeMeMethods, hn as carryInvocationParentSpan, ht as isCapxulOperation, in as makeAuthMethods, it as makeClientRequestMethods, j as makeAccountMethods, jn as globalLocalStorage, jt as formatGwei$1, k as bindProductTelemetryInvocation, kn as AuthClientPortTag, kt as toRlp, ln as sessionFromActor, lt as validateHandle, m as bootIdentityFlow, mn as ActorFailure, mt as CAPXUL_OPERATIONS, n as makeOrgMethods, nn as absurd, nt as signerFailure, o as ConvexOrganizationAdapter, on as publicIdentityFailure, ot as toKycTier, p as executeIdentityProductObservation, pn as CAPXUL_ERROR_CODES, pt as CLI_INVOCATION_KINDS, q as observeSdkClient, qn as FAILURE_MODES, qt as trim$1, rn as getFunctionName, rt as makeCurrentUserMethods, s as OrgPortTag, sn as runIdentityFacade, st as toTesterKind, t as ConvexOrganizationSetupAdapter, tn as toAddress, tt as recoverRawDigestSigner, un as runCapxulEffect, ut as redactTelemetryProps, v as makeSmartAccountMethods, vn as ClockPortTag, vt as details, w as ConvexAccountLayer, wn as readInvocationObservation, wt as diagnostics, x as makeHoldingsMethods, xn as observationRequestHeaders, xt as ORGANIZATION_SETUP_REASONS, y as ConvexSmartAccountLayer, yn as BetterAuthNodeLayer, yt as onboardings, z as normalizeSafeSaltEmail, zn as redactSecrets, zt as hexToBytes } from "./organizations-CyTR7Lft.mjs";
3
+ import { $ as isSignerNotReadySignal, $t as ChainIdSchema, A as bindProductTelemetryInvocation, An as detectAuthCacheAdapter, At as publicKeyToAddress, B as BASE_SEPOLIA_CHAIN_ID, Bn as redactUrlSecrets, Bt as toBytes, C as PonderIndexerAdapter, Cn as copyInvocationObservation, Ct as toOrgId, D as TelemetryPortTag, Dn as toPublishableKey, Dt as isBytes32, E as AccountReadPortTag, En as toAllowedOrigin, Et as images, F as makeCheckoutMethods, Fn as AuthCachePortTag, Ft as concatHex, G as failureEvidenceProps, Gn as CapxulError, Gt as hexToBigInt, H as asCapxulError, Hn as isRecord, Ht as numberToHex, I as makeTargetsMethods, In as deserializeCapxulError, It as isAddress, J as withCapturedAttemptContext, Jn as isFailureMode, Jt as BaseError, K as observeFailedResult, Kn as isCapxulError, Kt as hexToNumber, L as makeVerificationMethods, Ln as serializeCapxulError, Lt as InvalidAddressError, M as makeAccountMethods, Mn as toEpochMs, Mt as createCursor, N as makePaymentsMethods, Nn as toAuthUserId, Nt as slice, O as ConvexCallPortTag, On as AuthClientError, Ot as hashTypedData, P as makeDestinationsMethods, Pn as toEmail, Pt as concat, Q as isEcdsaSignatureHex, Qt as EpochMsSchema, Rn as decodeChainCause, Rt as keccak256, S as makeHoldingsMethods, Sn as attachInvocationObservation, St as ORGANIZATION_SETUP_STATUSES, T as ConvexAccountLayer, Tn as sanitizeObservationContext, Tt as AppIdSchema, U as toPublicError, Un as readField, Ut as stringToHex, V as callOperation, Vn as isCredentialField, Vt as bytesToHex, W as failureDetail, Wn as Errors, Wt as toHex, X as UNOBSERVABLE_SIGNER_STATUS, Xt as isHex, Y as version$2, Yt as size, Z as causeChain, Zt as DurationMsSchema, _ as makeActivityMethods, _n as SystemClockLayer, _t as OPERATIONS, an as askIdentity, at as toCountryCode, b as ConvexSmartAccountLayer, bn as BetterAuthBrowserLayer, bt as setups, c as OrgPortTag, cn as runPortEffect, ct as toHandle, dn as toCapxulResult, dt as CLI_CAPABILITIES, en as isEvmAddress, et as openfortSignerNotReadyCode, fn as formatTraceparent, ft as CLI_COMMAND_NAMES, g as makeMeMethods, gn as oauthBearerAuthClient, gt as normalizeCapxulOperation, h as bootIdentityFlow, hn as carryInvocationParentSpan, ht as isCapxulOperation, in as makeAuthMethods, it as makeClientRequestMethods, j as makeApprovalsMethods, jn as globalLocalStorage, jt as formatGwei$1, k as convexCallErrorFromCapxul, kn as AuthClientPortTag, kt as toRlp, ln as sessionFromActor, lt as validateHandle, m as executeIdentityProductObservation, mn as ActorFailure, mt as CAPXUL_OPERATIONS, n as makeOrgMethods, nn as absurd, nt as signerFailure, on as publicIdentityFailure, ot as toKycTier, pn as CAPXUL_ERROR_CODES, pt as CLI_INVOCATION_KINDS, q as observeSdkClient, qn as FAILURE_MODES, qt as trim$1, r as makeBankingMethods, rn as getFunctionName, rt as makeCurrentUserMethods, s as ConvexOrganizationAdapter, sn as runIdentityFacade, st as toTesterKind, t as ConvexOrganizationSetupAdapter, tn as toAddress, tt as recoverRawDigestSigner, un as runCapxulEffect, ut as redactTelemetryProps, v as makePaymentDocumentsMethods, vn as ClockPortTag, vt as details, w as makeAccountsMethods, wn as readInvocationObservation, wt as diagnostics, x as SmartAccountPortTag, xn as observationRequestHeaders, xt as ORGANIZATION_SETUP_REASONS, y as makeSmartAccountMethods, yn as BetterAuthNodeLayer, yt as onboardings, z as normalizeSafeSaltEmail, zn as redactSecrets, zt as hexToBytes } from "./organizations-D0q0-iDF.mjs";
4
4
  import { n as sha256$2, t as secp256k1 } from "./secp256k1-b-_IancF.mjs";
5
5
  import { t as require_lib } from "./lib-CoGPQsbr.mjs";
6
6
  import { serveStdio } from "@modelcontextprotocol/server/stdio";
@@ -35,10 +35,13 @@ function readSdkEnvConfig(env = process.env) {
35
35
  if (publishableKey === void 0 || publishableKey.length === 0) throw Errors.envMissing("CAPXUL_MCP_PUBLISHABLE_KEY (or CAPXUL_E2E_PUBLISHABLE_KEY)");
36
36
  const bootstrapBaseUrl = env.CAPXUL_MCP_BOOTSTRAP_URL?.trim() || env.CONVEX_SITE_URL?.trim();
37
37
  if (bootstrapBaseUrl === void 0 || bootstrapBaseUrl.length === 0) throw Errors.envMissing("CAPXUL_MCP_BOOTSTRAP_URL (or CONVEX_SITE_URL)");
38
+ const origin = env.CAPXUL_MCP_ORIGIN?.trim() || env.CAPXUL_E2E_ORIGIN?.trim() || env.SITE_URL?.trim() || bootstrapBaseUrl;
39
+ const devToolsUrl = env.CAPXUL_DEVTOOLS_URL?.trim() || void 0;
38
40
  return {
41
+ ...devToolsUrl === void 0 ? {} : { devToolsUrl },
39
42
  publishableKey,
40
43
  bootstrapBaseUrl,
41
- origin: env.CAPXUL_MCP_ORIGIN?.trim() || env.CAPXUL_E2E_ORIGIN?.trim() || env.SITE_URL?.trim() || bootstrapBaseUrl,
44
+ origin,
42
45
  authBaseUrl: readAuthBaseUrl(env) ?? bootstrapBaseUrl
43
46
  };
44
47
  }
@@ -447,7 +450,7 @@ var ConvexError = class extends (_b = Error, _a = IDENTIFYING_FIELD, _b) {
447
450
  //#region ../../node_modules/.pnpm/convex@1.39.1_react@19.2.7/node_modules/convex/dist/esm/index.js
448
451
  const version$1 = "1.39.1";
449
452
  //#endregion
450
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatGwei.js
453
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/unit/formatGwei.js
451
454
  /**
452
455
  * Converts numerical wei to a string representation of gwei.
453
456
  *
@@ -463,7 +466,7 @@ function formatGwei(wei, unit = "wei") {
463
466
  return formatGwei$1(wei, unit);
464
467
  }
465
468
  //#endregion
466
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/transaction.js
469
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/transaction.js
467
470
  function prettyPrint(args) {
468
471
  const entries = Object.entries(args).map(([key, value]) => {
469
472
  if (value === void 0 || value === false) return null;
@@ -504,7 +507,7 @@ var InvalidStorageKeySizeError = class extends BaseError {
504
507
  }
505
508
  };
506
509
  //#endregion
507
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
510
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
508
511
  /**
509
512
  * Computes an Authorization hash in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.
510
513
  */
@@ -520,7 +523,7 @@ function hashAuthorization(parameters) {
520
523
  return hash;
521
524
  }
522
525
  //#endregion
523
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/node.js
526
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/node.js
524
527
  var ExecutionRevertedError = class extends BaseError {
525
528
  constructor({ cause, message } = {}) {
526
529
  const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
@@ -758,7 +761,7 @@ Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
758
761
  -(2n ** (256n - 1n));
759
762
  const maxUint256 = 2n ** 256n - 1n;
760
763
  //#endregion
761
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
764
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToCommitments.js
762
765
  /**
763
766
  * Compute commitments from a list of blobs.
764
767
  *
@@ -780,7 +783,7 @@ function blobsToCommitments(parameters) {
780
783
  return to === "bytes" ? commitments : commitments.map((x) => bytesToHex(x));
781
784
  }
782
785
  //#endregion
783
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToProofs.js
786
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/blobsToProofs.js
784
787
  /**
785
788
  * Compute the proofs for a list of blobs and their commitments.
786
789
  *
@@ -825,7 +828,7 @@ function blobsToProofs(parameters) {
825
828
  /** @deprecated Use import from `noble/hashes/sha2` module */
826
829
  const sha256$1 = sha256$2;
827
830
  //#endregion
828
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/sha256.js
831
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/hash/sha256.js
829
832
  function sha256(value, to_) {
830
833
  const to = to_ || "hex";
831
834
  const bytes = sha256$1(isHex(value, { strict: false }) ? toBytes(value) : value);
@@ -833,7 +836,7 @@ function sha256(value, to_) {
833
836
  return toHex(bytes);
834
837
  }
835
838
  //#endregion
836
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
839
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
837
840
  /**
838
841
  * Transform a commitment to it's versioned hash.
839
842
  *
@@ -859,7 +862,7 @@ function commitmentToVersionedHash(parameters) {
859
862
  return to === "bytes" ? versionedHash : bytesToHex(versionedHash);
860
863
  }
861
864
  //#endregion
862
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
865
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
863
866
  /**
864
867
  * Transform a list of commitments to their versioned hashes.
865
868
  *
@@ -889,7 +892,7 @@ function commitmentsToVersionedHashes(parameters) {
889
892
  return hashes;
890
893
  }
891
894
  //#endregion
892
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/blob.js
895
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/blob.js
893
896
  /** Blob limit per transaction. */
894
897
  const blobsPerTransaction = 6;
895
898
  /** The number of field elements in a blob. */
@@ -899,7 +902,7 @@ const bytesPerBlob = 32 * fieldElementsPerBlob;
899
902
  /** Blob bytes limit per transaction. */
900
903
  const maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - 1 - 1 * fieldElementsPerBlob * blobsPerTransaction;
901
904
  //#endregion
902
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/blob.js
905
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/blob.js
903
906
  var BlobSizeTooLargeError = class extends BaseError {
904
907
  constructor({ maxSize, size }) {
905
908
  super("Blob size is too large.", {
@@ -930,7 +933,7 @@ var InvalidVersionedHashVersionError = class extends BaseError {
930
933
  }
931
934
  };
932
935
  //#endregion
933
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobs.js
936
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobs.js
934
937
  /**
935
938
  * Transforms arbitrary data to blobs.
936
939
  *
@@ -973,7 +976,7 @@ function toBlobs(parameters) {
973
976
  return to === "bytes" ? blobs.map((x) => x.bytes) : blobs.map((x) => bytesToHex(x.bytes));
974
977
  }
975
978
  //#endregion
976
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobSidecars.js
979
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/blob/toBlobSidecars.js
977
980
  /**
978
981
  * Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array.
979
982
  *
@@ -1027,7 +1030,7 @@ function toBlobSidecars(parameters) {
1027
1030
  return sidecars;
1028
1031
  }
1029
1032
  //#endregion
1030
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/getTransactionType.js
1033
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/getTransactionType.js
1031
1034
  function getTransactionType(transaction) {
1032
1035
  if (transaction.type) return transaction.type;
1033
1036
  if (typeof transaction.authorizationList !== "undefined") return "eip7702";
@@ -1040,14 +1043,14 @@ function getTransactionType(transaction) {
1040
1043
  throw new InvalidSerializableTransactionError({ transaction });
1041
1044
  }
1042
1045
  //#endregion
1043
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/chain.js
1046
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/errors/chain.js
1044
1047
  var InvalidChainIdError = class extends BaseError {
1045
1048
  constructor({ chainId }) {
1046
1049
  super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
1047
1050
  }
1048
1051
  };
1049
1052
  //#endregion
1050
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/assertTransaction.js
1053
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/assertTransaction.js
1051
1054
  function assertTransactionEIP7702(transaction) {
1052
1055
  const { authorizationList } = transaction;
1053
1056
  if (authorizationList) for (const authorization of authorizationList) {
@@ -1102,7 +1105,7 @@ function assertTransactionLegacy(transaction) {
1102
1105
  if (gasPrice && gasPrice > maxUint256) throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
1103
1106
  }
1104
1107
  //#endregion
1105
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
1108
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeAccessList.js
1106
1109
  function serializeAccessList(accessList) {
1107
1110
  if (!accessList || accessList.length === 0) return [];
1108
1111
  const serializedAccessList = [];
@@ -1115,7 +1118,7 @@ function serializeAccessList(accessList) {
1115
1118
  return serializedAccessList;
1116
1119
  }
1117
1120
  //#endregion
1118
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeTransaction.js
1121
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/transaction/serializeTransaction.js
1119
1122
  function serializeTransaction(transaction, signature) {
1120
1123
  const type = getTransactionType(transaction);
1121
1124
  if (type === "eip1559") return serializeTransactionEIP1559(transaction, signature);
@@ -1290,7 +1293,7 @@ function toYParitySignatureArray(transaction, signature_) {
1290
1293
  ];
1291
1294
  }
1292
1295
  //#endregion
1293
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
1296
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
1294
1297
  function serializeAuthorizationList(authorizationList) {
1295
1298
  if (!authorizationList || authorizationList.length === 0) return [];
1296
1299
  const serializedAuthorizationList = [];
@@ -1307,10 +1310,10 @@ function serializeAuthorizationList(authorizationList) {
1307
1310
  return serializedAuthorizationList;
1308
1311
  }
1309
1312
  //#endregion
1310
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/strings.js
1313
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/constants/strings.js
1311
1314
  const presignMessagePrefix = "Ethereum Signed Message:\n";
1312
1315
  //#endregion
1313
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
1316
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
1314
1317
  function toPrefixedMessage(message_) {
1315
1318
  const message = (() => {
1316
1319
  if (typeof message_ === "string") return stringToHex(message_);
@@ -1321,12 +1324,12 @@ function toPrefixedMessage(message_) {
1321
1324
  return concat([prefix, message]);
1322
1325
  }
1323
1326
  //#endregion
1324
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/hashMessage.js
1327
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/hashMessage.js
1325
1328
  function hashMessage(message, to_) {
1326
1329
  return keccak256(toPrefixedMessage(message), to_);
1327
1330
  }
1328
1331
  //#endregion
1329
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/serializeSignature.js
1332
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/utils/signature/serializeSignature.js
1330
1333
  /**
1331
1334
  * @description Converts a signature into hex format.
1332
1335
  *
@@ -1419,7 +1422,7 @@ function isPostHogUrlProperty(key) {
1419
1422
  return normalized.includes("url") || normalized.includes("referrer") || normalized.includes("path") || normalized.includes("filename");
1420
1423
  }
1421
1424
  //#endregion
1422
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/toAccount.js
1425
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/toAccount.js
1423
1426
  /**
1424
1427
  * @description Creates an Account from a custom signing implementation.
1425
1428
  *
@@ -1447,7 +1450,7 @@ function toAccount(source) {
1447
1450
  };
1448
1451
  }
1449
1452
  //#endregion
1450
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/sign.js
1453
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/sign.js
1451
1454
  let extraEntropy = false;
1452
1455
  /**
1453
1456
  * @description Signs a hash with a given private key.
@@ -1477,7 +1480,7 @@ async function sign({ hash, privateKey, to = "object" }) {
1477
1480
  })();
1478
1481
  }
1479
1482
  //#endregion
1480
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signAuthorization.js
1483
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signAuthorization.js
1481
1484
  /**
1482
1485
  * Signs an Authorization hash in [EIP-7702 format](https://eips.ethereum.org/EIPS/eip-7702): `keccak256('0x05' || rlp([chain_id, address, nonce]))`.
1483
1486
  */
@@ -1502,7 +1505,7 @@ async function signAuthorization(parameters) {
1502
1505
  return signature;
1503
1506
  }
1504
1507
  //#endregion
1505
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signMessage.js
1508
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signMessage.js
1506
1509
  /**
1507
1510
  * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):
1508
1511
  * `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
@@ -1517,7 +1520,7 @@ async function signMessage({ message, privateKey }) {
1517
1520
  });
1518
1521
  }
1519
1522
  //#endregion
1520
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signTransaction.js
1523
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signTransaction.js
1521
1524
  async function signTransaction(parameters) {
1522
1525
  const { privateKey, transaction, serializer = serializeTransaction } = parameters;
1523
1526
  const signableTransaction = (() => {
@@ -1533,7 +1536,7 @@ async function signTransaction(parameters) {
1533
1536
  }));
1534
1537
  }
1535
1538
  //#endregion
1536
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signTypedData.js
1539
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/utils/signTypedData.js
1537
1540
  /**
1538
1541
  * @description Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712):
1539
1542
  * `sign(keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message)))`.
@@ -1549,7 +1552,7 @@ async function signTypedData(parameters) {
1549
1552
  });
1550
1553
  }
1551
1554
  //#endregion
1552
- //#region ../../node_modules/.pnpm/viem@2.55.18_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/privateKeyToAccount.js
1555
+ //#region ../../node_modules/.pnpm/viem@2.55.18_patch_hash=6dka2762lzcggf7at6h6xt4khq_@typescript+typescript6@6.0.2_zod@4.6.5/node_modules/viem/_esm/accounts/privateKeyToAccount.js
1553
1556
  /**
1554
1557
  * @description Creates an Account from a private key.
1555
1558
  *
@@ -25182,6 +25185,76 @@ function devPrivateKeySigner(input) {
25182
25185
  };
25183
25186
  }
25184
25187
  //#endregion
25188
+ //#region ../../packages/observability/src/devtools.ts
25189
+ /** Local inspection is an explicit host choice, independent of remote telemetry. */
25190
+ function validateDevToolsUrl(value) {
25191
+ const url = new URL(value);
25192
+ if (!["ws:", "wss:"].includes(url.protocol) || ![
25193
+ "localhost",
25194
+ "127.0.0.1",
25195
+ "[::1]",
25196
+ "host.docker.internal"
25197
+ ].includes(url.hostname) || url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "") throw new TypeError("devToolsUrl must be a local WebSocket URL without credentials");
25198
+ return url.href;
25199
+ }
25200
+ function localSpan(delegate) {
25201
+ const attributes = new Map(delegate.attributes);
25202
+ let status = delegate.status;
25203
+ return {
25204
+ _tag: "Span",
25205
+ name: delegate.name,
25206
+ spanId: delegate.spanId,
25207
+ traceId: delegate.traceId,
25208
+ parent: delegate.parent,
25209
+ annotations: delegate.annotations,
25210
+ sampled: delegate.sampled,
25211
+ kind: delegate.kind,
25212
+ attributes,
25213
+ get status() {
25214
+ return status;
25215
+ },
25216
+ get links() {
25217
+ return delegate.links;
25218
+ },
25219
+ attribute(key, value) {
25220
+ attributes.set(key, value);
25221
+ delegate.attribute(key, value);
25222
+ },
25223
+ event(name, time, values) {
25224
+ delegate.event(name, time, values);
25225
+ },
25226
+ addLinks(links) {
25227
+ delegate.addLinks(links);
25228
+ },
25229
+ end(endTime, exit) {
25230
+ delegate.end(endTime, exit);
25231
+ status = {
25232
+ _tag: "Ended",
25233
+ startTime: status.startTime,
25234
+ endTime,
25235
+ exit
25236
+ };
25237
+ }
25238
+ };
25239
+ }
25240
+ /** Acquire after the host layer so traces and metrics use the same context. */
25241
+ function withDevTools(layer, url) {
25242
+ if (url === void 0) return layer;
25243
+ const endpoint = validateDevToolsUrl(url);
25244
+ return Layer.unwrap(Effect.promise(async () => {
25245
+ const [{ DevToolsClient }, { Socket }] = await Promise.all([import("effect/devtools"), import("effect/socket")]);
25246
+ const client = DevToolsClient.layer.pipe(Layer.provide(Socket.layerWebSocket(endpoint)), Layer.provide(Socket.layerWebSocketConstructorGlobal));
25247
+ return Layer.effect(Tracer.Tracer, Effect.gen(function* () {
25248
+ const delegate = yield* Effect.tracer;
25249
+ const mirror = Tracer.make({
25250
+ span: (options) => localSpan(delegate.span(options)),
25251
+ ...delegate.context === void 0 ? {} : { context: delegate.context.bind(delegate) }
25252
+ });
25253
+ return yield* DevToolsClient.makeTracer.pipe(Effect.provideService(Tracer.Tracer, mirror));
25254
+ })).pipe(Layer.provide(client), Layer.provideMerge(layer));
25255
+ }));
25256
+ }
25257
+ //#endregion
25185
25258
  //#region ../../packages/protocol/src/errors/convex-decoding.ts
25186
25259
  const KNOWN_CODES = new Set(CAPXUL_ERROR_CODES);
25187
25260
  function isCapxulCode(value) {
@@ -30408,6 +30481,123 @@ const attributes = (input, limit = 32) => {
30408
30481
  };
30409
30482
  const terminalName = (name) => name === "cli.command.completed" || name === "cli.wallet.step" || CLI_COMMAND_NAMES.some((command) => name === `cli.command.${command}`);
30410
30483
  //#endregion
30484
+ //#region ../../packages/observability/src/engineering/tracer.ts
30485
+ const failureText = (failure, key, limit, source) => {
30486
+ if (failure === null || typeof failure !== "object") return void 0;
30487
+ try {
30488
+ let owner = failure;
30489
+ let descriptor;
30490
+ for (let depth = 0; owner !== null && depth < 4; depth += 1) {
30491
+ descriptor = Object.getOwnPropertyDescriptor(owner, key);
30492
+ if (descriptor !== void 0 || key !== "name") break;
30493
+ owner = Object.getPrototypeOf(owner);
30494
+ }
30495
+ const value = descriptor?.value;
30496
+ return typeof value === "string" || key === "code" && typeof value === "number" ? redactSecrets(String(value), source).slice(0, limit) : void 0;
30497
+ } catch {
30498
+ return;
30499
+ }
30500
+ };
30501
+ const exportFailure = (failure, source) => {
30502
+ const message = failureText(failure, "message", 2048, source) ?? (typeof failure === "string" ? redactSecrets(failure, source).slice(0, 2048) : "Engineering operation failed");
30503
+ const code = failureText(failure, "code", 128);
30504
+ const error = new Error((code === void 0 ? message : `${message} [code=${code}]`).slice(0, 2048));
30505
+ error.name = failureText(failure, "_tag", 128) ?? failureText(failure, "name", 128) ?? "Error";
30506
+ error.stack = failureText(failure, "stack", 8192, source) ?? `${error.name}: ${error.message}`;
30507
+ return error;
30508
+ };
30509
+ const exportFailureExit = (cause, source) => Exit.failCause(Cause.fromReasons(cause.reasons.filter((reason) => !Cause.isInterruptReason(reason)).slice(0, 8).map((reason) => Cause.isFailReason(reason) ? Cause.makeFailReason(exportFailure(reason.error, source)) : Cause.makeDieReason(exportFailure(reason.defect, source)))));
30510
+ const BROWSER_KEEPALIVE_BYTES = 65536;
30511
+ let unfinishedBrowserExportBytes = 0;
30512
+ const hasBrowserDocument = () => typeof window !== "undefined" && typeof document !== "undefined";
30513
+ const browserExportClient = (client) => HttpClient.transform(client, (response, request) => Effect.acquireUseRelease(Effect.sync(() => {
30514
+ const bytes = "contentLength" in request.body ? request.body.contentLength : void 0;
30515
+ if (request.body._tag === "Stream" || request.body._tag === "FormData" || bytes === void 0 || !Number.isSafeInteger(bytes) || bytes < 0 || unfinishedBrowserExportBytes + bytes > BROWSER_KEEPALIVE_BYTES) return;
30516
+ unfinishedBrowserExportBytes += bytes;
30517
+ return bytes;
30518
+ }), (bytes) => response.pipe(Effect.provideService(FetchHttpClient.RequestInit, { keepalive: bytes !== void 0 }), Effect.tap((result) => bytes === void 0 ? Effect.void : Stream.runDrain(result.stream).pipe(Effect.catchIf((error) => error.reason._tag === "EmptyBodyError", () => Effect.void)))), (bytes) => Effect.sync(() => {
30519
+ if (bytes !== void 0) unfinishedBrowserExportBytes -= bytes;
30520
+ })));
30521
+ const spanUpstream = (span) => {
30522
+ let current = span;
30523
+ while (current?._tag === "Span") {
30524
+ const upstream = current.attributes.get("chain.upstream");
30525
+ if (upstream === "alchemy" || upstream === "infura" || upstream === "gateway") return upstream;
30526
+ current = current.parent._tag === "Some" ? current.parent.value : void 0;
30527
+ }
30528
+ };
30529
+ function redactHttpPath(path, fullUrl, source) {
30530
+ let origin = "https://redaction.invalid";
30531
+ try {
30532
+ const url = new URL(String(fullUrl));
30533
+ if (url.protocol === "https:" || url.protocol === "http:") origin = url.origin;
30534
+ } catch {}
30535
+ const prefix = path.startsWith("/") ? origin : "";
30536
+ return redactUrlSecrets(`${prefix}${path}`, source).slice(prefix.length, prefix.length + 2048);
30537
+ }
30538
+ /** A span whose prototype is `span`: it answers every Span member until an own property overrides it. */
30539
+ function inheritSpan(span) {
30540
+ const wrapped = Object.create(span);
30541
+ Object.defineProperties(wrapped, {
30542
+ traceId: { get: () => span.traceId },
30543
+ spanId: { get: () => span.spanId },
30544
+ attributes: { get: () => span.attributes },
30545
+ event: {
30546
+ value: span.event.bind(span),
30547
+ configurable: true
30548
+ },
30549
+ addLinks: {
30550
+ value: span.addLinks.bind(span),
30551
+ configurable: true
30552
+ }
30553
+ });
30554
+ return wrapped;
30555
+ }
30556
+ /** Preserve domain exits while preventing the OTLP serializer from seeing raw causes. */
30557
+ const makeLeakSafeEngineeringTracer = (delegate, enabled = () => true) => Tracer.make({
30558
+ span(options) {
30559
+ const span = enabled() ? delegate.span(options) : new Tracer.NativeSpan(options);
30560
+ const wrapped = inheritSpan(span);
30561
+ Object.defineProperty(wrapped, "attribute", { value: (name, value) => {
30562
+ const source = spanUpstream(span);
30563
+ const header = /^http\.(?:request|response)\.header\.(.+)$/u.exec(name)?.[1];
30564
+ if (header !== void 0 && isCredentialField(header, "header")) span.attribute(name, "[REDACTED]");
30565
+ else if (typeof value === "string" && name === "url.query") span.attribute(name, redactUrlSecrets(`?${value}`).slice(1, 2049));
30566
+ else if (typeof value === "string" && (name === "url.path" || name === "http.target")) {
30567
+ const fullUrl = span.attributes.get("url.full") ?? span.attributes.get("http.url");
30568
+ const path = name === "url.path" && typeof fullUrl === "string" ? /^https?:\/\/[^/]+([^?#]*)/u.exec(fullUrl)?.[1] ?? value : value;
30569
+ span.attribute(name, redactHttpPath(path, fullUrl, source));
30570
+ } else if (typeof value === "string" && (name === "url.full" || name === "http.url" || header === "location" || header === "referer" || header === "referrer")) span.attribute(name, redactUrlSecrets(value, source).slice(0, 2048));
30571
+ else if (header !== void 0 && typeof value === "string") span.attribute(name, redactSecrets(value, source).slice(0, 2048));
30572
+ else span.attribute(name, value);
30573
+ } });
30574
+ Object.defineProperty(wrapped, "end", {
30575
+ configurable: false,
30576
+ enumerable: false,
30577
+ value: (endTime, exit) => {
30578
+ if (!enabled()) {
30579
+ Object.defineProperty(wrapped, "status", { value: {
30580
+ _tag: "Ended",
30581
+ startTime: span.status.startTime,
30582
+ endTime,
30583
+ exit
30584
+ } });
30585
+ return;
30586
+ }
30587
+ if (Exit.isFailure(exit) && !Cause.hasInterruptsOnly(exit.cause)) {
30588
+ const first = exit.cause.reasons.find((reason) => !Cause.isInterruptReason(reason));
30589
+ const code = failureText(first === void 0 ? void 0 : Cause.isFailReason(first) ? first.error : first.defect, "code", 128);
30590
+ if (code !== void 0) span.attribute("error.code", code);
30591
+ span.end(endTime, exportFailureExit(exit.cause, spanUpstream(span)));
30592
+ } else span.end(endTime, exit);
30593
+ },
30594
+ writable: false
30595
+ });
30596
+ return wrapped;
30597
+ },
30598
+ ...delegate.context === void 0 ? {} : { context: delegate.context.bind(delegate) }
30599
+ });
30600
+ //#endregion
30411
30601
  //#region ../../packages/observability/src/delivery/records.ts
30412
30602
  function admittedLogger(state, delegate) {
30413
30603
  return Logger.make((options) => {
@@ -30463,7 +30653,7 @@ function admittedTracer(state, delegate) {
30463
30653
  /** The span as a producer sees it: at most 32 fields and 2000 attribute bytes, 2 events, 2 links. */
30464
30654
  function boundedSpan(state, span) {
30465
30655
  const { budget } = state;
30466
- const wrapped = Object.create(span);
30656
+ const wrapped = inheritSpan(span);
30467
30657
  let fields = 0, events = 0, links = 0, attributeBytes = 0;
30468
30658
  let ended = false;
30469
30659
  Object.defineProperties(wrapped, {
@@ -30696,109 +30886,6 @@ const validateEngineeringTelemetryConfig = (config) => {
30696
30886
  };
30697
30887
  };
30698
30888
  //#endregion
30699
- //#region ../../packages/observability/src/engineering/tracer.ts
30700
- const failureText = (failure, key, limit, source) => {
30701
- if (failure === null || typeof failure !== "object") return void 0;
30702
- try {
30703
- let owner = failure;
30704
- let descriptor;
30705
- for (let depth = 0; owner !== null && depth < 4; depth += 1) {
30706
- descriptor = Object.getOwnPropertyDescriptor(owner, key);
30707
- if (descriptor !== void 0 || key !== "name") break;
30708
- owner = Object.getPrototypeOf(owner);
30709
- }
30710
- const value = descriptor?.value;
30711
- return typeof value === "string" || key === "code" && typeof value === "number" ? redactSecrets(String(value), source).slice(0, limit) : void 0;
30712
- } catch {
30713
- return;
30714
- }
30715
- };
30716
- const exportFailure = (failure, source) => {
30717
- const message = failureText(failure, "message", 2048, source) ?? (typeof failure === "string" ? redactSecrets(failure, source).slice(0, 2048) : "Engineering operation failed");
30718
- const code = failureText(failure, "code", 128);
30719
- const error = new Error((code === void 0 ? message : `${message} [code=${code}]`).slice(0, 2048));
30720
- error.name = failureText(failure, "_tag", 128) ?? failureText(failure, "name", 128) ?? "Error";
30721
- error.stack = failureText(failure, "stack", 8192, source) ?? `${error.name}: ${error.message}`;
30722
- return error;
30723
- };
30724
- const exportFailureExit = (cause, source) => Exit.failCause(Cause.fromReasons(cause.reasons.filter((reason) => !Cause.isInterruptReason(reason)).slice(0, 8).map((reason) => Cause.isFailReason(reason) ? Cause.makeFailReason(exportFailure(reason.error, source)) : Cause.makeDieReason(exportFailure(reason.defect, source)))));
30725
- const BROWSER_KEEPALIVE_BYTES = 65536;
30726
- let unfinishedBrowserExportBytes = 0;
30727
- const hasBrowserDocument = () => typeof window !== "undefined" && typeof document !== "undefined";
30728
- const browserExportClient = (client) => HttpClient.transform(client, (response, request) => Effect.acquireUseRelease(Effect.sync(() => {
30729
- const bytes = "contentLength" in request.body ? request.body.contentLength : void 0;
30730
- if (request.body._tag === "Stream" || request.body._tag === "FormData" || bytes === void 0 || !Number.isSafeInteger(bytes) || bytes < 0 || unfinishedBrowserExportBytes + bytes > BROWSER_KEEPALIVE_BYTES) return;
30731
- unfinishedBrowserExportBytes += bytes;
30732
- return bytes;
30733
- }), (bytes) => response.pipe(Effect.provideService(FetchHttpClient.RequestInit, { keepalive: bytes !== void 0 }), Effect.tap((result) => bytes === void 0 ? Effect.void : Stream.runDrain(result.stream).pipe(Effect.catchIf((error) => error.reason._tag === "EmptyBodyError", () => Effect.void)))), (bytes) => Effect.sync(() => {
30734
- if (bytes !== void 0) unfinishedBrowserExportBytes -= bytes;
30735
- })));
30736
- const spanUpstream = (span) => {
30737
- let current = span;
30738
- while (current?._tag === "Span") {
30739
- const upstream = current.attributes.get("chain.upstream");
30740
- if (upstream === "alchemy" || upstream === "infura" || upstream === "gateway") return upstream;
30741
- current = current.parent._tag === "Some" ? current.parent.value : void 0;
30742
- }
30743
- };
30744
- function redactHttpPath(path, fullUrl, source) {
30745
- let origin = "https://redaction.invalid";
30746
- try {
30747
- const url = new URL(String(fullUrl));
30748
- if (url.protocol === "https:" || url.protocol === "http:") origin = url.origin;
30749
- } catch {}
30750
- const prefix = path.startsWith("/") ? origin : "";
30751
- return redactUrlSecrets(`${prefix}${path}`, source).slice(prefix.length, prefix.length + 2048);
30752
- }
30753
- /** A span whose prototype is `span`: it answers every Span member until an own property overrides it. */
30754
- function inheritSpan(span) {
30755
- return Object.create(span);
30756
- }
30757
- /** Preserve domain exits while preventing the OTLP serializer from seeing raw causes. */
30758
- const makeLeakSafeEngineeringTracer = (delegate, enabled = () => true) => Tracer.make({
30759
- span(options) {
30760
- const span = enabled() ? delegate.span(options) : new Tracer.NativeSpan(options);
30761
- const wrapped = inheritSpan(span);
30762
- Object.defineProperty(wrapped, "attribute", { value: (name, value) => {
30763
- const source = spanUpstream(span);
30764
- const header = /^http\.(?:request|response)\.header\.(.+)$/u.exec(name)?.[1];
30765
- if (header !== void 0 && isCredentialField(header, "header")) span.attribute(name, "[REDACTED]");
30766
- else if (typeof value === "string" && name === "url.query") span.attribute(name, redactUrlSecrets(`?${value}`).slice(1, 2049));
30767
- else if (typeof value === "string" && (name === "url.path" || name === "http.target")) {
30768
- const fullUrl = span.attributes.get("url.full") ?? span.attributes.get("http.url");
30769
- const path = name === "url.path" && typeof fullUrl === "string" ? /^https?:\/\/[^/]+([^?#]*)/u.exec(fullUrl)?.[1] ?? value : value;
30770
- span.attribute(name, redactHttpPath(path, fullUrl, source));
30771
- } else if (typeof value === "string" && (name === "url.full" || name === "http.url" || header === "location" || header === "referer" || header === "referrer")) span.attribute(name, redactUrlSecrets(value, source).slice(0, 2048));
30772
- else if (header !== void 0 && typeof value === "string") span.attribute(name, redactSecrets(value, source).slice(0, 2048));
30773
- else span.attribute(name, value);
30774
- } });
30775
- Object.defineProperty(wrapped, "end", {
30776
- configurable: false,
30777
- enumerable: false,
30778
- value: (endTime, exit) => {
30779
- if (!enabled()) {
30780
- Object.defineProperty(wrapped, "status", { value: {
30781
- _tag: "Ended",
30782
- startTime: span.status.startTime,
30783
- endTime,
30784
- exit
30785
- } });
30786
- return;
30787
- }
30788
- if (Exit.isFailure(exit) && !Cause.hasInterruptsOnly(exit.cause)) {
30789
- const first = exit.cause.reasons.find((reason) => !Cause.isInterruptReason(reason));
30790
- const code = failureText(first === void 0 ? void 0 : Cause.isFailReason(first) ? first.error : first.defect, "code", 128);
30791
- if (code !== void 0) span.attribute("error.code", code);
30792
- span.end(endTime, exportFailureExit(exit.cause, spanUpstream(span)));
30793
- } else span.end(endTime, exit);
30794
- },
30795
- writable: false
30796
- });
30797
- return wrapped;
30798
- },
30799
- ...delegate.context === void 0 ? {} : { context: delegate.context.bind(delegate) }
30800
- });
30801
- //#endregion
30802
30889
  //#region ../../packages/observability/src/engineering/minimal.ts
30803
30890
  const MINIMAL_LOG_NAMES = /* @__PURE__ */ new Set([
30804
30891
  "capxul_sdk_operation",
@@ -31458,6 +31545,14 @@ function makeProductionAdapterLayer(input) {
31458
31545
  //#region ../../packages/sdk/src/platform/production-input.ts
31459
31546
  function validateCreateCapxulClientInput(input) {
31460
31547
  const runtime = input.runtime ?? detectRuntime();
31548
+ if (input.devToolsUrl !== void 0) try {
31549
+ validateDevToolsUrl(input.devToolsUrl);
31550
+ } catch {
31551
+ return {
31552
+ ok: false,
31553
+ error: Errors.invalidInput("devToolsUrl", "must be a local ws or wss URL without credentials")
31554
+ };
31555
+ }
31461
31556
  if (input.signer !== void 0 && input.openfortSignerFactory !== void 0) return {
31462
31557
  ok: false,
31463
31558
  error: Errors.invalidInput("signer", "choose signer or openfortSignerFactory")
@@ -31622,7 +31717,7 @@ async function createProductionAdapters(input) {
31622
31717
  ...input.resetSignerSession === void 0 ? {} : { resetSignerSession: input.resetSignerSession }
31623
31718
  });
31624
31719
  const applicationLayer = Layer.merge(portsLayer, optionalEngineeringTelemetryLayer(bootstrapResult.value.engineeringTelemetry, resolvedInput.value.runtime, hostEngineeringPolicy(input.observability))).pipe(Layer.provideMerge(localDiagnosticsLayer(localDiagnostics, resolvedInput.value.runtime)));
31625
- const context = await Effect.runPromise(Layer.buildWithScope(applicationLayer, scope));
31720
+ const context = await Effect.runPromise(Layer.buildWithScope(withDevTools(applicationLayer, input.devToolsUrl), scope));
31626
31721
  const collected = await Effect.runPromise(collectProductionFlowPorts.pipe(Effect.provide(context)));
31627
31722
  const indexerUrl = input.indexerUrl ?? bootstrapResult.value.indexerUrl;
31628
31723
  const indexerRead = productionIndexerReadPort(indexerUrl === void 0 ? input : {
@@ -31676,7 +31771,6 @@ function makeFinancialOpsMethods(deps) {
31676
31771
  payments: makePaymentsMethods(deps),
31677
31772
  approvals: makeApprovalsMethods(deps),
31678
31773
  activity: makeActivityMethods(deps),
31679
- offramp: makeOfframpMethods(),
31680
31774
  paymentDocuments: makePaymentDocumentsMethods(deps)
31681
31775
  };
31682
31776
  }
@@ -31801,6 +31895,21 @@ function withHostObservationControls(snapshot, input, actorId) {
31801
31895
  });
31802
31896
  }
31803
31897
  //#endregion
31898
+ //#region ../../packages/sdk/src/observability/telemetry/emit-once.ts
31899
+ /**
31900
+ * A product event that could not be built or emitted never reaches the caller
31901
+ * as a failure, and is never lost silently: the drop is logged by event name.
31902
+ */
31903
+ function logDroppedEvent(eventName) {
31904
+ return (effect) => effect.pipe(Effect.catchCause((cause) => {
31905
+ const reason = Cause.squash(cause);
31906
+ return Effect.logWarning("product.telemetry.emit.dropped").pipe(Effect.annotateLogs({
31907
+ product_event: eventName,
31908
+ reason: reason instanceof Error ? reason.message : String(reason)
31909
+ }), Effect.ignoreCause);
31910
+ }));
31911
+ }
31912
+ //#endregion
31804
31913
  //#region ../../packages/sdk/src/platform/client/signer-readiness.ts
31805
31914
  /**
31806
31915
  * Start the signer readiness cycle when the identity becomes claimed (#1667).
@@ -32084,6 +32193,37 @@ function makeClientInternals(input, shared) {
32084
32193
  };
32085
32194
  }
32086
32195
  //#endregion
32196
+ //#region ../../packages/sdk/src/platform/client/scopes.ts
32197
+ const makeClientScopes = (input, runPromise, invocationControls) => {
32198
+ const shared = {
32199
+ convexCall: input.ports.convexCall,
32200
+ runPromise,
32201
+ invocationControls
32202
+ };
32203
+ const verification = {
32204
+ ...input.ports,
32205
+ siteBaseUrl: input.bootstrap.siteBaseUrl,
32206
+ runPromise,
32207
+ invocationControls
32208
+ };
32209
+ return {
32210
+ personal: {
32211
+ banking: makeBankingMethods(shared),
32212
+ verification: makeVerificationMethods(verification)
32213
+ },
32214
+ organization: {
32215
+ banking: (orgId) => makeBankingMethods(shared, {
32216
+ kind: "org",
32217
+ orgId
32218
+ }),
32219
+ verification: (orgId) => makeVerificationMethods(verification, {
32220
+ kind: "organization",
32221
+ orgId
32222
+ })
32223
+ }
32224
+ };
32225
+ };
32226
+ //#endregion
32087
32227
  //#region ../../packages/sdk/src/platform/client/assemble.ts
32088
32228
  function assembleCapxulClient(input) {
32089
32229
  const observation = input;
@@ -32095,7 +32235,6 @@ function assembleCapxulClient(input) {
32095
32235
  };
32096
32236
  const { actor, stopActor } = bootClientActor(input, effectRunner, observation);
32097
32237
  const invocationControls = (controls) => withHostObservationControls(observation.hostObservationSnapshot, controls, actor.authSession()?.authUserId);
32098
- const selectedOrgPort = input.orgPort;
32099
32238
  let kickProvisioning;
32100
32239
  const financialOps = makeFinancialOpsMethods({
32101
32240
  runPromise: effectRunner.runPromise,
@@ -32204,6 +32343,7 @@ function assembleCapxulClient(input) {
32204
32343
  invocationControls
32205
32344
  };
32206
32345
  const accounts = makeAccountsMethods(accountsInput);
32346
+ const scopes = makeClientScopes(input, effectRunner.runPromise, invocationControls);
32207
32347
  const orgMethods = makeOrgMethods({
32208
32348
  actor,
32209
32349
  chainId: input.bootstrap.chainId,
@@ -32211,8 +32351,9 @@ function assembleCapxulClient(input) {
32211
32351
  runPromise: effectRunner.runPromise,
32212
32352
  invocationControls,
32213
32353
  requestKeyScope: `${input.bootstrap.convexUrl}:${String(input.bootstrap.chainId)}`,
32214
- ...selectedOrgPort === void 0 ? {} : { orgPort: selectedOrgPort },
32354
+ ...input.orgPort === void 0 ? {} : { orgPort: input.orgPort },
32215
32355
  convexCall: input.ports.convexCall,
32356
+ ...scopes.organization,
32216
32357
  ...input.signer === void 0 ? {} : { signer: input.signer },
32217
32358
  ...input.organizationSetup === void 0 ? {} : { organizationSetup: input.organizationSetup }
32218
32359
  });
@@ -32224,6 +32365,7 @@ function assembleCapxulClient(input) {
32224
32365
  });
32225
32366
  const identityRuntime = makeIdentityRuntime(actor, input.ports.identity, effectRunner.runPromise);
32226
32367
  const client = {
32368
+ ...scopes.personal,
32227
32369
  checkouts: makeCheckoutMethods({
32228
32370
  convexCall: input.ports.convexCall,
32229
32371
  runPromise: effectRunner.runPromise,
@@ -32994,7 +33136,7 @@ function stdioIdentity(env = process.env, options = {}) {
32994
33136
  }
32995
33137
  //#endregion
32996
33138
  //#region package.json
32997
- var version = "4.20.0-beta.30";
33139
+ var version = "4.20.0-beta.32";
32998
33140
  //#endregion
32999
33141
  //#region src/deps.ts
33000
33142
  const NO_IDENTITY = async () => void 0;
@@ -33436,6 +33578,7 @@ async function createSdkClient(input, createClient = createCapxulClient) {
33436
33578
  authBaseUrl: config.authBaseUrl,
33437
33579
  requirement: signer === void 0 ? "counterfactual" : "deployed",
33438
33580
  runtime: "node",
33581
+ ...config.devToolsUrl === void 0 ? {} : { devToolsUrl: config.devToolsUrl },
33439
33582
  ...identity === void 0 ? {} : { authClient: identity.authClient },
33440
33583
  ...signer === void 0 ? {} : { signer }
33441
33584
  });