@hydra-acp/cli 0.1.150 → 0.1.151

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
@@ -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
@@ -278,6 +331,43 @@ hydra-acp session import <file>|- [--replace] [--cwd <path>] [--info]
278
331
  # working directory; --info prints the bundle's
279
332
  # meta without importing
280
333
 
334
+ # hydra-acp workspace [list] [--json] [--inactive]
335
+ # what exists: `active` (directory + a session
336
+ # record), `unowned` (directory, no record, so
337
+ # reclaimable), and with --inactive, `inactive`
338
+ # (a record pointing at a directory that is gone,
339
+ # so rebuildable). Reads the filesystem, not the
340
+ # daemon, so it still answers when the daemon is down
341
+ hydra-acp workspace merge [<session>] [-m <msg>] [--into <path>] [--remove]
342
+ # land a workspace's work into its recorded source
343
+ # tree, fast-forward only. Records anything still
344
+ # uncommitted there first (-m names that), replays
345
+ # your own post-start edits on top, and keeps the
346
+ # workspace unless --remove. --into overrides the
347
+ # destination
348
+ hydra-acp workspace apply [<session>] [--into <path>]
349
+ # same landing, but as staged changes you commit
350
+ # yourself: nothing is recorded on the workspace's
351
+ # branch and nothing is merged
352
+ hydra-acp workspace clean [<session>] [--deep]
353
+ # throw away everything done in a live session's
354
+ # workspace and leave the session in it, putting it
355
+ # back exactly as `start --clean` would have made it.
356
+ # Keeps installed dependencies and carried config
357
+ # files; --deep rebuilds those too. Live sessions
358
+ # only: every guard that makes it safe belongs to
359
+ # the running session
360
+ hydra-acp workspace remove|rm [<session>] [--force]
361
+ # take a named workspace away. Refuses while it
362
+ # holds uncommitted work or a live session is in it;
363
+ # --force overrides both. The branch and the last
364
+ # autosave are left behind for recovery
365
+ hydra-acp workspace prune [--force] # sweep `unowned` workspaces in bulk. Skips any
366
+ # holding uncommitted work unless --force, and
367
+ # reclaims each through its provider so no stale
368
+ # worktree registration or branch is left pointing
369
+ # at a path that no longer exists
370
+
281
371
  hydra-acp extension [list] # list configured extensions and live state
282
372
  hydra-acp extension add <name> # add to config (--command, --args, --env, --disabled)
283
373
  hydra-acp extension remove <name> # remove from config
@@ -388,6 +478,7 @@ conversation log.
388
478
  | `/hydra compact [status]` | Compact history now. `status` inspects state without triggering. |
389
479
  | `/hydra uncompact` | Roll back the most recent compaction, before any new turns. |
390
480
  | `/hydra fork [verbatim]` | Fork into a new session. Default is a synopsis brief; `verbatim` slices at the last completed turn. |
481
+ | `/hydra workspace <start [name] [--clean] \| sync \| merge \| 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; `clean` wipes the workspace and stays in it. See [isolated workspaces](#isolated-workspaces). |
391
482
  | `/hydra restart` | Restart the agent with a fresh `session/new`, preserving history. Useful when the available models have changed underneath you. |
392
483
  | `/hydra kill` | Close this session. The agent dies; the record is kept and can be resumed. |
393
484