opencode-orchestrator 0.1.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agnusdei1207
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # OpenCode Orchestrator
2
+
3
+ > **Multi-Agent Plugin for [OpenCode](https://opencode.ai)** β€” Make cheap models outperform expensive ones
4
+
5
+ <div align="center">
6
+
7
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+ [![OpenCode Plugin](https://img.shields.io/badge/OpenCode-Plugin-purple.svg)](https://opencode.ai)
9
+
10
+ </div>
11
+
12
+ ---
13
+
14
+ ## πŸ’‘ Philosophy
15
+
16
+ **The model doesn't matter. The workflow does.**
17
+
18
+ Any model β€” even lightweight ones β€” can produce reliable, production-quality code when:
19
+
20
+ 1. **Tasks are atomic** β€” one function, one fix, one file at a time
21
+ 2. **Every change is verified** β€” quality gate catches errors immediately
22
+ 3. **Errors trigger fixes** β€” self-correcting loop until it works
23
+
24
+ This plugin implements a **6-agent team** that turns any model into a disciplined development process.
25
+
26
+ ---
27
+
28
+ ## πŸš€ Quick Start
29
+
30
+ ### Install
31
+
32
+ ```bash
33
+ npm install opencode-orchestrator
34
+ # or
35
+ bun add opencode-orchestrator
36
+ ```
37
+
38
+ Plugin auto-registers. Just restart OpenCode.
39
+
40
+ ### Use
41
+
42
+ ```
43
+ /auto implement user authentication with JWT
44
+ ```
45
+
46
+ That's it. The agents handle the rest.
47
+
48
+ ---
49
+
50
+ ## πŸ€– How It Works
51
+
52
+ ```
53
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
54
+ β”‚ SELF-CORRECTING LOOP β”‚
55
+ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
56
+ β”‚ β”‚
57
+ β”‚ User Request β”‚
58
+ β”‚ β”‚ β”‚
59
+ β”‚ β–Ό β”‚
60
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
61
+ β”‚ β”‚ PLANNER │────▢│ Atomic Tasks: [T1] [T2] [T3] ... β”‚ β”‚
62
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
63
+ β”‚ β”‚ β”‚
64
+ β”‚ β–Ό β”‚
65
+ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
66
+ β”‚ β”‚ FOR EACH TASK: β”‚ β”‚
67
+ β”‚ β”‚ β”‚ β”‚
68
+ β”‚ β”‚ SEARCHER ─▢ CODER ─▢ REVIEWER ─┬─▢ βœ… NEXT β”‚ β”‚
69
+ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
70
+ β”‚ β”‚ ❌ FAIL β”‚ β”‚ β”‚
71
+ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚
72
+ β”‚ β”‚ β–Ό β”‚ β”‚ β”‚
73
+ β”‚ β”‚ FIXER β”€β”€β”€β”€β”˜ β”‚ β”‚
74
+ β”‚ β”‚ (retry ≀3) β”‚ β”‚
75
+ β”‚ β”‚ β”‚ β”‚
76
+ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
77
+ β”‚ β”‚ β”‚
78
+ β”‚ β–Ό β”‚
79
+ β”‚ βœ… COMPLETE β”‚
80
+ β”‚ β”‚
81
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
82
+ ```
83
+
84
+ ### Agents
85
+
86
+ | Agent | Job |
87
+ |-------|-----|
88
+ | **Planner** | Decomposes complex tasks into atomic units |
89
+ | **Searcher** | Finds patterns and context in codebase |
90
+ | **Coder** | Implements one atomic task at a time |
91
+ | **Reviewer** | Quality gate β€” catches all errors |
92
+ | **Fixer** | Applies targeted fixes from reviewer feedback |
93
+
94
+ ---
95
+
96
+ ## πŸ“‹ Commands
97
+
98
+ | Command | Description |
99
+ |---------|-------------|
100
+ | `/auto "task"` | Autonomous execution until complete |
101
+ | `/plan "task"` | Decompose into atomic tasks |
102
+ | `/review "code"` | Quality check |
103
+ | `/fix "errors"` | Apply fixes |
104
+ | `/search "pattern"` | Find context |
105
+
106
+ ---
107
+
108
+ ## πŸ›‘οΈ Error Prevention
109
+
110
+ | Feature | What It Does |
111
+ |---------|--------------|
112
+ | **Self-Correcting Loop** | Errors trigger fix β†’ verify cycle |
113
+ | **Retry Limit** | Same error 3x = stop and ask user |
114
+ | **Iteration Cap** | Max 100 iterations prevents runaway |
115
+ | **Atomic Tasks** | Small scope = fewer errors |
116
+
117
+ ---
118
+
119
+ ## ⚑ Why This Works
120
+
121
+ ### Traditional Approach
122
+ ```
123
+ [Big Model] ──────────────────────────▢ [Hope it works?]
124
+ ```
125
+
126
+ ### Orchestrator Approach
127
+ ```
128
+ [Any Model] ──▢ [Small Task] ──▢ [Verify] ──▢ [Fix if needed] ──▢ βœ…
129
+ ```
130
+
131
+ **Results:**
132
+ - πŸ”§ **Fewer errors**: Each change is verified
133
+ - πŸ’° **Lower cost**: Cheap models work fine
134
+ - πŸ”„ **Self-healing**: Errors get fixed automatically
135
+ - πŸ“Š **Predictable**: Clear progress tracking
136
+
137
+ ---
138
+
139
+ ## πŸ“š Documentation
140
+
141
+ - **[Architecture Guide](docs/ARCHITECTURE.md)** β€” Detailed workflow documentation
142
+ - **[Configuration](examples/orchestrator.jsonc)** β€” Customize agent settings
143
+
144
+ ---
145
+
146
+ ## πŸ“„ License
147
+
148
+ [MIT](LICENSE) β€” Use freely, modify freely, no strings attached.
149
+
150
+ ---
151
+
152
+ <div align="center">
153
+
154
+ **Built for [OpenCode](https://opencode.ai)** β€’ Make cheap models work like expensive ones
155
+
156
+ </div>
Binary file
@@ -0,0 +1,75 @@
1
+ /**
2
+ * OpenCode Orchestrator Plugin
3
+ *
4
+ * 6-Agent Collaborative Architecture for OpenCode
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.
9
+ */
10
+ import type { PluginInput } from "@opencode-ai/plugin";
11
+ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
12
+ tool: {
13
+ call_agent: {
14
+ description: string;
15
+ args: {
16
+ agent: import("zod").ZodEnum<{
17
+ planner: "planner";
18
+ coder: "coder";
19
+ reviewer: "reviewer";
20
+ fixer: "fixer";
21
+ searcher: "searcher";
22
+ }>;
23
+ task: import("zod").ZodString;
24
+ context: import("zod").ZodOptional<import("zod").ZodString>;
25
+ };
26
+ execute(args: {
27
+ agent: "planner" | "coder" | "reviewer" | "fixer" | "searcher";
28
+ task: string;
29
+ context?: string | undefined;
30
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
31
+ };
32
+ slashcommand: {
33
+ description: string;
34
+ args: {
35
+ command: import("zod").ZodString;
36
+ };
37
+ execute(args: {
38
+ command: string;
39
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
40
+ };
41
+ grep_search: {
42
+ description: string;
43
+ args: {
44
+ pattern: import("zod").ZodString;
45
+ dir: import("zod").ZodOptional<import("zod").ZodString>;
46
+ };
47
+ execute(args: {
48
+ pattern: string;
49
+ dir?: string | undefined;
50
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
51
+ };
52
+ glob_search: {
53
+ description: string;
54
+ args: {
55
+ pattern: import("zod").ZodString;
56
+ dir: import("zod").ZodOptional<import("zod").ZodString>;
57
+ };
58
+ execute(args: {
59
+ pattern: string;
60
+ dir?: string | undefined;
61
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
62
+ };
63
+ };
64
+ "chat.message": (input: any, output: any) => Promise<void>;
65
+ "tool.execute.after": (input: {
66
+ tool: string;
67
+ sessionID: string;
68
+ callID: string;
69
+ }, output: {
70
+ title: string;
71
+ output: string;
72
+ metadata: any;
73
+ }) => Promise<void>;
74
+ }>;
75
+ export default OrchestratorPlugin;