@haven_ai/sdk 0.0.0-dev.202609302323.7ff7df0 → 0.0.0-dev.202610010927.3739fd3

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.
@@ -794,6 +794,81 @@ interface HavenAgentSummary extends HavenAgent {
794
794
  * budgets", not a fetch failure).
795
795
  */
796
796
  taskBudgets: HavenTaskBudgetSummary[];
797
+ /**
798
+ * #3506: the sub-budget rows THIS agent must still sign as the DELEGATING
799
+ * agent — the owner issued a sub-budget (a parent-child row for this agent
800
+ * plus a grant to the sub-agent), and each row is `pending` until this
801
+ * agent's delegate key signs it (or `closing` until it signs the close).
802
+ * A derived VIEW, populated from `GET /sub-budgets?status=awaiting_signature`;
803
+ * empty (never throws) against a backend that predates the filter.
804
+ */
805
+ pendingSubBudgetSignatures: HavenPendingSubBudgetSignature[];
806
+ }
807
+ /**
808
+ * #3506: one sub-budget row awaiting THIS agent's signature — what
809
+ * `haven_get_agent` carries per row so the agent can call
810
+ * `haven_sign { sub_budget_id }` then `haven_submit { sub_budget_id, signature }`.
811
+ */
812
+ interface HavenPendingSubBudgetSignature {
813
+ subBudgetId: string;
814
+ /** The parent-child row a grant hangs under; null on the parent-child row itself (they share a tree). */
815
+ parentSubBudgetId: string | null;
816
+ /** `open`: sign the child delegation (row is pending). `close`: sign the revocation (row is closing). */
817
+ purpose: 'open' | 'close';
818
+ /** `parent-child`: this agent's own narrowing of its budget. `grant`: the slice delegated to the sub-agent. */
819
+ what: 'parent-child' | 'grant';
820
+ /** The sub-agent that holds the grant; null on this agent's own parent-child row. */
821
+ subAgentId: string | null;
822
+ tokenAddress: string;
823
+ recipientAddress: string | null;
824
+ periodAmountAtomic: string;
825
+ expiresAt: number;
826
+ isExpired: boolean;
827
+ }
828
+ /** #3506: sub-budget lifecycle status, as the wire names it. */
829
+ type HavenSubBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
830
+ /** #3506: `RawSubBudget`, camelCased — what the SDK sub-budget methods return. */
831
+ interface HavenSubBudget {
832
+ id: string;
833
+ agentId: string;
834
+ parentAgentId: string;
835
+ parentSubBudgetId: string | null;
836
+ chainId: number;
837
+ tokenAddress: string;
838
+ recipientAddress: string | null;
839
+ parentDelegationHash: string;
840
+ delegationHash: string;
841
+ label: string | null;
842
+ periodAmountAtomic: string;
843
+ status: HavenSubBudgetStatus;
844
+ expiresAt: number;
845
+ isExpired: boolean;
846
+ createdAt: string;
847
+ openedAt: string | null;
848
+ closedAt: string | null;
849
+ closeTxHash: string | null;
850
+ }
851
+ /** #3506: `POST /sub-budgets/:id/submit` — opened (from pending) or closed (from closing). */
852
+ interface SubmitSubBudgetResult {
853
+ subBudget: HavenSubBudget;
854
+ status: 'open' | 'closed';
855
+ /** Present only once the close UserOp lands (`status === 'closed'` from `closing`). */
856
+ closeTxHash?: string;
857
+ }
858
+ /** #3506: the sign data a live-child close returns (the revocation UserOp's typed data). */
859
+ interface HavenSubBudgetCloseSignData {
860
+ signature_scheme: 'eip712_userop';
861
+ typed_data: Record<string, unknown>;
862
+ user_op_hash: string;
863
+ }
864
+ /** #3506: `POST /sub-budgets/:id/close`. */
865
+ interface CloseSubBudgetResult {
866
+ subBudget: HavenSubBudget;
867
+ /** `closed` on a trivial close (never signed, or already expired); absent when a close signature is pending. */
868
+ status?: 'closed';
869
+ /** Present only when the close needed a signature (a live child). */
870
+ signData?: HavenSubBudgetCloseSignData;
871
+ nextAction?: string;
797
872
  }
798
873
  /** #3329: task-budget lifecycle status, as the wire names it. */
799
874
  type HavenTaskBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
@@ -2137,7 +2212,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
2137
2212
  * This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
2138
2213
  * it with the package version on every release — never hand-edit it.
2139
2214
  */
2140
- declare const SDK_VERSION = "0.0.0-dev.202609302323.7ff7df0";
2215
+ declare const SDK_VERSION = "0.0.0-dev.202610010927.3739fd3";
2141
2216
  /** The request header every published Haven client sends. */
2142
2217
  declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
2143
2218
  /** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
@@ -3239,4 +3314,4 @@ declare function encodeBase64Json(value: unknown): string;
3239
3314
  */
3240
3315
  declare function decodeBase64Json<T>(value: string, label?: string): T;
3241
3316
 
3242
- export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b, resolveTokenBySymbol as b$, type SweepPreparation as b0, type SweepSubmitResult as b1, type SweepTypedData as b2, TASK_SIGN_CONTEXT_VERSION as b3, TRANSFER_WITH_AUTHORIZATION_TYPES as b4, TYPED_DATA_NOT_ALLOWED as b5, type TaskBudgetCloseExpectation as b6, type TaskChildExpectation as b7, type TaskChildTypedData as b8, type UnsupportedNodeVersionMessageOptions as b9, connectorRerunCommand as bA, connectorSpec as bB, connectorUpgradeCommand as bC, createNextStepBuilder as bD, decodeBase64Json as bE, decodeBase64Utf8 as bF, defaultNextToolFor as bG, deriveDelegateAccountAddress as bH, encodeBase64Json as bI, encodeBase64Utf8 as bJ, encodePaymentProof as bK, hashDelegation as bL, havenClientIdentity as bM, isConnectorChannel as bN, isErc7710Option as bO, isPackedUserOperationTypedData as bP, isSupportedNodeVersion as bQ, isSweepableChain as bR, isTaskChildTypedData as bS, normalizePaymentRequired as bT, packedUserOperationHash as bU, parseNextTool as bV, parsePaymentRequired as bW, parsePaymentRequiredResponse as bX, readClientUpdate as bY, renderNextTool as bZ, resolveConnectorChannel as b_, X402AlreadySettledError as ba, X402Erc7710AlreadySettledError as bb, type X402ExpectedAuth as bc, type X402ExpectedContext as bd, type X402PaymentHeaderContext as be, X402PaymentHeaderValidationError as bf, type X402PaymentOption as bg, type X402RequestSnapshot as bh, type X402SchemeSelection as bi, X402TaskBudgetMismatchError as bj, X402UnexpectedStatusError as bk, X402_LEGACY_PAYMENT_HEADER_NAME as bl, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bm, X402_PAYMENT_HEADER_NAME as bn, X402_PAYMENT_HEADER_NAMES_SENT as bo, X402_PAYMENT_REQUIRED_HEADER_NAME as bp, X402_PAYMENT_RESPONSE_HEADER_NAME as bq, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as br, assertBoundDirectPaymentUserOp as bs, assertOwnTaskBudgetCloseUserOp as bt, assertOwnTaskChild as bu, assertUserOpTypedDataBinding as bv, buildSweepAuthorizationMessage as bw, buildSweepTypedData as bx, buildX402ExpectedMessage as by, compareNodeVersions as bz, type PaymentIntent as c, resolveTokenFromAddress as c0, selectErc7710PaymentOption as c1, selectPaymentOption as c2, selectStandardPaymentOption as c3, selectX402SettlementScheme as c4, signerUpdateFallback as c5, sweepUsdcAddress as c6, sweepUsdcDomain as c7, toStandardPaymentRequirements as c8, unsupportedNodeVersionMessage as c9, validateStandardX402PaymentHeader as ca, verifySettlementChild as cb, x402AssetTransferMethod as cc, x402AuthorizationAmount as cd, x402FacilitatorAddresses as ce, x402V2PaymentEnvelope as cf, type DelegationForHashing as cg, CAVEAT_ENFORCERS as ch, CAVEAT_TYPEHASH as ci, DELEGATION_MANAGER as cj, DELEGATION_TYPEHASH as ck, DIRECT_PAYMENT_CHAIN_IDS as cl, EXECUTE_ABI as cm, HYBRID_DELEGATOR_IMPLEMENTATION as cn, MAX_SETTLEMENT_WINDOW_SECONDS as co, SIMPLE_FACTORY_ADDRESS as cp, type SettlementChildTypedData as cq, assertFundingLegPaysDelegate as cr, assertOwnSettlementChild as cs, chainIdForNetwork as ct, isSettlementChildTypedData as cu, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type PaymentResumeState as u, type X402Receipt as v, type X402Quote as w, type X402Erc7710Settlement as x, type X402McpCallContext as y, type SignData as z };
3317
+ export { AgentPaymentNextAction as $, type AgentPaymentWarning as A, type X402Erc7710Settlement as B, type CloseTaskBudgetResult as C, type X402McpCallContext as D, type SignData as E, type ResumeAuthorizedX402Input as F, type ResumeX402PaymentInput as G, type HavenClientConfig as H, type X402ResumeState as I, type X402McpTransport as J, type X402MerchantCallContext as K, HavenError as L, AGENT_PAYMENT_FAILURE_CODE_VALUES as M, AGENT_PAYMENT_NEXT_ACTION_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, AGENT_PAYMENT_PHASE_VALUES as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AGENT_PAYMENT_RAIL_VALUES as U, type AgentNextStep as V, type AgentPaymentEnumSchema as W, type X402PaymentRequired as X, AgentPaymentFailureCode as Y, AgentPaymentFailureCodeDescriptions as Z, AgentPaymentFailureCodeSchema as _, type HavenClientUpdate as a, type SweepConfirmation as a$, AgentPaymentNextActionDescriptions as a0, AgentPaymentNextActionSchema as a1, AgentPaymentPhase as a2, AgentPaymentPhaseDescriptions as a3, AgentPaymentPhaseSchema as a4, AgentPaymentRail as a5, AgentPaymentRailDescriptions as a6, AgentPaymentRailSchema as a7, type AgentPaymentSummary as a8, AgentPaymentWarningCode as a9, MAX_TASK_BUDGET_TTL_SECONDS as aA, type MachinePaymentRail as aB, MerchantTimeoutError as aC, NEXT_TOOL_SERVER_NAMES as aD, NEXT_TOOL_SERVER_ROLES as aE, type NextStep as aF, type NextStepArguments as aG, type NextStepHandoff as aH, type NextStepInput as aI, type NextStepTarget as aJ, type NextStepTargets as aK, type NextToolServerRole as aL, PACKED_USER_OPERATION_FIELDS as aM, type PaymentFee as aN, type PaymentNextAction as aO, type PaymentPhase as aP, type PaymentStatus as aQ, ROOT_AUTHORITY as aR, SDK_CLIENT_IDENTITY as aS, SDK_VERSION as aT, SIGNER_UPDATE_FALLBACK as aU, SWEEP_BASE_CHAIN_ID as aV, SWEEP_BASE_SEPOLIA_CHAIN_ID as aW, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aX, SWEEP_BASE_USDC_ADDRESS as aY, type SettlementChildExpectation as aZ, SignerRefusalCode as a_, type AgentPurchaseSummary as aa, CONNECTOR_PACKAGE_NAME as ab, type CatalogSubmissionAccepted as ac, DEFAULT_CONFIRMATION_TIMEOUT_MS as ad, DEFAULT_NEXT_TOOL_BY_ACTION as ae, DIRECT_SIGN_CONTEXT_VERSION as af, ENTRY_POINT_V07 as ag, ERC7710_ASSET_TRANSFER_METHOD as ah, HAVEN_CLIENT_HEADER as ai, HAVEN_CONNECTOR_CHANNEL as aj, HAVEN_MINIMUM_NODE_VERSION as ak, HYBRID_DELEGATOR_DOMAIN_NAME as al, HYBRID_DELEGATOR_DOMAIN_VERSION as am, type HavenAgentAllowanceSummary as an, type HavenAgentReadiness as ao, type HavenAllowance as ap, HavenApiError as aq, type HavenCatalogMerchant as ar, type HavenListScope as as, HavenPaymentStateError as at, HavenSigningError as au, HavenTimeoutError as av, HavenTypedDataRefusedError as aw, HavenUnsupportedSignerVersionError as ax, HavenUserOpBindingError as ay, HavenZeroSettlementHashError as az, type PaymentResult as b, readClientUpdate as b$, type SweepEip712Domain as b0, type SweepEntry as b1, type SweepExpectedAuth as b2, type SweepPreparation as b3, type SweepSubmitResult as b4, type SweepTypedData as b5, TASK_SIGN_CONTEXT_VERSION as b6, TRANSFER_WITH_AUTHORIZATION_TYPES as b7, TYPED_DATA_NOT_ALLOWED as b8, type TaskBudgetCloseExpectation as b9, buildSweepTypedData as bA, buildX402ExpectedMessage as bB, compareNodeVersions as bC, connectorRerunCommand as bD, connectorSpec as bE, connectorUpgradeCommand as bF, createNextStepBuilder as bG, decodeBase64Json as bH, decodeBase64Utf8 as bI, defaultNextToolFor as bJ, deriveDelegateAccountAddress as bK, encodeBase64Json as bL, encodeBase64Utf8 as bM, encodePaymentProof as bN, hashDelegation as bO, havenClientIdentity as bP, isConnectorChannel as bQ, isErc7710Option as bR, isPackedUserOperationTypedData as bS, isSupportedNodeVersion as bT, isSweepableChain as bU, isTaskChildTypedData as bV, normalizePaymentRequired as bW, packedUserOperationHash as bX, parseNextTool as bY, parsePaymentRequired as bZ, parsePaymentRequiredResponse as b_, type TaskChildExpectation as ba, type TaskChildTypedData as bb, type UnsupportedNodeVersionMessageOptions as bc, X402AlreadySettledError as bd, X402Erc7710AlreadySettledError as be, type X402ExpectedAuth as bf, type X402ExpectedContext as bg, type X402PaymentHeaderContext as bh, X402PaymentHeaderValidationError as bi, type X402PaymentOption as bj, type X402RequestSnapshot as bk, type X402SchemeSelection as bl, X402TaskBudgetMismatchError as bm, X402UnexpectedStatusError as bn, X402_LEGACY_PAYMENT_HEADER_NAME as bo, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bp, X402_PAYMENT_HEADER_NAME as bq, X402_PAYMENT_HEADER_NAMES_SENT as br, X402_PAYMENT_REQUIRED_HEADER_NAME as bs, X402_PAYMENT_RESPONSE_HEADER_NAME as bt, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bu, assertBoundDirectPaymentUserOp as bv, assertOwnTaskBudgetCloseUserOp as bw, assertOwnTaskChild as bx, assertUserOpTypedDataBinding as by, buildSweepAuthorizationMessage as bz, type PaymentIntent as c, renderNextTool as c0, resolveConnectorChannel as c1, resolveTokenBySymbol as c2, resolveTokenFromAddress as c3, selectErc7710PaymentOption as c4, selectPaymentOption as c5, selectStandardPaymentOption as c6, selectX402SettlementScheme as c7, signerUpdateFallback as c8, sweepUsdcAddress as c9, sweepUsdcDomain as ca, toStandardPaymentRequirements as cb, unsupportedNodeVersionMessage as cc, validateStandardX402PaymentHeader as cd, verifySettlementChild as ce, x402AssetTransferMethod as cf, x402AuthorizationAmount as cg, x402FacilitatorAddresses as ch, x402V2PaymentEnvelope as ci, type DelegationForHashing as cj, CAVEAT_ENFORCERS as ck, CAVEAT_TYPEHASH as cl, DELEGATION_MANAGER as cm, DELEGATION_TYPEHASH as cn, DIRECT_PAYMENT_CHAIN_IDS as co, EXECUTE_ABI as cp, HYBRID_DELEGATOR_IMPLEMENTATION as cq, MAX_SETTLEMENT_WINDOW_SECONDS as cr, SIMPLE_FACTORY_ADDRESS as cs, type SettlementChildTypedData as ct, assertFundingLegPaysDelegate as cu, assertOwnSettlementChild as cv, chainIdForNetwork as cw, isSettlementChildTypedData as cx, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type SubmitSubBudgetResult as u, type HavenPendingSubBudgetSignature as v, type CloseSubBudgetResult as w, type PaymentResumeState as x, type X402Receipt as y, type X402Quote as z };
@@ -794,6 +794,81 @@ interface HavenAgentSummary extends HavenAgent {
794
794
  * budgets", not a fetch failure).
795
795
  */
796
796
  taskBudgets: HavenTaskBudgetSummary[];
797
+ /**
798
+ * #3506: the sub-budget rows THIS agent must still sign as the DELEGATING
799
+ * agent — the owner issued a sub-budget (a parent-child row for this agent
800
+ * plus a grant to the sub-agent), and each row is `pending` until this
801
+ * agent's delegate key signs it (or `closing` until it signs the close).
802
+ * A derived VIEW, populated from `GET /sub-budgets?status=awaiting_signature`;
803
+ * empty (never throws) against a backend that predates the filter.
804
+ */
805
+ pendingSubBudgetSignatures: HavenPendingSubBudgetSignature[];
806
+ }
807
+ /**
808
+ * #3506: one sub-budget row awaiting THIS agent's signature — what
809
+ * `haven_get_agent` carries per row so the agent can call
810
+ * `haven_sign { sub_budget_id }` then `haven_submit { sub_budget_id, signature }`.
811
+ */
812
+ interface HavenPendingSubBudgetSignature {
813
+ subBudgetId: string;
814
+ /** The parent-child row a grant hangs under; null on the parent-child row itself (they share a tree). */
815
+ parentSubBudgetId: string | null;
816
+ /** `open`: sign the child delegation (row is pending). `close`: sign the revocation (row is closing). */
817
+ purpose: 'open' | 'close';
818
+ /** `parent-child`: this agent's own narrowing of its budget. `grant`: the slice delegated to the sub-agent. */
819
+ what: 'parent-child' | 'grant';
820
+ /** The sub-agent that holds the grant; null on this agent's own parent-child row. */
821
+ subAgentId: string | null;
822
+ tokenAddress: string;
823
+ recipientAddress: string | null;
824
+ periodAmountAtomic: string;
825
+ expiresAt: number;
826
+ isExpired: boolean;
827
+ }
828
+ /** #3506: sub-budget lifecycle status, as the wire names it. */
829
+ type HavenSubBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
830
+ /** #3506: `RawSubBudget`, camelCased — what the SDK sub-budget methods return. */
831
+ interface HavenSubBudget {
832
+ id: string;
833
+ agentId: string;
834
+ parentAgentId: string;
835
+ parentSubBudgetId: string | null;
836
+ chainId: number;
837
+ tokenAddress: string;
838
+ recipientAddress: string | null;
839
+ parentDelegationHash: string;
840
+ delegationHash: string;
841
+ label: string | null;
842
+ periodAmountAtomic: string;
843
+ status: HavenSubBudgetStatus;
844
+ expiresAt: number;
845
+ isExpired: boolean;
846
+ createdAt: string;
847
+ openedAt: string | null;
848
+ closedAt: string | null;
849
+ closeTxHash: string | null;
850
+ }
851
+ /** #3506: `POST /sub-budgets/:id/submit` — opened (from pending) or closed (from closing). */
852
+ interface SubmitSubBudgetResult {
853
+ subBudget: HavenSubBudget;
854
+ status: 'open' | 'closed';
855
+ /** Present only once the close UserOp lands (`status === 'closed'` from `closing`). */
856
+ closeTxHash?: string;
857
+ }
858
+ /** #3506: the sign data a live-child close returns (the revocation UserOp's typed data). */
859
+ interface HavenSubBudgetCloseSignData {
860
+ signature_scheme: 'eip712_userop';
861
+ typed_data: Record<string, unknown>;
862
+ user_op_hash: string;
863
+ }
864
+ /** #3506: `POST /sub-budgets/:id/close`. */
865
+ interface CloseSubBudgetResult {
866
+ subBudget: HavenSubBudget;
867
+ /** `closed` on a trivial close (never signed, or already expired); absent when a close signature is pending. */
868
+ status?: 'closed';
869
+ /** Present only when the close needed a signature (a live child). */
870
+ signData?: HavenSubBudgetCloseSignData;
871
+ nextAction?: string;
797
872
  }
798
873
  /** #3329: task-budget lifecycle status, as the wire names it. */
799
874
  type HavenTaskBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
@@ -2137,7 +2212,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
2137
2212
  * This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
2138
2213
  * it with the package version on every release — never hand-edit it.
2139
2214
  */
2140
- declare const SDK_VERSION = "0.0.0-dev.202609302323.7ff7df0";
2215
+ declare const SDK_VERSION = "0.0.0-dev.202610010927.3739fd3";
2141
2216
  /** The request header every published Haven client sends. */
2142
2217
  declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
2143
2218
  /** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
@@ -3239,4 +3314,4 @@ declare function encodeBase64Json(value: unknown): string;
3239
3314
  */
3240
3315
  declare function decodeBase64Json<T>(value: string, label?: string): T;
3241
3316
 
3242
- export { AgentPaymentPhase as $, type AgentPaymentWarning as A, type ResumeAuthorizedX402Input as B, type CloseTaskBudgetResult as C, type ResumeX402PaymentInput as D, type X402ResumeState as E, type X402McpTransport as F, type X402MerchantCallContext as G, type HavenClientConfig as H, HavenError as I, AGENT_PAYMENT_FAILURE_CODE_VALUES as J, AGENT_PAYMENT_NEXT_ACTION_VALUES as K, AGENT_PAYMENT_PHASE_VALUES as L, AGENT_PAYMENT_RAIL_VALUES as M, type AgentNextStep as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentPaymentEnumSchema as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AgentPaymentFailureCode as U, AgentPaymentFailureCodeDescriptions as V, AgentPaymentFailureCodeSchema as W, type X402PaymentRequired as X, AgentPaymentNextAction as Y, AgentPaymentNextActionDescriptions as Z, AgentPaymentNextActionSchema as _, type HavenClientUpdate as a, type SweepExpectedAuth as a$, AgentPaymentPhaseDescriptions as a0, AgentPaymentPhaseSchema as a1, AgentPaymentRail as a2, AgentPaymentRailDescriptions as a3, AgentPaymentRailSchema as a4, type AgentPaymentSummary as a5, AgentPaymentWarningCode as a6, type AgentPurchaseSummary as a7, CONNECTOR_PACKAGE_NAME as a8, type CatalogSubmissionAccepted as a9, NEXT_TOOL_SERVER_NAMES as aA, NEXT_TOOL_SERVER_ROLES as aB, type NextStep as aC, type NextStepArguments as aD, type NextStepHandoff as aE, type NextStepInput as aF, type NextStepTarget as aG, type NextStepTargets as aH, type NextToolServerRole as aI, PACKED_USER_OPERATION_FIELDS as aJ, type PaymentFee as aK, type PaymentNextAction as aL, type PaymentPhase as aM, type PaymentStatus as aN, ROOT_AUTHORITY as aO, SDK_CLIENT_IDENTITY as aP, SDK_VERSION as aQ, SIGNER_UPDATE_FALLBACK as aR, SWEEP_BASE_CHAIN_ID as aS, SWEEP_BASE_SEPOLIA_CHAIN_ID as aT, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aU, SWEEP_BASE_USDC_ADDRESS as aV, type SettlementChildExpectation as aW, SignerRefusalCode as aX, type SweepConfirmation as aY, type SweepEip712Domain as aZ, type SweepEntry as a_, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, DEFAULT_NEXT_TOOL_BY_ACTION as ab, DIRECT_SIGN_CONTEXT_VERSION as ac, ENTRY_POINT_V07 as ad, ERC7710_ASSET_TRANSFER_METHOD as ae, HAVEN_CLIENT_HEADER as af, HAVEN_CONNECTOR_CHANNEL as ag, HAVEN_MINIMUM_NODE_VERSION as ah, HYBRID_DELEGATOR_DOMAIN_NAME as ai, HYBRID_DELEGATOR_DOMAIN_VERSION as aj, type HavenAgentAllowanceSummary as ak, type HavenAgentReadiness as al, type HavenAllowance as am, HavenApiError as an, type HavenCatalogMerchant as ao, type HavenListScope as ap, HavenPaymentStateError as aq, HavenSigningError as ar, HavenTimeoutError as as, HavenTypedDataRefusedError as at, HavenUnsupportedSignerVersionError as au, HavenUserOpBindingError as av, HavenZeroSettlementHashError as aw, MAX_TASK_BUDGET_TTL_SECONDS as ax, type MachinePaymentRail as ay, MerchantTimeoutError as az, type PaymentResult as b, resolveTokenBySymbol as b$, type SweepPreparation as b0, type SweepSubmitResult as b1, type SweepTypedData as b2, TASK_SIGN_CONTEXT_VERSION as b3, TRANSFER_WITH_AUTHORIZATION_TYPES as b4, TYPED_DATA_NOT_ALLOWED as b5, type TaskBudgetCloseExpectation as b6, type TaskChildExpectation as b7, type TaskChildTypedData as b8, type UnsupportedNodeVersionMessageOptions as b9, connectorRerunCommand as bA, connectorSpec as bB, connectorUpgradeCommand as bC, createNextStepBuilder as bD, decodeBase64Json as bE, decodeBase64Utf8 as bF, defaultNextToolFor as bG, deriveDelegateAccountAddress as bH, encodeBase64Json as bI, encodeBase64Utf8 as bJ, encodePaymentProof as bK, hashDelegation as bL, havenClientIdentity as bM, isConnectorChannel as bN, isErc7710Option as bO, isPackedUserOperationTypedData as bP, isSupportedNodeVersion as bQ, isSweepableChain as bR, isTaskChildTypedData as bS, normalizePaymentRequired as bT, packedUserOperationHash as bU, parseNextTool as bV, parsePaymentRequired as bW, parsePaymentRequiredResponse as bX, readClientUpdate as bY, renderNextTool as bZ, resolveConnectorChannel as b_, X402AlreadySettledError as ba, X402Erc7710AlreadySettledError as bb, type X402ExpectedAuth as bc, type X402ExpectedContext as bd, type X402PaymentHeaderContext as be, X402PaymentHeaderValidationError as bf, type X402PaymentOption as bg, type X402RequestSnapshot as bh, type X402SchemeSelection as bi, X402TaskBudgetMismatchError as bj, X402UnexpectedStatusError as bk, X402_LEGACY_PAYMENT_HEADER_NAME as bl, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bm, X402_PAYMENT_HEADER_NAME as bn, X402_PAYMENT_HEADER_NAMES_SENT as bo, X402_PAYMENT_REQUIRED_HEADER_NAME as bp, X402_PAYMENT_RESPONSE_HEADER_NAME as bq, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as br, assertBoundDirectPaymentUserOp as bs, assertOwnTaskBudgetCloseUserOp as bt, assertOwnTaskChild as bu, assertUserOpTypedDataBinding as bv, buildSweepAuthorizationMessage as bw, buildSweepTypedData as bx, buildX402ExpectedMessage as by, compareNodeVersions as bz, type PaymentIntent as c, resolveTokenFromAddress as c0, selectErc7710PaymentOption as c1, selectPaymentOption as c2, selectStandardPaymentOption as c3, selectX402SettlementScheme as c4, signerUpdateFallback as c5, sweepUsdcAddress as c6, sweepUsdcDomain as c7, toStandardPaymentRequirements as c8, unsupportedNodeVersionMessage as c9, validateStandardX402PaymentHeader as ca, verifySettlementChild as cb, x402AssetTransferMethod as cc, x402AuthorizationAmount as cd, x402FacilitatorAddresses as ce, x402V2PaymentEnvelope as cf, type DelegationForHashing as cg, CAVEAT_ENFORCERS as ch, CAVEAT_TYPEHASH as ci, DELEGATION_MANAGER as cj, DELEGATION_TYPEHASH as ck, DIRECT_PAYMENT_CHAIN_IDS as cl, EXECUTE_ABI as cm, HYBRID_DELEGATOR_IMPLEMENTATION as cn, MAX_SETTLEMENT_WINDOW_SECONDS as co, SIMPLE_FACTORY_ADDRESS as cp, type SettlementChildTypedData as cq, assertFundingLegPaysDelegate as cr, assertOwnSettlementChild as cs, chainIdForNetwork as ct, isSettlementChildTypedData as cu, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type PaymentResumeState as u, type X402Receipt as v, type X402Quote as w, type X402Erc7710Settlement as x, type X402McpCallContext as y, type SignData as z };
3317
+ export { AgentPaymentNextAction as $, type AgentPaymentWarning as A, type X402Erc7710Settlement as B, type CloseTaskBudgetResult as C, type X402McpCallContext as D, type SignData as E, type ResumeAuthorizedX402Input as F, type ResumeX402PaymentInput as G, type HavenClientConfig as H, type X402ResumeState as I, type X402McpTransport as J, type X402MerchantCallContext as K, HavenError as L, AGENT_PAYMENT_FAILURE_CODE_VALUES as M, AGENT_PAYMENT_NEXT_ACTION_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, AGENT_PAYMENT_PHASE_VALUES as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AGENT_PAYMENT_RAIL_VALUES as U, type AgentNextStep as V, type AgentPaymentEnumSchema as W, type X402PaymentRequired as X, AgentPaymentFailureCode as Y, AgentPaymentFailureCodeDescriptions as Z, AgentPaymentFailureCodeSchema as _, type HavenClientUpdate as a, type SweepConfirmation as a$, AgentPaymentNextActionDescriptions as a0, AgentPaymentNextActionSchema as a1, AgentPaymentPhase as a2, AgentPaymentPhaseDescriptions as a3, AgentPaymentPhaseSchema as a4, AgentPaymentRail as a5, AgentPaymentRailDescriptions as a6, AgentPaymentRailSchema as a7, type AgentPaymentSummary as a8, AgentPaymentWarningCode as a9, MAX_TASK_BUDGET_TTL_SECONDS as aA, type MachinePaymentRail as aB, MerchantTimeoutError as aC, NEXT_TOOL_SERVER_NAMES as aD, NEXT_TOOL_SERVER_ROLES as aE, type NextStep as aF, type NextStepArguments as aG, type NextStepHandoff as aH, type NextStepInput as aI, type NextStepTarget as aJ, type NextStepTargets as aK, type NextToolServerRole as aL, PACKED_USER_OPERATION_FIELDS as aM, type PaymentFee as aN, type PaymentNextAction as aO, type PaymentPhase as aP, type PaymentStatus as aQ, ROOT_AUTHORITY as aR, SDK_CLIENT_IDENTITY as aS, SDK_VERSION as aT, SIGNER_UPDATE_FALLBACK as aU, SWEEP_BASE_CHAIN_ID as aV, SWEEP_BASE_SEPOLIA_CHAIN_ID as aW, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aX, SWEEP_BASE_USDC_ADDRESS as aY, type SettlementChildExpectation as aZ, SignerRefusalCode as a_, type AgentPurchaseSummary as aa, CONNECTOR_PACKAGE_NAME as ab, type CatalogSubmissionAccepted as ac, DEFAULT_CONFIRMATION_TIMEOUT_MS as ad, DEFAULT_NEXT_TOOL_BY_ACTION as ae, DIRECT_SIGN_CONTEXT_VERSION as af, ENTRY_POINT_V07 as ag, ERC7710_ASSET_TRANSFER_METHOD as ah, HAVEN_CLIENT_HEADER as ai, HAVEN_CONNECTOR_CHANNEL as aj, HAVEN_MINIMUM_NODE_VERSION as ak, HYBRID_DELEGATOR_DOMAIN_NAME as al, HYBRID_DELEGATOR_DOMAIN_VERSION as am, type HavenAgentAllowanceSummary as an, type HavenAgentReadiness as ao, type HavenAllowance as ap, HavenApiError as aq, type HavenCatalogMerchant as ar, type HavenListScope as as, HavenPaymentStateError as at, HavenSigningError as au, HavenTimeoutError as av, HavenTypedDataRefusedError as aw, HavenUnsupportedSignerVersionError as ax, HavenUserOpBindingError as ay, HavenZeroSettlementHashError as az, type PaymentResult as b, readClientUpdate as b$, type SweepEip712Domain as b0, type SweepEntry as b1, type SweepExpectedAuth as b2, type SweepPreparation as b3, type SweepSubmitResult as b4, type SweepTypedData as b5, TASK_SIGN_CONTEXT_VERSION as b6, TRANSFER_WITH_AUTHORIZATION_TYPES as b7, TYPED_DATA_NOT_ALLOWED as b8, type TaskBudgetCloseExpectation as b9, buildSweepTypedData as bA, buildX402ExpectedMessage as bB, compareNodeVersions as bC, connectorRerunCommand as bD, connectorSpec as bE, connectorUpgradeCommand as bF, createNextStepBuilder as bG, decodeBase64Json as bH, decodeBase64Utf8 as bI, defaultNextToolFor as bJ, deriveDelegateAccountAddress as bK, encodeBase64Json as bL, encodeBase64Utf8 as bM, encodePaymentProof as bN, hashDelegation as bO, havenClientIdentity as bP, isConnectorChannel as bQ, isErc7710Option as bR, isPackedUserOperationTypedData as bS, isSupportedNodeVersion as bT, isSweepableChain as bU, isTaskChildTypedData as bV, normalizePaymentRequired as bW, packedUserOperationHash as bX, parseNextTool as bY, parsePaymentRequired as bZ, parsePaymentRequiredResponse as b_, type TaskChildExpectation as ba, type TaskChildTypedData as bb, type UnsupportedNodeVersionMessageOptions as bc, X402AlreadySettledError as bd, X402Erc7710AlreadySettledError as be, type X402ExpectedAuth as bf, type X402ExpectedContext as bg, type X402PaymentHeaderContext as bh, X402PaymentHeaderValidationError as bi, type X402PaymentOption as bj, type X402RequestSnapshot as bk, type X402SchemeSelection as bl, X402TaskBudgetMismatchError as bm, X402UnexpectedStatusError as bn, X402_LEGACY_PAYMENT_HEADER_NAME as bo, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bp, X402_PAYMENT_HEADER_NAME as bq, X402_PAYMENT_HEADER_NAMES_SENT as br, X402_PAYMENT_REQUIRED_HEADER_NAME as bs, X402_PAYMENT_RESPONSE_HEADER_NAME as bt, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bu, assertBoundDirectPaymentUserOp as bv, assertOwnTaskBudgetCloseUserOp as bw, assertOwnTaskChild as bx, assertUserOpTypedDataBinding as by, buildSweepAuthorizationMessage as bz, type PaymentIntent as c, renderNextTool as c0, resolveConnectorChannel as c1, resolveTokenBySymbol as c2, resolveTokenFromAddress as c3, selectErc7710PaymentOption as c4, selectPaymentOption as c5, selectStandardPaymentOption as c6, selectX402SettlementScheme as c7, signerUpdateFallback as c8, sweepUsdcAddress as c9, sweepUsdcDomain as ca, toStandardPaymentRequirements as cb, unsupportedNodeVersionMessage as cc, validateStandardX402PaymentHeader as cd, verifySettlementChild as ce, x402AssetTransferMethod as cf, x402AuthorizationAmount as cg, x402FacilitatorAddresses as ch, x402V2PaymentEnvelope as ci, type DelegationForHashing as cj, CAVEAT_ENFORCERS as ck, CAVEAT_TYPEHASH as cl, DELEGATION_MANAGER as cm, DELEGATION_TYPEHASH as cn, DIRECT_PAYMENT_CHAIN_IDS as co, EXECUTE_ABI as cp, HYBRID_DELEGATOR_IMPLEMENTATION as cq, MAX_SETTLEMENT_WINDOW_SECONDS as cr, SIMPLE_FACTORY_ADDRESS as cs, type SettlementChildTypedData as ct, assertFundingLegPaysDelegate as cu, assertOwnSettlementChild as cv, chainIdForNetwork as cw, isSettlementChildTypedData as cx, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type SubmitSubBudgetResult as u, type HavenPendingSubBudgetSignature as v, type CloseSubBudgetResult as w, type PaymentResumeState as x, type X402Receipt as y, type X402Quote as z };
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkOSGNL57N_cjs = require('./chunk-OSGNL57N.cjs');
3
+ var chunkOYVHR3IT_cjs = require('./chunk-OYVHR3IT.cjs');
4
4
  var viem = require('viem');
5
5
  var crypto = require('crypto');
6
6
  var secp256k1 = require('@noble/curves/secp256k1');
7
7
  var accounts = require('viem/accounts');
8
8
 
9
9
  var TYPED_DATA_NOT_ALLOWED = "TYPED_DATA_NOT_ALLOWED";
10
- var HavenTypedDataRefusedError = class extends chunkOSGNL57N_cjs.HavenSigningError {
10
+ var HavenTypedDataRefusedError = class extends chunkOYVHR3IT_cjs.HavenSigningError {
11
11
  constructor(message) {
12
12
  super(message);
13
13
  this.code = TYPED_DATA_NOT_ALLOWED;
@@ -48,7 +48,7 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
48
48
  `This signer only signs direct payments on chains the delegation rail has pinned contracts for (${[...DIRECT_PAYMENT_CHAIN_IDS].join(", ")}); this typed data names chain ${String(domain.chainId)}. Refusing.`
49
49
  );
50
50
  }
51
- const ownAccount = chunkOSGNL57N_cjs.deriveDelegateAccountAddress(delegateAddress);
51
+ const ownAccount = chunkOYVHR3IT_cjs.deriveDelegateAccountAddress(delegateAddress);
52
52
  const sender = typeof message.sender === "string" ? message.sender : "";
53
53
  if (sender.toLowerCase() !== ownAccount.toLowerCase()) {
54
54
  throw new HavenTypedDataRefusedError(
@@ -78,9 +78,9 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
78
78
  "This UserOperation's execute() call does not re-encode to the exact callData bytes (trailing or non-canonical bytes). Refusing."
79
79
  );
80
80
  }
81
- if (decoded.target.toLowerCase() !== chunkOSGNL57N_cjs.DELEGATION_MANAGER.toLowerCase()) {
81
+ if (decoded.target.toLowerCase() !== chunkOYVHR3IT_cjs.DELEGATION_MANAGER.toLowerCase()) {
82
82
  throw new HavenTypedDataRefusedError(
83
- `This UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkOSGNL57N_cjs.DELEGATION_MANAGER}). A direct payment only ever redeems the agent's own budget delegation \u2014 refusing what looks like a self-call (e.g. transferOwnership, updateSigners, upgradeToAndCall) or a call to an unrelated contract.`
83
+ `This UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkOYVHR3IT_cjs.DELEGATION_MANAGER}). A direct payment only ever redeems the agent's own budget delegation \u2014 refusing what looks like a self-call (e.g. transferOwnership, updateSigners, upgradeToAndCall) or a call to an unrelated contract.`
84
84
  );
85
85
  }
86
86
  if (decoded.value !== 0n) {
@@ -89,20 +89,20 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
89
89
  );
90
90
  }
91
91
  try {
92
- chunkOSGNL57N_cjs.assertRedeemsOwnBudgetDelegation(decoded.callData, ownAccount);
92
+ chunkOYVHR3IT_cjs.assertRedeemsOwnBudgetDelegation(decoded.callData, ownAccount);
93
93
  } catch (err) {
94
94
  throw new HavenTypedDataRefusedError(err instanceof Error ? err.message : String(err));
95
95
  }
96
96
  }
97
97
  function assertOwnSettlementChild(typedData, expectation, delegateAddress) {
98
98
  try {
99
- chunkOSGNL57N_cjs.verifySettlementChild(typedData, {
99
+ chunkOYVHR3IT_cjs.verifySettlementChild(typedData, {
100
100
  ...expectation,
101
- delegatorAccount: chunkOSGNL57N_cjs.deriveDelegateAccountAddress(delegateAddress)
101
+ delegatorAccount: chunkOYVHR3IT_cjs.deriveDelegateAccountAddress(delegateAddress)
102
102
  });
103
103
  } catch (err) {
104
104
  if (err instanceof HavenTypedDataRefusedError) throw err;
105
- if (err instanceof chunkOSGNL57N_cjs.HavenSigningError) throw new HavenTypedDataRefusedError(err.message);
105
+ if (err instanceof chunkOYVHR3IT_cjs.HavenSigningError) throw new HavenTypedDataRefusedError(err.message);
106
106
  throw new HavenTypedDataRefusedError(
107
107
  `Refusing to sign the x402 settlement child: it is malformed (${err instanceof Error ? err.message : String(err)}).`
108
108
  );
@@ -131,7 +131,7 @@ function assertFundingLegPaysDelegate(typedData, expected) {
131
131
  try {
132
132
  const { args: executeArgs } = viem.decodeFunctionData({ abi: EXECUTE_ABI, data: message.callData });
133
133
  const inner = executeArgs[0].callData;
134
- const { args } = viem.decodeFunctionData({ abi: chunkOSGNL57N_cjs.REDEEM_DELEGATIONS_ABI, data: inner });
134
+ const { args } = viem.decodeFunctionData({ abi: chunkOYVHR3IT_cjs.REDEEM_DELEGATIONS_ABI, data: inner });
135
135
  const executions = args[2];
136
136
  executionCallData = executions[0];
137
137
  } catch {
@@ -250,7 +250,7 @@ var TRANSFER_WITH_AUTHORIZATION_TYPES = {
250
250
  function sweepUsdcAddress(chainId) {
251
251
  const address = USDC_ADDRESS_BY_CHAIN[chainId];
252
252
  if (!address) {
253
- throw new chunkOSGNL57N_cjs.HavenSigningError(
253
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
254
254
  `Sweep is not supported on chain ${chainId}. Supported: ${SWEEPABLE_CHAIN_IDS.join(", ")}.`
255
255
  );
256
256
  }
@@ -259,7 +259,7 @@ function sweepUsdcAddress(chainId) {
259
259
  function sweepUsdcDomain(chainId) {
260
260
  const domain = USDC_EIP712_DOMAIN_BY_CHAIN[chainId];
261
261
  if (!domain) {
262
- throw new chunkOSGNL57N_cjs.HavenSigningError(
262
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
263
263
  `Sweep is not supported on chain ${chainId}. Supported: ${SWEEPABLE_CHAIN_IDS.join(", ")}.`
264
264
  );
265
265
  }
@@ -272,12 +272,12 @@ function buildSweepTypedData(auth) {
272
272
  const domain = sweepUsdcDomain(auth.chainId);
273
273
  const expectedToken = sweepUsdcAddress(auth.chainId);
274
274
  if (!sameAddress(auth.token, expectedToken)) {
275
- throw new chunkOSGNL57N_cjs.HavenSigningError(
275
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
276
276
  `Sweep token ${auth.token} is not the canonical USDC contract for chain ${auth.chainId}.`
277
277
  );
278
278
  }
279
279
  if (!/^0x[0-9a-fA-F]{64}$/.test(auth.nonce)) {
280
- throw new chunkOSGNL57N_cjs.HavenSigningError("Sweep nonce must be a 0x-prefixed 32-byte hex string.");
280
+ throw new chunkOYVHR3IT_cjs.HavenSigningError("Sweep nonce must be a 0x-prefixed 32-byte hex string.");
281
281
  }
282
282
  return {
283
283
  domain,
@@ -787,7 +787,7 @@ function stableStringify2(value) {
787
787
  }
788
788
 
789
789
  // src/client-identity.ts
790
- var SDK_VERSION = "0.0.0-dev.202609302323.7ff7df0";
790
+ var SDK_VERSION = "0.0.0-dev.202610010927.3739fd3";
791
791
  var HAVEN_CLIENT_HEADER = "X-Haven-Client";
792
792
  function havenClientIdentity(pkg, version) {
793
793
  return `${pkg}/${version}`;
@@ -820,7 +820,7 @@ function addressFromKey(privateKey) {
820
820
  try {
821
821
  return accounts.privateKeyToAddress(`0x${hexBytes(privateKey, 32, "private key")}`);
822
822
  } catch (err) {
823
- throw new chunkOSGNL57N_cjs.HavenSigningError(
823
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
824
824
  `Invalid private key: ${err instanceof Error ? err.message : String(err)}`
825
825
  );
826
826
  }
@@ -834,7 +834,7 @@ function signHash(privateKey, hash) {
834
834
  yParity: recovery
835
835
  });
836
836
  } catch (err) {
837
- throw new chunkOSGNL57N_cjs.HavenSigningError(
837
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
838
838
  `Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
839
839
  );
840
840
  }
@@ -870,7 +870,7 @@ var TAX_DECLARATION_TYPES = {
870
870
  var X_TAX_DECLARATION_HEADER = "X-Tax-Declaration";
871
871
  function validateContent(content) {
872
872
  if (typeof content !== "object" || content === null || Array.isArray(content)) {
873
- throw new chunkOSGNL57N_cjs.HavenSigningError("Tax declaration content must be an object.");
873
+ throw new chunkOYVHR3IT_cjs.HavenSigningError("Tax declaration content must be an object.");
874
874
  }
875
875
  const record = content;
876
876
  for (const field of ["principalId", "principalAttributionHash"]) {
@@ -923,7 +923,7 @@ function taxPrincipalId(network, delegateAddress) {
923
923
  if (network.startsWith("eip155:")) {
924
924
  return `did:pkh:${network}:${delegateAddress}`;
925
925
  }
926
- const chainId = chunkOSGNL57N_cjs.chainIdForNetwork(network);
926
+ const chainId = chunkOYVHR3IT_cjs.chainIdForNetwork(network);
927
927
  if (chainId === void 0) {
928
928
  throw new TaxDeclarationRefusedError(
929
929
  `The accepted payment option's network '${network}' is not a CAIP-2 eip155 chain this SDK can name; refusing to build a tax principal without the settlement network.`
@@ -968,12 +968,12 @@ function addressFromKeyForTax(delegateKey) {
968
968
  try {
969
969
  return addressFromKey(delegateKey);
970
970
  } catch (err) {
971
- throw new chunkOSGNL57N_cjs.HavenSigningError(
971
+ throw new chunkOYVHR3IT_cjs.HavenSigningError(
972
972
  `Invalid delegate key for tax declaration signing: ${err instanceof Error ? err.message : String(err)}`
973
973
  );
974
974
  }
975
975
  }
976
- var TaxDeclarationRefusedError = class extends chunkOSGNL57N_cjs.HavenSigningError {
976
+ var TaxDeclarationRefusedError = class extends chunkOYVHR3IT_cjs.HavenSigningError {
977
977
  code = "TAX_DECLARATION_REFUSED";
978
978
  constructor(message) {
979
979
  super(message);
@@ -1125,10 +1125,10 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1125
1125
  if (td?.primaryType !== "Delegation") {
1126
1126
  refuseTaskChild("it is not a Delegation payload", `primaryType was '${String(td?.primaryType)}'.`);
1127
1127
  }
1128
- if (!same(td.domain?.verifyingContract, chunkOSGNL57N_cjs.DELEGATION_MANAGER)) {
1128
+ if (!same(td.domain?.verifyingContract, chunkOYVHR3IT_cjs.DELEGATION_MANAGER)) {
1129
1129
  refuseTaskChild(
1130
1130
  "the EIP-712 domain names an unknown DelegationManager",
1131
- `Expected ${chunkOSGNL57N_cjs.DELEGATION_MANAGER}, got ${td.domain?.verifyingContract}.`
1131
+ `Expected ${chunkOYVHR3IT_cjs.DELEGATION_MANAGER}, got ${td.domain?.verifyingContract}.`
1132
1132
  );
1133
1133
  }
1134
1134
  if (td.domain?.name !== DELEGATION_DOMAIN_NAME || td.domain?.version !== DELEGATION_DOMAIN_VERSION) {
@@ -1156,7 +1156,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1156
1156
  `Expected chain ${expected.chainId}; the child says ${td.domain?.chainId}.`
1157
1157
  );
1158
1158
  }
1159
- const ownAccount = chunkOSGNL57N_cjs.deriveDelegateAccountAddress(delegateAddress);
1159
+ const ownAccount = chunkOYVHR3IT_cjs.deriveDelegateAccountAddress(delegateAddress);
1160
1160
  const delegator = td.message?.delegator;
1161
1161
  if (typeof delegator !== "string" || !same(delegator, ownAccount)) {
1162
1162
  refuseTaskChild(
@@ -1175,7 +1175,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1175
1175
  if (typeof authority !== "string" || !/^0x[0-9a-fA-F]{64}$/.test(authority)) {
1176
1176
  refuseTaskChild("its authority is not a 32-byte delegation hash", `Got ${String(authority)}.`);
1177
1177
  }
1178
- if (authority.toLowerCase() === chunkOSGNL57N_cjs.ROOT_AUTHORITY) {
1178
+ if (authority.toLowerCase() === chunkOYVHR3IT_cjs.ROOT_AUTHORITY) {
1179
1179
  refuseTaskChild(
1180
1180
  "it is a ROOT delegation, not a re-delegation of the agent budget",
1181
1181
  "A task budget always chains under the agent budget delegation."
@@ -1188,7 +1188,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1188
1188
  );
1189
1189
  }
1190
1190
  const caveats = td.message?.caveats ?? [];
1191
- const transfer = findCaveat(caveats, chunkOSGNL57N_cjs.CAVEAT_ENFORCERS.erc20TransferAmount);
1191
+ const transfer = findCaveat(caveats, chunkOYVHR3IT_cjs.CAVEAT_ENFORCERS.erc20TransferAmount);
1192
1192
  if (!transfer) {
1193
1193
  refuseTaskChild(
1194
1194
  "it has no ERC-20 transfer-amount caveat",
@@ -1206,7 +1206,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1206
1206
  `Expected ${expected.maxAmountAtomic}; the child allows ${amount.toString()}.`
1207
1207
  );
1208
1208
  }
1209
- const timestamp = findCaveat(caveats, chunkOSGNL57N_cjs.CAVEAT_ENFORCERS.timestamp);
1209
+ const timestamp = findCaveat(caveats, chunkOYVHR3IT_cjs.CAVEAT_ENFORCERS.timestamp);
1210
1210
  if (!timestamp) {
1211
1211
  refuseTaskChild("it never expires", "A task-budget child without a timestamp caveat is open-ended.");
1212
1212
  }
@@ -1227,7 +1227,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
1227
1227
  `Expected ${expected.expiresAt}; the child says ${beforeThreshold}.`
1228
1228
  );
1229
1229
  }
1230
- const calldata = findCaveat(caveats, chunkOSGNL57N_cjs.CAVEAT_ENFORCERS.allowedCalldata);
1230
+ const calldata = findCaveat(caveats, chunkOYVHR3IT_cjs.CAVEAT_ENFORCERS.allowedCalldata);
1231
1231
  if (expected.recipientAddress) {
1232
1232
  if (!calldata) {
1233
1233
  refuseTaskChild(
@@ -1264,7 +1264,7 @@ var DISABLE_DELEGATION_ABI = [
1264
1264
  {
1265
1265
  type: "function",
1266
1266
  name: "disableDelegation",
1267
- inputs: [{ name: "delegation", type: "tuple", components: chunkOSGNL57N_cjs.DELEGATION_TUPLE_COMPONENTS }],
1267
+ inputs: [{ name: "delegation", type: "tuple", components: chunkOYVHR3IT_cjs.DELEGATION_TUPLE_COMPONENTS }],
1268
1268
  outputs: [],
1269
1269
  stateMutability: "nonpayable"
1270
1270
  }
@@ -1283,7 +1283,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
1283
1283
  `This signer only signs a task-budget close on chains the delegation rail has pinned contracts for (${[...DIRECT_PAYMENT_CHAIN_IDS].join(", ")}); this typed data names chain ${String(domain.chainId)}. Refusing.`
1284
1284
  );
1285
1285
  }
1286
- const ownAccount = chunkOSGNL57N_cjs.deriveDelegateAccountAddress(delegateAddress);
1286
+ const ownAccount = chunkOYVHR3IT_cjs.deriveDelegateAccountAddress(delegateAddress);
1287
1287
  const sender = typeof message.sender === "string" ? message.sender : "";
1288
1288
  if (sender.toLowerCase() !== ownAccount.toLowerCase()) {
1289
1289
  throw new HavenTypedDataRefusedError(
@@ -1306,9 +1306,9 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
1306
1306
  "This close UserOperation's execute() call does not re-encode to the exact callData bytes (trailing or non-canonical bytes). Refusing."
1307
1307
  );
1308
1308
  }
1309
- if (decoded.target.toLowerCase() !== chunkOSGNL57N_cjs.DELEGATION_MANAGER.toLowerCase()) {
1309
+ if (decoded.target.toLowerCase() !== chunkOYVHR3IT_cjs.DELEGATION_MANAGER.toLowerCase()) {
1310
1310
  throw new HavenTypedDataRefusedError(
1311
- `This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkOSGNL57N_cjs.DELEGATION_MANAGER}). Refusing what looks like a self-call or a call to an unrelated contract.`
1311
+ `This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkOYVHR3IT_cjs.DELEGATION_MANAGER}). Refusing what looks like a self-call or a call to an unrelated contract.`
1312
1312
  );
1313
1313
  }
1314
1314
  if (decoded.value !== 0n) {
@@ -1345,7 +1345,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
1345
1345
  `This close UserOperation disables a delegation granted to ${delegation.delegate}, not this signer's own account (${ownAccount}) \u2014 a task-budget child is always self-delegated. Refusing.`
1346
1346
  );
1347
1347
  }
1348
- if (delegation.authority.toLowerCase() === chunkOSGNL57N_cjs.ROOT_AUTHORITY) {
1348
+ if (delegation.authority.toLowerCase() === chunkOYVHR3IT_cjs.ROOT_AUTHORITY) {
1349
1349
  throw new HavenTypedDataRefusedError(
1350
1350
  "This close UserOperation disables a ROOT delegation, not a re-delegation of the agent budget. A task-budget child always chains under the agent budget delegation. Refusing."
1351
1351
  );
@@ -1475,5 +1475,5 @@ exports.x402FacilitatorAddresses = x402FacilitatorAddresses;
1475
1475
  exports.x402PaymentHeaderNamesFor = x402PaymentHeaderNamesFor;
1476
1476
  exports.x402PaymentHeaderNamesSent = x402PaymentHeaderNamesSent;
1477
1477
  exports.x402V2PaymentEnvelope = x402V2PaymentEnvelope;
1478
- //# sourceMappingURL=chunk-PTIGFW65.cjs.map
1479
- //# sourceMappingURL=chunk-PTIGFW65.cjs.map
1478
+ //# sourceMappingURL=chunk-E5PDCCOQ.cjs.map
1479
+ //# sourceMappingURL=chunk-E5PDCCOQ.cjs.map