@haven_ai/sdk 0.1.23-alpha.0 → 0.1.23-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -453,49 +453,7 @@ interface X402ResumeState {
453
453
  chainId: number | null;
454
454
  merchantAddress: string;
455
455
  }
456
- interface MppAuthorizationOptions {
457
- /** Stable caller-supplied key for this user intent. Prevents duplicate approvals across retries. */
458
- idempotencyKey?: string;
459
- }
460
- /** Quote parsed from an MPP challenge without creating a Haven payment. */
461
- interface MppQuote {
462
- rail: 'mpp';
463
- paymentRail: MachinePaymentRail;
464
- idempotencyKey: string;
465
- challenge: MachinePaymentChallenge;
466
- request: X402RequestSnapshot;
467
- resourceUrl: string;
468
- description: string | null;
469
- amountAtomic: string;
470
- amount: string;
471
- token: string;
472
- asset: string;
473
- network: string;
474
- chainId: number;
475
- merchantAddress: string;
476
- expiresAt: string;
477
- }
478
- /** State bundle an agent can persist while waiting for manual MPP approval. */
479
- interface MppResumeState {
480
- rail: 'mpp';
481
- paymentRail: MachinePaymentRail;
482
- paymentId: string;
483
- idempotencyKey: string;
484
- challenge: MachinePaymentChallenge;
485
- url: string;
486
- request?: X402RequestSnapshot;
487
- resourceUrl: string;
488
- description: string | null;
489
- amountAtomic: string;
490
- amount: string;
491
- token: string;
492
- asset: string;
493
- network: string;
494
- chainId: number;
495
- merchantAddress: string;
496
- expiresAt: string;
497
- }
498
- type PaymentResumeState = X402ResumeState | MppResumeState;
456
+ type PaymentResumeState = X402ResumeState;
499
457
  interface ResumeAuthorizedX402Input extends X402AuthorizationOptions {
500
458
  /** Payment or approval request ID returned by authorizeX402 / haven.fetch. */
501
459
  paymentId: string;
@@ -514,63 +472,7 @@ interface ResumeX402PaymentInput extends X402AuthorizationOptions {
514
472
  /** Original or freshly parsed x402 requirements. Supplying this avoids an extra merchant 402 probe. */
515
473
  paymentRequired?: X402PaymentRequired;
516
474
  }
517
- interface ResumeAuthorizedMppInput extends MppAuthorizationOptions {
518
- /** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
519
- paymentId: string;
520
- /** Original MPP challenge returned by the paid resource. */
521
- challenge: MachinePaymentChallenge;
522
- }
523
- interface ResumeMppPaymentInput extends MppAuthorizationOptions {
524
- /** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
525
- paymentId: string;
526
- /** Original paid URL. If challenge is omitted, Haven will call it once to re-read the MPP challenge. */
527
- url: string;
528
- /** Original fetch options. Reused for the 402 probe and final merchant retry. */
529
- init?: RequestInit;
530
- /** Serializable original request captured by quoteMpp() / pending approval errors. */
531
- request?: X402RequestSnapshot;
532
- /** Original MPP challenge. Supplying this avoids an extra paid-resource 402 probe. */
533
- challenge?: MachinePaymentChallenge;
534
- }
535
475
  type MachinePaymentRail = 'x402' | 'mpp_demo' | 'mpp_crypto' | 'stripe_deposit' | 'spt';
536
- interface MachinePaymentChallenge {
537
- rail: MachinePaymentRail;
538
- version: string;
539
- challengeId: string;
540
- resource: string;
541
- description: string;
542
- network: {
543
- chainId: number;
544
- name: 'base';
545
- };
546
- asset: {
547
- symbol: 'USDC';
548
- address: string;
549
- decimals: 6;
550
- };
551
- amount: {
552
- display: string;
553
- atomic: string;
554
- };
555
- recipient: string;
556
- expiresAt: string;
557
- metadata?: Record<string, unknown>;
558
- }
559
- interface MachinePaymentReceipt {
560
- success: boolean;
561
- rail: MachinePaymentRail;
562
- paymentId: string;
563
- challengeId: string;
564
- txHash: string;
565
- token: string;
566
- amount: string;
567
- to: string;
568
- resourceUrl: string;
569
- explorerUrl: string;
570
- payer?: string;
571
- chainId?: number;
572
- proofHeader: string;
573
- }
574
476
  interface HavenAgent {
575
477
  id: string;
576
478
  name: string;
@@ -874,17 +776,19 @@ type AgentPaymentFailureCode = (typeof AgentPaymentFailureCode)[keyof typeof Age
874
776
  *
875
777
  * Two layers of vocabulary share this enum because both reach the wire:
876
778
  *
877
- * - **Categorical rails** identify the rail family and are used as
878
- * discriminators on `PaymentResumeState`: `direct`, `x402`, `mpp`.
779
+ * - **Categorical rails** identify the rail family and are used as the
780
+ * `PaymentResumeState` discriminator: `direct`, `x402` (`mpp` remains a
781
+ * valid categorical VALUE on historical status reads, but #1328 retired
782
+ * the `MppResumeState` variant that used to carry it — the mpp_demo
783
+ * client resume flow no longer exists).
879
784
  * - **Granular rails** identify the specific protocol the backend persists
880
785
  * and returns on response bodies: `mpp_demo`, `mpp_crypto`,
881
786
  * `stripe_deposit`, `spt`. `x402` doubles as both categorical and
882
787
  * granular.
883
788
  *
884
789
  * Consumers reading the top-level `rail` field on a payment status response
885
- * should treat any `mpp*` value as the MPP family; consumers reading the
886
- * `rail` field on a `MppResumeState` will always see the categorical `mpp`,
887
- * with the granular value on `paymentRail`.
790
+ * should treat any `mpp*` value as the MPP family — this still applies to
791
+ * historical `mpp_demo` rows, which remain readable.
888
792
  */
889
793
  declare const AgentPaymentRail: {
890
794
  /** Standard Haven payment from the user's Safe through an approved delegate allowance. */
@@ -908,7 +812,7 @@ type PaymentNextAction = AgentPaymentNextAction;
908
812
  declare const AGENT_PAYMENT_PHASE_VALUES: ("rejected" | "expired" | "failed" | "agent_signature_required" | "payment_submitted" | "payment_confirmed" | "user_approval_required" | "user_execution_required" | "waiting_for_additional_approvals" | "funding_sent" | "insufficient_funds" | "funded_but_unsettled")[];
909
813
  declare const AGENT_PAYMENT_NEXT_ACTION_VALUES: ("sign_and_submit_payment" | "check_status_later" | "none" | "wait_for_user_approval" | "wait_for_user_to_complete_payment" | "retry_original_x402_request" | "stop_and_tell_user" | "request_again_if_user_still_wants_it" | "retry_with_explicit_context" | "payment_window_expired" | "fund_safe_or_raise_allowance" | "sweep_stranded_funds")[];
910
814
  declare const AGENT_PAYMENT_FAILURE_CODE_VALUES: ("PRICE_EXCEEDS_MAX" | "PAYMENT_WINDOW_EXPIRED" | "MERCHANT_REJECTED_AFTER_FUNDING" | "MERCHANT_UNRESPONSIVE_AFTER_FUNDING" | "MERCHANT_CALL_CONTEXT_UNAVAILABLE" | "AMBIGUOUS_MAX_AMOUNT" | "MAX_AMOUNT_UNCONVERTIBLE")[];
911
- declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "mpp" | "mpp_demo" | "mpp_crypto" | "stripe_deposit" | "spt" | "direct")[];
815
+ declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "mpp_demo" | "mpp_crypto" | "stripe_deposit" | "spt" | "direct" | "mpp")[];
912
816
  declare const AgentPaymentPhaseDescriptions: Record<AgentPaymentPhase, string>;
913
817
  declare const AgentPaymentNextActionDescriptions: Record<AgentPaymentNextAction, string>;
914
818
  declare const AgentPaymentFailureCodeDescriptions: Record<AgentPaymentFailureCode, string>;
@@ -1123,7 +1027,7 @@ declare class X402UnexpectedStatusError extends HavenApiError {
1123
1027
  }
1124
1028
  declare class HavenPaymentStateError extends HavenApiError {
1125
1029
  readonly state: PaymentStatusResult;
1126
- resumeState?: X402ResumeState | MppResumeState;
1030
+ resumeState?: X402ResumeState;
1127
1031
  constructor(message: string, statusCode: number, state: PaymentStatusResult, body?: unknown);
1128
1032
  get status(): string;
1129
1033
  get phase(): PaymentPhase;
@@ -1375,7 +1279,6 @@ declare class HavenClient {
1375
1279
  private readonly chainRpcs;
1376
1280
  private readonly inFlightX402;
1377
1281
  private readonly x402ReceiptCache;
1378
- private readonly inFlightMachinePayments;
1379
1282
  /**
1380
1283
  * Setup-time headers configured via `HavenClientConfig.defaultHeaders`.
1381
1284
  * Read-only after construction — use `withRequestContext` for per-call
@@ -1615,10 +1518,11 @@ declare class HavenClient {
1615
1518
  verification: ReceiptVerification;
1616
1519
  }>;
1617
1520
  /**
1618
- * Rehydrate the x402/MPP resume-state bundle for a payment id.
1521
+ * Rehydrate the x402 resume-state bundle for a payment id (#1328: the MPP
1522
+ * resume-state variant retired along with the rest of the mpp_demo surface).
1619
1523
  *
1620
1524
  * The server returns stored protocol context only. The client still signs the
1621
- * merchant proof locally when resumeX402Payment() or resumeMppPayment() runs.
1525
+ * merchant proof locally when resumeX402Payment() runs.
1622
1526
  */
1623
1527
  getResumeState(paymentId: string): Promise<PaymentResumeState>;
1624
1528
  /**
@@ -1707,15 +1611,6 @@ declare class HavenClient {
1707
1611
  * Non-SSE responses pass through untouched.
1708
1612
  */
1709
1613
  private surfaceMcpResult;
1710
- /**
1711
- * Probe a paid MPP endpoint or inspect an existing challenge without creating
1712
- * a Haven payment or approval request.
1713
- */
1714
- quoteMpp(challengeOrUrl: MachinePaymentChallenge | string, init?: RequestInit, options?: MppAuthorizationOptions): Promise<MppQuote>;
1715
- /**
1716
- * Pay a previously inspected MPP quote and retry the exact captured request.
1717
- */
1718
- payMppChallenge(quote: MppQuote, options?: MppAuthorizationOptions): Promise<Response>;
1719
1614
  private retryX402Request;
1720
1615
  /**
1721
1616
  * #956: capture the merchant's OWN receipt when the paid response carries
@@ -1784,21 +1679,12 @@ declare class HavenClient {
1784
1679
  getX402MerchantCallContext(paymentId: string): Promise<X402MerchantCallContext>;
1785
1680
  private resolveX402MerchantCompletionContext;
1786
1681
  private resolveX402WalletForMerchantCall;
1787
- authorizeMachinePayment(challenge: MachinePaymentChallenge, options?: MppAuthorizationOptions): Promise<MachinePaymentReceipt>;
1788
- private authorizeMppDemoPayment;
1789
- resumeAuthorizedMpp(input: ResumeAuthorizedMppInput): Promise<MachinePaymentReceipt>;
1790
- resumeMppPayment(input: ResumeMppPaymentInput | MppResumeState): Promise<Response>;
1791
- private fetchWithMachinePayment;
1792
- private retryMppRequest;
1793
1682
  private assertCanResumeX402;
1794
- private assertCanResumeMpp;
1795
1683
  private mapX402ReceiptFromAuthorization;
1796
1684
  private mapX402ReceiptFromStatus;
1797
1685
  private buildX402Receipt;
1798
1686
  private createStandardX402Header;
1799
1687
  private cacheX402Receipt;
1800
- private mapMachinePaymentReceipt;
1801
- private mapMachinePaymentReceiptFromStatus;
1802
1688
  private recordMerchantRetryRejected;
1803
1689
  private reportMachinePaymentEvidence;
1804
1690
  /**
@@ -1822,11 +1708,8 @@ declare class HavenClient {
1822
1708
  private buildX402Quote;
1823
1709
  private detectX402McpTransport;
1824
1710
  private buildX402ResumeState;
1825
- private buildMppQuote;
1826
- private buildMppResumeState;
1827
1711
  private attachResumeState;
1828
1712
  private attachX402ResumeState;
1829
- private attachMppResumeState;
1830
1713
  /**
1831
1714
  * Execute a tool call by name and input.
1832
1715
  *
@@ -1999,7 +1882,7 @@ declare const toolDescriptions: {
1999
1882
  readonly payX402OneShot: {
2000
1883
  readonly summary: "Fetch an x402 paid HTTP resource in a single call. Handles the full probe -> pay -> retry round trip and returns the merchant response.";
2001
1884
  readonly selectionGuidance: "Prefer this over the quote+pay split when the agent just wants the paid resource and does not need to inspect the price first. If you already have a quote from haven_quote_x402, use haven_pay_x402_quote instead. Do not use for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
2002
- readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns an MPP machine-payment challenge instead of standard x402, the MPP payment path is used automatically. If the resource returns a non-402 status, returns it unchanged without contacting Haven.";
1885
+ readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns a non-402 status, returns it unchanged without contacting Haven.";
2003
1886
  readonly nextActionGuidance: string;
2004
1887
  };
2005
1888
  readonly resumeX402: {
@@ -2007,29 +1890,13 @@ declare const toolDescriptions: {
2007
1890
  readonly behavior: "Accepts either resume_state or payment_id, validates the original x402 details against the approved Haven funding, and retries the merchant request with the X-PAYMENT header. No new Haven approval is created.";
2008
1891
  readonly nextActionGuidance: "Only use when get_payment_status returns nextAction=retry_original_x402_request; do not start a new merchant session.";
2009
1892
  };
2010
- readonly quoteMpp: {
2011
- readonly summary: "Inspect a Haven MPP challenge or paid MPP URL without creating a Haven payment, signature, approval, or on-chain transaction.";
2012
- readonly behavior: "Parses an MPP challenge envelope and returns a typed quote with rail tag, amount, asset, and merchant context. Pure read-only — Haven is not contacted.";
2013
- readonly nextActionGuidance: "On success the returned quote is the input to haven_pay_mpp_challenge. Do not call the merchant again — Haven re-uses the captured request when paying.";
2014
- };
2015
- readonly payMpp: {
2016
- readonly summary: "Pay an inspected MPP challenge. The delegate key signs locally; Haven only validates and relays signed, on-chain-constrained payment transactions.";
2017
- readonly selectionGuidance: "Do not use this for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
2018
- readonly behavior: "Authorizes the payment through Haven within the on-chain allowance, signs the challenge proof, and returns the proof header for retrying the original paid resource.";
2019
- readonly nextActionGuidance: "If approval is needed, preserve resume_state or payment_id and wait for nextAction=retry_original_x402_request before resuming.";
2020
- };
2021
- readonly resumeMpp: {
2022
- readonly summary: "Resume an MPP payment after the Haven wallet owner approved the funding step.";
2023
- readonly behavior: "Accepts either resume_state or payment_id and retries the original paid resource with the MPP proof header. No new Haven approval is created.";
2024
- readonly nextActionGuidance: "";
2025
- };
2026
1893
  readonly getPaymentStatus: {
2027
1894
  readonly summary: "Fetch structured Haven payment status, including phase and nextAction taxonomy for agent recovery.";
2028
1895
  readonly behavior: "Accepts a payment intent or approval request id and returns the full state taxonomy (phase, nextAction, rail, amount, merchant, resource url, idempotency key, message).";
2029
1896
  readonly nextActionGuidance: "";
2030
1897
  };
2031
1898
  readonly getResumeState: {
2032
- readonly summary: "Rehydrate stored x402 or MPP resume_state by payment_id.";
1899
+ readonly summary: "Rehydrate stored x402 resume_state by payment_id.";
2033
1900
  readonly behavior: "Returns the context that the agent originally received in a pending-approval response, reconstructed from Haven's database. This is context only; signing still happens locally when a resume tool is called.";
2034
1901
  readonly nextActionGuidance: "";
2035
1902
  };
@@ -2297,11 +2164,6 @@ declare function resolveTokenFromAddress(address: string, network?: string): {
2297
2164
  decimals: number;
2298
2165
  } | null;
2299
2166
 
2300
- declare function parseMachinePaymentChallenge(response: Response): MachinePaymentChallenge;
2301
- declare function parseMachinePaymentChallengeResponse(response: Response): Promise<MachinePaymentChallenge>;
2302
- declare function buildMachinePaymentIdempotencyKey(challenge: MachinePaymentChallenge): string;
2303
- declare function encodeMachinePaymentProof(receipt: Omit<MachinePaymentReceipt, 'proofHeader'>): string;
2304
-
2305
2167
  /**
2306
2168
  * Runtime-agnostic base64 helpers — the single source of truth for the wire
2307
2169
  * encoding shared by the SDK and the edge signer (#325).
@@ -2368,4 +2230,4 @@ declare function discoverMerchantMcpUrl(inputUrl: string): Promise<string | null
2368
2230
  /** Trailing-slash/percent-case echoes compare equal; unparseable never does. */
2369
2231
  declare function sameUrl(a: string, b: string): boolean;
2370
2232
 
2371
- export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, MerchantTimeoutError, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, X402UnexpectedStatusError, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildMachinePaymentIdempotencyKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, isSupportedNodeVersion, isSweepableChain, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectPaymentOption, selectStandardPaymentOption, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, verifyPaymentReceipt, verifySignature, x402AuthorizationAmount };
2233
+ export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentRail, MerchantTimeoutError, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedX402Input, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, X402UnexpectedStatusError, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isSupportedNodeVersion, isSweepableChain, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectPaymentOption, selectStandardPaymentOption, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, verifyPaymentReceipt, verifySignature, x402AuthorizationAmount };
package/dist/index.d.ts CHANGED
@@ -453,49 +453,7 @@ interface X402ResumeState {
453
453
  chainId: number | null;
454
454
  merchantAddress: string;
455
455
  }
456
- interface MppAuthorizationOptions {
457
- /** Stable caller-supplied key for this user intent. Prevents duplicate approvals across retries. */
458
- idempotencyKey?: string;
459
- }
460
- /** Quote parsed from an MPP challenge without creating a Haven payment. */
461
- interface MppQuote {
462
- rail: 'mpp';
463
- paymentRail: MachinePaymentRail;
464
- idempotencyKey: string;
465
- challenge: MachinePaymentChallenge;
466
- request: X402RequestSnapshot;
467
- resourceUrl: string;
468
- description: string | null;
469
- amountAtomic: string;
470
- amount: string;
471
- token: string;
472
- asset: string;
473
- network: string;
474
- chainId: number;
475
- merchantAddress: string;
476
- expiresAt: string;
477
- }
478
- /** State bundle an agent can persist while waiting for manual MPP approval. */
479
- interface MppResumeState {
480
- rail: 'mpp';
481
- paymentRail: MachinePaymentRail;
482
- paymentId: string;
483
- idempotencyKey: string;
484
- challenge: MachinePaymentChallenge;
485
- url: string;
486
- request?: X402RequestSnapshot;
487
- resourceUrl: string;
488
- description: string | null;
489
- amountAtomic: string;
490
- amount: string;
491
- token: string;
492
- asset: string;
493
- network: string;
494
- chainId: number;
495
- merchantAddress: string;
496
- expiresAt: string;
497
- }
498
- type PaymentResumeState = X402ResumeState | MppResumeState;
456
+ type PaymentResumeState = X402ResumeState;
499
457
  interface ResumeAuthorizedX402Input extends X402AuthorizationOptions {
500
458
  /** Payment or approval request ID returned by authorizeX402 / haven.fetch. */
501
459
  paymentId: string;
@@ -514,63 +472,7 @@ interface ResumeX402PaymentInput extends X402AuthorizationOptions {
514
472
  /** Original or freshly parsed x402 requirements. Supplying this avoids an extra merchant 402 probe. */
515
473
  paymentRequired?: X402PaymentRequired;
516
474
  }
517
- interface ResumeAuthorizedMppInput extends MppAuthorizationOptions {
518
- /** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
519
- paymentId: string;
520
- /** Original MPP challenge returned by the paid resource. */
521
- challenge: MachinePaymentChallenge;
522
- }
523
- interface ResumeMppPaymentInput extends MppAuthorizationOptions {
524
- /** Payment or approval request ID returned by authorizeMachinePayment / haven.fetch. */
525
- paymentId: string;
526
- /** Original paid URL. If challenge is omitted, Haven will call it once to re-read the MPP challenge. */
527
- url: string;
528
- /** Original fetch options. Reused for the 402 probe and final merchant retry. */
529
- init?: RequestInit;
530
- /** Serializable original request captured by quoteMpp() / pending approval errors. */
531
- request?: X402RequestSnapshot;
532
- /** Original MPP challenge. Supplying this avoids an extra paid-resource 402 probe. */
533
- challenge?: MachinePaymentChallenge;
534
- }
535
475
  type MachinePaymentRail = 'x402' | 'mpp_demo' | 'mpp_crypto' | 'stripe_deposit' | 'spt';
536
- interface MachinePaymentChallenge {
537
- rail: MachinePaymentRail;
538
- version: string;
539
- challengeId: string;
540
- resource: string;
541
- description: string;
542
- network: {
543
- chainId: number;
544
- name: 'base';
545
- };
546
- asset: {
547
- symbol: 'USDC';
548
- address: string;
549
- decimals: 6;
550
- };
551
- amount: {
552
- display: string;
553
- atomic: string;
554
- };
555
- recipient: string;
556
- expiresAt: string;
557
- metadata?: Record<string, unknown>;
558
- }
559
- interface MachinePaymentReceipt {
560
- success: boolean;
561
- rail: MachinePaymentRail;
562
- paymentId: string;
563
- challengeId: string;
564
- txHash: string;
565
- token: string;
566
- amount: string;
567
- to: string;
568
- resourceUrl: string;
569
- explorerUrl: string;
570
- payer?: string;
571
- chainId?: number;
572
- proofHeader: string;
573
- }
574
476
  interface HavenAgent {
575
477
  id: string;
576
478
  name: string;
@@ -874,17 +776,19 @@ type AgentPaymentFailureCode = (typeof AgentPaymentFailureCode)[keyof typeof Age
874
776
  *
875
777
  * Two layers of vocabulary share this enum because both reach the wire:
876
778
  *
877
- * - **Categorical rails** identify the rail family and are used as
878
- * discriminators on `PaymentResumeState`: `direct`, `x402`, `mpp`.
779
+ * - **Categorical rails** identify the rail family and are used as the
780
+ * `PaymentResumeState` discriminator: `direct`, `x402` (`mpp` remains a
781
+ * valid categorical VALUE on historical status reads, but #1328 retired
782
+ * the `MppResumeState` variant that used to carry it — the mpp_demo
783
+ * client resume flow no longer exists).
879
784
  * - **Granular rails** identify the specific protocol the backend persists
880
785
  * and returns on response bodies: `mpp_demo`, `mpp_crypto`,
881
786
  * `stripe_deposit`, `spt`. `x402` doubles as both categorical and
882
787
  * granular.
883
788
  *
884
789
  * Consumers reading the top-level `rail` field on a payment status response
885
- * should treat any `mpp*` value as the MPP family; consumers reading the
886
- * `rail` field on a `MppResumeState` will always see the categorical `mpp`,
887
- * with the granular value on `paymentRail`.
790
+ * should treat any `mpp*` value as the MPP family — this still applies to
791
+ * historical `mpp_demo` rows, which remain readable.
888
792
  */
889
793
  declare const AgentPaymentRail: {
890
794
  /** Standard Haven payment from the user's Safe through an approved delegate allowance. */
@@ -908,7 +812,7 @@ type PaymentNextAction = AgentPaymentNextAction;
908
812
  declare const AGENT_PAYMENT_PHASE_VALUES: ("rejected" | "expired" | "failed" | "agent_signature_required" | "payment_submitted" | "payment_confirmed" | "user_approval_required" | "user_execution_required" | "waiting_for_additional_approvals" | "funding_sent" | "insufficient_funds" | "funded_but_unsettled")[];
909
813
  declare const AGENT_PAYMENT_NEXT_ACTION_VALUES: ("sign_and_submit_payment" | "check_status_later" | "none" | "wait_for_user_approval" | "wait_for_user_to_complete_payment" | "retry_original_x402_request" | "stop_and_tell_user" | "request_again_if_user_still_wants_it" | "retry_with_explicit_context" | "payment_window_expired" | "fund_safe_or_raise_allowance" | "sweep_stranded_funds")[];
910
814
  declare const AGENT_PAYMENT_FAILURE_CODE_VALUES: ("PRICE_EXCEEDS_MAX" | "PAYMENT_WINDOW_EXPIRED" | "MERCHANT_REJECTED_AFTER_FUNDING" | "MERCHANT_UNRESPONSIVE_AFTER_FUNDING" | "MERCHANT_CALL_CONTEXT_UNAVAILABLE" | "AMBIGUOUS_MAX_AMOUNT" | "MAX_AMOUNT_UNCONVERTIBLE")[];
911
- declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "mpp" | "mpp_demo" | "mpp_crypto" | "stripe_deposit" | "spt" | "direct")[];
815
+ declare const AGENT_PAYMENT_RAIL_VALUES: ("x402" | "mpp_demo" | "mpp_crypto" | "stripe_deposit" | "spt" | "direct" | "mpp")[];
912
816
  declare const AgentPaymentPhaseDescriptions: Record<AgentPaymentPhase, string>;
913
817
  declare const AgentPaymentNextActionDescriptions: Record<AgentPaymentNextAction, string>;
914
818
  declare const AgentPaymentFailureCodeDescriptions: Record<AgentPaymentFailureCode, string>;
@@ -1123,7 +1027,7 @@ declare class X402UnexpectedStatusError extends HavenApiError {
1123
1027
  }
1124
1028
  declare class HavenPaymentStateError extends HavenApiError {
1125
1029
  readonly state: PaymentStatusResult;
1126
- resumeState?: X402ResumeState | MppResumeState;
1030
+ resumeState?: X402ResumeState;
1127
1031
  constructor(message: string, statusCode: number, state: PaymentStatusResult, body?: unknown);
1128
1032
  get status(): string;
1129
1033
  get phase(): PaymentPhase;
@@ -1375,7 +1279,6 @@ declare class HavenClient {
1375
1279
  private readonly chainRpcs;
1376
1280
  private readonly inFlightX402;
1377
1281
  private readonly x402ReceiptCache;
1378
- private readonly inFlightMachinePayments;
1379
1282
  /**
1380
1283
  * Setup-time headers configured via `HavenClientConfig.defaultHeaders`.
1381
1284
  * Read-only after construction — use `withRequestContext` for per-call
@@ -1615,10 +1518,11 @@ declare class HavenClient {
1615
1518
  verification: ReceiptVerification;
1616
1519
  }>;
1617
1520
  /**
1618
- * Rehydrate the x402/MPP resume-state bundle for a payment id.
1521
+ * Rehydrate the x402 resume-state bundle for a payment id (#1328: the MPP
1522
+ * resume-state variant retired along with the rest of the mpp_demo surface).
1619
1523
  *
1620
1524
  * The server returns stored protocol context only. The client still signs the
1621
- * merchant proof locally when resumeX402Payment() or resumeMppPayment() runs.
1525
+ * merchant proof locally when resumeX402Payment() runs.
1622
1526
  */
1623
1527
  getResumeState(paymentId: string): Promise<PaymentResumeState>;
1624
1528
  /**
@@ -1707,15 +1611,6 @@ declare class HavenClient {
1707
1611
  * Non-SSE responses pass through untouched.
1708
1612
  */
1709
1613
  private surfaceMcpResult;
1710
- /**
1711
- * Probe a paid MPP endpoint or inspect an existing challenge without creating
1712
- * a Haven payment or approval request.
1713
- */
1714
- quoteMpp(challengeOrUrl: MachinePaymentChallenge | string, init?: RequestInit, options?: MppAuthorizationOptions): Promise<MppQuote>;
1715
- /**
1716
- * Pay a previously inspected MPP quote and retry the exact captured request.
1717
- */
1718
- payMppChallenge(quote: MppQuote, options?: MppAuthorizationOptions): Promise<Response>;
1719
1614
  private retryX402Request;
1720
1615
  /**
1721
1616
  * #956: capture the merchant's OWN receipt when the paid response carries
@@ -1784,21 +1679,12 @@ declare class HavenClient {
1784
1679
  getX402MerchantCallContext(paymentId: string): Promise<X402MerchantCallContext>;
1785
1680
  private resolveX402MerchantCompletionContext;
1786
1681
  private resolveX402WalletForMerchantCall;
1787
- authorizeMachinePayment(challenge: MachinePaymentChallenge, options?: MppAuthorizationOptions): Promise<MachinePaymentReceipt>;
1788
- private authorizeMppDemoPayment;
1789
- resumeAuthorizedMpp(input: ResumeAuthorizedMppInput): Promise<MachinePaymentReceipt>;
1790
- resumeMppPayment(input: ResumeMppPaymentInput | MppResumeState): Promise<Response>;
1791
- private fetchWithMachinePayment;
1792
- private retryMppRequest;
1793
1682
  private assertCanResumeX402;
1794
- private assertCanResumeMpp;
1795
1683
  private mapX402ReceiptFromAuthorization;
1796
1684
  private mapX402ReceiptFromStatus;
1797
1685
  private buildX402Receipt;
1798
1686
  private createStandardX402Header;
1799
1687
  private cacheX402Receipt;
1800
- private mapMachinePaymentReceipt;
1801
- private mapMachinePaymentReceiptFromStatus;
1802
1688
  private recordMerchantRetryRejected;
1803
1689
  private reportMachinePaymentEvidence;
1804
1690
  /**
@@ -1822,11 +1708,8 @@ declare class HavenClient {
1822
1708
  private buildX402Quote;
1823
1709
  private detectX402McpTransport;
1824
1710
  private buildX402ResumeState;
1825
- private buildMppQuote;
1826
- private buildMppResumeState;
1827
1711
  private attachResumeState;
1828
1712
  private attachX402ResumeState;
1829
- private attachMppResumeState;
1830
1713
  /**
1831
1714
  * Execute a tool call by name and input.
1832
1715
  *
@@ -1999,7 +1882,7 @@ declare const toolDescriptions: {
1999
1882
  readonly payX402OneShot: {
2000
1883
  readonly summary: "Fetch an x402 paid HTTP resource in a single call. Handles the full probe -> pay -> retry round trip and returns the merchant response.";
2001
1884
  readonly selectionGuidance: "Prefer this over the quote+pay split when the agent just wants the paid resource and does not need to inspect the price first. If you already have a quote from haven_quote_x402, use haven_pay_x402_quote instead. Do not use for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
2002
- readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns an MPP machine-payment challenge instead of standard x402, the MPP payment path is used automatically. If the resource returns a non-402 status, returns it unchanged without contacting Haven.";
1885
+ readonly behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the EIP-3009 payment from the delegate wallet, asks Haven for a Safe AllowanceModule top-up if needed, then retries the original request with the X-PAYMENT header and returns the merchant response. If the resource returns a non-402 status, returns it unchanged without contacting Haven.";
2003
1886
  readonly nextActionGuidance: string;
2004
1887
  };
2005
1888
  readonly resumeX402: {
@@ -2007,29 +1890,13 @@ declare const toolDescriptions: {
2007
1890
  readonly behavior: "Accepts either resume_state or payment_id, validates the original x402 details against the approved Haven funding, and retries the merchant request with the X-PAYMENT header. No new Haven approval is created.";
2008
1891
  readonly nextActionGuidance: "Only use when get_payment_status returns nextAction=retry_original_x402_request; do not start a new merchant session.";
2009
1892
  };
2010
- readonly quoteMpp: {
2011
- readonly summary: "Inspect a Haven MPP challenge or paid MPP URL without creating a Haven payment, signature, approval, or on-chain transaction.";
2012
- readonly behavior: "Parses an MPP challenge envelope and returns a typed quote with rail tag, amount, asset, and merchant context. Pure read-only — Haven is not contacted.";
2013
- readonly nextActionGuidance: "On success the returned quote is the input to haven_pay_mpp_challenge. Do not call the merchant again — Haven re-uses the captured request when paying.";
2014
- };
2015
- readonly payMpp: {
2016
- readonly summary: "Pay an inspected MPP challenge. The delegate key signs locally; Haven only validates and relays signed, on-chain-constrained payment transactions.";
2017
- readonly selectionGuidance: "Do not use this for read-only allowance, budget, spend-limit, remaining-amount, reset-period, or what-can-I-spend questions; use the allowance lookup tool instead.";
2018
- readonly behavior: "Authorizes the payment through Haven within the on-chain allowance, signs the challenge proof, and returns the proof header for retrying the original paid resource.";
2019
- readonly nextActionGuidance: "If approval is needed, preserve resume_state or payment_id and wait for nextAction=retry_original_x402_request before resuming.";
2020
- };
2021
- readonly resumeMpp: {
2022
- readonly summary: "Resume an MPP payment after the Haven wallet owner approved the funding step.";
2023
- readonly behavior: "Accepts either resume_state or payment_id and retries the original paid resource with the MPP proof header. No new Haven approval is created.";
2024
- readonly nextActionGuidance: "";
2025
- };
2026
1893
  readonly getPaymentStatus: {
2027
1894
  readonly summary: "Fetch structured Haven payment status, including phase and nextAction taxonomy for agent recovery.";
2028
1895
  readonly behavior: "Accepts a payment intent or approval request id and returns the full state taxonomy (phase, nextAction, rail, amount, merchant, resource url, idempotency key, message).";
2029
1896
  readonly nextActionGuidance: "";
2030
1897
  };
2031
1898
  readonly getResumeState: {
2032
- readonly summary: "Rehydrate stored x402 or MPP resume_state by payment_id.";
1899
+ readonly summary: "Rehydrate stored x402 resume_state by payment_id.";
2033
1900
  readonly behavior: "Returns the context that the agent originally received in a pending-approval response, reconstructed from Haven's database. This is context only; signing still happens locally when a resume tool is called.";
2034
1901
  readonly nextActionGuidance: "";
2035
1902
  };
@@ -2297,11 +2164,6 @@ declare function resolveTokenFromAddress(address: string, network?: string): {
2297
2164
  decimals: number;
2298
2165
  } | null;
2299
2166
 
2300
- declare function parseMachinePaymentChallenge(response: Response): MachinePaymentChallenge;
2301
- declare function parseMachinePaymentChallengeResponse(response: Response): Promise<MachinePaymentChallenge>;
2302
- declare function buildMachinePaymentIdempotencyKey(challenge: MachinePaymentChallenge): string;
2303
- declare function encodeMachinePaymentProof(receipt: Omit<MachinePaymentReceipt, 'proofHeader'>): string;
2304
-
2305
2167
  /**
2306
2168
  * Runtime-agnostic base64 helpers — the single source of truth for the wire
2307
2169
  * encoding shared by the SDK and the edge signer (#325).
@@ -2368,4 +2230,4 @@ declare function discoverMerchantMcpUrl(inputUrl: string): Promise<string | null
2368
2230
  /** Trailing-slash/percent-case echoes compare equal; unparseable never does. */
2369
2231
  declare function sameUrl(a: string, b: string): boolean;
2370
2232
 
2371
- export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentChallenge, type MachinePaymentRail, type MachinePaymentReceipt, MerchantTimeoutError, type MppAuthorizationOptions, type MppQuote, type MppResumeState, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedMppInput, type ResumeAuthorizedX402Input, type ResumeMppPaymentInput, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, X402UnexpectedStatusError, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildMachinePaymentIdempotencyKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodeMachinePaymentProof, encodePaymentProof, havenTools, isSupportedNodeVersion, isSweepableChain, parseMachinePaymentChallenge, parseMachinePaymentChallengeResponse, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectPaymentOption, selectStandardPaymentOption, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, verifyPaymentReceipt, verifySignature, x402AuthorizationAmount };
2233
+ export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type ClaudeTool, DISCOVERY_MAX_BYTES, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentRail, MerchantTimeoutError, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PendingApproval, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedX402Input, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, type X402AuthorizationOptions, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, X402UnexpectedStatusError, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isSupportedNodeVersion, isSweepableChain, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectPaymentOption, selectStandardPaymentOption, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, verifyPaymentReceipt, verifySignature, x402AuthorizationAmount };