opencode-orchestrator 1.0.10 → 1.0.12

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
@@ -12,12 +12,6 @@
12
12
 
13
13
  ---
14
14
 
15
- ### 🌌 **The End of Sequential Limits. The Era of Fractal Mastery.**
16
-
17
- Where traditional agents hit a sequential wall, we deploy a fractal swarm. OpenCode Orchestrator is the world's most advanced autonomous engineering platform—a **Titan-Class Execution Engine** designed to conquer missions that break conventional AI.
18
-
19
- By fusing **Fractal Swarm Intelligence (HPFA™)** with **Continuous Multi-Stage Verification Pipeline (MSVP™)**, it delivers a level of scale, velocity, and architectural absolute previously considered impossible. Welcome to the final form of autonomous development. No bottlenecks. No limits. Only pure execution.
20
-
21
15
  ## ⚡ Quick Start
22
16
 
23
17
  ```bash
@@ -26,9 +20,16 @@ npm install -g opencode-orchestrator
26
20
 
27
21
  Then in OpenCode, launch your mission:
28
22
  ```bash
29
- /extreme-mission "Architect and Build a Diablo-like Web Engine"
23
+ /swarm "Architect and Build a Diablo-like Web Game"
30
24
  ```
31
25
 
26
+ ### 🌌 **The End of Sequential Limits. The Era of Fractal Mastery.**
27
+
28
+ Where traditional agents hit a sequential wall, we deploy a fractal swarm. OpenCode Orchestrator is the world's most advanced autonomous engineering platform—a **Titan-Class Execution Engine** designed to conquer missions that break conventional AI.
29
+
30
+ By fusing **Fractal Swarm Intelligence (HPFA™)** with **Continuous Multi-Stage Verification Pipeline (MSVP™)**, it delivers a level of scale, velocity, and architectural absolute previously considered impossible. Welcome to the final form of autonomous development. No bottlenecks. No limits. Only pure execution.
31
+
32
+
32
33
  ## 💎 The Four Pillars of Excellence
33
34
 
34
35
  We’ve combined industrial-grade reliability with cutting-edge parallel intelligence to redefine what’s possible in AI coding.
@@ -74,20 +75,20 @@ We’ve combined industrial-grade reliability with cutting-edge parallel intelli
74
75
 
75
76
  ## 🏛️ Hyper-Parallel Architecture: HPFA & MSVP
76
77
 
77
- The orchestrator eliminates the linear bottleneck of AI development through two breakthrough technologies:
78
+ The orchestrator eliminates the linear reasoning bottleneck of conventional AI agents by shifting from sequential execution to a **Distributed Runtime Unit** paradigm.
78
79
 
79
- ### 🧬 **HPFA (Hyper-Parallel Fractal Architecture)**
80
- Imagine an agent that doesn't just work, but **thinks like a Hive Mind**.
81
- * **Fractal Delegation**: Workers are no longer just "doers." They are mini-planners that can recursively spawn their own sub-agents to handle complexity at every level.
82
- * **Speculative Racing**: Ambiguous tasks are solved using multiple strategies in parallel. The fastest, most accurate path wins, while others are pruned—minimizing latency and maximizing quality.
80
+ ### 🧬 **HPFA (Hyper-Parallel Fractal Architecture)**
81
+ HPFA defines a recursive problem-solving model that decomposes massive codebases into atomic task units through a fractal hierarchy.
82
+ * **Fractal Delegation**: Workers are instantiated as autonomous controllers with localized `TaskLauncher` contexts. This enables recursive spawning of sub-agents up to 8 levels deep, mapping complex architectural hierarchies into a parallel execution grid.
83
+ * **Cognitive Concurrency Control**: A dedicated state-machine manages up to 50 concurrent sessions. It monitors success/failure trajectories to dynamically scale concurrency slots, ensuring maximum throughput while maintaining strict rate-limit compliance.
83
84
 
84
- ### 🛡️ **MSVP (Multi-Stage Verification Pipeline)**
85
- Speed is nothing without accuracy. MSVP ensures your code is production-ready at every second.
86
- * **Shadow Parallel Review**: As soon as a file is written, a parallel reviewer session is already validating it before the main task even finishes.
87
- * **Barrier-Sync Integration**: A 4-stage verification gate that prevents "architectural drift" by forcing a global synchronization barrier before final sealing.
85
+ ### 🛡️ **MSVP (Multi-Stage Verification Pipeline)**
86
+ MSVP ensures continuous integration integrity by decoupling verification from the implementation lifecycle, treating code review as a parallel background-thread.
87
+ * **Shadow Review Pipeline**: Upon every file-write operation, a parallel reviewer session is instantly snapshotted (Unit-level Verification). This zero-latency audit identifies defects the millisecond they are introduced, without blocking the primary implementation thread.
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.
88
89
 
89
90
  ```
90
- /extreme-mission "Build Complex System"
91
+ /swarm "Build Diablo Game"
91
92
 
92
93
  ╔═══════════════════════════════════════╗
93
94
  ║ 🎯 COMMANDER — Orchestrator ║
@@ -148,14 +149,14 @@ Speed is nothing without accuracy. MSVP ensures your code is production-ready at
148
149
 
149
150
  | Feature | What It Does |
150
151
  |:---------|:-------------|
151
- | 🚀 **MSVP Pipeline** | Parallel unit reviews triggered immediately after worker tasks |
152
- | 🧬 **Fractal Spawning** | Workers can recursively spawn sub-missions for complex tasks |
153
- | ⚡ **20+ Parallel Tasks** | High-intensity execution with safety concurrency limits |
154
- | 🔄 **Non-Stop Recovery** | WAL-based persistence (resumes tasks after crashes) |
155
- | 🔥 **Multi-File Ops** | Work on different files at the same time |
156
- | 🛡️ **Self-Scaling** | Dynamic concurrency limits based on success/failure |
157
- | 🩹 **Memory Integrity** | Strict resource cleanup prevents leaks in long sessions |
158
- | 🏗️ **Architectural Modularity**| Enforces language-agnostic clean code principles |
152
+ | 🚀 **MSVP Pipeline** | Zero-latency unit reviews triggered the millisecond code is written |
153
+ | 🧬 **Fractal Spawning** | Workers recursively spawn sub-agents for infinite structural depth |
154
+ | ⚡ **50 Parallel Tasks** | Titan-class density—run massive swarms without breaking a sweat |
155
+ | 🔄 **Non-Stop Recovery** | WAL-powered cognitive persistence; resumes instantly after any crash |
156
+ | 🔥 **Multi-File Ops** | Massive parallel edits with cross-file context integrity |
157
+ | 🛡️ **Self-Scaling** | Dynamic AI-driven concurrency management based on success velocity |
158
+ | 🩹 **Memory Integrity** | 100% reclamation; engineered for sessions with 10k+ iterations |
159
+ | 🏗️ **Clean-Code Engine**| Enforces industrial modularity and clean architectural patterns |
159
160
 
160
161
  ---
161
162
 
package/dist/index.js CHANGED
@@ -288,11 +288,11 @@ var PARALLEL_TASK = {
288
288
  // Task lifecycle (24 hours for long tasks)
289
289
  TTL_MS: 24 * TIME.HOUR,
290
290
  CLEANUP_DELAY_MS: 10 * TIME.MINUTE,
291
- MAX_DEPTH: 5,
292
- // Increased for fractal recursion
291
+ MAX_DEPTH: 8,
292
+ // Titan-Class depth for complex fractal missions
293
293
  // Concurrency limits (Aggressive for intense processing)
294
- DEFAULT_CONCURRENCY: 5,
295
- MAX_CONCURRENCY: 20,
294
+ DEFAULT_CONCURRENCY: 10,
295
+ MAX_CONCURRENCY: 50,
296
296
  // Sync polling (for delegate_task sync mode)
297
297
  // Optimized: Reduced polling frequency while relying more on events
298
298
  SYNC_TIMEOUT_MS: 5 * TIME.MINUTE,
@@ -631,7 +631,7 @@ var PROMPTS = {
631
631
 
632
632
  // src/shared/message/constants/slash-commands.ts
633
633
  var COMMAND_NAMES = {
634
- TASK: "extreme-mission",
634
+ TASK: "swarm",
635
635
  PLAN: "plan",
636
636
  STATUS: "status",
637
637
  STOP: "stop",
@@ -15532,7 +15532,7 @@ $ARGUMENTS
15532
15532
  </execution_rules>
15533
15533
  </mission>`;
15534
15534
  var COMMANDS = {
15535
- "extreme-mission": {
15535
+ "swarm": {
15536
15536
  description: "MISSION MODE - Execute task autonomously until complete",
15537
15537
  template: MISSION_MODE_TEMPLATE,
15538
15538
  argumentHint: '"mission goal"'
@@ -15593,7 +15593,7 @@ THINK \u2192 PLAN \u2192 DELEGATE \u2192 EXECUTE \u2192 VERIFY \u2192 COMPLETE
15593
15593
 
15594
15594
  ## Usage
15595
15595
  - Select **${AGENT_NAMES.COMMANDER}** and type your request
15596
- - Or use \`/extreme-mission "your mission"\` explicitly
15596
+ - Or use \`/swarm "your mission"\` explicitly
15597
15597
  - ${AGENT_NAMES.COMMANDER} automatically coordinates all agents`
15598
15598
  }
15599
15599
  };
@@ -16249,7 +16249,7 @@ var ConcurrencyController = class {
16249
16249
  this.failureCount.set(key, 0);
16250
16250
  if (streak % 5 === 0) {
16251
16251
  const currentLimit = this.getConcurrencyLimit(key);
16252
- if (currentLimit < 20) {
16252
+ if (currentLimit < PARALLEL_TASK.MAX_CONCURRENCY) {
16253
16253
  this.setLimit(key, currentLimit + 1);
16254
16254
  log(`[concurrency] Auto-scaling UP for ${key}: ${currentLimit + 1}`);
16255
16255
  }
@@ -17060,6 +17060,11 @@ var TaskLauncher = class {
17060
17060
  * Prepare task: Create session and registration without blocking on concurrency
17061
17061
  */
17062
17062
  async prepareTask(input) {
17063
+ const currentDepth = input.depth ?? 0;
17064
+ if (currentDepth >= PARALLEL_TASK.MAX_DEPTH) {
17065
+ log(`[task-launcher.ts] Task depth limit reached (${currentDepth}/${PARALLEL_TASK.MAX_DEPTH}). Generation blocked.`);
17066
+ throw new Error(`Maximum task depth (${PARALLEL_TASK.MAX_DEPTH}) reached. To prevent infinite recursion, no further sub-tasks can be spawned.`);
17067
+ }
17063
17068
  const createResult = await this.client.session.create({
17064
17069
  body: {
17065
17070
  parentID: input.parentSessionID,
@@ -17908,7 +17913,10 @@ var createDelegateTaskTool = (manager, client) => tool({
17908
17913
  async execute(args, context) {
17909
17914
  const { agent, description, prompt, background, resume, mode, groupID } = args;
17910
17915
  const ctx = context;
17911
- log(`${PARALLEL_LOG.DELEGATE_TASK} execute() called`, { agent, description, background, resume, mode, groupID, parentSession: ctx.sessionID });
17916
+ const allTasks = manager.getAllTasks();
17917
+ const parentTask = allTasks.find((t) => t.sessionID === ctx.sessionID);
17918
+ const parentDepth = parentTask?.depth ?? 0;
17919
+ log(`${PARALLEL_LOG.DELEGATE_TASK} execute() called`, { agent, description, background, resume, mode, groupID, parentSession: ctx.sessionID, depth: parentDepth });
17912
17920
  const sessionClient = client;
17913
17921
  if (background === void 0) {
17914
17922
  return `${OUTPUT_LABEL.ERROR} 'background' parameter is REQUIRED.`;
@@ -17924,7 +17932,9 @@ var createDelegateTaskTool = (manager, client) => tool({
17924
17932
  description,
17925
17933
  // Assuming description is needed for resume context
17926
17934
  mode,
17927
- groupID
17935
+ groupID,
17936
+ depth: parentDepth
17937
+ // Preserve depth on resume
17928
17938
  };
17929
17939
  const launchResult = await manager.launch(input);
17930
17940
  const task = Array.isArray(launchResult) ? launchResult[0] : launchResult;
@@ -17964,7 +17974,8 @@ ${text || "(No output)"}`;
17964
17974
  prompt,
17965
17975
  parentSessionID: ctx.sessionID,
17966
17976
  mode,
17967
- groupID
17977
+ groupID,
17978
+ depth: parentDepth
17968
17979
  });
17969
17980
  const task = Array.isArray(launchResult) ? launchResult[0] : launchResult;
17970
17981
  presets.taskStarted(task.id, agent);
@@ -20538,7 +20549,7 @@ ${claudeRules}`;
20538
20549
  function detectSlashCommand(text) {
20539
20550
  const match = text.trim().match(/^\/([a-zA-Z0-9_-]+)(?:\s+(.*))?$/);
20540
20551
  if (!match) return null;
20541
- return { command: match[1], args: match[2] || "" };
20552
+ return { command: match[1].toLowerCase(), args: match[2] || "" };
20542
20553
  }
20543
20554
 
20544
20555
  // src/utils/formatting/timestamp.ts
@@ -20576,7 +20587,7 @@ function createChatMessageHandler(ctx) {
20576
20587
  if (sessionID) {
20577
20588
  handleUserMessage(sessionID);
20578
20589
  }
20579
- if (agentName === AGENT_NAMES.COMMANDER) {
20590
+ if (agentName === AGENT_NAMES.COMMANDER.toLowerCase()) {
20580
20591
  if (!sessions.has(sessionID)) {
20581
20592
  const now = Date.now();
20582
20593
  sessions.set(sessionID, {
@@ -20610,7 +20621,7 @@ function createChatMessageHandler(ctx) {
20610
20621
  }
20611
20622
  if (parsed) {
20612
20623
  const command = COMMANDS[parsed.command];
20613
- if (command && agentName !== AGENT_NAMES.COMMANDER) {
20624
+ if (command && agentName !== AGENT_NAMES.COMMANDER.toLowerCase()) {
20614
20625
  parts[textPartIndex].text = command.template.replace(
20615
20626
  /\$ARGUMENTS/g,
20616
20627
  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: "/extreme-mission";
5
+ readonly TASK: "/swarm";
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: "extreme-mission";
15
+ readonly TASK: "swarm";
16
16
  readonly PLAN: "plan";
17
17
  readonly STATUS: "status";
18
18
  readonly STOP: "stop";
@@ -9,9 +9,9 @@ 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
- readonly MAX_DEPTH: 5;
13
- readonly DEFAULT_CONCURRENCY: 5;
14
- readonly MAX_CONCURRENCY: 20;
12
+ readonly MAX_DEPTH: 8;
13
+ readonly DEFAULT_CONCURRENCY: 10;
14
+ readonly MAX_CONCURRENCY: 50;
15
15
  readonly SYNC_TIMEOUT_MS: number;
16
16
  readonly POLL_INTERVAL_MS: 2000;
17
17
  readonly MIN_IDLE_TIME_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.10",
5
+ "version": "1.0.12",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {