opencode-orchestrator 1.0.30 → 1.0.33
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
|
@@ -66,42 +66,38 @@ MSVP is a structured verification process that decouples implementation from qua
|
|
|
66
66
|
[User Task Input]
|
|
67
67
|
│
|
|
68
68
|
┌─────────▼─────────┐
|
|
69
|
-
│ COMMANDER │
|
|
69
|
+
│ COMMANDER │ (Orchestration & Discovery)
|
|
70
70
|
└─────────┬─────────┘
|
|
71
71
|
│
|
|
72
|
-
┌────────────────▼────────────────┐
|
|
73
|
-
│ Phase 0: Parallel Discovery │ (Structure, Tech Stack, Docs, Infra)
|
|
74
|
-
└────────────────┬────────────────┘
|
|
75
|
-
│
|
|
76
72
|
┌─────────▼─────────┐
|
|
77
|
-
│ PLANNER │
|
|
73
|
+
│ PLANNER │ (Create TODO.md)
|
|
78
74
|
└─────────┬─────────┘
|
|
79
75
|
│
|
|
80
76
|
┌────────────────▼────────────────┐
|
|
81
|
-
│
|
|
77
|
+
│ COMMANDER: Parallel Launch │
|
|
82
78
|
└──────┬─────────┬─────────┬──────┘
|
|
83
79
|
│ │ │
|
|
84
80
|
┌──────▼──┐ ┌────▼───┐ ┌───▼────┐
|
|
85
|
-
│ WORKER
|
|
86
|
-
|
|
87
|
-
│
|
|
88
|
-
|
|
89
|
-
│
|
|
90
|
-
|
|
91
|
-
│
|
|
92
|
-
|
|
93
|
-
│
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
│ WORKER A│ │ WORKER B│ │ WORKER C│ (Implementation)
|
|
82
|
+
└────┬────┘ └────┬───┘ └────┬────┘
|
|
83
|
+
│ │ │
|
|
84
|
+
┌────▼────┐ ┌────▼───┐ ┌────▼────┐
|
|
85
|
+
│REVIEWER │ │REVIEWER │ │REVIEWER │ (Unit Verification)
|
|
86
|
+
└────┬────┘ └────┬───┘ └────┬────┘
|
|
87
|
+
│ │ │
|
|
88
|
+
═════▼═══════════▼══════════▼══════
|
|
89
|
+
│ SYNC BARRIER │
|
|
90
|
+
════════════════╤══════════════════
|
|
91
|
+
│
|
|
92
|
+
┌─────────▼─────────┐
|
|
93
|
+
│ MASTER REVIEWER │ (E2E Verification)
|
|
94
|
+
└─────────┬─────────┘
|
|
95
|
+
│
|
|
96
|
+
┌─────────▼─────────┐
|
|
97
|
+
│ Mission Sealed? │
|
|
98
|
+
└─────────┬─────────┘
|
|
99
|
+
No ↙ ↘ Yes
|
|
100
|
+
[Loop] [Complete]
|
|
105
101
|
```
|
|
106
102
|
|
|
107
103
|
---
|
package/dist/index.js
CHANGED
|
@@ -334,8 +334,24 @@ var PARALLEL_TASK = {
|
|
|
334
334
|
// Task lifecycle (24 hours for long tasks)
|
|
335
335
|
TTL_MS: 24 * TIME.HOUR,
|
|
336
336
|
CLEANUP_DELAY_MS: 10 * TIME.MINUTE,
|
|
337
|
-
|
|
338
|
-
|
|
337
|
+
/**
|
|
338
|
+
* Maximum recursion depth for parallel task spawning
|
|
339
|
+
*
|
|
340
|
+
* Depth hierarchy:
|
|
341
|
+
* - Depth 0: Commander (can spawn Planner/Worker/Reviewer)
|
|
342
|
+
* - Depth 1: Planner (can spawn Worker)
|
|
343
|
+
* - Depth 2: Worker/Reviewer (TERMINAL - cannot spawn sub-agents)
|
|
344
|
+
* - Depth 3: BLOCKED
|
|
345
|
+
*
|
|
346
|
+
* This prevents infinite recursion and ensures Master Reviewer
|
|
347
|
+
* doesn't wait indefinitely for deeply nested sub-tasks.
|
|
348
|
+
*/
|
|
349
|
+
MAX_DEPTH: 3,
|
|
350
|
+
/**
|
|
351
|
+
* Terminal node depth - agents at this depth cannot spawn sub-agents.
|
|
352
|
+
* Worker and Reviewer are terminal nodes by design.
|
|
353
|
+
*/
|
|
354
|
+
TERMINAL_DEPTH: 2,
|
|
339
355
|
// Concurrency limits (Aggressive for intense processing)
|
|
340
356
|
DEFAULT_CONCURRENCY: 10,
|
|
341
357
|
MAX_CONCURRENCY: 50,
|
|
@@ -907,46 +923,16 @@ var PHILOSOPHY_TAGLINE = "Explore \u2192 Learn \u2192 Adapt \u2192 Act";
|
|
|
907
923
|
var PHILOSOPHY_QUOTE = "Like an astronaut landing on unknown planets \u2014 never assume, always discover.";
|
|
908
924
|
var PHILOSOPHY_LEARN_PRINCIPLE = "LEARN = DOCUMENT: What you discover, you record. Your learnings become the team's knowledge.";
|
|
909
925
|
|
|
910
|
-
// src/shared/prompt/constants/scouts.ts
|
|
911
|
-
var SCOUT_LABEL = "Scout";
|
|
912
|
-
var SCOUT_STRUCTURE = {
|
|
913
|
-
ID: "STRUCTURE",
|
|
914
|
-
NAME: `${SCOUT_LABEL}: Structure`,
|
|
915
|
-
PROMPT: "Analyze the project folder structure. Locate source code (src, lib), tests, and documentation directories. Map out the tree at depth 2-3."
|
|
916
|
-
};
|
|
917
|
-
var SCOUT_STACK = {
|
|
918
|
-
ID: "STACK",
|
|
919
|
-
NAME: `${SCOUT_LABEL}: Stack`,
|
|
920
|
-
PROMPT: "Identify the technology stack. Parse package.json, Cargo.toml, go.mod, or pyproject.toml. Determine build and test commands."
|
|
921
|
-
};
|
|
922
|
-
var SCOUT_DOCS = {
|
|
923
|
-
ID: "DOCS",
|
|
924
|
-
NAME: `${SCOUT_LABEL}: Docs`,
|
|
925
|
-
PROMPT: "Digest the project documentation. Read README.md, CONTRIBUTING.md, and any files in docs/ to understand the core architecture and mission."
|
|
926
|
-
};
|
|
927
|
-
var SCOUT_INFRA = {
|
|
928
|
-
ID: "INFRA",
|
|
929
|
-
NAME: `${SCOUT_LABEL}: Infra`,
|
|
930
|
-
PROMPT: "Detect infrastructure and environment configs. Search for Dockerfiles, CI/CD workflows (.github, .gitlab), and environment variable templates."
|
|
931
|
-
};
|
|
932
|
-
var SCOUT_INTEGRATION = {
|
|
933
|
-
ID: "INTEGRATION",
|
|
934
|
-
NAME: `${SCOUT_LABEL}: Integration`,
|
|
935
|
-
PROMPT: "Read all modified files and their cross-module dependencies in parallel. Map the actual integration surface and identify potential consistency issues."
|
|
936
|
-
};
|
|
937
|
-
|
|
938
926
|
// src/shared/prompt/constants/mandates.ts
|
|
939
|
-
var
|
|
927
|
+
var PHASE_0_DIRECT_DISCOVERY = `**Direct Project Discovery**: Read the project directly to understand it.
|
|
940
928
|
|
|
941
|
-
1. **
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
2. **PARALLEL SYNC**: Use \`${TOOL_NAMES.LIST_TASKS}\` to monitor progress.
|
|
947
|
-
3. **ONE-PASS INGESTION**: Once all scouts show DONE, use \`${TOOL_NAMES.GET_TASK_RESULT}\` for ALL scouts in a single turn to consolidate findings into \`${PATHS.CONTEXT}\`.
|
|
929
|
+
1. **STRUCTURE**: Run \`ls -la\` and \`find . -maxdepth 2 -type d | head -30\` to map the project layout.
|
|
930
|
+
2. **STACK**: Read config files (package.json, Cargo.toml, go.mod, etc.) to identify build/test commands.
|
|
931
|
+
3. **DOCS**: Read README.md and key documentation to understand the architecture.
|
|
932
|
+
4. **INFRA**: Check for Dockerfile, CI/CD configs, and infrastructure files.
|
|
933
|
+
5. **CONSOLIDATE**: Save findings to \`${PATHS.CONTEXT}\`.
|
|
948
934
|
|
|
949
|
-
[
|
|
935
|
+
[EFFICIENT]: Direct reading is faster and cheaper than delegating to parallel scouts.`;
|
|
950
936
|
var PHASE_1_THINK_ANALYSIS = `### 1.1 ANALYZE & SCOPE (INPUT)
|
|
951
937
|
- **Review consolidated ${PATHS.CONTEXT} from Phase 0.**
|
|
952
938
|
- Map discovered files to the user's request.
|
|
@@ -966,16 +952,43 @@ var PHASE_1_THINK_ANALYSIS = `### 1.1 ANALYZE & SCOPE (INPUT)
|
|
|
966
952
|
- Identify high-risk parts and fallback plans.
|
|
967
953
|
- If agent fails \u2192 See RECOVERY section.`;
|
|
968
954
|
var PHASE_5_MSVP = `1. **STAGE 1 (Unit)**: Workers MUST trigger ${AGENT_NAMES.REVIEWER} for unit verification immediately upon completion.
|
|
969
|
-
2. **
|
|
970
|
-
3. **
|
|
971
|
-
4. **
|
|
972
|
-
5. **SEAL GATE**: No SEALED output until ${PATHS.TODO} is all [x] and zero issues remain.`;
|
|
955
|
+
2. **STAGE 2 (Integration Master)**: The Master ${AGENT_NAMES.REVIEWER} directly reads all modified files and validates cross-module consistency.
|
|
956
|
+
3. **E2E VALIDATION**: Run full system tests and build pass check.
|
|
957
|
+
4. **SEAL GATE**: No SEALED output until ${PATHS.TODO} is all [x] and zero issues remain.`;
|
|
973
958
|
var HPFA_RULES = `1. **Fractal Spawning**: Workers spawn sub-workers for complex files/modules.
|
|
974
959
|
2. **Speculative Racing**: Launch multiple strategies in parallel (mode: race) for uncertainty.
|
|
975
960
|
3. **Asynchronous Batching**: Group non-dependent tool calls to trigger host-side parallelism.
|
|
976
961
|
4. **Barrier-Sync Pipeline**: Reviewers start Unit Review (Stage 1) while other workers still run.
|
|
977
962
|
5. **Real-time Brain Sync**: Parallel sessions share public interfaces via shared task logs.`;
|
|
978
963
|
|
|
964
|
+
// src/shared/prompt/constants/scouts.ts
|
|
965
|
+
var SCOUT_LABEL = "Scout";
|
|
966
|
+
var SCOUT_STRUCTURE = {
|
|
967
|
+
ID: "STRUCTURE",
|
|
968
|
+
NAME: `${SCOUT_LABEL}: Structure`,
|
|
969
|
+
PROMPT: "Analyze the project folder structure. Locate source code (src, lib), tests, and documentation directories. Map out the tree at depth 2-3."
|
|
970
|
+
};
|
|
971
|
+
var SCOUT_STACK = {
|
|
972
|
+
ID: "STACK",
|
|
973
|
+
NAME: `${SCOUT_LABEL}: Stack`,
|
|
974
|
+
PROMPT: "Identify the technology stack. Parse package.json, Cargo.toml, go.mod, or pyproject.toml. Determine build and test commands."
|
|
975
|
+
};
|
|
976
|
+
var SCOUT_DOCS = {
|
|
977
|
+
ID: "DOCS",
|
|
978
|
+
NAME: `${SCOUT_LABEL}: Docs`,
|
|
979
|
+
PROMPT: "Digest the project documentation. Read README.md, CONTRIBUTING.md, and any files in docs/ to understand the core architecture and mission."
|
|
980
|
+
};
|
|
981
|
+
var SCOUT_INFRA = {
|
|
982
|
+
ID: "INFRA",
|
|
983
|
+
NAME: `${SCOUT_LABEL}: Infra`,
|
|
984
|
+
PROMPT: "Detect infrastructure and environment configs. Search for Dockerfiles, CI/CD workflows (.github, .gitlab), and environment variable templates."
|
|
985
|
+
};
|
|
986
|
+
var SCOUT_INTEGRATION = {
|
|
987
|
+
ID: "INTEGRATION",
|
|
988
|
+
NAME: `${SCOUT_LABEL}: Integration`,
|
|
989
|
+
PROMPT: "Read all modified files and their cross-module dependencies in parallel. Map the actual integration surface and identify potential consistency issues."
|
|
990
|
+
};
|
|
991
|
+
|
|
979
992
|
// src/core/agents/consts/task-status.const.ts
|
|
980
993
|
var TASK_STATUS = {
|
|
981
994
|
PENDING: STATUS_LABEL.PENDING,
|
|
@@ -13427,11 +13440,13 @@ tool.schema = external_exports;
|
|
|
13427
13440
|
var ENVIRONMENT_DISCOVERY = `${PROMPT_TAGS.ENVIRONMENT_DISCOVERY.open}
|
|
13428
13441
|
**MANDATORY FIRST STEP** - Before any planning or coding:
|
|
13429
13442
|
|
|
13430
|
-
## \u26A1
|
|
13431
|
-
|
|
13432
|
-
1. **
|
|
13433
|
-
2. **
|
|
13434
|
-
3. **Verify** findings against existing codebase
|
|
13443
|
+
## \u26A1 Direct Discovery (Efficient)
|
|
13444
|
+
Read the project directly - this is faster and cheaper than delegating to parallel scouts:
|
|
13445
|
+
1. **Read** project structure, config files, and documentation directly.
|
|
13446
|
+
2. **Document** all findings to \`${PATHS.CONTEXT}\`.
|
|
13447
|
+
3. **Verify** findings against existing codebase.
|
|
13448
|
+
|
|
13449
|
+
[NOTE]: Direct reading saves tokens and avoids parallel wait overhead.
|
|
13435
13450
|
|
|
13436
13451
|
## 1. Project Structure Discovery
|
|
13437
13452
|
Explore the project root to understand its organization:
|
|
@@ -13949,8 +13964,8 @@ ${PROMPT_TAGS.TOOLS.close}`;
|
|
|
13949
13964
|
|
|
13950
13965
|
// src/agents/prompts/commander/execution.ts
|
|
13951
13966
|
var COMMANDER_EXECUTION = `${PROMPT_TAGS.EXECUTION_STRATEGY.open}
|
|
13952
|
-
## ${PHASES.PHASE_0.ID}: ${PHASES.PHASE_0.NAME} (
|
|
13953
|
-
${
|
|
13967
|
+
## ${PHASES.PHASE_0.ID}: ${PHASES.PHASE_0.NAME} (Direct Discovery)
|
|
13968
|
+
${PHASE_0_DIRECT_DISCOVERY}
|
|
13954
13969
|
|
|
13955
13970
|
## ${PHASES.PHASE_1.ID}: ${PHASES.PHASE_1.NAME} (Mandatory - Never Skip!)
|
|
13956
13971
|
**THINK FIRST**: As ${AGENT_NAMES.COMMANDER}, think about ORCHESTRATION and synthesis before action.
|
|
@@ -14586,7 +14601,12 @@ ${PROMPT_TAGS.ROLE.close}`;
|
|
|
14586
14601
|
var WORKER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
14587
14602
|
**FORBIDDEN ACTIONS (Adapt to Project Conventions)**
|
|
14588
14603
|
|
|
14589
|
-
|
|
14604
|
+
## \u26D4 NEVER Spawn or Delegate (CRITICAL)
|
|
14605
|
+
- NEVER use \`${TOOL_NAMES.DELEGATE_TASK}\` to spawn sub-workers
|
|
14606
|
+
- NEVER use \`${TOOL_NAMES.CALL_AGENT}\` to create additional sessions
|
|
14607
|
+
- You are a TERMINAL node - complete your assigned file directly
|
|
14608
|
+
- If task is too complex, REPORT BACK to ${AGENT_NAMES.COMMANDER} with specific blockers
|
|
14609
|
+
- Violating this rule causes infinite recursion and system failure
|
|
14590
14610
|
|
|
14591
14611
|
## Never Assume
|
|
14592
14612
|
- NEVER guess API syntax \u2192 CHECK ${PATHS.DOCS}/ or research first
|
|
@@ -14596,7 +14616,6 @@ var WORKER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
|
14596
14616
|
## Never Skip
|
|
14597
14617
|
- NEVER skip error handling \u2192 Follow project's error handling patterns
|
|
14598
14618
|
- NEVER skip ${TOOL_NAMES.LSP_DIAGNOSTICS} \u2192 Always verify code compiles
|
|
14599
|
-
|
|
14600
14619
|
- NEVER skip verification \u2192 Test before claiming done
|
|
14601
14620
|
|
|
14602
14621
|
## Never Shortcut
|
|
@@ -15001,16 +15020,21 @@ ${PHASE_5_MSVP}
|
|
|
15001
15020
|
|
|
15002
15021
|
### Role Specialization
|
|
15003
15022
|
1. **UNIT REVIEW (Stage 1)**: Triggered by Workers. Focus on local file correctness and unit tests.
|
|
15004
|
-
2. **MASTER REVIEW (Stage 2)**: Triggered by Commander in Phase 5.
|
|
15023
|
+
2. **MASTER REVIEW (Stage 2)**: Triggered by Commander in Phase 5. Read modified files directly and focus on cross-module consistency and system-wide integration.
|
|
15005
15024
|
|
|
15006
|
-
[CRITICAL]: As Master Reviewer,
|
|
15025
|
+
[CRITICAL]: As Master Reviewer, read all modified files directly from ${PATHS.WORK_LOG} before making a verdict.
|
|
15007
15026
|
${PROMPT_TAGS.ROLE.close}`;
|
|
15008
15027
|
|
|
15009
15028
|
// src/agents/prompts/reviewer/forbidden.ts
|
|
15010
15029
|
var REVIEWER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
15011
15030
|
**FORBIDDEN ACTIONS**
|
|
15012
15031
|
|
|
15013
|
-
|
|
15032
|
+
## \u26D4 NEVER Spawn or Delegate (CRITICAL)
|
|
15033
|
+
- NEVER use \`${TOOL_NAMES.DELEGATE_TASK}\` to spawn additional reviewers
|
|
15034
|
+
- NEVER use \`${TOOL_NAMES.CALL_AGENT}\` to create sub-sessions
|
|
15035
|
+
- You are a TERMINAL node - verify your assigned file directly
|
|
15036
|
+
- If verification scope is too large, REPORT BACK to ${AGENT_NAMES.COMMANDER}
|
|
15037
|
+
- Violating this rule causes infinite recursion and blocks Master Review
|
|
15014
15038
|
|
|
15015
15039
|
## Never Approve Without Verification
|
|
15016
15040
|
- NEVER approve without actually running the project's test command
|
|
@@ -15027,7 +15051,6 @@ var REVIEWER_FORBIDDEN = `${PROMPT_TAGS.FORBIDDEN_ACTIONS.open}
|
|
|
15027
15051
|
- NEVER make architecture changes \u2192 Escalate to ${AGENT_NAMES.COMMANDER}
|
|
15028
15052
|
- NEVER implement fixes yourself \u2192 Send back to ${AGENT_NAMES.WORKER} with clear feedback
|
|
15029
15053
|
|
|
15030
|
-
|
|
15031
15054
|
## Adaptive Verification
|
|
15032
15055
|
- READ ${PATHS.CONTEXT} to know the correct build/test commands
|
|
15033
15056
|
- COMPARE with existing code patterns for consistency
|
|
@@ -15235,12 +15258,14 @@ Before running integration tests, all merged files must:
|
|
|
15235
15258
|
|
|
15236
15259
|
### Integration Workflow (Master Mode)
|
|
15237
15260
|
|
|
15238
|
-
#### Step 0:
|
|
15239
|
-
Read
|
|
15261
|
+
#### Step 0: Direct File Reading
|
|
15262
|
+
Read all modified files directly from ${PATHS.WORK_LOG}. Identify:
|
|
15240
15263
|
- Cross-module interface changes
|
|
15241
15264
|
- Shared constant modifications
|
|
15242
15265
|
- Potential synchronization bottlenecks
|
|
15243
15266
|
|
|
15267
|
+
[NOTE]: Read directly - no parallel scout overhead, saves tokens.
|
|
15268
|
+
|
|
15244
15269
|
#### Step 1: Check ${PATHS.TODO} Status
|
|
15245
15270
|
\`\`\`bash
|
|
15246
15271
|
cat ${PATHS.TODO}
|
|
@@ -15302,7 +15327,7 @@ Write to ${PATHS.INTEGRATION_STATUS}:
|
|
|
15302
15327
|
|
|
15303
15328
|
**CRITICAL**:
|
|
15304
15329
|
- E2E only at ${PATHS.TODO} completion time!
|
|
15305
|
-
-
|
|
15330
|
+
- Read modified files directly for maximum efficiency.
|
|
15306
15331
|
- All ${PATHS.TODO} [x] + no issues = SEALED!
|
|
15307
15332
|
${PROMPT_TAGS.INTEGRATION_TESTING.close}`;
|
|
15308
15333
|
|
|
@@ -17996,6 +18021,17 @@ var createDelegateTaskTool = (manager, client) => tool({
|
|
|
17996
18021
|
const parentTask = allTasks.find((t) => t.sessionID === ctx.sessionID);
|
|
17997
18022
|
const parentDepth = parentTask?.depth ?? 0;
|
|
17998
18023
|
log(`${PARALLEL_LOG.DELEGATE_TASK} execute() called`, { agent, description, background, resume, mode, groupID, parentSession: ctx.sessionID, depth: parentDepth });
|
|
18024
|
+
if (parentDepth >= PARALLEL_TASK.TERMINAL_DEPTH) {
|
|
18025
|
+
log(`${PARALLEL_LOG.DELEGATE_TASK} Terminal node guard triggered`, { parentDepth, TERMINAL_DEPTH: PARALLEL_TASK.TERMINAL_DEPTH });
|
|
18026
|
+
return `${OUTPUT_LABEL.ERROR} Delegation blocked: You are a terminal node (depth ${parentDepth}).
|
|
18027
|
+
|
|
18028
|
+
**${AGENT_NAMES.WORKER} and ${AGENT_NAMES.REVIEWER} cannot spawn sub-agents.** This prevents infinite recursion.
|
|
18029
|
+
|
|
18030
|
+
If your task is too complex, please:
|
|
18031
|
+
1. Report back to ${AGENT_NAMES.COMMANDER} with specific blockers
|
|
18032
|
+
2. Request task decomposition at the ${AGENT_NAMES.PLANNER} level
|
|
18033
|
+
3. Complete your assigned file directly without delegation`;
|
|
18034
|
+
}
|
|
17999
18035
|
const sessionClient = client;
|
|
18000
18036
|
if (background === void 0) {
|
|
18001
18037
|
return `${OUTPUT_LABEL.ERROR} 'background' parameter is REQUIRED.`;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
export { PROMPT_TAGS, wrapTag } from "./tags.js";
|
|
5
5
|
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
|
-
export {
|
|
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";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Architectural Mandates - Immutable Core Logic
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
4
|
* These constants define the non-negotiable architectural requirements
|
|
6
5
|
* that ensure the orchestrator operates according to the verified diagram.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: Direct reading is preferred over parallel scouts to reduce token costs.
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
|
-
* Phase 0: Discovery
|
|
10
|
-
*
|
|
10
|
+
* Phase 0: Direct Discovery
|
|
11
|
+
* Read directly - no parallel scout overhead, saves tokens and time.
|
|
11
12
|
*/
|
|
12
|
-
export declare const
|
|
13
|
+
export declare const PHASE_0_DIRECT_DISCOVERY: string;
|
|
13
14
|
/**
|
|
14
15
|
* Phase 1: THINK (Strategic Mandate)
|
|
15
16
|
*/
|
|
@@ -9,7 +9,24 @@ export declare const TASK_MODE: {
|
|
|
9
9
|
export declare const PARALLEL_TASK: {
|
|
10
10
|
readonly TTL_MS: number;
|
|
11
11
|
readonly CLEANUP_DELAY_MS: number;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Maximum recursion depth for parallel task spawning
|
|
14
|
+
*
|
|
15
|
+
* Depth hierarchy:
|
|
16
|
+
* - Depth 0: Commander (can spawn Planner/Worker/Reviewer)
|
|
17
|
+
* - Depth 1: Planner (can spawn Worker)
|
|
18
|
+
* - Depth 2: Worker/Reviewer (TERMINAL - cannot spawn sub-agents)
|
|
19
|
+
* - Depth 3: BLOCKED
|
|
20
|
+
*
|
|
21
|
+
* This prevents infinite recursion and ensures Master Reviewer
|
|
22
|
+
* doesn't wait indefinitely for deeply nested sub-tasks.
|
|
23
|
+
*/
|
|
24
|
+
readonly MAX_DEPTH: 3;
|
|
25
|
+
/**
|
|
26
|
+
* Terminal node depth - agents at this depth cannot spawn sub-agents.
|
|
27
|
+
* Worker and Reviewer are terminal nodes by design.
|
|
28
|
+
*/
|
|
29
|
+
readonly TERMINAL_DEPTH: 2;
|
|
13
30
|
readonly DEFAULT_CONCURRENCY: 10;
|
|
14
31
|
readonly MAX_CONCURRENCY: 50;
|
|
15
32
|
readonly SYNC_TIMEOUT_MS: number;
|
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.
|
|
5
|
+
"version": "1.0.33",
|
|
6
6
|
"author": "agnusdei1207",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|