opencode-orchestrator 1.0.34 → 1.0.36

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
@@ -23,50 +23,17 @@ In an OpenCode environment:
23
23
 
24
24
  ## Overview
25
25
 
26
- OpenCode Orchestrator is a framework designed to manage complex software engineering tasks through parallel multi-agent execution. It extends the capabilities of standard AI agents by introducing a hierarchical delegation model and a multi-stage verification pipeline.
27
-
28
- ### Key Characteristics
29
- * **Parallel Execution**: Manages multiple concurrent agent sessions to accelerate development.
30
- * **Hierarchical Delegation**: Supports recursive task decomposition (Fractal Spawning) for complex requirements.
31
- * **Integrated Verification**: Employs a multi-stage pipeline (Unit & Integration) to ensure code quality.
32
- * **Persistent State**: Uses structured logging to maintain state and recover from interruptions.
33
-
34
- ---
35
-
36
- ## Core Philosophy: Adaptive Engineering
37
-
38
- The orchestrator follows an **Explore → Learn → Adapt → Act** cycle to ensure agents remain grounded in the project's specific context.
39
-
40
- * **Explore**: Systematically discover the project structure, tech stack, and documentation.
41
- * **Learn**: Extract existing patterns, naming conventions, and architectural decisions from the codebase.
42
- * **Adapt**: Adjust implementation strategies and verification parameters based on learned context.
43
- * **Act**: Execute tasks through parallel delegation with evidence-based verification.
44
-
45
- ---
46
-
47
- ## 🏗️ Architecture
48
-
49
- The system is built upon two core mechanisms that handle scaling and quality control.
50
-
51
- ### HPFA (Hyper-Parallel Fractal Architecture)
52
- HPFA is a parallel execution model that enables task decomposition at scale.
53
- * **Managed Concurrency**: Orchestrates up to 50 parallel agent sessions simultaneously.
54
- * **Recursive Scaling**: Allows "Worker" agents to spawn sub-workers for modular tasks, ensuring deep architectural coverage.
55
-
56
- ### MSVP (Multi-Stage Verification Pipeline)
57
- MSVP is a structured verification process that decouples implementation from quality assurance.
58
- * **Stage 1 (Unit Verification)**: Reviewers validate individual module changes and run local tests immediately after implementation.
59
- * **Stage 2 (Integration Review)**: A master reviewer verifies cross-module consistency and system integrity after all individual units are completed.
26
+ OpenCode Orchestrator manages complex software tasks through **parallel multi-agent execution**. Commander orchestrates Workers and Reviewers to implement and verify code concurrently.
60
27
 
61
28
  ---
62
29
 
63
- ## 📊 Workflow Diagram
30
+ ## 📊 Workflow
64
31
 
65
32
  ```text
66
33
  [User Task Input]
67
34
 
68
35
  ┌─────────▼─────────┐
69
- │ COMMANDER │ (Orchestration & Discovery)
36
+ │ COMMANDER │ (Orchestration)
70
37
  └─────────┬─────────┘
71
38
 
72
39
  ┌─────────▼─────────┐
@@ -78,7 +45,7 @@ MSVP is a structured verification process that decouples implementation from qua
78
45
  └──────┬─────────┬─────────┬──────┘
79
46
  │ │ │
80
47
  ┌──────▼──┐ ┌────▼───┐ ┌───▼────┐
81
- │ WORKER A│ │ WORKER B│ │ WORKER C (Implementation)
48
+ │ WORKER │ │ WORKER │ │ WORKER │
82
49
  └──────┬──┘ └────┬───┘ └────┬────┘
83
50
  │ │ │
84
51
  ╔══════▼═════════▼══════════▼══════╗
@@ -86,44 +53,39 @@ MSVP is a structured verification process that decouples implementation from qua
86
53
  ╚══════╤═════════╤══════════╤══════╝
87
54
  │ │ │
88
55
  ┌──────▼──┐ ┌────▼───┐ ┌────▼────┐
89
- │REVIEWER │ │REVIEWER │ │REVIEWER │ (Unit Verification)
56
+ │REVIEWER │ │REVIEWER │ │REVIEWER │
90
57
  └──────┬──┘ └────┬───┘ └────┬────┘
91
58
  │ │ │
92
- ═══════▼═════════▼══════════▼══════
93
- SYNC BARRIER
94
- ════════════════╤══════════════════
95
-
96
- ┌─────────▼─────────┐
97
- │ MASTER REVIEWER │ (E2E Verification)
98
- └─────────┬─────────┘
99
-
100
- ┌─────────▼─────────┐
101
- │ Mission Sealed? │
102
- └─────────┬─────────┘
103
- No ↙ ↘ Yes
104
- [Loop] [Complete]
59
+ ═▼═════════▼══════════▼═
60
+ SYNC BARRIER
61
+ ═══════════╤═══════════
62
+
63
+ ┌─────────▼─────────┐
64
+ │ MASTER REVIEWER │ (E2E Verification)
65
+ └─────────┬─────────┘
66
+
67
+ [MISSION SEALED]
105
68
  ```
106
69
 
107
70
  ---
108
71
 
109
- ## 🚀 System Roles
72
+ ## 🚀 Agents
110
73
 
111
- | Role | Responsibility | Key Actions |
112
- |:-----|:---------------|:------------|
113
- | **Commander** | Mission Control | Task assignment, conflict resolution, global synchronization |
114
- | **Planner** | Architecture | Environment analysis, dependency mapping, TODO generation |
115
- | **Worker** | Implementation | Code writing, file modification, unit test creation |
116
- | **Reviewer** | Quality Control| Static analysis, build verification, integration testing |
74
+ | Agent | Role |
75
+ |:------|:-----|
76
+ | **Commander** | Orchestrates all agents, manages task flow |
77
+ | **Planner** | Creates TODO.md with task breakdown |
78
+ | **Worker** | Implements features, writes tests |
79
+ | **Reviewer** | Validates code, runs verification |
117
80
 
118
81
  ---
119
82
 
120
- ## 🛠️ Features
83
+ ## Key Features
121
84
 
122
- * **Concurrent Task Management**: Efficiently handles up to 50 background agent sessions.
123
- * **Automated Context Synthesis**: Parallel scouters gather environment intelligence (Structure, Stack, Docs) instantly.
124
- * **Synchronized Verification**: Ensures all distributed tasks pass Stage 1 review before final integration.
125
- * **Fault Tolerance**: Automatically resumes progress from checkpoints in case of tool or session failure.
126
- * **Context Optimization**: Monitors context window limits and performs automated compaction for long sessions.
85
+ - **Parallel Execution**: Up to 50 concurrent agent sessions
86
+ - **Two-Stage Verification**: Unit review Master review Seal
87
+ - **Fault Tolerance**: Auto-recovery from failures
88
+ - **Context Optimization**: Manages token limits automatically
127
89
 
128
90
  ---
129
91
 
@@ -2,5 +2,6 @@
2
2
  * Reviewer Forbidden Actions
3
3
  *
4
4
  * Verification integrity - never approve without evidence.
5
+ * Reviewer is a TERMINAL node and cannot spawn other agents.
5
6
  */
6
7
  export declare const REVIEWER_FORBIDDEN: string;
@@ -2,5 +2,6 @@
2
2
  * Worker Forbidden Actions
3
3
  *
4
4
  * Universal anti-patterns - adapt to project-specific conventions.
5
+ * Worker is a TERMINAL node and cannot spawn other agents.
5
6
  */
6
7
  export declare const WORKER_FORBIDDEN: string;
package/dist/index.js CHANGED
@@ -990,6 +990,30 @@ var SCOUT_INTEGRATION = {
990
990
  PROMPT: "Read all modified files and their cross-module dependencies in parallel. Map the actual integration surface and identify potential consistency issues."
991
991
  };
992
992
 
993
+ // src/shared/prompt/constants/architecture.ts
994
+ var AGENT_ROLES = {
995
+ /** Only Commander can spawn other agents */
996
+ SPAWNER: AGENT_NAMES.COMMANDER,
997
+ /** Terminal agents cannot spawn any sub-agents */
998
+ TERMINAL_AGENTS: [AGENT_NAMES.PLANNER, AGENT_NAMES.WORKER, AGENT_NAMES.REVIEWER]
999
+ };
1000
+ var TERMINAL_NODE = {
1001
+ /** Label for terminal node concept */
1002
+ LABEL: "TERMINAL node",
1003
+ /** Reason why terminal nodes can't spawn */
1004
+ REASON: "prevents infinite recursion",
1005
+ /** What to do instead of spawning */
1006
+ ALTERNATIVE: `Report back to ${AGENT_NAMES.COMMANDER} with specific blockers`
1007
+ };
1008
+ var SPAWNING_RULES = {
1009
+ /** Who can spawn */
1010
+ SPAWNER_ONLY: `${AGENT_NAMES.COMMANDER} is the ONLY agent who can spawn other agents`,
1011
+ /** What terminal nodes should do */
1012
+ TERMINAL_BEHAVIOR: `Complete your assigned task directly without delegation`,
1013
+ /** Error message for blocked spawn attempts */
1014
+ BLOCKED_MESSAGE: `You are a ${TERMINAL_NODE.LABEL} - ${TERMINAL_NODE.REASON}`
1015
+ };
1016
+
993
1017
  // src/core/agents/consts/task-status.const.ts
994
1018
  var TASK_STATUS = {
995
1019
  PENDING: STATUS_LABEL.PENDING,
@@ -14298,8 +14322,8 @@ var PLANNER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
14298
14322
  ## \u26D4 NEVER Spawn or Delegate (CRITICAL)
14299
14323
  - NEVER use \`${TOOL_NAMES.DELEGATE_TASK}\` to spawn agents
14300
14324
  - NEVER use \`${TOOL_NAMES.CALL_AGENT}\` to create sessions
14301
- - You are a TERMINAL node - create plans, don't execute them
14302
- - ${AGENT_NAMES.COMMANDER} is the ONLY agent who can spawn Workers/Reviewers
14325
+ - You are a ${TERMINAL_NODE.LABEL} - create plans, don't execute them
14326
+ - ${SPAWNING_RULES.SPAWNER_ONLY}
14303
14327
 
14304
14328
  ## Never Implement
14305
14329
  - NEVER write actual code \u2192 Only plan and research
@@ -14608,9 +14632,9 @@ var WORKER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
14608
14632
  ## \u26D4 NEVER Spawn or Delegate (CRITICAL)
14609
14633
  - NEVER use \`${TOOL_NAMES.DELEGATE_TASK}\` to spawn sub-workers
14610
14634
  - NEVER use \`${TOOL_NAMES.CALL_AGENT}\` to create additional sessions
14611
- - You are a TERMINAL node - complete your assigned file directly
14612
- - If task is too complex, REPORT BACK to ${AGENT_NAMES.COMMANDER} with specific blockers
14613
- - Violating this rule causes infinite recursion and system failure
14635
+ - You are a ${TERMINAL_NODE.LABEL} - ${SPAWNING_RULES.TERMINAL_BEHAVIOR}
14636
+ - If task is too complex, ${TERMINAL_NODE.ALTERNATIVE}
14637
+ - Violating this rule ${TERMINAL_NODE.REASON}
14614
14638
 
14615
14639
  ## Never Assume
14616
14640
  - NEVER guess API syntax \u2192 CHECK ${PATHS.DOCS}/ or research first
@@ -15036,9 +15060,9 @@ var REVIEWER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
15036
15060
  ## \u26D4 NEVER Spawn or Delegate (CRITICAL)
15037
15061
  - NEVER use \`${TOOL_NAMES.DELEGATE_TASK}\` to spawn additional reviewers
15038
15062
  - NEVER use \`${TOOL_NAMES.CALL_AGENT}\` to create sub-sessions
15039
- - You are a TERMINAL node - verify your assigned file directly
15040
- - If verification scope is too large, REPORT BACK to ${AGENT_NAMES.COMMANDER}
15041
- - Violating this rule causes infinite recursion and blocks Master Review
15063
+ - You are a ${TERMINAL_NODE.LABEL} - verify your assigned file directly
15064
+ - If verification scope is too large, ${TERMINAL_NODE.ALTERNATIVE}
15065
+ - Violating this rule ${TERMINAL_NODE.REASON}
15042
15066
 
15043
15067
  ## Never Approve Without Verification
15044
15068
  - NEVER approve without actually running the project's test command
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Architecture Rules - Core system behavior constants
3
+ *
4
+ * These define the immutable rules about agent hierarchy and spawning.
5
+ * Used by prompts to ensure consistent messaging across all agents.
6
+ */
7
+ /**
8
+ * Agent hierarchy roles
9
+ */
10
+ export declare const AGENT_ROLES: {
11
+ /** Only Commander can spawn other agents */
12
+ readonly SPAWNER: "Commander";
13
+ /** Terminal agents cannot spawn any sub-agents */
14
+ readonly TERMINAL_AGENTS: readonly ["Planner", "Worker", "Reviewer"];
15
+ };
16
+ /**
17
+ * Terminal node messaging - used in forbidden actions
18
+ */
19
+ export declare const TERMINAL_NODE: {
20
+ /** Label for terminal node concept */
21
+ readonly LABEL: "TERMINAL node";
22
+ /** Reason why terminal nodes can't spawn */
23
+ readonly REASON: "prevents infinite recursion";
24
+ /** What to do instead of spawning */
25
+ readonly ALTERNATIVE: "Report back to Commander with specific blockers";
26
+ };
27
+ /**
28
+ * Spawning restriction messages
29
+ */
30
+ export declare const SPAWNING_RULES: {
31
+ /** Who can spawn */
32
+ readonly SPAWNER_ONLY: "Commander is the ONLY agent who can spawn other agents";
33
+ /** What terminal nodes should do */
34
+ readonly TERMINAL_BEHAVIOR: "Complete your assigned task directly without delegation";
35
+ /** Error message for blocked spawn attempts */
36
+ readonly BLOCKED_MESSAGE: "You are a TERMINAL node - prevents infinite recursion";
37
+ };
38
+ /**
39
+ * Core architecture rules as a single exportable constant
40
+ */
41
+ export declare const ARCHITECTURE_RULES: {
42
+ readonly AGENT_ROLES: {
43
+ /** Only Commander can spawn other agents */
44
+ readonly SPAWNER: "Commander";
45
+ /** Terminal agents cannot spawn any sub-agents */
46
+ readonly TERMINAL_AGENTS: readonly ["Planner", "Worker", "Reviewer"];
47
+ };
48
+ readonly TERMINAL_NODE: {
49
+ /** Label for terminal node concept */
50
+ readonly LABEL: "TERMINAL node";
51
+ /** Reason why terminal nodes can't spawn */
52
+ readonly REASON: "prevents infinite recursion";
53
+ /** What to do instead of spawning */
54
+ readonly ALTERNATIVE: "Report back to Commander with specific blockers";
55
+ };
56
+ readonly SPAWNING_RULES: {
57
+ /** Who can spawn */
58
+ readonly SPAWNER_ONLY: "Commander is the ONLY agent who can spawn other agents";
59
+ /** What terminal nodes should do */
60
+ readonly TERMINAL_BEHAVIOR: "Complete your assigned task directly without delegation";
61
+ /** Error message for blocked spawn attempts */
62
+ readonly BLOCKED_MESSAGE: "You are a TERMINAL node - prevents infinite recursion";
63
+ };
64
+ };
@@ -6,3 +6,4 @@ export { WORK_STATUS } from "./status.js";
6
6
  export { PHILOSOPHY_PHASES, PHILOSOPHY_TAGLINE, PHILOSOPHY_QUOTE, PHILOSOPHY_LEARN_PRINCIPLE, EXECUTION_CYCLE, EXECUTION_CYCLE_STEPS, } from "./philosophy.js";
7
7
  export { PHASE_0_DIRECT_DISCOVERY, PHASE_1_THINK_ANALYSIS, PHASE_5_MSVP, HPFA_RULES } from "./mandates.js";
8
8
  export { SCOUT_LABEL, SCOUT_STRUCTURE, SCOUT_STACK, SCOUT_DOCS, SCOUT_INFRA, SCOUT_INTEGRATION } from "./scouts.js";
9
+ export { AGENT_ROLES, TERMINAL_NODE, SPAWNING_RULES, ARCHITECTURE_RULES, } from "./architecture.js";
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.34",
5
+ "version": "1.0.36",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {