@hydra-acp/cli 0.1.4 → 0.1.6
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 +16 -13
- package/dist/cli.js +834 -254
- package/dist/index.d.ts +433 -31
- package/dist/index.js +577 -126
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ hydra-acp daemon start
|
|
|
178
178
|
# spawned-by-editor cases where stdio is already piped. The first
|
|
179
179
|
# session/new asks the daemon which agent to spawn (defaults to
|
|
180
180
|
# config.defaultAgent). If you'd rather the editor pin a specific agent,
|
|
181
|
-
# spawn `hydra-acp launch <agent
|
|
181
|
+
# spawn `hydra-acp launch <agent>` (see "Launcher mode" below).
|
|
182
182
|
|
|
183
183
|
# 4. From a terminal, drive a session interactively (TUI).
|
|
184
184
|
hydra-acp # bare invocation in a TTY launches the TUI
|
|
@@ -198,13 +198,13 @@ hydra-acp --session-id hydra_session_abc123
|
|
|
198
198
|
hydra-acp # auto-dispatch: TUI in a TTY, shim when stdio is piped
|
|
199
199
|
hydra-acp shim # explicit shim mode (forces shim regardless of TTY)
|
|
200
200
|
hydra-acp tui # explicit terminal-UI mode
|
|
201
|
-
hydra-acp launch <agent
|
|
202
|
-
# daemon to spawn <agent
|
|
201
|
+
hydra-acp launch <agent> # launcher mode: shim that forces the
|
|
202
|
+
# daemon to spawn <agent> on session/new
|
|
203
203
|
hydra-acp --session-id <id> # attach to existing session
|
|
204
204
|
# (TUI in a TTY, shim otherwise)
|
|
205
205
|
|
|
206
206
|
hydra-acp init # generate config + auth token
|
|
207
|
-
hydra-acp daemon start [--
|
|
207
|
+
hydra-acp daemon start [--foreground] # detached by default; --foreground to attach
|
|
208
208
|
hydra-acp daemon stop
|
|
209
209
|
hydra-acp daemon status
|
|
210
210
|
|
|
@@ -234,7 +234,7 @@ A bare invocation (`hydra-acp` with no subcommand) auto-dispatches based on whet
|
|
|
234
234
|
|
|
235
235
|
### Launcher mode
|
|
236
236
|
|
|
237
|
-
`hydra-acp launch <agent
|
|
237
|
+
`hydra-acp launch <agent>` is a convenience for "shim me, and use *this* registry agent." It's the easiest way to wrap an existing ACP-speaking editor configuration whose agent-spawn surface is just a command and arguments:
|
|
238
238
|
|
|
239
239
|
```text
|
|
240
240
|
# Configure your editor's ACP-launch command to:
|
|
@@ -243,9 +243,9 @@ hydra-acp launch claude-code
|
|
|
243
243
|
|
|
244
244
|
When the editor sends `session/new`, the shim rewrites the params to `{ ..., agentId: "claude-code" }` before forwarding to the daemon. The daemon resolves `claude-code` against the cached ACP Registry, downloads/installs the agent on first use under `~/.hydra-acp/agents/`, and spawns the subprocess. The editor sees a normal ACP agent. From then on, `hydra-acp sessions` lists the live session and any other client can `session/attach` to it.
|
|
245
245
|
|
|
246
|
-
`<agent
|
|
246
|
+
`<agent>` is the registry ID — e.g. `claude-code`, `gemini-cli`, `codex`. Run `hydra-acp agents` to browse what's available, or fetch the registry CDN URL directly.
|
|
247
247
|
|
|
248
|
-
If both `launch <agent
|
|
248
|
+
If both `launch <agent>` and `--session-id` are given, `--session-id` wins (attach mode); the agent is ignored because the agent process is already running.
|
|
249
249
|
|
|
250
250
|
### Naming sessions from the editor
|
|
251
251
|
|
|
@@ -267,7 +267,7 @@ Slash commands of the form `/hydra <verb> [args]` are intercepted by hydra befor
|
|
|
267
267
|
|---|---|
|
|
268
268
|
| `/hydra title` | Asks the agent for a one-line summary, applies it as the new title via `session_info_update`. The sub-prompt and reply are suppressed from clients. |
|
|
269
269
|
| `/hydra title <text>` | Sets the title to `<text>` directly. No agent call. |
|
|
270
|
-
| `/hydra
|
|
270
|
+
| `/hydra agent <agent>` | Swaps the agent process backing this session. Spawns the new agent (must be in the registry — see `hydra-acp agents list`), kills the old one, and feeds the conversation transcript so far back in as the first prompt to the new agent. `session_info_update` carries the new `agentId`; a synthetic `agent_message_chunk` banner marks the switch in the transcript. The on-disk session record is updated so resurrection brings the session back on the new agent. |
|
|
271
271
|
|
|
272
272
|
These work from anywhere a session prompt can be typed — the TUI's input box, agent-shell, the slack thread composer, the browser chat composer. Hydra detects them server-side; clients send them as ordinary `session/prompt` requests.
|
|
273
273
|
|
|
@@ -284,11 +284,11 @@ hydra-acp sessions import backup.hydra --replace # overwrites in place
|
|
|
284
284
|
|
|
285
285
|
Each session carries a stable **`lineageId`** that survives every export/import hop, so the same bundle imported twice is detected as a duplicate — the second import errors with the existing local id. `--replace` overrides that and overwrites the existing local copy, killing any live session first and preserving the local `sessionId` so bookmarks (Slack threads, editor session links) keep resolving.
|
|
286
286
|
|
|
287
|
-
The first attach to an imported session is slow: hydra spawns a fresh agent, runs `session/new`, and feeds the imported history back in as a synthesized takeover transcript (same machinery as `/hydra
|
|
287
|
+
The first attach to an imported session is slow: hydra spawns a fresh agent, runs `session/new`, and feeds the imported history back in as a synthesized takeover transcript (same machinery as `/hydra agent`). Subsequent attaches use the normal `session/load` path. This is a text-level handover — the originating agent's internal state (tool-call chains, compacted earlier turns) isn't preserved, so the resumed conversation may be cognitively shallower than the original.
|
|
288
288
|
|
|
289
|
-
### Forwarding agent args (`hydra-acp launch <agent
|
|
289
|
+
### Forwarding agent args (`hydra-acp launch <agent> ...`)
|
|
290
290
|
|
|
291
|
-
Anything you put after `<agent
|
|
291
|
+
Anything you put after `<agent>` in launcher mode is forwarded to the underlying agent's command. Hydra appends the extra args to the registry-provided spawn plan. Example:
|
|
292
292
|
|
|
293
293
|
```text
|
|
294
294
|
hydra-acp launch codex-acp -c sandbox_mode=danger-full-access
|
|
@@ -303,14 +303,17 @@ Every config-knob flag has an `HYDRA_ACP_FOO_BAR` env-var equivalent. Flag wins
|
|
|
303
303
|
| Flag | Env var |
|
|
304
304
|
|---|---|
|
|
305
305
|
| `--name` | `HYDRA_ACP_NAME` |
|
|
306
|
-
| `--agent
|
|
306
|
+
| `--agent` | `HYDRA_ACP_AGENT` |
|
|
307
|
+
| `--model` | `HYDRA_ACP_MODEL` |
|
|
307
308
|
| `--session-id` | `HYDRA_ACP_SESSION_ID` |
|
|
308
309
|
|
|
310
|
+
`--model` is a one-shot override for the per-agent `defaultModels` entry in `~/.hydra-acp/config.json`. It only applies at fresh session creation — resurrect and `/hydra agent` switch ignore it (resurrected sessions stay on whatever model they were last using).
|
|
311
|
+
|
|
309
312
|
Action commands (`init`, `daemon`, `sessions`, `--help`, `--version`, `--rotate-token`) are not config knobs and are flag-only.
|
|
310
313
|
|
|
311
314
|
### Registry id resolution
|
|
312
315
|
|
|
313
|
-
When you ask hydra to spawn an agent (via `launch <
|
|
316
|
+
When you ask hydra to spawn an agent (via `launch <agent>`, `--agent`, or `HYDRA_ACP_AGENT`), the daemon first tries an exact match against the ACP Registry's `id` field. If nothing matches, it falls back to matching against the **npx package basename** (the segment after the last `/` and before the version `@`). That means common binary names work transparently:
|
|
314
317
|
|
|
315
318
|
| You spawn… | Registry `id` | Resolves via |
|
|
316
319
|
|---|---|---|
|