@haven_ai/sdk 0.1.34-alpha.0 → 0.1.36-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 -1
- package/dist/index.cjs +241 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +366 -8
- package/dist/index.d.ts +366 -8
- package/dist/index.js +224 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -526,7 +526,8 @@ interface HavenAgent {
|
|
|
526
526
|
chainId: number;
|
|
527
527
|
/**
|
|
528
528
|
* Which on-chain policy primitive gates this agent's spend (#1306): the
|
|
529
|
-
* legacy Safe AllowanceModule (
|
|
529
|
+
* legacy Safe AllowanceModule (retired — no account can enter it since
|
|
530
|
+
* #1984, and it cannot spend since #1986) or the delegation
|
|
530
531
|
* rail's active budget delegations (#1090). Read-only reporting — the
|
|
531
532
|
* on-chain state is the actual gate either way, this only says which
|
|
532
533
|
* mechanism a caller should read/derive from.
|
|
@@ -648,7 +649,8 @@ interface HavenAgentSummary extends HavenAgent {
|
|
|
648
649
|
* Spend-authority readiness: hosted identity + on-chain remaining spend
|
|
649
650
|
* authority. Deliberately named for what it covers — the LOCAL signer's
|
|
650
651
|
* availability is NOT included and must be verified separately (a signer
|
|
651
|
-
* tool call, or
|
|
652
|
+
* tool call, or the connector's `--doctor`, whose exact command this build
|
|
653
|
+
* renders from `HAVEN_CONNECTOR_CHANNEL` — see `connector-channel.ts`).
|
|
652
654
|
*/
|
|
653
655
|
spend_authority_readiness: HavenAgentReadiness;
|
|
654
656
|
allowances: HavenAgentAllowanceSummary[];
|
|
@@ -990,8 +992,34 @@ interface AgentPaymentWarning {
|
|
|
990
992
|
*/
|
|
991
993
|
interface AgentNextStep {
|
|
992
994
|
next_action: AgentPaymentNextAction;
|
|
993
|
-
/**
|
|
995
|
+
/**
|
|
996
|
+
* Claude-family namespaced tool name for the next call
|
|
997
|
+
* (`mcp__<server>__<tool>`), when one exists.
|
|
998
|
+
*
|
|
999
|
+
* **Namespaced with the DEFAULT server names**, which is the most the hosted
|
|
1000
|
+
* server can know: local server names are the client's own config and never
|
|
1001
|
+
* reach Haven. Two runtimes are already not the default — Codex names servers
|
|
1002
|
+
* by config key (`haven`, `haven_signer`), and a connector run with
|
|
1003
|
+
* `--name <slug>` wires `haven-<slug>` / `haven-signer-<slug>` (#1694). On
|
|
1004
|
+
* either, this field and `next_tool_server` name a server the client does not
|
|
1005
|
+
* have. Prefer {@link AgentNextStep.next_tool_server_role} plus
|
|
1006
|
+
* {@link AgentNextStep.next_tool_name} whenever your servers are not the
|
|
1007
|
+
* default pair; see #2550.
|
|
1008
|
+
*/
|
|
994
1009
|
next_tool?: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* The server half of `next_tool`, unprefixed — `haven` or `haven-signer`.
|
|
1012
|
+
* Carries the same default-name caveat as `next_tool` (#1588, #2550).
|
|
1013
|
+
*/
|
|
1014
|
+
next_tool_server?: string;
|
|
1015
|
+
/** The bare tool name, callable on whichever server plays the role below. */
|
|
1016
|
+
next_tool_name?: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* Which of the CLIENT'S OWN servers to call (#2550). Runtime-neutral, and
|
|
1019
|
+
* the field to resolve against when your server names are not the defaults —
|
|
1020
|
+
* it names a role rather than a name the hosted server had to guess.
|
|
1021
|
+
*/
|
|
1022
|
+
next_tool_server_role?: 'hosted' | 'signer';
|
|
995
1023
|
/** Small literal arguments for next_tool. Bulky fields are referenced by reason. */
|
|
996
1024
|
next_arguments?: Record<string, unknown>;
|
|
997
1025
|
/** False when the agent should stop and involve the user before continuing. */
|
|
@@ -1264,6 +1292,16 @@ type SignerRefusalCode = (typeof SignerRefusalCode)[keyof typeof SignerRefusalCo
|
|
|
1264
1292
|
* this sentence is exactly how the two surfaces could start disagreeing about
|
|
1265
1293
|
* what to do.
|
|
1266
1294
|
*/
|
|
1295
|
+
declare function signerUpdateFallback(channel?: string): string;
|
|
1296
|
+
/**
|
|
1297
|
+
* The same sentence rendered for THIS build's channel (#2423). Every existing
|
|
1298
|
+
* consumer keeps importing this constant and keeps getting a string; the only
|
|
1299
|
+
* thing that moved is that `alpha` is no longer typed into it.
|
|
1300
|
+
*
|
|
1301
|
+
* The hosted MCP server is the one caller that does NOT use this constant: it
|
|
1302
|
+
* is deployed rather than published, so it renders `signerUpdateFallback()`
|
|
1303
|
+
* with the channel its own environment names.
|
|
1304
|
+
*/
|
|
1267
1305
|
declare const SIGNER_UPDATE_FALLBACK: string;
|
|
1268
1306
|
/**
|
|
1269
1307
|
* Thrown by the local signer when a Haven-signed binding (x402 expected
|
|
@@ -2259,13 +2297,36 @@ type SharedToolKey = keyof typeof toolDescriptions;
|
|
|
2259
2297
|
* auto-install the skill into runtime skills folders.
|
|
2260
2298
|
*
|
|
2261
2299
|
* `packages/frontend/src/lib/agent-skill-bundle.ts` keeps a deliberately
|
|
2262
|
-
* decoupled inline copy (the download fallback): frontend
|
|
2263
|
-
*
|
|
2264
|
-
*
|
|
2300
|
+
* decoupled inline copy (the download fallback): the frontend does not depend
|
|
2301
|
+
* on the SDK, so it can deploy standalone on Vercel without an unpublished
|
|
2302
|
+
* export. It is NOT `@haven_ai/*`-free — it takes `@haven_ai/core` with the
|
|
2303
|
+
* `"*"` workspace pin — and this comment said otherwise until #2537 checked
|
|
2304
|
+
* the manifest; the material point is the one that survives, and it is about
|
|
2305
|
+
* the SDK specifically. A parity test in that package's test suite imports
|
|
2265
2306
|
* this canonical string and asserts byte-for-byte equality, so the two copies
|
|
2266
2307
|
* cannot drift.
|
|
2308
|
+
*
|
|
2309
|
+
* **The onboarding section (#2537) is COMPOSED, not written here.** Its rule
|
|
2310
|
+
* sentences are interpolated from `agent-guidance.ts`, which is also where the
|
|
2311
|
+
* backend's setup prompt and the `/for-agents.md` runbook get them: a rule an
|
|
2312
|
+
* agent meets twice must be one text, or the two copies drift into
|
|
2313
|
+
* contradicting each other in front of a reader with no way to tell which is
|
|
2314
|
+
* current. The prose around them is skill-only and lives here.
|
|
2315
|
+
*
|
|
2316
|
+
* **Those three bullets are quoted in the setup prompt's own voice**, where
|
|
2317
|
+
* the USER is speaking: "me"/"I" are the user, and "the command above" is the
|
|
2318
|
+
* connector command printed directly above them there — neither of which
|
|
2319
|
+
* holds in this file, which addresses the agent throughout and prints no
|
|
2320
|
+
* command. Any future user-voice quote here needs the same two-referent
|
|
2321
|
+
* gloss, and it must sit BEFORE the quote rather than after: the first draft
|
|
2322
|
+
* put it after, and both the reviewer and the design reviewer independently
|
|
2323
|
+
* found that an agent reading top-to-bottom meets `relay ... to me` before
|
|
2324
|
+
* it learns whose "me" that is — on the one instruction the section itself
|
|
2325
|
+
* calls the highest-priority one. `AGENT_APPROVAL_RELAY_PROSE_SENTENCE` is a
|
|
2326
|
+
* live sibling constant not pulled in here; if it ever is, this applies to it
|
|
2327
|
+
* too (design review, #2537).
|
|
2267
2328
|
*/
|
|
2268
|
-
declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules. Use when the user asks to send, pay, tip, or transfer crypto \u2014 or when a request hits an HTTP 402 (x402) paywall.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; a payment above the remaining budget is declined \u2014\nnothing is paid past the rules the user set.\n\nHosted tools run in the `mcp__haven__` namespace. Local signing tools run in\nthe `mcp__haven-signer__` namespace and keep the delegate key on this machine.\nThat namespacing is Claude-family; other runtimes name the servers by their\nown config keys (Codex: `haven`, `haven_signer`). Tool results carry the\nexact next step (`next_action`, `next_tool`, `next_arguments`, plus the\nruntime-neutral `next_tool_server` + `next_tool_name` \u2014 the bare tool name\non that logical server, whatever your runtime calls it).\nFollow those fields first; the prose below is fallback and orientation, not\nthe source of truth.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Identity and budget\n\nDo not guess the wallet address, network, or budget.\n\nFor instant orientation at the start of a session, read the non-secret\n`agent.json` the connector wrote to your Haven credential directory (typically\n`~/.haven/agents/<agent-id>/agent.json` \u2014 if you don't know the agent id, list\n`~/.haven/agents/` to find the folder). It\nholds your agent id, Haven wallet address, network, and *configured* per-token\nbudget, and contains no keys \u2014 the fastest way to answer \"who am I and what may\nI spend\" with no round trip. If that file is absent (some setups don't write\nit), use the tools below instead.\n\nBefore any payment, confirm the *live remaining* budget with the tools \u2014\n`agent.json` shows the configured budget, not what is left after recent\nspending:\n\n- `mcp__haven__haven_get_agent` \u2014 the recommended first call: identity\n (wallet, network) plus `spend_authority_readiness` (`ready` / `needs_approval` /\n `revoked`) and live remaining per-token allowance, in one shot. That signal\n covers hosted identity and on-chain spend authority only \u2014 it cannot see the\n local signer; the signer is verified by calling any signer tool.\n- `mcp__haven__haven_get_allowances` \u2014 detailed per-token breakdown\n (configured, spent, reset window) when you need more than the summary.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is declined before any money moves \u2014 tell the user; they can raise\nthe budget in the Haven dashboard, or wait for the period reset.\n\n## Paying\n\n**Catalog purchases \u2014 the primary path for MCP merchants:**\n\n1. `mcp__haven__haven_discover_tools` to find a payable service and its\n `catalog_id`.\n2. If the user needs the live price before authorizing a cap, call\n `mcp__haven__haven_quote_catalog_purchase` with `catalog_id`. It is\n read-only and informational only: it never reserves a price or creates a\n payment. Tell the user its `amount` / `amount_atomic`, then choose a cap.\n3. `mcp__haven__haven_prepare_catalog_purchase` with `catalog_id` and a\n spending cap. A cap is REQUIRED on this tool and is best practice on every\n paid call below too \u2014 it caps what the LIVE merchant quote may charge,\n checked before any funding intent is created. Write it the way the user\n said it: `max_amount_human` is whole tokens, so \"no more than 1 USDC\" is\n `max_amount_human: \"1\"`. (`max_amount` is the atomic-unit form, where\n \"1\" means 0.000001 USDC \u2014 do not convert by hand, and never send both.)\n4. Then FOLLOW THE RESPONSE'S GUIDANCE FIELDS: `next_action`, `next_tool`,\n and `next_arguments` name the exact next call \u2014 act on those first; the\n prose in this section is fallback and debugging detail. If the catalog\n entry is missing or degraded, the response instead names\n `mcp__haven__haven_pay_mcp_tool` (merchant URL, tool name, arguments) as\n the manual fallback.\n\n**Signing:** `mcp__haven-signer__haven_sign_x402` with `payment_id` ONLY \u2014\nthe local signer fetches the exact signing bytes AND `payment_required`\nitself, so never relay `typed_data` or the 402 blob yourself. If the signer\nreports its fetched context carried no `payment_required` (older backend),\nre-call with `payment_required` added verbatim. Fallback for an older signer\nor backend: re-run the quote/prepare tool with the SAME `idempotency_key`\nplus `include_signing_payload=true`, then pass `payload_hash`,\n`x402_expected` (the nested `x402.expected` object), and\n`typed_data`/`typed_data_b64` through unchanged.\n\n**Settle:** `mcp__haven__haven_settle_mcp_tool` with `payment_id`,\n`signature`, and `payment_header` ONLY \u2014 Haven rehydrates the merchant call\ncontext (`merchant_url`, `tool_name`, `arguments`, `mcp_transport`)\nserver-side from `payment_id`. Pass those four fields explicitly only as a\nversion-skew fallback when Haven has no stored context for the id \u2014 both or\nnone together, never just one. If the settle result carries `settled: false`,\nfunding has not confirmed \u2014 follow the result's guidance fields and check\nstatus later, do not re-pay.\n\nStep-by-step alternative (also key-safe; for an older signer or backend, or\nwhen you already have a merchant URL and tool name instead of a\n`catalog_id`): if the user needs the live price before choosing a cap, first\ncall `mcp__haven__haven_quote_mcp_tool` with that merchant URL, tool name,\nand arguments. It is informational only; then call\n`mcp__haven__haven_pay_mcp_tool` with the same inputs and the explicit cap.\nThe paid call always obtains a fresh quote before it creates any intent. Then\ncontinue `mcp__haven__haven_pay_mcp_tool` \u2192\n`mcp__haven-signer__haven_sign` \u2192 `mcp__haven__haven_submit` \u2192\n`mcp__haven-signer__haven_x402_sign_header` \u2192\n`mcp__haven__haven_complete_mcp_tool`. Call that last step with\n`payment_id` and the signer's `payment_header` ONLY. It does not take\n`payment_required`: Haven rehydrates the merchant call context\n(`merchant_url`, `tool_name`, `arguments`, `mcp_transport`) and the\n402 server-side from `payment_id`, exactly as at settle. Pass that context\nexplicitly only as a version-skew fallback when Haven has no stored context\nfor the id \u2014 `merchant_url` and `tool_name` both or none together, never\njust one.\nThe returned `expires_at` is the signing window; if a tool returns\n`PAYMENT_WINDOW_EXPIRED`, re-run the same quote/prepare tool with the same\n`idempotency_key`. Do not call the merchant yourself \u2014 Haven completes the\nmerchant leg for you.\n\n**Direct transfer / non-MCP paywall:** `mcp__haven__haven_pay` with\nrecipient, amount, and token for a plain transfer. For an arbitrary,\nnon-MCP x402 paywall: `mcp__haven__haven_quote_x402` to get a quote, then\n`mcp__haven__haven_pay_x402_quote` \u2014 follow the result's guidance fields\nfirst and sign in the local Haven signer. On THIS path Haven does not talk to\nthe merchant: `mcp__haven-signer__haven_sign_x402` returns both\n`signature` and `payment_header`; relay `signature` with\n`mcp__haven__haven_submit`, then retry the paywalled URL yourself with\n`payment_header`. Do not pass that call's `x402_binding` to\n`mcp__haven-signer__haven_x402_sign_header` \u2014 the one-shot already spent it\nbuilding the header, so the call can only refuse. Then tell Haven what the\nmerchant answered: `mcp__haven__haven_report_x402_outcome` with the\n`payment_id`, `outcome` (`\"accepted\"` for a 2xx, else `\"rejected\"`)\nand the `merchant_status` you got. Because Haven never contacted that\nmerchant, this is the only way it can learn the purchase failed \u2014 without it a\nfailed purchase reads as complete for fifteen minutes. (The SDK's own\n`haven_pay_x402` tool does perform the merchant retry itself; that tool is\nnot part of the hosted MCP surface.) If the process\ncrashes after payment, a later `mcp__haven__haven_get_payment_status` call\nmay report `nextAction: 'retry_original_x402_request'` \u2014 only then call\n`mcp__haven__haven_resume_x402_payment` with the preserved resume state or\npayment id, instead of paying again.\n\n**Catalog tool arguments:** when `haven_discover_tools` returns\n`tool_arguments`, pass that object unchanged as the pay tool's\n`arguments` field (for example\n`tool_arguments: { \"tier\": \"50gb\" }` -> `arguments: { \"tier\": \"50gb\" }`).\n\n**Prices:** show the user the live price from a read-only quote or the pay-tool\nresult, never a catalog price. `haven_discover_tools` prices are indicative\n(`price_is_indicative`) and can be stale. A read-only quote is informational\nonly and does not reserve a price; the later paid call re-quotes and enforces\nthe cap. The pay-tool result's `amount` / `amount_atomic` is the merchant's\nown quoted price for that call \u2014 a ceiling the merchant settles at or below \u2014\nso present it as the most the user will pay. It is a price, not an approval:\nthe payment goes through only if it also fits the cap you set and the on-chain\nbudget the user signed, which is enforced on-chain rather than by Haven.\n\n**Status:** `mcp__haven__haven_get_payment_status` with a `payment_id` to\ncheck on in-flight payments. Do not poll in a tight loop.\n\n## Declines and stop signals\n\n- A payment outside the agent's rules \u2014 above the remaining budget, wrong\n recipient, or expired budget \u2014 is declined before any money moves. Nothing\n is queued; tell the user, who can raise the budget in Haven.\n- `safe_to_continue: false` on a guidance block is a stop signal in\n machine-readable form: stop and involve the user before calling anything\n else for this payment.\n- Never ask the user for private keys. Signing happens only in the local Haven\n signer; the hosted Haven tools never receive the signing key. If a tool\n reports a missing or invalid credential, tell the user to re-run the Haven\n setup command.\n\n## Failure handling\n\nHaven tool failures are shaped like `{ success: false, code, message, ... }`\nor older `{ error, status, details? }` responses. Branch on `code` when\npresent and surface `message` or `error` verbatim. Common cases:\n\n- `insufficient_funds`: the Haven wallet doesn't hold enough of that token.\n Suggest the user add funds in the Haven dashboard.\n- `PRICE_EXCEEDS_MAX`: the live merchant price exceeded your cap. No funds\n moved; ask the user before retrying with a higher one.\n- `AMBIGUOUS_MAX_AMOUNT`: you sent both `max_amount` and\n `max_amount_human`. Nothing was contacted or spent \u2014 re-send with exactly\n one (`max_amount_human` for a cap the user stated in tokens).\n- `MAX_AMOUNT_UNCONVERTIBLE`: `max_amount_human` does not fit this quote's\n asset \u2014 unknown decimals, or more decimal places than the asset supports.\n Round the cap, or send an exact atomic `max_amount`.\n- `PAYMENT_WINDOW_EXPIRED`: re-run the quote/prepare tool with the same\n `idempotency_key`, then sign the fresh payload.\n- `MERCHANT_REJECTED_AFTER_FUNDING`: the merchant refused the paid retry.\n Stop-and-sweep \u2014 stop retrying the merchant and use\n `mcp__haven__haven_sweep_delegate` to recover stranded delegate funds.\n- `MERCHANT_UNRESPONSIVE_AFTER_FUNDING`: funding confirmed on-chain, but the\n merchant never answered the paid retry. This is NOT proof of rejection \u2014 the\n merchant may still settle late. Verify-then-sweep, never a blind sweep:\n check `mcp__haven__haven_get_payment_status`, retry\n `mcp__haven__haven_complete_mcp_tool` ONCE, and only sweep with\n `mcp__haven__haven_sweep_delegate` if no settlement appears.\n- Budget exceeded: tell the user how much remains (from\n `mcp__haven__haven_get_allowances`) and that they can raise the budget in\n Haven.\n\n## Reporting after a purchase\n\nA settled `mcp__haven__haven_settle_mcp_tool` response carries\n`agent_summary.purchase_summary` and the remaining post-purchase allowance\nin `allowance` \u2014 report the product, Haven-derived payment/transaction\nfields, and what is left from those fields directly. `result` is optional\nraw merchant evidence; never use it to decide whether the purchase was paid.\nDo not call `haven_get_agent` or `haven_get_allowances` again just to\nreport a purchase you already made.\n\n## Revoke\n\nIf this agent's credential may have leaked, tell the user to pause or revoke\nthe agent in the Haven dashboard under Agents. New requests stop immediately\nfor that credential.\n";
|
|
2329
|
+
declare const HAVEN_SKILL_MD = "---\nname: haven-pay\ndescription: Pay for things from the user's Haven wallet within their agent rules, and set Haven up when it is not yet connected. Use when the user asks to send, pay, tip, or transfer crypto; when a request hits an HTTP 402 (x402) paywall; or when they ask to create a Haven account, create an agent, or connect one.\n---\n\n# Haven: pay from a Haven wallet\n\nThis skill lets the agent make payments from the user's Haven wallet through\nthe Haven MCP tools. Every payment is checked against the agent's on-chain\nbudget before money moves; a payment above the remaining budget is declined \u2014\nnothing is paid past the rules the user set.\n\nHosted tools run in the `mcp__haven__` namespace. Local signing tools run in\nthe `mcp__haven-signer__` namespace and keep the delegate key on this machine.\nThat namespacing is Claude-family; other runtimes name the servers by their\nown config keys (Codex: `haven`, `haven_signer`). Tool results carry the\nexact next step (`next_action`, `next_tool`, `next_arguments`, plus the\nruntime-neutral `next_tool_server` + `next_tool_name` \u2014 the bare tool name\non that logical server, whatever your runtime calls it).\nFollow those fields first; the prose below is fallback and orientation, not\nthe source of truth.\n\n## When to use this skill\n\n- The user asks to send money, pay someone, tip, donate, or transfer tokens.\n- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,\n then retry the original request.\n\n## Onboarding and setup\n\nYou are in this mode when there is no Haven agent credential on this machine,\nor when your user asks you to create a Haven account, create an agent, or\nconnect one \u2014 for themselves or for someone else.\n\n**None of the tools below creates authority.** They spend a budget a human\nalready signed. There is no tool here that opens an account, mints a\ncredential, or approves a budget, so reaching for one of them to \"set Haven\nup\" cannot work; the steps are the ones in this section instead.\n\nStart by reading `/for-agents.md` on the Haven host \u2014 the origin of the\n`api_url` in your `agent.json` if you have one, otherwise the host your user\nnames. It is the full runbook: six steps, which four are your user's, and what\nto say at each hand-off.\n\nTwo of those steps you can do yourself, from the shell with `@haven_ai/cli`\n(installs the `haven` command):\n\n- `haven login` \u2014 a device-code browser flow. It prints a code and a link\n for your user to approve, so you never see or ask for their password. What\n the session can reach is an allow-list, not your user's full authority: it\n creates and manages agents and reads the account, and it cannot approve a\n budget, rotate a key, change a signer or move money \u2014 those are your user's.\n- `haven agents connect` with `--name`, `--budget`, `--token` and\n `--period` \u2014 creates a connection setup and prints two things: the\n connector command the backend built, and the approval link to give your user.\n Add `--run` to execute that command here as a child process.\n- `haven wallets funding` \u2014 prints the paste-ready funding instruction: what\n to send, to which address, on which chain. Read the chain from there rather\n than assuming one. `--wait` polls until the account counts as funded.\n\n**Four steps are your user's, and each one needs a human:** create the account\nand its passkey, fund the wallet, approve every agent's budget, and rotate a\ncredential. You can compose the funding message for them with\n`haven wallets funding`, but you cannot send the money \u2014 that transfer is\ntheirs, from a wallet you have no access to.\n\nRunning the connector command is the step that wires this machine to the new\nagent \u2014 the command `haven agents connect` printed, or the one your user\npasted you from the dashboard. Three rules bind you while you do it, quoted\nunchanged from the setup prompt your user is also holding so the two copies\ncannot drift into contradicting each other. They are written in your user's\nvoice, so read them accordingly: \"me\" and \"I\" below are your user, never\nHaven, and \"the command above\" is that connector command, not anything printed\nin this file. The first rule outranks anything else you were about to do next:\n\n- When a --json outcome reports approval.required: true, your first action must be to relay the approval instruction to me in your own reply \u2014 if the outcome carries approval.url, give me that link; otherwise tell me to return to Haven and approve this agent's budget \u2014 before verifying the connection, restarting anything, or any other step. Never build that link yourself: relay the one the outcome gave you or none at all. Any restart the outcome asks for is a separate instruction to give me afterwards, once the approval is done.\n- Only two changes to the command above are permitted, and no others: appending --json, and \u2014 only if the connector refuses because it could not determine the agent runtime \u2014 re-running it once with --runtime <name> added, naming the harness you are running in, using one of the values that refusal lists. Never invent a runtime name and never change anything else.\n- If the connector refuses with wiring_collision, this machine is already wired to a different agent: relay that refusal to me with the superseded_agent_ids and suggested_name it carries, and let me choose whether to replace the existing wiring or add this agent alongside it. Never pick for me by adding --replace or --name yourself.\n\nDo not print private keys, API keys, credential file contents, or config secrets in chat or logs.\n\n## Identity and budget\n\nDo not guess the wallet address, network, or budget.\n\nFor instant orientation at the start of a session, read the non-secret\n`agent.json` the connector wrote to your Haven credential directory (typically\n`~/.haven/agents/<agent-id>/agent.json` \u2014 if you don't know the agent id, list\n`~/.haven/agents/` to find the folder). It\nholds your agent id, Haven wallet address, network, and *configured* per-token\nbudget, and contains no keys \u2014 the fastest way to answer \"who am I and what may\nI spend\" with no round trip. If that file is absent (some setups don't write\nit), use the tools below instead.\n\nBefore any payment, confirm the *live remaining* budget with the tools \u2014\n`agent.json` shows the configured budget, not what is left after recent\nspending:\n\n- `mcp__haven__haven_get_agent` \u2014 the recommended first call: identity\n (wallet, network) plus `spend_authority_readiness` (`ready` / `needs_approval` /\n `revoked`) and live remaining per-token allowance, in one shot. That signal\n covers hosted identity and on-chain spend authority only \u2014 it cannot see the\n local signer; the signer is verified by calling any signer tool.\n- `mcp__haven__haven_get_allowances` \u2014 detailed per-token breakdown\n (configured, spent, reset window) when you need more than the summary.\n\nBudgets reset on a period the user chose. If a payment exceeds the remaining\nbudget it is declined before any money moves \u2014 tell the user; they can raise\nthe budget in the Haven dashboard, or wait for the period reset.\n\n## Paying\n\n**Catalog purchases \u2014 the primary path for MCP merchants:**\n\n1. `mcp__haven__haven_discover_tools` to find a payable service and its\n `catalog_id`.\n2. If the user needs the live price before authorizing a cap, call\n `mcp__haven__haven_quote_catalog_purchase` with `catalog_id`. It is\n read-only and informational only: it never reserves a price or creates a\n payment. Tell the user its `amount` / `amount_atomic`, then choose a cap.\n3. `mcp__haven__haven_prepare_catalog_purchase` with `catalog_id` and a\n spending cap. A cap is REQUIRED on this tool and is best practice on every\n paid call below too \u2014 it caps what the LIVE merchant quote may charge,\n checked before any funding intent is created. Write it the way the user\n said it: `max_amount_human` is whole tokens, so \"no more than 1 USDC\" is\n `max_amount_human: \"1\"`. (`max_amount` is the atomic-unit form, where\n \"1\" means 0.000001 USDC \u2014 do not convert by hand, and never send both.)\n4. Then FOLLOW THE RESPONSE'S GUIDANCE FIELDS: `next_action`, `next_tool`,\n and `next_arguments` name the exact next call \u2014 act on those first; the\n prose in this section is fallback and debugging detail. If the catalog\n entry is missing or degraded, the response instead names\n `mcp__haven__haven_pay_mcp_tool` (merchant URL, tool name, arguments) as\n the manual fallback.\n\n**Signing:** `mcp__haven-signer__haven_sign_x402` with `payment_id` ONLY \u2014\nthe local signer fetches the exact signing bytes AND `payment_required`\nitself, so never relay `typed_data` or the 402 blob yourself. If the signer\nreports its fetched context carried no `payment_required` (older backend),\nre-call with `payment_required` added verbatim. Fallback for an older signer\nor backend: re-run the quote/prepare tool with the SAME `idempotency_key`\nplus `include_signing_payload=true`, then pass `payload_hash`,\n`x402_expected` (the nested `x402.expected` object), and\n`typed_data`/`typed_data_b64` through unchanged.\n\n**Settle:** `mcp__haven__haven_settle_mcp_tool` with `payment_id`,\n`signature`, and `payment_header` ONLY \u2014 Haven rehydrates the merchant call\ncontext (`merchant_url`, `tool_name`, `arguments`, `mcp_transport`)\nserver-side from `payment_id`. Pass those four fields explicitly only as a\nversion-skew fallback when Haven has no stored context for the id \u2014 both or\nnone together, never just one. If the settle result carries `settled: false`,\nfunding has not confirmed \u2014 follow the result's guidance fields and check\nstatus later, do not re-pay.\n\nStep-by-step alternative (also key-safe; for an older signer or backend, or\nwhen you already have a merchant URL and tool name instead of a\n`catalog_id`): if the user needs the live price before choosing a cap, first\ncall `mcp__haven__haven_quote_mcp_tool` with that merchant URL, tool name,\nand arguments. It is informational only; then call\n`mcp__haven__haven_pay_mcp_tool` with the same inputs and the explicit cap.\nThe paid call always obtains a fresh quote before it creates any intent. Then\ncontinue `mcp__haven__haven_pay_mcp_tool` \u2192\n`mcp__haven-signer__haven_sign` \u2192 `mcp__haven__haven_submit` \u2192\n`mcp__haven-signer__haven_x402_sign_header` \u2192\n`mcp__haven__haven_complete_mcp_tool`. Call that last step with\n`payment_id` and the signer's `payment_header` ONLY. It does not take\n`payment_required`: Haven rehydrates the merchant call context\n(`merchant_url`, `tool_name`, `arguments`, `mcp_transport`) and the\n402 server-side from `payment_id`, exactly as at settle. Pass that context\nexplicitly only as a version-skew fallback when Haven has no stored context\nfor the id \u2014 `merchant_url` and `tool_name` both or none together, never\njust one.\nThe returned `expires_at` is the signing window; if a tool returns\n`PAYMENT_WINDOW_EXPIRED`, re-run the same quote/prepare tool with the same\n`idempotency_key`. Do not call the merchant yourself \u2014 Haven completes the\nmerchant leg for you.\n\n**Direct transfer / non-MCP paywall:** `mcp__haven__haven_pay` with\n`to`, `amount`, and `token` for a plain transfer. For an arbitrary,\nnon-MCP x402 paywall: `mcp__haven__haven_quote_x402` to get a quote, then\n`mcp__haven__haven_pay_x402_quote` \u2014 follow the result's guidance fields\nfirst and sign in the local Haven signer. On THIS path Haven does not talk to\nthe merchant: `mcp__haven-signer__haven_sign_x402` returns both\n`signature` and `payment_header`; relay `signature` with\n`mcp__haven__haven_submit`, then retry the paywalled URL yourself with\n`payment_header`. Do not pass that call's `x402_binding` to\n`mcp__haven-signer__haven_x402_sign_header` \u2014 the one-shot already spent it\nbuilding the header, so the call can only refuse. Then tell Haven what the\nmerchant answered: `mcp__haven__haven_report_x402_outcome` with the\n`payment_id`, `outcome` (`\"accepted\"` for a 2xx, else `\"rejected\"`)\nand the `merchant_status` you got. Because Haven never contacted that\nmerchant, this is the only way it can learn the purchase failed \u2014 without it a\nfailed purchase reads as complete for fifteen minutes. (The SDK's own\n`haven_pay_x402` tool does perform the merchant retry itself; that tool is\nnot part of the hosted MCP surface.) If the process\ncrashes after payment, a later `mcp__haven__haven_get_payment_status` call\nmay report `nextAction: 'retry_original_x402_request'` \u2014 only then call\n`mcp__haven__haven_resume_x402_payment` with the preserved resume state or\npayment id, instead of paying again.\n\n**Catalog tool arguments:** when `haven_discover_tools` returns\n`tool_arguments`, pass that object unchanged as the pay tool's\n`arguments` field (for example\n`tool_arguments: { \"tier\": \"50gb\" }` -> `arguments: { \"tier\": \"50gb\" }`).\n\n**Prices:** show the user the live price from a read-only quote or the pay-tool\nresult, never a catalog price. `haven_discover_tools` prices are indicative\n(`price_is_indicative`) and can be stale. A read-only quote is informational\nonly and does not reserve a price; the later paid call re-quotes and enforces\nthe cap. The pay-tool result's `amount` / `amount_atomic` is the merchant's\nown quoted price for that call \u2014 a ceiling the merchant settles at or below \u2014\nso present it as the most the user will pay. It is a price, not an approval:\nthe payment goes through only if it also fits the cap you set and the on-chain\nbudget the user signed, which is enforced on-chain rather than by Haven.\n\n**Status:** `mcp__haven__haven_get_payment_status` with a `payment_id` to\ncheck on in-flight payments. Do not poll in a tight loop.\n\n## Declines and stop signals\n\n- A payment outside the agent's rules \u2014 above the remaining budget, wrong\n recipient, or expired budget \u2014 is declined before any money moves. Nothing\n is queued; tell the user, who can raise the budget in Haven.\n- `safe_to_continue: false` on a guidance block is a stop signal in\n machine-readable form: stop and involve the user before calling anything\n else for this payment.\n- Never ask the user for private keys. Signing happens only in the local Haven\n signer; the hosted Haven tools never receive the signing key. If a tool\n reports a missing or invalid credential, tell the user to re-run the Haven\n connector command.\n\n## Failure handling\n\nHaven tool failures are shaped like `{ success: false, code, message, ... }`\nor older `{ error, status, details? }` responses. Branch on `code` when\npresent and surface `message` or `error` verbatim. Common cases:\n\n- `insufficient_funds`: the Haven wallet doesn't hold enough of that token.\n Suggest the user add funds in the Haven dashboard.\n- `PRICE_EXCEEDS_MAX`: the live merchant price exceeded your cap. No funds\n moved; ask the user before retrying with a higher one.\n- `AMBIGUOUS_MAX_AMOUNT`: you sent both `max_amount` and\n `max_amount_human`. Nothing was contacted or spent \u2014 re-send with exactly\n one (`max_amount_human` for a cap the user stated in tokens).\n- `MAX_AMOUNT_UNCONVERTIBLE`: `max_amount_human` does not fit this quote's\n asset \u2014 unknown decimals, or more decimal places than the asset supports.\n Round the cap, or send an exact atomic `max_amount`.\n- `PAYMENT_WINDOW_EXPIRED`: re-run the quote/prepare tool with the same\n `idempotency_key`, then sign the fresh payload.\n- `MERCHANT_REJECTED_AFTER_FUNDING`: the merchant refused the paid retry.\n Stop-and-sweep \u2014 stop retrying the merchant and use\n `mcp__haven__haven_sweep_delegate` to recover stranded delegate funds.\n- `MERCHANT_UNRESPONSIVE_AFTER_FUNDING`: funding confirmed on-chain, but the\n merchant never answered the paid retry. This is NOT proof of rejection \u2014 the\n merchant may still settle late. Verify-then-sweep, never a blind sweep:\n check `mcp__haven__haven_get_payment_status`, retry\n `mcp__haven__haven_complete_mcp_tool` ONCE, and only sweep with\n `mcp__haven__haven_sweep_delegate` if no settlement appears.\n- Budget exceeded: tell the user how much remains (from\n `mcp__haven__haven_get_allowances`) and that they can raise the budget in\n Haven.\n\n## Reporting after a purchase\n\nA settled `mcp__haven__haven_settle_mcp_tool` response carries\n`agent_summary.purchase_summary` and the remaining post-purchase allowance\nin `allowance` \u2014 report the product, Haven-derived payment/transaction\nfields, and what is left from those fields directly. `result` is optional\nraw merchant evidence; never use it to decide whether the purchase was paid.\nDo not call `haven_get_agent` or `haven_get_allowances` again just to\nreport a purchase you already made.\n\n## Revoke\n\nIf this agent's credential may have leaked, tell the user to pause or revoke\nthe agent in the Haven dashboard under Agents. New requests stop immediately\nfor that credential.\n";
|
|
2269
2330
|
/** Directory name for the installed skill folder. */
|
|
2270
2331
|
declare const SKILL_FOLDER_NAME = "haven-pay";
|
|
2271
2332
|
/**
|
|
@@ -2279,6 +2340,303 @@ declare const SKILL_FOLDER_NAME = "haven-pay";
|
|
|
2279
2340
|
*/
|
|
2280
2341
|
declare const HAVEN_SKILL_BODY_MD: string;
|
|
2281
2342
|
|
|
2343
|
+
/**
|
|
2344
|
+
* Agent-facing onboarding guidance — canonical copy (#2523, epic #2519).
|
|
2345
|
+
*
|
|
2346
|
+
* Two exports, one source:
|
|
2347
|
+
*
|
|
2348
|
+
* 1. **The shared sentences** — the rules an agent must follow when it runs the
|
|
2349
|
+
* connector. They appear in the backend's `setup_prompt`
|
|
2350
|
+
* (`routes/agent-connection-setups.ts` `buildSetupPrompt`) AND in the runbook
|
|
2351
|
+
* below. Before this file they existed once, inline in the route; the runbook
|
|
2352
|
+
* would have been a second copy, and a second copy of a rule is how the two
|
|
2353
|
+
* drift into contradicting each other in front of an agent that has no way to
|
|
2354
|
+
* tell which is current.
|
|
2355
|
+
* 2. **`HAVEN_AGENT_RUNBOOK_MD`** — the runbook served as
|
|
2356
|
+
* `packages/frontend/public/for-agents.md`, written to the agent whose user
|
|
2357
|
+
* has no Haven account yet. `llms-full.txt`'s quickstart addresses the owner;
|
|
2358
|
+
* this addresses the agent, and its job is to say which steps are the human's
|
|
2359
|
+
* and exactly what to say at each hand-off.
|
|
2360
|
+
*
|
|
2361
|
+
* The frontend keeps the runbook as a static file rather than importing it:
|
|
2362
|
+
* `packages/frontend` has zero `@haven_ai/*` dependencies by design (standalone
|
|
2363
|
+
* Vercel deploys), and `public/` is served as-is. A byte-equality test
|
|
2364
|
+
* (`src/lib/__tests__/for-agents-runbook.test.ts`) pins the served file to this
|
|
2365
|
+
* string, exactly as `agent-skill-bundle.test.ts` pins the skill.
|
|
2366
|
+
*
|
|
2367
|
+
* Wording constraints, recorded because they are not stylistic (owner
|
|
2368
|
+
* constraints 2026-09-04, and `docs/regulatory/casp-risk-guardrails.md`
|
|
2369
|
+
* § Product Copy Rules): the human keeps every signature; there is no headless
|
|
2370
|
+
* account path; the runbook must never suggest the agent enters the user's
|
|
2371
|
+
* password; the owner-signed budget is what authorises a payment, and Haven
|
|
2372
|
+
* constructs and relays.
|
|
2373
|
+
*/
|
|
2374
|
+
/** Secret hygiene — the one rule that survives every mode and every runtime. */
|
|
2375
|
+
declare const AGENT_SECRET_HYGIENE_SENTENCE = "Do not print private keys, API keys, credential file contents, or config secrets in chat or logs.";
|
|
2376
|
+
/** Where the signing key is made, and what Haven receives instead of it. */
|
|
2377
|
+
declare const AGENT_LOCAL_KEY_SENTENCE = "The Haven connector generates the signing key locally and sends Haven only the public signing address plus proof.";
|
|
2378
|
+
/** Sandboxed environments: the command does not change, the environment does. */
|
|
2379
|
+
declare const AGENT_NETWORK_ACCESS_SENTENCE = "Network access is expected: this command downloads the npm package and contacts the Haven API, so if your environment is sandboxed, run it with network access enabled or request network access escalation; that changes the execution environment, not the command, and is not a third command modification.";
|
|
2380
|
+
/** #2483: `--json` is a SHOULD addressed to agents, not to a human pasting the command. */
|
|
2381
|
+
declare const AGENT_JSON_MODE_SENTENCE = "If you are an AI agent running this command yourself rather than a human pasting it, you should append --json: the connector then emits one machine-readable, secret-free result object on stdout with progress on stderr, and returns promptly instead of blocking while it waits for the budget approval.";
|
|
2382
|
+
/** #2483: one gate at a time — the approval relay comes before anything else. */
|
|
2383
|
+
declare const AGENT_APPROVAL_RELAY_JSON_SENTENCE = "When a --json outcome reports approval.required: true, your first action must be to relay the approval instruction to me in your own reply \u2014 if the outcome carries approval.url, give me that link; otherwise tell me to return to Haven and approve this agent's budget \u2014 before verifying the connection, restarting anything, or any other step. Never build that link yourself: relay the one the outcome gave you or none at all. Any restart the outcome asks for is a separate instruction to give me afterwards, once the approval is done.";
|
|
2384
|
+
/** #2486: the prose-mode twin of the sentence above; each mode relays exactly once. */
|
|
2385
|
+
declare const AGENT_APPROVAL_RELAY_PROSE_SENTENCE = "If you ran the command without --json, the connector waits for the approval itself and prints its next steps when it finishes: relay the budget-approval instruction to me \u2014 the approval link if those steps printed one, otherwise that you need to return to Haven and approve this agent's budget \u2014 only if those printed next steps still ask for it. If they report the budget as already approved, there is nothing for me to approve.";
|
|
2386
|
+
/**
|
|
2387
|
+
* #2551, handed to #2528 by PR #2567 so a third writer would not land on the
|
|
2388
|
+
* money-path prompt file for one line.
|
|
2389
|
+
*
|
|
2390
|
+
* The connector's `wiring_collision` refusal is the THIRD case where the agent
|
|
2391
|
+
* owes its user a decision rather than an action of its own — beside
|
|
2392
|
+
* `approval.required` and the runtime-refusal retry. Named explicitly because
|
|
2393
|
+
* the other two are, and an unnamed relay case is one an agent resolves by
|
|
2394
|
+
* guessing: here it would guess `--replace` (silently displacing a working
|
|
2395
|
+
* agent) or `--name` (quietly wiring a second one). Both are the user's call.
|
|
2396
|
+
*/
|
|
2397
|
+
declare const AGENT_WIRING_COLLISION_RELAY_SENTENCE = "If the connector refuses with wiring_collision, this machine is already wired to a different agent: relay that refusal to me with the superseded_agent_ids and suggested_name it carries, and let me choose whether to replace the existing wiring or add this agent alongside it. Never pick for me by adding --replace or --name yourself.";
|
|
2398
|
+
/** #1719: exactly two permitted changes, and the second is bounded by the refusal's own list. */
|
|
2399
|
+
declare const AGENT_COMMAND_MODIFICATION_SENTENCE = "Only two changes to the command above are permitted, and no others: appending --json, and \u2014 only if the connector refuses because it could not determine the agent runtime \u2014 re-running it once with --runtime <name> added, naming the harness you are running in, using one of the values that refusal lists. Never invent a runtime name and never change anything else.";
|
|
2400
|
+
/**
|
|
2401
|
+
* The agent-facing section every published README carries (#2533, A6).
|
|
2402
|
+
*
|
|
2403
|
+
* ONE string, six copies, one instrument. All five npm READMEs plus the repo
|
|
2404
|
+
* README open with dashboard-first instructions, which strand the reader this
|
|
2405
|
+
* epic exists for: an agent whose user has no account yet. This is the entry
|
|
2406
|
+
* that redirects them, and it is defined here rather than written six times
|
|
2407
|
+
* because six hand-maintained copies is exactly the drift #2310 was about —
|
|
2408
|
+
* `agent-guidance.test.ts` fails if any copy differs by a byte.
|
|
2409
|
+
*
|
|
2410
|
+
* TWO links, and the second is not redundant. The path is correct wherever
|
|
2411
|
+
* Haven is actually served and needs no host we do not own (#2520's rule); the
|
|
2412
|
+
* GitHub URL is the one that resolves for a reader on npmjs.com, who has no
|
|
2413
|
+
* origin to resolve a path against. A path alone would be unfollowable in the
|
|
2414
|
+
* place these READMEs are most often read; an absolute app host alone would be
|
|
2415
|
+
* a host nobody owns. Naming both is the honest answer, and the runbook itself
|
|
2416
|
+
* is committed at that path, so the fallback is a real file rather than a
|
|
2417
|
+
* promise.
|
|
2418
|
+
*
|
|
2419
|
+
* Interrogative, not declarative-with-a-question-mark. `llms.txt` states the
|
|
2420
|
+
* same idea declaratively because there it is a LINK TITLE in a list; an H2
|
|
2421
|
+
* whose job is to catch the right reader and let everyone else skip is a
|
|
2422
|
+
* question. The mismatched mood was a haven-design-reviewer finding, fixed
|
|
2423
|
+
* while it was cheap: the string is byte-pinned in six files, so the cost of
|
|
2424
|
+
* changing it only ever goes up.
|
|
2425
|
+
*
|
|
2426
|
+
* It says what the agent CANNOT do first. The account and the passkey are the
|
|
2427
|
+
* user's, always — stating that up front is what stops an agent trying, and it
|
|
2428
|
+
* is the epic invariant no slice may weaken.
|
|
2429
|
+
*/
|
|
2430
|
+
declare const AGENT_README_SECTION_MD = "## Are you an AI agent whose user has no Haven account yet?\n\nRead **`/for-agents.md`** on the Haven host your user gave you \u2014 or\n[the copy in this repository](https://github.com/d-hinders/Haven-AI/blob/dev/packages/frontend/public/for-agents.md)\nif you do not have that host yet.\n\nYour user creates the account and the passkey: those are theirs, they need a\nhuman, and you should never ask for their password. You can do everything else\n\u2014 including running the connector command from the setup prompt they paste you,\nand managing the account from the shell with `@haven_ai/cli`.";
|
|
2431
|
+
/**
|
|
2432
|
+
* The runbook, served at `/for-agents.md`.
|
|
2433
|
+
*
|
|
2434
|
+
* Every link is a same-origin path (#2520): resolve it against the host the
|
|
2435
|
+
* file was fetched from. The npm dist-tags are the placeholder `<channel>`
|
|
2436
|
+
* rather than literals — the connector's command and, since #2617, the CLI's
|
|
2437
|
+
* login in step 1 — for two reasons that point the same way: a published
|
|
2438
|
+
* package must not hard-code one (#2423, guarded by
|
|
2439
|
+
* `scripts/release-bump.test.mjs`), and this string is committed as a static
|
|
2440
|
+
* file, so baking in a channel `release-bump.mjs` later rewrites would put the
|
|
2441
|
+
* served copy out of parity at exactly the moment nobody is reading it. The
|
|
2442
|
+
* page tells the agent to run the command its setup prompt hands it, where the
|
|
2443
|
+
* tag is real and deployment-correct, and to read the CLI's tag from
|
|
2444
|
+
* `/.well-known/haven.json` (`packages.cli.channel`).
|
|
2445
|
+
*
|
|
2446
|
+
* The budget-approval hand-off is now a LINK when the connector has one, and a
|
|
2447
|
+
* tab when it does not — #2528 landed the half of this that was missing.
|
|
2448
|
+
* `ConnectOutcome` (`packages/connect/src/runtime.ts`) carries
|
|
2449
|
+
* `approval: { required, expires_at, url? }`; `url` is the same-origin
|
|
2450
|
+
* `approval_url` the register response returns, so the agent relays a
|
|
2451
|
+
* destination instead of "return to Haven".
|
|
2452
|
+
*
|
|
2453
|
+
* The step-5 hand-off is TWO blockquotes, not one with the alternative in
|
|
2454
|
+
* brackets. It was the bracket form briefly, to save ~110 bytes against the
|
|
2455
|
+
* size ceiling, and haven-design-reviewer was right to push back: this
|
|
2456
|
+
* section's own header says "Send these as your own message", so every other
|
|
2457
|
+
* script in it is paste-ready. A bracketed either/or inside the quote makes
|
|
2458
|
+
* the agent perform text surgery on something presented as copyable — and a
|
|
2459
|
+
* naive relay ships the raw brackets to the human, which reads as broken
|
|
2460
|
+
* rather than as a choice. Two quotes cost bytes and buy back the property
|
|
2461
|
+
* the section is built on. Do not re-compress this to save them.
|
|
2462
|
+
*
|
|
2463
|
+
* `AGENT_WIRING_COLLISION_RELAY_SENTENCE` is deliberately NOT in this page's
|
|
2464
|
+
* rule list, though it IS in the setup prompt (#2551 via #2567). This page's
|
|
2465
|
+
* list is already a curated subset of the prompt's — it omits the network and
|
|
2466
|
+
* local-key sentences and adds the prose-relay one — and a collision can only
|
|
2467
|
+
* happen to an agent that is running the connector, which means it is holding
|
|
2468
|
+
* the prompt, where the sentence is. Repeating it here would cost every agent
|
|
2469
|
+
* that fetches this page bytes for a rule it will be handed at the moment it
|
|
2470
|
+
* applies.
|
|
2471
|
+
*
|
|
2472
|
+
* TWO limits, stated because the copy below depends on both. First, `url` is
|
|
2473
|
+
* OPTIONAL and its absence is normal: a backend older than #2528 sends none,
|
|
2474
|
+
* and `approval.required: false` carries none because there is nothing to
|
|
2475
|
+
* approve — so every sentence here has to work with and without it, which is
|
|
2476
|
+
* why they read "if the outcome carries a link". Second, the outcome still has
|
|
2477
|
+
* NO setup id: #2528 added the link only, and the connector's own status poll
|
|
2478
|
+
* (`GET /:setupId/connector-status`) still answers `{ status, approved_budget }`.
|
|
2479
|
+
* An agent must not construct an approval URL out of parts — it has the whole
|
|
2480
|
+
* one or it has none. `?next=` / `?via=agent` / `?setup=` are the hand-off
|
|
2481
|
+
* link shapes from #2522.
|
|
2482
|
+
*/
|
|
2483
|
+
declare const HAVEN_AGENT_RUNBOOK_MD = "# Haven for agents \u2014 set your user up to let you pay\n\nYou are an AI agent whose user has no Haven account yet, or has one but has not connected you.\n\n> Links below are paths on this same host: resolve them against the URL you fetched this file from.\n\n## What Haven is, in three sentences\n\nYour user gives you a **budget on their own account** \u2014 not their wallet, and not a key to their funds. The budget is a delegation they sign, enforced on-chain: a payment over it, to the wrong recipient, or past its expiry is refused at execution time, not by a dashboard promise. Haven constructs and relays the payments; you get an agent credential and a signing key made on your machine, and your user can revoke the budget without you and without Haven.\n\n## The sequence\n\nFour of the six steps are your user's \u2014 each needs a human signature or a human decision. The rest is yours. If they already have a funded account, start at step 3.\n\n1. **HUMAN \u2014 create the account.** Name, email, password, then a passkey (Face ID / Touch ID) or a wallet. Never offer to enter any of it: you must not have their password, and the passkey is bound to their device. With a terminal, `npx @haven_ai/cli@<channel> login --api <api-url>` afterwards gets you a scoped session for steps 3-4 (that flag or `HAVEN_API_URL`, on the first command \u2014 the session then remembers the backend; **the CLI's built-in default is Haven's hosted production backend**, so on any other deployment an omitted flag connects you somewhere real and wrong rather than failing) \u2014 they approve a code in the browser, you never hold their password. The `<channel>` in that command is the tag your deployment names \u2014 read it from `/.well-known/haven.json` (`packages.cli.channel`), never a tag you pick. Do not hold the process open while you wait: under `--json`, pass `--no-wait` to get the link object back at once, then poll it with `haven login --poll <device_code>` \u2014 one round per invocation, exit 3 while it is still pending, 0 once approved. It can set up agents and read the account; it cannot sign, approve a budget, move funds, or rotate any agent's keys.\n2. **HUMAN \u2014 fund it.** USDC only, no ETH: Haven sponsors the gas. `haven wallets funding` prints the address, the amount **and which chain** in one place; without a CLI session, the dashboard's funding card shows the address and amount and its Receive-funds screen names the chain. Read the chain off whichever you used and put it in your message \u2014 never assume one: a testnet deployment and production both call themselves Haven.\n3. **HUMAN \u2014 create the agent, set its budget**, and paste you the **setup prompt** it hands back. With a CLI session (step 1) you can do this step yourself: `haven agents connect --name <n> --budget <amount> --token USDC --period <minutes>` prints the same connector command and approval link; add `--run` to do step 4 too.\n4. **YOU \u2014 run the connector command** in that prompt (below). It makes your signing key locally, registering only the public address.\n5. **HUMAN \u2014 approve the budget** with their passkey, in the Haven tab they created the agent in: it advances to the approval step by itself once your run registers.\n6. **YOU \u2014 verify, then pay.**\n\n## Budget changes later (second token, raise, revoke)\n\nThe first budget rides the setup above. After the agent exists, a CLI session can construct the LATER changes \u2014 a second token, a bigger amount, a recipient pin, a stop \u2014 and hand your user a link; the human still signs, every time:\n\n```\nhaven budget grant <agentId> --amount <n> --token USDC --period <minutes> [--recipient <address>] [--wait]\nhaven budget revoke <agentId> <delegationHash> [--wait]\n```\n\nThe CLI never signs: it prints a dashboard link, your user opens it and signs with their passkey or wallet. `--wait` polls until the human's signature lands. The hash for `revoke` is in `haven agents show <agentId>`.\n\n## Hand-off scripts\n\nSend these as your own message, `<host>` replaced by the host you fetched this file from. Say what you cannot do, not only what they must.\n\n**Before signup** (step 1):\n\n> I can do everything except the parts that need your signature. Please open `<host>/signup?next=/agents&via=agent` \u2014 name, email, password, then a passkey (Face ID / Touch ID) or a wallet. That is your account's key: I should not have it, and I will never ask for your password. Already have one? `<host>/login?next=/agents`.\n\n**At the passkey step:**\n\n> The passkey must be made on your own device \u2014 it is what keeps the account yours, so nobody, Haven included, can move your funds without you. If this browser cannot, open `<host>/onboarding?next=/agents` on your phone and finish there.\n\n**At funding** (step 2):\n\n> Your Haven account needs USDC before I can pay for anything \u2014 USDC only, no ETH: Haven sponsors the gas. Before you send anything, let me get you the exact address **and network** \u2014 `haven wallets funding` prints both, and the funding card on `<host>/dashboard` shows the same. Please do not send to an address or a chain I have not confirmed with you; a small amount first is fine.\n\n**At the budget** (step 3):\n\n> On `<host>/agents`, create an agent for me and set a budget \u2014 say 25 USDC per day. That is the limit I cannot exceed. It hands back a setup prompt: paste it to me and I run it here.\n\n**At budget approval** (step 5) \u2014 the moment your run reports that approval is required, before anything else. Send the first if your run carried `approval.url`, the second if it did not.\n\n> Setup is done on my side. Approve the budget here: <approval.url>. Approve it with your passkey; nothing can be spent until you do.\n\n> Setup is done on my side. Go back to the Haven tab where you created the agent \u2014 it should now be asking you to approve the budget. Approve it with your passkey; nothing can be spent until you do.\n\n## What you run\n\nThe setup prompt carries a **connector command** shaped like this:\n\n```\nnpx -y @haven_ai/connect@<channel> --setup EXAMPLE-SETUP-TOKEN-NOT-REAL --api <api-url> --ack-local-tools\n```\n\nRun the prompt's version, not this one: the token is one-time, the API URL is the backend's own, and `<channel>` is the npm tag your prompt names \u2014 never a tag you pick. The rules below come from that prompt, so \"me\" in them is your user, not Haven.\n\n- If you are an AI agent running this command yourself rather than a human pasting it, you should append --json: the connector then emits one machine-readable, secret-free result object on stdout with progress on stderr, and returns promptly instead of blocking while it waits for the budget approval.\n- When a --json outcome reports approval.required: true, your first action must be to relay the approval instruction to me in your own reply \u2014 if the outcome carries approval.url, give me that link; otherwise tell me to return to Haven and approve this agent's budget \u2014 before verifying the connection, restarting anything, or any other step. Never build that link yourself: relay the one the outcome gave you or none at all. Any restart the outcome asks for is a separate instruction to give me afterwards, once the approval is done.\n- If you ran the command without --json, the connector waits for the approval itself and prints its next steps when it finishes: relay the budget-approval instruction to me \u2014 the approval link if those steps printed one, otherwise that you need to return to Haven and approve this agent's budget \u2014 only if those printed next steps still ask for it. If they report the budget as already approved, there is nothing for me to approve.\n- Only two changes to the command above are permitted, and no others: appending --json, and \u2014 only if the connector refuses because it could not determine the agent runtime \u2014 re-running it once with --runtime <name> added, naming the harness you are running in, using one of the values that refusal lists. Never invent a runtime name and never change anything else.\n- Do not print private keys, API keys, credential file contents, or config secrets in chat or logs.\n\nIf the approval wait times out, nothing is lost \u2014 your agent is registered and the budget is still waiting to be approved. Send your user the `approval.url` your run reported, or, if it carried none, ask them to finish it in that same Haven tab. The outcome carries no setup id, so never assemble an approval link out of parts \u2014 relay the whole one it gave you or none at all.\n\n## How to verify\n\nCall `haven_get_agent`, one of the Haven MCP tools the connector wires into your runtime in step 4. It returns identity plus `spend_authority_readiness`:\n\n- `ready` \u2014 a budget is live; you can pay.\n- `needs_approval` \u2014 the connector finished, nobody approved yet. Ask your user again, in their Haven tab; there is no queue to wait in.\n- `revoked` \u2014 the credential is not active; ask your user to create a new agent.\n\n`ready` covers hosted identity and the budget only, not your local signer. Check that with `npx -y @haven_ai/connect@<channel> --doctor`, the same tag your prompt named \u2014 a separate command, so the two-changes rule does not bind it.\n\n## If you cannot open a browser\n\nNothing here needs you to. Steps 1-3 are links: hand your user the full `<host>/\u2026` URL and ask them to say when it is done. Step 5 is a link only when your run reported one in `approval.url` \u2014 otherwise it is the tab they already have open, as above. Then poll `haven_get_agent` until it reads `ready`. Do not route around the sign-in wall \u2014 it makes the account theirs, not yours.\n\n## Vocabulary\n\n| Term | What it is |\n|---|---|\n| **setup prompt** | The text the dashboard hands your user to paste to you. Carries the command and its rules. |\n| **connector command** | The `npx -y @haven_ai/connect@\u2026` line you run. One-time token, one use. |\n| **agent credential** | Your API key (`sk_agent_\u2026`), written to `~/.haven`. It identifies you; alone it cannot move money. |\n| **delegate key** | Your signing key, made on this machine and never sent anywhere. |\n| **budget** | The on-chain delegation your user signed. It authorises the payment; Haven constructs and relays it. |\n\nNext: [your agent hit a 402](/402.md) \u00B7 [everything agent-readable](/llms.txt)\n";
|
|
2484
|
+
/**
|
|
2485
|
+
* The **onboarding prompt** — the whole-onboarding text the dashboard offers a
|
|
2486
|
+
* signed-in user to paste to their agent (#2535, epic #2519).
|
|
2487
|
+
*
|
|
2488
|
+
* ## It is NOT the "setup prompt", and the distinction is load-bearing
|
|
2489
|
+
*
|
|
2490
|
+
* `setup prompt` is one of the four canonical agent-facing terms
|
|
2491
|
+
* (`docs/product/copy-guidelines.md` § Agent-facing vocabulary, settled by
|
|
2492
|
+
* #2533 and swept by #2576): it names the text the CONNECT MODAL hands back,
|
|
2493
|
+
* which carries a one-time setup token and the connector command. This string
|
|
2494
|
+
* is a different object with a different lifetime — it exists before any setup
|
|
2495
|
+
* does, contains no token and no secret, and is therefore safe to render to a
|
|
2496
|
+
* signed-in user who has not created an agent yet. Calling both "the setup
|
|
2497
|
+
* prompt" would undo the disambiguation those two issues paid for, so this one
|
|
2498
|
+
* is the **onboarding prompt** wherever it is named.
|
|
2499
|
+
*
|
|
2500
|
+
* ## Why a shared export rather than a route
|
|
2501
|
+
*
|
|
2502
|
+
* The issue offered `GET /agent-connection-setups/agent-prompt` or a static
|
|
2503
|
+
* export. The export wins on cost and on the #2523 precedent: no new route, no
|
|
2504
|
+
* auth question, and no `owner_cli` allow-list entry — and the allow-list is
|
|
2505
|
+
* fail-closed by design, so every entry is a decision. The route would only
|
|
2506
|
+
* earn those three if the prompt had to vary per user, and it deliberately does
|
|
2507
|
+
* not: it names commands and links, never account state.
|
|
2508
|
+
*
|
|
2509
|
+
* ## What keeps it from drifting from the setup prompt
|
|
2510
|
+
*
|
|
2511
|
+
* The two are built from the SAME sentence constants above — this one reuses
|
|
2512
|
+
* the approval-relay and secret-hygiene rules verbatim rather than paraphrasing
|
|
2513
|
+
* them, which is the whole reason those constants exist. A test asserts that
|
|
2514
|
+
* containment, so a reworded copy here fails rather than quietly disagreeing
|
|
2515
|
+
* with what `buildSetupPrompt` tells the same agent minutes later.
|
|
2516
|
+
*
|
|
2517
|
+
* The frontend cannot import this: `packages/frontend` has zero `@haven_ai/*`
|
|
2518
|
+
* runtime dependencies by design (standalone Vercel deploys). It keeps a copy
|
|
2519
|
+
* in `src/lib/agent-onboarding-prompt.ts`, byte-pinned to this string by
|
|
2520
|
+
* `src/lib/__tests__/agent-onboarding-prompt.test.ts`, exactly as the runbook
|
|
2521
|
+
* and the skill are pinned.
|
|
2522
|
+
*
|
|
2523
|
+
* ## The origin placeholder
|
|
2524
|
+
*
|
|
2525
|
+
* `{{HAVEN_ORIGIN}}` is substituted by the renderer with the host the user is
|
|
2526
|
+
* actually signed in to, so dev, preview and production each produce a truthful
|
|
2527
|
+
* prompt from one string. It is a placeholder rather than a build-time constant
|
|
2528
|
+
* for the same reason `<channel>` is one in the runbook: this text is committed,
|
|
2529
|
+
* and a baked host is wrong everywhere except where it was baked.
|
|
2530
|
+
*
|
|
2531
|
+
* ## Wording constraints (same as the runbook's, and not stylistic)
|
|
2532
|
+
*
|
|
2533
|
+
* The human keeps every signature; there is no headless account path; it must
|
|
2534
|
+
* never suggest the agent enters the user's password; the owner-signed budget
|
|
2535
|
+
* is what authorises a payment, and Haven constructs and relays. Every command
|
|
2536
|
+
* it names exists at merge time — `haven login` (#2526) and
|
|
2537
|
+
* `haven agents connect` (#2527) both landed before this shipped, which is the
|
|
2538
|
+
* condition #2535 made blocking.
|
|
2539
|
+
*/
|
|
2540
|
+
declare const AGENT_ONBOARDING_PROMPT = "I have a Haven account and I am signed in at {{HAVEN_ORIGIN}}. Please set up Haven so you can pay for things within a budget I approve.\n\nStart by reading {{HAVEN_ORIGIN}}/for-agents.md \u2014 it is written for you and explains which steps are mine.\n\nThen:\n\n1. Run `npx @haven_ai/cli@<channel> login`. The `<channel>` in that command is the tag your deployment names \u2014 read it from `/.well-known/haven.json` (`packages.cli.channel`), never a tag you pick. It prints a link and a code and does not need my password \u2014 it must never ask for it. Give me the link straight away and wait for me to approve it in my browser.\n2. Once I have approved, run `haven agents connect --name <a name you choose> --budget <amount> --token USDC --period <minutes>` with the budget I tell you. If I have not given you one, ask me before running it. Add `--run` to complete the connection in the same step.\n3. When a --json outcome reports approval.required: true, your first action must be to relay the approval instruction to me in your own reply \u2014 if the outcome carries approval.url, give me that link; otherwise tell me to return to Haven and approve this agent's budget \u2014 before verifying the connection, restarting anything, or any other step. Never build that link yourself: relay the one the outcome gave you or none at all. Any restart the outcome asks for is a separate instruction to give me afterwards, once the approval is done.\n4. Once I have approved the budget, verify with the `haven_get_agent` tool: `ready` means you can pay, `needs_approval` means my approval has not landed yet.\n\nTwo things only I can do: approving that budget with my passkey, and funding the account with USDC on Base \u2014 no ETH, Haven sponsors the gas. Tell me if either is missing rather than working around it.\n\nDo not print private keys, API keys, credential file contents, or config secrets in chat or logs.";
|
|
2541
|
+
|
|
2542
|
+
/**
|
|
2543
|
+
* The npm dist-tag the published Haven packages tell a user to re-run (#2423,
|
|
2544
|
+
* slice 3 of epic #2420).
|
|
2545
|
+
*
|
|
2546
|
+
* ## Why a constant and not a literal
|
|
2547
|
+
*
|
|
2548
|
+
* Roughly a dozen user- and agent-facing strings across `@haven_ai/sdk`,
|
|
2549
|
+
* `@haven_ai/signer`, `@haven_ai/connect` and the hosted MCP server say some
|
|
2550
|
+
* form of "re-run `npx @haven_ai/connect@alpha`". Every one of them was a
|
|
2551
|
+
* hard-coded literal, which is correct only for a build published under the
|
|
2552
|
+
* `alpha` dist-tag. Once `dev`-branch snapshots publish under a `dev` tag
|
|
2553
|
+
* (#2421), a snapshot build telling its tester to re-run `@alpha` would hand
|
|
2554
|
+
* them the production connector — silently replacing the very build they are
|
|
2555
|
+
* testing. So the tag becomes one build-time constant and every hint derives
|
|
2556
|
+
* from it.
|
|
2557
|
+
*
|
|
2558
|
+
* ## Who writes it
|
|
2559
|
+
*
|
|
2560
|
+
* `scripts/release-bump.mjs` rewrites {@link HAVEN_CONNECTOR_CHANNEL} from the
|
|
2561
|
+
* version it is bumping to, using exactly the rule `.github/workflows/publish.yml`
|
|
2562
|
+
* uses to pick the `--tag` for that same version:
|
|
2563
|
+
*
|
|
2564
|
+
* | version | dist-tag / channel |
|
|
2565
|
+
* |---|---|
|
|
2566
|
+
* | `0.1.34-alpha.0` | `alpha` |
|
|
2567
|
+
* | `0.0.0-dev.202609021200.abc1234` | `dev` |
|
|
2568
|
+
* | `0.2.0` | `latest` |
|
|
2569
|
+
*
|
|
2570
|
+
* One rule, two consumers. `scripts/ci/connector-channel-agreement.test.mjs`
|
|
2571
|
+
* executes the workflow's own shell and the bump script's own function over the
|
|
2572
|
+
* same version table and fails if they ever disagree.
|
|
2573
|
+
*
|
|
2574
|
+
* ## Build-time here, run-time there
|
|
2575
|
+
*
|
|
2576
|
+
* A published tarball cannot read a deployment's environment, so for the
|
|
2577
|
+
* published packages the channel is baked in at release time. A surface that is
|
|
2578
|
+
* *deployed* rather than published has no release at which to bake anything in,
|
|
2579
|
+
* so it reads the `HAVEN_CONNECTOR_CHANNEL` environment variable and falls back
|
|
2580
|
+
* to this constant. Two surfaces do that: the hosted MCP server
|
|
2581
|
+
* (`packages/mcp-server/src/connector-channel.ts`) and, since slice 2 (#2422),
|
|
2582
|
+
* the backend's connector handout (`parseConnectorChannel` in
|
|
2583
|
+
* `packages/backend/src/config.ts`). All three readers share one variable name,
|
|
2584
|
+
* one default and one validation pattern, and that agreement is EXECUTED rather
|
|
2585
|
+
* than asserted: `packages/backend/src/__tests__/connector-channel.test.ts`
|
|
2586
|
+
* runs this module's `resolveConnectorChannel` and the backend's
|
|
2587
|
+
* `parseConnectorChannel` over the same input table and fails if they ever
|
|
2588
|
+
* diverge.
|
|
2589
|
+
*
|
|
2590
|
+
* **This says nothing about how any environment is configured.** Setting the
|
|
2591
|
+
* variable anywhere is an operator action (epic #2420, operator step 3); no
|
|
2592
|
+
* code here can observe it and none of this comment asserts it has happened.
|
|
2593
|
+
*/
|
|
2594
|
+
/** The published connector package. Never varies; only its tag does. */
|
|
2595
|
+
declare const CONNECTOR_PACKAGE_NAME = "@haven_ai/connect";
|
|
2596
|
+
/**
|
|
2597
|
+
* The npm dist-tag this build's re-run hints name.
|
|
2598
|
+
*
|
|
2599
|
+
* **Do not hand-edit.** `scripts/release-bump.mjs` owns this literal the same
|
|
2600
|
+
* way it owns `CONNECTOR_VERSION` and its siblings, and
|
|
2601
|
+
* `scripts/release-bump.test.mjs` fails if the two drift.
|
|
2602
|
+
*/
|
|
2603
|
+
declare const HAVEN_CONNECTOR_CHANNEL = "alpha";
|
|
2604
|
+
/** True when `value` is a well-formed dist-tag. */
|
|
2605
|
+
declare function isConnectorChannel(value: string): boolean;
|
|
2606
|
+
/**
|
|
2607
|
+
* Resolve a channel from a deployment's `HAVEN_CONNECTOR_CHANNEL`.
|
|
2608
|
+
*
|
|
2609
|
+
* - unset, empty or whitespace ⇒ `fallback` (dashboards store a cleared
|
|
2610
|
+
* variable as `""`, and that must land on the production-safe value);
|
|
2611
|
+
* - well-formed ⇒ itself;
|
|
2612
|
+
* - anything else ⇒ **throws**. It does not quietly fall back: a typo such as
|
|
2613
|
+
* `dve` would then land on the production channel, and the environment would
|
|
2614
|
+
* look fixed while reproducing the exact defect this slice removes.
|
|
2615
|
+
*
|
|
2616
|
+
* Well-formed-but-wrong (`dve` again) is *not* caught here and cannot be — it
|
|
2617
|
+
* fails later at `npx`, where the error names the package. Stated rather than
|
|
2618
|
+
* implied.
|
|
2619
|
+
*/
|
|
2620
|
+
declare function resolveConnectorChannel(raw: string | undefined | null, fallback?: string): string;
|
|
2621
|
+
/** `@haven_ai/connect@<channel>` — the spec an `npx` invocation names. */
|
|
2622
|
+
declare function connectorSpec(channel?: string): string;
|
|
2623
|
+
/**
|
|
2624
|
+
* The re-run command every hint embeds.
|
|
2625
|
+
*
|
|
2626
|
+
* `connectorRerunCommand()` → `npx @haven_ai/connect@alpha`
|
|
2627
|
+
* `connectorRerunCommand('--doctor')` → `npx @haven_ai/connect@alpha --doctor`
|
|
2628
|
+
*
|
|
2629
|
+
* `args` is appended verbatim so each call site keeps its own flags and its own
|
|
2630
|
+
* surrounding sentence. The wording of those sentences is deliberately NOT
|
|
2631
|
+
* moved here: several are inside signer refusal messages that users and agents
|
|
2632
|
+
* pattern-match on, and this change is meant to move the channel token and
|
|
2633
|
+
* nothing else.
|
|
2634
|
+
*/
|
|
2635
|
+
declare function connectorRerunCommand(args?: string, options?: {
|
|
2636
|
+
channel?: string;
|
|
2637
|
+
npxFlags?: string;
|
|
2638
|
+
}): string;
|
|
2639
|
+
|
|
2282
2640
|
/**
|
|
2283
2641
|
* The Node.js floor Haven's published packages support (#1161).
|
|
2284
2642
|
*
|
|
@@ -2696,4 +3054,4 @@ declare function discoverMerchantMcpUrl(inputUrl: string): Promise<string | null
|
|
|
2696
3054
|
/** Trailing-slash/percent-case echoes compare equal; unparseable never does. */
|
|
2697
3055
|
declare function sameUrl(a: string, b: string): boolean;
|
|
2698
3056
|
|
|
2699
|
-
export { AGENT_PAYMENT_FAILURE_CODE_VALUES, AGENT_PAYMENT_NEXT_ACTION_VALUES, AGENT_PAYMENT_PHASE_VALUES, AGENT_PAYMENT_RAIL_VALUES, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, type CatalogSubmissionAccepted, type ClaudeTool, DEFAULT_CONFIRMATION_TIMEOUT_MS, DISCOVERY_MAX_BYTES, ERC7710_ASSET_TRANSFER_METHOD, HAVEN_MINIMUM_NODE_VERSION, HAVEN_SKILL_BODY_MD, HAVEN_SKILL_MD, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, type HavenCatalogSubmission, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentRail, MerchantTimeoutError, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedX402Input, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepConfirmation, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, X402AlreadySettledError, type X402AuthorizationOptions, type X402Erc7710Settlement, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402MerchantOutcome, type X402MerchantOutcomeReport, type X402PaymentHeaderContext, X402PaymentHeaderValidationError, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, type X402SchemeSelection, 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, decodeBase64Json, decodeBase64Utf8, discoverMerchantMcpUrl, encodeBase64Json, encodeBase64Utf8, encodePaymentProof, havenTools, isErc7710Option, isSupportedNodeVersion, isSweepableChain, normalizePaymentRequired, parsePaymentRequired, parsePaymentRequiredResponse, resolveTokenFromAddress, sameUrl, selectErc7710PaymentOption, selectPaymentOption, selectStandardPaymentOption, selectX402SettlementScheme, signHash, signUserOpTypedDataForDelegation, sweepUsdcAddress, sweepUsdcDomain, toStandardPaymentRequirements, toolDescriptions, unsupportedNodeVersionMessage, validateStandardX402PaymentHeader, verifyPaymentReceipt, verifySignature, x402AssetTransferMethod, x402AuthorizationAmount, x402FacilitatorAddresses, x402V2PaymentEnvelope };
|
|
3057
|
+
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, type AgentNextStep, type AgentPaymentEnumSchema, AgentPaymentFailureCode, AgentPaymentFailureCodeDescriptions, AgentPaymentFailureCodeSchema, AgentPaymentNextAction, AgentPaymentNextActionDescriptions, AgentPaymentNextActionSchema, AgentPaymentPhase, AgentPaymentPhaseDescriptions, AgentPaymentPhaseSchema, AgentPaymentRail, AgentPaymentRailDescriptions, AgentPaymentRailSchema, type AgentPaymentSummary, type AgentPaymentWarning, AgentPaymentWarningCode, type AgentPurchaseSummary, CONNECTOR_PACKAGE_NAME, type CatalogSubmissionAccepted, type ClaudeTool, 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, type HavenAgent, type HavenAgentAllowanceSummary, type HavenAgentReadiness, type HavenAgentSummary, type HavenAllowance, type HavenAllowanceSummary, HavenApiError, type HavenCatalogEntry, type HavenCatalogSubmission, HavenClient, type HavenClientConfig, HavenError, type HavenPaymentReceipt, HavenPaymentStateError, HavenSigningError, HavenTimeoutError, HavenUnsupportedSignerVersionError, MERCHANT_DISCOVERY_PATHS, type MachinePaymentRail, MerchantTimeoutError, type OpenAITool, type PaymentFee, type PaymentIntent, type PaymentNextAction, type PaymentPhase, type PaymentReceipt, type PaymentRequest, type PaymentResult, type PaymentResumeState, type PaymentStatus, type PaymentStatusResult, type PostPurchaseAllowanceSummary, RECEIPT_VERSION, type ReceiptVerification, type ResumeAuthorizedX402Input, type ResumeX402PaymentInput, SIGNER_UPDATE_FALLBACK, SKILL_FOLDER_NAME, SWEEP_BASE_CHAIN_ID, SWEEP_BASE_SEPOLIA_CHAIN_ID, SWEEP_BASE_SEPOLIA_USDC_ADDRESS, SWEEP_BASE_USDC_ADDRESS, type SharedToolKey, type SignData, SignerRefusalCode, type SweepAuthorization, type SweepConfirmation, type SweepEip712Domain, type SweepEntry, type SweepExpectedAuth, type SweepPreparation, type SweepPrepareResponse, type SweepResult, type SweepSubmitResponse, type SweepSubmitResult, type SweepTypedData, TRANSFER_WITH_AUTHORIZATION_TYPES, type ToolDescription, type UnsupportedNodeVersionMessageOptions, X402AlreadySettledError, type X402AuthorizationOptions, type X402Erc7710Settlement, type X402ExpectedAuth, type X402ExpectedContext, type X402Intent, type X402McpCallContext, type X402McpTransport, type X402MerchantCallContext, type X402MerchantOutcome, type X402MerchantOutcomeReport, type X402PaymentHeaderContext, X402PaymentHeaderValidationError, type X402PaymentOption, type X402PaymentRequired, type X402Quote, type X402Receipt, type X402RequestSnapshot, type X402ResumeState, type X402SchemeSelection, 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 };
|