@haven_ai/sdk 0.11.0-alpha.0 → 0.13.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.
- package/README.md +37 -4
- package/dist/{base64-D4VZhgUg.d.ts → base64-C3mJNLYR.d.cts} +10 -2
- package/dist/{base64-DR4Gl8cD.d.cts → base64-CxzIc3KH.d.ts} +10 -2
- package/dist/{chunk-IKQIIMM6.cjs → chunk-4Z7PKLFD.cjs} +38 -37
- package/dist/chunk-4Z7PKLFD.cjs.map +1 -0
- package/dist/{chunk-34YJQFCM.js → chunk-CK6VRIPR.js} +3 -3
- package/dist/chunk-CK6VRIPR.js.map +1 -0
- package/dist/{chunk-ZDJ55LR7.js → chunk-CXQ42FOA.js} +7 -6
- package/dist/chunk-CXQ42FOA.js.map +1 -0
- package/dist/{chunk-MZKLAHBK.cjs → chunk-LZHCIK7L.cjs} +56 -4
- package/dist/chunk-LZHCIK7L.cjs.map +1 -0
- package/dist/{chunk-I7SL4A6X.js → chunk-MI7LVP56.js} +55 -5
- package/dist/chunk-MI7LVP56.js.map +1 -0
- package/dist/{chunk-DXBAN4SN.cjs → chunk-Z5MTKU6O.cjs} +4 -4
- package/dist/chunk-Z5MTKU6O.cjs.map +1 -0
- package/dist/edge.cjs +93 -93
- package/dist/edge.d.cts +11 -8
- package/dist/edge.d.ts +11 -8
- package/dist/edge.js +4 -4
- package/dist/index.cjs +456 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -15
- package/dist/index.d.ts +26 -15
- package/dist/index.js +140 -48
- package/dist/index.js.map +1 -1
- package/dist/{receipt-CbD8L0WL.d.ts → receipt-CTOPh2fm.d.ts} +5 -4
- package/dist/{receipt-_bWCELEH.d.cts → receipt-DwRqGjGb.d.cts} +5 -4
- package/dist/test-support.cjs +58 -21
- package/dist/test-support.cjs.map +1 -1
- package/dist/test-support.d.cts +47 -3
- package/dist/test-support.d.ts +47 -3
- package/dist/test-support.js +37 -3
- package/dist/test-support.js.map +1 -1
- package/dist/{types-DKmvjXK6.d.cts → types-3vUBmumz.d.cts} +163 -2
- package/dist/{types-DKmvjXK6.d.ts → types-3vUBmumz.d.ts} +163 -2
- package/package.json +2 -2
- package/dist/chunk-34YJQFCM.js.map +0 -1
- package/dist/chunk-DXBAN4SN.cjs.map +0 -1
- package/dist/chunk-I7SL4A6X.js.map +0 -1
- package/dist/chunk-IKQIIMM6.cjs.map +0 -1
- package/dist/chunk-MZKLAHBK.cjs.map +0 -1
- package/dist/chunk-ZDJ55LR7.js.map +0 -1
|
@@ -322,6 +322,18 @@ var AgentPaymentWarningCode = {
|
|
|
322
322
|
* remains the actual gate either way.
|
|
323
323
|
*/
|
|
324
324
|
QuoteExceedsRemainingBudget: "QUOTE_EXCEEDS_REMAINING_BUDGET",
|
|
325
|
+
/**
|
|
326
|
+
* #4458: the agent's only budget for the token has ENDED — the quote-time
|
|
327
|
+
* pre-check answered the typed 403 `delegation_expired`, not an over-budget
|
|
328
|
+
* compare. Travels beside `budget_check.sufficient: false` and, on
|
|
329
|
+
* `haven_quote_x402`, `safe_to_continue: false` with no prefilled cap. The
|
|
330
|
+
* remedy is the owner setting a NEW budget: waiting for a period to reset
|
|
331
|
+
* cannot help, which is why this is its own code rather than
|
|
332
|
+
* {@link AgentPaymentWarningCode.QuoteExceedsRemainingBudget}. Additive: an
|
|
333
|
+
* older backend never emits it, and the on-chain policy remains the actual
|
|
334
|
+
* gate either way.
|
|
335
|
+
*/
|
|
336
|
+
QuoteBudgetEnded: "QUOTE_BUDGET_ENDED",
|
|
325
337
|
/**
|
|
326
338
|
* #3967: the MERCHANT reported a denial on one of its x402 payment options —
|
|
327
339
|
* a known denial key (starting with `issuanceDenied`) in `accepts[].extra`.
|
|
@@ -375,13 +387,51 @@ var HavenError = class extends Error {
|
|
|
375
387
|
statusCode;
|
|
376
388
|
paymentId;
|
|
377
389
|
};
|
|
378
|
-
var HavenApiError = class extends HavenError {
|
|
379
|
-
constructor(message, statusCode, body, paymentId) {
|
|
390
|
+
var HavenApiError = class _HavenApiError extends HavenError {
|
|
391
|
+
constructor(message, statusCode, body, paymentId, failureCause) {
|
|
380
392
|
super(message, "API_ERROR", statusCode, paymentId);
|
|
381
393
|
this.body = body;
|
|
394
|
+
this.failureCause = failureCause;
|
|
382
395
|
this.name = "HavenApiError";
|
|
383
396
|
}
|
|
384
397
|
body;
|
|
398
|
+
failureCause;
|
|
399
|
+
/**
|
|
400
|
+
* #4470: an error a retry cannot change. The census in
|
|
401
|
+
* `haven-api-error-census.test.ts` requires every literal 5xx site to use
|
|
402
|
+
* this or be allowlisted there with a reason.
|
|
403
|
+
*/
|
|
404
|
+
static deterministic(message, statusCode, body, paymentId) {
|
|
405
|
+
return new _HavenApiError(message, statusCode, body, paymentId, { kind: "deterministic" });
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
var FundingConfirmationUnknownError = class extends HavenApiError {
|
|
409
|
+
constructor(txHash, chainId, reason) {
|
|
410
|
+
super(
|
|
411
|
+
`Funding tx ${txHash} was submitted, but its on-chain confirmation could not be read (${reason}).`,
|
|
412
|
+
504,
|
|
413
|
+
{ txHash, chainId }
|
|
414
|
+
);
|
|
415
|
+
this.txHash = txHash;
|
|
416
|
+
this.chainId = chainId;
|
|
417
|
+
this.name = "FundingConfirmationUnknownError";
|
|
418
|
+
}
|
|
419
|
+
txHash;
|
|
420
|
+
chainId;
|
|
421
|
+
fundingErrorCode = "funding_confirmation_unknown";
|
|
422
|
+
};
|
|
423
|
+
var FundingRevertedError = class extends HavenApiError {
|
|
424
|
+
constructor(txHash, chainId) {
|
|
425
|
+
super(`Funding tx ${txHash} reverted on-chain; nothing reached the delegate.`, 502, { txHash, chainId }, void 0, {
|
|
426
|
+
kind: "deterministic"
|
|
427
|
+
});
|
|
428
|
+
this.txHash = txHash;
|
|
429
|
+
this.chainId = chainId;
|
|
430
|
+
this.name = "FundingRevertedError";
|
|
431
|
+
}
|
|
432
|
+
txHash;
|
|
433
|
+
chainId;
|
|
434
|
+
fundingErrorCode = "funding_reverted";
|
|
385
435
|
};
|
|
386
436
|
var MerchantTimeoutError = class extends HavenApiError {
|
|
387
437
|
merchantErrorCode = "merchant_timeout";
|
|
@@ -1033,6 +1083,6 @@ function assertRedeemsOwnBudgetDelegation(redeemCalldata, ownAccount) {
|
|
|
1033
1083
|
}
|
|
1034
1084
|
}
|
|
1035
1085
|
|
|
1036
|
-
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CAVEAT_ENFORCERS, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MAX_SETTLEMENT_WINDOW_SECONDS, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild };
|
|
1037
|
-
//# sourceMappingURL=chunk-
|
|
1038
|
-
//# sourceMappingURL=chunk-
|
|
1086
|
+
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, AgentPaymentWarningCode, CAVEAT_ENFORCERS, CONNECTOR_PACKAGE_NAME, DEFAULT_CONFIRMATION_TIMEOUT_MS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, FundingConfirmationUnknownError, FundingRevertedError, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_DOMAIN_NAME, HYBRID_DELEGATOR_DOMAIN_VERSION, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, HavenZeroSettlementHashError, MAX_SETTLEMENT_WINDOW_SECONDS, MerchantTimeoutError, PACKED_USER_OPERATION_FIELDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, TASK_SIGN_CONTEXT_VERSION, X402AlreadySettledError, X402Erc7710AlreadySettledError, X402TaskBudgetMismatchError, X402UnexpectedStatusError, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, connectorSpec, connectorUpgradeCommand, deriveDelegateAccountAddress, isConnectorChannel, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, resolveConnectorChannel, signerUpdateFallback, verifySettlementChild };
|
|
1087
|
+
//# sourceMappingURL=chunk-MI7LVP56.js.map
|
|
1088
|
+
//# sourceMappingURL=chunk-MI7LVP56.js.map
|