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 CHANGED
@@ -2,78 +2,24 @@
2
2
  <img src="assets/logo.png" alt="Logo" width="200" />
3
3
  </div>
4
4
 
5
- # OpenCode Orchestrator Plugin
5
+ # OpenCode Orchestrator
6
6
 
7
7
  > **Multi-Agent Plugin for [OpenCode](https://opencode.ai)**
8
8
 
9
9
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
10
10
  [![npm](https://img.shields.io/npm/v/opencode-orchestrator.svg)](https://www.npmjs.com/package/opencode-orchestrator)
11
- [![npm downloads](https://img.shields.io/npm/dt/opencode-orchestrator.svg)](https://www.npmjs.com/package/opencode-orchestrator)
12
- [![OpenCode Plugin](https://img.shields.io/badge/OpenCode-Plugin-purple.svg)](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
- ## How It Works (Parallel DAG)
14
+ ## What is this?
51
15
 
52
- Instead of a linear sequence, we use a **Directed Acyclic Graph (DAG)** to model your mission.
16
+ A 6-agent collaborative system that turns **affordable LLMs into reliable engineering teams**.
53
17
 
54
- ```
55
- Mission Start (/task)
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
- > **Note**: After installation, **restart OpenCode** or run `opencode` in your terminal.
87
- > The plugin will automatically register itself in `~/.config/opencode/opencode.json` with its absolute path.
32
+ Restart OpenCode after installation.
88
33
 
89
- ### Troubleshooting
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
- **The only command you need:**
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
- The Orchestrator will:
105
- 1. **Decompose** the mission into a JSON Task DAG
106
- 2. **Parallel Execute** independent streams
107
- 3. **Search** proactively for patterns
108
- 4. **Code** with atomic precision
109
- 5. **Verify** via the Style Guardian (MANDATORY)
110
- 6. **Self-Heal** if errors occur
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
- | **Orchestrator** | Team leader — coordinates, decides, adapts |
119
- | **Planner** | Breaks work into atomic tasks |
120
- | **Coder** | Implements one task at a time |
121
- | **Reviewer** | Quality gate — catches all errors |
122
- | **Fixer** | Targeted error resolution |
123
- | **Searcher** | Finds context before coding |
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
- ## Open Source
75
+ ## How It Works
133
76
 
134
- MIT License. No telemetry. No backdoors.
135
-
136
- [github.com/agnusdei1207/opencode-orchestrator](https://github.com/agnusdei1207/opencode-orchestrator)
137
-
138
- ---
139
-
140
- ## License
141
-
142
- MIT License. NO WARRANTY.
143
-
144
- [MIT](LICENSE)
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
- ## 🏛️ The Architecture: The PDCA & Distributed Cognitive Loop
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
- 1. **PDCA Methodology (Quality Assurance)**:
163
- * **Plan (Planner)**: Recursively decomposes mission into atomic tasks ($O(log n)$).
164
- * **Do (Coder)**: Executes the atomic tasks in parallel (Distributed Actions).
165
- * **Check (Reviewer)**: Acts as a **Byzantine Fault Tolerance** node, strictly validating code against requirements.
166
- * **Act (Orchestrator)**: Merges successful states or **Pivots** (Dynamic Programming) if failures occur.
167
-
168
- 2. **Distributed Systems Theory (Actor Model)**:
169
- * Each agent operates as an independent **Actor** with isolated state.
170
- * **Context Sharding**: We treat context windows like RAM, paging data in/out via `temp_context` files to simulate **Infinite Context**.
171
-
172
- 3. **Algorithmic Efficiency**:
173
- * **Divide & Conquer**: Breaking complex problems into trivial $O(1)$ sub-problems.
174
- * **Dynamic Programming**: Storing intermediate results (State) to avoid redundant computation and allow for intelligent backtracking.
175
-
176
- ### 🚀 The Command: `/task`
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
- The interface to this system is a single, powerful command:
118
+ ## Troubleshooting
179
119
 
120
+ If `/task` doesn't appear:
180
121
  ```bash
181
- /task "Refactor the authentication middleware and implement JWT rotation"
122
+ npm uninstall -g opencode-orchestrator
123
+ npm install -g opencode-orchestrator
182
124
  ```
183
125
 
184
- This triggers the **Distributed Task Loop**. It's not just a chat; it's a mission commitment.
126
+ ---
185
127
 
186
- ### The 5-Phase Efficiency Workflow
128
+ ## Docs
187
129
 
188
- 1. **🧠 Phase 1: Filtered Analysis**: The **Searcher** reads docs but filters out noise. We only feed the "critical path" to the Planner.
189
- 2. **🌲 Phase 2: Strategic Planning**: The **Planner** creates a JSON DAG. This is our roadmap. No token is wasted on aimless wandering.
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
- ## ⚡ Fast-Paced Development
135
+ ## License
136
+
137
+ MIT License. [LICENSE](LICENSE)
138
+
139
+ ---
197
140
 
198
- This project is evolving **extremely fast**. We iterate rapidly to bring relentless execution to your workflow.
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
@@ -73,5 +73,6 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
73
73
  output: string;
74
74
  metadata: any;
75
75
  }) => Promise<void>;
76
+ "assistant.done": (input: any, output: any) => Promise<void>;
76
77
  }>;
77
78
  export default OrchestratorPlugin;
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.54",
5
+ "version": "0.1.56",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {