opencode-orchestrator 1.0.11 → 1.0.13

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
@@ -20,7 +20,7 @@ npm install -g opencode-orchestrator
20
20
 
21
21
  Then in OpenCode, launch your mission:
22
22
  ```bash
23
- /swarm "Architect and Build a Diablo-like Web Game"
23
+ /task "Architect and Build a Diablo-like Web Game"
24
24
  ```
25
25
 
26
26
  ### 🌌 **The End of Sequential Limits. The Era of Fractal Mastery.**
@@ -88,14 +88,22 @@ MSVP ensures continuous integration integrity by decoupling verification from th
88
88
  * **Global Barrier-Sync Protocol**: Implements a synchronized verification gate. The system enforces a blocking "Barrier" that requires consistency across all distributed units before transitioning to the final Master Review (E2E Integration) and Mission Sealing.
89
89
 
90
90
  ```
91
- /swarm "Build Complex System"
91
+ /task "Build Diablo Game"
92
92
 
93
93
  ╔═══════════════════════════════════════╗
94
94
  ║ 🎯 COMMANDER — Orchestrator ║
95
95
  ║ (Main Session - Single) ║
96
96
  ╚═══════════════════╤═══════════════════╝
97
97
 
98
- ┌───────────────────▼───────────────────┐
98
+ ══════════════════════════▼══════════════════════════
99
+ ║ 🚀 PHASE 0: DISCOVERY SWARM (Parallel) ║
100
+ ══════════════════════════════════════════════════════
101
+ │ │ │ │
102
+ ▼ Scout ▼ Scout ▼ Scout ▼ Scout
103
+ [Structure] [Stack] [Docs] [Infra]
104
+ └───────────────┬───────────────┬───────────────┘
105
+ │ Consolidate & Sync
106
+ ┌────────▼───────────────────┐
99
107
  │ 📋 PLANNER — Create Plan │
100
108
  │ → Outputs: Architectural Grid │
101
109
  └───────────────────┬───────────────────┘
package/dist/index.js CHANGED
@@ -631,7 +631,7 @@ var PROMPTS = {
631
631
 
632
632
  // src/shared/message/constants/slash-commands.ts
633
633
  var COMMAND_NAMES = {
634
- TASK: "swarm",
634
+ TASK: "task",
635
635
  PLAN: "plan",
636
636
  STATUS: "status",
637
637
  STOP: "stop",
@@ -13312,6 +13312,12 @@ tool.schema = external_exports;
13312
13312
  var ENVIRONMENT_DISCOVERY = `${PROMPT_TAGS.ENVIRONMENT_DISCOVERY.open}
13313
13313
  **MANDATORY FIRST STEP** - Before any planning or coding:
13314
13314
 
13315
+ ## \u26A1 Parallel Discovery Strategy
13316
+ To maximize cognitive velocity, execute Phase 0 as a **Parallel Discovery Swarm**:
13317
+ 1. **Delegate** independent scouts (background=true) for Structure, Stack, and Infra discovery.
13318
+ 2. **Consolidate** all empirical evidence once scouts complete their missions.
13319
+ 3. **Verify** findings against existing codebase before sealing the initial context.
13320
+
13315
13321
  ## 1. Project Structure Discovery
13316
13322
  Explore the project root to understand its organization:
13317
13323
  \`\`\`bash
@@ -13853,41 +13859,40 @@ ${PROMPT_TAGS.TOOLS.close}`;
13853
13859
 
13854
13860
  // src/agents/prompts/commander/execution.ts
13855
13861
  var COMMANDER_EXECUTION = `${PROMPT_TAGS.EXECUTION_STRATEGY.open}
13856
- ## Phase 0: ENVIRONMENT DISCOVERY (Never skip!)
13857
- 1. Initialize ${PATHS.OPENCODE}/ folder:
13858
- - If exists \u2192 DELETE and CREATE fresh
13859
- - If not exists \u2192 CREATE new
13860
- - This folder is for CONTEXT SHARING between agents
13861
- 2. Analyze project structure (ls, find)
13862
- 3. Read README.md, package.json, Dockerfile
13863
- 4. Identify build/test commands
13864
- 5. Save context to ${PATHS.CONTEXT}
13865
-
13866
- ## Phase 1: THINK (Mandatory - Never Skip!)
13867
- **THINK FIRST**: As ${AGENT_NAMES.COMMANDER}, think about ORCHESTRATION before action.
13868
-
13869
- ### 1.1 MISSION SCOPE
13870
- - What is the FULL scope of this mission?
13871
- - What are the deliverables and success criteria?
13872
- - What does the user REALLY want (not just what they said)?
13873
-
13874
- ### 1.2 DECOMPOSITION
13875
- - How can I break this into INDEPENDENT sub-tasks?
13876
- - Which tasks MUST be sequential (dependencies)?
13877
- - What is the MAXIMUM parallelism I can achieve?
13878
-
13879
- ### 1.3 DELEGATION
13880
- - Which agent is BEST for each task? (${AGENT_NAMES.PLANNER}/${AGENT_NAMES.WORKER}/${AGENT_NAMES.REVIEWER})
13881
- - What context does each agent NEED to succeed?
13882
- - What could cause an agent to FAIL or get stuck?
13862
+ ## Phase 0: STRATEGIC SCOUT SWARM (Parallel Intelligence)
13863
+ **Launch Intelligence Scouts** to map the terrain before any strategic decisions.
13864
+
13865
+ 1. **Initialize \`${PATHS.OPENCODE}\`/ folder**: Clean start for synchronized context.
13866
+ 2. **LAUNCH Scouts (background=true)**:
13867
+ - **[Scout: Structure]**: Map directory tree and file patterns.
13868
+ - **[Scout: Stack]**: Detect tech stack, build system, and dependencies.
13869
+ - **[Scout: Docs]**: Analyze README, API docs, and architectural conventions.
13870
+ - **[Scout: Infra]**: Identify CI/CD, Docker, and environment variables.
13871
+ 3. **RECOVER & RETRIEVE**: Monitor scouts. Once finished, **READ \`${PATHS.CONTEXT}\` and \`ls -R\` outputs** to ingest all findings.
13872
+
13873
+ ## Phase 1: COMMANDER'S INTEL ANALYSIS (Strategic Mandate)
13874
+ **THINK FIRST**: Do not just blindly delegate. Analyze the gathered intelligence to set the mission trajectory.
13875
+
13876
+ ### 1.1 ARCHITECTURAL ANALYSIS
13877
+ - Based on Phase 0 reports, what is the existing architecture?
13878
+ - What are the core constraints and patterns I MUST enforce?
13879
+ - Identify potential bottlenecks or high-risk areas.
13880
+
13881
+ ### 1.2 THE STRATEGIC MANDATE
13882
+ - Define the **MISSION CHARTER** for the ${AGENT_NAMES.PLANNER}.
13883
+ - What is the specific architectural goal?
13884
+ - What are the non-negotiable success criteria?
13885
+
13886
+ ### 1.3 DECOMPOSITION
13887
+ - Break the mission into INDEPENDENT parallel streams.
13888
+ - Define the maximum concurrency slots for this specific mission.
13883
13889
 
13884
13890
  ### 1.4 RISK ASSESSMENT
13885
13891
  - What are the HIGH-RISK parts of this mission?
13886
13892
  - What is my FALLBACK if a task fails?
13887
- - How will I DETECT and RECOVER from issues?
13888
13893
  - If agent fails \u2192 See ${PROMPT_TAGS.RECOVERY.open} section: DECOMPOSE and retry
13889
13894
 
13890
- **ANTI-PATTERNS**: Sequential execution when parallel is possible. Doing work yourself instead of delegating. Starting without clear decomposition.
13895
+ **ANTI-PATTERNS**: Starting without intellectual synthesis. Sequential execution when parallel is possible.
13891
13896
 
13892
13897
  ## Phase 2: TRIAGE
13893
13898
  | Type | Signal | Approach |
@@ -13906,10 +13911,11 @@ ${AGENT_NAMES.PLANNER} creates ${PATHS.TODO} with parallel groups
13906
13911
  4. CONTINUE with dependent tasks
13907
13912
  5. REPEAT until all [ ] become [x]
13908
13913
 
13909
- ## Phase 5: VERIFY
13910
- ${AGENT_NAMES.REVIEWER} validates ALL work
13911
- ${AGENT_NAMES.REVIEWER} runs tests, confirms pass
13912
- Only proceed to seal if PASS
13914
+ ## Phase 5: STAGE 2 INTEGRATION REVIEW (Final Gate)
13915
+ 1. **SYNC BARRIER**: Ensure all [Work + Stage 1 Review] pairs in ${PATHS.TODO} are SUCCESS.
13916
+ 2. **VERIFY INTEGRATION**: ${AGENT_NAMES.REVIEWER} validates cross-module consistency.
13917
+ 3. **E2E VALIDATION**: Run full system tests and build pass check.
13918
+ 4. Only proceed to SEAL if all criteria are met with zero regressions.
13913
13919
 
13914
13920
  ## Phase 6: SEAL
13915
13921
  When ALL conditions met, output ${MISSION_SEAL.PATTERN}
@@ -14611,14 +14617,15 @@ ADAPTIVE IMPLEMENTATION WORKFLOW
14611
14617
  8. Handle edge cases like existing code does
14612
14618
  9. Add tests matching project's test style
14613
14619
 
14614
- ## Phase 5: VERIFY (Before reporting)
14620
+ ## Phase 5: VERIFY & TRIGGER SHADOW REVIEW
14615
14621
  10. Run ${TOOL_NAMES.LSP_DIAGNOSTICS} \u2192 Must be clean
14622
+ 11. Run BUILD & TEST commands from ${PATHS.CONTEXT}
14623
+ 12. **TRIGGER STAGE 1 REVIEW**:
14624
+ - Before finishing, ${TOOL_NAMES.DELEGATE_TASK} to **${AGENT_NAMES.REVIEWER}** for unit verification.
14625
+ - Prompt: "Verify unit changes in [your module] for mission [mission_id]. Run tests and check diagnostics."
14626
+ 13. Report completion WITH evidence (test logs, review status).
14616
14627
 
14617
- 11. Run BUILD command from ${PATHS.CONTEXT}
14618
- 12. Run TEST command from ${PATHS.CONTEXT}
14619
- 13. Report completion WITH evidence
14620
-
14621
- **CRITICAL**: Do NOT mark [x] in ${PATHS.TODO} - that's ${AGENT_NAMES.REVIEWER}'s job!
14628
+ **CRITICAL**: Do NOT mark [x] in ${PATHS.TODO} - that's ${AGENT_NAMES.REVIEWER}'s job after Stage 2!
14622
14629
  ${PROMPT_TAGS.WORKFLOW.close}`;
14623
14630
 
14624
14631
  // src/agents/prompts/worker/quality.ts
@@ -15532,7 +15539,7 @@ $ARGUMENTS
15532
15539
  </execution_rules>
15533
15540
  </mission>`;
15534
15541
  var COMMANDS = {
15535
- "swarm": {
15542
+ "task": {
15536
15543
  description: "MISSION MODE - Execute task autonomously until complete",
15537
15544
  template: MISSION_MODE_TEMPLATE,
15538
15545
  argumentHint: '"mission goal"'
@@ -15593,7 +15600,7 @@ THINK \u2192 PLAN \u2192 DELEGATE \u2192 EXECUTE \u2192 VERIFY \u2192 COMPLETE
15593
15600
 
15594
15601
  ## Usage
15595
15602
  - Select **${AGENT_NAMES.COMMANDER}** and type your request
15596
- - Or use \`/swarm "your mission"\` explicitly
15603
+ - Or use \`/task "your mission"\` explicitly
15597
15604
  - ${AGENT_NAMES.COMMANDER} automatically coordinates all agents`
15598
15605
  }
15599
15606
  };
@@ -20549,7 +20556,7 @@ ${claudeRules}`;
20549
20556
  function detectSlashCommand(text) {
20550
20557
  const match = text.trim().match(/^\/([a-zA-Z0-9_-]+)(?:\s+(.*))?$/);
20551
20558
  if (!match) return null;
20552
- return { command: match[1], args: match[2] || "" };
20559
+ return { command: match[1].toLowerCase(), args: match[2] || "" };
20553
20560
  }
20554
20561
 
20555
20562
  // src/utils/formatting/timestamp.ts
@@ -20587,7 +20594,7 @@ function createChatMessageHandler(ctx) {
20587
20594
  if (sessionID) {
20588
20595
  handleUserMessage(sessionID);
20589
20596
  }
20590
- if (agentName === AGENT_NAMES.COMMANDER) {
20597
+ if (agentName === AGENT_NAMES.COMMANDER.toLowerCase()) {
20591
20598
  if (!sessions.has(sessionID)) {
20592
20599
  const now = Date.now();
20593
20600
  sessions.set(sessionID, {
@@ -20621,7 +20628,7 @@ function createChatMessageHandler(ctx) {
20621
20628
  }
20622
20629
  if (parsed) {
20623
20630
  const command = COMMANDS[parsed.command];
20624
- if (command && agentName !== AGENT_NAMES.COMMANDER) {
20631
+ if (command && agentName !== AGENT_NAMES.COMMANDER.toLowerCase()) {
20625
20632
  parts[textPartIndex].text = command.template.replace(
20626
20633
  /\$ARGUMENTS/g,
20627
20634
  parsed.args || PROMPTS.CONTINUE
@@ -2,7 +2,7 @@
2
2
  * Slash Commands (with slash prefix)
3
3
  */
4
4
  export declare const SLASH_COMMANDS: {
5
- readonly TASK: "/swarm";
5
+ readonly TASK: "/task";
6
6
  readonly PLAN: "/plan";
7
7
  readonly STATUS: "/status";
8
8
  readonly STOP: "/stop";
@@ -12,7 +12,7 @@ export declare const SLASH_COMMANDS: {
12
12
  * Command Names (without slash prefix, for comparison after parsing)
13
13
  */
14
14
  export declare const COMMAND_NAMES: {
15
- readonly TASK: "swarm";
15
+ readonly TASK: "task";
16
16
  readonly PLAN: "plan";
17
17
  readonly STATUS: "status";
18
18
  readonly STOP: "stop";
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": "1.0.11",
5
+ "version": "1.0.13",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {