@haven_ai/sdk 0.10.0-alpha.0 → 0.12.0-alpha.0

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.
Files changed (40) hide show
  1. package/README.md +45 -9
  2. package/dist/{base64-CiR5BJhk.d.cts → base64-C5OrJLij.d.ts} +10 -2
  3. package/dist/{base64-CxkinHPQ.d.ts → base64-COaV1Sis.d.cts} +10 -2
  4. package/dist/{chunk-6LEXYQ7J.cjs → chunk-4JTLJVBS.cjs} +4 -4
  5. package/dist/chunk-4JTLJVBS.cjs.map +1 -0
  6. package/dist/{chunk-MLUWABVT.js → chunk-7M3CIW7W.js} +7 -6
  7. package/dist/chunk-7M3CIW7W.js.map +1 -0
  8. package/dist/{chunk-TD2PHUYP.js → chunk-UPEDQLAL.js} +72 -6
  9. package/dist/chunk-UPEDQLAL.js.map +1 -0
  10. package/dist/{chunk-22FJ4JQO.cjs → chunk-V2ODMLDD.cjs} +38 -37
  11. package/dist/chunk-V2ODMLDD.cjs.map +1 -0
  12. package/dist/{chunk-EWTHDEIW.js → chunk-WFTGZS24.js} +3 -3
  13. package/dist/chunk-WFTGZS24.js.map +1 -0
  14. package/dist/{chunk-H37YVYZA.cjs → chunk-ZA3NOSO2.cjs} +73 -5
  15. package/dist/chunk-ZA3NOSO2.cjs.map +1 -0
  16. package/dist/edge.cjs +93 -93
  17. package/dist/edge.d.cts +11 -8
  18. package/dist/edge.d.ts +11 -8
  19. package/dist/edge.js +4 -4
  20. package/dist/index.cjs +866 -475
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +69 -33
  23. package/dist/index.d.ts +69 -33
  24. package/dist/index.js +554 -171
  25. package/dist/index.js.map +1 -1
  26. package/dist/{receipt-q7ez8Zb2.d.cts → receipt-Dy77vCea.d.cts} +5 -4
  27. package/dist/{receipt-Cg9a5Seq.d.ts → receipt-DyUInpvF.d.ts} +5 -4
  28. package/dist/test-support.cjs +21 -21
  29. package/dist/test-support.d.cts +2 -2
  30. package/dist/test-support.d.ts +2 -2
  31. package/dist/test-support.js +2 -2
  32. package/dist/{types-BKgqzvnk.d.ts → types-CAvsjRKi.d.cts} +209 -12
  33. package/dist/{types-BKgqzvnk.d.cts → types-CAvsjRKi.d.ts} +209 -12
  34. package/package.json +1 -1
  35. package/dist/chunk-22FJ4JQO.cjs.map +0 -1
  36. package/dist/chunk-6LEXYQ7J.cjs.map +0 -1
  37. package/dist/chunk-EWTHDEIW.js.map +0 -1
  38. package/dist/chunk-H37YVYZA.cjs.map +0 -1
  39. package/dist/chunk-MLUWABVT.js.map +0 -1
  40. package/dist/chunk-TD2PHUYP.js.map +0 -1
@@ -14,9 +14,14 @@
14
14
  * it is a string check. A public host name whose DNS ANSWER points at
15
15
  * private space is NOT blocked here — that needs the resolution-time
16
16
  * checks parked in #3742–#3744 (owner-accepted residual, 2026-10-07).
17
- * - Without `merchantEgress`, NOTHING in the SDK changes: no `redirect:
18
- * 'manual'`, no body capping, no extra refusals. SDK, local-MCP and
19
- * embedder callers keep today's behaviour byte for byte.
17
+ * - Without `merchantEgress` there is no URL check, no body capping and no
18
+ * per-use budget. Redirects are still followed by the transport (#4257),
19
+ * under the platform's rules (20 hops, the Fetch spec's method/body
20
+ * rewrite), plus the one rule both paths share: a hop to another origin
21
+ * carries only the cross-origin header allow-list. A paid request (the
22
+ * delivery, or a body with an x402 payment in `_meta`) is never re-sent
23
+ * to another origin by a redirect that keeps the body (307/308, or 301/302
24
+ * on a method other than POST); any other request follows as before.
20
25
  * - The policy is network policy, not spend control. It never gates a
21
26
  * payment's authority — the on-chain allowance stays the real control
22
27
  * (CASP: off-chain policy is never the spend control).
@@ -48,7 +53,10 @@ interface MerchantEgressPolicy {
48
53
  /**
49
54
  * How many GET redirects may be followed; EVERY hop is re-asserted against
50
55
  * `assertUrl` before it connects. A redirect on any other method is
51
- * refused outright. `undefined` = no redirect following.
56
+ * refused outright. A hop to a different origin carries only the
57
+ * transport's cross-origin header allow-list (#4244): credentials and other
58
+ * caller headers stay with the origin they were sent to.
59
+ * `undefined` = no redirect following.
52
60
  */
53
61
  maxGetRedirects?: number;
54
62
  /** Per-use timeouts (ms). The effective deadline is `min(this, merchantTimeout)`. */
@@ -59,7 +67,14 @@ interface MerchantEgressPolicy {
59
67
  */
60
68
  responseByteCaps?: Partial<Record<MerchantEgressUse, number>>;
61
69
  }
62
- type MerchantEgressRefusalReason = 'url_not_allowed' | 'redirect_on_non_get' | 'redirect_missing_location' | 'redirect_invalid_location' | 'redirect_budget_exceeded';
70
+ type MerchantEgressRefusalReason = 'url_not_allowed' | 'redirect_on_non_get' | 'redirect_missing_location' | 'redirect_invalid_location' | 'redirect_budget_exceeded'
71
+ /**
72
+ * #4257: a redirect that keeps the body (307/308, or 301/302 on a method
73
+ * other than POST) would re-send it to another origin. Under a
74
+ * policy (GET only) this is unreachable; without one it fires for a paid
75
+ * delivery, or a body carrying an x402 payment in `_meta`.
76
+ */
77
+ | 'redirect_cross_origin_body';
63
78
  declare const MERCHANT_EGRESS_REFUSED_CODE = "MERCHANT_EGRESS_REFUSED";
64
79
  /**
65
80
  * The policy refused a merchant request. `beforeRequest` is true when the
@@ -73,7 +88,27 @@ declare class MerchantEgressRefusedError extends HavenError {
73
88
  readonly url: string;
74
89
  readonly refusal: MerchantEgressRefusalReason;
75
90
  readonly beforeRequest: boolean;
76
- constructor(message: string, url: string, refusal: MerchantEgressRefusalReason, beforeRequest: boolean);
91
+ /** #4257: the redirect status that was not followed, when a redirect was refused. */
92
+ readonly redirectStatus?: number;
93
+ /**
94
+ * #4257: set only when `url` IS the redirect target (a cross-origin body
95
+ * re-send, a spent hop budget, a hop `assertUrl` refused). A refusal that
96
+ * stopped at the answering URL itself (a non-GET redirect, a missing or
97
+ * unresolvable Location) leaves it unset, and `url` is that answering URL.
98
+ */
99
+ readonly redirectTarget?: string;
100
+ /**
101
+ * #4257: set when the refusal interrupted a PAID delivery and the local
102
+ * completion has re-thrown it with the payment it belongs to — the funded,
103
+ * undelivered state, never "nothing happened".
104
+ */
105
+ readonly settlementScheme?: 'eip3009' | 'erc7710';
106
+ constructor(message: string, url: string, refusal: MerchantEgressRefusalReason, beforeRequest: boolean, extra?: {
107
+ redirectStatus?: number;
108
+ redirectTarget?: string;
109
+ paymentId?: string;
110
+ settlementScheme?: 'eip3009' | 'erc7710';
111
+ });
77
112
  }
78
113
  declare const MERCHANT_EGRESS_RESPONSE_CAP_CODE = "MERCHANT_EGRESS_RESPONSE_CAP";
79
114
  /**
@@ -752,6 +787,14 @@ interface HavenAllowance {
752
787
  * compared alone — they do not add up. Never a balance figure.
753
788
  */
754
789
  fundsCoverRemaining: boolean | null;
790
+ /**
791
+ * #4355: when THIS budget next refills — the end of its current period
792
+ * (ISO 8601), or its start for a budget not yet started. `null` when it
793
+ * never refills again (it ends first), and on a backend that predates the
794
+ * field. With a remaining of 0 it says the budget is spent for this period
795
+ * and when it comes back — not that nobody approved one.
796
+ */
797
+ nextRefillAt: string | null;
755
798
  /**
756
799
  * #3518: this budget's SCOPE, so an agent holding more than one budget
757
800
  * for a token can name the merchant-locked one before paying. The
@@ -806,6 +849,14 @@ interface HavenAllowanceSummary {
806
849
  delegateAddress: string;
807
850
  chainId: number;
808
851
  allowances: HavenAllowance[];
852
+ /**
853
+ * #4352 (additive, decision 5): when the agent's only budgets for this
854
+ * chain have ENDED, the latest ended budget's expiry (ISO 8601) — read by
855
+ * the same narrow expired-row query the refusal answers use. `null` when no
856
+ * expired row exists; the field NEVER reports a live budget. `null` on a
857
+ * backend that predates the field.
858
+ */
859
+ budgetEndedAt: string | null;
809
860
  /** #3772: see {@link HavenAgent.supersededBy}. */
810
861
  supersededBy: HavenAgentSupersession | null;
811
862
  }
@@ -1005,6 +1056,8 @@ interface HavenAgentAllowanceSummary {
1005
1056
  * read: any non-boolean wire value maps to `null`, never `undefined`.
1006
1057
  */
1007
1058
  fundsCoverRemaining: boolean | null;
1059
+ /** #4355: the {@link HavenAllowance.nextRefillAt} projection. */
1060
+ nextRefillAt: string | null;
1008
1061
  }
1009
1062
  /**
1010
1063
  * One-shot "am I ready?" bootstrap: identity + live spend authority + a
@@ -1028,6 +1081,27 @@ interface HavenAgentSummary extends HavenAgent {
1028
1081
  * renders from `HAVEN_CONNECTOR_CHANNEL` — see `connector-channel.ts`).
1029
1082
  */
1030
1083
  spend_authority_readiness: HavenAgentReadiness;
1084
+ /**
1085
+ * #4355 (additive; the readiness values are unchanged — #4349 decision 5):
1086
+ * set only when readiness is `needs_approval` BECAUSE every live budget is
1087
+ * spent for its period — `allowances[]` has rows, all at remaining 0. It is
1088
+ * the earliest {@link HavenAgentAllowanceSummary.nextRefillAt} among them:
1089
+ * wait until then, or ask the owner to raise the budget. `null` otherwise:
1090
+ * ready, revoked, no budget approved (`allowances[]` empty), or a spent
1091
+ * budget that ends before it would refill.
1092
+ */
1093
+ budgetRefillsAt: string | null;
1094
+ /**
1095
+ * #4352 (additive; the readiness values are unchanged — #4349 decision 5):
1096
+ * set only when readiness is `needs_approval` BECAUSE the agent's only
1097
+ * budget(s) have ENDED — `allowances[]` is empty and the server's
1098
+ * expired-row read found one. The ended budget's expiry (ISO 8601): waiting
1099
+ * will not help; ask the owner to set a new one. `null` otherwise — ready,
1100
+ * revoked, no budget approved at all, live rows present (whether spendable
1101
+ * or all spent — the latter is {@link HavenAgentSummary.budgetRefillsAt}'s
1102
+ * case), or a backend that predates the field.
1103
+ */
1104
+ budgetEndedAt: string | null;
1031
1105
  allowances: HavenAgentAllowanceSummary[];
1032
1106
  /**
1033
1107
  * #3329: open, unexpired task budgets — a derived VIEW, same discipline as
@@ -1107,9 +1181,9 @@ interface HavenSubBudgetCloseSignData {
1107
1181
  /** #3506: `POST /sub-budgets/:id/close`. */
1108
1182
  interface CloseSubBudgetResult {
1109
1183
  subBudget: HavenSubBudget;
1110
- /** `closed` on a trivial close (never signed, or already expired); absent when a close signature is pending. */
1184
+ /** `closed` on a trivial close (never signed, or `open` and already expired) or when the chain already shows it disabled; absent when a close signature is pending. */
1111
1185
  status?: 'closed';
1112
- /** Present only when the close needed a signature (a live child). */
1186
+ /** Present only when the close needed a signature (a live child, or any `closing` row — #3923). */
1113
1187
  signData?: HavenSubBudgetCloseSignData;
1114
1188
  nextAction?: string;
1115
1189
  }
@@ -1145,6 +1219,8 @@ interface HavenTaskBudget {
1145
1219
  status: HavenTaskBudgetStatus;
1146
1220
  expiresAt: number;
1147
1221
  isExpired: boolean;
1222
+ /** #3922: camelCase `is_live`; absent when the backend predates it (presence preserved). */
1223
+ isLive?: boolean;
1148
1224
  createdAt: string;
1149
1225
  openedAt: string | null;
1150
1226
  closedAt: string | null;
@@ -1352,6 +1428,23 @@ interface HavenPaymentReceipt {
1352
1428
  paymentId: string;
1353
1429
  paymentIntentId?: string | null;
1354
1430
  approvalRequestId?: string | null;
1431
+ /**
1432
+ * #4469: which settlement branch moved the money (`eip3009` | `erc7710`),
1433
+ * from the intent (#946). The receipts wire declares this as raw text with
1434
+ * no enum (`packages/backend/src/openapi/spec.ts`), so it is typed
1435
+ * `string | null` here rather than narrowed: a value this SDK does not know
1436
+ * is still the backend's record, and narrowing it to `null` would erase it.
1437
+ * Absent on an older backend; `null` when the backend states no scheme
1438
+ * (legacy-rail receipts).
1439
+ */
1440
+ settlementScheme?: string | null;
1441
+ /**
1442
+ * #4469: the budget delegation that METERED this payment (#3518), uniform
1443
+ * across schemes. `string | null` on receipts — the backend sends
1444
+ * `?? null` — unlike {@link PaymentStatusResult.budgetDelegationHash}, which
1445
+ * is `string` and absent when unknown. Absent on an older backend.
1446
+ */
1447
+ budgetDelegationHash?: string | null;
1355
1448
  /**
1356
1449
  * #3134: the payment protocol this receipt settled on — one of the
1357
1450
  * evidence-eligible rails (`x402`, `mpp_demo`, `mpp_crypto`, `spt`) — under the
@@ -1427,6 +1520,23 @@ interface HavenPaymentReceipt {
1427
1520
  */
1428
1521
  protocolReceiptPayload?: Record<string, unknown> | null;
1429
1522
  merchantStatus: number | null;
1523
+ /**
1524
+ * #4469: the paying agent's own delivery verdict (#3770), when it reported
1525
+ * one — `ok` | `unusable` | `partial`. Evidence only: it never gates
1526
+ * anything and the payment itself is unchanged. Absent on an older backend;
1527
+ * `null` when the backend states "not reported".
1528
+ */
1529
+ deliveryQuality?: 'ok' | 'unusable' | 'partial' | null;
1530
+ /** #4469: the agent's optional note (max 2000 chars) saying what was wrong. Absent on an older backend. */
1531
+ deliveryNote?: string | null;
1532
+ /** #4469: when the agent reported the verdict (ISO 8601). Absent on an older backend. */
1533
+ deliveryReportedAt?: string | null;
1534
+ /**
1535
+ * #4469: the NON-SECRET pointer to a delivered good (#3778) — merchant,
1536
+ * product, value, order id. Never a redemption code or other credential:
1537
+ * those are refused at write. Absent on an older backend.
1538
+ */
1539
+ deliveryReference?: string | null;
1430
1540
  confirmedAt: string | null;
1431
1541
  createdAt: string;
1432
1542
  updatedAt: string;
@@ -1793,6 +1903,34 @@ declare const AgentPaymentWarningCode: {
1793
1903
  * settlement can no longer land at all.
1794
1904
  */
1795
1905
  readonly SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED";
1906
+ /**
1907
+ * #3967: the quote-time budget pre-check decided the quoted amount does NOT
1908
+ * fit the agent's remaining delegation budget — the same server-side compare
1909
+ * the payment path runs before funding. Travels beside
1910
+ * `budget_check.sufficient: false` and, on `haven_quote_x402`,
1911
+ * `safe_to_continue: false` with no prefilled cap. The on-chain policy
1912
+ * remains the actual gate either way.
1913
+ */
1914
+ readonly QuoteExceedsRemainingBudget: "QUOTE_EXCEEDS_REMAINING_BUDGET";
1915
+ /**
1916
+ * #4458: the agent's only budget for the token has ENDED — the quote-time
1917
+ * pre-check answered the typed 403 `delegation_expired`, not an over-budget
1918
+ * compare. Travels beside `budget_check.sufficient: false` and, on
1919
+ * `haven_quote_x402`, `safe_to_continue: false` with no prefilled cap. The
1920
+ * remedy is the owner setting a NEW budget: waiting for a period to reset
1921
+ * cannot help, which is why this is its own code rather than
1922
+ * {@link AgentPaymentWarningCode.QuoteExceedsRemainingBudget}. Additive: an
1923
+ * older backend never emits it, and the on-chain policy remains the actual
1924
+ * gate either way.
1925
+ */
1926
+ readonly QuoteBudgetEnded: "QUOTE_BUDGET_ENDED";
1927
+ /**
1928
+ * #3967: the MERCHANT reported a denial on one of its x402 payment options —
1929
+ * a known denial key (starting with `issuanceDenied`) in `accepts[].extra`.
1930
+ * Strictly informational: it flips neither `safe_to_continue` nor
1931
+ * `expected_settleable`; the agent should surface it to the user.
1932
+ */
1933
+ readonly MerchantReportedDenial: "MERCHANT_REPORTED_DENIAL";
1796
1934
  };
1797
1935
  type AgentPaymentWarningCode = (typeof AgentPaymentWarningCode)[keyof typeof AgentPaymentWarningCode];
1798
1936
  interface AgentPaymentWarning {
@@ -2053,9 +2191,11 @@ interface HavenCatalogEntry {
2053
2191
  * (the operator vouches for the listing; the catalog refresh probe still
2054
2192
  * checks the endpoint, see `verifiedPayable`). `ingestion` = submitted
2055
2193
  * through the Verified Payable Directory and passed domain-ownership proof
2056
- * plus the read-only quote probe.
2194
+ * plus the read-only quote probe. `bazaar` = written by the x402 Bazaar
2195
+ * discovery cron (#4245): seller-chosen name and description, no operator
2196
+ * review, no ownership proof.
2057
2197
  */
2058
- source: 'operator' | 'ingestion';
2198
+ source: 'operator' | 'ingestion' | 'bazaar';
2059
2199
  /** True only for `ingestion` entries — the one ownership claim. See the epic's trust claim (never merchant honesty or quality). */
2060
2200
  domainVerified: boolean;
2061
2201
  /**
@@ -2117,9 +2257,66 @@ declare class HavenError extends Error {
2117
2257
  readonly paymentId?: string | undefined;
2118
2258
  constructor(message: string, code: string, statusCode?: number | undefined, paymentId?: string | undefined);
2119
2259
  }
2260
+ /**
2261
+ * #4470: why a `HavenApiError` happened, where its status alone cannot say.
2262
+ *
2263
+ * - `no_answer` — the transport got no usable answer: the request timed out
2264
+ * (status 408), `fetch` threw, or the body was not JSON (status 0). Whether
2265
+ * the call took effect is unknown, so a `GET` may be retried and a `POST`
2266
+ * must not be; `method` says which it was.
2267
+ * - `deterministic` — the SDK refused an answer it cannot use (a missing
2268
+ * field, the wrong shape). Repeating the same call gets the same answer,
2269
+ * whatever the status says.
2270
+ *
2271
+ * Absent on every other error, which keeps the status rule. A readonly field
2272
+ * rather than a subclass, so `name`, `code` and `statusCode` stay what
2273
+ * consumers already match on.
2274
+ */
2275
+ type HavenApiFailureCause = {
2276
+ readonly kind: 'no_answer';
2277
+ readonly method: 'GET' | 'POST';
2278
+ } | {
2279
+ readonly kind: 'deterministic';
2280
+ };
2120
2281
  declare class HavenApiError extends HavenError {
2121
2282
  readonly body?: unknown | undefined;
2122
- constructor(message: string, statusCode: number, body?: unknown | undefined, paymentId?: string);
2283
+ readonly failureCause?: HavenApiFailureCause | undefined;
2284
+ constructor(message: string, statusCode: number, body?: unknown | undefined, paymentId?: string, failureCause?: HavenApiFailureCause | undefined);
2285
+ /**
2286
+ * #4470: an error a retry cannot change. The census in
2287
+ * `haven-api-error-census.test.ts` requires every literal 5xx site to use
2288
+ * this or be allowlisted there with a reason.
2289
+ */
2290
+ static deterministic(message: string, statusCode: number, body?: unknown, paymentId?: string): HavenApiError;
2291
+ }
2292
+ /**
2293
+ * #4470: the funding transaction's confirmation could not be read — ethers'
2294
+ * `waitForTransaction` rejected (its `TIMEOUT`, or an RPC failure). Haven had
2295
+ * already submitted the funding leg, so funds may have reached the delegate:
2296
+ * the answer is check-status, never "tell the user it failed" and never a new
2297
+ * payment. The merchant was not called.
2298
+ *
2299
+ * Deliberately carries no `failureCause`: it is not a transport non-answer
2300
+ * (no Haven request went unanswered) and not deterministic (a later read may
2301
+ * see the receipt). Callers answer the class itself — the hosted delivery
2302
+ * step does in `ensureFundingConfirmedOrRefuse`; unwrapped, its 504 reads
2303
+ * "re-call once", which re-runs the same wait.
2304
+ */
2305
+ declare class FundingConfirmationUnknownError extends HavenApiError {
2306
+ readonly txHash: string;
2307
+ readonly chainId: number;
2308
+ readonly fundingErrorCode: "funding_confirmation_unknown";
2309
+ constructor(txHash: string, chainId: number, reason: string);
2310
+ }
2311
+ /**
2312
+ * #4470: the funding transaction was mined and reverted, so nothing reached
2313
+ * the delegate. Repeating the wait gets the same receipt.
2314
+ */
2315
+ declare class FundingRevertedError extends HavenApiError {
2316
+ readonly txHash: string;
2317
+ readonly chainId: number;
2318
+ readonly fundingErrorCode: "funding_reverted";
2319
+ constructor(txHash: string, chainId: number);
2123
2320
  }
2124
2321
  /**
2125
2322
  * #1300: quoteX402 hit a URL that answered something other than 402 — the
@@ -2325,4 +2522,4 @@ declare class HavenTimeoutError extends HavenError {
2325
2522
  constructor(paymentId: string);
2326
2523
  }
2327
2524
 
2328
- export { AgentPaymentNextActionSchema as $, type AgentPaymentWarning as A, type BudgetPrecheckResult as B, type CloseTaskBudgetResult as C, type X402ResumeState as D, type X402McpTransport as E, type X402MerchantCallContext as F, type X402IntentByKey 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, type MerchantEgressPolicy as M, AGENT_PAYMENT_RAIL_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentNextStep as Q, type ResumeAuthorizedX402Input as R, type SweepResult as S, type TaskBudgetSignContext as T, type AgentPaymentEnumSchema as U, AgentPaymentFailureCode as V, AgentPaymentFailureCodeDescriptions as W, type X402PaymentRequired as X, AgentPaymentFailureCodeSchema as Y, AgentPaymentNextAction as Z, AgentPaymentNextActionDescriptions as _, type PaymentResult as a, AgentPaymentPhase as a0, AgentPaymentPhaseDescriptions as a1, AgentPaymentPhaseSchema as a2, AgentPaymentRail as a3, AgentPaymentRailDescriptions as a4, AgentPaymentRailSchema as a5, type AgentPaymentSummary as a6, AgentPaymentWarningCode as a7, type AgentPurchaseSummary as a8, type CatalogSubmissionAccepted as a9, type PaymentFee as aA, type PaymentNextAction as aB, type PaymentPhase as aC, type PaymentStatus as aD, SIGNER_UPDATE_FALLBACK as aE, SignerRefusalCode as aF, type SweepConfirmation as aG, type SweepEntry as aH, X402AlreadySettledError as aI, X402Erc7710AlreadySettledError as aJ, type X402ExpectedAuth as aK, type X402ExpectedContext as aL, type X402PaymentOption as aM, type X402RequestSnapshot as aN, X402TaskBudgetMismatchError as aO, X402UnexpectedStatusError as aP, assertPublicHttpsMerchantUrl as aQ, isPublicHttpsMerchantUrl as aR, publicHttpsMerchantUrlRefusal as aS, readBodyCapped as aT, signerUpdateFallback as aU, strictMerchantEgressPolicy as aV, type RawPaymentParties as aW, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, HOSTED_DISCOVERY_TIMEOUT_MS as ab, HOSTED_EGRESS_TIMEOUTS as ac, HOSTED_MAX_GET_REDIRECTS as ad, HOSTED_RESPONSE_BYTE_CAPS as ae, type HavenAgentAllowanceSummary as af, type HavenAgentReadiness as ag, type HavenAgentSupersession as ah, type HavenAllowance as ai, HavenApiError as aj, type HavenCatalogMerchant as ak, type HavenListScope as al, HavenPaymentStateError as am, HavenSigningError as an, HavenTimeoutError as ao, HavenUnsupportedSignerVersionError as ap, HavenZeroSettlementHashError as aq, MERCHANT_EGRESS_REFUSED_CODE as ar, MERCHANT_EGRESS_RESPONSE_CAP_CODE as as, type MachinePaymentRail as at, type MerchantEgressRefusalReason as au, MerchantEgressRefusedError as av, MerchantEgressResponseCapError as aw, type MerchantEgressTimeouts as ax, type MerchantEgressUse as ay, MerchantTimeoutError as az, type PaymentIntent as b, type X402AuthorizationOptions as c, type X402Intent as d, type PaymentStatusResult as e, type HavenAgent as f, type HavenAgentSummary as g, type HavenAllowanceSummary as h, type HavenBalanceCoverage as i, type PostPurchaseAllowanceSummary as j, type HavenCatalogEntry as k, type HavenCatalogSubmission as l, type HavenPaymentReceipt as m, type HavenPaymentReceiptsPage as n, type HavenTaskBudget as o, type SubmitTaskBudgetResult as p, type SubmitSubBudgetResult as q, type HavenPendingSubBudgetSignature as r, type CloseSubBudgetResult as s, type PaymentResumeState as t, type X402Receipt as u, type X402Quote as v, type X402Erc7710Settlement as w, type X402McpCallContext as x, type SignData as y, type ResumeX402PaymentInput as z };
2525
+ export { AgentPaymentNextActionSchema as $, type AgentPaymentWarning as A, type BudgetPrecheckResult as B, type CloseTaskBudgetResult as C, type X402ResumeState as D, type X402McpTransport as E, type X402MerchantCallContext as F, type X402IntentByKey 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, type MerchantEgressPolicy as M, AGENT_PAYMENT_RAIL_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, type AgentNextStep as Q, type ResumeAuthorizedX402Input as R, type SweepResult as S, type TaskBudgetSignContext as T, type AgentPaymentEnumSchema as U, AgentPaymentFailureCode as V, AgentPaymentFailureCodeDescriptions as W, type X402PaymentRequired as X, AgentPaymentFailureCodeSchema as Y, AgentPaymentNextAction as Z, AgentPaymentNextActionDescriptions as _, type PaymentResult as a, AgentPaymentPhase as a0, AgentPaymentPhaseDescriptions as a1, AgentPaymentPhaseSchema as a2, AgentPaymentRail as a3, AgentPaymentRailDescriptions as a4, AgentPaymentRailSchema as a5, type AgentPaymentSummary as a6, AgentPaymentWarningCode as a7, type AgentPurchaseSummary as a8, type CatalogSubmissionAccepted as a9, type MerchantEgressTimeouts as aA, type MerchantEgressUse as aB, MerchantTimeoutError as aC, type PaymentFee as aD, type PaymentNextAction as aE, type PaymentPhase as aF, type PaymentStatus as aG, SIGNER_UPDATE_FALLBACK as aH, SignerRefusalCode as aI, type SweepConfirmation as aJ, type SweepEntry as aK, X402AlreadySettledError as aL, X402Erc7710AlreadySettledError as aM, type X402ExpectedAuth as aN, type X402ExpectedContext as aO, type X402PaymentOption as aP, type X402RequestSnapshot as aQ, X402TaskBudgetMismatchError as aR, X402UnexpectedStatusError as aS, assertPublicHttpsMerchantUrl as aT, isPublicHttpsMerchantUrl as aU, publicHttpsMerchantUrlRefusal as aV, readBodyCapped as aW, signerUpdateFallback as aX, strictMerchantEgressPolicy as aY, type RawPaymentParties as aZ, DEFAULT_CONFIRMATION_TIMEOUT_MS as aa, FundingConfirmationUnknownError as ab, FundingRevertedError as ac, HOSTED_DISCOVERY_TIMEOUT_MS as ad, HOSTED_EGRESS_TIMEOUTS as ae, HOSTED_MAX_GET_REDIRECTS as af, HOSTED_RESPONSE_BYTE_CAPS as ag, type HavenAgentAllowanceSummary as ah, type HavenAgentReadiness as ai, type HavenAgentSupersession as aj, type HavenAllowance as ak, HavenApiError as al, type HavenApiFailureCause as am, type HavenCatalogMerchant as an, type HavenListScope as ao, HavenPaymentStateError as ap, HavenSigningError as aq, HavenTimeoutError as ar, HavenUnsupportedSignerVersionError as as, HavenZeroSettlementHashError as at, MERCHANT_EGRESS_REFUSED_CODE as au, MERCHANT_EGRESS_RESPONSE_CAP_CODE as av, type MachinePaymentRail as aw, type MerchantEgressRefusalReason as ax, MerchantEgressRefusedError as ay, MerchantEgressResponseCapError as az, type PaymentIntent as b, type X402AuthorizationOptions as c, type X402Intent as d, type PaymentStatusResult as e, type HavenAgent as f, type HavenAgentSummary as g, type HavenAllowanceSummary as h, type HavenBalanceCoverage as i, type PostPurchaseAllowanceSummary as j, type HavenCatalogEntry as k, type HavenCatalogSubmission as l, type HavenPaymentReceipt as m, type HavenPaymentReceiptsPage as n, type HavenTaskBudget as o, type SubmitTaskBudgetResult as p, type SubmitSubBudgetResult as q, type HavenPendingSubBudgetSignature as r, type CloseSubBudgetResult as s, type PaymentResumeState as t, type X402Receipt as u, type X402Quote as v, type X402Erc7710Settlement as w, type X402McpCallContext as x, type SignData as y, type ResumeX402PaymentInput as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven_ai/sdk",
3
- "version": "0.10.0-alpha.0",
3
+ "version": "0.12.0-alpha.0",
4
4
  "description": "TypeScript SDK for Haven — give AI agents budgeted, non-custodial payment ability. Pay x402 (HTTP 402) APIs in USDC within on-chain-enforced spending limits; the agent never holds funds or keys.",
5
5
  "engines": {
6
6
  "node": ">=22"