@serkanalgur/opencode-nexus 2.5.0 → 2.7.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 +113 -40
- package/dist/index.js +4454 -242
- package/dist/tui.js +176 -48
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -30,17 +30,17 @@ OpenCode Nexus is an agent orchestration plugin for [OpenCode V2](https://openco
|
|
|
30
30
|
| **DAG Execution** | Tasks are parallelized based on dependency graphs with priority queuing |
|
|
31
31
|
| **Cost-Aware Routing** | Scores models by quality/cost/speed, selects optimal per task complexity |
|
|
32
32
|
| **Self-Healing** | Retries with exponential backoff, context transfer, escalation policies |
|
|
33
|
-
| **Web Dashboard** |
|
|
33
|
+
| **Web Dashboard** | A live view of sessions, agents, tasks, costs and config, served over HTTP + WebSocket (default port 4747) — started on request, never automatically |
|
|
34
34
|
| **TUI Dashboard** | Monitor agents, budget, and config from the terminal |
|
|
35
35
|
| **Team Mode** | Lead agent orchestrates specialist agents in parallel |
|
|
36
36
|
| **Todo & Goal Tracking** | Enforce task completion, persist objectives across sessions |
|
|
37
37
|
| **Persistent Memory** | SQLite-backed memory store with TTL and search |
|
|
38
38
|
| **Learning Module** | Pattern recognition from failures, confidence scoring |
|
|
39
39
|
| **JSONC Config** | Read/write project and global config files with comments |
|
|
40
|
-
| **LSP
|
|
40
|
+
| **OpenCode LSP opt-in** | On startup, inserts `"lsp": true` into your global `opencode.jsonc` if it isn't already there. That is the whole of it — Nexus does not read LSP state, manage servers, or report anything about them |
|
|
41
41
|
| **AST-Grep** | Pattern-aware code search and rewriting |
|
|
42
42
|
| **Security Scanning** | Automated secrets and vulnerability detection |
|
|
43
|
-
| **Slash Commands** | `/nexus`, `/nexus
|
|
43
|
+
| **Slash Commands** | `/nexus`, `/nexus-web`, `/nexus-config`, `/nexus-model`, `/nexus-status`, `/nexus-dashboard`, `/nexus-reset` |
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
@@ -105,11 +105,11 @@ Use nexus.goal.set with description="Build complete auth system"
|
|
|
105
105
|
### 3. Use Slash Commands
|
|
106
106
|
|
|
107
107
|
```
|
|
108
|
-
/nexus # Open full configuration
|
|
109
|
-
/nexus web #
|
|
110
|
-
/nexus
|
|
111
|
-
/nexus
|
|
112
|
-
/nexus
|
|
108
|
+
/nexus # Open full configuration dialog
|
|
109
|
+
/nexus web # Open the web dashboard, if one is running
|
|
110
|
+
/nexus status # Show the config summary
|
|
111
|
+
/nexus model coder # Pick the model for a role
|
|
112
|
+
/nexus reset # Reset configuration to defaults
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
---
|
|
@@ -146,35 +146,80 @@ Failed tasks follow a 4-step escalation chain:
|
|
|
146
146
|
|
|
147
147
|
### Web Dashboard
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
A live view of the orchestrator, served by an HTTP + WebSocket server on port 4747 (`127.0.0.1`).
|
|
150
150
|
|
|
151
|
-
**
|
|
151
|
+
**Nothing is listening until you ask for it.** The server is not started at
|
|
152
|
+
startup, and no command starts it implicitly. There is exactly one call that
|
|
153
|
+
does, and it has to come from the agent, because the server runs in the OpenCode
|
|
154
|
+
server process next to the orchestrator that feeds it:
|
|
152
155
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
```
|
|
157
|
+
Ask the agent: "start the nexus dashboard"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
which calls `nexus.dashboard.start(port=4747, host="127.0.0.1")` and prints the
|
|
161
|
+
URL. **If the start fails, nothing is listening and no browser is opened** — the
|
|
162
|
+
tool says so and names the reason. The two ways it fails are a port already in
|
|
163
|
+
use (the bind is refused; pass a different `port`) and `dashboard.enabled: false`
|
|
164
|
+
in `nexus.jsonc`, which the tool reports by name.
|
|
157
165
|
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
/nexus web
|
|
161
|
-
```
|
|
162
|
-
This shows instructions and tries to open your browser.
|
|
166
|
+
Once it is running, the TUI command opens it for you:
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
```
|
|
169
|
+
/nexus web [port] [host]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
`/nexus web` **cannot start the server** and does not pretend to. It asks
|
|
173
|
+
`http://host:port/api/health` whether a nexus dashboard is already serving there,
|
|
174
|
+
and then does one of three things:
|
|
175
|
+
|
|
176
|
+
| What it found | What it does |
|
|
177
|
+
|---|---|
|
|
178
|
+
| A nexus dashboard | Opens your browser at that URL |
|
|
179
|
+
| A different process on that port | Says so, opens nothing, suggests another port |
|
|
180
|
+
| Nothing there | Says so, opens nothing, and gives you the one `nexus.dashboard.start` call to make |
|
|
181
|
+
|
|
182
|
+
**How it stays current.** A WebSocket to `/ws/events` carries a throttled
|
|
183
|
+
`orchestrator:state` push — every state change schedules a full snapshot, at
|
|
184
|
+
most once a second — plus the thirteen orchestrator events as they happen. On
|
|
185
|
+
top of that, an **Auto-refresh** checkbox (on by default) has the page ask the
|
|
186
|
+
server for a fresh state every 5 seconds and poll `/api/health` and `/api/costs`,
|
|
187
|
+
the two things the socket does not carry. The push is what keeps the page fresh;
|
|
188
|
+
the interval is a belt-and-braces refresh you can switch off. The page also
|
|
189
|
+
shows how old the last snapshot is, and labels it stale past 15 seconds.
|
|
165
190
|
|
|
166
191
|
**What it shows:**
|
|
167
|
-
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
192
|
+
- **Sessions** — one row per session nexus owns, is still collecting cost from,
|
|
193
|
+
or has abandoned, with each one's state (`running` / `idle` / `abandoned` /
|
|
194
|
+
`settled`), last read token count, and unbilled spend. Rows with **no owning
|
|
195
|
+
agent** are called out in a banner above the table, because a session that is
|
|
196
|
+
still generating after its agent was terminated keeps spending and nothing is
|
|
197
|
+
collecting that spend — a case that was invisible on every layer before.
|
|
198
|
+
This list is nexus's own bookkeeping, not an enumeration of every open session
|
|
199
|
+
on the server, and the page says so on the section itself.
|
|
200
|
+
- **Agents** — role, status, model, session id, and metrics
|
|
201
|
+
- **Budget** — spend against the configured cap, with the alert threshold marked
|
|
202
|
+
- **Tasks and DAG** — the task list, and a graph drawn from the dependency edges
|
|
203
|
+
the state actually reports. Edges pointing at tasks that are not in the
|
|
204
|
+
snapshot, self-edges, and cycles are counted and reported in the section note
|
|
205
|
+
rather than silently not drawn.
|
|
206
|
+
- **Cost breakdown** — by agent and by model, read from `/api/costs`, which
|
|
207
|
+
covers the full history rather than only the live agents
|
|
208
|
+
- **Configuration (read-only)** — the resolved config the orchestrator reports
|
|
209
|
+
as in force, plus a `read-only` JSON viewer. The write path was deliberately
|
|
210
|
+
removed rather than left broken: it used to post a `config:update` message
|
|
211
|
+
that the server does not handle, so the Apply button reported success and
|
|
212
|
+
nothing happened. There is no auth story for writes and the socket is a
|
|
213
|
+
localhost server answering with `CORS: *`, so no write path was added to
|
|
214
|
+
replace it — edit `nexus.jsonc` instead.
|
|
215
|
+
- **Activity log** — every event the broadcaster forwards, each delivered once
|
|
173
216
|
|
|
174
217
|
**Stop the dashboard:**
|
|
175
218
|
```
|
|
176
|
-
nexus.dashboard.stop
|
|
219
|
+
Ask the agent to call nexus.dashboard.stop
|
|
177
220
|
```
|
|
221
|
+
This stops the HTTP/WebSocket server only. The orchestrator, its agents and its
|
|
222
|
+
sessions keep running.
|
|
178
223
|
|
|
179
224
|
### Team Mode
|
|
180
225
|
|
|
@@ -297,8 +342,8 @@ nexus.clarify(question="Should I use JWT or OAuth?", options="JWT, OAuth", assum
|
|
|
297
342
|
| `nexus.preset` | Apply preset config | `{ name }` |
|
|
298
343
|
| `nexus.config.save` | Save config to disk | `{ level: 'project' \| 'global' }` |
|
|
299
344
|
| `nexus.config.init` | Initialize config files | `{ level }` |
|
|
300
|
-
| `nexus.dashboard.start` | Start web dashboard | `{ port?, host? }` |
|
|
301
|
-
| `nexus.dashboard.stop` | Stop web dashboard | `{}` |
|
|
345
|
+
| `nexus.dashboard.start` | Start the web dashboard server (port must be free) | `{ port?, host? }` |
|
|
346
|
+
| `nexus.dashboard.stop` | Stop the web dashboard server | `{}` |
|
|
302
347
|
| `nexus.todo.add` | Add a todo item | `{ description, assignedTo? }` |
|
|
303
348
|
| `nexus.todo.list` | List all todos | `{}` |
|
|
304
349
|
| `nexus.todo.complete` | Complete a todo | `{ id }` |
|
|
@@ -327,17 +372,26 @@ nexus.clarify(question="Should I use JWT or OAuth?", options="JWT, OAuth", assum
|
|
|
327
372
|
|
|
328
373
|
## TUI Commands
|
|
329
374
|
|
|
375
|
+
The TUI plugin registers exactly these slash commands. With no argument,
|
|
376
|
+
`/nexus` opens the full configuration dialog; with one, it dispatches to a
|
|
377
|
+
subcommand (`config`/`c`, `status`/`s`, `dashboard`/`d`, `web`/`w`,
|
|
378
|
+
`model`/`m`, `reset`).
|
|
379
|
+
|
|
330
380
|
| Command | Alias | Description |
|
|
331
381
|
|---------|-------|-------------|
|
|
332
|
-
| `/nexus` | `Ctrl+N` |
|
|
333
|
-
| `/nexus
|
|
334
|
-
| `/nexus
|
|
335
|
-
| `/nexus
|
|
336
|
-
| `/nexus
|
|
337
|
-
| `/nexus
|
|
338
|
-
| `/nexus
|
|
339
|
-
|
|
340
|
-
|
|
382
|
+
| `/nexus` | `Ctrl+N` | Full configuration dialog, or a subcommand |
|
|
383
|
+
| `/nexus-web` | `/nw` | Open the web dashboard if one is already serving; otherwise say how to start it. Does not start the server — see [Web Dashboard](#web-dashboard) |
|
|
384
|
+
| `/nexus-config` | `/nc` | Configure models & budget |
|
|
385
|
+
| `/nexus-model` | `/nm` | Select a model for a role |
|
|
386
|
+
| `/nexus-status` | `/ns` | Show the config summary |
|
|
387
|
+
| `/nexus-dashboard` | `/nd` | Config, budget and dashboard-status overview. Prints text; starts nothing |
|
|
388
|
+
| `/nexus-reset` | — | Reset all settings to defaults |
|
|
389
|
+
|
|
390
|
+
A prompt beginning `/nexus …` typed into the composer is a *different* thing: it
|
|
391
|
+
is intercepted by a prompt hook and routed to `orchestrator.handleCommand()`,
|
|
392
|
+
which understands only `status`, `agents`, `costs`, `pause`, `resume` and
|
|
393
|
+
`dashboard` (which returns the state as JSON). Anything else answers
|
|
394
|
+
`Unknown command`. The table above is the TUI palette.
|
|
341
395
|
|
|
342
396
|
---
|
|
343
397
|
|
|
@@ -356,6 +410,24 @@ Configure via `/nexus` or `Ctrl+N`:
|
|
|
356
410
|
📝 Documenter: opencode/big-pickle
|
|
357
411
|
```
|
|
358
412
|
|
|
413
|
+
### Web Dashboard
|
|
414
|
+
|
|
415
|
+
`.opencode/nexus.jsonc` (project) and `~/.config/opencode/nexus.jsonc` (global)
|
|
416
|
+
both accept:
|
|
417
|
+
|
|
418
|
+
```jsonc
|
|
419
|
+
{
|
|
420
|
+
"dashboard": {
|
|
421
|
+
"enabled": true, // false makes every start attempt refuse, and say so
|
|
422
|
+
"port": 4747, // default port; startDashboard({port}) still wins
|
|
423
|
+
"host": "127.0.0.1"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
The server has no authentication, which is why `host` defaults to loopback.
|
|
429
|
+
Leave it there unless you have put your own authentication in front of it.
|
|
430
|
+
|
|
359
431
|
### Custom Roles
|
|
360
432
|
|
|
361
433
|
Define your own agent roles:
|
|
@@ -395,7 +467,7 @@ nexus.template(name="documentation") — Documentation update
|
|
|
395
467
|
│ ┌────────────────────────────────────────────────────┐ │
|
|
396
468
|
│ │ SERVER PLUGIN (index.ts) │ │
|
|
397
469
|
│ │ • 40+ tool registrations │ │
|
|
398
|
-
│ │ • Auto-creates
|
|
470
|
+
│ │ • Auto-creates agent files; opts OpenCode into LSP │ │
|
|
399
471
|
│ │ • Config file loading and creation │ │
|
|
400
472
|
│ └────────────────────────────────────────────────────┘ │
|
|
401
473
|
│ │
|
|
@@ -422,7 +494,8 @@ nexus.template(name="documentation") — Documentation update
|
|
|
422
494
|
│ ┌────────────────────────────────────────────────────┐ │
|
|
423
495
|
│ │ WEB DASHBOARD │ │
|
|
424
496
|
│ │ • Bun.serve() HTTP + WebSocket (port 4747) │ │
|
|
425
|
-
│ │ • DAG viz, cost chart, config
|
|
497
|
+
│ │ • DAG viz, cost chart, read-only config, sessions │ │
|
|
498
|
+
│ │ • Started on request; throttled push + poll │ │
|
|
426
499
|
│ └────────────────────────────────────────────────────┘ │
|
|
427
500
|
│ │
|
|
428
501
|
│ ┌────────────────────────────────────────────────────┐ │
|