opencode-orchestrator 0.5.3 → 0.5.5

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 (77) hide show
  1. package/README.md +10 -67
  2. package/dist/agents/definitions.d.ts +1 -1
  3. package/dist/agents/orchestrator.d.ts +1 -1
  4. package/dist/agents/subagents/architect.d.ts +1 -1
  5. package/dist/agents/subagents/builder.d.ts +1 -1
  6. package/dist/agents/subagents/inspector.d.ts +1 -1
  7. package/dist/agents/subagents/recorder.d.ts +1 -1
  8. package/dist/core/agents/concurrency.d.ts +36 -0
  9. package/dist/core/agents/config.d.ts +9 -0
  10. package/dist/core/agents/format.d.ts +9 -0
  11. package/dist/core/agents/index.d.ts +7 -0
  12. package/dist/core/agents/interfaces/index.d.ts +5 -0
  13. package/dist/core/agents/interfaces/launch-input.d.ts +9 -0
  14. package/dist/core/agents/interfaces/parallel-task.d.ts +26 -0
  15. package/dist/core/agents/logger.d.ts +4 -0
  16. package/dist/core/agents/manager.d.ts +76 -0
  17. package/dist/core/agents/task-store.d.ts +28 -0
  18. package/dist/core/agents/types/index.d.ts +4 -0
  19. package/dist/core/agents/types/parallel-task-status.d.ts +4 -0
  20. package/dist/core/commands/index.d.ts +6 -0
  21. package/dist/core/commands/interfaces/background-task.d.ts +20 -0
  22. package/dist/core/commands/interfaces/index.d.ts +5 -0
  23. package/dist/core/commands/interfaces/run-background-options.d.ts +9 -0
  24. package/dist/core/commands/manager.d.ts +27 -0
  25. package/dist/core/commands/types/background-task-status.d.ts +4 -0
  26. package/dist/core/commands/types/index.d.ts +4 -0
  27. package/dist/core/orchestrator/index.d.ts +7 -0
  28. package/dist/core/orchestrator/interfaces/index.d.ts +5 -0
  29. package/dist/core/{state.d.ts → orchestrator/interfaces/session-state.d.ts} +4 -7
  30. package/dist/core/orchestrator/interfaces/task.d.ts +17 -0
  31. package/dist/core/orchestrator/state.d.ts +10 -0
  32. package/dist/core/orchestrator/task-graph.d.ts +17 -0
  33. package/dist/core/orchestrator/types/index.d.ts +5 -0
  34. package/dist/core/orchestrator/types/task-status.d.ts +4 -0
  35. package/dist/core/orchestrator/types/task-type.d.ts +4 -0
  36. package/dist/index.d.ts +2 -24
  37. package/dist/index.js +871 -2561
  38. package/dist/shared/{contracts/names.d.ts → agent.d.ts} +12 -0
  39. package/dist/shared/constants.d.ts +56 -0
  40. package/dist/tools/background-cmd/check.d.ts +14 -0
  41. package/dist/tools/background-cmd/index.d.ts +7 -0
  42. package/dist/tools/background-cmd/kill.d.ts +12 -0
  43. package/dist/tools/background-cmd/list.d.ts +17 -0
  44. package/dist/tools/background-cmd/run.d.ts +18 -0
  45. package/dist/tools/parallel/cancel-task.d.ts +13 -0
  46. package/dist/tools/parallel/delegate-task.d.ts +21 -0
  47. package/dist/tools/parallel/get-task-result.d.ts +13 -0
  48. package/dist/tools/parallel/index.d.ts +7 -0
  49. package/dist/tools/parallel/list-tasks.d.ts +13 -0
  50. package/dist/tools/search.d.ts +2 -9
  51. package/dist/utils/sanity.d.ts +22 -0
  52. package/package.json +18 -12
  53. package/dist/agents/subagents/frontend-designer.d.ts +0 -2
  54. package/dist/constants/agent.d.ts +0 -8
  55. package/dist/constants/index.d.ts +0 -7
  56. package/dist/constants/prompts.d.ts +0 -10
  57. package/dist/constants/task.d.ts +0 -12
  58. package/dist/constants/time.d.ts +0 -34
  59. package/dist/context/enforcer.d.ts +0 -47
  60. package/dist/core/async-agent.d.ts +0 -112
  61. package/dist/core/background.d.ts +0 -111
  62. package/dist/core/batch-processor.d.ts +0 -62
  63. package/dist/core/config.d.ts +0 -55
  64. package/dist/core/session-manager.d.ts +0 -39
  65. package/dist/core/tasks.d.ts +0 -30
  66. package/dist/parallel/optimizer.d.ts +0 -47
  67. package/dist/profiler/execution.d.ts +0 -40
  68. package/dist/prompts/shared.d.ts +0 -2
  69. package/dist/shared/contracts/interfaces.d.ts +0 -7
  70. package/dist/tools/async-agent.d.ts +0 -70
  71. package/dist/tools/background.d.ts +0 -57
  72. package/dist/tools/batch.d.ts +0 -53
  73. package/dist/tools/config.d.ts +0 -60
  74. package/dist/tools/git.d.ts +0 -48
  75. package/dist/utils/formatting.d.ts +0 -13
  76. package/dist/utils/index.d.ts +0 -8
  77. package/dist/utils/task.d.ts +0 -8
package/README.md CHANGED
@@ -28,16 +28,17 @@ A **5-agent autonomous architecture** designed to solve complex engineering task
28
28
 
29
29
  **Core Philosophy**: Intelligence is a resource. We orchestrate that resource through **Phase-based Workflows** and **Mandatory Environment Scans** to ensure code always fits the project's infrastructure.
30
30
 
31
+ > 🦀 **Powered by Rust** — Background tasks and parallel searches run on native Rust binaries for maximum performance.
32
+
31
33
  ### Key Features
32
- - **🎯 Autonomous Loop** — Commander runs relentlessly until mission is complete.
34
+ - **🎯 Autonomous Loop** — Commander runs relentlessly until the mission is complete.
33
35
  - **🔍 Environment Scan** — Mandatory analysis of Infra (Docker/OS), Stack, and Domain before any code change.
34
36
  - **🔨 Smart Implementation** — Builder matches existing codebase patterns exactly.
35
37
  - **🛡️ Rigorous Audit** — Inspector proves success with environment-specific evidence (Builds/Tests/Logs).
36
38
  - **💾 Persistent Context** — Recorder saves session state to disk, enabling resume at any time.
37
39
  - **🏗️ Parallel Agents** — Delegated agent execution (`delegate_task`) with sync/async modes.
38
40
  - **⏳ Background Tasks** — Run long commands (builds, tests) in background and check results later.
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.
41
+ - **🔎 mgrep** — Multi-pattern parallel search powered by Rust for blazing-fast codebase analysis.
41
42
 
42
43
  ---
43
44
 
@@ -58,8 +59,8 @@ Restart OpenCode after installation.
58
59
  In OpenCode, press `Tab` to open the Agent selection menu. Select **Commander** and type your mission!
59
60
 
60
61
  <div align="center">
61
- <img src="assets/commander-screenshot.png" alt="Commander Screenshot" width="600" />
62
- <p><em>Press Tab to select Commander</em></p>
62
+ <img src="assets/commander-screenshot.png" alt="Commander Screenshot" width="600" />
63
+ <p><em>Press Tab to select Commander</em></p>
63
64
  </div>
64
65
 
65
66
  ```
@@ -94,8 +95,7 @@ Trigger parallel agent execution with prompts like:
94
95
 
95
96
  Commander will automatically use `delegate_task` with `background: true` for independent tasks.
96
97
 
97
- Monitor parallel tasks in terminal:
98
-
98
+ Monitor parallel tasks in the terminal:
99
99
  ```
100
100
  [parallel] 🚀 SPAWNED task_a1b2 → builder: Implement feature X
101
101
  [parallel] 🚀 SPAWNED task_c3d4 → inspector: Review module Y
@@ -103,63 +103,6 @@ Monitor parallel tasks in terminal:
103
103
  [parallel] 🗑️ CLEANED task_c3d4 (session deleted)
104
104
  ```
105
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
-
163
106
  ---
164
107
 
165
108
  ## Agents (5-Agent Architecture)
@@ -258,13 +201,13 @@ npm run dev:test
258
201
  ### Release Scripts
259
202
 
260
203
  ```bash
261
- # Release patch version (0.4.7 → 0.4.8)
204
+ # Release patch version (0.4.1 → 0.4.2)
262
205
  npm run release:patch
263
206
 
264
- # Release minor version (0.4.7 → 0.5.0)
207
+ # Release minor version (0.4.1 → 0.5.0)
265
208
  npm run release:minor
266
209
 
267
- # Release major version (0.4.7 → 1.0.0)
210
+ # Release major version (0.4.1 → 1.0.0)
268
211
  npm run release:major
269
212
  ```
270
213
 
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../shared/agent.js";
2
2
  export declare const AGENTS: Record<string, AgentDefinition>;
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../shared/agent.js";
2
2
  export declare const orchestrator: AgentDefinition;
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../../shared/agent.js";
2
2
  export declare const architect: AgentDefinition;
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../../shared/agent.js";
2
2
  export declare const builder: AgentDefinition;
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../../shared/agent.js";
2
2
  export declare const inspector: AgentDefinition;
@@ -1,2 +1,2 @@
1
- import { AgentDefinition } from "../../shared/contracts/interfaces.js";
1
+ import { AgentDefinition } from "../../shared/agent.js";
2
2
  export declare const recorder: AgentDefinition;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Concurrency Controller
3
+ *
4
+ * Queue-based rate limiting with support for:
5
+ * - Agent-specific limits
6
+ * - Provider-specific limits (e.g., anthropic/*, openai/*)
7
+ * - Model-specific limits (e.g., anthropic/claude-3-5-sonnet)
8
+ */
9
+ export interface ConcurrencyConfig {
10
+ defaultConcurrency?: number;
11
+ agentConcurrency?: Record<string, number>;
12
+ providerConcurrency?: Record<string, number>;
13
+ modelConcurrency?: Record<string, number>;
14
+ }
15
+ export declare class ConcurrencyController {
16
+ private counts;
17
+ private queues;
18
+ private limits;
19
+ private config;
20
+ constructor(config?: ConcurrencyConfig);
21
+ setLimit(key: string, limit: number): void;
22
+ /**
23
+ * Get concurrency limit for a key.
24
+ * Priority: explicit limit > model > provider > agent > default
25
+ */
26
+ getConcurrencyLimit(key: string): number;
27
+ getLimit(key: string): number;
28
+ acquire(key: string): Promise<void>;
29
+ release(key: string): void;
30
+ getQueueLength(key: string): number;
31
+ getActiveCount(key: string): number;
32
+ /**
33
+ * Get formatted concurrency info string (e.g., "2/5 slots")
34
+ */
35
+ getConcurrencyInfo(key: string): string;
36
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parallel Manager Configuration
3
+ */
4
+ export declare const CONFIG: {
5
+ readonly TASK_TTL_MS: number;
6
+ readonly CLEANUP_DELAY_MS: number;
7
+ readonly MIN_STABILITY_MS: number;
8
+ readonly POLL_INTERVAL_MS: 2000;
9
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Format utilities for parallel tasks
3
+ */
4
+ export declare function formatDuration(start: Date, end?: Date): string;
5
+ export declare function buildNotificationMessage(tasks: Array<{
6
+ id: string;
7
+ description: string;
8
+ status: string;
9
+ }>): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Parallel Module - Agent parallel execution
3
+ */
4
+ export * from "./types/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export { ConcurrencyController } from "./concurrency.js";
7
+ export { ParallelAgentManager, parallelAgentManager } from "./manager.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Parallel Module Interfaces Index
3
+ */
4
+ export { ParallelTask } from "./parallel-task.js";
5
+ export { LaunchInput } from "./launch-input.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * LaunchInput - Input for launching a parallel task
3
+ */
4
+ export interface LaunchInput {
5
+ description: string;
6
+ prompt: string;
7
+ agent: string;
8
+ parentSessionID: string;
9
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * ParallelTask - Represents a task running in a parallel session
3
+ */
4
+ import { ParallelTaskStatus } from "../types/parallel-task-status.js";
5
+ export interface TaskProgress {
6
+ toolCalls: number;
7
+ lastTool?: string;
8
+ lastMessage?: string;
9
+ lastUpdate: Date;
10
+ }
11
+ export interface ParallelTask {
12
+ id: string;
13
+ sessionID: string;
14
+ parentSessionID: string;
15
+ description: string;
16
+ agent: string;
17
+ status: ParallelTaskStatus;
18
+ startedAt: Date;
19
+ completedAt?: Date;
20
+ error?: string;
21
+ result?: string;
22
+ concurrencyKey?: string;
23
+ lastMsgCount?: number;
24
+ stablePolls?: number;
25
+ progress?: TaskProgress;
26
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Debug logger for parallel agent
3
+ */
4
+ export declare function log(...args: unknown[]): void;
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Parallel Agent Manager
3
+ *
4
+ * Session-based async agent execution with:
5
+ * - Concurrency control per agent type
6
+ * - Batched notifications
7
+ * - Automatic cleanup
8
+ */
9
+ import type { PluginInput } from "@opencode-ai/plugin";
10
+ import { formatDuration } from "./format.js";
11
+ import type { ParallelTask } from "./interfaces/parallel-task.js";
12
+ import type { LaunchInput } from "./interfaces/launch-input.js";
13
+ export type { ParallelTask };
14
+ export { formatDuration };
15
+ type OpencodeClient = PluginInput["client"];
16
+ export declare class ParallelAgentManager {
17
+ private static _instance;
18
+ private store;
19
+ private client;
20
+ private directory;
21
+ private concurrency;
22
+ private pollingInterval?;
23
+ private constructor();
24
+ static getInstance(client?: OpencodeClient, directory?: string): ParallelAgentManager;
25
+ launch(input: LaunchInput): Promise<ParallelTask>;
26
+ getTask(id: string): ParallelTask | undefined;
27
+ getRunningTasks(): ParallelTask[];
28
+ getAllTasks(): ParallelTask[];
29
+ getTasksByParent(parentSessionID: string): ParallelTask[];
30
+ cancelTask(taskId: string): Promise<boolean>;
31
+ getResult(taskId: string): Promise<string | null>;
32
+ setConcurrencyLimit(agentType: string, limit: number): void;
33
+ getPendingCount(parentSessionID: string): number;
34
+ cleanup(): void;
35
+ formatDuration: typeof formatDuration;
36
+ /**
37
+ * Handle OpenCode session events for proper resource cleanup.
38
+ * Call this from your plugin's event hook.
39
+ */
40
+ handleEvent(event: {
41
+ type: string;
42
+ properties?: {
43
+ sessionID?: string;
44
+ info?: {
45
+ id?: string;
46
+ };
47
+ };
48
+ }): void;
49
+ /**
50
+ * Find task by session ID
51
+ */
52
+ private findBySession;
53
+ /**
54
+ * Handle session.idle event - validate and complete task
55
+ */
56
+ private handleSessionIdle;
57
+ private handleTaskError;
58
+ private startPolling;
59
+ private stopPolling;
60
+ private pollRunningTasks;
61
+ /**
62
+ * Update task progress and stability tracking
63
+ */
64
+ private updateTaskProgress;
65
+ /**
66
+ * Complete a task and cleanup
67
+ */
68
+ private completeTask;
69
+ private validateSessionHasOutput;
70
+ private pruneExpiredTasks;
71
+ private scheduleCleanup;
72
+ private notifyParentIfAllComplete;
73
+ }
74
+ export declare const parallelAgentManager: {
75
+ getInstance: typeof ParallelAgentManager.getInstance;
76
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Task Store - Stores and manages parallel tasks
3
+ */
4
+ import type { ParallelTask } from "./interfaces/parallel-task.js";
5
+ export declare class TaskStore {
6
+ private tasks;
7
+ private pendingByParent;
8
+ private notifications;
9
+ set(id: string, task: ParallelTask): void;
10
+ get(id: string): ParallelTask | undefined;
11
+ getAll(): ParallelTask[];
12
+ getRunning(): ParallelTask[];
13
+ getByParent(parentSessionID: string): ParallelTask[];
14
+ delete(id: string): boolean;
15
+ clear(): void;
16
+ trackPending(parentSessionID: string, taskId: string): void;
17
+ untrackPending(parentSessionID: string, taskId: string): void;
18
+ getPendingCount(parentSessionID: string): number;
19
+ hasPending(parentSessionID: string): boolean;
20
+ queueNotification(task: ParallelTask): void;
21
+ getNotifications(parentSessionID: string): ParallelTask[];
22
+ clearNotifications(parentSessionID: string): void;
23
+ cleanEmptyNotifications(): void;
24
+ /**
25
+ * Remove a specific task from all notification queues
26
+ */
27
+ clearNotificationsForTask(taskId: string): void;
28
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Parallel Module Types Index
3
+ */
4
+ export { ParallelTaskStatus } from "./parallel-task-status.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ParallelTaskStatus - Task status union type
3
+ */
4
+ export type ParallelTaskStatus = "pending" | "running" | "completed" | "error" | "timeout";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Background Task Module
3
+ */
4
+ export * from "./types/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export { backgroundTaskManager } from "./manager.js";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * BackgroundTask - Represents a shell command running in background
3
+ */
4
+ import { ChildProcess } from "child_process";
5
+ import { BackgroundTaskStatus } from "../types/background-task-status.js";
6
+ export interface BackgroundTask {
7
+ id: string;
8
+ command: string;
9
+ args: string[];
10
+ cwd: string;
11
+ label?: string;
12
+ status: BackgroundTaskStatus;
13
+ output: string;
14
+ errorOutput: string;
15
+ exitCode: number | null;
16
+ startTime: number;
17
+ endTime?: number;
18
+ timeout: number;
19
+ process?: ChildProcess;
20
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Background Task Interfaces Index
3
+ */
4
+ export { BackgroundTask } from "./background-task.js";
5
+ export { RunBackgroundOptions } from "./run-background-options.js";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * RunBackgroundOptions - Options for running a background task
3
+ */
4
+ export interface RunBackgroundOptions {
5
+ command: string;
6
+ cwd?: string;
7
+ timeout?: number;
8
+ label?: string;
9
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Background Task Manager
3
+ *
4
+ * Runs shell commands in the background and tracks their output.
5
+ */
6
+ import type { BackgroundTask } from "./interfaces/background-task.js";
7
+ import type { BackgroundTaskStatus } from "./types/background-task-status.js";
8
+ import type { RunBackgroundOptions } from "./interfaces/run-background-options.js";
9
+ declare class BackgroundTaskManager {
10
+ private static _instance;
11
+ private tasks;
12
+ private debugMode;
13
+ private constructor();
14
+ static get instance(): BackgroundTaskManager;
15
+ private generateId;
16
+ private debug;
17
+ run(options: RunBackgroundOptions): BackgroundTask;
18
+ get(taskId: string): BackgroundTask | undefined;
19
+ getAll(): BackgroundTask[];
20
+ getByStatus(status: BackgroundTaskStatus): BackgroundTask[];
21
+ clearCompleted(): number;
22
+ kill(taskId: string): boolean;
23
+ formatDuration(task: BackgroundTask): string;
24
+ getStatusEmoji(status: BackgroundTaskStatus): string;
25
+ }
26
+ export declare const backgroundTaskManager: BackgroundTaskManager;
27
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * BackgroundTaskStatus - Task status union type
3
+ */
4
+ export type BackgroundTaskStatus = "pending" | "running" | "done" | "error" | "timeout";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Background Task Types Index
3
+ */
4
+ export { BackgroundTaskStatus } from "./background-task-status.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Session Module - State and Task management
3
+ */
4
+ export * from "./types/index.js";
5
+ export * from "./interfaces/index.js";
6
+ export { TaskGraph } from "./task-graph.js";
7
+ export { state } from "./state.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Session Interfaces Index
3
+ */
4
+ export { Task } from "./task.js";
5
+ export { SessionState } from "./session-state.js";
@@ -1,4 +1,7 @@
1
- import { TaskGraph } from "./tasks.js";
1
+ /**
2
+ * SessionState - State for a single orchestration session
3
+ */
4
+ import type { TaskGraph } from "../task-graph.js";
2
5
  export interface SessionState {
3
6
  enabled: boolean;
4
7
  iterations: number;
@@ -8,9 +11,3 @@ export interface SessionState {
8
11
  anomalyCount: number;
9
12
  lastHealthyOutput?: string;
10
13
  }
11
- export declare const state: {
12
- missionActive: boolean;
13
- maxIterations: number;
14
- maxRetries: number;
15
- sessions: Map<string, SessionState>;
16
- };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Task - A single task in the orchestration DAG
3
+ */
4
+ import { TaskStatus } from "../types/task-status.js";
5
+ import { TaskType } from "../types/task-type.js";
6
+ export interface Task {
7
+ id: string;
8
+ description: string;
9
+ action: string;
10
+ file: string;
11
+ dependencies: string[];
12
+ status: TaskStatus;
13
+ result?: string;
14
+ retryCount: number;
15
+ complexity: number;
16
+ type: TaskType;
17
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Global State - Orchestration state manager
3
+ */
4
+ import { SessionState } from "./interfaces/session-state.js";
5
+ export declare const state: {
6
+ missionActive: boolean;
7
+ maxIterations: number;
8
+ maxRetries: number;
9
+ sessions: Map<string, SessionState>;
10
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * TaskGraph - DAG for task orchestration
3
+ */
4
+ import { Task } from "./interfaces/task.js";
5
+ export declare class TaskGraph {
6
+ private tasks;
7
+ constructor(tasks?: Task[]);
8
+ addTask(task: Task): void;
9
+ getTask(id: string): Task | undefined;
10
+ updateTask(id: string, updates: Partial<Task>): void;
11
+ getReadyTasks(): Task[];
12
+ isCompleted(): boolean;
13
+ hasFailed(): boolean;
14
+ getTaskSummary(): string;
15
+ toJSON(): string;
16
+ static fromJSON(json: string): TaskGraph;
17
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Orchestrator Types Index
3
+ */
4
+ export { TaskStatus } from "./task-status.js";
5
+ export { TaskType } from "./task-type.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TaskStatus - Status of a task in the DAG
3
+ */
4
+ export type TaskStatus = "pending" | "running" | "completed" | "failed";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * TaskType - Type of task in the orchestration DAG
3
+ */
4
+ export type TaskType = "infrastructure" | "logic" | "integration";
package/dist/index.d.ts CHANGED
@@ -13,24 +13,6 @@
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
- };
34
16
  call_agent: {
35
17
  description: string;
36
18
  args: {
@@ -85,12 +67,10 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
85
67
  args: {
86
68
  patterns: import("zod").ZodArray<import("zod").ZodString>;
87
69
  dir: import("zod").ZodOptional<import("zod").ZodString>;
88
- max_results_per_pattern: import("zod").ZodOptional<import("zod").ZodNumber>;
89
70
  };
90
71
  execute(args: {
91
72
  patterns: string[];
92
73
  dir?: string | undefined;
93
- max_results_per_pattern?: number | undefined;
94
74
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
95
75
  };
96
76
  run_background: {
@@ -100,14 +80,12 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
100
80
  cwd: import("zod").ZodOptional<import("zod").ZodString>;
101
81
  timeout: import("zod").ZodOptional<import("zod").ZodNumber>;
102
82
  label: import("zod").ZodOptional<import("zod").ZodString>;
103
- sessionID: import("zod").ZodOptional<import("zod").ZodString>;
104
83
  };
105
84
  execute(args: {
106
85
  command: string;
107
86
  cwd?: string | undefined;
108
87
  timeout?: number | undefined;
109
88
  label?: string | undefined;
110
- sessionID?: string | undefined;
111
89
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
112
90
  };
113
91
  check_background: {
@@ -126,13 +104,13 @@ declare const OrchestratorPlugin: (input: PluginInput) => Promise<{
126
104
  args: {
127
105
  status: import("zod").ZodOptional<import("zod").ZodEnum<{
128
106
  running: "running";
129
- all: "all";
130
107
  done: "done";
131
108
  error: "error";
109
+ all: "all";
132
110
  }>>;
133
111
  };
134
112
  execute(args: {
135
- status?: "running" | "all" | "done" | "error" | undefined;
113
+ status?: "running" | "done" | "error" | "all" | undefined;
136
114
  }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
137
115
  };
138
116
  kill_background: {