@hueyexe/opencode-ensemble 0.16.1 → 0.18.0

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
@@ -17,9 +17,9 @@ Plugin built on the public OpenCode SDK. No internal dependencies.
17
17
 
18
18
  ## Quick Start
19
19
 
20
- ```json
20
+ ```jsonc
21
21
  {
22
- "plugin": ["@hueyexe/opencode-ensemble@0.16.0"]
22
+ "plugins": ["@hueyexe/opencode-ensemble@0.18.0"]
23
23
  }
24
24
  ```
25
25
 
@@ -40,10 +40,10 @@ The lead agent:
40
40
  2. Adds independent tasks first and records the generated task IDs.
41
41
  3. Adds dependent QA and review tasks with `depends_on` using real returned IDs.
42
42
  4. Spawns a small team with explicit roles:
43
- - scout: explore agent, worktree disabled, model openai/gpt-5.3-codex-spark
44
- - api-dev: build agent, own worktree, model anthropic/claude-opus-4-7, plan_approval: true
45
- - qa: build agent, own worktree, model anthropic/claude-sonnet-4-6
46
- - reviewer: explore agent, worktree disabled, model openai/gpt-5.3-codex-spark
43
+ - scout: explore agent, worktree disabled, model openai/gpt-5-mini (example)
44
+ - api-dev: build agent, own worktree, model anthropic/claude-opus-4-7 (example), plan_approval: true
45
+ - qa: build agent, own worktree, model anthropic/claude-opus-4-7 (example)
46
+ - reviewer: explore agent, worktree disabled, model openai/gpt-5-mini (example)
47
47
  ```
48
48
 
49
49
  The lead uses the task board to make sequencing visible. Record the returned task IDs before creating dependent tasks:
@@ -79,7 +79,7 @@ team_spawn({
79
79
  name: "scout",
80
80
  agent: "explore",
81
81
  worktree: false,
82
- model: "openai/gpt-5.3-codex-spark",
82
+ model: "openai/gpt-5-mini",
83
83
  claim_task: "task_abc123",
84
84
  prompt: "Trace the checkout webhook flow. Report the files, data model, existing tests, and the smallest safe implementation plan. Do not edit files.",
85
85
  })
@@ -177,21 +177,23 @@ The plugin uses SQLite via the host's runtime adapter:
177
177
 
178
178
  ### 1. Add the plugin
179
179
 
180
- Add to your OpenCode config with a pinned version. Project-level or global.
180
+ Add to your OpenCode config with a pinned version. Project-level or global. On OpenCode v2 the key is `plugins` (v1 used `plugin` — both work on their respective versions).
181
181
 
182
182
  **Project-level** (`opencode.json` in your project root):
183
183
 
184
- ```json
184
+ ```jsonc
185
185
  {
186
- "plugin": ["@hueyexe/opencode-ensemble@0.16.0"]
186
+ // OpenCode v2:
187
+ "plugins": ["@hueyexe/opencode-ensemble@0.18.0"]
187
188
  }
188
189
  ```
189
190
 
190
- **Global** (`~/.config/opencode/opencode.json`):
191
+ **Global** (`~/.config/opencode/opencode.json`): same entry.
191
192
 
192
- ```json
193
+ ```jsonc
193
194
  {
194
- "plugin": ["@hueyexe/opencode-ensemble@0.16.0"]
195
+ // OpenCode v1:
196
+ "plugin": ["@hueyexe/opencode-ensemble@0.18.0"]
195
197
  }
196
198
  ```
197
199
 
@@ -211,7 +213,19 @@ Then restart OpenCode.
211
213
 
212
214
  Teammates work in git worktrees outside your project directory. Without this permission, OpenCode will prompt you to approve every file operation in a teammate's worktree.
213
215
 
214
- Add to your OpenCode config (`~/.config/opencode/opencode.json`):
216
+ Add to your OpenCode config (`~/.config/opencode/opencode.json`).
217
+
218
+ OpenCode v2 (`permissions` array):
219
+
220
+ ```jsonc
221
+ {
222
+ "permissions": [
223
+ { "action": "external_directory", "resource": "~/.local/share/opencode/worktree/**", "effect": "allow" }
224
+ ]
225
+ }
226
+ ```
227
+
228
+ OpenCode v1 (`permission` map):
215
229
 
216
230
  ```json
217
231
  {
@@ -227,15 +241,15 @@ This is required. Without it, you'll see "Permission required — Access externa
227
241
 
228
242
  ### Local development
229
243
 
230
- To test a local build, point your plugin config at the built output:
244
+ To test a local build, point your plugin config at the package directory (v2 loads the source entry; v1 uses the `server()` export from the same file):
231
245
 
232
- ```json
246
+ ```jsonc
233
247
  {
234
- "plugin": ["/path/to/opencode-ensemble/dist/index.js"]
248
+ "plugins": [{ "package": "/path/to/opencode-ensemble" }]
235
249
  }
236
250
  ```
237
251
 
238
- Build with `bun run build`, then restart OpenCode to pick up changes.
252
+ No build step needed for local testing — but run `bun run typecheck && bun test && bun run build` before committing. Restart OpenCode (or wait for hot-reload) to pick up changes.
239
253
 
240
254
  ## Tools
241
255
 
@@ -251,7 +265,7 @@ Build with `bun run build`, then restart OpenCode to pick up changes.
251
265
  | `team_merge` | Merge a shutdown teammate's branch into working directory (unstaged). Blocks if you have local changes to overlapping files. |
252
266
  | `team_cleanup` | Remove the current team when done. Safety-net merges forgotten branches. With `purge`, previews archived-team deletion and returns exact approval labels plus a confirmation token. |
253
267
  | `team_status` | See all members, their status, and a task summary. |
254
- | `team_view` | Switch the TUI to a teammate's session. |
268
+ | `team_view` | Resolve a teammate's session; pass `navigate: true` to switch the TUI to it (opt-in — only when the user explicitly asks). |
255
269
 
256
270
  Archived-team purge is intentionally two-step. First call `team_cleanup` with `purge` to get a preview, exact approval and denial option labels, and `confirm_token`; no data is deleted. Stale archived worktree/workspace references and stale Ensemble-owned branches are counted in the preview and cleaned during confirmed purge. Arbitrary non-Ensemble branches still block purge for safety. The lead must then use the question tool with those exact options. Only after the user selects the exact approval option should it call `team_cleanup` again with the same `purge`, `confirm_purge: true`, and the preview token.
257
271
 
@@ -274,17 +288,15 @@ Archived-team purge is intentionally two-step. First call `team_cleanup` with `p
274
288
 
275
289
  ## What you see in the TUI
276
290
 
277
- The plugin works within OpenCode's existing TUI. For deeper visibility, open the [dashboard](#dashboard) at `http://localhost:4747`.
291
+ The plugin works within OpenCode's existing UI on every client (terminal, desktop, web): tools, approvals, messages, and the [dashboard](#dashboard) at `http://localhost:4747` all live server-side.
278
292
 
279
293
  What you get:
280
294
 
281
- - **Toast notifications** when teammates spawn, finish, error, shut down, or get rate-limited
282
- - **Working progress toasts** showing who's still active after every status change (e.g. "Working: alice, bob (2/3)")
283
- - **Rich tool titles** in the sidebar (e.g. "Spawned alice (build)", "Message -> bob", "Task board (3 tasks)")
284
- - **Session switching** via `team_view` to see any teammate's full chat log
285
- - **Status checks** via `team_status` for a snapshot of the whole team
286
-
287
- Teammate messages arrive in the lead's session as `[Team message from alice]: ...` blocks. They look like user messages because that's how `promptAsync` delivery works. Content is clearly labeled with the sender's name.
295
+ - **Team state in context** — the lead's system prompt carries member statuses and task counts, so it stays aware across turns including after compaction.
296
+ - **Teammate messages** arriving in the lead's session as labeled blocks with the sender's name.
297
+ - **Rich tool titles** in the sidebar (e.g. "Spawned alice (build)", "Message -> bob", "Task board (3 tasks)").
298
+ - **Status checks** via `team_status` for a snapshot of the whole team.
299
+ - **Terminal extras** (terminal only): a sidebar widget with live member status and task counts via the bundled `./tui` companion, loaded automatically with the plugin. `team_view` reports the teammate session by default; ask for it and `navigate: true` switches the TUI there (ctrl+p to return).
288
300
 
289
301
  ## Architecture
290
302
 
@@ -436,7 +448,9 @@ STALL_THRESHOLD_MS=0
436
448
 
437
449
  ## Known limitations
438
450
 
439
- - **Teammate messages may switch the lead's agent mode.** When a teammate sends a message back to the lead via `promptAsync`, OpenCode starts a new prompt loop that can switch the lead from plan/explore mode into build mode. This is a server-level behavior that the plugin cannot override. The lead's mode will restore when you send your next message.
451
+ - **Teammate messages may switch the lead's agent mode (v1).** When a teammate sends a message back to the lead, OpenCode can start the next prompt loop in build mode even if the lead was in plan/explore mode. Tracked upstream; the lead's mode restores when you send your next message. On v2, pass an explicit `model` on `team_spawn` so teammates never inherit the server default.
452
+ - **Session switching is opt-in (v2).** `team_view` reports the teammate's session ID by default; it switches the user's client only when asked for with `navigate: true` — agents never hijack the client unprompted. The live sidebar (terminal only) shows member status on every client's dashboard at `http://localhost:4747`.
453
+ - **Per-session shell env is unavailable (v2).** The v2 shell hook carries no session ID, so `ENSEMBLE_*` variables are not injected into teammate shells. Team identity travels in prompts and tool calls instead.
440
454
 
441
455
  ## How this differs from Claude Code agent teams
442
456