@axelgar/opentree 0.1.19 → 0.1.20

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.
Files changed (2) hide show
  1. package/README.md +61 -0
  2. package/package.json +5 -5
package/README.md CHANGED
@@ -226,6 +226,67 @@ command = "claude" # Or "aider", "cursor", etc.
226
226
  args = ["--some-flag"]
227
227
  ```
228
228
 
229
+ ### Agent status signals
230
+
231
+ Agents can tell opentree how they're doing by writing a `.opentree-status.json`
232
+ file to the **worktree root**. The workspace list reads it on every refresh and
233
+ shows a badge (and, for `needs_input`, a `N need input` count in the status bar),
234
+ so a glance across the dashboard tells you which worktree is waiting on you.
235
+
236
+ ```jsonc
237
+ {
238
+ "status": "needs_input", // required
239
+ "message": "Approve running tests?", // optional — shown on the row
240
+ "updated_at": "2026-07-13T12:00:00Z" // optional
241
+ }
242
+ ```
243
+
244
+ Valid `status` values:
245
+
246
+ | `status` | Badge |
247
+ | ------------- | -------------- |
248
+ | `in_progress` | `working...` |
249
+ | `needs_input` | `needs input` |
250
+ | `success` | `done` |
251
+ | `failure` | `failed` |
252
+ | `error` | `error` |
253
+
254
+ **One-step setup.** Let opentree install the hooks for you:
255
+
256
+ ```bash
257
+ opentree agents setup claude # or: codex, gemini, opencode
258
+ ```
259
+
260
+ This merges the guarded status hooks into the agent's user-level config
261
+ (`~/.claude/settings.json`, `~/.codex/hooks.json`, `~/.gemini/settings.json`, or
262
+ an OpenCode plugin), backing up any existing file first. It's idempotent — safe
263
+ to re-run. opentree exports `OPENTREE_STATUS_FILE` into every agent shell it
264
+ launches, so the hooks write to the right worktree and stay inert (a no-op) in
265
+ any session opentree didn't start. That means you install once, globally, and it
266
+ just works across all your worktrees.
267
+
268
+ `opentree agents setup <agent>` maps a new prompt → `in_progress` and a
269
+ permission prompt / notification / turn-end → `needs_input`.
270
+
271
+ **GitHub Copilot** and **Pi** can't be fully automated (Copilot has no
272
+ "waiting for input" event; Pi's notify config holds a single script) — running
273
+ `opentree agents setup gh` / `pi` prints tailored manual instructions.
274
+
275
+ **Manual wiring / other agents.** Any agent can drive the badge by writing the
276
+ status file itself. Point it at `$OPENTREE_STATUS_FILE` (exported by opentree),
277
+ e.g. a Claude Code hook in `~/.claude/settings.json`:
278
+
279
+ ```jsonc
280
+ {
281
+ "hooks": {
282
+ "UserPromptSubmit": [{ "hooks": [{ "type": "command",
283
+ "command": "[ -n \"$OPENTREE_STATUS_FILE\" ] && printf '{\"status\":\"in_progress\"}' > \"$OPENTREE_STATUS_FILE\"" }] }],
284
+ "Notification": [{ "hooks": [{ "type": "command",
285
+ "command": "[ -n \"$OPENTREE_STATUS_FILE\" ] && printf '{\"status\":\"needs_input\"}' > \"$OPENTREE_STATUS_FILE\"" }] }]
286
+ }
287
+ }
288
+ ```
289
+
229
290
  ## How It Works
230
291
 
231
292
  1. **Worktrees**: Git worktrees allow multiple checkouts of the same repo in different directories. Each workspace lives in `.opentree/<branch-name>/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axelgar/opentree",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Git worktree manager CLI for orchestrating parallel AI coding sessions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,10 +15,10 @@
15
15
  "bin/opentree"
16
16
  ],
17
17
  "optionalDependencies": {
18
- "@axelgar/opentree-linux-x64": "0.1.19",
19
- "@axelgar/opentree-linux-arm64": "0.1.19",
20
- "@axelgar/opentree-darwin-x64": "0.1.19",
21
- "@axelgar/opentree-darwin-arm64": "0.1.19"
18
+ "@axelgar/opentree-linux-x64": "0.1.20",
19
+ "@axelgar/opentree-linux-arm64": "0.1.20",
20
+ "@axelgar/opentree-darwin-x64": "0.1.20",
21
+ "@axelgar/opentree-darwin-arm64": "0.1.20"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=18"