opencode-orchestrator 0.1.57 → 0.1.61

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
@@ -13,14 +13,20 @@
13
13
 
14
14
  ## What is this?
15
15
 
16
- A 6-agent collaborative system that turns **affordable LLMs into reliable engineering teams**.
17
-
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
23
- - **Structure** — **TypeScript Brain** for logic + **Rust Muscle** for speed
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
- ### Option 1: Select Orchestrator Agent
39
- Press `tab` → Select **Orchestrator** → Just type your request!
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
- ### Option 2: Use /task Command
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 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
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 "mission"
69
+ Select Commander or /task
79
70
 
80
71
 
81
72
  ┌─────────────┐
82
- PLANNER
73
+ COMMANDER ← THINK → ACT → OBSERVE → ADJUST
83
74
  └──────┬──────┘
84
75
 
85
76
  ┌──────┴──────┐
86
77
  ▼ ▼
87
- [Task A] [Task B] (parallel)
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
- REVIEWER
94
+ INSPECTOR ← AUDIT → [FAIL? → FIX] → PASS
95
+ └──────┬──────┘
96
+
97
+ ┌─────────────┐
98
+ │ MEMORY │ ← Save progress
93
99
  └──────┬──────┘
94
100
 
95
- DONE
101
+ MISSION COMPLETE
96
102
  ```
97
103
 
98
104
  ---
99
105
 
100
- ## PDCA Control Loop
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
- │ 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
- ```
140
+
141
+ The plugin automatically removes itself from OpenCode config.
142
+
143
+ ---
117
144
 
118
145
  ## Troubleshooting
119
146
 
120
- If `/task` doesn't appear:
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
- **Fast-Paced Development** — Updates are frequent. Keep your version fresh.
169
+ **Updates are frequent. Keep your version fresh.**
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "./types.js";
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 "./types.js";
1
+ import { AgentDefinition } from "../shared/contracts/interfaces.js";
2
2
  export declare const orchestrator: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const architect: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const builder: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const coder: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const executor: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const fixer: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const inspector: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const memory: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const planner: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const publisher: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const recorder: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const reviewer: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const searcher: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const strategist: AgentDefinition;
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const surgeon: AgentDefinition;
@@ -0,0 +1,7 @@
1
+ export interface AgentDefinition {
2
+ id: string;
3
+ description: string;
4
+ systemPrompt: string;
5
+ canWrite: boolean;
6
+ canBash: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { AgentDefinition } from "../../shared/contracts/interfaces.js";
2
+ export declare const visualist: AgentDefinition;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  /**
2
2
  * OpenCode Orchestrator Plugin
3
3
  *
4
- * 6-Agent Collaborative Architecture for OpenCode
4
+ * 5-Agent Structured Architecture for OpenCode
5
5
  *
6
- * Philosophy: Cheap models (GLM-4.7, Gemma, Phi) can outperform
7
- * expensive models through intelligent task decomposition and
8
- * team collaboration with quality gates.
6
+ * Optimized for weak models (GLM-4.7, Gemma, Phi) through:
7
+ * - XML-structured prompts with clear boundaries
8
+ * - Explicit reasoning patterns (THINK → ACT → OBSERVE → ADJUST)
9
+ * - Evidence-based completion requirements
10
+ * - Parallel execution by default
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
- planner: "planner";
18
- coder: "coder";
19
- reviewer: "reviewer";
20
- fixer: "fixer";
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: "planner" | "coder" | "reviewer" | "fixer" | "searcher";
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>;