opencode-orchestrator 0.1.59 → 0.1.62
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 +85 -57
- package/dist/agents/definitions.d.ts +1 -1
- package/dist/agents/names.d.ts +12 -0
- package/dist/agents/orchestrator.d.ts +1 -1
- package/dist/agents/subagents/architect.d.ts +2 -0
- package/dist/agents/subagents/builder.d.ts +2 -0
- package/dist/agents/subagents/coder.d.ts +2 -0
- package/dist/agents/subagents/executor.d.ts +2 -0
- package/dist/agents/subagents/fixer.d.ts +2 -0
- package/dist/agents/subagents/inspector.d.ts +2 -0
- package/dist/agents/subagents/memory.d.ts +2 -0
- package/dist/agents/subagents/planner.d.ts +2 -0
- package/dist/agents/subagents/publisher.d.ts +2 -0
- package/dist/agents/subagents/recorder.d.ts +2 -0
- package/dist/agents/subagents/reviewer.d.ts +2 -0
- package/dist/agents/subagents/searcher.d.ts +2 -0
- package/dist/agents/subagents/strategist.d.ts +2 -0
- package/dist/agents/subagents/surgeon.d.ts +2 -0
- package/dist/agents/subagents/types.d.ts +7 -0
- package/dist/agents/subagents/visualist.d.ts +2 -0
- package/dist/index.d.ts +23 -14
- package/dist/index.js +1039 -567
- package/dist/scripts/postinstall.js +4 -6
- package/dist/scripts/preuninstall.js +37 -0
- package/dist/shared/contracts/interfaces.d.ts +7 -0
- package/dist/shared/contracts/names.d.ts +8 -0
- package/dist/tools/callAgent.d.ts +5 -6
- package/dist/tools/search.d.ts +8 -0
- package/dist/tools/slashCommand.d.ts +4 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -13,14 +13,20 @@
|
|
|
13
13
|
|
|
14
14
|
## What is this?
|
|
15
15
|
|
|
16
|
-
A
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **
|
|
16
|
+
A **5-agent structured architecture** that makes weak LLMs perform reliably.
|
|
17
|
+
|
|
18
|
+
**Problem**: Models like GLM-4.7 struggle with complex engineering tasks.
|
|
19
|
+
|
|
20
|
+
**Solution**: XML-structured prompts + explicit reasoning patterns + evidence-based completion.
|
|
21
|
+
|
|
22
|
+
### Key Features
|
|
23
|
+
- **Structured Prompts** — XML tags provide clear boundaries for weak models
|
|
24
|
+
- **Explicit Reasoning** — THINK → ACT → OBSERVE → ADJUST pattern
|
|
25
|
+
- **Auto-Fix** — Inspector audits AND repairs automatically
|
|
26
|
+
- **Persistent Memory** — Context saved to disk, never lost
|
|
27
|
+
- **Parallel Execution** — Independent tasks run concurrently
|
|
28
|
+
- **Relentless Loop** — Runs until mission complete (no user input needed)
|
|
29
|
+
|
|
24
30
|
---
|
|
25
31
|
|
|
26
32
|
## Installation
|
|
@@ -35,100 +41,122 @@ Restart OpenCode after installation.
|
|
|
35
41
|
|
|
36
42
|
## Usage
|
|
37
43
|
|
|
38
|
-
###
|
|
39
|
-
Press `tab` → Select **
|
|
44
|
+
### Just Select Commander Agent
|
|
45
|
+
Press `tab` → Select **Commander** → Type your request!
|
|
40
46
|
|
|
41
47
|
```
|
|
42
48
|
"Implement user authentication with JWT"
|
|
43
49
|
```
|
|
44
50
|
|
|
45
|
-
|
|
51
|
+
That's it. Commander automatically:
|
|
52
|
+
1. Enters mission mode
|
|
53
|
+
2. Plans tasks in parallel
|
|
54
|
+
3. Executes until complete
|
|
55
|
+
4. Stops when done with evidence
|
|
56
|
+
|
|
57
|
+
### Or Use /task Command
|
|
46
58
|
```bash
|
|
47
59
|
/task "Implement user authentication with JWT"
|
|
48
60
|
```
|
|
49
61
|
|
|
50
|
-
Both
|
|
51
|
-
|
|
52
|
-
### How It Works:
|
|
53
|
-
1. **Plan** — Decompose into atomic tasks
|
|
54
|
-
2. **Search** — Find patterns and context
|
|
55
|
-
3. **Code** — Implement with precision
|
|
56
|
-
4. **Review** — Verify via quality gate
|
|
57
|
-
5. **Fix** — Self-heal if errors occur
|
|
58
|
-
6. **Loop** — Repeat until ✅ MISSION COMPLETE
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## Agents
|
|
63
|
-
|
|
64
|
-
| Agent | Role |
|
|
65
|
-
|-------|------|
|
|
66
|
-
| Orchestrator | Team leader — coordinates the mission |
|
|
67
|
-
| Planner | Decomposes work into atomic tasks |
|
|
68
|
-
| Coder | Implements one task at a time |
|
|
69
|
-
| Reviewer | Quality gate — catches all errors |
|
|
70
|
-
| Fixer | Targeted error resolution |
|
|
71
|
-
| Searcher | Finds context before coding |
|
|
62
|
+
Both work identically - Commander agent OR /task command.
|
|
72
63
|
|
|
73
64
|
---
|
|
74
65
|
|
|
75
66
|
## How It Works
|
|
76
67
|
|
|
77
68
|
```
|
|
78
|
-
/task
|
|
69
|
+
Select Commander or /task
|
|
79
70
|
│
|
|
80
71
|
▼
|
|
81
72
|
┌─────────────┐
|
|
82
|
-
│
|
|
73
|
+
│ COMMANDER │ ← THINK → ACT → OBSERVE → ADJUST
|
|
83
74
|
└──────┬──────┘
|
|
84
75
|
│
|
|
85
76
|
┌──────┴──────┐
|
|
86
77
|
▼ ▼
|
|
87
|
-
|
|
78
|
+
ARCHITECT MEMORY (load context)
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
┌──────────────────┐
|
|
82
|
+
│ PARALLEL DAG │
|
|
83
|
+
│ Group 1: [T1, T2, T3] ← run together
|
|
84
|
+
│ Group 2: [T4] ← wait for group 1
|
|
85
|
+
└──────────────────┘
|
|
86
|
+
│
|
|
87
|
+
┌──────┴──────┐
|
|
88
|
+
▼ ▼
|
|
89
|
+
BUILDER BUILDER (parallel)
|
|
88
90
|
│ │
|
|
89
91
|
└──────┬──────┘
|
|
90
92
|
▼
|
|
91
93
|
┌─────────────┐
|
|
92
|
-
│
|
|
94
|
+
│ INSPECTOR │ ← AUDIT → [FAIL? → FIX] → PASS
|
|
95
|
+
└──────┬──────┘
|
|
96
|
+
▼
|
|
97
|
+
┌─────────────┐
|
|
98
|
+
│ MEMORY │ ← Save progress
|
|
93
99
|
└──────┬──────┘
|
|
94
100
|
▼
|
|
95
|
-
✅
|
|
101
|
+
✅ MISSION COMPLETE
|
|
96
102
|
```
|
|
97
103
|
|
|
98
104
|
---
|
|
99
105
|
|
|
100
|
-
##
|
|
106
|
+
## Agents (5-Agent Architecture)
|
|
101
107
|
|
|
108
|
+
| Agent | Role | What It Does |
|
|
109
|
+
| :--- | :--- | :--- |
|
|
110
|
+
| **Commander** | Orchestrator | Controls mission, delegates work, verifies completion |
|
|
111
|
+
| **Architect** | Planner | Decomposes complex tasks into parallel DAGs |
|
|
112
|
+
| **Builder** | Developer | Implements code (logic + UI combined) |
|
|
113
|
+
| **Inspector** | Quality + Fix | Audits code AND auto-fixes problems |
|
|
114
|
+
| **Memory** | Context | Saves/loads progress across sessions |
|
|
115
|
+
|
|
116
|
+
### Why 5 Agents?
|
|
117
|
+
- **Builder** = Coder + Visualist (full-stack in one agent)
|
|
118
|
+
- **Inspector** = Reviewer + Fixer (auto-fixes on audit failure)
|
|
119
|
+
- **Fewer agents = fewer handoffs = better for weak models**
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Optimized for Weak Models
|
|
124
|
+
|
|
125
|
+
| Technique | Purpose |
|
|
126
|
+
|-----------|---------|
|
|
127
|
+
| XML tags | Clear semantic boundaries |
|
|
128
|
+
| THINK-ACT-OBSERVE-ADJUST | Explicit step-by-step reasoning |
|
|
129
|
+
| Few-shot examples | Correct output format learning |
|
|
130
|
+
| Tables/JSON output | Structured over prose |
|
|
131
|
+
| Evidence required | Concrete verification criteria |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Uninstall
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm uninstall -g opencode-orchestrator
|
|
102
139
|
```
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
│ │ │ │ │ │
|
|
108
|
-
│ Planner Coder Reviewer Orchestrator │
|
|
109
|
-
│ ↓ ↓ ↓ ↓ │
|
|
110
|
-
│ DAG Code Pass/Fail Merge/Pivot │
|
|
111
|
-
│ │ │
|
|
112
|
-
│ ┌───────┴───────┐ │
|
|
113
|
-
│ ↓ ↓ │
|
|
114
|
-
│ ✅ Pass ❌ Fail → Fixer │
|
|
115
|
-
└─────────────────────────────────────────────────────┘
|
|
116
|
-
```
|
|
140
|
+
|
|
141
|
+
The plugin automatically removes itself from OpenCode config.
|
|
142
|
+
|
|
143
|
+
---
|
|
117
144
|
|
|
118
145
|
## Troubleshooting
|
|
119
146
|
|
|
120
|
-
If
|
|
147
|
+
If Commander doesn't appear after install:
|
|
121
148
|
```bash
|
|
122
149
|
npm uninstall -g opencode-orchestrator
|
|
123
150
|
npm install -g opencode-orchestrator
|
|
151
|
+
# Restart OpenCode
|
|
124
152
|
```
|
|
125
153
|
|
|
126
154
|
---
|
|
127
155
|
|
|
128
156
|
## Docs
|
|
129
157
|
|
|
130
|
-
- [Architecture](docs/ARCHITECTURE.md)
|
|
131
|
-
- [Plugin Troubleshooting](docs/PLUGIN_TROUBLESHOOTING.md)
|
|
158
|
+
- [Architecture & Design](docs/ARCHITECTURE.md) — System design, agents, and why it works
|
|
159
|
+
- [Plugin Troubleshooting](docs/PLUGIN_TROUBLESHOOTING.md) — Setup issues
|
|
132
160
|
|
|
133
161
|
---
|
|
134
162
|
|
|
@@ -138,4 +166,4 @@ MIT License. [LICENSE](LICENSE)
|
|
|
138
166
|
|
|
139
167
|
---
|
|
140
168
|
|
|
141
|
-
**
|
|
169
|
+
**Updates are frequent. Keep your version fresh.**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AgentDefinition } from "
|
|
1
|
+
import { AgentDefinition } from "../shared/contracts/interfaces.js";
|
|
2
2
|
export declare const AGENTS: Record<string, AgentDefinition>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const AGENT_NAMES: {
|
|
2
|
+
readonly ORCHESTRATOR: "orchestrator";
|
|
3
|
+
readonly PLANNER: "planner";
|
|
4
|
+
readonly CODER: "coder";
|
|
5
|
+
readonly REVIEWER: "reviewer";
|
|
6
|
+
readonly SEARCHER: "searcher";
|
|
7
|
+
readonly SURGEON: "surgeon";
|
|
8
|
+
readonly EXECUTOR: "executor";
|
|
9
|
+
readonly VISUALIST: "visualist";
|
|
10
|
+
readonly PUBLISHER: "publisher";
|
|
11
|
+
};
|
|
12
|
+
export type AgentName = typeof AGENT_NAMES[keyof typeof AGENT_NAMES];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AgentDefinition } from "
|
|
1
|
+
import { AgentDefinition } from "../shared/contracts/interfaces.js";
|
|
2
2
|
export declare const orchestrator: AgentDefinition;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenCode Orchestrator Plugin
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 5-Agent Structured Architecture
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Optimized for weak models through:
|
|
7
|
+
* - XML-structured prompts with clear boundaries
|
|
8
|
+
* - Explicit reasoning patterns (THINK → ACT → OBSERVE → ADJUST)
|
|
9
|
+
* - Evidence-based completion requirements
|
|
10
|
+
* - Autonomous execution loop
|
|
11
|
+
*
|
|
12
|
+
* Agents: Commander, Architect, Builder, Inspector, Memory
|
|
9
13
|
*/
|
|
10
14
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
11
15
|
declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
|
|
@@ -14,17 +18,16 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
|
|
|
14
18
|
description: string;
|
|
15
19
|
args: {
|
|
16
20
|
agent: import("zod").ZodEnum<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
searcher: "searcher";
|
|
21
|
+
architect: "architect";
|
|
22
|
+
builder: "builder";
|
|
23
|
+
inspector: "inspector";
|
|
24
|
+
memory: "memory";
|
|
22
25
|
}>;
|
|
23
26
|
task: import("zod").ZodString;
|
|
24
27
|
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
28
|
};
|
|
26
29
|
execute(args: {
|
|
27
|
-
agent: "
|
|
30
|
+
agent: "architect" | "builder" | "inspector" | "memory";
|
|
28
31
|
task: string;
|
|
29
32
|
context?: string | undefined;
|
|
30
33
|
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
@@ -62,17 +65,23 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
|
|
|
62
65
|
};
|
|
63
66
|
};
|
|
64
67
|
config: (config: Record<string, unknown>) => Promise<void>;
|
|
65
|
-
"chat.message": (
|
|
66
|
-
"tool.execute.after": (
|
|
68
|
+
"chat.message": (msgInput: any, msgOutput: any) => Promise<void>;
|
|
69
|
+
"tool.execute.after": (toolInput: {
|
|
67
70
|
tool: string;
|
|
68
71
|
sessionID: string;
|
|
69
72
|
callID: string;
|
|
70
73
|
arguments?: any;
|
|
71
|
-
},
|
|
74
|
+
}, toolOutput: {
|
|
72
75
|
title: string;
|
|
73
76
|
output: string;
|
|
74
77
|
metadata: any;
|
|
75
78
|
}) => Promise<void>;
|
|
76
|
-
"assistant.done": (
|
|
79
|
+
"assistant.done": (assistantInput: any, assistantOutput: any) => Promise<void>;
|
|
80
|
+
handler: ({ event }: {
|
|
81
|
+
event: {
|
|
82
|
+
type: string;
|
|
83
|
+
properties?: unknown;
|
|
84
|
+
};
|
|
85
|
+
}) => Promise<void>;
|
|
77
86
|
}>;
|
|
78
87
|
export default OrchestratorPlugin;
|