@hueyexe/opencode-ensemble 0.18.0 → 0.21.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 +45 -24
- package/dist/index.js +17224 -30767
- package/package.json +2 -2
- package/src/config.ts +33 -0
- package/src/dashboard-html.ts +34 -1
- package/src/dashboard-js-events.ts +9 -0
- package/src/dashboard-js-graph-layout.ts +40 -0
- package/src/dashboard-js-graph.ts +99 -0
- package/src/dashboard.ts +8 -19
- package/src/hooks.ts +3 -3
- package/src/index.ts +11 -23
- package/src/member-model.ts +107 -3
- package/src/messaging.ts +4 -2
- package/src/notify.ts +9 -18
- package/src/recovery.ts +23 -16
- package/src/schema.ts +4 -0
- package/src/system-prompt.ts +79 -50
- package/src/task-graph.ts +116 -0
- package/src/tool-arg-hint.ts +71 -0
- package/src/tools/team-broadcast.ts +21 -3
- package/src/tools/team-message.ts +4 -5
- package/src/tools/team-results.ts +15 -5
- package/src/tools/team-spawn.ts +68 -16
- package/src/tools/team-tasks-add.ts +56 -3
- package/src/tools/team-tasks-complete.ts +2 -1
- package/src/types.ts +5 -1
- package/src/v2-client.ts +103 -14
- package/src/v2-setup.ts +16 -3
- package/src/wake.ts +198 -0
package/README.md
CHANGED
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@hueyexe/opencode-ensemble)
|
|
8
8
|
[](https://www.npmjs.com/package/@hueyexe/opencode-ensemble)
|
|
9
|
-
[](https://github.com/hueyexe/opencode-ensemble/actions/workflows/ci.yml)
|
|
10
10
|
[]()
|
|
11
|
-
[]()
|
|
12
12
|
[](./LICENSE)
|
|
13
13
|
|
|
14
14
|
Run parallel AI agents in OpenCode. Each agent gets its own session, context window, and task. They coordinate through messaging and a shared task board.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Built on the public OpenCode SDKs — no OpenCode internals. Runtime dependencies are the three OpenCode SDK packages (`@opencode-ai/sdk`, `@opencode-ai/plugin`, `@opencode/plugin`). The bundled TUI companion additionally uses SolidJS and OpenTUI, provided by the OpenCode host and declared as peer dependencies.
|
|
17
17
|
|
|
18
18
|
## Quick Start
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
Install the plugin and you're done:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
opencode plugin add @hueyexe/opencode-ensemble@latest
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Then restart OpenCode and ask it to do something that benefits from parallel work. The agent handles the rest. See [Install](#install) for worktree permissions and other options.
|
|
27
27
|
|
|
28
28
|
## What actually happens
|
|
29
29
|
|
|
@@ -148,21 +148,26 @@ A real-time mission control dashboard runs at `http://localhost:4747` while Open
|
|
|
148
148
|
- **Agent cards** — status, current task, activity sparklines, timing. Click to open detail drawer
|
|
149
149
|
- **Agent drawer** — full prompt, model, execution status, chat-style message history with markdown rendering
|
|
150
150
|
- **Task board** — progress bar, collapsible status groups, dependency arrows
|
|
151
|
+
- **Dependency graph tab** — task cards with agent ownership, prerequisite arrows,
|
|
152
|
+
dependency inspection, live updates, and missing/cyclic dependency warnings
|
|
151
153
|
- **Activity feed** — chat-style message bubbles with avatars, expandable with full markdown
|
|
152
154
|
- **Timeline** — horizontal event strip showing spawns, messages, completions, shutdowns
|
|
153
155
|
- **Keyboard shortcuts** — `j/k` navigate agents, `Enter` opens drawer, `Esc` closes, `?` shows help
|
|
154
156
|
- **Live clock** — current time + team session duration
|
|
155
157
|
- **Project outline** — collapsible per-project grouping when teams span multiple working directories
|
|
156
158
|
|
|
159
|
+
The **Dependency graph** tab lays out every task as a card, with arrows from each prerequisite to its dependent, live agent ownership/status, a detail panel for prerequisites and dependents, and warnings for missing or cyclic dependency IDs. Add dependencies with the `depends_on` field on `team_tasks_add`.
|
|
160
|
+
|
|
157
161
|
Configure the port in `.opencode/ensemble.json`:
|
|
158
162
|
|
|
159
163
|
```json
|
|
160
164
|
{
|
|
161
|
-
"dashboardPort": 4747
|
|
165
|
+
"dashboardPort": 4747,
|
|
166
|
+
"dashboardHost": "127.0.0.1"
|
|
162
167
|
}
|
|
163
168
|
```
|
|
164
169
|
|
|
165
|
-
Set to `0` to disable. The dashboard starts automatically when OpenCode loads the plugin.
|
|
170
|
+
Set `dashboardPort` to `0` to disable. The dashboard starts automatically when OpenCode loads the plugin. `dashboardHost` defaults to loopback; changing it can expose dashboard data to other machines on your network.
|
|
166
171
|
|
|
167
172
|
## Install
|
|
168
173
|
|
|
@@ -177,14 +182,22 @@ The plugin uses SQLite via the host's runtime adapter:
|
|
|
177
182
|
|
|
178
183
|
### 1. Add the plugin
|
|
179
184
|
|
|
180
|
-
|
|
185
|
+
The simplest install is the CLI (npm registry or Git package specifiers both work):
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
opencode plugin add @hueyexe/opencode-ensemble@latest
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
This installs globally and writes the config entry for you. To update later: `opencode plugin update @hueyexe/opencode-ensemble`.
|
|
192
|
+
|
|
193
|
+
**Manual config** — add to your OpenCode config with `@latest`, or pin an exact version for reproducibility. Project-level or global.
|
|
181
194
|
|
|
182
195
|
**Project-level** (`opencode.json` in your project root):
|
|
183
196
|
|
|
184
197
|
```jsonc
|
|
185
198
|
{
|
|
186
199
|
// OpenCode v2:
|
|
187
|
-
"plugins": ["@hueyexe/opencode-ensemble@
|
|
200
|
+
"plugins": ["@hueyexe/opencode-ensemble@latest"]
|
|
188
201
|
}
|
|
189
202
|
```
|
|
190
203
|
|
|
@@ -193,15 +206,13 @@ Add to your OpenCode config with a pinned version. Project-level or global. On O
|
|
|
193
206
|
```jsonc
|
|
194
207
|
{
|
|
195
208
|
// OpenCode v1:
|
|
196
|
-
"plugin": ["@hueyexe/opencode-ensemble@
|
|
209
|
+
"plugin": ["@hueyexe/opencode-ensemble@latest"]
|
|
197
210
|
}
|
|
198
211
|
```
|
|
199
212
|
|
|
200
|
-
OpenCode auto-installs npm plugins at startup. To update,
|
|
201
|
-
|
|
202
|
-
**Why pin versions?** OpenCode has a [known bug](https://github.com/anomalyco/opencode/issues/6774) where unpinned plugins (e.g., `"@hueyexe/opencode-ensemble"`) get cached on first install and never auto-update, even after restarting. Pinning to a specific version avoids this — when you change the version string, OpenCode sees a new package spec and installs it fresh.
|
|
213
|
+
OpenCode auto-installs npm plugins at startup. To update, change the version spec in your config (or keep `@latest`) and restart OpenCode.
|
|
203
214
|
|
|
204
|
-
If
|
|
215
|
+
**If updates do not appear:** OpenCode has a [known bug](https://github.com/anomalyco/opencode/issues/6774) where unpinned plugins (e.g., `"@hueyexe/opencode-ensemble"`) get cached on first install and never auto-update, even after restarting. If you hit it, pin an exact version tag (for example, `@0.21.0`) and bump it when you upgrade, or clear the cache manually:
|
|
205
216
|
|
|
206
217
|
```bash
|
|
207
218
|
rm -rf ~/.cache/opencode/packages/@hueyexe
|
|
@@ -241,7 +252,7 @@ This is required. Without it, you'll see "Permission required — Access externa
|
|
|
241
252
|
|
|
242
253
|
### Local development
|
|
243
254
|
|
|
244
|
-
|
|
255
|
+
Configure the worktree as a local plugin (v2 loads the source entry; v1 uses the `server()` export from the same file):
|
|
245
256
|
|
|
246
257
|
```jsonc
|
|
247
258
|
{
|
|
@@ -320,7 +331,7 @@ What you get:
|
|
|
320
331
|
|
|
321
332
|
## Model Selection
|
|
322
333
|
|
|
323
|
-
Control which AI models your agents use. By default,
|
|
334
|
+
Control which AI models your agents use. By default, teammates inherit the lead conversation's current model, read at spawn time (including its variant on v2). You can override this per-agent, per-agent-type, or with automatic rotation.
|
|
324
335
|
|
|
325
336
|
**All agents use the same model:**
|
|
326
337
|
```json
|
|
@@ -362,7 +373,8 @@ When `promptForModels` is true, the lead uses the question tool to ask which mod
|
|
|
362
373
|
2. `modelsByAgent` mapping for this agent type
|
|
363
374
|
3. `modelAssignment` strategy (`rotate` or `random` from `modelPool`)
|
|
364
375
|
4. `defaultModel`
|
|
365
|
-
5.
|
|
376
|
+
5. The lead conversation's current model at spawn time (including its variant on v2)
|
|
377
|
+
6. OpenCode's default model
|
|
366
378
|
|
|
367
379
|
The lead can always override by passing `model` directly on `team_spawn`, regardless of config.
|
|
368
380
|
|
|
@@ -385,11 +397,15 @@ Configure via JSON files, environment variables, or both. Project config overrid
|
|
|
385
397
|
"timeoutMs": 1800000,
|
|
386
398
|
"rateLimitCapacity": 10,
|
|
387
399
|
"dashboardPort": 4747,
|
|
400
|
+
"dashboardHost": "127.0.0.1",
|
|
388
401
|
"defaultModel": "anthropic/claude-sonnet-4-6",
|
|
389
402
|
"modelPool": ["anthropic/claude-opus-4-7", "anthropic/claude-sonnet-4-6", "openai/gpt-5.4"],
|
|
390
403
|
"modelsByAgent": {},
|
|
391
404
|
"modelAssignment": "default",
|
|
392
|
-
"promptForModels": false
|
|
405
|
+
"promptForModels": false,
|
|
406
|
+
"systemPromptTeamState": "full",
|
|
407
|
+
"taskDepthLimit": 0,
|
|
408
|
+
"taskDepthLimitOverflowAction": "lead_resolve"
|
|
393
409
|
}
|
|
394
410
|
```
|
|
395
411
|
|
|
@@ -406,11 +422,15 @@ All fields are optional. Missing fields use defaults.
|
|
|
406
422
|
| `timeoutMs` | `1800000` (30 min) | Hard timeout for busy teammates. `0` disables. |
|
|
407
423
|
| `rateLimitCapacity` | `10` | Token bucket capacity for team tool calls. `0` disables. |
|
|
408
424
|
| `dashboardPort` | `4747` | Dashboard server port. `0` disables. |
|
|
409
|
-
| `
|
|
425
|
+
| `dashboardHost` | `127.0.0.1` | Dashboard network interface to bind. Keep the loopback default unless you intend to expose the dashboard on your network. |
|
|
426
|
+
| `defaultModel` | `""` | Default model for all agents (e.g. `"anthropic/claude-sonnet-4-6"`). Empty = inherit the lead conversation's current model, then OpenCode's default. |
|
|
410
427
|
| `modelPool` | `[]` | List of models for rotation/random assignment. |
|
|
411
428
|
| `modelsByAgent` | `{}` | Map agent type to model (e.g. `{"build": "anthropic/claude-opus-4-7"}`). |
|
|
412
429
|
| `modelAssignment` | `"default"` | How to assign models: `"default"`, `"rotate"`, or `"random"`. |
|
|
413
430
|
| `promptForModels` | `false` | Lead asks user about model preferences before spawning. |
|
|
431
|
+
| `systemPromptTeamState` | `"full"` | Live team state in the system prompt: `"full"` (statuses, tasks, message payloads), `"state-only"` (no message payloads; use `team_results`), or `"off"` (stable role/workflow guidance only). Lower settings avoid provider prefix-cache invalidation on every state change. |
|
|
432
|
+
| `taskDepthLimit` | `0` (unlimited) | Maximum active task dependency depth, counting unresolved roots as depth 1. Completed/cancelled prerequisites are treated as resolved and do not accumulate into a lifetime chain. `team_tasks_add` rejects a batch that would exceed it, before writing anything. The issue #42 `depth_limit` alias is accepted. |
|
|
433
|
+
| `taskDepthLimitOverflowAction` | `"lead_resolve"` | `"lead_resolve"` tells the lead to split the work; `"user_resolve"` tells the lead to ask the user first. Both reject the over-limit batch. The issue #42 `depth_limit_overflow_action` alias is accepted. |
|
|
414
434
|
|
|
415
435
|
### Environment variables
|
|
416
436
|
|
|
@@ -448,7 +468,8 @@ STALL_THRESHOLD_MS=0
|
|
|
448
468
|
|
|
449
469
|
## Known limitations
|
|
450
470
|
|
|
451
|
-
- **
|
|
471
|
+
- **Lead agent/model preservation is best-effort (v1).** On v1, Ensemble reads the lead's current agent and model and passes them on teammate wake prompts, so a Plan lead normally stays in Plan. If OpenCode cannot report the selection, it may fall back to Build/default; pass an explicit `model` on `team_spawn` when this matters. V2 wakes are synthetic and do not switch the lead's agent/model.
|
|
472
|
+
- **Model variants are v2-only.** A `provider/model#variant` reference is forwarded to v2's `session.switchModel`; v1 hosts do not have a variant field and ignore the suffix.
|
|
452
473
|
- **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
474
|
- **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.
|
|
454
475
|
|
|
@@ -469,7 +490,7 @@ Same coordination model (shared tasks, peer messaging, lead coordination) with s
|
|
|
469
490
|
```bash
|
|
470
491
|
bun install
|
|
471
492
|
bun run typecheck
|
|
472
|
-
bun test #
|
|
493
|
+
bun test # 835 tests
|
|
473
494
|
bun run build
|
|
474
495
|
```
|
|
475
496
|
|