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 +21 -0
- package/README.md +156 -0
- package/bin/orchestrator +0 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.js +13033 -0
- package/dist/scripts/postinstall.js +53 -0
- package/package.json +80 -0
- package/scripts/postinstall.ts +73 -0
- package/src/index.ts +791 -0
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
|
+
[](LICENSE)
|
|
8
|
+
[](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>
|
package/bin/orchestrator
ADDED
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -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;
|