@haven_ai/signer 0.5.0-alpha.1 → 0.7.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 +12 -6
- package/dist/cli.cjs +481 -22
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +482 -23
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +482 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -4
- package/dist/index.d.ts +39 -4
- package/dist/index.js +483 -24
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -43,8 +43,12 @@ every "rerun the connector" hint it prints names the channel THIS build was
|
|
|
43
43
|
published under, so a build installed from a non-production channel tells you
|
|
44
44
|
to reinstall from that same channel rather than sending you to production.
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
backend's expected-context version
|
|
46
|
+
That command SETS UP an agent. To update a signer that has fallen behind the
|
|
47
|
+
backend's expected-context version on a machine that is already set up, run
|
|
48
|
+
the connector doctor instead — `npx -y @haven_ai/connect@<channel> --doctor` —
|
|
49
|
+
and then the `--repair` line it prints; a bare re-run stops at "Missing
|
|
50
|
+
--setup" (#3412). Every update hint this signer prints names that form. To run
|
|
51
|
+
the signer directly:
|
|
48
52
|
|
|
49
53
|
```sh
|
|
50
54
|
HAVEN_DELEGATE_KEY=0x... npx @haven_ai/signer@alpha
|
|
@@ -61,7 +65,7 @@ It exposes four stdio MCP tools, all sign-only:
|
|
|
61
65
|
|
|
62
66
|
| Tool | Does | Emits |
|
|
63
67
|
|---|---|---|
|
|
64
|
-
| `haven_sign` | Sign one payment. Preferred form is `{ payment_id }` alone — the signer fetches the exact payload itself. Signs only Haven-prepared payloads (#3272, #3281): a direct-payment `PackedUserOperation` from this signer's own delegate account whose only call redeems a delegation made to that account, or — against a Haven-signed context, which it records and binds — an EIP-3009 funding leg of that same shape paying this signer's own delegate EOA, or an erc7710 settlement child from this signer's own account; other typed data is refused (`TYPED_DATA_NOT_ALLOWED`) | `{ signature }` or `{ signature,
|
|
68
|
+
| `haven_sign` | Sign one payment, or (#3329) one task-budget open/close. Preferred form is `{ payment_id }` alone for a payment, or `{ task_budget_id }` alone (mutually exclusive with `payment_id`) for a task-budget open/close — the signer fetches the exact payload itself either way. Signs only Haven-prepared payloads (#3272, #3281, #3329): a direct-payment `PackedUserOperation` from this signer's own delegate account whose only call redeems a delegation made to that account EITHER directly OR through a self-delegated task-budget child under it (the two-link `[task child, budget]` chain), or — against a Haven-signed context, which it records and binds — an EIP-3009 funding leg of that same shape paying this signer's own delegate EOA, or an erc7710 settlement child from this signer's own account; other typed data is refused (`TYPED_DATA_NOT_ALLOWED`) | `{ signature }`, `{ signature, x402_binding }`, or `{ signature, task_budget_id, purpose }` |
|
|
65
69
|
| `haven_sign_x402` | One-shot x402: funding signature **and** the merchant header in a single local call (`haven_sign` + `haven_x402_sign_header`). `{ payment_id }` alone is the preferred call | `{ signature, x402_binding, payment_header, accepted }` |
|
|
66
70
|
| `haven_x402_sign_header` | Build + sign the EIP-3009 merchant payment header, only when the fresh merchant `payment_required` matches the recorded `x402_binding` | `{ payment_header, accepted }` |
|
|
67
71
|
| `haven_sign_sweep_delegate` | Sign a Haven-prepared gasless EIP-3009 sweep that recovers stranded funds from the delegate wallet back to your own account. Never broadcasts | `{ signature }` |
|
|
@@ -121,8 +125,10 @@ sender is THIS signer's own delegate account (the counterfactual
|
|
|
121
125
|
HybridDeleGator for the delegate key, derived offline — `delegate-account.ts` in `@haven_ai/sdk`);
|
|
122
126
|
and its `callData` is a single `execute` to the DelegationManager calling
|
|
123
127
|
`redeemDelegations`, whose arguments are decoded too (`redemption-guard.ts` in `@haven_ai/sdk`):
|
|
124
|
-
exactly one
|
|
125
|
-
|
|
128
|
+
exactly one of two chain shapes (#3329) — a single grant made to this signer's own account by a
|
|
129
|
+
different account, or a two-link `[task child, budget]` chain whose leaf is self-delegated by this
|
|
130
|
+
signer's own account — never an empty chain or any other multi-link shape,
|
|
131
|
+
`SingleDefault` mode, and canonical
|
|
126
132
|
encoding at every level. The argument check matters: an EMPTY permission
|
|
127
133
|
context makes the DelegationManager run the execution as the account itself,
|
|
128
134
|
which would reach `transferOwnership`. A delegate-wallet `TransferWithAuthorization` or `Permit`,
|
|
@@ -335,7 +341,7 @@ carries no x402 context to fund a merchant retry with, so it surfaces the
|
|
|
335
341
|
| `SIGN_CONTEXT_MALFORMED` | The response body was missing `sign_data.typed_data` / `x402_expected` (a pre-#1263 backend), or — on the direct-payment fetch — an unsupported `direct_sign_context_version` or a `signature_scheme` other than `eip712_userop` | `stop_and_tell_user` | `typed_data_b64` | — |
|
|
336
342
|
| `SIGN_CONTEXT_REFUSED` (x402: 410 or `expired`; direct: `expired` only) | x402: the quote's window closed. Direct: the payment's window closed — call `haven_send` / `haven_pay` again with the same `idempotency_key` | `payment_window_expired` | — | x402 only: `retry_with_new_quote: true`; both: `http_status`, and `backend_error_code: 'expired'` when the backend sent one |
|
|
337
343
|
| `SIGN_CONTEXT_REFUSED` (404, direct fetch) | The `payment_id` is not this agent's, or the backend predates #3271 and has no direct route | `stop_and_tell_user` | `typed_data_b64` | `http_status`, `backend_error_code` |
|
|
338
|
-
| `SIGN_CONTEXT_REFUSED` (426 `client_outdated`, #3303) | This signer is below the minimum version the Haven deployment has set (only when one is set). Nothing is signed; the prepared payment is left unsigned.
|
|
344
|
+
| `SIGN_CONTEXT_REFUSED` (426 `client_outdated`, #3303) | This signer is below the minimum version the Haven deployment has set (only when one is set). Nothing is signed; the prepared payment is left unsigned. Run `client_update.upgrade_command` and the repair line it prints, restart the agent runtime, then retry the same call | `stop_and_tell_user` | — | `http_status: 426`, `backend_error_code: 'client_outdated'`, `client_update` (the update command as data); carries `next_tool_omitted_reason`, not the status read |
|
|
339
345
|
| `SIGN_CONTEXT_REFUSED` (other) | Unknown `payment_id` (404, x402 fetch), `already_executed` / `not_signable` (409), a bare 410 retired-rail tombstone (direct fetch) — or `sign_context_unavailable` (409): always on `haven_sign_x402`; on `haven_sign` only when neither route can serve the row | `stop_and_tell_user` | — | `http_status`, `backend_error_code` |
|
|
340
346
|
| `USEROP_BINDING_MISMATCH` | A direct payment's `PackedUserOperation` typed data (from the direct fetch, or a tool argument) does not recompute to its own `payload_hash`, or a fetched direct context is not a `PackedUserOperation` — see [Two ways to use it](#two-ways-to-use-it) above | `stop_and_tell_user` | — | no `http_status` — this is a local recomputation, not a backend refusal |
|
|
341
347
|
| `TYPED_DATA_NOT_ALLOWED` | Typed data without an x402 context that is not a bound direct-payment `PackedUserOperation` (#3272): wrong chain, not this signer's own account, a call other than `execute` → DelegationManager → `redeemDelegations`, or a redemption whose delegations are empty, not made to this account, or in a non-default mode — see the allowlist paragraph above. Reachable by `payment_id` when Haven serves such a payload | `stop_and_tell_user` | — | no `http_status` — a local shape check, not a backend refusal |
|