@hydra-acp/cli 0.1.150 → 0.1.152
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 +96 -0
- package/dist/cli.js +517 -426
- package/dist/daemon.js +128 -86
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -114,8 +114,15 @@ hydra-acp tui # explicit form
|
|
|
114
114
|
hydra-acp session # list sessions
|
|
115
115
|
hydra-acp --reattach # reattach to this terminal's last session
|
|
116
116
|
hydra-acp --session hydra_session_abc123 # attach to a specific session
|
|
117
|
+
hydra-acp --workspace # new sessions get their own isolated checkout
|
|
117
118
|
```
|
|
118
119
|
|
|
120
|
+
`--workspace` is a mode, not a name: every session you *create* in that TUI runs
|
|
121
|
+
in its own workspace, so two sessions in one repo can't edit each other's files.
|
|
122
|
+
It applies to creation only — attaching to an existing session never changes
|
|
123
|
+
that session's isolation. If the directory can't be isolated (not a repository,
|
|
124
|
+
no commits yet), the session still starts in the source tree and says why.
|
|
125
|
+
|
|
119
126
|
In the TUI, `^G` opens the key-binding help — that's the one binding worth
|
|
120
127
|
memorizing. The others you'll reach for early: `^P` switches sessions, `^R`
|
|
121
128
|
searches your prompt history and then scrollback, `^T` toggles the agent's
|
|
@@ -129,6 +136,52 @@ todo list, files edited so far, git status, context usage, and your other
|
|
|
129
136
|
sessions. Click a gadget's title to fold it. (With a draft in the composer,
|
|
130
137
|
`^S` amends the in-flight turn instead.)
|
|
131
138
|
|
|
139
|
+
### Isolated workspaces
|
|
140
|
+
|
|
141
|
+
A workspace is a git worktree on its own `hydra/<label>` branch, kept outside
|
|
142
|
+
your tree under `~/.hydra-acp/workspaces/`. `/hydra workspace start` moves a
|
|
143
|
+
running session into one, and the exits differ only in what happens to the work:
|
|
144
|
+
`stop` merges it back and returns, `discard` throws it away and returns, and
|
|
145
|
+
`detach` returns leaving the workspace and its branch intact for later. `merge`
|
|
146
|
+
lands the work without leaving, and `sync` pulls the source's committed history
|
|
147
|
+
*into* the workspace so you can test against what you'll land onto. Since
|
|
148
|
+
landing is fast-forward-only, `sync` is also the way back once the source has
|
|
149
|
+
moved on and `stop` starts refusing.
|
|
150
|
+
|
|
151
|
+
`start` **copies** your uncommitted changes in rather than taking them, so your
|
|
152
|
+
checkout is left exactly as it was, and landing reconciles the two sides rather
|
|
153
|
+
than demanding a clean tree. It names every file that came along, and
|
|
154
|
+
`start --clean` opts out and names what it left behind instead, for when the
|
|
155
|
+
work in your tree is unrelated to what you're about to ask for. `discard`
|
|
156
|
+
retires the last autosave to `refs/hydra/retired/<label>-<sha>` and names it on
|
|
157
|
+
the way out, so even the destructive exit is recoverable, and keeping it
|
|
158
|
+
outside the live namespace means a later workspace reusing that label can't
|
|
159
|
+
overwrite it.
|
|
160
|
+
|
|
161
|
+
`clean` is the exit that isn't one: it throws away everything done in the
|
|
162
|
+
workspace and leaves you in it, landing on exactly the state `start --clean`
|
|
163
|
+
would have produced. Installed dependencies and carried config files survive
|
|
164
|
+
(they're part of what `start` built, not part of the work being discarded);
|
|
165
|
+
`--deep` rebuilds them instead. Because it deletes the workspace's copy of your
|
|
166
|
+
carried work, it also re-anchors the landing so the copy still in your own tree
|
|
167
|
+
can't be lost by a later `stop`.
|
|
168
|
+
|
|
169
|
+
Submodules are populated on creation, and work inside one is carried in and
|
|
170
|
+
landed back like any other work. That needs handling the superproject can't
|
|
171
|
+
express: a container records a submodule as a pointer, not as content, so
|
|
172
|
+
uncommitted work inside one is invisible to its snapshot while still showing in
|
|
173
|
+
its status as a single modified path.
|
|
174
|
+
|
|
175
|
+
**Two sessions can share one workspace, deliberately.** `start <name>` naming a
|
|
176
|
+
workspace a live session is already in *joins* it instead of creating a second
|
|
177
|
+
one beside it — useful for a reviewer reading another session's work in place,
|
|
178
|
+
or a planner running a dependency tree against one checkout. Their edits
|
|
179
|
+
interleave, which is the risk you accept, and no worse than two non-isolated
|
|
180
|
+
sessions in one repo. Joining requires the two trees to already agree, since it
|
|
181
|
+
carries nothing across. `stop` from a co-tenant behaves as `detach` — you can't
|
|
182
|
+
finish a shared thing alone — so the merge waits for the last session to leave
|
|
183
|
+
and nothing commits a tree somebody is still writing to.
|
|
184
|
+
|
|
132
185
|
### From your editor
|
|
133
186
|
|
|
134
187
|
Point your editor's ACP agent command at `hydra-acp acp` instead of the agent
|
|
@@ -226,6 +279,9 @@ hydra-acp --reattach # reattach to this terminal's last s
|
|
|
226
279
|
hydra-acp --new # force a fresh session
|
|
227
280
|
hydra-acp --readonly # open a session as a transcript viewer (with --session)
|
|
228
281
|
hydra-acp --dangerously-skip-permissions # auto-approve every tool permission request
|
|
282
|
+
# (tui.skipPermissions makes this the default;
|
|
283
|
+
# --no-dangerously-skip-permissions refuses it
|
|
284
|
+
# for one run)
|
|
229
285
|
|
|
230
286
|
hydra-acp init [--rotate-token] # generate the service token
|
|
231
287
|
hydra-acp version [--json] # CLI, daemon, and extension/transformer versions
|
|
@@ -278,6 +334,43 @@ hydra-acp session import <file>|- [--replace] [--cwd <path>] [--info]
|
|
|
278
334
|
# working directory; --info prints the bundle's
|
|
279
335
|
# meta without importing
|
|
280
336
|
|
|
337
|
+
# hydra-acp workspace [list] [--json] [--inactive]
|
|
338
|
+
# what exists: `active` (directory + a session
|
|
339
|
+
# record), `unowned` (directory, no record, so
|
|
340
|
+
# reclaimable), and with --inactive, `inactive`
|
|
341
|
+
# (a record pointing at a directory that is gone,
|
|
342
|
+
# so rebuildable). Reads the filesystem, not the
|
|
343
|
+
# daemon, so it still answers when the daemon is down
|
|
344
|
+
hydra-acp workspace merge [<session>] [-m <msg>] [--into <path>] [--remove]
|
|
345
|
+
# land a workspace's work into its recorded source
|
|
346
|
+
# tree, fast-forward only. Records anything still
|
|
347
|
+
# uncommitted there first (-m names that), replays
|
|
348
|
+
# your own post-start edits on top, and keeps the
|
|
349
|
+
# workspace unless --remove. --into overrides the
|
|
350
|
+
# destination
|
|
351
|
+
hydra-acp workspace apply [<session>] [--into <path>]
|
|
352
|
+
# same landing, but as staged changes you commit
|
|
353
|
+
# yourself: nothing is recorded on the workspace's
|
|
354
|
+
# branch and nothing is merged
|
|
355
|
+
hydra-acp workspace clean [<session>] [--deep]
|
|
356
|
+
# throw away everything done in a live session's
|
|
357
|
+
# workspace and leave the session in it, putting it
|
|
358
|
+
# back exactly as `start --clean` would have made it.
|
|
359
|
+
# Keeps installed dependencies and carried config
|
|
360
|
+
# files; --deep rebuilds those too. Live sessions
|
|
361
|
+
# only: every guard that makes it safe belongs to
|
|
362
|
+
# the running session
|
|
363
|
+
hydra-acp workspace remove|rm [<session>] [--force]
|
|
364
|
+
# take a named workspace away. Refuses while it
|
|
365
|
+
# holds uncommitted work or a live session is in it;
|
|
366
|
+
# --force overrides both. The branch and the last
|
|
367
|
+
# autosave are left behind for recovery
|
|
368
|
+
hydra-acp workspace prune [--force] # sweep `unowned` workspaces in bulk. Skips any
|
|
369
|
+
# holding uncommitted work unless --force, and
|
|
370
|
+
# reclaims each through its provider so no stale
|
|
371
|
+
# worktree registration or branch is left pointing
|
|
372
|
+
# at a path that no longer exists
|
|
373
|
+
|
|
281
374
|
hydra-acp extension [list] # list configured extensions and live state
|
|
282
375
|
hydra-acp extension add <name> # add to config (--command, --args, --env, --disabled)
|
|
283
376
|
hydra-acp extension remove <name> # remove from config
|
|
@@ -388,6 +481,7 @@ conversation log.
|
|
|
388
481
|
| `/hydra compact [status]` | Compact history now. `status` inspects state without triggering. |
|
|
389
482
|
| `/hydra uncompact` | Roll back the most recent compaction, before any new turns. |
|
|
390
483
|
| `/hydra fork [verbatim]` | Fork into a new session. Default is a synopsis brief; `verbatim` slices at the last completed turn. |
|
|
484
|
+
| `/hydra workspace <start [name] [--clean] \| sync \| merge \| apply \| stop \| detach \| clean [--deep] \| discard \| status>` | Move this session into an isolated checkout and land, park, or throw away the work. `start --clean` leaves your uncommitted changes behind instead of copying them in; `apply` stages the work into your tree without its history; `clean` wipes the workspace and stays in it. See [isolated workspaces](#isolated-workspaces). |
|
|
391
485
|
| `/hydra restart` | Restart the agent with a fresh `session/new`, preserving history. Useful when the available models have changed underneath you. |
|
|
392
486
|
| `/hydra kill` | Close this session. The agent dies; the record is kept and can be resumed. |
|
|
393
487
|
|
|
@@ -477,6 +571,8 @@ one is to sit on that row and walk through them. Eighteen ship built in, and
|
|
|
477
571
|
|
|
478
572
|
`tui.defaultEnterAction` (default `"amend"`) controls what the unmodified Enter key does in the prompt composer. With `"amend"` (the default), Enter amends the in-flight turn and `Shift+Enter` enqueues a new prompt; with no turn in flight either key just enqueues, since there's nothing to amend. Set to `"enqueue"` to flip the two: Enter enqueues (sends immediately when idle, queues behind an in-flight turn) and `Shift+Enter` amends.
|
|
479
573
|
|
|
574
|
+
`tui.skipPermissions` (default `false`) makes `--dangerously-skip-permissions` the standing default for the TUI: every tool permission request is auto-approved (with `allow_once`, so nothing is written to the agent's persisted permission rules) and the modal never appears. The startup banner names the config key so it isn't silent. TUI-only on purpose: `shim`, `launch`, and `cat` are spawned by editors and scripts with their own argv, and an ambient config key there would disarm paths you aren't watching. Pass `--no-dangerously-skip-permissions` to get the prompts back for a single run.
|
|
575
|
+
|
|
480
576
|
## Extensions
|
|
481
577
|
|
|
482
578
|
Hydra can spawn user-configured extension processes when the daemon starts. Extensions are arbitrary commands — written in any language — that talk to the daemon over its existing REST or WSS endpoints. Hydra handles their lifecycle (spawn on start, kill on stop, auto-restart on crash with exponential backoff up to ~60s) and injects daemon connection info via env vars.
|