opencode-orchestrator 0.1.61 → 0.1.64

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,9 +2,9 @@
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
- > **Multi-Agent Plugin for [OpenCode](https://opencode.ai)**
7
+ > **Autonomous 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)
@@ -13,19 +13,17 @@
13
13
 
14
14
  ## What is this?
15
15
 
16
- A **5-agent structured architecture** that makes weak LLMs perform reliably.
16
+ A **5-agent autonomous architecture** designed to solve complex engineering tasks with high reliability, even on mid-range LLMs.
17
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.
18
+ **Core Philosophy**: Intelligence is a resource. We orchestrate that resource through **Phase-based Workflows** and **Mandatory Environment Scans** to ensure code always fits the project's infrastructure.
21
19
 
22
20
  ### 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)
21
+ - **🎯 Autonomous Loop** — Commander runs relentlessly until the mission is complete.
22
+ - **🔍 Environment Scan** — Mandatory analysis of Infra (Docker/OS), Stack, and Domain before any code change.
23
+ - **🔨 Smart Implementation** — Builder matches existing codebase patterns exactly.
24
+ - **🛡️ Rigorous Audit** — Inspector proves success with environment-specific evidence (Builds/Tests/Logs).
25
+ - **💾 Persistent Context** — Recorder saves session state to disk, enabling resume at any time.
26
+ - **🏗️ Parallel Tasking** — Architect splits work into concurrent DAG groups.
29
27
 
30
28
  ---
31
29
 
@@ -41,122 +39,69 @@ Restart OpenCode after installation.
41
39
 
42
40
  ## Usage
43
41
 
44
- ### Just Select Commander Agent
45
- Press `tab` → Select **Commander** → Type your request!
42
+ ### Just Select Commander Agent 🎯
43
+ Press `tab` → Select **Commander** → Type your mission!
46
44
 
47
45
  ```
48
- "Implement user authentication with JWT"
46
+ "Fix the login bug in the docker-compose environment"
49
47
  ```
50
48
 
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
49
+ The Commander will:
50
+ 1. **Survey**: Scan the Docker environment and codebase.
51
+ 2. **Plan**: Break the fix into steps.
52
+ 3. **Execute**: Call Builder to fix while matching patterns.
53
+ 4. **Verify**: Run builds/tests to prove the fix works.
54
+ 5. **Complete**: Report results with concrete evidence.
56
55
 
57
56
  ### Or Use /task Command
58
57
  ```bash
59
58
  /task "Implement user authentication with JWT"
60
59
  ```
61
60
 
62
- Both work identically - Commander agent OR /task command.
63
-
64
- ---
65
-
66
- ## How It Works
67
-
68
- ```
69
- Select Commander or /task
70
-
71
-
72
- ┌─────────────┐
73
- │ COMMANDER │ ← THINK → ACT → OBSERVE → ADJUST
74
- └──────┬──────┘
75
-
76
- ┌──────┴──────┐
77
- ▼ ▼
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)
90
- │ │
91
- └──────┬──────┘
92
-
93
- ┌─────────────┐
94
- │ INSPECTOR │ ← AUDIT → [FAIL? → FIX] → PASS
95
- └──────┬──────┘
96
-
97
- ┌─────────────┐
98
- │ MEMORY │ ← Save progress
99
- └──────┬──────┘
100
-
101
- ✅ MISSION COMPLETE
102
- ```
103
-
104
61
  ---
105
62
 
106
63
  ## Agents (5-Agent Architecture)
107
64
 
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**
65
+ | Agent | Emoji | Role | Responsibility |
66
+ | :--- | :--- | :--- | :--- |
67
+ | **Commander** | 🎯 | Orchestrator | Autonomous mission control & delegation |
68
+ | **Architect** | 🏗️ | Planner | Task decomposition & strategy correction |
69
+ | **Builder** | 🔨 | Developer | Full-stack implementation (Logic + UI) |
70
+ | **Inspector** | 🔍 | Quality | 5-point audit & automatic bug fixing |
71
+ | **Recorder** | 💾 | Context | Persistent environment & progress tracking |
120
72
 
121
73
  ---
122
74
 
123
- ## Optimized for Weak Models
75
+ ## The Workflow (Progressive Phases)
124
76
 
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 |
77
+ 1. **Phase 0: Triage (Smart)**
78
+ - **Fast Track 🟢**: Simple fixes → Execute instantly (Skip heavy scans).
79
+ - **Deep Track 🔴**: Complex features Full Environment Scan & Plan.
80
+ 2. **Phase 1: Environment Scan**
81
+ - Mandatory for Deep Track: Infra/Domain/Stack analysis.
82
+ 3. **Phase 2: Parallel Planning**
83
+ - Architect creates a DAG of atomic tasks (Scalable Planning).
84
+ 4. **Phase 3: Execution & Audit**
85
+ - Builder writes code ↔ Inspector verifies with evidence.
86
+ 5. **Phase 4: Completion**
87
+ - Mission Complete reported with proof of build/test success.
132
88
 
133
89
  ---
134
90
 
135
91
  ## Uninstall
136
92
 
137
93
  ```bash
94
+ npm run dev:uninstall
95
+ # OR
138
96
  npm uninstall -g opencode-orchestrator
139
97
  ```
140
98
 
141
- The plugin automatically removes itself from OpenCode config.
142
-
143
- ---
144
-
145
- ## Troubleshooting
146
-
147
- If Commander doesn't appear after install:
148
- ```bash
149
- npm uninstall -g opencode-orchestrator
150
- npm install -g opencode-orchestrator
151
- # Restart OpenCode
152
- ```
153
-
154
99
  ---
155
100
 
156
101
  ## Docs
157
102
 
158
- - [Architecture & Design](docs/ARCHITECTURE.md) — System design, agents, and why it works
159
- - [Plugin Troubleshooting](docs/PLUGIN_TROUBLESHOOTING.md) — Setup issues
103
+ - [Architecture & Design](docs/ARCHITECTURE.md) — Detailed system design and agent protocols
104
+ - [Plugin Troubleshooting](docs/PLUGIN_TROUBLESHOOTING.md) — Setup and common issues
160
105
 
161
106
  ---
162
107
 
@@ -166,4 +111,4 @@ MIT License. [LICENSE](LICENSE)
166
111
 
167
112
  ---
168
113
 
169
- **Updates are frequent. Keep your version fresh.**
114
+ **Reliability over slop. Environment over assumptions.**
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * OpenCode Orchestrator Plugin
3
3
  *
4
- * 5-Agent Structured Architecture for OpenCode
4
+ * 5-Agent Structured Architecture
5
5
  *
6
- * Optimized for weak models (GLM-4.7, Gemma, Phi) through:
6
+ * Optimized for weak models through:
7
7
  * - XML-structured prompts with clear boundaries
8
8
  * - Explicit reasoning patterns (THINK → ACT → OBSERVE → ADJUST)
9
9
  * - Evidence-based completion requirements
10
- * - Parallel execution by default
10
+ * - Autonomous execution loop
11
11
  *
12
- * Agents: Commander, Architect, Builder, Inspector, Memory
12
+ * Agents: Commander, Architect, Builder, Inspector, Recorder
13
13
  */
14
14
  import type { PluginInput } from "@opencode-ai/plugin";
15
15
  declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
@@ -21,13 +21,13 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
21
21
  architect: "architect";
22
22
  builder: "builder";
23
23
  inspector: "inspector";
24
- memory: "memory";
24
+ recorder: "recorder";
25
25
  }>;
26
26
  task: import("zod").ZodString;
27
27
  context: import("zod").ZodOptional<import("zod").ZodString>;
28
28
  };
29
29
  execute(args: {
30
- agent: "architect" | "builder" | "inspector" | "memory";
30
+ agent: "architect" | "builder" | "inspector" | "recorder";
31
31
  task: string;
32
32
  context?: string | undefined;
33
33
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
@@ -65,17 +65,23 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
65
65
  };
66
66
  };
67
67
  config: (config: Record<string, unknown>) => Promise<void>;
68
- "chat.message": (input: any, output: any) => Promise<void>;
69
- "tool.execute.after": (input: {
68
+ "chat.message": (msgInput: any, msgOutput: any) => Promise<void>;
69
+ "tool.execute.after": (toolInput: {
70
70
  tool: string;
71
71
  sessionID: string;
72
72
  callID: string;
73
73
  arguments?: any;
74
- }, output: {
74
+ }, toolOutput: {
75
75
  title: string;
76
76
  output: string;
77
77
  metadata: any;
78
78
  }) => Promise<void>;
79
- "assistant.done": (input: any, output: any) => Promise<void>;
79
+ "assistant.done": (assistantInput: any, assistantOutput: any) => Promise<void>;
80
+ handler: ({ event }: {
81
+ event: {
82
+ type: string;
83
+ properties?: unknown;
84
+ };
85
+ }) => Promise<void>;
80
86
  }>;
81
87
  export default OrchestratorPlugin;