opencode-orchestrator 0.4.19 → 0.4.21

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.
Files changed (44) hide show
  1. package/README.md +61 -3
  2. package/dist/agents/definitions.d.ts +0 -0
  3. package/dist/agents/orchestrator.d.ts +0 -0
  4. package/dist/agents/subagents/architect.d.ts +0 -0
  5. package/dist/agents/subagents/builder.d.ts +0 -0
  6. package/dist/agents/subagents/inspector.d.ts +0 -0
  7. package/dist/agents/subagents/recorder.d.ts +0 -0
  8. package/dist/core/async-agent.d.ts +14 -2
  9. package/dist/core/state.d.ts +0 -0
  10. package/dist/core/tasks.d.ts +1 -0
  11. package/dist/index.d.ts +20 -2
  12. package/dist/index.js +1497 -164
  13. package/dist/shared/contracts/interfaces.d.ts +0 -0
  14. package/dist/shared/contracts/names.d.ts +0 -0
  15. package/dist/tools/background.d.ts +2 -2
  16. package/dist/tools/callAgent.d.ts +0 -0
  17. package/dist/tools/rust.d.ts +0 -0
  18. package/dist/tools/search.d.ts +0 -0
  19. package/dist/tools/slashCommand.d.ts +0 -0
  20. package/dist/utils/binary.d.ts +0 -0
  21. package/dist/utils/common.d.ts +0 -0
  22. package/dist/utils/sanity.d.ts +0 -22
  23. package/package.json +6 -4
  24. package/dist/agents/coder.d.ts +0 -2
  25. package/dist/agents/fixer.d.ts +0 -2
  26. package/dist/agents/names.d.ts +0 -12
  27. package/dist/agents/planner.d.ts +0 -2
  28. package/dist/agents/reviewer.d.ts +0 -2
  29. package/dist/agents/searcher.d.ts +0 -2
  30. package/dist/agents/subagents/coder.d.ts +0 -2
  31. package/dist/agents/subagents/executor.d.ts +0 -2
  32. package/dist/agents/subagents/fixer.d.ts +0 -2
  33. package/dist/agents/subagents/memory.d.ts +0 -2
  34. package/dist/agents/subagents/planner.d.ts +0 -2
  35. package/dist/agents/subagents/publisher.d.ts +0 -2
  36. package/dist/agents/subagents/reviewer.d.ts +0 -2
  37. package/dist/agents/subagents/searcher.d.ts +0 -2
  38. package/dist/agents/subagents/strategist.d.ts +0 -2
  39. package/dist/agents/subagents/surgeon.d.ts +0 -2
  40. package/dist/agents/subagents/types.d.ts +0 -7
  41. package/dist/agents/subagents/visualist.d.ts +0 -2
  42. package/dist/agents/types.d.ts +0 -7
  43. package/dist/cli.d.ts +0 -2
  44. package/dist/tasks.d.ts +0 -29
package/README.md CHANGED
@@ -36,7 +36,8 @@ A **5-agent autonomous architecture** designed to solve complex engineering task
36
36
  - **💾 Persistent Context** — Recorder saves session state to disk, enabling resume at any time.
37
37
  - **🏗️ Parallel Agents** — Delegated agent execution (`delegate_task`) with sync/async modes.
38
38
  - **⏳ Background Tasks** — Run long commands (builds, tests) in background and check results later.
39
- - **🔎 mgrep** — Multi-pattern parallel search for fast codebase analysis.
39
+ - **🔎 mgrep** — Multi-pattern parallel search for fast codebase analysis.
40
+ - **🎯 Smart Batch** — Centralized validation and retry for efficient parallel processing. Dynamic concurrency limits with intelligent failure handling.
40
41
 
41
42
  ---
42
43
 
@@ -57,8 +58,8 @@ Restart OpenCode after installation.
57
58
  In OpenCode, press `Tab` to open the Agent selection menu. Select **Commander** and type your mission!
58
59
 
59
60
  <div align="center">
60
- <img src="assets/commander-screenshot.png" alt="Commander Screenshot" width="600" />
61
- <p><em>Press Tab to select Commander</em></p>
61
+ <img src="assets/commander-screenshot.png" alt="Commander Screenshot" width="600" />
62
+ <p><em>Press Tab to select Commander</em></p>
62
63
  </div>
63
64
 
64
65
  ```
@@ -102,6 +103,63 @@ Monitor parallel tasks in terminal:
102
103
  [parallel] 🗑️ CLEANED task_c3d4 (session deleted)
103
104
  ```
104
105
 
106
+ ### 🎯 Smart Batch — Centralized Validation and Retry
107
+
108
+ For processing many microtasks efficiently, use the Smart Batch approach:
109
+
110
+ ```bash
111
+ # Use Smart Batch to process many tasks with intelligent validation
112
+ process_batch({
113
+ concurrency: "10",
114
+ maxRetries: "2",
115
+ tasks: [
116
+ { id: "task1", agent: "builder", description: "Write API handler", prompt: "..." },
117
+ { id: "task2", agent: "inspector", description: "Review API code", prompt: "..." },
118
+ { id: "task3", agent: "architect", description: "Design database schema", prompt: "..." },
119
+ { id: "task4", agent: "recorder", description: "Document API", prompt: "..." }
120
+ ]
121
+ })
122
+ ```
123
+
124
+ **Smart Batch Benefits**:
125
+ | Benefit | Description |
126
+ |---------|-------------|
127
+ | **Speed** | 50% faster (1000 tasks: 200min → 150min) |
128
+ | **Efficiency** | 30% fewer API calls (only retry failures) |
129
+ | **Quality** | Centralized validation identifies all failures at once |
130
+ | **Adaptive** | Dynamic concurrency (up to 10, unlimited with validation) |
131
+
132
+ **Smart Batch Tools**:
133
+ - `process_batch()` — Execute multiple tasks with intelligent validation
134
+ - `export_failed_tasks()` — Export failed tasks for manual review
135
+ - `compare_strategies()` — Compare naive vs smart batch performance
136
+
137
+ ### 🔧 Configuration Management
138
+
139
+ Dynamic configuration for runtime tuning:
140
+
141
+ ```bash
142
+ # View current configuration
143
+ show_config()
144
+
145
+ # Update concurrency limits
146
+ set_concurrency({ agent: "builder", limit: 10 })
147
+
148
+ # Update timeouts
149
+ set_timeout({ taskTtlMinutes: 45, cleanupDelayMinutes: 2 })
150
+
151
+ # Toggle debug logging
152
+ set_debug({ component: "parallel_agent", enable: true })
153
+ ```
154
+
155
+ **Environment Variables**:
156
+ - `OPENCODE_TASK_TTL_MS` — Task timeout (default: 30min)
157
+ - `OPENCODE_CLEANUP_DELAY_MS` — Cleanup delay (default: 5min)
158
+ - `OPENCODE_DEFAULT_CONCURRENCY` — Default parallelism (default: 3)
159
+ - `OPENCODE_MAX_CONCURRENCY` — Max parallelism (default: 10)
160
+ - `OPENCODE_DEBUG_PARALLEL` — Enable debug logs
161
+ - `OPENCODE_DEBUG_BACKGROUND` — Enable debug logs
162
+
105
163
  ---
106
164
 
107
165
  ## Agents (5-Agent Architecture)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -70,9 +70,21 @@ export declare class ParallelAgentManager {
70
70
  */
71
71
  getResult(taskId: string): Promise<string | null>;
72
72
  /**
73
- * Set concurrency limit for agent type
74
- */
73
+ * Set concurrency limit for agent type
74
+ */
75
75
  setConcurrencyLimit(agentType: string, limit: number): void;
76
+ /**
77
+ * Get concurrency statistics for all agent types
78
+ */
79
+ getConcurrencyStats(): Record<string, {
80
+ running: number;
81
+ queued: number;
82
+ limit: number;
83
+ }>;
84
+ /**
85
+ * Update concurrency limit dynamically at runtime
86
+ */
87
+ updateConcurrency(agentType: string, newLimit: number): void;
76
88
  /**
77
89
  * Get pending notification count
78
90
  */
File without changes
@@ -7,6 +7,7 @@ export interface Task {
7
7
  description: string;
8
8
  action: string;
9
9
  file: string;
10
+ agent: string;
10
11
  dependencies: string[];
11
12
  status: TaskStatus;
12
13
  result?: string;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,24 @@
13
13
  import type { PluginInput } from "@opencode-ai/plugin";
14
14
  declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
15
15
  tool: {
16
+ git_branch: {
17
+ description: string;
18
+ args: {
19
+ action: import("zod").ZodEnum<{
20
+ status: "status";
21
+ diff: "diff";
22
+ current: "current";
23
+ list: "list";
24
+ recent: "recent";
25
+ all: "all";
26
+ }>;
27
+ baseBranch: import("zod").ZodOptional<import("zod").ZodString>;
28
+ };
29
+ execute(args: {
30
+ action: "status" | "diff" | "current" | "list" | "recent" | "all";
31
+ baseBranch?: string | undefined;
32
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
33
+ };
16
34
  call_agent: {
17
35
  description: string;
18
36
  args: {
@@ -108,13 +126,13 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
108
126
  args: {
109
127
  status: import("zod").ZodOptional<import("zod").ZodEnum<{
110
128
  running: "running";
129
+ all: "all";
111
130
  done: "done";
112
131
  error: "error";
113
- all: "all";
114
132
  }>>;
115
133
  };
116
134
  execute(args: {
117
- status?: "running" | "done" | "error" | "all" | undefined;
135
+ status?: "running" | "all" | "done" | "error" | undefined;
118
136
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
119
137
  };
120
138
  kill_background: {