@haven_ai/sdk 0.1.37-alpha.0 → 0.2.1-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.
package/dist/index.js CHANGED
@@ -108,9 +108,14 @@ var AgentPaymentNextAction = {
108
108
  */
109
109
  PaymentWindowExpired: "payment_window_expired",
110
110
  /**
111
- * Stop and tell the user that the originating Safe needs to be funded or
111
+ * Stop and tell the user that the originating account needs to be funded or
112
112
  * the agent's per-token allowance needs to be raised before the payment
113
113
  * can succeed. A user approval will not fix this state on its own.
114
+ *
115
+ * #2908: the wire twin `fund_account_or_raise_allowance`
116
+ * ({@link AgentPaymentNextActionAccountAlias}) means the same thing; the
117
+ * server keeps emitting THIS value until #2914. Compare via
118
+ * {@link canonicalAgentPaymentNextAction}.
114
119
  */
115
120
  FundSafeOrRaiseAllowance: "fund_safe_or_raise_allowance",
116
121
  /**
@@ -118,19 +123,53 @@ var AgentPaymentNextAction = {
118
123
  * settled to the merchant. The wallet owner should initiate a sweep to
119
124
  * return those funds to the originating Safe.
120
125
  */
121
- SweepStrandedFunds: "sweep_stranded_funds"
126
+ SweepStrandedFunds: "sweep_stranded_funds",
127
+ /**
128
+ * #2970: a `submitted` erc7710 x402 intent whose settlement window has
129
+ * passed with no on-chain settlement evidence Haven could verify. Distinct
130
+ * from {@link CheckStatusLater}, which this REPLACES once the window is
131
+ * past — but it is not futile: Haven's settlement sweep (120s tick) scans
132
+ * each candidate over its own window plus a 120s clock-skew allowance, so
133
+ * it can still attribute the settlement for a short while after this value
134
+ * first appears. Poll {@link CheckStatusLater}'s tool
135
+ * (`haven_get_payment_status`) once more, roughly two minutes later; if it
136
+ * still shows no evidence, tell the user the goods were delivered but
137
+ * Haven holds no verified settlement evidence for this payment. If the
138
+ * agent holds the merchant's real settlement transaction hash (from
139
+ * `PAYMENT-RESPONSE`'s `transaction` field, or a prior settle/complete
140
+ * result's `settlement_tx_hash`), report it with the hosted
141
+ * `haven_report_settlement_evidence` tool instead of waiting —
142
+ * `haven_report_x402_outcome` takes no hash and refuses a non-`confirmed`
143
+ * intent.
144
+ */
145
+ AwaitingSettlementEvidence: "awaiting_settlement_evidence"
122
146
  };
147
+ var AgentPaymentNextActionAccountAlias = {
148
+ /** Account-vocabulary twin of `fund_safe_or_raise_allowance`; same meaning. */
149
+ FundAccountOrRaiseAllowance: "fund_account_or_raise_allowance"
150
+ };
151
+ function canonicalAgentPaymentNextAction(value) {
152
+ if (value === AgentPaymentNextActionAccountAlias.FundAccountOrRaiseAllowance) {
153
+ return AgentPaymentNextAction.FundSafeOrRaiseAllowance;
154
+ }
155
+ return value;
156
+ }
157
+ function isFundAccountOrRaiseAllowance(value) {
158
+ return value === AgentPaymentNextAction.FundSafeOrRaiseAllowance || value === AgentPaymentNextActionAccountAlias.FundAccountOrRaiseAllowance;
159
+ }
123
160
  var AgentPaymentFailureCode = {
124
161
  /** A merchant-authoritative x402 price exceeds the caller's pre-funding max_amount cap. */
125
162
  PriceExceedsMax: "PRICE_EXCEEDS_MAX",
126
163
  /** The x402 funding/quote window expired before the signer or hosted settle step could finish. */
127
164
  PaymentWindowExpired: "PAYMENT_WINDOW_EXPIRED",
128
- /** The Haven funding leg succeeded, but the merchant rejected the paid retry. */
165
+ /** The merchant rejected the paid retry. On eip3009 the funding leg had succeeded (sweep);
166
+ * on erc7710 there is no funding leg — nothing to sweep, follow the message (#2983). */
129
167
  MerchantRejectedAfterFunding: "MERCHANT_REJECTED_AFTER_FUNDING",
130
168
  /** #1300 review: funding is on-chain but the merchant never ANSWERED the
131
169
  * paid retry within the timeout. NOT proof of rejection — the merchant
132
- * holds a valid EIP-3009 authorization and may still settle late, so the
133
- * guidance is verify-then-sweep, never blind sweep. */
170
+ * may still settle late, so the guidance is verify-then-act. On eip3009
171
+ * the funding leg had succeeded (verify-then-sweep); on erc7710 there is
172
+ * no funding leg — nothing to sweep, follow the message (#3000). */
134
173
  MerchantUnresponsiveAfterFunding: "MERCHANT_UNRESPONSIVE_AFTER_FUNDING",
135
174
  /**
136
175
  * #1307: the caller omitted merchant_url/tool_name (asking Haven to
@@ -156,7 +195,17 @@ var AgentPaymentFailureCode = {
156
195
  * asset can represent (truncating it would silently change the user's cap).
157
196
  * The fallback is the exact atomic `max_amount`.
158
197
  */
159
- MaxAmountUnconvertible: "MAX_AMOUNT_UNCONVERTIBLE"
198
+ MaxAmountUnconvertible: "MAX_AMOUNT_UNCONVERTIBLE",
199
+ /**
200
+ * #2979: the merchant answered a `tools/call` probe with its own
201
+ * machine-readable "cannot settle right now" refusal (HTTP 503,
202
+ * `{ error: 'merchant_not_ready', reason_code, ... }`) instead of a 402
203
+ * challenge — e.g. its settlement wallet is out of gas. No 402 was ever
204
+ * issued and no payment was created; this is honest and (per
205
+ * `retry_after_s`, when present) usually transient, unlike a permanent
206
+ * endpoint miss.
207
+ */
208
+ MerchantNotReady: "MERCHANT_NOT_READY"
160
209
  };
161
210
  var AgentPaymentRail = {
162
211
  /** Standard Haven payment from the user's Safe through an approved delegate allowance. */
@@ -204,16 +253,18 @@ var AgentPaymentNextActionDescriptions = {
204
253
  [AgentPaymentNextAction.PaymentWindowExpired]: "The x402 funding/quote window expired. Re-quote with the same idempotency key before asking the signer to build a merchant payment header again.",
205
254
  [AgentPaymentNextAction.FundSafeOrRaiseAllowance]: "Stop and tell the user that the account needs to be funded or the agent budget raised before the payment can succeed.",
206
255
  [AgentPaymentNextAction.RetryWithExplicitContext]: "Retry the same tool call, this time passing merchant_url, tool_name, arguments, and mcp_transport explicitly \u2014 the server had no stored context to rehydrate for this payment id.",
207
- [AgentPaymentNextAction.SweepStrandedFunds]: "Tell the user that funds may be stranded in the delegate wallet and prompt them to initiate a sweep in Haven to return them to the originating account."
256
+ [AgentPaymentNextAction.SweepStrandedFunds]: "Tell the user that funds may be stranded in the delegate wallet and prompt them to initiate a sweep in Haven to return them to the originating account.",
257
+ [AgentPaymentNextAction.AwaitingSettlementEvidence]: "The settlement window passed with no verified on-chain evidence yet. If you hold the merchant's real settlement transaction hash, report it with haven_report_settlement_evidence. Otherwise, Haven's settlement sweep may still attribute it within about two minutes \u2014 poll getPaymentStatus once more, then tell the user the goods were delivered but unverified if it still shows nothing."
208
258
  };
209
259
  var AgentPaymentFailureCodeDescriptions = {
210
260
  [AgentPaymentFailureCode.PriceExceedsMax]: "The merchant-authoritative x402 amount exceeds the caller's max_amount cap. No funding transfer was created; ask the user before retrying with a larger cap.",
211
261
  [AgentPaymentFailureCode.PaymentWindowExpired]: "The x402 funding/quote window expired before the signer or hosted settle step could finish. Re-quote via haven_pay_mcp_tool with the same idempotency key to avoid duplicate funding.",
212
- [AgentPaymentFailureCode.MerchantRejectedAfterFunding]: "The Haven funding leg succeeded, but the merchant rejected the paid retry. Stop retrying the merchant and reconcile stranded delegate funds with haven_sweep_delegate.",
213
- [AgentPaymentFailureCode.MerchantUnresponsiveAfterFunding]: "The Haven funding leg succeeded, but the merchant did not answer the paid retry before the timeout. The merchant may still settle late \u2014 check haven_get_payment_status (and retry haven_complete_mcp_tool once) BEFORE sweeping; sweep only if no settlement appears.",
262
+ [AgentPaymentFailureCode.MerchantRejectedAfterFunding]: "The merchant rejected the paid retry. eip3009: the funding leg succeeded \u2014 stop retrying the merchant and reconcile stranded delegate funds with haven_sweep_delegate. erc7710: no funding leg, nothing to sweep \u2014 follow the message (re-quote later, or check haven_get_payment_status after the window first).",
263
+ [AgentPaymentFailureCode.MerchantUnresponsiveAfterFunding]: "The merchant did not answer the paid retry before the timeout. The merchant may still settle late. eip3009: the funding leg succeeded \u2014 check haven_get_payment_status, retry haven_complete_mcp_tool once, sweep only if no settlement appears. erc7710: no funding leg, nothing to sweep, and haven_complete_mcp_tool has no erc7710 branch \u2014 do not retry it; check haven_get_payment_status after the payment window and re-quote only if it shows no settlement.",
214
264
  [AgentPaymentFailureCode.MerchantCallContextUnavailable]: "merchant_url/tool_name were omitted and no stored merchant call context is available for this payment_id. Re-send merchant_url, tool_name, arguments, and mcp_transport explicitly.",
215
265
  [AgentPaymentFailureCode.AmbiguousMaxAmount]: "Both max_amount (atomic units) and max_amount_human (whole tokens) were supplied for one purchase. Nothing was contacted and nothing was spent. Re-send with exactly ONE: max_amount_human for a cap the user stated in tokens, max_amount for an exact atomic figure.",
216
- [AgentPaymentFailureCode.MaxAmountUnconvertible]: "max_amount_human could not be converted to atomic units against this quote's asset \u2014 either its decimals are unknown to Haven or the cap has more decimal places than the asset supports. Nothing was spent. Round the cap, or re-send it as an exact atomic max_amount."
266
+ [AgentPaymentFailureCode.MaxAmountUnconvertible]: "max_amount_human could not be converted to atomic units against this quote's asset \u2014 either its decimals are unknown to Haven or the cap has more decimal places than the asset supports. Nothing was spent. Round the cap, or re-send it as an exact atomic max_amount.",
267
+ [AgentPaymentFailureCode.MerchantNotReady]: 'The merchant refused the probe with its own "cannot settle right now" signal instead of a 402 challenge. No payment was created. Often transient \u2014 retry later (see retry_after_s in the message, if given) rather than treating this as a broken or wrong endpoint.'
217
268
  };
218
269
  var AgentPaymentWarningCode = {
219
270
  /** No max_amount cap was supplied — the live quoted price was accepted as-is. */
@@ -244,7 +295,24 @@ var AgentPaymentWarningCode = {
244
295
  * on-chain policy re-checks at redemption either way; this only says the
245
296
  * guidance shown here may be optimistic.
246
297
  */
247
- AllowanceReadOptimistic: "ALLOWANCE_READ_OPTIMISTIC"
298
+ AllowanceReadOptimistic: "ALLOWANCE_READ_OPTIMISTIC",
299
+ /**
300
+ * #2991: the quote tools' `expected_settlement_scheme` prediction of what
301
+ * `haven_prepare_catalog_purchase` / `haven_pay_mcp_tool` will actually
302
+ * select could not be computed — the agent's execution rail could not be
303
+ * read from Haven, so `expected_settlement_scheme` is `null` rather than a
304
+ * guess. `accepted_scheme` (the merchant's offer) is unaffected.
305
+ */
306
+ X402SchemeUnknown: "X402_SCHEME_UNKNOWN",
307
+ /**
308
+ * #2968: the merchant answered 200 and handed over goods, but Haven holds NO
309
+ * on-chain evidence that the payment moved. `settled: false` beside this code
310
+ * is not a failure — it is the absence of proof, and the two must travel
311
+ * together so an agent can tell "the user has the goods" apart from "the
312
+ * money moved". Carries the intent's `expires_at`: after that instant the
313
+ * settlement can no longer land at all.
314
+ */
315
+ SettlementUnconfirmed: "SETTLEMENT_UNCONFIRMED"
248
316
  };
249
317
  var AgentPaymentRailDescriptions = {
250
318
  [AgentPaymentRail.Direct]: "Standard Haven payment from the user-controlled account, redeeming the agent's on-chain budget delegation.",
@@ -308,8 +376,18 @@ var MerchantTimeoutError = class extends HavenApiError {
308
376
  };
309
377
  var X402UnexpectedStatusError = class extends HavenApiError {
310
378
  x402ErrorCode = "unexpected_non_402_status";
311
- constructor(message, statusCode) {
312
- super(message, statusCode);
379
+ /**
380
+ * #2979: `body` is the merchant's own JSON, when the non-402 response
381
+ * carried one — e.g. the demo merchant's `/mcp` readiness gate answers
382
+ * `503 { error: 'merchant_not_ready', reason_code, ... }`. Optional and
383
+ * best-effort: a non-JSON or unreadable body leaves this `undefined`, same
384
+ * as before this field existed. Consumers key on it (not on the message
385
+ * string) to distinguish an honest, machine-readable merchant refusal from
386
+ * a genuine "this is not the x402 endpoint" miss, which otherwise look
387
+ * identical — both are just "some non-402 status".
388
+ */
389
+ constructor(message, statusCode, body) {
390
+ super(message, statusCode, body);
313
391
  this.name = "X402UnexpectedStatusError";
314
392
  }
315
393
  };
@@ -348,6 +426,17 @@ var HavenSigningError = class extends HavenError {
348
426
  this.name = "HavenSigningError";
349
427
  }
350
428
  };
429
+ var HavenZeroSettlementHashError = class extends HavenError {
430
+ constructor(paymentId) {
431
+ super(
432
+ "settlement_tx_hash is the zero hash (0x00\u202600), which is never a real settlement transaction \u2014 refused before any report was sent.",
433
+ "ZERO_SETTLEMENT_HASH",
434
+ 400,
435
+ paymentId
436
+ );
437
+ this.name = "HavenZeroSettlementHashError";
438
+ }
439
+ };
351
440
  var SignerRefusalCode = {
352
441
  /** `SUPPORTED_X402_EXPECTED_VERSIONS` in `@haven_ai/signer` does not include the received version. */
353
442
  UnsupportedExpectedContextVersion: "UNSUPPORTED_EXPECTED_CONTEXT_VERSION",
@@ -1096,6 +1185,15 @@ var HavenApiTransport = class {
1096
1185
  };
1097
1186
 
1098
1187
  // src/payment-mappers.ts
1188
+ function mapParties(raw) {
1189
+ if (!raw) return void 0;
1190
+ return {
1191
+ treasuryAccount: raw.treasury_account,
1192
+ delegate: raw.delegate,
1193
+ delegateAccount: raw.delegate_account,
1194
+ merchant: raw.merchant
1195
+ };
1196
+ }
1099
1197
  function mapPaymentResult(raw, buildExplorerUrl2) {
1100
1198
  return {
1101
1199
  paymentId: raw.payment_id,
@@ -1126,12 +1224,16 @@ function mapPaymentStatusResult(raw) {
1126
1224
  rail: raw.rail,
1127
1225
  status: raw.status,
1128
1226
  phase: raw.phase,
1129
- nextAction: raw.next_action,
1227
+ // #2908: the account-vocabulary alias collapses onto the canonical value
1228
+ // so every `=== AgentPaymentNextAction.X` downstream keeps working when
1229
+ // the server flips its emit at #2914.
1230
+ nextAction: canonicalAgentPaymentNextAction(raw.next_action),
1130
1231
  amount: raw.amount,
1131
1232
  token: raw.token,
1132
1233
  resourceUrl: raw.resource_url,
1133
1234
  merchantAddress: raw.merchant_address,
1134
1235
  payerAddress: raw.payer_address ?? null,
1236
+ parties: mapParties(raw.parties),
1135
1237
  txHash: raw.tx_hash,
1136
1238
  expiresAt: raw.expires_at,
1137
1239
  chainId: raw.chain_id,
@@ -1165,10 +1267,13 @@ function mapPaymentReceipt(raw) {
1165
1267
  rail: raw.rail,
1166
1268
  proofStatus: raw.proof_status,
1167
1269
  txHash: raw.tx_hash,
1270
+ fundingTxHash: raw.funding_tx_hash ?? null,
1271
+ settlementTxHash: raw.settlement_tx_hash ?? null,
1168
1272
  chainId: raw.chain_id,
1169
1273
  resourceUrl: raw.resource_url,
1170
1274
  merchantAddress: raw.merchant_address,
1171
1275
  payerAddress: raw.payer_address,
1276
+ parties: mapParties(raw.parties),
1172
1277
  settlementAddress: raw.settlement_address,
1173
1278
  tokenSymbol: raw.token_symbol,
1174
1279
  tokenAddress: raw.token_address,
@@ -1258,7 +1363,7 @@ function messageForState(label, status, paymentId, nextAction) {
1258
1363
  function paymentStateFromRaw(label, raw) {
1259
1364
  if (!raw.payment_id || !raw.status) return null;
1260
1365
  const phase = raw.phase ?? phaseForStatus(raw.status);
1261
- const nextAction = raw.next_action ?? nextActionForStatus(raw.status);
1366
+ const nextAction = canonicalAgentPaymentNextAction(raw.next_action) ?? nextActionForStatus(raw.status);
1262
1367
  if (!phase || !nextAction) return null;
1263
1368
  const amount = raw.amount ?? raw.requested ?? "";
1264
1369
  const token = raw.token ?? "";
@@ -1581,6 +1686,20 @@ function verifyPaymentReceipt(receipt, recover = defaultRecover) {
1581
1686
  return { verified: true, recoveredSigner: recovered };
1582
1687
  }
1583
1688
 
1689
+ // src/account-naming.ts
1690
+ function readAccountAddress(raw) {
1691
+ return raw.account_address ?? raw.safe_address ?? void 0;
1692
+ }
1693
+ function readAccountId(raw) {
1694
+ return raw.account_id ?? raw.safe_id ?? void 0;
1695
+ }
1696
+ function accountAddressTwins(address) {
1697
+ return { accountAddress: address, safeAddress: address };
1698
+ }
1699
+ function readX402ReceiptPayer(raw) {
1700
+ return raw.payer ?? raw.account_address ?? raw.sign_data?.components?.payer_account ?? raw.safe_address ?? raw.sign_data?.components?.safe;
1701
+ }
1702
+
1584
1703
  // src/account-reads.ts
1585
1704
  function safeBigInt(value) {
1586
1705
  try {
@@ -1639,7 +1758,10 @@ var AccountReads = class {
1639
1758
  const raw = await this.transport.get("/machine-payments/allowances");
1640
1759
  return {
1641
1760
  agentId: raw.agent_id,
1642
- safeAddress: raw.safe_address,
1761
+ // #2908: one mapper, both names, same value — `readAccountAddress`
1762
+ // prefers the server's `account_address` twin and falls back to
1763
+ // `safe_address` for a pre-#2907 server.
1764
+ ...accountAddressTwins(readAccountAddress(raw)),
1643
1765
  delegateAddress: raw.delegate_address,
1644
1766
  chainId: raw.chain_id,
1645
1767
  allowances: raw.allowances.map((allowance) => ({
@@ -1728,7 +1850,10 @@ var AccountReads = class {
1728
1850
  id: raw.id,
1729
1851
  name: raw.name,
1730
1852
  status: raw.status,
1731
- safeAddress: raw.safe_address,
1853
+ // #2908: both camelCase names off whichever snake_case name the server
1854
+ // sent (new first). The hosted MCP's `haven_get_agent` spreads this
1855
+ // object, so this is also the hosted output's dual-emit point.
1856
+ ...accountAddressTwins(readAccountAddress(raw)),
1732
1857
  delegateAddress: raw.delegate_address,
1733
1858
  chainId: raw.chain_id,
1734
1859
  executionRail: raw.execution_rail === "delegation" ? "delegation" : "legacy"
@@ -1778,7 +1903,7 @@ var DelegateSweepApi = class {
1778
1903
  const contract = createErc20Contract(sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
1779
1904
  const balance2 = await contract.balanceOf(agent.delegateAddress);
1780
1905
  if (balance2 > 0n) {
1781
- const tx = await contract.transfer(agent.safeAddress, balance2);
1906
+ const tx = await contract.transfer(agent.accountAddress, balance2);
1782
1907
  const { txHash, confirmation } = await waitForSweepTx(tx);
1783
1908
  transfers.push({ asset: "USDC", amount: format(balance2, 6), amountAtomic: balance2.toString(), txHash, explorerUrl: this.options.buildExplorerUrl(agent.chainId, txHash), confirmation });
1784
1909
  }
@@ -1788,12 +1913,12 @@ var DelegateSweepApi = class {
1788
1913
  const fee = await provider.getFeeData();
1789
1914
  const send = balance - (fee.maxFeePerGas ?? fee.gasPrice ?? 1000000n) * 21000n * 2n;
1790
1915
  if (send > 0n) {
1791
- const tx = await wallet.sendTransaction({ to: agent.safeAddress, value: send });
1916
+ const tx = await wallet.sendTransaction({ to: agent.accountAddress, value: send });
1792
1917
  const { txHash, confirmation } = await waitForSweepTx(tx);
1793
1918
  transfers.push({ asset: "ETH", amount: format(send, 18), amountAtomic: send.toString(), txHash, explorerUrl: this.options.buildExplorerUrl(agent.chainId, txHash), confirmation });
1794
1919
  }
1795
1920
  }
1796
- return { fromAddress: agent.delegateAddress, toAddress: agent.safeAddress, chainId: agent.chainId, transfers, unconfirmed: transfers.some((t) => t.confirmation === "unconfirmed") };
1921
+ return { fromAddress: agent.delegateAddress, toAddress: agent.accountAddress, chainId: agent.chainId, transfers, unconfirmed: transfers.some((t) => t.confirmation === "unconfirmed") };
1797
1922
  }
1798
1923
  prepareSweep() {
1799
1924
  return this.options.transport.post("/machine-payments/sweep/prepare", {});
@@ -2187,7 +2312,7 @@ var X402FundingLeg = class {
2187
2312
  const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
2188
2313
  const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
2189
2314
  const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
2190
- const payer = raw.payer ?? raw.safe_address ?? raw.sign_data?.components.safe;
2315
+ const payer = readX402ReceiptPayer(raw);
2191
2316
  return buildX402Receipt({
2192
2317
  paymentId: raw.payment_id,
2193
2318
  txHash,
@@ -2872,15 +2997,57 @@ var MerchantCompletion = class {
2872
2997
  for (let attempt = 0; ; attempt += 1) {
2873
2998
  try {
2874
2999
  await this.post("/machine-payments/evidence", body);
2875
- return;
3000
+ return { outcome: "confirmed" };
2876
3001
  } catch (err) {
2877
- const retryable = err instanceof HavenApiError && err.statusCode === EVIDENCE_RETRYABLE_STATUS;
2878
- if (!retryable || attempt >= EVIDENCE_RETRY_DELAYS_MS.length) return;
3002
+ const statusCode = err instanceof HavenApiError ? err.statusCode : void 0;
3003
+ const retryable = statusCode === EVIDENCE_RETRYABLE_STATUS;
3004
+ if (!retryable) {
3005
+ return { outcome: "refused", statusCode: statusCode ?? 0 };
3006
+ }
3007
+ if (attempt >= EVIDENCE_RETRY_DELAYS_MS.length) {
3008
+ return { outcome: "retryable", statusCode };
3009
+ }
2879
3010
  await this.sleep(EVIDENCE_RETRY_DELAYS_MS[attempt]);
2880
3011
  }
2881
3012
  }
2882
3013
  }
3014
+ /**
3015
+ * #2972: report the merchant's REAL settlement transaction hash for an
3016
+ * erc7710 x402 payment out of band — the remedy #2970's guidance could not
3017
+ * name, because no hosted tool accepted a hash. An agent reaches this after
3018
+ * `haven_settle_mcp_tool` / `haven_complete_mcp_tool` answered
3019
+ * `DELIVERED_UNSETTLED` or `SETTLEMENT_PENDING`, or after
3020
+ * `haven_get_payment_status` reports `awaiting_settlement_evidence` — in
3021
+ * every one of those cases the agent may be holding the merchant's own
3022
+ * `PAYMENT-RESPONSE.transaction` while Haven has nothing.
3023
+ *
3024
+ * Reuses `reportEvidence` — same backend seam
3025
+ * (`POST /machine-payments/evidence` → `observeErc7710Settlement`,
3026
+ * fail-closed — see `settlement-observed.ts`), same three-outcome contract.
3027
+ * `resourceUrl` and `merchantStatus` are omitted: this call has no fresh
3028
+ * merchant HTTP exchange to read either from, and both are optional at the
3029
+ * backend (see the parameter doc on `reportEvidence`).
3030
+ *
3031
+ * The zero hash is refused HERE, client-side, before any network call —
3032
+ * never posted. `isZeroSettlementTxHash` is the same recognizer the #2970
3033
+ * gate uses, so a caller cannot "fix" a missing hash by reporting the demo
3034
+ * merchant's own marker and getting a different verdict than the settle
3035
+ * path already gave it.
3036
+ */
3037
+ async reportSettlementEvidence(paymentId, settlementTxHash) {
3038
+ if (isZeroSettlementTxHash(settlementTxHash)) {
3039
+ throw new HavenZeroSettlementHashError(paymentId);
3040
+ }
3041
+ return this.reportEvidence({
3042
+ paymentId,
3043
+ rail: "x402",
3044
+ txHash: settlementTxHash
3045
+ });
3046
+ }
2883
3047
  };
3048
+ function isZeroSettlementTxHash(hash) {
3049
+ return typeof hash === "string" && /^0x0+$/i.test(hash);
3050
+ }
2884
3051
  function parseMerchantSettlement(header) {
2885
3052
  if (!header) return {};
2886
3053
  const parsed = parseProtocolReceiptHeader(header);
@@ -3382,7 +3549,7 @@ var HavenClient = class {
3382
3549
  const query = params.size > 0 ? `?${params.toString()}` : "";
3383
3550
  const raw = await this.get(`/catalog${query}`);
3384
3551
  let entries = raw.entries.map(mapCatalogEntry);
3385
- if (options.verified === "verified") entries = entries.filter((e) => e.source === "ingestion");
3552
+ if (options.verified === "verified") entries = entries.filter((e) => e.verifiedPayable === true);
3386
3553
  if (options.verified === "operator") entries = entries.filter((e) => e.source === "operator");
3387
3554
  return entries;
3388
3555
  }
@@ -3519,9 +3686,16 @@ var HavenClient = class {
3519
3686
  const request = snapshotX402Request(url, initialInit);
3520
3687
  const response = await this.merchantTransport.fetch(url, initialInit);
3521
3688
  if (response.status !== 402) {
3689
+ let body;
3690
+ try {
3691
+ body = await response.clone().json();
3692
+ } catch {
3693
+ body = void 0;
3694
+ }
3522
3695
  throw new X402UnexpectedStatusError(
3523
3696
  `Expected an x402 quote response with HTTP 402, got HTTP ${response.status}.`,
3524
- response.status || 400
3697
+ response.status || 400,
3698
+ body
3525
3699
  );
3526
3700
  }
3527
3701
  if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
@@ -3810,6 +3984,7 @@ var HavenClient = class {
3810
3984
  } catch {
3811
3985
  body = text;
3812
3986
  }
3987
+ let evidenceOutcome;
3813
3988
  if (!surfaced.ok) {
3814
3989
  if (!input.noFundingLeg && fundingTxHash) {
3815
3990
  await this.merchantCompletion.recordRetryRejected({
@@ -3829,9 +4004,10 @@ var HavenClient = class {
3829
4004
  });
3830
4005
  }
3831
4006
  } else {
3832
- const evidenceTxHash = input.noFundingLeg ? settlement.settlementTxHash ?? void 0 : fundingTxHash ?? void 0;
4007
+ const rawEvidenceTxHash = input.noFundingLeg ? settlement.settlementTxHash ?? void 0 : fundingTxHash ?? void 0;
4008
+ const evidenceTxHash = rawEvidenceTxHash && !isZeroSettlementTxHash(rawEvidenceTxHash) ? rawEvidenceTxHash : void 0;
3833
4009
  if (evidenceTxHash) {
3834
- await this.merchantCompletion.reportEvidence({
4010
+ evidenceOutcome = await this.merchantCompletion.reportEvidence({
3835
4011
  paymentId: evidenceContext.paymentId,
3836
4012
  rail: "x402",
3837
4013
  txHash: evidenceTxHash,
@@ -3849,7 +4025,8 @@ var HavenClient = class {
3849
4025
  status: surfaced.status,
3850
4026
  ok: surfaced.ok,
3851
4027
  body,
3852
- settlementTxHash: settlement.settlementTxHash ?? void 0
4028
+ settlementTxHash: settlement.settlementTxHash ?? void 0,
4029
+ evidenceOutcome
3853
4030
  };
3854
4031
  }
3855
4032
  /**
@@ -3864,6 +4041,19 @@ var HavenClient = class {
3864
4041
  async reportX402MerchantOutcome(input) {
3865
4042
  return await this.merchantCompletion.reportMerchantOutcome(input);
3866
4043
  }
4044
+ /**
4045
+ * #2972: report the merchant's real settlement transaction hash for an
4046
+ * erc7710 x402 payment — the remedy for `DELIVERED_UNSETTLED` /
4047
+ * `SETTLEMENT_PENDING` / `awaiting_settlement_evidence` when the agent
4048
+ * holds the hash (`PAYMENT-RESPONSE.transaction`, or a prior settle/
4049
+ * complete result's `settlement_tx_hash`) and Haven does not. See
4050
+ * `MerchantCompletion.reportSettlementEvidence` for the fail-closed
4051
+ * verification this posts into (`observeErc7710Settlement`) and the
4052
+ * client-side zero-hash refusal.
4053
+ */
4054
+ async reportSettlementEvidence(paymentId, settlementTxHash) {
4055
+ return await this.merchantCompletion.reportSettlementEvidence(paymentId, settlementTxHash);
4056
+ }
3867
4057
  /**
3868
4058
  * GET /x402/:id/merchant-call-context — the settle-leg twin of #1263's
3869
4059
  * sign-context fetch (#1307). Re-serves the stored merchant MCP-tool call
@@ -4020,13 +4210,13 @@ var toolDescriptions = {
4020
4210
  summary: "Pay an inspected x402 quote. The delegate key signs locally; Haven only validates and relays signed, on-chain-constrained payment transactions.",
4021
4211
  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.",
4022
4212
  behavior: "Signs the payment locally and returns the merchant response. Settlement is either direct account-to-merchant with no funding leg, or a bridge that first redeems the agent's budget delegation to fund the delegate wallet for an EIP-3009 authorization. A payment outside the on-chain budget is declined before any money moves; nothing is queued for a human to approve later.",
4023
- nextActionGuidance: "Preserve the returned resume_state \u2014 it identifies this payment if you need to ask about it later. This tool performs the merchant retry itself, so do not wait on a signal while the call is in flight. If the process crashes after this call and a later haven_get_payment_status reports nextAction=retry_original_x402_request, Haven's funding leg confirmed but no merchant response was ever recorded \u2014 call the resume tool with the preserved resume_state or payment_id instead of paying again. If the response carries phase=insufficient_funds and nextAction=fund_safe_or_raise_allowance, the payment cannot be retried until the account is funded or the agent budget raised \u2014 stop and tell the user the shortfall reported on the response."
4213
+ nextActionGuidance: "Preserve the returned resume_state \u2014 it identifies this payment if you need to ask about it later. This tool performs the merchant retry itself, so do not wait on a signal while the call is in flight. If the process crashes after this call and a later haven_get_payment_status reports nextAction=retry_original_x402_request, Haven's funding leg confirmed but no merchant response was ever recorded \u2014 call the resume tool with the preserved resume_state or payment_id instead of paying again. If the response carries phase=insufficient_funds and nextAction=fund_safe_or_raise_allowance (or fund_account_or_raise_allowance), the payment cannot be retried until the account is funded or the agent budget raised \u2014 stop and tell the user the shortfall reported on the response."
4024
4214
  },
4025
4215
  payX402OneShot: {
4026
4216
  summary: "Fetch an x402 paid HTTP resource in a single call. Handles the full probe -> pay -> retry round trip and returns the merchant response.",
4027
4217
  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.",
4028
4218
  behavior: "Calls the URL, parses any HTTP 402 x402 challenge, signs the payment locally, then retries the original request with the signed payment header (sent under PAYMENT-SIGNATURE, plus the legacy X-PAYMENT on the EIP-3009 path only) and returns the merchant response. Settlement is either direct account-to-merchant with no funding leg, or a bridge that first redeems the agent's budget delegation to fund the delegate wallet for an EIP-3009 authorization. A payment outside the on-chain budget is declined before any money moves; nothing is queued for a human to approve later. If the resource returns a non-402 status, returns it unchanged without contacting Haven.",
4029
- nextActionGuidance: "Preserve the returned resume_state or paymentId \u2014 either identifies this payment if you need to ask about it later. This tool performs the merchant retry itself, so do not wait on a signal while the call is in flight. If the process crashes after this call and a later haven_get_payment_status reports nextAction=retry_original_x402_request, Haven's funding leg confirmed but no merchant response was ever recorded \u2014 call the resume tool with the preserved resume_state or payment_id instead of paying again. If the response carries phase=insufficient_funds and nextAction=fund_safe_or_raise_allowance, the payment cannot be retried until the account is funded or the agent budget raised \u2014 stop and tell the user the shortfall reported on the response."
4219
+ nextActionGuidance: "Preserve the returned resume_state or paymentId \u2014 either identifies this payment if you need to ask about it later. This tool performs the merchant retry itself, so do not wait on a signal while the call is in flight. If the process crashes after this call and a later haven_get_payment_status reports nextAction=retry_original_x402_request, Haven's funding leg confirmed but no merchant response was ever recorded \u2014 call the resume tool with the preserved resume_state or payment_id instead of paying again. If the response carries phase=insufficient_funds and nextAction=fund_safe_or_raise_allowance (or fund_account_or_raise_allowance), the payment cannot be retried until the account is funded or the agent budget raised \u2014 stop and tell the user the shortfall reported on the response."
4030
4220
  },
4031
4221
  resumeX402: {
4032
4222
  summary: "Resume an x402 payment whose Haven-side authorization already succeeded but whose merchant retry did not complete.",
@@ -4038,8 +4228,8 @@ var toolDescriptions = {
4038
4228
  // MACHINE-PAYMENT-CHALLENGE was never produced by anything besides the now
4039
4229
  // deleted `/demo/mpp/*` route. Use the x402 fragments above instead.
4040
4230
  getPaymentStatus: {
4041
- summary: "Fetch structured Haven payment status, including phase and nextAction taxonomy for agent recovery.",
4042
- behavior: "Accepts a payment intent id and returns the full state taxonomy (phase, nextAction, rail, amount, merchant, resource url, idempotency key, message).",
4231
+ summary: "Fetch structured Haven payment status for agent recovery.",
4232
+ behavior: "State: phase, nextAction, rail, amount, merchant, resource, idempotency, message; parties: treasury/delegate/delegateAccount/merchant. awaiting_settlement_evidence: poll once, else unverified.",
4043
4233
  nextActionGuidance: ""
4044
4234
  },
4045
4235
  getResumeState: {
@@ -4050,7 +4240,7 @@ var toolDescriptions = {
4050
4240
  getAgent: {
4051
4241
  summary: "Return the authenticated agent identity AND its live spend authority in one call: Haven wallet, delegate, chain, raw status, spend_authority_readiness, and per-token remaining allowance (atomic + human-readable). The recommended first call in a new session to confirm who you are and whether Haven will let you spend right now.",
4052
4242
  selectionGuidance: "Use this as the one-shot orientation/bootstrap at the start of a session, or whenever you need to confirm identity together with whether the agent can spend right now. For a detailed per-token breakdown (configured vs spent vs reset window) use haven_get_allowances.",
4053
- behavior: `Reads identity plus the live spend-authority snapshot in one shot \u2014 the agent's active on-chain budget delegation. spend_authority_readiness (readiness is a deprecated alias, same value) is "ready" when at least one token has remaining spend authority, "needs_approval" when the agent is active but has none, and "revoked" when the credential is not active. It covers hosted identity + on-chain spend authority ONLY \u2014 the hosted server cannot see the LOCAL signer, so "ready" does not mean the signer can start; verify the signer with a signer tool call or connect --doctor. An over-budget payment is declined before any money moves: there is no approval queue, so ask the owner to grant or raise the budget in Haven rather than waiting for an approval. allowances[] carries remainingAtomic and remainingDisplay per token. Identity fields (id, name, status, safeAddress, delegateAddress, chainId) are unchanged from before.`,
4243
+ behavior: `Reads identity plus the live spend-authority snapshot in one shot \u2014 the agent's active on-chain budget delegation. spend_authority_readiness (readiness is a deprecated alias, same value) is "ready" when at least one token has remaining spend authority, "needs_approval" when the agent is active but has none, and "revoked" when the credential is not active. It covers hosted identity + on-chain spend authority ONLY \u2014 the hosted server cannot see the LOCAL signer, so "ready" does not mean the signer can start; verify the signer with a signer tool call or connect --doctor. An over-budget payment is declined before any money moves: there is no approval queue, so ask the owner to grant or raise the budget in Haven rather than waiting for an approval. allowances[] carries remainingAtomic and remainingDisplay per token. Identity fields: id, name, status, accountAddress (safeAddress: deprecated alias, same value), delegateAddress, chainId.`,
4054
4244
  nextActionGuidance: ""
4055
4245
  },
4056
4246
  getAllowances: {
@@ -4079,7 +4269,7 @@ var toolDescriptions = {
4079
4269
  },
4080
4270
  discoverTools: {
4081
4271
  summary: "Step 1 of a purchase: discover payable services from Haven's curated merchant catalog \u2014 names, prices, and which pay tool to use next.",
4082
- selectionGuidance: "Use this when the user asks what the agent can buy, pay for, or which paid services exist \u2014 or when you need a resource URL for a service the user described. Use verified=verified to show only self-submitted directory entries that passed domain-ownership proof and a live quote probe \u2014 never treat those badges as proof of merchant honesty, quality, or reliability. Do NOT use for balance, budget, or spend-limit questions \u2014 use haven_get_allowances. Do NOT use to pay \u2014 each returned entry names the pay tool to use next.",
4272
+ selectionGuidance: "Use this when the user asks what the agent can buy, pay for, or which paid services exist \u2014 or when you need a resource URL for a service the user described. Use verified=verified for entries Haven watched pass a live quote probe (operator-curated or self-submitted) \u2014 domain_verified is the only ownership claim; never treat these badges as proof of merchant honesty, quality, or reliability. Do NOT use for balance, budget, or spend-limit questions \u2014 use haven_get_allowances. Do NOT use to pay \u2014 each returned entry names the pay tool to use next.",
4083
4273
  behavior: "Use each entry's suggested_tool field first \u2014 it names the exact next call. Read-only lookup against Haven's curated catalog; entries are periodically re-verified against the live merchant and degraded entries are flagged. Use category for a case-insensitive category filter (for example, VPN or vpn), or search for a product name, category, or description term. Returns name, description, price, rail, resource URL, tool_name, tool_arguments, suggested_tool, and the provenance badges source/domain_verified/verified_payable. The catalog price (price_display/price_atomic, marked price_is_indicative) is a last-verified hint, NOT authoritative \u2014 the real price comes from the merchant's live 402 at pay time. Never creates a payment, signature, or approval.",
4084
4274
  nextActionGuidance: `Pick an entry and pay it with the tool named in suggested_tool, passing the entry's resource_url, tool_name, and tool_arguments for MCP merchants. Confirm the price from the live pay-tool result (not the catalog), and pass the user's cap as max_amount_human in whole tokens ("no more than 1 USDC" \u2192 max_amount_human: "1") \u2014 never convert it to atomic units by hand.`
4085
4275
  },
@@ -4090,9 +4280,9 @@ var toolDescriptions = {
4090
4280
  nextActionGuidance: "Give the verify_token and the well-known instructions (from getCatalogSubmissionStatus) to the merchant so they can publish the proof line, then poll the submission status until it reaches verified_payable or failed."
4091
4281
  },
4092
4282
  sweep_delegate: {
4093
- summary: "Sweep stranded USDC and/or ETH from the delegate wallet back to the originating Safe.",
4283
+ summary: "Sweep stranded USDC and/or ETH from the delegate wallet back to the originating account.",
4094
4284
  selectionGuidance: "Use this when the user instructs you to recover stranded funds on the delegate wallet, or when a payment status returns nextAction=sweep_stranded_funds. Do NOT use for normal payments \u2014 use haven_pay_x402. Do NOT use to read balances only \u2014 use haven_get_allowances.",
4095
- behavior: `Reads the delegate EOA's on-chain USDC and ETH balances. For each non-zero balance, signs and submits a transfer from the delegate EOA to the originating Safe (hardcoded destination). The delegate key signs locally \u2014 Haven never sees it and the backend never constructs signed transactions (CASP/MiCA Red Line #2). Returns tx hashes and recovered amounts. Returns an empty transfers list when nothing is stranded. Each transfer carries confirmation: "confirmed" (a receipt was seen \u2014 the funds are in the Safe) or "unconfirmed" (broadcast but not confirmed within 90 seconds \u2014 still in the mempool, may still land). The top-level unconfirmed flag is true when any transfer is unconfirmed.`,
4285
+ behavior: `Reads the delegate EOA's on-chain USDC and ETH balances. For each non-zero balance, signs and submits a transfer from the delegate EOA to the originating account (hardcoded destination). The delegate key signs locally \u2014 Haven never sees it and the backend never constructs signed transactions (CASP/MiCA Red Line #2). Returns tx hashes and recovered amounts. Returns an empty transfers list when nothing is stranded. Each transfer carries confirmation: "confirmed" (a receipt was seen \u2014 the funds are in the account) or "unconfirmed" (broadcast but not confirmed within 90 seconds \u2014 still in the mempool, may still land). The top-level unconfirmed flag is true when any transfer is unconfirmed.`,
4096
4286
  nextActionGuidance: 'If transfers is non-empty, confirm the amounts with the user. Report a transfer as recovered ONLY when its confirmation is "confirmed". For an "unconfirmed" transfer, tell the user it was submitted but not yet confirmed, give them its txHash and explorerUrl to check, and do not re-run the sweep immediately \u2014 a re-run after it lands will simply find nothing stranded.'
4097
4287
  },
4098
4288
  send: {
@@ -4100,6 +4290,11 @@ var toolDescriptions = {
4100
4290
  selectionGuidance: "Use this for plain transfers \u2014 refunding a user, paying a freelancer, topping up a co-agent's wallet, or moving funds between addresses. Do NOT use for x402 paid endpoints \u2014 use haven_pay_x402 instead. Do NOT use for read-only allowance, budget, or what-can-I-spend questions \u2014 use haven_get_allowances.",
4101
4291
  behavior: "Sends the requested amount by redeeming the agent's on-chain budget delegation, account to recipient with no funding leg. Budget, recipient and expiry are enforced on-chain while the transfer is prepared, so a request outside them is declined before any money moves and before the agent is asked to sign \u2014 it is never queued for a human to approve later. The agent's signing key signs the account's typed data; Haven never receives the key.",
4102
4292
  nextActionGuidance: "On a decline, report the reason to the user and ask them to grant or raise the budget in Haven \u2014 there is nothing to poll and no approval will arrive. After a successful send, poll haven_get_payment_status until nextAction=none."
4293
+ },
4294
+ reportSettlementEvidence: {
4295
+ summary: "Report an erc7710 payment's real settlement transaction hash so Haven can verify it on-chain and confirm the payment.",
4296
+ behavior: "Pass payment_id and settlement_tx_hash (0x + 64 hex chars) \u2014 from PAYMENT-RESPONSE or a prior settlement_tx_hash. Haven verifies on-chain before confirming; a zero, mismatched, or reverted hash is refused. Your own payments only.",
4297
+ nextActionGuidance: "code DELIVERED_UNSETTLED: did not verify, do not retry \u2014 poll haven_get_payment_status. code SETTLEMENT_PENDING (retryable:true): not mined or RPC unreachable \u2014 report the same hash again shortly."
4103
4298
  }
4104
4299
  };
4105
4300
 
@@ -4702,15 +4897,30 @@ present and surface \`message\` or \`error\` verbatim. Common cases:
4702
4897
  Round the cap, or send an exact atomic \`max_amount\`.
4703
4898
  - \`PAYMENT_WINDOW_EXPIRED\`: re-run the quote/prepare tool with the same
4704
4899
  \`idempotency_key\`, then sign the fresh payload.
4900
+ - \`MERCHANT_NOT_READY\`: the merchant refused the quote with its own
4901
+ "cannot settle right now" signal (a 503 \`merchant_not_ready\` with a
4902
+ \`reason_code\`) instead of a 402. No payment was created. Tell the user;
4903
+ retry later (the message carries \`retry_after_s\` when the merchant gave
4904
+ one) \u2014 this is not a wrong or broken endpoint.
4705
4905
  - \`MERCHANT_REJECTED_AFTER_FUNDING\`: the merchant refused the paid retry.
4706
- Stop-and-sweep \u2014 stop retrying the merchant and use
4707
- \`mcp__haven__haven_sweep_delegate\` to recover stranded delegate funds.
4708
- - \`MERCHANT_UNRESPONSIVE_AFTER_FUNDING\`: funding confirmed on-chain, but the
4709
- merchant never answered the paid retry. This is NOT proof of rejection \u2014 the
4710
- merchant may still settle late. Verify-then-sweep, never a blind sweep:
4711
- check \`mcp__haven__haven_get_payment_status\`, retry
4906
+ On eip3009 (\`rail\` not \`erc7710\`): Stop-and-sweep \u2014 stop retrying the
4907
+ merchant and use \`mcp__haven__haven_sweep_delegate\` to recover stranded
4908
+ delegate funds. On erc7710 there is no funding leg and nothing to sweep:
4909
+ follow the message \u2014 it says whether the merchant declined to settle
4910
+ (re-quote later) or whether to check \`haven_get_payment_status\` after
4911
+ the payment window first.
4912
+ - \`MERCHANT_UNRESPONSIVE_AFTER_FUNDING\`: the merchant never answered the paid
4913
+ retry. This is NOT proof of rejection \u2014 the merchant may still settle late.
4914
+ On eip3009 (\`rail\` not \`erc7710\`), funding confirmed on-chain: Verify-then-sweep,
4915
+ never a blind sweep \u2014 check \`mcp__haven__haven_get_payment_status\`, retry
4712
4916
  \`mcp__haven__haven_complete_mcp_tool\` ONCE, and only sweep with
4713
- \`mcp__haven__haven_sweep_delegate\` if no settlement appears.
4917
+ \`mcp__haven__haven_sweep_delegate\` if no settlement appears. On erc7710
4918
+ there is no funding leg and nothing to sweep, and
4919
+ \`mcp__haven__haven_complete_mcp_tool\` has no erc7710 branch (it refuses a
4920
+ submitted intent) \u2014 do not retry it: the merchant may still redeem the
4921
+ settlement authorization within the payment window, so check
4922
+ \`mcp__haven__haven_get_payment_status\` after that window and re-quote only
4923
+ if it shows no settlement.
4714
4924
  - Budget exceeded: tell the user how much remains (from
4715
4925
  \`mcp__haven__haven_get_allowances\`) and that they can raise the budget in
4716
4926
  Haven.
@@ -4817,6 +5027,6 @@ function sameUrl(a, b) {
4817
5027
  }
4818
5028
  }
4819
5029
 
4820
- export { AGENT_APPROVAL_RELAY_JSON_SENTENCE, AGENT_APPROVAL_RELAY_PROSE_SENTENCE, AGENT_COMMAND_MODIFICATION_SENTENCE, AGENT_JSON_MODE_SENTENCE, AGENT_LOCAL_KEY_SENTENCE, AGENT_NETWORK_ACCESS_SENTENCE, AGENT_ONBOARDING_PROMPT, AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AGENT_README_SECTION_MD, AGENT_SECRET_HYGIENE_SENTENCE, AGENT_WIRING_COLLISION_RELAY_SENTENCE, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DISCOVERY_MAX_BYTES, ERC7710_ASSET_TRANSFER_METHOD, HAVEN_AGENT_RUNBOOK_MD, HAVEN_CONNECTOR_CHANNEL, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_BODY_MD, HAVEN_SKILL_MD, HavenApiError, HavenClient, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, MerchantTimeoutError, RECEIPT_VERSION, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, SignerRefusalCode, TRANSFER_WITH_AUTHORIZATION_TYPES, X402AlreadySettledError, X402PaymentHeaderValidationError, X402UnexpectedStatusError, X402_LEGACY_PAYMENT_HEADER_NAME, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_PAYMENT_HEADER_NAME, X402_PAYMENT_HEADER_NAMES_SENT, X402_PAYMENT_REQUIRED_HEADER_NAME, X402_PAYMENT_RESPONSE_HEADER_NAME, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, addressFromKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, compareNodeVersions, composeDescription, connectorRerunCommand, connectorSpec, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isConnectorChannel, isErc7710Option, isSupportedNodeVersion, isSweepableChain, normalizePaymentRequired, parsePaymentRequired, parsePaymentRequiredResponse, resolveConnectorChannel, resolveTokenFromAddress, sameUrl, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, signHash, signUserOpTypedDataForDelegation, signerUpdateFallback, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, verifyPaymentReceipt, verifySignature, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402V2PaymentEnvelope };
5030
+ export { AGENT_APPROVAL_RELAY_JSON_SENTENCE, AGENT_APPROVAL_RELAY_PROSE_SENTENCE, AGENT_COMMAND_MODIFICATION_SENTENCE, AGENT_JSON_MODE_SENTENCE, AGENT_LOCAL_KEY_SENTENCE, AGENT_NETWORK_ACCESS_SENTENCE, AGENT_ONBOARDING_PROMPT, AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AGENT_README_SECTION_MD, AGENT_SECRET_HYGIENE_SENTENCE, AGENT_WIRING_COLLISION_RELAY_SENTENCE, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionAccountAlias, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DISCOVERY_MAX_BYTES, ERC7710_ASSET_TRANSFER_METHOD, HAVEN_AGENT_RUNBOOK_MD, HAVEN_CONNECTOR_CHANNEL, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_BODY_MD, HAVEN_SKILL_MD, HavenApiError, HavenClient, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenZeroSettlementHashError, MERCHANT_DISCOVERY_PATHS, MerchantTimeoutError, RECEIPT_VERSION, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, SignerRefusalCode, TRANSFER_WITH_AUTHORIZATION_TYPES, X402AlreadySettledError, X402PaymentHeaderValidationError, X402UnexpectedStatusError, X402_LEGACY_PAYMENT_HEADER_NAME, X402_MAX_AUTHORIZATION_WINDOW_SECONDS, X402_PAYMENT_HEADER_NAME, X402_PAYMENT_HEADER_NAMES_SENT, X402_PAYMENT_REQUIRED_HEADER_NAME, X402_PAYMENT_RESPONSE_HEADER_NAME, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS, accountAddressTwins, addressFromKey, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, canonicalAgentPaymentNextAction, compareNodeVersions, composeDescription, connectorRerunCommand, connectorSpec, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isConnectorChannel, isErc7710Option, isFundAccountOrRaiseAllowance, isSupportedNodeVersion, isSweepableChain, isZeroSettlementTxHash, normalizePaymentRequired, parsePaymentRequired, parsePaymentRequiredResponse, readAccountAddress, readAccountId, readX402ReceiptPayer, resolveConnectorChannel, resolveTokenFromAddress, sameUrl, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, signHash, signUserOpTypedDataForDelegation, signerUpdateFallback, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, verifyPaymentReceipt, verifySignature, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402V2PaymentEnvelope };
4821
5031
  //# sourceMappingURL=index.js.map
4822
5032
  //# sourceMappingURL=index.js.map