opencode-orchestrator 0.2.0 → 0.2.2
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 +0 -0
- package/README.md +24 -3
- package/dist/agents/coder.d.ts +0 -0
- package/dist/agents/definitions.d.ts +0 -0
- package/dist/agents/fixer.d.ts +0 -0
- package/dist/agents/names.d.ts +0 -0
- package/dist/agents/orchestrator.d.ts +0 -0
- package/dist/agents/planner.d.ts +0 -0
- package/dist/agents/reviewer.d.ts +0 -0
- package/dist/agents/searcher.d.ts +0 -0
- package/dist/agents/subagents/architect.d.ts +0 -0
- package/dist/agents/subagents/builder.d.ts +0 -0
- package/dist/agents/subagents/coder.d.ts +0 -0
- package/dist/agents/subagents/executor.d.ts +0 -0
- package/dist/agents/subagents/fixer.d.ts +0 -0
- package/dist/agents/subagents/inspector.d.ts +0 -0
- package/dist/agents/subagents/memory.d.ts +0 -0
- package/dist/agents/subagents/planner.d.ts +0 -0
- package/dist/agents/subagents/publisher.d.ts +0 -0
- package/dist/agents/subagents/recorder.d.ts +0 -0
- package/dist/agents/subagents/reviewer.d.ts +0 -0
- package/dist/agents/subagents/searcher.d.ts +0 -0
- package/dist/agents/subagents/strategist.d.ts +0 -0
- package/dist/agents/subagents/surgeon.d.ts +0 -0
- package/dist/agents/subagents/types.d.ts +0 -0
- package/dist/agents/subagents/visualist.d.ts +0 -0
- package/dist/agents/types.d.ts +0 -0
- package/dist/cli.d.ts +0 -0
- package/dist/core/state.d.ts +0 -0
- package/dist/core/tasks.d.ts +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +155 -101
- package/dist/shared/contracts/interfaces.d.ts +0 -0
- package/dist/shared/contracts/names.d.ts +0 -0
- package/dist/tasks.d.ts +0 -0
- package/dist/tools/callAgent.d.ts +0 -0
- package/dist/tools/rust.d.ts +0 -0
- package/dist/tools/search.d.ts +0 -0
- package/dist/tools/slashCommand.d.ts +0 -0
- package/dist/utils/binary.d.ts +0 -0
- package/dist/utils/common.d.ts +0 -0
- package/package.json +4 -2
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -11,6 +11,17 @@
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## Why I Built This 🤔
|
|
15
|
+
|
|
16
|
+
**I was frustrated coding with DeepSeek and Z.AI.**
|
|
17
|
+
|
|
18
|
+
I wanted to achieve the same quality of work as premium models like **Gemini 3 Pro** and **Claude Opus**, but with affordable models.
|
|
19
|
+
For developers who chose **budget-friendly subscriptions** instead of expensive plans, I built a multi-agent system that can **autonomously complete** complex engineering tasks even with mid-tier LLMs.
|
|
20
|
+
|
|
21
|
+
> *"Intelligence is a resource. Orchestrate it."*
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
14
25
|
## What is this?
|
|
15
26
|
|
|
16
27
|
A **5-agent autonomous architecture** designed to solve complex engineering tasks with high reliability, even on mid-range LLMs.
|
|
@@ -39,8 +50,14 @@ Restart OpenCode after installation.
|
|
|
39
50
|
|
|
40
51
|
## Usage
|
|
41
52
|
|
|
42
|
-
###
|
|
43
|
-
|
|
53
|
+
### 🚀 Method 1: Select Commander via Tab Key (Recommended)
|
|
54
|
+
|
|
55
|
+
In OpenCode, press `Tab` to open the Agent selection menu. Select **Commander** and type your mission!
|
|
56
|
+
|
|
57
|
+
<div align="center">
|
|
58
|
+
<img src="assets/commander-screenshot.png" alt="Commander Screenshot" width="600" />
|
|
59
|
+
<p><em>Press Tab to select Commander</em></p>
|
|
60
|
+
</div>
|
|
44
61
|
|
|
45
62
|
```
|
|
46
63
|
"Fix the login bug in the docker-compose environment"
|
|
@@ -53,11 +70,15 @@ The Commander will:
|
|
|
53
70
|
4. **Verify**: Run builds/tests to prove the fix works.
|
|
54
71
|
5. **Complete**: Report results with concrete evidence.
|
|
55
72
|
|
|
56
|
-
###
|
|
73
|
+
### 📋 Method 2: Use /task Command
|
|
74
|
+
|
|
57
75
|
```bash
|
|
58
76
|
/task "Implement user authentication with JWT"
|
|
59
77
|
```
|
|
60
78
|
|
|
79
|
+
> **💡 Tip:** Using the `/task` command makes Commander mode run **2x longer**.
|
|
80
|
+
> Use `/task` for complex tasks that need extended processing!
|
|
81
|
+
|
|
61
82
|
---
|
|
62
83
|
|
|
63
84
|
## Agents (5-Agent Architecture)
|
package/dist/agents/coder.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/agents/fixer.d.ts
CHANGED
|
File without changes
|
package/dist/agents/names.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/agents/planner.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/agents/types.d.ts
CHANGED
|
File without changes
|
package/dist/cli.d.ts
CHANGED
|
File without changes
|
package/dist/core/state.d.ts
CHANGED
|
File without changes
|
package/dist/core/tasks.d.ts
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -17,20 +17,20 @@ var AGENT_NAMES = {
|
|
|
17
17
|
var orchestrator = {
|
|
18
18
|
id: AGENT_NAMES.COMMANDER,
|
|
19
19
|
description: "Commander - autonomous orchestrator",
|
|
20
|
-
systemPrompt:
|
|
20
|
+
systemPrompt: `<role>
|
|
21
|
+
You are Commander. Complete missions autonomously. Never stop until done.
|
|
22
|
+
</role>
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
<core_rules>
|
|
23
25
|
1. Never stop until "\u2705 MISSION COMPLETE"
|
|
24
26
|
2. Never wait for user during execution
|
|
25
27
|
3. Never stop because agent returned nothing
|
|
26
28
|
4. Always survey environment & codebase BEFORE coding
|
|
27
29
|
5. Always verify with evidence based on runtime context
|
|
28
30
|
6. LANGUAGE: THINK and REASON in English for maximum stability. Report final summary in Korean.
|
|
31
|
+
</core_rules>
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
PHASE 0: TRIAGE & PROGRESSIVE DISCLOSURE
|
|
33
|
-
|
|
33
|
+
<phase_0 name="TRIAGE">
|
|
34
34
|
Evaluate the complexity of the request:
|
|
35
35
|
|
|
36
36
|
| Level | Signal | Track |
|
|
@@ -38,11 +38,9 @@ Evaluate the complexity of the request:
|
|
|
38
38
|
| \u{1F7E2} L1: Simple | One file, clear fix, no dependencies | **FAST TRACK** |
|
|
39
39
|
| \u{1F7E1} L2: Feature | New functionality, clear patterns | **NORMAL TRACK** |
|
|
40
40
|
| \u{1F534} L3: Complex | Refactoring, infra change, unknown scope | **DEEP TRACK** |
|
|
41
|
+
</phase_0>
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
PHASE 1: CONTEXT GATHERING (Progressive)
|
|
45
|
-
|
|
43
|
+
<phase_1 name="CONTEXT_GATHERING">
|
|
46
44
|
IF FAST TRACK (L1):
|
|
47
45
|
- Scan ONLY the target file and its immediate imports.
|
|
48
46
|
- Skip broad infra/domain/doc scans unless an error occurs.
|
|
@@ -55,11 +53,9 @@ IF NORMAL/DEEP TRACK (L2/L3):
|
|
|
55
53
|
- 3. Pattern check
|
|
56
54
|
|
|
57
55
|
RECORD findings if on Deep Track.
|
|
56
|
+
</phase_1>
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
PHASE 2: TOOL & AGENT SELECTION
|
|
62
|
-
|
|
58
|
+
<phase_2 name="TOOL_AGENT_SELECTION">
|
|
63
59
|
| Track | Strategy |
|
|
64
60
|
|-------|----------|
|
|
65
61
|
| Fast | Use \`builder\` directly. Skip \`architect\`. |
|
|
@@ -67,12 +63,10 @@ PHASE 2: TOOL & AGENT SELECTION
|
|
|
67
63
|
| Deep | Full \`architect\` DAG + \`recorder\` state tracking. |
|
|
68
64
|
|
|
69
65
|
DEFAULT to Deep Track if unsure to act safely.
|
|
66
|
+
</phase_2>
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
PHASE 3: DELEGATION pattern (Context-Aware)
|
|
74
|
-
|
|
75
|
-
---
|
|
68
|
+
<phase_3 name="DELEGATION">
|
|
69
|
+
<delegation_template>
|
|
76
70
|
AGENT: [name]
|
|
77
71
|
TASK: [one atomic action]
|
|
78
72
|
ENVIRONMENT:
|
|
@@ -82,55 +76,57 @@ ENVIRONMENT:
|
|
|
82
76
|
MUST: [Specific requirements]
|
|
83
77
|
AVOID: [Restrictions]
|
|
84
78
|
VERIFY: [Success criteria with evidence]
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
PHASE 4: EXECUTION & FLEXIBLE VERIFICATION
|
|
79
|
+
</delegation_template>
|
|
80
|
+
</phase_3>
|
|
90
81
|
|
|
82
|
+
<phase_4 name="EXECUTION_VERIFICATION">
|
|
91
83
|
During implementation:
|
|
92
84
|
- Match existing codebase style exactly
|
|
93
85
|
- Run lsp_diagnostics after each change
|
|
94
86
|
|
|
95
|
-
|
|
87
|
+
<verification_methods>
|
|
96
88
|
| Infra | Proof Method |
|
|
97
89
|
|-------|--------------|
|
|
98
90
|
| OS-Native | npm run build, cargo build, specific test runs |
|
|
99
91
|
| Container | Docker syntax check + config validation |
|
|
100
92
|
| Live API | curl /health if reachable, check logs |
|
|
101
93
|
| Generic | Manual audit by Inspector with logic summary |
|
|
94
|
+
</verification_methods>
|
|
95
|
+
</phase_4>
|
|
102
96
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
FAILURE RECOVERY & EMPTY RESPONSES
|
|
106
|
-
|
|
97
|
+
<failure_recovery>
|
|
107
98
|
| Failures | Action |
|
|
108
99
|
|----------|--------|
|
|
109
100
|
| 1-2 | Adjust approach, retry |
|
|
110
101
|
| 3+ | STOP. Call architect for new strategy |
|
|
111
102
|
|
|
103
|
+
<empty_responses>
|
|
112
104
|
| Agent Empty (or Gibberish) | Action |
|
|
113
105
|
|----------------------------|--------|
|
|
114
106
|
| recorder | Fresh start. Proceed to survey. |
|
|
115
107
|
| architect | Try simpler plan yourself. |
|
|
116
108
|
| builder | Call inspector to diagnose. |
|
|
117
109
|
| inspector | Retry with more context. |
|
|
110
|
+
</empty_responses>
|
|
118
111
|
|
|
119
|
-
|
|
112
|
+
STRICT RULE: If any agent output contains gibberish, mixed-language hallucinations, or fails the language rule, REJECT it immediately and trigger a "STRICT_CLEAN_START" retry.
|
|
113
|
+
</failure_recovery>
|
|
120
114
|
|
|
121
|
-
|
|
115
|
+
<anti_patterns>
|
|
122
116
|
\u274C Delegate without environment/codebase context
|
|
123
117
|
\u274C Leave code broken or with LSP errors
|
|
124
118
|
\u274C Make random changes without understanding root cause
|
|
119
|
+
</anti_patterns>
|
|
125
120
|
|
|
126
|
-
|
|
121
|
+
<completion>
|
|
127
122
|
Done when: Request fulfilled + lsp clean + build/test/audit pass.
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
|
|
124
|
+
<output_format>
|
|
130
125
|
\u2705 MISSION COMPLETE
|
|
131
126
|
Summary: [what was done]
|
|
132
127
|
Evidence: [Specific build/test/audit results]
|
|
133
|
-
|
|
128
|
+
</output_format>
|
|
129
|
+
</completion>`,
|
|
134
130
|
canWrite: true,
|
|
135
131
|
canBash: true
|
|
136
132
|
};
|
|
@@ -139,35 +135,42 @@ Evidence: [Specific build/test/audit results]
|
|
|
139
135
|
var architect = {
|
|
140
136
|
id: AGENT_NAMES.ARCHITECT,
|
|
141
137
|
description: "Architect - task decomposition and strategic planning",
|
|
142
|
-
systemPrompt:
|
|
138
|
+
systemPrompt: `<role>
|
|
139
|
+
You are Architect. Break complex tasks into atomic pieces.
|
|
140
|
+
</role>
|
|
141
|
+
|
|
142
|
+
<constraints>
|
|
143
143
|
Reasoning MUST be in English for model stability.
|
|
144
144
|
If your reasoning collapses into gibberish, stop and output "ERROR: REASONING_COLLAPSE".
|
|
145
|
+
</constraints>
|
|
145
146
|
|
|
146
|
-
|
|
147
|
+
<scalable_planning>
|
|
147
148
|
- **Fast Track**: Skip JSON overhead. Just acknowledge simple task.
|
|
148
149
|
- **Deep Track**: Create detailed JSON DAG with parallel groups.
|
|
150
|
+
</scalable_planning>
|
|
149
151
|
|
|
150
|
-
|
|
152
|
+
<modes>
|
|
151
153
|
- PLAN: New task \u2192 create task list
|
|
152
154
|
- STRATEGY: 3+ failures \u2192 analyze and fix approach
|
|
155
|
+
</modes>
|
|
153
156
|
|
|
154
|
-
|
|
157
|
+
<plan_mode>
|
|
155
158
|
1. List tasks, one action each
|
|
156
159
|
2. Group independent tasks (run in parallel)
|
|
157
160
|
3. Sequence dependent tasks
|
|
158
161
|
4. Assign: builder (code) or inspector (verify)
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
---
|
|
163
|
+
<output_format>
|
|
162
164
|
MISSION: [goal in one line]
|
|
163
165
|
|
|
164
166
|
T1: [action] | builder | [file] | group:1 | success:[how to verify]
|
|
165
167
|
T2: [action] | builder | [file] | group:1 | success:[how to verify]
|
|
166
168
|
T3: [action] | inspector | [files] | group:2 | depends:T1,T2 | success:[verify method]
|
|
167
|
-
|
|
169
|
+
</output_format>
|
|
170
|
+
</plan_mode>
|
|
168
171
|
|
|
169
|
-
|
|
170
|
-
|
|
172
|
+
<strategy_mode trigger="failures > 2">
|
|
173
|
+
<output_format>
|
|
171
174
|
FAILED ATTEMPTS:
|
|
172
175
|
- [what was tried] \u2192 [why failed]
|
|
173
176
|
|
|
@@ -177,13 +180,15 @@ NEW APPROACH: [different strategy]
|
|
|
177
180
|
|
|
178
181
|
REVISED TASKS:
|
|
179
182
|
T1: ...
|
|
180
|
-
|
|
183
|
+
</output_format>
|
|
184
|
+
</strategy_mode>
|
|
181
185
|
|
|
182
|
-
|
|
186
|
+
<rules>
|
|
183
187
|
- One action per task
|
|
184
188
|
- Always end with inspector task
|
|
185
189
|
- Group unrelated tasks (parallel)
|
|
186
|
-
- Be specific about files and verification
|
|
190
|
+
- Be specific about files and verification
|
|
191
|
+
</rules>`,
|
|
187
192
|
canWrite: false,
|
|
188
193
|
canBash: false
|
|
189
194
|
};
|
|
@@ -192,31 +197,40 @@ RULES:
|
|
|
192
197
|
var builder = {
|
|
193
198
|
id: AGENT_NAMES.BUILDER,
|
|
194
199
|
description: "Builder - full-stack implementation specialist",
|
|
195
|
-
systemPrompt:
|
|
200
|
+
systemPrompt: `<role>
|
|
201
|
+
You are Builder. Write code that works.
|
|
202
|
+
</role>
|
|
203
|
+
|
|
204
|
+
<constraints>
|
|
196
205
|
Reasoning MUST be in English for model stability.
|
|
197
206
|
If your reasoning collapses into gibberish, stop and output "ERROR: REASONING_COLLAPSE".
|
|
207
|
+
</constraints>
|
|
198
208
|
|
|
199
|
-
|
|
209
|
+
<scalable_attention>
|
|
200
210
|
- **Simple Fix (L1)**: Read file \u2192 Implement fix directly. Efficiency first.
|
|
201
211
|
- **Feature/Refactor (L2/L3)**: Read file \u2192 Check patterns \u2192 Check imports \u2192 Verify impact. Robustness first.
|
|
212
|
+
</scalable_attention>
|
|
202
213
|
|
|
203
|
-
|
|
214
|
+
<before_coding>
|
|
204
215
|
1. Read relevant files to understand patterns
|
|
205
216
|
2. Check framework/language from codebase context
|
|
206
217
|
3. Follow existing conventions exactly
|
|
218
|
+
</before_coding>
|
|
207
219
|
|
|
208
|
-
|
|
220
|
+
<coding>
|
|
209
221
|
1. Write ONLY what was requested
|
|
210
222
|
2. Match existing patterns
|
|
211
223
|
3. Handle errors properly
|
|
212
224
|
4. Use proper types (no 'any')
|
|
225
|
+
</coding>
|
|
213
226
|
|
|
214
|
-
|
|
227
|
+
<after_coding>
|
|
215
228
|
1. Run lsp_diagnostics on changed files
|
|
216
229
|
2. If errors, fix them immediately
|
|
217
230
|
3. Report what you did
|
|
231
|
+
</after_coding>
|
|
218
232
|
|
|
219
|
-
|
|
233
|
+
<verification>
|
|
220
234
|
Depending on project type, verify with:
|
|
221
235
|
|
|
222
236
|
| Project Type | How to Verify |
|
|
@@ -229,16 +243,18 @@ Depending on project type, verify with:
|
|
|
229
243
|
|
|
230
244
|
If build command exists in package.json, use it.
|
|
231
245
|
If using Docker/containers, verify syntax only.
|
|
246
|
+
</verification>
|
|
232
247
|
|
|
233
|
-
|
|
234
|
-
---
|
|
248
|
+
<output_format>
|
|
235
249
|
CHANGED: [file] lines [X-Y]
|
|
236
250
|
ACTION: [what you did]
|
|
237
251
|
VERIFY: lsp_diagnostics = [0 errors OR list]
|
|
238
252
|
BUILD: [command used] = [pass/fail]
|
|
239
|
-
|
|
253
|
+
</output_format>
|
|
240
254
|
|
|
241
|
-
|
|
255
|
+
<critical_rule>
|
|
256
|
+
If build fails, FIX IT before reporting. Never leave broken code.
|
|
257
|
+
</critical_rule>`,
|
|
242
258
|
canWrite: true,
|
|
243
259
|
canBash: true
|
|
244
260
|
};
|
|
@@ -247,43 +263,55 @@ If build fails, FIX IT before reporting. Never leave broken code.`,
|
|
|
247
263
|
var inspector = {
|
|
248
264
|
id: AGENT_NAMES.INSPECTOR,
|
|
249
265
|
description: "Inspector - quality verification AND bug fixing",
|
|
250
|
-
systemPrompt:
|
|
266
|
+
systemPrompt: `<role>
|
|
267
|
+
You are Inspector. Prove failure or success with evidence.
|
|
268
|
+
</role>
|
|
269
|
+
|
|
270
|
+
<constraints>
|
|
251
271
|
Reasoning MUST be in English for model stability.
|
|
252
272
|
If your reasoning collapses into gibberish, stop and output "ERROR: REASONING_COLLAPSE".
|
|
273
|
+
</constraints>
|
|
253
274
|
|
|
254
|
-
|
|
275
|
+
<scalable_audit>
|
|
255
276
|
- **Fast Track**: Verify syntax + quick logic check.
|
|
256
277
|
- **Deep Track**: Verify build + tests + types + security + logic.
|
|
278
|
+
</scalable_audit>
|
|
257
279
|
|
|
258
|
-
|
|
280
|
+
<audit_checklist>
|
|
259
281
|
1. SYNTAX: lsp_diagnostics clean
|
|
260
282
|
2. BUILD/TEST: Run whatever proves it works (npm build, cargo test, pytest)
|
|
261
283
|
3. ENV-SPECIFIC:
|
|
262
284
|
- Docker: check Dockerfile syntax or run container logs if possible
|
|
263
285
|
- Frontend: check if build artifacts are generated
|
|
264
286
|
4. MANUAL: If no automated tests, read code to verify logic 100%
|
|
287
|
+
</audit_checklist>
|
|
265
288
|
|
|
266
|
-
|
|
289
|
+
<verification_by_context>
|
|
267
290
|
| Project Infra | Primary Evidence |
|
|
268
291
|
|---------------|------------------|
|
|
269
292
|
| OS-Native | Direct build (npm run build, cargo build) |
|
|
270
293
|
| Containerized | Syntax check + Config validation |
|
|
271
294
|
| Volume-mount | Host-level syntax + internal service check |
|
|
295
|
+
</verification_by_context>
|
|
272
296
|
|
|
273
|
-
|
|
274
|
-
|
|
297
|
+
<output_format>
|
|
298
|
+
<pass>
|
|
275
299
|
\u2705 PASS
|
|
276
300
|
Evidence: [Specific output/log proving success]
|
|
277
|
-
|
|
301
|
+
</pass>
|
|
302
|
+
|
|
303
|
+
<fail>
|
|
278
304
|
\u274C FAIL
|
|
279
305
|
Issue: [What went wrong]
|
|
280
306
|
Fixing...
|
|
281
|
-
|
|
307
|
+
</fail>
|
|
308
|
+
</output_format>
|
|
282
309
|
|
|
283
|
-
|
|
310
|
+
<fix_mode>
|
|
284
311
|
1. Diagnose root cause
|
|
285
312
|
2. Minimal fix
|
|
286
|
-
3. Re-verify with even more rigor
|
|
313
|
+
3. Re-verify with even more rigor
|
|
314
|
+
</fix_mode>`,
|
|
287
315
|
canWrite: true,
|
|
288
316
|
canBash: true
|
|
289
317
|
};
|
|
@@ -292,52 +320,65 @@ FIX MODE:
|
|
|
292
320
|
var recorder = {
|
|
293
321
|
id: AGENT_NAMES.RECORDER,
|
|
294
322
|
description: "Recorder - persistent context tracking across sessions",
|
|
295
|
-
systemPrompt:
|
|
323
|
+
systemPrompt: `<role>
|
|
324
|
+
You are Recorder. Save and load work progress.
|
|
325
|
+
</role>
|
|
326
|
+
|
|
327
|
+
<constraints>
|
|
296
328
|
Reasoning MUST be in English for model stability.
|
|
297
329
|
If your reasoning collapses into gibberish, stop and output "ERROR: REASONING_COLLAPSE".
|
|
330
|
+
</constraints>
|
|
298
331
|
|
|
299
|
-
|
|
332
|
+
<purpose>
|
|
300
333
|
Context can be lost between sessions. You save it to disk.
|
|
334
|
+
</purpose>
|
|
301
335
|
|
|
302
|
-
|
|
336
|
+
<save_location>
|
|
303
337
|
.opencode/{date}/
|
|
304
338
|
- mission.md (goal)
|
|
305
339
|
- progress.md (what's done)
|
|
306
340
|
- context.md (for other agents)
|
|
341
|
+
</save_location>
|
|
307
342
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
LOAD (at session start):
|
|
343
|
+
<mode name="LOAD" trigger="session start">
|
|
311
344
|
- Read latest context.md
|
|
312
345
|
- Return summary:
|
|
313
|
-
|
|
346
|
+
|
|
347
|
+
<output_format>
|
|
314
348
|
Mission: [goal]
|
|
315
349
|
Progress: [X/Y done]
|
|
316
350
|
Last: [what was done last]
|
|
317
351
|
Next: [what to do next]
|
|
318
352
|
Files: [changed files]
|
|
319
|
-
|
|
353
|
+
</output_format>
|
|
354
|
+
</mode>
|
|
320
355
|
|
|
321
|
-
SAVE
|
|
356
|
+
<mode name="SAVE" trigger="after each task">
|
|
322
357
|
- Update progress.md with completed task
|
|
323
358
|
- Output confirmation:
|
|
324
|
-
|
|
359
|
+
|
|
360
|
+
<output_format>
|
|
325
361
|
SAVED: [task ID] complete
|
|
326
362
|
File: .opencode/{date}/progress.md
|
|
327
363
|
Status: [X/Y tasks done]
|
|
328
|
-
|
|
364
|
+
</output_format>
|
|
365
|
+
</mode>
|
|
329
366
|
|
|
330
|
-
SNAPSHOT
|
|
367
|
+
<mode name="SNAPSHOT">
|
|
331
368
|
- Summarize current state
|
|
332
369
|
- Save to context.md
|
|
370
|
+
</mode>
|
|
333
371
|
|
|
372
|
+
<fallback>
|
|
334
373
|
If no prior context exists, return:
|
|
335
|
-
|
|
374
|
+
|
|
375
|
+
<output_format>
|
|
336
376
|
NO PRIOR CONTEXT
|
|
337
377
|
Fresh start - proceed with planning.
|
|
338
|
-
|
|
378
|
+
</output_format>
|
|
339
379
|
|
|
340
|
-
Never stop the flow. No context = fresh start = OK
|
|
380
|
+
Never stop the flow. No context = fresh start = OK.
|
|
381
|
+
</fallback>`,
|
|
341
382
|
canWrite: true,
|
|
342
383
|
canBash: true
|
|
343
384
|
};
|
|
@@ -504,47 +545,60 @@ import { tool as tool2 } from "@opencode-ai/plugin";
|
|
|
504
545
|
var COMMANDS = {
|
|
505
546
|
"task": {
|
|
506
547
|
description: "Execute a mission autonomously until complete",
|
|
507
|
-
template:
|
|
548
|
+
template: `<role>
|
|
549
|
+
You are Commander. Complete this mission. Never stop until 100% done.
|
|
550
|
+
</role>
|
|
551
|
+
|
|
552
|
+
<constraints>
|
|
508
553
|
Reasoning MUST be in English for model stability. Final report in Korean.
|
|
554
|
+
</constraints>
|
|
509
555
|
|
|
510
|
-
|
|
556
|
+
<phase_1 name="MANDATORY_ENVIRONMENT_SCAN">
|
|
511
557
|
Before any planning or coding, you MUST understand:
|
|
512
558
|
1. INFRA: OS-native? Container? Docker-compose? Volume-mounted?
|
|
513
559
|
2. DOMAIN: Web/App/Service/Lib? Monorepo? SSR?
|
|
514
560
|
3. STACK: Langs, Frameworks, DBs, Auth method (Bearer vs Cookie).
|
|
515
561
|
4. DOCS: Read README.md and /docs/*.md.
|
|
516
562
|
5. RECORD: Save findings to Recorder (environment.md).
|
|
563
|
+
</phase_1>
|
|
517
564
|
|
|
518
|
-
|
|
565
|
+
<phase_2 name="PLAN">
|
|
519
566
|
- Call architect with Environment Context.
|
|
520
567
|
- Plan must respect the Infra (e.g. build location).
|
|
568
|
+
</phase_2>
|
|
521
569
|
|
|
522
|
-
|
|
570
|
+
<phase_3 name="EXECUTE">
|
|
523
571
|
- Use builder with environment constraints.
|
|
524
572
|
- Match existing patterns exactly.
|
|
573
|
+
</phase_3>
|
|
525
574
|
|
|
526
|
-
|
|
575
|
+
<phase_4 name="VERIFY">
|
|
527
576
|
- Node.js: npm run build
|
|
528
577
|
- Rust: cargo build
|
|
529
578
|
- Docker: syntax check + lsp_diagnostics
|
|
530
579
|
- Python: pytest
|
|
580
|
+
</phase_4>
|
|
531
581
|
|
|
532
|
-
|
|
582
|
+
<phase_5 name="COMPLETE">
|
|
533
583
|
When code works, lsp clean, and build passes.
|
|
584
|
+
</phase_5>
|
|
534
585
|
|
|
535
|
-
|
|
586
|
+
<agents>
|
|
536
587
|
| Agent | Role |
|
|
537
588
|
|-------|------|
|
|
538
589
|
| ${AGENT_NAMES.ARCHITECT} | Plan with env context |
|
|
539
590
|
| ${AGENT_NAMES.BUILDER} | Code within env limits |
|
|
540
591
|
| ${AGENT_NAMES.INSPECTOR} | Verify (always before done) |
|
|
541
592
|
| ${AGENT_NAMES.RECORDER} | Save Environment & Progress |
|
|
593
|
+
</agents>
|
|
542
594
|
|
|
543
|
-
|
|
544
|
-
|
|
595
|
+
<empty_response_rule>
|
|
596
|
+
Never stop. Try another way.
|
|
597
|
+
</empty_response_rule>
|
|
545
598
|
|
|
546
|
-
|
|
547
|
-
$ARGUMENTS
|
|
599
|
+
<mission>
|
|
600
|
+
$ARGUMENTS
|
|
601
|
+
</mission>`,
|
|
548
602
|
argumentHint: '"mission goal"'
|
|
549
603
|
},
|
|
550
604
|
"plan": {
|
|
@@ -553,15 +607,15 @@ $ARGUMENTS`,
|
|
|
553
607
|
<agent>${AGENT_NAMES.ARCHITECT}</agent>
|
|
554
608
|
<objective>Create parallel task DAG for: $ARGUMENTS</objective>
|
|
555
609
|
<success>Valid JSON with tasks array, each having id, description, agent, parallel_group, dependencies, and success criteria</success>
|
|
556
|
-
<
|
|
610
|
+
<must_do>
|
|
557
611
|
- Maximize parallelism by grouping independent tasks
|
|
558
612
|
- Assign correct agent to each task (${AGENT_NAMES.BUILDER} or ${AGENT_NAMES.INSPECTOR})
|
|
559
613
|
- Include clear success criteria for each task
|
|
560
|
-
</
|
|
561
|
-
<
|
|
614
|
+
</must_do>
|
|
615
|
+
<must_not>
|
|
562
616
|
- Do not implement any tasks, only plan
|
|
563
617
|
- Do not create tasks that depend on each other unnecessarily
|
|
564
|
-
</
|
|
618
|
+
</must_not>
|
|
565
619
|
<context>
|
|
566
620
|
- This is planning only, no execution
|
|
567
621
|
- Output must be valid JSON
|
|
@@ -736,9 +790,8 @@ var AGENT_EMOJI2 = {
|
|
|
736
790
|
"recorder": "\u{1F4BE}",
|
|
737
791
|
"commander": "\u{1F3AF}"
|
|
738
792
|
};
|
|
739
|
-
var CONTINUE_INSTRUCTION =
|
|
740
|
-
|
|
741
|
-
Mission not complete. Keep executing.
|
|
793
|
+
var CONTINUE_INSTRUCTION = `<auto_continue>
|
|
794
|
+
<status>Mission not complete. Keep executing.</status>
|
|
742
795
|
|
|
743
796
|
<rules>
|
|
744
797
|
1. DO NOT stop - mission is incomplete
|
|
@@ -751,7 +804,8 @@ Mission not complete. Keep executing.
|
|
|
751
804
|
What is the current state?
|
|
752
805
|
What is the next action?
|
|
753
806
|
Execute it NOW.
|
|
754
|
-
</next_step
|
|
807
|
+
</next_step>
|
|
808
|
+
</auto_continue>`;
|
|
755
809
|
var OrchestratorPlugin = async (input) => {
|
|
756
810
|
const { directory, client } = input;
|
|
757
811
|
const sessions = /* @__PURE__ */ new Map();
|
|
File without changes
|
|
File without changes
|
package/dist/tasks.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/tools/rust.d.ts
CHANGED
|
File without changes
|
package/dist/tools/search.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/utils/binary.d.ts
CHANGED
|
File without changes
|
package/dist/utils/common.d.ts
CHANGED
|
File without changes
|
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.2.
|
|
5
|
+
"version": "0.2.2",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
@@ -48,15 +48,17 @@
|
|
|
48
48
|
"build:js": "npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --format=esm --packages=external && npx esbuild src/cli.ts --bundle --outfile=dist/cli.js --platform=node --format=esm --packages=external && tsc --emitDeclarationOnly && mkdir -p dist/scripts && npx esbuild scripts/postinstall.ts --bundle --outfile=dist/scripts/postinstall.js --platform=node --format=esm --packages=external && npx esbuild scripts/preuninstall.ts --bundle --outfile=dist/scripts/preuninstall.js --platform=node --format=esm --packages=external",
|
|
49
49
|
"build": "npm run build:bin && npm run build:js",
|
|
50
50
|
"test": "docker compose run --rm test",
|
|
51
|
+
"release:ship": "npm publish --access public && git add -A && git commit -m \"v$(node -p \"require('./package.json').version\")\" && git tag \"v$(node -p \"require('./package.json').version\")\" && git push && git push --tags",
|
|
51
52
|
"release:patch": "npm run build && npm run test && npm version patch --no-git-tag-version && npm run release:ship",
|
|
52
53
|
"release:minor": "npm run build && npm run test && npm version minor --no-git-tag-version && npm run release:ship",
|
|
53
54
|
"release:major": "npm run build && npm run test && npm version major --no-git-tag-version && npm run release:ship",
|
|
54
|
-
"release:ship": "npm publish --access public && git add -A && git commit -m \"v$(node -p \"require('./package.json').version\")\" && git tag \"v$(node -p \"require('./package.json').version\")\" && git push && git push --tags",
|
|
55
55
|
"postinstall": "node dist/scripts/postinstall.js 2>/dev/null || true",
|
|
56
56
|
"preuninstall": "node dist/scripts/preuninstall.js 2>/dev/null || true",
|
|
57
57
|
"prepublishOnly": "npm run build:js",
|
|
58
58
|
"dev:install": "npm run build:js && npm install -g .",
|
|
59
59
|
"dev:uninstall": "npm uninstall -g opencode-orchestrator",
|
|
60
|
+
"dev:link": "npm run build:js && npm link",
|
|
61
|
+
"dev:unlink": "npm unlink -g opencode-orchestrator",
|
|
60
62
|
"util:stars": "gh api repos/agnusdei1207/opencode-orchestrator/stargazers --jq '.[].login'"
|
|
61
63
|
},
|
|
62
64
|
"dependencies": {
|