@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 +42 -28
- package/dist/index.js +43016 -19579
- package/package.json +18 -5
- package/src/dashboard-js-render.ts +5 -2
- package/src/dashboard.ts +62 -5
- package/src/hooks.ts +86 -8
- package/src/index.ts +90 -20
- package/src/log.ts +9 -0
- package/src/member-model.ts +30 -0
- package/src/notify.ts +46 -0
- package/src/progress.ts +26 -7
- package/src/recovery.ts +106 -3
- package/src/rpc.ts +99 -0
- package/src/schema.ts +18 -0
- package/src/tasks.ts +19 -0
- package/src/tools/team-create.ts +15 -2
- package/src/tools/team-merge.ts +30 -3
- package/src/tools/team-message.ts +55 -6
- package/src/tools/team-shutdown.ts +6 -0
- package/src/tools/team-spawn.ts +37 -16
- package/src/tools/team-status.ts +38 -4
- package/src/tools/team-view.ts +10 -4
- package/src/tui-view.ts +50 -0
- package/src/tui.tsx +101 -0
- package/src/types.ts +5 -0
- package/src/v2-client.ts +227 -0
- package/src/v2-events.ts +73 -0
- package/src/v2-rpc.ts +24 -0
- package/src/v2-session.ts +56 -0
- package/src/v2-setup.ts +349 -0
- package/src/v2-tools.ts +349 -0
- package/src/watchdog.ts +91 -17
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
|
-
```
|
|
20
|
+
```jsonc
|
|
21
21
|
{
|
|
22
|
-
"
|
|
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
|
|
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-
|
|
46
|
-
- reviewer: explore agent, worktree disabled, model openai/gpt-5
|
|
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
|
|
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
|
-
```
|
|
184
|
+
```jsonc
|
|
185
185
|
{
|
|
186
|
-
|
|
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
|
-
```
|
|
193
|
+
```jsonc
|
|
193
194
|
{
|
|
194
|
-
|
|
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
|
|
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
|
-
```
|
|
246
|
+
```jsonc
|
|
233
247
|
{
|
|
234
|
-
"
|
|
248
|
+
"plugins": [{ "package": "/path/to/opencode-ensemble" }]
|
|
235
249
|
}
|
|
236
250
|
```
|
|
237
251
|
|
|
238
|
-
|
|
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` |
|
|
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
|
|
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
|
-
- **
|
|
282
|
-
- **
|
|
283
|
-
- **Rich tool titles** in the sidebar (e.g. "Spawned alice (build)", "Message -> bob", "Task board (3 tasks)")
|
|
284
|
-
- **
|
|
285
|
-
- **
|
|
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
|
|
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
|
|