@haven_ai/sdk 0.0.0-dev.202609302247.f2e8289 → 0.0.0-dev.202610010927.3739fd3
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/{base64-DKp_5E8w.d.cts → base64-CCJ8g3n3.d.cts} +124 -2
- package/dist/{base64-DKp_5E8w.d.ts → base64-CCJ8g3n3.d.ts} +124 -2
- package/dist/{chunk-LN36WP4E.cjs → chunk-E5PDCCOQ.cjs} +35 -35
- package/dist/{chunk-LN36WP4E.cjs.map → chunk-E5PDCCOQ.cjs.map} +1 -1
- package/dist/{chunk-66Y4FOAW.js → chunk-FW3UISA7.js} +4 -4
- package/dist/{chunk-66Y4FOAW.js.map → chunk-FW3UISA7.js.map} +1 -1
- package/dist/{chunk-FZB5XARP.cjs → chunk-OYVHR3IT.cjs} +2 -2
- package/dist/chunk-OYVHR3IT.cjs.map +1 -0
- package/dist/{chunk-ANJUPDH2.js → chunk-PUAJJDMB.js} +2 -2
- package/dist/chunk-PUAJJDMB.js.map +1 -0
- package/dist/edge.cjs +89 -89
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +4 -4
- package/dist/index.cjs +431 -310
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -4
- package/dist/index.d.ts +27 -4
- package/dist/index.js +130 -9
- package/dist/index.js.map +1 -1
- package/dist/test-support.cjs +18 -18
- package/dist/test-support.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-ANJUPDH2.js.map +0 -1
- package/dist/chunk-FZB5XARP.cjs.map +0 -1
|
@@ -794,6 +794,81 @@ interface HavenAgentSummary extends HavenAgent {
|
|
|
794
794
|
* budgets", not a fetch failure).
|
|
795
795
|
*/
|
|
796
796
|
taskBudgets: HavenTaskBudgetSummary[];
|
|
797
|
+
/**
|
|
798
|
+
* #3506: the sub-budget rows THIS agent must still sign as the DELEGATING
|
|
799
|
+
* agent — the owner issued a sub-budget (a parent-child row for this agent
|
|
800
|
+
* plus a grant to the sub-agent), and each row is `pending` until this
|
|
801
|
+
* agent's delegate key signs it (or `closing` until it signs the close).
|
|
802
|
+
* A derived VIEW, populated from `GET /sub-budgets?status=awaiting_signature`;
|
|
803
|
+
* empty (never throws) against a backend that predates the filter.
|
|
804
|
+
*/
|
|
805
|
+
pendingSubBudgetSignatures: HavenPendingSubBudgetSignature[];
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* #3506: one sub-budget row awaiting THIS agent's signature — what
|
|
809
|
+
* `haven_get_agent` carries per row so the agent can call
|
|
810
|
+
* `haven_sign { sub_budget_id }` then `haven_submit { sub_budget_id, signature }`.
|
|
811
|
+
*/
|
|
812
|
+
interface HavenPendingSubBudgetSignature {
|
|
813
|
+
subBudgetId: string;
|
|
814
|
+
/** The parent-child row a grant hangs under; null on the parent-child row itself (they share a tree). */
|
|
815
|
+
parentSubBudgetId: string | null;
|
|
816
|
+
/** `open`: sign the child delegation (row is pending). `close`: sign the revocation (row is closing). */
|
|
817
|
+
purpose: 'open' | 'close';
|
|
818
|
+
/** `parent-child`: this agent's own narrowing of its budget. `grant`: the slice delegated to the sub-agent. */
|
|
819
|
+
what: 'parent-child' | 'grant';
|
|
820
|
+
/** The sub-agent that holds the grant; null on this agent's own parent-child row. */
|
|
821
|
+
subAgentId: string | null;
|
|
822
|
+
tokenAddress: string;
|
|
823
|
+
recipientAddress: string | null;
|
|
824
|
+
periodAmountAtomic: string;
|
|
825
|
+
expiresAt: number;
|
|
826
|
+
isExpired: boolean;
|
|
827
|
+
}
|
|
828
|
+
/** #3506: sub-budget lifecycle status, as the wire names it. */
|
|
829
|
+
type HavenSubBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
|
|
830
|
+
/** #3506: `RawSubBudget`, camelCased — what the SDK sub-budget methods return. */
|
|
831
|
+
interface HavenSubBudget {
|
|
832
|
+
id: string;
|
|
833
|
+
agentId: string;
|
|
834
|
+
parentAgentId: string;
|
|
835
|
+
parentSubBudgetId: string | null;
|
|
836
|
+
chainId: number;
|
|
837
|
+
tokenAddress: string;
|
|
838
|
+
recipientAddress: string | null;
|
|
839
|
+
parentDelegationHash: string;
|
|
840
|
+
delegationHash: string;
|
|
841
|
+
label: string | null;
|
|
842
|
+
periodAmountAtomic: string;
|
|
843
|
+
status: HavenSubBudgetStatus;
|
|
844
|
+
expiresAt: number;
|
|
845
|
+
isExpired: boolean;
|
|
846
|
+
createdAt: string;
|
|
847
|
+
openedAt: string | null;
|
|
848
|
+
closedAt: string | null;
|
|
849
|
+
closeTxHash: string | null;
|
|
850
|
+
}
|
|
851
|
+
/** #3506: `POST /sub-budgets/:id/submit` — opened (from pending) or closed (from closing). */
|
|
852
|
+
interface SubmitSubBudgetResult {
|
|
853
|
+
subBudget: HavenSubBudget;
|
|
854
|
+
status: 'open' | 'closed';
|
|
855
|
+
/** Present only once the close UserOp lands (`status === 'closed'` from `closing`). */
|
|
856
|
+
closeTxHash?: string;
|
|
857
|
+
}
|
|
858
|
+
/** #3506: the sign data a live-child close returns (the revocation UserOp's typed data). */
|
|
859
|
+
interface HavenSubBudgetCloseSignData {
|
|
860
|
+
signature_scheme: 'eip712_userop';
|
|
861
|
+
typed_data: Record<string, unknown>;
|
|
862
|
+
user_op_hash: string;
|
|
863
|
+
}
|
|
864
|
+
/** #3506: `POST /sub-budgets/:id/close`. */
|
|
865
|
+
interface CloseSubBudgetResult {
|
|
866
|
+
subBudget: HavenSubBudget;
|
|
867
|
+
/** `closed` on a trivial close (never signed, or already expired); absent when a close signature is pending. */
|
|
868
|
+
status?: 'closed';
|
|
869
|
+
/** Present only when the close needed a signature (a live child). */
|
|
870
|
+
signData?: HavenSubBudgetCloseSignData;
|
|
871
|
+
nextAction?: string;
|
|
797
872
|
}
|
|
798
873
|
/** #3329: task-budget lifecycle status, as the wire names it. */
|
|
799
874
|
type HavenTaskBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
|
|
@@ -808,6 +883,22 @@ interface HavenTaskBudget {
|
|
|
808
883
|
delegationHash: string;
|
|
809
884
|
label: string | null;
|
|
810
885
|
maxAtomic: string;
|
|
886
|
+
/**
|
|
887
|
+
* #3501: camelCase form of `spent_atomic` — the live enforcer figure.
|
|
888
|
+
* Present on GET reads of an open task budget; null when the read failed;
|
|
889
|
+
* absent when the response did not read the chain.
|
|
890
|
+
*/
|
|
891
|
+
spentAtomic?: string | null;
|
|
892
|
+
/**
|
|
893
|
+
* #3501: what the chain will still allow through this child (cap minus
|
|
894
|
+
* spent, clamped at zero). A failed read is null — never the full cap.
|
|
895
|
+
*/
|
|
896
|
+
remainingAtomic?: string | null;
|
|
897
|
+
/**
|
|
898
|
+
* #3501: provenance of `remainingAtomic`, the parent allowance's honesty
|
|
899
|
+
* flag (`onchain.remainingIsFromChain`, #1319) on the task-budget surface.
|
|
900
|
+
*/
|
|
901
|
+
remainingIsFromChain?: boolean;
|
|
811
902
|
status: HavenTaskBudgetStatus;
|
|
812
903
|
expiresAt: number;
|
|
813
904
|
isExpired: boolean;
|
|
@@ -820,6 +911,15 @@ interface HavenTaskBudget {
|
|
|
820
911
|
* #3329: the condensed row `getAgentSummary()` carries per open, unexpired
|
|
821
912
|
* task budget — enough to render a "reserved by open task budgets" line and
|
|
822
913
|
* a task-budget list without a second read.
|
|
914
|
+
*
|
|
915
|
+
* #3501: each row also carries the budget-visibility figure the issue asks
|
|
916
|
+
* for — what the chain will still allow through this child — so an agent
|
|
917
|
+
* reading `haven_get_agent` can tell BEFORE its next payment whether the
|
|
918
|
+
* task budget will refuse it. `remainingAtomic` is null when the on-chain
|
|
919
|
+
* read failed (never the full cap as remaining), and
|
|
920
|
+
* `remainingIsFromChain` is the same honesty flag the parent allowance's
|
|
921
|
+
* `onchain.remainingIsFromChain` carries (#1319): true = live enforcer
|
|
922
|
+
* read, false = the read failed and the figures are null.
|
|
823
923
|
*/
|
|
824
924
|
interface HavenTaskBudgetSummary {
|
|
825
925
|
id: string;
|
|
@@ -827,6 +927,28 @@ interface HavenTaskBudgetSummary {
|
|
|
827
927
|
tokenAddress: string;
|
|
828
928
|
maxAtomic: string;
|
|
829
929
|
maxDisplay: string;
|
|
930
|
+
/**
|
|
931
|
+
* #3501: spent so far through this child, from the enforcer's `spentMap`.
|
|
932
|
+
* Null when the on-chain read failed; also null for a budget whose
|
|
933
|
+
* delegation the read could not speak for.
|
|
934
|
+
*/
|
|
935
|
+
spentAtomic: string | null;
|
|
936
|
+
/**
|
|
937
|
+
* #3501: `maxAtomic` minus spent, clamped at zero. Null — never the full
|
|
938
|
+
* cap — when the on-chain read failed.
|
|
939
|
+
*/
|
|
940
|
+
remainingAtomic: string | null;
|
|
941
|
+
/**
|
|
942
|
+
* #3501: true when `remainingAtomic` came from the live enforcer read,
|
|
943
|
+
* false when that read failed (spent/remaining are then null).
|
|
944
|
+
*/
|
|
945
|
+
remainingIsFromChain: boolean;
|
|
946
|
+
/**
|
|
947
|
+
* #3501: human form of `remainingAtomic` ("0.001 USDC"), derived by the
|
|
948
|
+
* same formatter as `maxDisplay`. Null exactly when `remainingAtomic` is
|
|
949
|
+
* null — a failed read never renders as an amount.
|
|
950
|
+
*/
|
|
951
|
+
remainingDisplay: string | null;
|
|
830
952
|
recipientAddress: string | null;
|
|
831
953
|
expiresAt: number;
|
|
832
954
|
}
|
|
@@ -2090,7 +2212,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2090
2212
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2091
2213
|
* it with the package version on every release — never hand-edit it.
|
|
2092
2214
|
*/
|
|
2093
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2215
|
+
declare const SDK_VERSION = "0.0.0-dev.202610010927.3739fd3";
|
|
2094
2216
|
/** The request header every published Haven client sends. */
|
|
2095
2217
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2096
2218
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -3192,4 +3314,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
3192
3314
|
*/
|
|
3193
3315
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
3194
3316
|
|
|
3195
|
-
export {
|
|
3317
|
+
export { AgentPaymentNextAction as $, type AgentPaymentWarning as A, type X402Erc7710Settlement as B, type CloseTaskBudgetResult as C, type X402McpCallContext as D, type SignData as E, type ResumeAuthorizedX402Input as F, type ResumeX402PaymentInput as G, type HavenClientConfig as H, type X402ResumeState as I, type X402McpTransport as J, type X402MerchantCallContext as K, HavenError as L, AGENT_PAYMENT_FAILURE_CODE_VALUES as M, AGENT_PAYMENT_NEXT_ACTION_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, AGENT_PAYMENT_PHASE_VALUES as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AGENT_PAYMENT_RAIL_VALUES as U, type AgentNextStep as V, type AgentPaymentEnumSchema as W, type X402PaymentRequired as X, AgentPaymentFailureCode as Y, AgentPaymentFailureCodeDescriptions as Z, AgentPaymentFailureCodeSchema as _, type HavenClientUpdate as a, type SweepConfirmation as a$, AgentPaymentNextActionDescriptions as a0, AgentPaymentNextActionSchema as a1, AgentPaymentPhase as a2, AgentPaymentPhaseDescriptions as a3, AgentPaymentPhaseSchema as a4, AgentPaymentRail as a5, AgentPaymentRailDescriptions as a6, AgentPaymentRailSchema as a7, type AgentPaymentSummary as a8, AgentPaymentWarningCode as a9, MAX_TASK_BUDGET_TTL_SECONDS as aA, type MachinePaymentRail as aB, MerchantTimeoutError as aC, NEXT_TOOL_SERVER_NAMES as aD, NEXT_TOOL_SERVER_ROLES as aE, type NextStep as aF, type NextStepArguments as aG, type NextStepHandoff as aH, type NextStepInput as aI, type NextStepTarget as aJ, type NextStepTargets as aK, type NextToolServerRole as aL, PACKED_USER_OPERATION_FIELDS as aM, type PaymentFee as aN, type PaymentNextAction as aO, type PaymentPhase as aP, type PaymentStatus as aQ, ROOT_AUTHORITY as aR, SDK_CLIENT_IDENTITY as aS, SDK_VERSION as aT, SIGNER_UPDATE_FALLBACK as aU, SWEEP_BASE_CHAIN_ID as aV, SWEEP_BASE_SEPOLIA_CHAIN_ID as aW, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aX, SWEEP_BASE_USDC_ADDRESS as aY, type SettlementChildExpectation as aZ, SignerRefusalCode as a_, type AgentPurchaseSummary as aa, CONNECTOR_PACKAGE_NAME as ab, type CatalogSubmissionAccepted as ac, DEFAULT_CONFIRMATION_TIMEOUT_MS as ad, DEFAULT_NEXT_TOOL_BY_ACTION as ae, DIRECT_SIGN_CONTEXT_VERSION as af, ENTRY_POINT_V07 as ag, ERC7710_ASSET_TRANSFER_METHOD as ah, HAVEN_CLIENT_HEADER as ai, HAVEN_CONNECTOR_CHANNEL as aj, HAVEN_MINIMUM_NODE_VERSION as ak, HYBRID_DELEGATOR_DOMAIN_NAME as al, HYBRID_DELEGATOR_DOMAIN_VERSION as am, type HavenAgentAllowanceSummary as an, type HavenAgentReadiness as ao, type HavenAllowance as ap, HavenApiError as aq, type HavenCatalogMerchant as ar, type HavenListScope as as, HavenPaymentStateError as at, HavenSigningError as au, HavenTimeoutError as av, HavenTypedDataRefusedError as aw, HavenUnsupportedSignerVersionError as ax, HavenUserOpBindingError as ay, HavenZeroSettlementHashError as az, type PaymentResult as b, readClientUpdate as b$, type SweepEip712Domain as b0, type SweepEntry as b1, type SweepExpectedAuth as b2, type SweepPreparation as b3, type SweepSubmitResult as b4, type SweepTypedData as b5, TASK_SIGN_CONTEXT_VERSION as b6, TRANSFER_WITH_AUTHORIZATION_TYPES as b7, TYPED_DATA_NOT_ALLOWED as b8, type TaskBudgetCloseExpectation as b9, buildSweepTypedData as bA, buildX402ExpectedMessage as bB, compareNodeVersions as bC, connectorRerunCommand as bD, connectorSpec as bE, connectorUpgradeCommand as bF, createNextStepBuilder as bG, decodeBase64Json as bH, decodeBase64Utf8 as bI, defaultNextToolFor as bJ, deriveDelegateAccountAddress as bK, encodeBase64Json as bL, encodeBase64Utf8 as bM, encodePaymentProof as bN, hashDelegation as bO, havenClientIdentity as bP, isConnectorChannel as bQ, isErc7710Option as bR, isPackedUserOperationTypedData as bS, isSupportedNodeVersion as bT, isSweepableChain as bU, isTaskChildTypedData as bV, normalizePaymentRequired as bW, packedUserOperationHash as bX, parseNextTool as bY, parsePaymentRequired as bZ, parsePaymentRequiredResponse as b_, type TaskChildExpectation as ba, type TaskChildTypedData as bb, type UnsupportedNodeVersionMessageOptions as bc, X402AlreadySettledError as bd, X402Erc7710AlreadySettledError as be, type X402ExpectedAuth as bf, type X402ExpectedContext as bg, type X402PaymentHeaderContext as bh, X402PaymentHeaderValidationError as bi, type X402PaymentOption as bj, type X402RequestSnapshot as bk, type X402SchemeSelection as bl, X402TaskBudgetMismatchError as bm, X402UnexpectedStatusError as bn, X402_LEGACY_PAYMENT_HEADER_NAME as bo, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bp, X402_PAYMENT_HEADER_NAME as bq, X402_PAYMENT_HEADER_NAMES_SENT as br, X402_PAYMENT_REQUIRED_HEADER_NAME as bs, X402_PAYMENT_RESPONSE_HEADER_NAME as bt, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bu, assertBoundDirectPaymentUserOp as bv, assertOwnTaskBudgetCloseUserOp as bw, assertOwnTaskChild as bx, assertUserOpTypedDataBinding as by, buildSweepAuthorizationMessage as bz, type PaymentIntent as c, renderNextTool as c0, resolveConnectorChannel as c1, resolveTokenBySymbol as c2, resolveTokenFromAddress as c3, selectErc7710PaymentOption as c4, selectPaymentOption as c5, selectStandardPaymentOption as c6, selectX402SettlementScheme as c7, signerUpdateFallback as c8, sweepUsdcAddress as c9, sweepUsdcDomain as ca, toStandardPaymentRequirements as cb, unsupportedNodeVersionMessage as cc, validateStandardX402PaymentHeader as cd, verifySettlementChild as ce, x402AssetTransferMethod as cf, x402AuthorizationAmount as cg, x402FacilitatorAddresses as ch, x402V2PaymentEnvelope as ci, type DelegationForHashing as cj, CAVEAT_ENFORCERS as ck, CAVEAT_TYPEHASH as cl, DELEGATION_MANAGER as cm, DELEGATION_TYPEHASH as cn, DIRECT_PAYMENT_CHAIN_IDS as co, EXECUTE_ABI as cp, HYBRID_DELEGATOR_IMPLEMENTATION as cq, MAX_SETTLEMENT_WINDOW_SECONDS as cr, SIMPLE_FACTORY_ADDRESS as cs, type SettlementChildTypedData as ct, assertFundingLegPaysDelegate as cu, assertOwnSettlementChild as cv, chainIdForNetwork as cw, isSettlementChildTypedData as cx, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type SubmitSubBudgetResult as u, type HavenPendingSubBudgetSignature as v, type CloseSubBudgetResult as w, type PaymentResumeState as x, type X402Receipt as y, type X402Quote as z };
|
|
@@ -794,6 +794,81 @@ interface HavenAgentSummary extends HavenAgent {
|
|
|
794
794
|
* budgets", not a fetch failure).
|
|
795
795
|
*/
|
|
796
796
|
taskBudgets: HavenTaskBudgetSummary[];
|
|
797
|
+
/**
|
|
798
|
+
* #3506: the sub-budget rows THIS agent must still sign as the DELEGATING
|
|
799
|
+
* agent — the owner issued a sub-budget (a parent-child row for this agent
|
|
800
|
+
* plus a grant to the sub-agent), and each row is `pending` until this
|
|
801
|
+
* agent's delegate key signs it (or `closing` until it signs the close).
|
|
802
|
+
* A derived VIEW, populated from `GET /sub-budgets?status=awaiting_signature`;
|
|
803
|
+
* empty (never throws) against a backend that predates the filter.
|
|
804
|
+
*/
|
|
805
|
+
pendingSubBudgetSignatures: HavenPendingSubBudgetSignature[];
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* #3506: one sub-budget row awaiting THIS agent's signature — what
|
|
809
|
+
* `haven_get_agent` carries per row so the agent can call
|
|
810
|
+
* `haven_sign { sub_budget_id }` then `haven_submit { sub_budget_id, signature }`.
|
|
811
|
+
*/
|
|
812
|
+
interface HavenPendingSubBudgetSignature {
|
|
813
|
+
subBudgetId: string;
|
|
814
|
+
/** The parent-child row a grant hangs under; null on the parent-child row itself (they share a tree). */
|
|
815
|
+
parentSubBudgetId: string | null;
|
|
816
|
+
/** `open`: sign the child delegation (row is pending). `close`: sign the revocation (row is closing). */
|
|
817
|
+
purpose: 'open' | 'close';
|
|
818
|
+
/** `parent-child`: this agent's own narrowing of its budget. `grant`: the slice delegated to the sub-agent. */
|
|
819
|
+
what: 'parent-child' | 'grant';
|
|
820
|
+
/** The sub-agent that holds the grant; null on this agent's own parent-child row. */
|
|
821
|
+
subAgentId: string | null;
|
|
822
|
+
tokenAddress: string;
|
|
823
|
+
recipientAddress: string | null;
|
|
824
|
+
periodAmountAtomic: string;
|
|
825
|
+
expiresAt: number;
|
|
826
|
+
isExpired: boolean;
|
|
827
|
+
}
|
|
828
|
+
/** #3506: sub-budget lifecycle status, as the wire names it. */
|
|
829
|
+
type HavenSubBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
|
|
830
|
+
/** #3506: `RawSubBudget`, camelCased — what the SDK sub-budget methods return. */
|
|
831
|
+
interface HavenSubBudget {
|
|
832
|
+
id: string;
|
|
833
|
+
agentId: string;
|
|
834
|
+
parentAgentId: string;
|
|
835
|
+
parentSubBudgetId: string | null;
|
|
836
|
+
chainId: number;
|
|
837
|
+
tokenAddress: string;
|
|
838
|
+
recipientAddress: string | null;
|
|
839
|
+
parentDelegationHash: string;
|
|
840
|
+
delegationHash: string;
|
|
841
|
+
label: string | null;
|
|
842
|
+
periodAmountAtomic: string;
|
|
843
|
+
status: HavenSubBudgetStatus;
|
|
844
|
+
expiresAt: number;
|
|
845
|
+
isExpired: boolean;
|
|
846
|
+
createdAt: string;
|
|
847
|
+
openedAt: string | null;
|
|
848
|
+
closedAt: string | null;
|
|
849
|
+
closeTxHash: string | null;
|
|
850
|
+
}
|
|
851
|
+
/** #3506: `POST /sub-budgets/:id/submit` — opened (from pending) or closed (from closing). */
|
|
852
|
+
interface SubmitSubBudgetResult {
|
|
853
|
+
subBudget: HavenSubBudget;
|
|
854
|
+
status: 'open' | 'closed';
|
|
855
|
+
/** Present only once the close UserOp lands (`status === 'closed'` from `closing`). */
|
|
856
|
+
closeTxHash?: string;
|
|
857
|
+
}
|
|
858
|
+
/** #3506: the sign data a live-child close returns (the revocation UserOp's typed data). */
|
|
859
|
+
interface HavenSubBudgetCloseSignData {
|
|
860
|
+
signature_scheme: 'eip712_userop';
|
|
861
|
+
typed_data: Record<string, unknown>;
|
|
862
|
+
user_op_hash: string;
|
|
863
|
+
}
|
|
864
|
+
/** #3506: `POST /sub-budgets/:id/close`. */
|
|
865
|
+
interface CloseSubBudgetResult {
|
|
866
|
+
subBudget: HavenSubBudget;
|
|
867
|
+
/** `closed` on a trivial close (never signed, or already expired); absent when a close signature is pending. */
|
|
868
|
+
status?: 'closed';
|
|
869
|
+
/** Present only when the close needed a signature (a live child). */
|
|
870
|
+
signData?: HavenSubBudgetCloseSignData;
|
|
871
|
+
nextAction?: string;
|
|
797
872
|
}
|
|
798
873
|
/** #3329: task-budget lifecycle status, as the wire names it. */
|
|
799
874
|
type HavenTaskBudgetStatus = 'pending' | 'open' | 'closing' | 'closed';
|
|
@@ -808,6 +883,22 @@ interface HavenTaskBudget {
|
|
|
808
883
|
delegationHash: string;
|
|
809
884
|
label: string | null;
|
|
810
885
|
maxAtomic: string;
|
|
886
|
+
/**
|
|
887
|
+
* #3501: camelCase form of `spent_atomic` — the live enforcer figure.
|
|
888
|
+
* Present on GET reads of an open task budget; null when the read failed;
|
|
889
|
+
* absent when the response did not read the chain.
|
|
890
|
+
*/
|
|
891
|
+
spentAtomic?: string | null;
|
|
892
|
+
/**
|
|
893
|
+
* #3501: what the chain will still allow through this child (cap minus
|
|
894
|
+
* spent, clamped at zero). A failed read is null — never the full cap.
|
|
895
|
+
*/
|
|
896
|
+
remainingAtomic?: string | null;
|
|
897
|
+
/**
|
|
898
|
+
* #3501: provenance of `remainingAtomic`, the parent allowance's honesty
|
|
899
|
+
* flag (`onchain.remainingIsFromChain`, #1319) on the task-budget surface.
|
|
900
|
+
*/
|
|
901
|
+
remainingIsFromChain?: boolean;
|
|
811
902
|
status: HavenTaskBudgetStatus;
|
|
812
903
|
expiresAt: number;
|
|
813
904
|
isExpired: boolean;
|
|
@@ -820,6 +911,15 @@ interface HavenTaskBudget {
|
|
|
820
911
|
* #3329: the condensed row `getAgentSummary()` carries per open, unexpired
|
|
821
912
|
* task budget — enough to render a "reserved by open task budgets" line and
|
|
822
913
|
* a task-budget list without a second read.
|
|
914
|
+
*
|
|
915
|
+
* #3501: each row also carries the budget-visibility figure the issue asks
|
|
916
|
+
* for — what the chain will still allow through this child — so an agent
|
|
917
|
+
* reading `haven_get_agent` can tell BEFORE its next payment whether the
|
|
918
|
+
* task budget will refuse it. `remainingAtomic` is null when the on-chain
|
|
919
|
+
* read failed (never the full cap as remaining), and
|
|
920
|
+
* `remainingIsFromChain` is the same honesty flag the parent allowance's
|
|
921
|
+
* `onchain.remainingIsFromChain` carries (#1319): true = live enforcer
|
|
922
|
+
* read, false = the read failed and the figures are null.
|
|
823
923
|
*/
|
|
824
924
|
interface HavenTaskBudgetSummary {
|
|
825
925
|
id: string;
|
|
@@ -827,6 +927,28 @@ interface HavenTaskBudgetSummary {
|
|
|
827
927
|
tokenAddress: string;
|
|
828
928
|
maxAtomic: string;
|
|
829
929
|
maxDisplay: string;
|
|
930
|
+
/**
|
|
931
|
+
* #3501: spent so far through this child, from the enforcer's `spentMap`.
|
|
932
|
+
* Null when the on-chain read failed; also null for a budget whose
|
|
933
|
+
* delegation the read could not speak for.
|
|
934
|
+
*/
|
|
935
|
+
spentAtomic: string | null;
|
|
936
|
+
/**
|
|
937
|
+
* #3501: `maxAtomic` minus spent, clamped at zero. Null — never the full
|
|
938
|
+
* cap — when the on-chain read failed.
|
|
939
|
+
*/
|
|
940
|
+
remainingAtomic: string | null;
|
|
941
|
+
/**
|
|
942
|
+
* #3501: true when `remainingAtomic` came from the live enforcer read,
|
|
943
|
+
* false when that read failed (spent/remaining are then null).
|
|
944
|
+
*/
|
|
945
|
+
remainingIsFromChain: boolean;
|
|
946
|
+
/**
|
|
947
|
+
* #3501: human form of `remainingAtomic` ("0.001 USDC"), derived by the
|
|
948
|
+
* same formatter as `maxDisplay`. Null exactly when `remainingAtomic` is
|
|
949
|
+
* null — a failed read never renders as an amount.
|
|
950
|
+
*/
|
|
951
|
+
remainingDisplay: string | null;
|
|
830
952
|
recipientAddress: string | null;
|
|
831
953
|
expiresAt: number;
|
|
832
954
|
}
|
|
@@ -2090,7 +2212,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2090
2212
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2091
2213
|
* it with the package version on every release — never hand-edit it.
|
|
2092
2214
|
*/
|
|
2093
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2215
|
+
declare const SDK_VERSION = "0.0.0-dev.202610010927.3739fd3";
|
|
2094
2216
|
/** The request header every published Haven client sends. */
|
|
2095
2217
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2096
2218
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -3192,4 +3314,4 @@ declare function encodeBase64Json(value: unknown): string;
|
|
|
3192
3314
|
*/
|
|
3193
3315
|
declare function decodeBase64Json<T>(value: string, label?: string): T;
|
|
3194
3316
|
|
|
3195
|
-
export {
|
|
3317
|
+
export { AgentPaymentNextAction as $, type AgentPaymentWarning as A, type X402Erc7710Settlement as B, type CloseTaskBudgetResult as C, type X402McpCallContext as D, type SignData as E, type ResumeAuthorizedX402Input as F, type ResumeX402PaymentInput as G, type HavenClientConfig as H, type X402ResumeState as I, type X402McpTransport as J, type X402MerchantCallContext as K, HavenError as L, AGENT_PAYMENT_FAILURE_CODE_VALUES as M, AGENT_PAYMENT_NEXT_ACTION_VALUES as N, type OpenTaskBudgetResult as O, type PaymentRequest as P, AGENT_PAYMENT_PHASE_VALUES as Q, type RawPaymentParties as R, type SweepResult as S, type TaskBudgetSignContext as T, AGENT_PAYMENT_RAIL_VALUES as U, type AgentNextStep as V, type AgentPaymentEnumSchema as W, type X402PaymentRequired as X, AgentPaymentFailureCode as Y, AgentPaymentFailureCodeDescriptions as Z, AgentPaymentFailureCodeSchema as _, type HavenClientUpdate as a, type SweepConfirmation as a$, AgentPaymentNextActionDescriptions as a0, AgentPaymentNextActionSchema as a1, AgentPaymentPhase as a2, AgentPaymentPhaseDescriptions as a3, AgentPaymentPhaseSchema as a4, AgentPaymentRail as a5, AgentPaymentRailDescriptions as a6, AgentPaymentRailSchema as a7, type AgentPaymentSummary as a8, AgentPaymentWarningCode as a9, MAX_TASK_BUDGET_TTL_SECONDS as aA, type MachinePaymentRail as aB, MerchantTimeoutError as aC, NEXT_TOOL_SERVER_NAMES as aD, NEXT_TOOL_SERVER_ROLES as aE, type NextStep as aF, type NextStepArguments as aG, type NextStepHandoff as aH, type NextStepInput as aI, type NextStepTarget as aJ, type NextStepTargets as aK, type NextToolServerRole as aL, PACKED_USER_OPERATION_FIELDS as aM, type PaymentFee as aN, type PaymentNextAction as aO, type PaymentPhase as aP, type PaymentStatus as aQ, ROOT_AUTHORITY as aR, SDK_CLIENT_IDENTITY as aS, SDK_VERSION as aT, SIGNER_UPDATE_FALLBACK as aU, SWEEP_BASE_CHAIN_ID as aV, SWEEP_BASE_SEPOLIA_CHAIN_ID as aW, SWEEP_BASE_SEPOLIA_USDC_ADDRESS as aX, SWEEP_BASE_USDC_ADDRESS as aY, type SettlementChildExpectation as aZ, SignerRefusalCode as a_, type AgentPurchaseSummary as aa, CONNECTOR_PACKAGE_NAME as ab, type CatalogSubmissionAccepted as ac, DEFAULT_CONFIRMATION_TIMEOUT_MS as ad, DEFAULT_NEXT_TOOL_BY_ACTION as ae, DIRECT_SIGN_CONTEXT_VERSION as af, ENTRY_POINT_V07 as ag, ERC7710_ASSET_TRANSFER_METHOD as ah, HAVEN_CLIENT_HEADER as ai, HAVEN_CONNECTOR_CHANNEL as aj, HAVEN_MINIMUM_NODE_VERSION as ak, HYBRID_DELEGATOR_DOMAIN_NAME as al, HYBRID_DELEGATOR_DOMAIN_VERSION as am, type HavenAgentAllowanceSummary as an, type HavenAgentReadiness as ao, type HavenAllowance as ap, HavenApiError as aq, type HavenCatalogMerchant as ar, type HavenListScope as as, HavenPaymentStateError as at, HavenSigningError as au, HavenTimeoutError as av, HavenTypedDataRefusedError as aw, HavenUnsupportedSignerVersionError as ax, HavenUserOpBindingError as ay, HavenZeroSettlementHashError as az, type PaymentResult as b, readClientUpdate as b$, type SweepEip712Domain as b0, type SweepEntry as b1, type SweepExpectedAuth as b2, type SweepPreparation as b3, type SweepSubmitResult as b4, type SweepTypedData as b5, TASK_SIGN_CONTEXT_VERSION as b6, TRANSFER_WITH_AUTHORIZATION_TYPES as b7, TYPED_DATA_NOT_ALLOWED as b8, type TaskBudgetCloseExpectation as b9, buildSweepTypedData as bA, buildX402ExpectedMessage as bB, compareNodeVersions as bC, connectorRerunCommand as bD, connectorSpec as bE, connectorUpgradeCommand as bF, createNextStepBuilder as bG, decodeBase64Json as bH, decodeBase64Utf8 as bI, defaultNextToolFor as bJ, deriveDelegateAccountAddress as bK, encodeBase64Json as bL, encodeBase64Utf8 as bM, encodePaymentProof as bN, hashDelegation as bO, havenClientIdentity as bP, isConnectorChannel as bQ, isErc7710Option as bR, isPackedUserOperationTypedData as bS, isSupportedNodeVersion as bT, isSweepableChain as bU, isTaskChildTypedData as bV, normalizePaymentRequired as bW, packedUserOperationHash as bX, parseNextTool as bY, parsePaymentRequired as bZ, parsePaymentRequiredResponse as b_, type TaskChildExpectation as ba, type TaskChildTypedData as bb, type UnsupportedNodeVersionMessageOptions as bc, X402AlreadySettledError as bd, X402Erc7710AlreadySettledError as be, type X402ExpectedAuth as bf, type X402ExpectedContext as bg, type X402PaymentHeaderContext as bh, X402PaymentHeaderValidationError as bi, type X402PaymentOption as bj, type X402RequestSnapshot as bk, type X402SchemeSelection as bl, X402TaskBudgetMismatchError as bm, X402UnexpectedStatusError as bn, X402_LEGACY_PAYMENT_HEADER_NAME as bo, X402_MAX_AUTHORIZATION_WINDOW_SECONDS as bp, X402_PAYMENT_HEADER_NAME as bq, X402_PAYMENT_HEADER_NAMES_SENT as br, X402_PAYMENT_REQUIRED_HEADER_NAME as bs, X402_PAYMENT_RESPONSE_HEADER_NAME as bt, X402_SETTLEMENT_FORWARD_MARGIN_SECONDS as bu, assertBoundDirectPaymentUserOp as bv, assertOwnTaskBudgetCloseUserOp as bw, assertOwnTaskChild as bx, assertUserOpTypedDataBinding as by, buildSweepAuthorizationMessage as bz, type PaymentIntent as c, renderNextTool as c0, resolveConnectorChannel as c1, resolveTokenBySymbol as c2, resolveTokenFromAddress as c3, selectErc7710PaymentOption as c4, selectPaymentOption as c5, selectStandardPaymentOption as c6, selectX402SettlementScheme as c7, signerUpdateFallback as c8, sweepUsdcAddress as c9, sweepUsdcDomain as ca, toStandardPaymentRequirements as cb, unsupportedNodeVersionMessage as cc, validateStandardX402PaymentHeader as cd, verifySettlementChild as ce, x402AssetTransferMethod as cf, x402AuthorizationAmount as cg, x402FacilitatorAddresses as ch, x402V2PaymentEnvelope as ci, type DelegationForHashing as cj, CAVEAT_ENFORCERS as ck, CAVEAT_TYPEHASH as cl, DELEGATION_MANAGER as cm, DELEGATION_TYPEHASH as cn, DIRECT_PAYMENT_CHAIN_IDS as co, EXECUTE_ABI as cp, HYBRID_DELEGATOR_IMPLEMENTATION as cq, MAX_SETTLEMENT_WINDOW_SECONDS as cr, SIMPLE_FACTORY_ADDRESS as cs, type SettlementChildTypedData as ct, assertFundingLegPaysDelegate as cu, assertOwnSettlementChild as cv, chainIdForNetwork as cw, isSettlementChildTypedData as cx, type X402AuthorizationOptions as d, type X402Intent as e, type PaymentStatusResult as f, type HavenAgent as g, type HavenAgentSummary as h, type SweepPrepareResponse as i, type SweepAuthorization as j, type SweepSubmitResponse as k, type HavenAllowanceSummary as l, type HavenBalanceCoverage as m, type PostPurchaseAllowanceSummary as n, type HavenCatalogEntry as o, type HavenCatalogSubmission as p, type HavenPaymentReceipt as q, type HavenPaymentReceiptsPage as r, type HavenTaskBudget as s, type SubmitTaskBudgetResult as t, type SubmitSubBudgetResult as u, type HavenPendingSubBudgetSignature as v, type CloseSubBudgetResult as w, type PaymentResumeState as x, type X402Receipt as y, type X402Quote as z };
|