@haven_ai/sdk 0.0.0-dev.202610011057.1c1da3f → 0.0.0-dev.202610011720.e9283da

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.
@@ -133,6 +133,12 @@ interface PaymentIntent {
133
133
  expiresAt: string;
134
134
  /** Data needed to sign the payment */
135
135
  signData: SignData;
136
+ /**
137
+ * #3528: the additive, WARNING-GRADE prepare hints. Present only when the
138
+ * recipient is one of the owner's own Haven accounts (`SELF_TRANSFER`);
139
+ * advisory — never blocks, never replaces a refusal.
140
+ */
141
+ warnings?: AgentPaymentWarning[];
136
142
  }
137
143
  type PaymentStatus = 'pending_signature' | 'submitted' | 'confirmed' | 'pending_approval' | 'approved' | 'proposed' | 'executed' | 'rejected' | 'expired' | 'failed';
138
144
  interface PaymentResult {
@@ -351,6 +357,12 @@ interface X402Intent {
351
357
  expectedTypedDataHash?: string;
352
358
  /** Delegate EOA the funding transfer tops up (the x402 payer). */
353
359
  fundingTo: string;
360
+ /**
361
+ * #3528: the additive, WARNING-GRADE prepare hints. Present only when the
362
+ * recipient (the merchant on erc7710, the delegate EOA on a 3009 funding
363
+ * leg) is one of the owner's own Haven accounts; advisory — never blocks.
364
+ */
365
+ warnings?: AgentPaymentWarning[];
354
366
  }
355
367
  interface X402ExpectedContext {
356
368
  paymentId: string;
@@ -1523,6 +1535,15 @@ declare const AgentPaymentWarningCode: {
1523
1535
  * settlement can no longer land at all.
1524
1536
  */
1525
1537
  readonly SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED";
1538
+ /**
1539
+ * #3528: the recipient of the just-prepared payment is one of the owner's
1540
+ * own Haven accounts. WARNING-GRADE and advisory only — a self-transfer is
1541
+ * legitimate (sweeping between own accounts), and the on-chain authority
1542
+ * for the send is unchanged either way. Carried on the prepare surfaces
1543
+ * (`POST /payments`, both `POST /x402` legs, and the MCP tools that front
1544
+ * them); it never blocks and never replaces a refusal.
1545
+ */
1546
+ readonly SelfTransfer: "SELF_TRANSFER";
1526
1547
  };
1527
1548
  type AgentPaymentWarningCode = (typeof AgentPaymentWarningCode)[keyof typeof AgentPaymentWarningCode];
1528
1549
  interface AgentPaymentWarning {
@@ -2212,7 +2233,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
2212
2233
  * This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
2213
2234
  * it with the package version on every release — never hand-edit it.
2214
2235
  */
2215
- declare const SDK_VERSION = "0.0.0-dev.202610011057.1c1da3f";
2236
+ declare const SDK_VERSION = "0.0.0-dev.202610011720.e9283da";
2216
2237
  /** The request header every published Haven client sends. */
2217
2238
  declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
2218
2239
  /** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
@@ -2751,6 +2772,18 @@ declare function selectX402SettlementScheme(accepts: X402PaymentOption[], opts:
2751
2772
  delegationRail: boolean;
2752
2773
  }): X402SchemeSelection | null;
2753
2774
  declare function x402AuthorizationAmount(option: X402PaymentOption): string;
2775
+ /**
2776
+ * #3528: map a prepare response's raw `warnings` array onto the typed
2777
+ * `AgentPaymentWarning` shape. Verbatim pass-through per entry (code +
2778
+ * message); `undefined` when the backend sent none — the field stays
2779
+ * ABSENT, never an empty array, so a stranger's prepare is unchanged on the
2780
+ * wire. Unknown codes are relayed as-is: warnings are advisory by contract
2781
+ * (#1308), so a newer backend may add one an older SDK must not swallow.
2782
+ */
2783
+ declare function mapRawWarnings(raw: Array<{
2784
+ code: string;
2785
+ message: string;
2786
+ }> | undefined): AgentPaymentWarning[] | undefined;
2754
2787
  /**
2755
2788
  * Canonical Haven-authenticated x402 expected context, recomputed byte-for-byte
2756
2789
  * by the edge signer before it signs anything.
@@ -3314,4 +3347,4 @@ declare function encodeBase64Json(value: unknown): string;
3314
3347
  */
3315
3348
  declare function decodeBase64Json<T>(value: string, label?: string): T;
3316
3349
 
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 };
3350
+ 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, parsePaymentRequiredResponse 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, mapRawWarnings as bW, normalizePaymentRequired as bX, packedUserOperationHash as bY, parseNextTool as bZ, parsePaymentRequired 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, readClientUpdate as c0, renderNextTool as c1, resolveConnectorChannel as c2, resolveTokenBySymbol as c3, resolveTokenFromAddress as c4, selectErc7710PaymentOption as c5, selectPaymentOption as c6, selectStandardPaymentOption as c7, selectX402SettlementScheme as c8, signerUpdateFallback as c9, sweepUsdcAddress as ca, sweepUsdcDomain as cb, toStandardPaymentRequirements as cc, unsupportedNodeVersionMessage as cd, validateStandardX402PaymentHeader as ce, verifySettlementChild as cf, x402AssetTransferMethod as cg, x402AuthorizationAmount as ch, x402FacilitatorAddresses as ci, x402V2PaymentEnvelope as cj, type DelegationForHashing as ck, CAVEAT_ENFORCERS as cl, CAVEAT_TYPEHASH as cm, DELEGATION_MANAGER as cn, DELEGATION_TYPEHASH as co, DIRECT_PAYMENT_CHAIN_IDS as cp, EXECUTE_ABI as cq, HYBRID_DELEGATOR_IMPLEMENTATION as cr, MAX_SETTLEMENT_WINDOW_SECONDS as cs, SIMPLE_FACTORY_ADDRESS as ct, type SettlementChildTypedData as cu, assertFundingLegPaysDelegate as cv, assertOwnSettlementChild as cw, chainIdForNetwork as cx, isSettlementChildTypedData as cy, 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 };
@@ -133,6 +133,12 @@ interface PaymentIntent {
133
133
  expiresAt: string;
134
134
  /** Data needed to sign the payment */
135
135
  signData: SignData;
136
+ /**
137
+ * #3528: the additive, WARNING-GRADE prepare hints. Present only when the
138
+ * recipient is one of the owner's own Haven accounts (`SELF_TRANSFER`);
139
+ * advisory — never blocks, never replaces a refusal.
140
+ */
141
+ warnings?: AgentPaymentWarning[];
136
142
  }
137
143
  type PaymentStatus = 'pending_signature' | 'submitted' | 'confirmed' | 'pending_approval' | 'approved' | 'proposed' | 'executed' | 'rejected' | 'expired' | 'failed';
138
144
  interface PaymentResult {
@@ -351,6 +357,12 @@ interface X402Intent {
351
357
  expectedTypedDataHash?: string;
352
358
  /** Delegate EOA the funding transfer tops up (the x402 payer). */
353
359
  fundingTo: string;
360
+ /**
361
+ * #3528: the additive, WARNING-GRADE prepare hints. Present only when the
362
+ * recipient (the merchant on erc7710, the delegate EOA on a 3009 funding
363
+ * leg) is one of the owner's own Haven accounts; advisory — never blocks.
364
+ */
365
+ warnings?: AgentPaymentWarning[];
354
366
  }
355
367
  interface X402ExpectedContext {
356
368
  paymentId: string;
@@ -1523,6 +1535,15 @@ declare const AgentPaymentWarningCode: {
1523
1535
  * settlement can no longer land at all.
1524
1536
  */
1525
1537
  readonly SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED";
1538
+ /**
1539
+ * #3528: the recipient of the just-prepared payment is one of the owner's
1540
+ * own Haven accounts. WARNING-GRADE and advisory only — a self-transfer is
1541
+ * legitimate (sweeping between own accounts), and the on-chain authority
1542
+ * for the send is unchanged either way. Carried on the prepare surfaces
1543
+ * (`POST /payments`, both `POST /x402` legs, and the MCP tools that front
1544
+ * them); it never blocks and never replaces a refusal.
1545
+ */
1546
+ readonly SelfTransfer: "SELF_TRANSFER";
1526
1547
  };
1527
1548
  type AgentPaymentWarningCode = (typeof AgentPaymentWarningCode)[keyof typeof AgentPaymentWarningCode];
1528
1549
  interface AgentPaymentWarning {
@@ -2212,7 +2233,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
2212
2233
  * This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
2213
2234
  * it with the package version on every release — never hand-edit it.
2214
2235
  */
2215
- declare const SDK_VERSION = "0.0.0-dev.202610011057.1c1da3f";
2236
+ declare const SDK_VERSION = "0.0.0-dev.202610011720.e9283da";
2216
2237
  /** The request header every published Haven client sends. */
2217
2238
  declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
2218
2239
  /** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
@@ -2751,6 +2772,18 @@ declare function selectX402SettlementScheme(accepts: X402PaymentOption[], opts:
2751
2772
  delegationRail: boolean;
2752
2773
  }): X402SchemeSelection | null;
2753
2774
  declare function x402AuthorizationAmount(option: X402PaymentOption): string;
2775
+ /**
2776
+ * #3528: map a prepare response's raw `warnings` array onto the typed
2777
+ * `AgentPaymentWarning` shape. Verbatim pass-through per entry (code +
2778
+ * message); `undefined` when the backend sent none — the field stays
2779
+ * ABSENT, never an empty array, so a stranger's prepare is unchanged on the
2780
+ * wire. Unknown codes are relayed as-is: warnings are advisory by contract
2781
+ * (#1308), so a newer backend may add one an older SDK must not swallow.
2782
+ */
2783
+ declare function mapRawWarnings(raw: Array<{
2784
+ code: string;
2785
+ message: string;
2786
+ }> | undefined): AgentPaymentWarning[] | undefined;
2754
2787
  /**
2755
2788
  * Canonical Haven-authenticated x402 expected context, recomputed byte-for-byte
2756
2789
  * by the edge signer before it signs anything.
@@ -3314,4 +3347,4 @@ declare function encodeBase64Json(value: unknown): string;
3314
3347
  */
3315
3348
  declare function decodeBase64Json<T>(value: string, label?: string): T;
3316
3349
 
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 };
3350
+ 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, parsePaymentRequiredResponse 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, mapRawWarnings as bW, normalizePaymentRequired as bX, packedUserOperationHash as bY, parseNextTool as bZ, parsePaymentRequired 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, readClientUpdate as c0, renderNextTool as c1, resolveConnectorChannel as c2, resolveTokenBySymbol as c3, resolveTokenFromAddress as c4, selectErc7710PaymentOption as c5, selectPaymentOption as c6, selectStandardPaymentOption as c7, selectX402SettlementScheme as c8, signerUpdateFallback as c9, sweepUsdcAddress as ca, sweepUsdcDomain as cb, toStandardPaymentRequirements as cc, unsupportedNodeVersionMessage as cd, validateStandardX402PaymentHeader as ce, verifySettlementChild as cf, x402AssetTransferMethod as cg, x402AuthorizationAmount as ch, x402FacilitatorAddresses as ci, x402V2PaymentEnvelope as cj, type DelegationForHashing as ck, CAVEAT_ENFORCERS as cl, CAVEAT_TYPEHASH as cm, DELEGATION_MANAGER as cn, DELEGATION_TYPEHASH as co, DIRECT_PAYMENT_CHAIN_IDS as cp, EXECUTE_ABI as cq, HYBRID_DELEGATOR_IMPLEMENTATION as cr, MAX_SETTLEMENT_WINDOW_SECONDS as cs, SIMPLE_FACTORY_ADDRESS as ct, type SettlementChildTypedData as cu, assertFundingLegPaysDelegate as cv, assertOwnSettlementChild as cw, chainIdForNetwork as cx, isSettlementChildTypedData as cy, 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 };
@@ -310,7 +310,16 @@ var AgentPaymentWarningCode = {
310
310
  * money moved". Carries the intent's `expires_at`: after that instant the
311
311
  * settlement can no longer land at all.
312
312
  */
313
- SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED"
313
+ SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED",
314
+ /**
315
+ * #3528: the recipient of the just-prepared payment is one of the owner's
316
+ * own Haven accounts. WARNING-GRADE and advisory only — a self-transfer is
317
+ * legitimate (sweeping between own accounts), and the on-chain authority
318
+ * for the send is unchanged either way. Carried on the prepare surfaces
319
+ * (`POST /payments`, both `POST /x402` legs, and the MCP tools that front
320
+ * them); it never blocks and never replaces a refusal.
321
+ */
322
+ SelfTransfer: "SELF_TRANSFER"
314
323
  };
315
324
  var AgentPaymentRailDescriptions = {
316
325
  [AgentPaymentRail.Direct]: "Standard Haven payment from the user-controlled account, redeeming the agent's on-chain budget delegation.",
@@ -1016,5 +1025,5 @@ function assertRedeemsOwnBudgetDelegation(redeemCalldata, ownAccount) {
1016
1025
  }
1017
1026
 
1018
1027
  export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CAVEAT_ENFORCERS, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MAX_SETTLEMENT_WINDOW_SECONDS, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild };
1019
- //# sourceMappingURL=chunk-PUAJJDMB.js.map
1020
- //# sourceMappingURL=chunk-PUAJJDMB.js.map
1028
+ //# sourceMappingURL=chunk-BRELGKWM.js.map
1029
+ //# sourceMappingURL=chunk-BRELGKWM.js.map