@haven_ai/connect 0.1.25-alpha.0 → 0.1.27-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 CHANGED
@@ -45,7 +45,7 @@ spending authority.
45
45
 
46
46
  ## After setup
47
47
 
48
- 1. Return to Haven and approve the agent rules. Approval — not restarting —
48
+ 1. Return to Haven and approve the budget. Approval — not restarting —
49
49
  unlocks the Haven tools.
50
50
  2. Activate the runtime using the table above.
51
51
  3. In the activated runtime, run the read-only `haven_get_agent` and
@@ -57,7 +57,10 @@ spending authority.
57
57
  Pass `--json` when a launcher needs a machine-readable completion record. Connect
58
58
  writes progress and human recovery notes to stderr and exactly one JSON object
59
59
  to stdout, with `schema_version: 1` and `outcome` set to `complete`,
60
- `action_required`, or `failed`. The object includes runtime/topology status,
60
+ `action_required`, or `failed`. Structured runs skip the interactive
61
+ budget-approval wait so the record is emitted promptly; approve in the Haven
62
+ dashboard whenever ready and verify later with the read-only `haven_get_agent`
63
+ tool. The object includes runtime/topology status,
61
64
  probe result, activation and next-action guidance, approval state/expiry (null
62
65
  when the backend does not provide an approval expiry), and the two
63
66
  read-only verification tools. It contains no API key, private key, credential
@@ -87,3 +90,66 @@ For Hermes, Connect stores the hosted-MCP API key in the matching owner-only
87
90
  Hermes requires its Python MCP SDK support to be installed. If Haven tools do
88
91
  not appear after restart, run `pip install mcp` in the Hermes environment, then
89
92
  restart Hermes and check `hermes mcp list`.
93
+
94
+ ## Why there is no pre-registration confirmation prompt
95
+
96
+ Connect mints a signing key and registers the agent as soon as it runs, without
97
+ an extra "about to create agent X, proceed?" gate. That is deliberate: the
98
+ consent already happened when the user minted the one-time setup prompt in the
99
+ Haven dashboard, which enumerates exactly what the command may do. The setup
100
+ stays cancellable from the dashboard throughout, and the registered agent
101
+ starts `pending_approval` with zero spend authority — nothing can move funds
102
+ until the user approves the budget in Haven. A CLI-side confirmation would add
103
+ friction without adding a security boundary. (The local-signer tool-exposure
104
+ acknowledgement is a separate, machine-checkable consent about what the local
105
+ MCP tools expose, not a registration gate.)
106
+
107
+ ## Running setup again
108
+
109
+ Each setup prompt is one-time and each successful run creates a **new** agent
110
+ with its own freshly minted key pair. Re-running Connect on an
111
+ already-configured machine behaves as follows (characterized in
112
+ `storage.test.ts`, `config-writers.test.ts`, `runtime.test.ts`, and
113
+ `runtime-install.test.ts`, #1544/#1569):
114
+
115
+ - **Re-running an already-consumed setup command** fails cleanly before any
116
+ credential file or runtime configuration is touched — Haven refuses the
117
+ consumed setup when Connect resolves it (or, in a rare concurrent-run race,
118
+ at registration). The key pair minted for the attempt exists only in memory
119
+ and is discarded. Start a fresh connection from the Haven dashboard instead.
120
+ - **Running a fresh setup on a configured machine** writes the new agent's
121
+ credentials into its own directory under `~/.haven/agents/<agent-id>/`,
122
+ alongside the previous agent's directory, which stays byte-identical.
123
+ Nothing is rotated, revoked, or deleted locally.
124
+ - **Runtime MCP entries are replaced, not duplicated**: Connect owns the
125
+ `haven` and `haven-signer` entries (and the managed Codex/Hermes
126
+ equivalents) and re-points them at the newest agent's credentials.
127
+ Unrelated MCP servers and configuration are preserved. One runtime is
128
+ therefore wired to one Haven agent — the newest one.
129
+ - **The previous agent is not revoked by a re-run.** Its credentials remain on
130
+ disk and its authority remains whatever its on-chain rules say. Revoke
131
+ agents you no longer use from the Haven dashboard, then delete their
132
+ credential directories.
133
+ - **Connect never overwrites an existing credential file.** A write that would
134
+ collide with an existing `identity.json`/`signer.json`/`agent.json` is
135
+ refused outright (and a partially failed write rolls itself back), so a
136
+ re-run cannot corrupt stored key material.
137
+
138
+ ## Diagnosing a stuck setup: `--doctor` / `--repair` (#1589)
139
+
140
+ ```bash
141
+ npx @haven_ai/connect@alpha --doctor --runtime codex-desktop
142
+ npx @haven_ai/connect@alpha --doctor --repair --runtime codex-desktop
143
+ ```
144
+
145
+ `--doctor` is read-only and needs NO setup token: it checks the runtime config,
146
+ the agent credential files, the pinned signer runtime install, the hosted MCP
147
+ (authorized `tools/list`), and starts the local signer for a real stdio
148
+ handshake — reporting its advertised compat versions. Every failing check
149
+ prints one concrete repair action; the exit code is non-zero on any failure.
150
+ Add `--json` for a machine-readable report. No secret material is ever
151
+ printed.
152
+
153
+ `--repair` re-runs what setup already owns — reinstall the pinned signer
154
+ runtime, rewrite the wrapper + sidecar, and re-write the runtime config from
155
+ the STORED credentials. It never touches keys and never needs a new token.