@serkanalgur/opencode-nexus 1.7.0 → 1.8.1
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 +254 -330
- package/dist/index.js +1183 -50
- package/dist/tui.js +177 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
<img src="./assets/banner.svg" alt="OpenCode Nexus" width="100%" />
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@serkanalgur/opencode-nexus)
|
|
6
|
+
[](https://www.npmjs.com/package/@serkanalgur/opencode-nexus)
|
|
6
7
|
[](https://github.com/serkanalgur/opencode-nexus/blob/main/LICENSE)
|
|
7
8
|
[](https://opencode.ai)
|
|
8
9
|
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](https://github.com/sponsors/serkanalgur)
|
|
9
11
|
|
|
10
12
|
**Adaptive Multi-Agent Orchestration with Cost Intelligence**
|
|
11
13
|
|
|
12
|
-
[Installation](#installation) • [Quick Start](#quick-start) • [Features](#features) • [
|
|
14
|
+
[Installation](#installation) • [Quick Start](#quick-start) • [Features](#features) • [Agents](#agents) • [Tools](#tools) • [Configuration](#configuration) • [Development](#development)
|
|
13
15
|
|
|
14
16
|
</div>
|
|
15
17
|
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
|
|
18
20
|
## What is OpenCode Nexus?
|
|
19
21
|
|
|
20
|
-
OpenCode Nexus is an agent orchestration plugin for [OpenCode V2](https://opencode.ai) that spawns **real sub-agent sessions** with **cost-aware routing**, **DAG-based task execution**, **self-healing**, and a **TUI dashboard**.
|
|
22
|
+
OpenCode Nexus is an agent orchestration plugin for [OpenCode V2](https://opencode.ai) that spawns **real sub-agent sessions** with **cost-aware routing**, **DAG-based task execution**, **self-healing**, and a **TUI/web dashboard**.
|
|
21
23
|
|
|
22
24
|
### Key Capabilities
|
|
23
25
|
|
|
@@ -30,10 +32,15 @@ OpenCode Nexus is an agent orchestration plugin for [OpenCode V2](https://openco
|
|
|
30
32
|
| **Self-Healing** | Retries with exponential backoff, context transfer, escalation policies |
|
|
31
33
|
| **Web Dashboard** | Real-time monitoring via HTTP + WebSocket server on port 4747 |
|
|
32
34
|
| **TUI Dashboard** | Monitor agents, budget, and config from the terminal |
|
|
35
|
+
| **Team Mode** | Lead agent orchestrates specialist agents in parallel |
|
|
36
|
+
| **Todo & Goal Tracking** | Enforce task completion, persist objectives across sessions |
|
|
33
37
|
| **Persistent Memory** | SQLite-backed memory store with TTL and search |
|
|
34
38
|
| **Learning Module** | Pattern recognition from failures, confidence scoring |
|
|
35
39
|
| **JSONC Config** | Read/write project and global config files with comments |
|
|
36
|
-
| **
|
|
40
|
+
| **LSP Integration** | Auto-enabled for TypeScript, Python, Go, and 30+ languages |
|
|
41
|
+
| **AST-Grep** | Pattern-aware code search and rewriting |
|
|
42
|
+
| **Security Scanning** | Automated secrets and vulnerability detection |
|
|
43
|
+
| **Slash Commands** | `/nexus`, `/nexus web`, `/nexus review`, and more |
|
|
37
44
|
|
|
38
45
|
---
|
|
39
46
|
|
|
@@ -50,157 +57,170 @@ bun add -g @serkanalgur/opencode-nexus
|
|
|
50
57
|
opencode plugin @serkanalgur/opencode-nexus --global
|
|
51
58
|
```
|
|
52
59
|
|
|
53
|
-
Or manually add to `~/.config/opencode/opencode.
|
|
60
|
+
Or manually add to `~/.config/opencode/opencode.jsonc`:
|
|
54
61
|
|
|
55
|
-
```
|
|
62
|
+
```jsonc
|
|
56
63
|
{
|
|
57
64
|
"plugins": ["@serkanalgur/opencode-nexus"]
|
|
58
65
|
}
|
|
59
66
|
```
|
|
60
67
|
|
|
68
|
+
### Auto-Setup
|
|
69
|
+
|
|
70
|
+
On first load, Nexus automatically:
|
|
71
|
+
- Creates `nexus-orchestrator` agent in `~/.config/opencode/agents/`
|
|
72
|
+
- Creates subagent files: `nexus-coder`, `nexus-explorer`, `nexus-reviewer`, `nexus-tester`, `nexus-architect`, `nexus-documenter`
|
|
73
|
+
- Enables LSP in OpenCode config
|
|
74
|
+
- Configures agent models from `.opencode/nexus.jsonc`
|
|
75
|
+
|
|
61
76
|
---
|
|
62
77
|
|
|
63
78
|
## Quick Start
|
|
64
79
|
|
|
65
80
|
### 1. Configure Agent Models
|
|
66
81
|
|
|
67
|
-
Press **Ctrl+N** or type `/nexus` to open the configuration dialog
|
|
82
|
+
Press **Ctrl+N** or type `/nexus` to open the configuration dialog. Select where to save (project or global).
|
|
68
83
|
|
|
69
|
-
### 2. Use
|
|
84
|
+
### 2. Use the Nexus Orchestrator
|
|
85
|
+
|
|
86
|
+
Select `nexus-orchestrator` as your primary agent, then:
|
|
70
87
|
|
|
71
88
|
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
/nexus status # Show config summary
|
|
75
|
-
/nexus dashboard # Show dashboard
|
|
76
|
-
/nexus model # Select model for a role
|
|
77
|
-
/nexus reset # Reset to defaults
|
|
78
|
-
```
|
|
89
|
+
# Spawn agents for tasks
|
|
90
|
+
Use nexus.spawn with role="coder" and task="Implement JWT auth"
|
|
79
91
|
|
|
80
|
-
|
|
92
|
+
# Wait for completion and get results
|
|
93
|
+
Use nexus.spawn with role="reviewer" and task="Review the implementation" and wait=true
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
# Delegate (convenience wrapper)
|
|
96
|
+
Use nexus.delegate with role="tester" and task="Write tests for auth module"
|
|
83
97
|
|
|
84
|
-
|
|
85
|
-
Use
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Use
|
|
98
|
+
# Check progress
|
|
99
|
+
Use nexus.sessions
|
|
100
|
+
|
|
101
|
+
# Track goals
|
|
102
|
+
Use nexus.goal.set with description="Build complete auth system"
|
|
89
103
|
```
|
|
90
104
|
|
|
91
|
-
###
|
|
105
|
+
### 3. Use Slash Commands
|
|
92
106
|
|
|
93
|
-
```
|
|
94
|
-
|
|
107
|
+
```
|
|
108
|
+
/nexus # Open full configuration
|
|
109
|
+
/nexus web # Start web dashboard (open http://localhost:4747)
|
|
110
|
+
/nexus review # Quick code review
|
|
111
|
+
/nexus fix # Quick fix for last error
|
|
112
|
+
/nexus explain # Explain last change
|
|
113
|
+
```
|
|
95
114
|
|
|
96
|
-
|
|
97
|
-
budget: { maxTotalCost: 10.00 }
|
|
98
|
-
})
|
|
115
|
+
---
|
|
99
116
|
|
|
100
|
-
|
|
101
|
-
orchestrator.initialize(ctx)
|
|
117
|
+
## Features
|
|
102
118
|
|
|
103
|
-
|
|
104
|
-
const agent = await orchestrator.spawnAgent({ role: 'coder' })
|
|
119
|
+
### Cost-Aware Model Selection
|
|
105
120
|
|
|
106
|
-
|
|
107
|
-
const result = await orchestrator.execute({
|
|
108
|
-
tasks: [
|
|
109
|
-
{
|
|
110
|
-
id: 'task-1',
|
|
111
|
-
name: 'Implement auth',
|
|
112
|
-
description: 'Add JWT authentication',
|
|
113
|
-
requiredRole: 'coder',
|
|
114
|
-
complexity: { overall: 60, factors: { fileCount: 3, codeLines: 200, dependencyDepth: 2, domainKnowledge: 40, riskLevel: 'medium' } },
|
|
115
|
-
dependencies: [],
|
|
116
|
-
files: { include: ['src/auth/**'] },
|
|
117
|
-
priority: 'high',
|
|
118
|
-
status: 'pending'
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
})
|
|
121
|
+
Models are configured per role in `.opencode/nexus.jsonc`. Nexus scores models by quality, cost, and speed — then picks the optimal one:
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
```jsonc
|
|
124
|
+
{
|
|
125
|
+
"models": {
|
|
126
|
+
"architect": "opencode/muse-spark-1.3-contributor-free",
|
|
127
|
+
"coder": "opencode/mimo-v2.6-flash-free",
|
|
128
|
+
"reviewer": "opencode/muse-spark-1.2-contributor-free",
|
|
129
|
+
"tester": "opencode-go/mimo-v2.5",
|
|
130
|
+
"explorer": "opencode/big-pickle",
|
|
131
|
+
"documenter": "opencode/big-pickle"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
124
134
|
```
|
|
125
135
|
|
|
126
|
-
|
|
136
|
+
When you call `nexus.spawn(role="coder")`, the coder model from config is used automatically.
|
|
127
137
|
|
|
128
|
-
|
|
138
|
+
### Self-Healing with Escalation
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
Failed tasks follow a 4-step escalation chain:
|
|
131
141
|
|
|
132
|
-
|
|
142
|
+
1. **Retry** — Exponential backoff (1s, 2s, 4s...)
|
|
143
|
+
2. **Respawn** — Collect context, spawn new agent with transferred state
|
|
144
|
+
3. **Fallback Model** — Try cheaper alternative model
|
|
145
|
+
4. **Alert** — Emit escalation event, mark as failed
|
|
133
146
|
|
|
134
|
-
|
|
135
|
-
// Creates a real OpenCode session with descriptive title
|
|
136
|
-
const session = await ctx.session.create({
|
|
137
|
-
title: '💻 Coder — anthropic/claude-sonnet-4-6',
|
|
138
|
-
agent: 'build',
|
|
139
|
-
model: { providerID: 'anthropic', id: 'claude-sonnet-4-6' }
|
|
140
|
-
})
|
|
147
|
+
### Web Dashboard
|
|
141
148
|
|
|
142
|
-
|
|
143
|
-
await ctx.session.prompt({ sessionID: session.id, text: 'You are a senior software engineer...' })
|
|
144
|
-
```
|
|
149
|
+
Real-time monitoring via embedded HTTP + WebSocket server on port 4747.
|
|
145
150
|
|
|
146
|
-
|
|
151
|
+
**How to start:**
|
|
147
152
|
|
|
148
|
-
|
|
153
|
+
1. Ask the agent to start the dashboard:
|
|
154
|
+
```
|
|
155
|
+
Use nexus.dashboard.start with port=4747
|
|
156
|
+
```
|
|
149
157
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
| **Tester** | `build-orchestrator` | Comprehensive tests, edge cases, quality assurance |
|
|
156
|
-
| **Explorer** | `explore` | Codebase navigation, architecture analysis |
|
|
157
|
-
| **Documenter** | `doc-writer` | Clear technical documentation |
|
|
158
|
+
2. Or use the TUI command:
|
|
159
|
+
```
|
|
160
|
+
/nexus web
|
|
161
|
+
```
|
|
162
|
+
This shows instructions and tries to open your browser.
|
|
158
163
|
|
|
159
|
-
|
|
164
|
+
3. Open in browser: `http://localhost:4747`
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
**What it shows:**
|
|
167
|
+
- Agent grid with role, status, model, and metrics
|
|
168
|
+
- Cost tracker with budget gauge
|
|
169
|
+
- DAG visualization with task dependencies
|
|
170
|
+
- Activity log with all events
|
|
171
|
+
- Config panel (read-only)
|
|
172
|
+
- Auto-refresh every 5 seconds
|
|
162
173
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
174
|
+
**Stop the dashboard:**
|
|
175
|
+
```
|
|
176
|
+
nexus.dashboard.stop()
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Team Mode
|
|
167
180
|
|
|
168
|
-
|
|
169
|
-
|
|
181
|
+
Create a team of specialist agents working in parallel:
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
nexus.team.create(name="auth-team", leadRole="architect")
|
|
185
|
+
nexus.team.addMember(teamId="...", role="coder", model="opencode/mimo-v2.6-flash-free")
|
|
186
|
+
nexus.team.addMember(teamId="...", role="reviewer", model="opencode/muse-spark-1.2-contributor-free")
|
|
187
|
+
nexus.team.activate(teamId="...")
|
|
170
188
|
```
|
|
171
189
|
|
|
172
|
-
###
|
|
190
|
+
### Todo & Goal Tracking
|
|
173
191
|
|
|
174
|
-
|
|
192
|
+
Track tasks and persist objectives across sessions:
|
|
175
193
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
194
|
+
```
|
|
195
|
+
nexus.todo.add(description="Implement auth middleware")
|
|
196
|
+
nexus.todo.list()
|
|
197
|
+
nexus.todo.complete(id="...")
|
|
180
198
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
enabled: true,
|
|
185
|
-
maxRetries: 3,
|
|
186
|
-
contextTransfer: true
|
|
187
|
-
}
|
|
188
|
-
})
|
|
199
|
+
nexus.goal.set(description="Build complete auth system")
|
|
200
|
+
nexus.goal.status()
|
|
201
|
+
nexus.goal.complete()
|
|
189
202
|
```
|
|
190
203
|
|
|
191
|
-
###
|
|
204
|
+
### LSP Integration
|
|
192
205
|
|
|
193
|
-
|
|
206
|
+
OpenCode's built-in LSP servers are auto-enabled. Supports 30+ languages including TypeScript, Python, Go, Rust, and more.
|
|
194
207
|
|
|
195
|
-
|
|
196
|
-
# Start dashboard
|
|
197
|
-
Use nexus.dashboard.start with port=4747
|
|
208
|
+
### AST-Grep
|
|
198
209
|
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
Pattern-aware code search and rewriting:
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
nexus.astgrep.search(pattern="console.log($$$)", language="typescript", directory="src/")
|
|
214
|
+
nexus.astgrep.rewrite(pattern="var $X", rewrite="const $X", language="typescript", directory="src/")
|
|
201
215
|
```
|
|
202
216
|
|
|
203
|
-
|
|
217
|
+
### Security Scanning
|
|
218
|
+
|
|
219
|
+
Automated secrets and vulnerability detection:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
nexus.security.scan(content="const API_KEY = \"sk-123\"", filename="config.ts")
|
|
223
|
+
```
|
|
204
224
|
|
|
205
225
|
### Persistent Memory
|
|
206
226
|
|
|
@@ -215,9 +235,6 @@ orchestrator.memoryStore.set({
|
|
|
215
235
|
confidence: 0.9,
|
|
216
236
|
tags: ['api', 'design']
|
|
217
237
|
})
|
|
218
|
-
|
|
219
|
-
// Search across all memory
|
|
220
|
-
const results = orchestrator.memoryStore.search('api pattern')
|
|
221
238
|
```
|
|
222
239
|
|
|
223
240
|
### Learning Module
|
|
@@ -225,36 +242,12 @@ const results = orchestrator.memoryStore.search('api pattern')
|
|
|
225
242
|
Records failure patterns and solutions, building confidence over time:
|
|
226
243
|
|
|
227
244
|
```typescript
|
|
228
|
-
// Automatically records failures during execution
|
|
229
|
-
// Finds similar past failures and suggests solutions
|
|
230
|
-
// Confidence increases with successful reuse
|
|
231
|
-
|
|
232
245
|
const solutions = orchestrator.learning.findSolutions('TypeScript TS2345 error')
|
|
233
246
|
// → [{ entry: { solution: 'Add type cast', confidence: 0.85 }, similarity: 0.7 }]
|
|
234
247
|
```
|
|
235
248
|
|
|
236
|
-
### JSONC Configuration
|
|
237
|
-
|
|
238
|
-
Read and write config files with comments:
|
|
239
|
-
|
|
240
|
-
```jsonc
|
|
241
|
-
// .opencode/nexus.jsonc (project-level)
|
|
242
|
-
{
|
|
243
|
-
// Agent models for each role
|
|
244
|
-
"models": {
|
|
245
|
-
"architect": "anthropic/claude-sonnet-4-6",
|
|
246
|
-
"coder": "opencode-go/mimo-v2.5"
|
|
247
|
-
},
|
|
248
|
-
"budget": { "maxTotalCost": 10.00 }
|
|
249
|
-
}
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
Precedence: project > global > TUI > defaults.
|
|
253
|
-
|
|
254
249
|
### Preset Configurations
|
|
255
250
|
|
|
256
|
-
Quickly apply predefined configs:
|
|
257
|
-
|
|
258
251
|
| Preset | Models | Budget | Self-Healing |
|
|
259
252
|
|--------|--------|--------|--------------|
|
|
260
253
|
| **minimal** | Gemini Flash | $1 | Off |
|
|
@@ -262,184 +255,133 @@ Quickly apply predefined configs:
|
|
|
262
255
|
| **enterprise** | Top-tier | $50 | On (5 retries) |
|
|
263
256
|
| **cost-optimized** | Cheapest | $3 | On (2 retries) |
|
|
264
257
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
Extend Nexus with custom modules:
|
|
268
|
-
|
|
269
|
-
```typescript
|
|
270
|
-
import { NexusPlugin } from '@serkanalgur/opencode-nexus'
|
|
271
|
-
|
|
272
|
-
NexusPlugin.register({
|
|
273
|
-
name: 'my-custom-module',
|
|
274
|
-
description: 'Custom feature',
|
|
275
|
-
version: '1.0.0',
|
|
276
|
-
setup: async (ctx) => { /* ... */ },
|
|
277
|
-
teardown: async () => { /* ... */ }
|
|
278
|
-
})
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
### Custom Agent Roles
|
|
282
|
-
|
|
283
|
-
Define your own agent roles with custom prompts:
|
|
284
|
-
|
|
285
|
-
```jsonc
|
|
286
|
-
// .opencode/nexus.jsonc
|
|
287
|
-
{
|
|
288
|
-
"customRoles": [
|
|
289
|
-
{
|
|
290
|
-
"name": "security-auditor",
|
|
291
|
-
"displayName": "Security Auditor",
|
|
292
|
-
"emoji": "🔐",
|
|
293
|
-
"prompt": "You are a security auditor. Focus on OWASP Top 10, vulnerability scanning, and security best practices.",
|
|
294
|
-
"model": "anthropic/claude-sonnet-4-6"
|
|
295
|
-
}
|
|
296
|
-
]
|
|
297
|
-
}
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
Or register dynamically via tools: `nexus.roles.add(name="security-auditor", displayName="Security Auditor", prompt="...")`
|
|
301
|
-
|
|
302
|
-
### Execution History
|
|
303
|
-
|
|
304
|
-
Track all task executions with costs, durations, and outcomes:
|
|
305
|
-
|
|
306
|
-
```
|
|
307
|
-
nexus.history.list(count=10) — Recent executions
|
|
308
|
-
nexus.history.stats() — Success rate, avg cost, breakdown by role
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
### Cost Forecasting
|
|
312
|
-
|
|
313
|
-
Predict costs before executing tasks:
|
|
258
|
+
---
|
|
314
259
|
|
|
315
|
-
|
|
316
|
-
const forecast = orchestrator.forecaster.forecastAll([
|
|
317
|
-
{ task: myTask, role: 'coder', model: 'claude-sonnet-4-6', complexity: score }
|
|
318
|
-
], budgetRemaining)
|
|
319
|
-
// → { totalEstimatedCost: 0.0234, withinBudget: true }
|
|
320
|
-
```
|
|
260
|
+
## Agents
|
|
321
261
|
|
|
322
|
-
|
|
262
|
+
Nexus creates 7 agent files in `~/.config/opencode/agents/`:
|
|
323
263
|
|
|
324
|
-
|
|
264
|
+
| Agent | Mode | Purpose |
|
|
265
|
+
|-------|------|---------|
|
|
266
|
+
| `nexus-orchestrator` | primary | Main orchestrator — decompose, dispatch, integrate |
|
|
267
|
+
| `nexus-architect` | subagent | System design and architecture |
|
|
268
|
+
| `nexus-coder` | subagent | Implement code tasks |
|
|
269
|
+
| `nexus-reviewer` | subagent | Code review (read-only) |
|
|
270
|
+
| `nexus-tester` | subagent | Write and run tests |
|
|
271
|
+
| `nexus-explorer` | subagent | Explore codebases (read-only) |
|
|
272
|
+
| `nexus-documenter` | subagent | Write documentation |
|
|
325
273
|
|
|
326
|
-
|
|
327
|
-
nexus.performance.scores() — All model/role scores
|
|
328
|
-
nexus.performance.best(role="coder") — Best model for a role
|
|
329
|
-
```
|
|
274
|
+
### Clarify Skill
|
|
330
275
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
### Git Worktree Per Agent
|
|
334
|
-
|
|
335
|
-
Each agent works in its own isolated git worktree:
|
|
276
|
+
When instructions are ambiguous, use `nexus.clarify`:
|
|
336
277
|
|
|
337
278
|
```
|
|
338
|
-
nexus.
|
|
339
|
-
nexus.worktree.list() — List active worktrees
|
|
340
|
-
nexus.worktree.disable() — Clean up all
|
|
279
|
+
nexus.clarify(question="Should I use JWT or OAuth?", options="JWT, OAuth", assumption="JWT")
|
|
341
280
|
```
|
|
342
281
|
|
|
343
282
|
---
|
|
344
283
|
|
|
345
|
-
## TUI Commands
|
|
346
|
-
|
|
347
|
-
| Command | Alias | Description |
|
|
348
|
-
|---------|-------|-------------|
|
|
349
|
-
| `/nexus` | — | Open full configuration dialog |
|
|
350
|
-
| `/nexus config` | `/nc` | Configure models & budget |
|
|
351
|
-
| `/nexus dashboard` | `/nd` | Show dashboard with models, budget, commands |
|
|
352
|
-
| `/nexus model` | `/nm` | Select model for a role |
|
|
353
|
-
| `/nexus status` | `/ns` | Show config summary |
|
|
354
|
-
| `/nexus reset` | — | Reset all settings to defaults |
|
|
355
|
-
|
|
356
|
-
**Keyboard shortcut:** `Ctrl+N` opens the main configuration dialog.
|
|
357
|
-
|
|
358
|
-
---
|
|
359
|
-
|
|
360
284
|
## Tools
|
|
361
285
|
|
|
362
|
-
Register these tools in your agent prompts:
|
|
363
|
-
|
|
364
286
|
| Tool | Description | Input |
|
|
365
287
|
|------|-------------|-------|
|
|
366
|
-
| `nexus.
|
|
367
|
-
| `nexus.
|
|
288
|
+
| `nexus.spawn` | Spawn a sub-agent | `{ role, task, model?, wait?, timeout? }` |
|
|
289
|
+
| `nexus.delegate` | Spawn + wait + result | `{ role, task, model?, timeout? }` |
|
|
290
|
+
| `nexus.sessions` | List active sessions | `{}` |
|
|
291
|
+
| `nexus.background` | Move agents to background | `{}` |
|
|
292
|
+
| `nexus.result` | Get agent result | `{ sessionID }` |
|
|
293
|
+
| `nexus.status` | Orchestrator status | `{ detailed? }` |
|
|
368
294
|
| `nexus.costs` | Cost report & budget | `{}` |
|
|
369
|
-
| `nexus.
|
|
370
|
-
| `nexus.
|
|
371
|
-
| `nexus.
|
|
295
|
+
| `nexus.forecast` | Predict costs | `{ tasks }` |
|
|
296
|
+
| `nexus.model.costs` | Show/set model pricing | `{ model?, setInput?, setOutput? }` |
|
|
297
|
+
| `nexus.preset` | Apply preset config | `{ name }` |
|
|
372
298
|
| `nexus.config.save` | Save config to disk | `{ level: 'project' \| 'global' }` |
|
|
373
|
-
| `nexus.config.init` | Initialize config files | `{ level
|
|
374
|
-
| `nexus.dashboard.start` | Start web dashboard | `{ port
|
|
299
|
+
| `nexus.config.init` | Initialize config files | `{ level }` |
|
|
300
|
+
| `nexus.dashboard.start` | Start web dashboard | `{ port?, host? }` |
|
|
375
301
|
| `nexus.dashboard.stop` | Stop web dashboard | `{}` |
|
|
376
|
-
| `nexus.
|
|
377
|
-
| `nexus.
|
|
378
|
-
| `nexus.
|
|
379
|
-
| `nexus.
|
|
380
|
-
| `nexus.
|
|
381
|
-
| `nexus.
|
|
382
|
-
| `nexus.
|
|
302
|
+
| `nexus.todo.add` | Add a todo item | `{ description, assignedTo? }` |
|
|
303
|
+
| `nexus.todo.list` | List all todos | `{}` |
|
|
304
|
+
| `nexus.todo.complete` | Complete a todo | `{ id }` |
|
|
305
|
+
| `nexus.todo.stats` | Todo statistics | `{}` |
|
|
306
|
+
| `nexus.goal.set` | Set a goal | `{ description, autoContinue? }` |
|
|
307
|
+
| `nexus.goal.status` | Current goal status | `{}` |
|
|
308
|
+
| `nexus.goal.complete` | Complete goal | `{}` |
|
|
309
|
+
| `nexus.goal.list` | List all goals | `{}` |
|
|
310
|
+
| `nexus.team.create` | Create a team | `{ name, leadRole }` |
|
|
311
|
+
| `nexus.team.addMember` | Add team member | `{ teamId, role, model }` |
|
|
312
|
+
| `nexus.team.status` | Team status | `{ teamId? }` |
|
|
313
|
+
| `nexus.team.activate` | Start team | `{ teamId }` |
|
|
314
|
+
| `nexus.performance.scores` | Performance scores | `{}` |
|
|
315
|
+
| `nexus.performance.best` | Best model for role | `{ role }` |
|
|
316
|
+
| `nexus.history.list` | Execution history | `{ count? }` |
|
|
383
317
|
| `nexus.history.stats` | Execution statistics | `{}` |
|
|
384
|
-
| `nexus.
|
|
385
|
-
| `nexus.
|
|
386
|
-
| `nexus.
|
|
387
|
-
| `nexus.
|
|
388
|
-
| `nexus.worktree.
|
|
389
|
-
| `nexus.worktree.
|
|
390
|
-
|
|
391
|
-
### Tool Examples
|
|
392
|
-
|
|
393
|
-
```
|
|
394
|
-
# Spawn a coder agent with complexity analysis
|
|
395
|
-
Use nexus.spawn with role="coder" and task="Implement JWT auth middleware"
|
|
396
|
-
# → 💻 Coder — anthropic/claude-sonnet-4-6
|
|
397
|
-
# → 📊 Complexity: 45/100 (low risk)
|
|
398
|
-
|
|
399
|
-
# Check status
|
|
400
|
-
Use nexus.status with detailed=true
|
|
318
|
+
| `nexus.astgrep.search` | Search AST patterns | `{ pattern, language, directory }` |
|
|
319
|
+
| `nexus.astgrep.status` | Check ast-grep install | `{}` |
|
|
320
|
+
| `nexus.security.scan` | Scan for security issues | `{ content, filename? }` |
|
|
321
|
+
| `nexus.clarify` | Ask clarifying question | `{ question, options?, assumption? }` |
|
|
322
|
+
| `nexus.worktree.enable` | Enable worktree isolation | `{ repoRoot? }` |
|
|
323
|
+
| `nexus.worktree.list` | List worktrees | `{}` |
|
|
324
|
+
| `nexus.worktree.disable` | Disable worktrees | `{}` |
|
|
401
325
|
|
|
402
|
-
|
|
403
|
-
Use nexus.preset with name="balanced"
|
|
326
|
+
---
|
|
404
327
|
|
|
405
|
-
|
|
406
|
-
Use nexus.config.init with level="project"
|
|
328
|
+
## TUI Commands
|
|
407
329
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
330
|
+
| Command | Alias | Description |
|
|
331
|
+
|---------|-------|-------------|
|
|
332
|
+
| `/nexus` | `Ctrl+N` | Open full configuration dialog |
|
|
333
|
+
| `/nexus web` | `/nw` | Start web dashboard |
|
|
334
|
+
| `/nexus review` | `/nr` | Quick code review |
|
|
335
|
+
| `/nexus fix` | `/nf` | Quick fix for last error |
|
|
336
|
+
| `/nexus explain` | `/ne` | Explain last change |
|
|
337
|
+
| `/nexus config` | `/nc` | Configure models & budget |
|
|
338
|
+
| `/nexus model` | `/nm` | Select model for a role |
|
|
339
|
+
| `/nexus status` | `/ns` | Show config summary |
|
|
340
|
+
| `/nexus reset` | — | Reset all settings to defaults |
|
|
411
341
|
|
|
412
342
|
---
|
|
413
343
|
|
|
414
344
|
## Configuration
|
|
415
345
|
|
|
416
|
-
### Agent Models
|
|
346
|
+
### Agent Models
|
|
417
347
|
|
|
418
348
|
Configure via `/nexus` or `Ctrl+N`:
|
|
419
349
|
|
|
420
350
|
```
|
|
421
|
-
🏗️ Architect:
|
|
422
|
-
💻 Coder:
|
|
423
|
-
🔍 Reviewer:
|
|
424
|
-
🧪 Tester:
|
|
425
|
-
🔬 Explorer:
|
|
426
|
-
📝 Documenter:
|
|
351
|
+
🏗️ Architect: opencode/muse-spark-1.3-contributor-free
|
|
352
|
+
💻 Coder: opencode/mimo-v2.6-flash-free
|
|
353
|
+
🔍 Reviewer: opencode/muse-spark-1.2-contributor-free
|
|
354
|
+
🧪 Tester: opencode-go/mimo-v2.5
|
|
355
|
+
🔬 Explorer: opencode/big-pickle
|
|
356
|
+
📝 Documenter: opencode/big-pickle
|
|
427
357
|
```
|
|
428
358
|
|
|
429
|
-
###
|
|
359
|
+
### Custom Roles
|
|
430
360
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
361
|
+
Define your own agent roles:
|
|
362
|
+
|
|
363
|
+
```jsonc
|
|
364
|
+
{
|
|
365
|
+
"customRoles": [
|
|
366
|
+
{
|
|
367
|
+
"name": "security-auditor",
|
|
368
|
+
"displayName": "Security Auditor",
|
|
369
|
+
"emoji": "🔐",
|
|
370
|
+
"prompt": "You are a security auditor...",
|
|
371
|
+
"model": "anthropic/claude-sonnet-4-6"
|
|
372
|
+
}
|
|
373
|
+
]
|
|
374
|
+
}
|
|
435
375
|
```
|
|
436
376
|
|
|
437
|
-
###
|
|
377
|
+
### Task Templates
|
|
438
378
|
|
|
439
379
|
```
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
380
|
+
nexus.template(name="list") — Show available templates
|
|
381
|
+
nexus.template(name="feature") — Full feature pipeline
|
|
382
|
+
nexus.template(name="bugfix") — Bug investigation and fix
|
|
383
|
+
nexus.template(name="refactor") — Code refactoring pipeline
|
|
384
|
+
nexus.template(name="documentation") — Documentation update
|
|
443
385
|
```
|
|
444
386
|
|
|
445
387
|
---
|
|
@@ -447,67 +389,49 @@ Configure via `/nexus` or `Ctrl+N`:
|
|
|
447
389
|
## Architecture
|
|
448
390
|
|
|
449
391
|
```
|
|
450
|
-
|
|
451
|
-
│
|
|
452
|
-
│
|
|
453
|
-
│
|
|
454
|
-
│ │ SERVER PLUGIN (index.ts)
|
|
455
|
-
│ │ •
|
|
456
|
-
│ │
|
|
457
|
-
│ │ •
|
|
458
|
-
│ │
|
|
459
|
-
│
|
|
460
|
-
│
|
|
461
|
-
│
|
|
462
|
-
│ │
|
|
463
|
-
│ │ •
|
|
464
|
-
│ │ •
|
|
465
|
-
│ │ •
|
|
466
|
-
│ │ •
|
|
467
|
-
│ │ •
|
|
468
|
-
│ │ •
|
|
469
|
-
│ │ •
|
|
470
|
-
│
|
|
471
|
-
│
|
|
472
|
-
│
|
|
473
|
-
│ │
|
|
474
|
-
│ │
|
|
475
|
-
│ │
|
|
476
|
-
│ │
|
|
477
|
-
│ │
|
|
478
|
-
│ │
|
|
479
|
-
│
|
|
480
|
-
│
|
|
481
|
-
│ │
|
|
482
|
-
│ │
|
|
483
|
-
│ │
|
|
484
|
-
│ │
|
|
485
|
-
│
|
|
486
|
-
│
|
|
487
|
-
│
|
|
488
|
-
│
|
|
489
|
-
│ │
|
|
490
|
-
│ │
|
|
491
|
-
│
|
|
492
|
-
|
|
493
|
-
│ │ • SPA: Agent grid, DAG viz, cost tracker │ │
|
|
494
|
-
│ └──────────────────────────────────────────────────┘ │
|
|
495
|
-
│ │
|
|
496
|
-
│ ┌──────────────────────────────────────────────────┐ │
|
|
497
|
-
│ │ CONFIG │ │
|
|
498
|
-
│ │ • JSONC file loading (project + global) │ │
|
|
499
|
-
│ │ • Config creation and initialization │ │
|
|
500
|
-
│ │ • Preset configurations (4 presets) │ │
|
|
501
|
-
│ │ • Task templates (feature, bugfix, refactor) │ │
|
|
502
|
-
│ └──────────────────────────────────────────────────┘ │
|
|
503
|
-
│ │
|
|
504
|
-
│ ┌──────────────────────────────────────────────────┐ │
|
|
505
|
-
│ │ TUI PLUGIN (tui.tsx) │ │
|
|
506
|
-
│ │ • /nexus slash commands │ │
|
|
507
|
-
│ │ • Configuration dialogs (model selection) │ │
|
|
508
|
-
│ │ • Keyboard shortcut (Ctrl+N) │ │
|
|
509
|
-
│ └──────────────────────────────────────────────────┘ │
|
|
510
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
392
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
393
|
+
│ NEXUS PLUGIN │
|
|
394
|
+
│ │
|
|
395
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
396
|
+
│ │ SERVER PLUGIN (index.ts) │ │
|
|
397
|
+
│ │ • 40+ tool registrations │ │
|
|
398
|
+
│ │ • Auto-creates agents and enables LSP │ │
|
|
399
|
+
│ │ • Config file loading and creation │ │
|
|
400
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
401
|
+
│ │
|
|
402
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
403
|
+
│ │ ORCHESTRATOR (orchestrator.ts) │ │
|
|
404
|
+
│ │ • Real OpenCode session creation │ │
|
|
405
|
+
│ │ • DAG execution with priority queuing │ │
|
|
406
|
+
│ │ • Cost-aware model routing (scored selection) │ │
|
|
407
|
+
│ │ • Self-healing with 4-step escalation │ │
|
|
408
|
+
│ │ • Context transfer to respawned agents │ │
|
|
409
|
+
│ │ • Deadlock detection (cycle finding) │ │
|
|
410
|
+
│ │ • Todo/Goal tracking │ │
|
|
411
|
+
│ │ • Team management │ │
|
|
412
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
413
|
+
│ │
|
|
414
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
415
|
+
│ │ MODULES │ │
|
|
416
|
+
│ │ Health Monitor │ Learning │ Message Store (SQLite) │ │
|
|
417
|
+
│ │ Persistent Mem │ Fan-Out │ Notifications (OS) │ │
|
|
418
|
+
│ │ State Broadcaster │ Module Registry │ Security │ │
|
|
419
|
+
│ │ Cost Forecaster │ Performance Tracker │ AST-Grep │ │
|
|
420
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
421
|
+
│ │
|
|
422
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
423
|
+
│ │ WEB DASHBOARD │ │
|
|
424
|
+
│ │ • Bun.serve() HTTP + WebSocket (port 4747) │ │
|
|
425
|
+
│ │ • DAG viz, cost chart, config editor, auto-refresh │ │
|
|
426
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
427
|
+
│ │
|
|
428
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
429
|
+
│ │ AGENTS (auto-created) │ │
|
|
430
|
+
│ │ nexus-orchestrator (primary) │ │
|
|
431
|
+
│ │ nexus-architect, nexus-coder, nexus-reviewer │ │
|
|
432
|
+
│ │ nexus-tester, nexus-explorer, nexus-documenter │ │
|
|
433
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
434
|
+
└─────────────────────────────────────────────────────────────┘
|
|
511
435
|
```
|
|
512
436
|
|
|
513
437
|
---
|