@haven_ai/sdk 0.0.0-dev.202609060835.03f674a → 0.0.0-dev.202609060949.092c4e4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +165 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -5
- package/dist/index.d.ts +28 -5
- package/dist/index.js +165 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4314,10 +4314,121 @@ var havenTools = {
|
|
|
4314
4314
|
openai: openaiTools
|
|
4315
4315
|
};
|
|
4316
4316
|
|
|
4317
|
+
// src/agent-guidance.ts
|
|
4318
|
+
var AGENT_SECRET_HYGIENE_SENTENCE = "Do not print private keys, API keys, credential file contents, or config secrets in chat or logs.";
|
|
4319
|
+
var AGENT_LOCAL_KEY_SENTENCE = "The Haven connector generates the signing key locally and sends Haven only the public signing address plus proof.";
|
|
4320
|
+
var 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.";
|
|
4321
|
+
var 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.";
|
|
4322
|
+
var 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.";
|
|
4323
|
+
var 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.";
|
|
4324
|
+
var 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.";
|
|
4325
|
+
var 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.";
|
|
4326
|
+
var AGENT_README_SECTION_MD = `## Are you an AI agent whose user has no Haven account yet?
|
|
4327
|
+
|
|
4328
|
+
Read **\`/for-agents.md\`** on the Haven host your user gave you \u2014 or
|
|
4329
|
+
[the copy in this repository](https://github.com/d-hinders/Haven-AI/blob/dev/packages/frontend/public/for-agents.md)
|
|
4330
|
+
if you do not have that host yet.
|
|
4331
|
+
|
|
4332
|
+
Your user creates the account and the passkey: those are theirs, they need a
|
|
4333
|
+
human, and you should never ask for their password. You can do everything else
|
|
4334
|
+
\u2014 including running the connector command from the setup prompt they paste you,
|
|
4335
|
+
and managing the account from the shell with \`@haven_ai/cli\`.`;
|
|
4336
|
+
var HAVEN_AGENT_RUNBOOK_MD = `# Haven for agents \u2014 set your user up to let you pay
|
|
4337
|
+
|
|
4338
|
+
You are an AI agent whose user has no Haven account yet, or has one but has not connected you.
|
|
4339
|
+
|
|
4340
|
+
> Links below are paths on this same host: resolve them against the URL you fetched this file from.
|
|
4341
|
+
|
|
4342
|
+
## What Haven is, in three sentences
|
|
4343
|
+
|
|
4344
|
+
Your 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.
|
|
4345
|
+
|
|
4346
|
+
## The sequence
|
|
4347
|
+
|
|
4348
|
+
Four 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.
|
|
4349
|
+
|
|
4350
|
+
1. **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 login\` afterwards gets you a scoped session for steps 3-4 \u2014 they approve a code in the browser, you never hold their password. It can set up agents and read the account; it cannot sign, approve a budget, move funds, or rotate any agent's keys.
|
|
4351
|
+
2. **HUMAN \u2014 fund it.** USDC on Base, to the address the dashboard shows. With a CLI session, \`haven wallets funding\` prints the address and the amount to send.
|
|
4352
|
+
3. **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.
|
|
4353
|
+
4. **YOU \u2014 run the connector command** in that prompt (below). It makes your signing key locally, registering only the public address.
|
|
4354
|
+
5. **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.
|
|
4355
|
+
6. **YOU \u2014 verify, then pay.**
|
|
4356
|
+
|
|
4357
|
+
## Hand-off scripts
|
|
4358
|
+
|
|
4359
|
+
Send 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.
|
|
4360
|
+
|
|
4361
|
+
**Before signup** (step 1):
|
|
4362
|
+
|
|
4363
|
+
> 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\`.
|
|
4364
|
+
|
|
4365
|
+
**At the passkey step:**
|
|
4366
|
+
|
|
4367
|
+
> 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.
|
|
4368
|
+
|
|
4369
|
+
**At funding** (step 2):
|
|
4370
|
+
|
|
4371
|
+
> Your Haven account needs USDC on Base before I can pay for anything \u2014 USDC only, no ETH: Haven sponsors the gas. The dashboard shows the address to send it to; a small amount first is fine. If I have a terminal session, \`haven wallets funding\` prints the address, the amount and an explorer link \u2014 say the word and I will paste them here.
|
|
4372
|
+
|
|
4373
|
+
**At the budget** (step 3):
|
|
4374
|
+
|
|
4375
|
+
> 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.
|
|
4376
|
+
|
|
4377
|
+
**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.
|
|
4378
|
+
|
|
4379
|
+
> Setup is done on my side. Approve the budget here: <approval.url>. Approve it with your passkey; nothing can be spent until you do.
|
|
4380
|
+
|
|
4381
|
+
> 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.
|
|
4382
|
+
|
|
4383
|
+
## What you run
|
|
4384
|
+
|
|
4385
|
+
The setup prompt carries a **connector command** shaped like this:
|
|
4386
|
+
|
|
4387
|
+
\`\`\`
|
|
4388
|
+
npx -y @haven_ai/connect@<channel> --setup EXAMPLE-SETUP-TOKEN-NOT-REAL --api <api-url> --ack-local-tools
|
|
4389
|
+
\`\`\`
|
|
4390
|
+
|
|
4391
|
+
Run 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.
|
|
4392
|
+
|
|
4393
|
+
- ${AGENT_JSON_MODE_SENTENCE}
|
|
4394
|
+
- ${AGENT_APPROVAL_RELAY_JSON_SENTENCE}
|
|
4395
|
+
- ${AGENT_APPROVAL_RELAY_PROSE_SENTENCE}
|
|
4396
|
+
- ${AGENT_COMMAND_MODIFICATION_SENTENCE}
|
|
4397
|
+
- ${AGENT_SECRET_HYGIENE_SENTENCE}
|
|
4398
|
+
|
|
4399
|
+
If 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.
|
|
4400
|
+
|
|
4401
|
+
## How to verify
|
|
4402
|
+
|
|
4403
|
+
Call \`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\`:
|
|
4404
|
+
|
|
4405
|
+
- \`ready\` \u2014 a budget is live; you can pay.
|
|
4406
|
+
- \`needs_approval\` \u2014 the connector finished, nobody approved yet. Ask your user again, in their Haven tab; there is no queue to wait in.
|
|
4407
|
+
- \`revoked\` \u2014 the credential is not active; ask your user to create a new agent.
|
|
4408
|
+
|
|
4409
|
+
\`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.
|
|
4410
|
+
|
|
4411
|
+
## If you cannot open a browser
|
|
4412
|
+
|
|
4413
|
+
Nothing 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.
|
|
4414
|
+
|
|
4415
|
+
## Vocabulary
|
|
4416
|
+
|
|
4417
|
+
| Term | What it is |
|
|
4418
|
+
|---|---|
|
|
4419
|
+
| **setup prompt** | The text the dashboard hands your user to paste to you. Carries the command and its rules. |
|
|
4420
|
+
| **connector command** | The \`npx -y @haven_ai/connect@\u2026\` line you run. One-time token, one use. |
|
|
4421
|
+
| **agent credential** | Your API key (\`sk_agent_\u2026\`), written to \`~/.haven\`. It identifies you; alone it cannot move money. |
|
|
4422
|
+
| **delegate key** | Your signing key, made on this machine and never sent anywhere. |
|
|
4423
|
+
| **budget** | The on-chain delegation your user signed. It authorises the payment; Haven constructs and relays it. |
|
|
4424
|
+
|
|
4425
|
+
Next: [your agent hit a 402](/402.md) \xB7 [everything agent-readable](/llms.txt)
|
|
4426
|
+
`;
|
|
4427
|
+
|
|
4317
4428
|
// src/skill-content.ts
|
|
4318
4429
|
var HAVEN_SKILL_MD = `---
|
|
4319
4430
|
name: haven-pay
|
|
4320
|
-
description: 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
|
|
4431
|
+
description: 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.
|
|
4321
4432
|
---
|
|
4322
4433
|
|
|
4323
4434
|
# Haven: pay from a Haven wallet
|
|
@@ -4343,6 +4454,59 @@ the source of truth.
|
|
|
4343
4454
|
- A request returns HTTP 402 (x402): use the Haven pay tools to settle it,
|
|
4344
4455
|
then retry the original request.
|
|
4345
4456
|
|
|
4457
|
+
## Onboarding and setup
|
|
4458
|
+
|
|
4459
|
+
You are in this mode when there is no Haven agent credential on this machine,
|
|
4460
|
+
or when your user asks you to create a Haven account, create an agent, or
|
|
4461
|
+
connect one \u2014 for themselves or for someone else.
|
|
4462
|
+
|
|
4463
|
+
**None of the tools below creates authority.** They spend a budget a human
|
|
4464
|
+
already signed. There is no tool here that opens an account, mints a
|
|
4465
|
+
credential, or approves a budget, so reaching for one of them to "set Haven
|
|
4466
|
+
up" cannot work; the steps are the ones in this section instead.
|
|
4467
|
+
|
|
4468
|
+
Start by reading \`/for-agents.md\` on the Haven host \u2014 the origin of the
|
|
4469
|
+
\`api_url\` in your \`agent.json\` if you have one, otherwise the host your user
|
|
4470
|
+
names. It is the full runbook: six steps, which four are your user's, and what
|
|
4471
|
+
to say at each hand-off.
|
|
4472
|
+
|
|
4473
|
+
Two of those steps you can do yourself, from the shell with \`@haven_ai/cli\`
|
|
4474
|
+
(installs the \`haven\` command):
|
|
4475
|
+
|
|
4476
|
+
- \`haven login\` \u2014 a device-code browser flow. It prints a code and a link
|
|
4477
|
+
for your user to approve, so you never see or ask for their password. What
|
|
4478
|
+
the session can reach is an allow-list, not your user's full authority: it
|
|
4479
|
+
creates and manages agents and reads the account, and it cannot approve a
|
|
4480
|
+
budget, rotate a key, change a signer or move money \u2014 those are your user's.
|
|
4481
|
+
- \`haven agents connect\` with \`--name\`, \`--budget\`, \`--token\` and
|
|
4482
|
+
\`--period\` \u2014 creates a connection setup and prints two things: the
|
|
4483
|
+
connector command the backend built, and the approval link to give your user.
|
|
4484
|
+
Add \`--run\` to execute that command here as a child process.
|
|
4485
|
+
- \`haven wallets funding\` \u2014 prints the paste-ready funding instruction: what
|
|
4486
|
+
to send, to which address, on which chain. Read the chain from there rather
|
|
4487
|
+
than assuming one. \`--wait\` polls until the account counts as funded.
|
|
4488
|
+
|
|
4489
|
+
**Four steps are your user's, and each one needs a human:** create the account
|
|
4490
|
+
and its passkey, fund the wallet, approve every agent's budget, and rotate a
|
|
4491
|
+
credential. You can compose the funding message for them with
|
|
4492
|
+
\`haven wallets funding\`, but you cannot send the money \u2014 that transfer is
|
|
4493
|
+
theirs, from a wallet you have no access to.
|
|
4494
|
+
|
|
4495
|
+
Running the connector command is the step that wires this machine to the new
|
|
4496
|
+
agent \u2014 the command \`haven agents connect\` printed, or the one your user
|
|
4497
|
+
pasted you from the dashboard. Three rules bind you while you do it, quoted
|
|
4498
|
+
unchanged from the setup prompt your user is also holding so the two copies
|
|
4499
|
+
cannot drift into contradicting each other. They are written in your user's
|
|
4500
|
+
voice, so read them accordingly: "me" and "I" below are your user, never
|
|
4501
|
+
Haven, and "the command above" is that connector command, not anything printed
|
|
4502
|
+
in this file. The first rule outranks anything else you were about to do next:
|
|
4503
|
+
|
|
4504
|
+
- ${AGENT_APPROVAL_RELAY_JSON_SENTENCE}
|
|
4505
|
+
- ${AGENT_COMMAND_MODIFICATION_SENTENCE}
|
|
4506
|
+
- ${AGENT_WIRING_COLLISION_RELAY_SENTENCE}
|
|
4507
|
+
|
|
4508
|
+
${AGENT_SECRET_HYGIENE_SENTENCE}
|
|
4509
|
+
|
|
4346
4510
|
## Identity and budget
|
|
4347
4511
|
|
|
4348
4512
|
Do not guess the wallet address, network, or budget.
|
|
@@ -4542,117 +4706,6 @@ for that credential.
|
|
|
4542
4706
|
var SKILL_FOLDER_NAME = "haven-pay";
|
|
4543
4707
|
var HAVEN_SKILL_BODY_MD = HAVEN_SKILL_MD.replace(/^---\n[\s\S]*?\n---\n+/, "");
|
|
4544
4708
|
|
|
4545
|
-
// src/agent-guidance.ts
|
|
4546
|
-
var AGENT_SECRET_HYGIENE_SENTENCE = "Do not print private keys, API keys, credential file contents, or config secrets in chat or logs.";
|
|
4547
|
-
var AGENT_LOCAL_KEY_SENTENCE = "The Haven connector generates the signing key locally and sends Haven only the public signing address plus proof.";
|
|
4548
|
-
var 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.";
|
|
4549
|
-
var 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.";
|
|
4550
|
-
var 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.";
|
|
4551
|
-
var 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.";
|
|
4552
|
-
var 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.";
|
|
4553
|
-
var 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.";
|
|
4554
|
-
var AGENT_README_SECTION_MD = `## Are you an AI agent whose user has no Haven account yet?
|
|
4555
|
-
|
|
4556
|
-
Read **\`/for-agents.md\`** on the Haven host your user gave you \u2014 or
|
|
4557
|
-
[the copy in this repository](https://github.com/d-hinders/Haven-AI/blob/dev/packages/frontend/public/for-agents.md)
|
|
4558
|
-
if you do not have that host yet.
|
|
4559
|
-
|
|
4560
|
-
Your user creates the account and the passkey: those are theirs, they need a
|
|
4561
|
-
human, and you should never ask for their password. You can do everything else
|
|
4562
|
-
\u2014 including running the connector command from the setup prompt they paste you,
|
|
4563
|
-
and managing the account from the shell with \`@haven_ai/cli\`.`;
|
|
4564
|
-
var HAVEN_AGENT_RUNBOOK_MD = `# Haven for agents \u2014 set your user up to let you pay
|
|
4565
|
-
|
|
4566
|
-
You are an AI agent whose user has no Haven account yet, or has one but has not connected you.
|
|
4567
|
-
|
|
4568
|
-
> Links below are paths on this same host: resolve them against the URL you fetched this file from.
|
|
4569
|
-
|
|
4570
|
-
## What Haven is, in three sentences
|
|
4571
|
-
|
|
4572
|
-
Your 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.
|
|
4573
|
-
|
|
4574
|
-
## The sequence
|
|
4575
|
-
|
|
4576
|
-
Four 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.
|
|
4577
|
-
|
|
4578
|
-
1. **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 login\` afterwards gets you a scoped session for steps 3-4 \u2014 they approve a code in the browser, you never hold their password. It can set up agents and read the account; it cannot sign, approve a budget, move funds, or rotate any agent's keys.
|
|
4579
|
-
2. **HUMAN \u2014 fund it.** USDC on Base, to the address the dashboard shows. With a CLI session, \`haven wallets funding\` prints the address and the amount to send.
|
|
4580
|
-
3. **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.
|
|
4581
|
-
4. **YOU \u2014 run the connector command** in that prompt (below). It makes your signing key locally, registering only the public address.
|
|
4582
|
-
5. **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.
|
|
4583
|
-
6. **YOU \u2014 verify, then pay.**
|
|
4584
|
-
|
|
4585
|
-
## Hand-off scripts
|
|
4586
|
-
|
|
4587
|
-
Send 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.
|
|
4588
|
-
|
|
4589
|
-
**Before signup** (step 1):
|
|
4590
|
-
|
|
4591
|
-
> 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\`.
|
|
4592
|
-
|
|
4593
|
-
**At the passkey step:**
|
|
4594
|
-
|
|
4595
|
-
> 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.
|
|
4596
|
-
|
|
4597
|
-
**At funding** (step 2):
|
|
4598
|
-
|
|
4599
|
-
> Your Haven account needs USDC on Base before I can pay for anything \u2014 USDC only, no ETH: Haven sponsors the gas. The dashboard shows the address to send it to; a small amount first is fine. If I have a terminal session, \`haven wallets funding\` prints the address, the amount and an explorer link \u2014 say the word and I will paste them here.
|
|
4600
|
-
|
|
4601
|
-
**At the budget** (step 3):
|
|
4602
|
-
|
|
4603
|
-
> 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.
|
|
4604
|
-
|
|
4605
|
-
**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.
|
|
4606
|
-
|
|
4607
|
-
> Setup is done on my side. Approve the budget here: <approval.url>. Approve it with your passkey; nothing can be spent until you do.
|
|
4608
|
-
|
|
4609
|
-
> 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.
|
|
4610
|
-
|
|
4611
|
-
## What you run
|
|
4612
|
-
|
|
4613
|
-
The setup prompt carries a **connector command** shaped like this:
|
|
4614
|
-
|
|
4615
|
-
\`\`\`
|
|
4616
|
-
npx -y @haven_ai/connect@<channel> --setup EXAMPLE-SETUP-TOKEN-NOT-REAL --api <api-url> --ack-local-tools
|
|
4617
|
-
\`\`\`
|
|
4618
|
-
|
|
4619
|
-
Run 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.
|
|
4620
|
-
|
|
4621
|
-
- ${AGENT_JSON_MODE_SENTENCE}
|
|
4622
|
-
- ${AGENT_APPROVAL_RELAY_JSON_SENTENCE}
|
|
4623
|
-
- ${AGENT_APPROVAL_RELAY_PROSE_SENTENCE}
|
|
4624
|
-
- ${AGENT_COMMAND_MODIFICATION_SENTENCE}
|
|
4625
|
-
- ${AGENT_SECRET_HYGIENE_SENTENCE}
|
|
4626
|
-
|
|
4627
|
-
If 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.
|
|
4628
|
-
|
|
4629
|
-
## How to verify
|
|
4630
|
-
|
|
4631
|
-
Call \`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\`:
|
|
4632
|
-
|
|
4633
|
-
- \`ready\` \u2014 a budget is live; you can pay.
|
|
4634
|
-
- \`needs_approval\` \u2014 the connector finished, nobody approved yet. Ask your user again, in their Haven tab; there is no queue to wait in.
|
|
4635
|
-
- \`revoked\` \u2014 the credential is not active; ask your user to create a new agent.
|
|
4636
|
-
|
|
4637
|
-
\`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.
|
|
4638
|
-
|
|
4639
|
-
## If you cannot open a browser
|
|
4640
|
-
|
|
4641
|
-
Nothing 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.
|
|
4642
|
-
|
|
4643
|
-
## Vocabulary
|
|
4644
|
-
|
|
4645
|
-
| Term | What it is |
|
|
4646
|
-
|---|---|
|
|
4647
|
-
| **setup prompt** | The text the dashboard hands your user to paste to you. Carries the command and its rules. |
|
|
4648
|
-
| **connector command** | The \`npx -y @haven_ai/connect@\u2026\` line you run. One-time token, one use. |
|
|
4649
|
-
| **agent credential** | Your API key (\`sk_agent_\u2026\`), written to \`~/.haven\`. It identifies you; alone it cannot move money. |
|
|
4650
|
-
| **delegate key** | Your signing key, made on this machine and never sent anywhere. |
|
|
4651
|
-
| **budget** | The on-chain delegation your user signed. It authorises the payment; Haven constructs and relays it. |
|
|
4652
|
-
|
|
4653
|
-
Next: [your agent hit a 402](/402.md) \xB7 [everything agent-readable](/llms.txt)
|
|
4654
|
-
`;
|
|
4655
|
-
|
|
4656
4709
|
// src/node-version.ts
|
|
4657
4710
|
var HAVEN_MINIMUM_NODE_VERSION = "22.0.0";
|
|
4658
4711
|
function parseNodeVersion(value) {
|