opencode-orchestrator 0.1.54 → 0.1.56
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 +83 -141
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,78 +2,24 @@
|
|
|
2
2
|
<img src="assets/logo.png" alt="Logo" width="200" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
|
-
# OpenCode Orchestrator
|
|
5
|
+
# OpenCode Orchestrator
|
|
6
6
|
|
|
7
7
|
> **Multi-Agent Plugin for [OpenCode](https://opencode.ai)**
|
|
8
8
|
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
[](https://www.npmjs.com/package/opencode-orchestrator)
|
|
11
|
-
[](https://www.npmjs.com/package/opencode-orchestrator)
|
|
12
|
-
[](https://opencode.ai)
|
|
13
|
-
|
|
14
|
-
**OpenCode Orchestrator** is a collaborative framework that enables **low-benchmark models to deliver senior-level engineering results**.
|
|
15
|
-
|
|
16
|
-
By maximizing the **method of agent collaboration**, we overcome the inherent limitations of individual AI models. We don't just "chat" with AI; we use a structured engineering layer to ensure complex missions are executed with 100% reliability and relentlessly pushed to completion, regardless of the model's price point.
|
|
17
|
-
|
|
18
|
-
**Core Philosophy: Excellence through Collaboration**
|
|
19
|
-
|
|
20
|
-
We believe that **a perfect collaboration method is superior to individual intelligence**.
|
|
21
|
-
|
|
22
|
-
* **Systems Engineering Fusion**: We integrate Operating System principles (Scheduling), Distributed Systems (Actor Model), and Algorithm Theory (Divide & Conquer) to transform unpredictable LLMs into a **controlled computing resource**.
|
|
23
|
-
* **Relentless PDCA Loop**: Every change follows a strict **Plan-Do-Check-Act** cycle. This systematic approach ensures that high-level professional tasks are completed without the quality decay or hallucinations typical of raw LLM outputs.
|
|
24
|
-
* **Architecture over Benchmarks**: By decomposing missions into atomic, verifiable tasks, we extract **high-fidelity outcomes** from cost-effective models, proving that superior architecture can outperform raw scale.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Why Orchestrator?
|
|
29
|
-
|
|
30
|
-
| Traditional | With Orchestrator |
|
|
31
|
-
|-------------|-------------------|
|
|
32
|
-
| Expensive "Smart" Model required | **Affordable Model + Smart Process** |
|
|
33
|
-
| High Token Costs (Huge Context) | **Token Efficient** (Filtered Context) |
|
|
34
|
-
| Linear, Slow Execution | **Parallel, Fast Execution** |
|
|
35
|
-
| Errors compound silently | **Self-Correcting Verification Loops** |
|
|
36
|
-
| "Hope it works" | **Strategic Micro-Tasking** |
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
- **🧩 Strategic Organization** — Maximizing output through intelligent role distribution
|
|
41
|
-
- **📉 Token Economy** — Filtering noise to reduce costs and increase focus
|
|
42
|
-
- **⚡ Parallel DAG** — Concurrent execution for speed and efficiency
|
|
43
|
-
- **🔍 Micro-Tasking** — Atomic decomposition to prevent hallucinations
|
|
44
|
-
- **🛡️ Style Guardian** — Strict AST-based linting and consistency checks
|
|
45
|
-
- **🔄 Self-Healing** — Autonomous pivot strategies for complex errors
|
|
46
|
-
- **🏗️ Rust Core** — Native performance for heavy lifting
|
|
47
11
|
|
|
48
12
|
---
|
|
49
13
|
|
|
50
|
-
##
|
|
14
|
+
## What is this?
|
|
51
15
|
|
|
52
|
-
|
|
16
|
+
A 6-agent collaborative system that turns **affordable LLMs into reliable engineering teams**.
|
|
53
17
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
│ PLANNER │ (Architect)
|
|
60
|
-
└───────┬───────┘
|
|
61
|
-
│
|
|
62
|
-
┌───────┴───────┐
|
|
63
|
-
│ │ (Parallel Streams)
|
|
64
|
-
▼ ▼
|
|
65
|
-
┌───────────┐ ┌───────────┐
|
|
66
|
-
│ Tasks (A) │ │ Tasks (B) │
|
|
67
|
-
└─────┬─────┘ └─────┬─────┘
|
|
68
|
-
│ │
|
|
69
|
-
└───────┬───────┘
|
|
70
|
-
▼
|
|
71
|
-
┌───────────────┐
|
|
72
|
-
│ REVIEWER │ (Style Guardian)
|
|
73
|
-
└───────┬───────┘
|
|
74
|
-
▼
|
|
75
|
-
✅ MISSION COMPLETE
|
|
76
|
-
```
|
|
18
|
+
- **Relentless Loop** — Auto-continues until mission complete
|
|
19
|
+
- **Atomic Decomposition** — Tasks broken into verifiable micro-units
|
|
20
|
+
- **PDCA Loop** — Plan → Do → Check → Act (self-correcting)
|
|
21
|
+
- **Parallel DAG** — Independent tasks run concurrently
|
|
22
|
+
- **Quality Gate** — Reviewer catches all errors before merge
|
|
77
23
|
|
|
78
24
|
---
|
|
79
25
|
|
|
@@ -83,31 +29,33 @@ Instead of a linear sequence, we use a **Directed Acyclic Graph (DAG)** to model
|
|
|
83
29
|
npm install -g opencode-orchestrator
|
|
84
30
|
```
|
|
85
31
|
|
|
86
|
-
|
|
87
|
-
> The plugin will automatically register itself in `~/.config/opencode/opencode.json` with its absolute path.
|
|
32
|
+
Restart OpenCode after installation.
|
|
88
33
|
|
|
89
|
-
|
|
90
|
-
If the command `/task` does not appear:
|
|
91
|
-
1. Uninstall: `npm uninstall -g opencode-orchestrator`
|
|
92
|
-
2. Clear config: `rm -rf ~/.config/opencode` (Warning: resets all plugins)
|
|
93
|
-
3. Reinstall: `npm install -g opencode-orchestrator`
|
|
34
|
+
---
|
|
94
35
|
|
|
36
|
+
## Usage
|
|
95
37
|
|
|
96
|
-
|
|
38
|
+
### Option 1: Select Orchestrator Agent
|
|
39
|
+
Press `tab` → Select **Orchestrator** → Just type your request!
|
|
97
40
|
|
|
98
|
-
|
|
41
|
+
```
|
|
42
|
+
"Implement user authentication with JWT"
|
|
43
|
+
```
|
|
99
44
|
|
|
45
|
+
### Option 2: Use /task Command
|
|
100
46
|
```bash
|
|
101
47
|
/task "Implement user authentication with JWT"
|
|
102
48
|
```
|
|
103
49
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
50
|
+
Both methods activate **Relentless Loop** — the agent continues automatically until mission complete.
|
|
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
|
|
111
59
|
|
|
112
60
|
---
|
|
113
61
|
|
|
@@ -115,85 +63,79 @@ The Orchestrator will:
|
|
|
115
63
|
|
|
116
64
|
| Agent | Role |
|
|
117
65
|
|-------|------|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
125
|
-
---
|
|
126
|
-
|
|
127
|
-
- **[System Architecture (Deep Dive)](docs/ARCHITECTURE.md)**: Explore the Distributed Cognitive Architecture (DCA), PDCA Loop, and Actor Model internals.
|
|
128
|
-
- **[Configuration](docs/CONFIGURATION.md)**: `opencode.toml` setup guide.
|
|
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 |
|
|
129
72
|
|
|
130
73
|
---
|
|
131
74
|
|
|
132
|
-
##
|
|
75
|
+
## How It Works
|
|
133
76
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
[
|
|
77
|
+
```
|
|
78
|
+
/task "mission"
|
|
79
|
+
│
|
|
80
|
+
▼
|
|
81
|
+
┌─────────────┐
|
|
82
|
+
│ PLANNER │
|
|
83
|
+
└──────┬──────┘
|
|
84
|
+
│
|
|
85
|
+
┌──────┴──────┐
|
|
86
|
+
▼ ▼
|
|
87
|
+
[Task A] [Task B] (parallel)
|
|
88
|
+
│ │
|
|
89
|
+
└──────┬──────┘
|
|
90
|
+
▼
|
|
91
|
+
┌─────────────┐
|
|
92
|
+
│ REVIEWER │
|
|
93
|
+
└──────┬──────┘
|
|
94
|
+
▼
|
|
95
|
+
✅ DONE
|
|
96
|
+
```
|
|
145
97
|
|
|
146
98
|
---
|
|
147
99
|
|
|
148
|
-
##
|
|
149
|
-
|
|
150
|
-
We have moved beyond simple "chatbots". **OpenCode Orchestrator** implements a **Deterministic Engineering Layer** built on top of the stochastic nature of LLMs,
|
|
151
|
-
- **Strict PDCA Loop**: Guarantees quality via Plan-Do-Check-Act cycle.
|
|
152
|
-
- **🔍 Micro-tasking**: Atomic decomposition to prevent hallucinations.
|
|
153
|
-
- **🛡️ Style Guardian**: Strict AST-based linting and consistency checks by the Reviewer.
|
|
154
|
-
- **🔄 Self-healing**: Autonomous pivoting strategies for complex errors.
|
|
155
|
-
- **Distributed Cognitive System**: Intelligence layer acting like an OS Kernel.
|
|
156
|
-
- **File-Based State**: Uses physical filesystem as RAM, ignoring context limits.
|
|
157
|
-
We treat agents as **Semantic Compute Units**. By applying rigorous Computer Science principles, we achieve a level of reliability that no single model can match.
|
|
158
|
-
|
|
159
|
-
### 🧬 The "Grand Fusion" of Methodologies
|
|
160
|
-
We explicitly fused three massive domains into one seamless workflow:
|
|
100
|
+
## PDCA Control Loop
|
|
161
101
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
102
|
+
```
|
|
103
|
+
┌─────────────────────────────────────────────────────┐
|
|
104
|
+
│ PDCA LOOP │
|
|
105
|
+
│ │
|
|
106
|
+
│ PLAN ──→ DO ──→ CHECK ──→ ACT │
|
|
107
|
+
│ │ │ │ │ │
|
|
108
|
+
│ Planner Coder Reviewer Orchestrator │
|
|
109
|
+
│ ↓ ↓ ↓ ↓ │
|
|
110
|
+
│ DAG Code Pass/Fail Merge/Pivot │
|
|
111
|
+
│ │ │
|
|
112
|
+
│ ┌───────┴───────┐ │
|
|
113
|
+
│ ↓ ↓ │
|
|
114
|
+
│ ✅ Pass ❌ Fail → Fixer │
|
|
115
|
+
└─────────────────────────────────────────────────────┘
|
|
116
|
+
```
|
|
177
117
|
|
|
178
|
-
|
|
118
|
+
## Troubleshooting
|
|
179
119
|
|
|
120
|
+
If `/task` doesn't appear:
|
|
180
121
|
```bash
|
|
181
|
-
|
|
122
|
+
npm uninstall -g opencode-orchestrator
|
|
123
|
+
npm install -g opencode-orchestrator
|
|
182
124
|
```
|
|
183
125
|
|
|
184
|
-
|
|
126
|
+
---
|
|
185
127
|
|
|
186
|
-
|
|
128
|
+
## Docs
|
|
187
129
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
3. **🚀 Phase 3: Parallel Execution**: The **Orchestrator** identifies independent tasks and runs them concurrently.
|
|
191
|
-
4. **🛡️ Phase 4: Sync & Verify**: The **Reviewer** acts as the gatekeeper. It checks syntax, logic, and *cross-file consistency*.
|
|
192
|
-
5. **💰 Phase 5: Cost-Effective Completion**: We achieve "Senior Developer" results at "Junior Intern" prices.
|
|
130
|
+
- [Architecture](docs/ARCHITECTURE.md)
|
|
131
|
+
- [Plugin Troubleshooting](docs/PLUGIN_TROUBLESHOOTING.md)
|
|
193
132
|
|
|
194
133
|
---
|
|
195
134
|
|
|
196
|
-
##
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
MIT License. [LICENSE](LICENSE)
|
|
138
|
+
|
|
139
|
+
---
|
|
197
140
|
|
|
198
|
-
|
|
199
|
-
Updates are frequent. Keep your version fresh.
|
|
141
|
+
**Fast-Paced Development** — Updates are frequent. Keep your version fresh.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -705,6 +705,17 @@ var OrchestratorPlugin = async (input) => {
|
|
|
705
705
|
if (textPartIndex === -1) return;
|
|
706
706
|
const originalText = parts[textPartIndex].text || "";
|
|
707
707
|
const parsed = detectSlashCommand(originalText);
|
|
708
|
+
const agentName = input2.agent?.toLowerCase() || "";
|
|
709
|
+
if (agentName === "orchestrator" && !state.missionActive) {
|
|
710
|
+
const sessionID = input2.sessionID;
|
|
711
|
+
state.sessions.set(sessionID, {
|
|
712
|
+
enabled: true,
|
|
713
|
+
iterations: 0,
|
|
714
|
+
taskRetries: /* @__PURE__ */ new Map(),
|
|
715
|
+
currentTask: ""
|
|
716
|
+
});
|
|
717
|
+
state.missionActive = true;
|
|
718
|
+
}
|
|
708
719
|
if (parsed) {
|
|
709
720
|
const command = COMMANDS[parsed.command];
|
|
710
721
|
if (command) {
|
|
@@ -839,6 +850,27 @@ ${session.graph.getTaskSummary()}${guidance}`;
|
|
|
839
850
|
|
|
840
851
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
841
852
|
[DAG STEP: ${session.iterations}/${state.maxIterations}]`;
|
|
853
|
+
},
|
|
854
|
+
// Relentless Loop: Auto-continue until mission complete
|
|
855
|
+
"assistant.done": async (input2, output) => {
|
|
856
|
+
if (!state.missionActive) return;
|
|
857
|
+
const session = state.sessions.get(input2.sessionID);
|
|
858
|
+
if (!session?.enabled) return;
|
|
859
|
+
const text = output.text || "";
|
|
860
|
+
const isComplete = text.includes("\u2705 MISSION COMPLETE") || text.includes("MISSION COMPLETE") || text.includes("\uBAA8\uB4E0 \uD0DC\uC2A4\uD06C \uC644\uB8CC") || text.includes("All tasks completed") || session.graph && session.graph.isCompleted?.();
|
|
861
|
+
if (isComplete) {
|
|
862
|
+
session.enabled = false;
|
|
863
|
+
state.missionActive = false;
|
|
864
|
+
state.sessions.delete(input2.sessionID);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
if (session.iterations >= state.maxIterations) {
|
|
868
|
+
session.enabled = false;
|
|
869
|
+
state.missionActive = false;
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
output.continue = true;
|
|
873
|
+
output.continueMessage = "continue";
|
|
842
874
|
}
|
|
843
875
|
};
|
|
844
876
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "opencode-orchestrator",
|
|
3
3
|
"displayName": "OpenCode Orchestrator",
|
|
4
4
|
"description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.56",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|