@hydra-acp/cli 0.1.3 → 0.1.4
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 +25 -1
- package/dist/cli.js +1078 -266
- package/dist/index.d.ts +176 -7
- package/dist/index.js +660 -129
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,6 +211,12 @@ hydra-acp daemon status
|
|
|
211
211
|
hydra-acp sessions # list sessions
|
|
212
212
|
hydra-acp sessions kill <id> # close a live session (keeps the on-disk record so it can be resurrected)
|
|
213
213
|
hydra-acp sessions rm <id> # remove a session entirely (live or cold)
|
|
214
|
+
hydra-acp sessions export <id> [--out <file>|.]
|
|
215
|
+
# write a session bundle (meta + history) to <file>,
|
|
216
|
+
# to a default-named file when --out=., or to stdout
|
|
217
|
+
hydra-acp sessions import <file>|- [--replace]
|
|
218
|
+
# import a bundle from <file> or stdin (-);
|
|
219
|
+
# --replace overwrites an existing lineage match
|
|
214
220
|
|
|
215
221
|
hydra-acp extensions # list configured extensions and live state
|
|
216
222
|
hydra-acp extensions add <name> # add to config (--command, --args, --env, --disabled)
|
|
@@ -265,6 +271,21 @@ Slash commands of the form `/hydra <verb> [args]` are intercepted by hydra befor
|
|
|
265
271
|
|
|
266
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.
|
|
267
273
|
|
|
274
|
+
### Exporting and importing sessions
|
|
275
|
+
|
|
276
|
+
`hydra-acp sessions export` writes a session to a `*.hydra` JSON bundle (meta + history + optional prompt history). `hydra-acp sessions import` brings it back into the local daemon as a new cold session. Use this to archive a session before clearing it, share one with a teammate, restore from backup, or move work between machines without running both daemons live.
|
|
277
|
+
|
|
278
|
+
```text
|
|
279
|
+
hydra-acp sessions export hydra_session_abc --out backup.hydra
|
|
280
|
+
hydra-acp sessions import backup.hydra # → new local id
|
|
281
|
+
hydra-acp sessions import backup.hydra # error: already imported
|
|
282
|
+
hydra-acp sessions import backup.hydra --replace # overwrites in place
|
|
283
|
+
```
|
|
284
|
+
|
|
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
|
+
|
|
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 switch`). 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
|
+
|
|
268
289
|
### Forwarding agent args (`hydra-acp launch <agent-id> ...`)
|
|
269
290
|
|
|
270
291
|
Anything you put after `<agent-id>` in launcher mode is forwarded to the underlying agent's command. Hydra appends the extra args to the registry-provided spawn plan. Example:
|
|
@@ -319,7 +340,7 @@ When you ask hydra to spawn an agent (via `launch <id>`, `--agent-id`, or `HYDRA
|
|
|
319
340
|
}
|
|
320
341
|
```
|
|
321
342
|
|
|
322
|
-
`daemon.sessionIdleTimeoutSeconds` (default
|
|
343
|
+
`daemon.sessionIdleTimeoutSeconds` (default 3600 — one hour) controls how long a session with no recorded agent or user activity stays alive before the daemon closes it. Snapshot-shaped state pings (model/mode/title/commands) and bare attach/detach don't count as activity — only recordable broadcasts (prompts, agent chunks, tool calls, permission prompts) do, so persistent observer clients like the slack/notifier/approver/browser extensions can't pin a quiet session open. In-flight turns and unresolved permission requests defer the close until they settle. The disk record stays so the session can be resurrected later via `session/load`, at which point extensions re-attach automatically through their poll loops. Set to `0` to disable.
|
|
323
344
|
|
|
324
345
|
`daemon.sessionRecentMinutes` (default 30) controls how far back `hydra-acp sessions` (and the `/v1/sessions` REST endpoint without `?all=true`) looks for cold (disk-only) sessions. Set to `0` to never list cold sessions.
|
|
325
346
|
|
|
@@ -514,6 +535,9 @@ GET /v1/sessions # list sessions
|
|
|
514
535
|
POST /v1/sessions # create session (alternative to ACP session/new)
|
|
515
536
|
POST /v1/sessions/:id/kill # demote a live session to cold (keeps the on-disk record); idempotent
|
|
516
537
|
DELETE /v1/sessions/:id # remove a session entirely (live or cold)
|
|
538
|
+
GET /v1/sessions/:id/export # download a session bundle (*.hydra JSON; meta + history)
|
|
539
|
+
POST /v1/sessions/import # body { bundle, replace? } → { sessionId, importedFromSessionId, replaced }
|
|
540
|
+
# 409 with existingSessionId on a lineageId clash unless replace:true
|
|
517
541
|
GET /v1/agents # list known agents (registry + installed)
|
|
518
542
|
POST /v1/agents/:id/install # pre-install an agent
|
|
519
543
|
GET /v1/registry # current cached registry contents
|