opencode-orchestrator 1.2.6 → 1.2.13

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 (37) hide show
  1. package/dist/core/agents/index.d.ts +1 -0
  2. package/dist/core/agents/manager/task-poller.d.ts +1 -0
  3. package/dist/core/cleanup/cleanup-scheduler.d.ts +11 -0
  4. package/dist/core/loop/mission-loop.d.ts +1 -30
  5. package/dist/core/notification/task-toast-manager.d.ts +6 -0
  6. package/dist/core/sync/todo-parser.d.ts +5 -0
  7. package/dist/core/sync/todo-sync-service.d.ts +35 -0
  8. package/dist/hooks/registry.d.ts +4 -4
  9. package/dist/hooks/types.d.ts +5 -5
  10. package/dist/index.js +15921 -1806
  11. package/dist/plugin-handlers/chat-message-handler.d.ts +17 -1
  12. package/dist/plugin-handlers/interfaces/index.d.ts +1 -0
  13. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +14 -0
  14. package/dist/plugin-handlers/tool-execute-handler.d.ts +2 -11
  15. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +2 -7
  16. package/dist/shared/constants/system-messages.d.ts +2 -0
  17. package/dist/shared/loop/interfaces/index.d.ts +3 -2
  18. package/dist/shared/loop/interfaces/mission-loop.d.ts +29 -0
  19. package/dist/tools/ast/index.d.ts +3 -28
  20. package/dist/tools/background-cmd/check.d.ts +2 -11
  21. package/dist/tools/background-cmd/kill.d.ts +2 -9
  22. package/dist/tools/background-cmd/list.d.ts +2 -14
  23. package/dist/tools/background-cmd/run.d.ts +2 -15
  24. package/dist/tools/callAgent.d.ts +2 -17
  25. package/dist/tools/lsp/index.d.ts +2 -11
  26. package/dist/tools/parallel/cancel-task.d.ts +2 -9
  27. package/dist/tools/parallel/delegate-task.d.ts +2 -25
  28. package/dist/tools/parallel/get-task-result.d.ts +2 -9
  29. package/dist/tools/parallel/list-tasks.d.ts +2 -9
  30. package/dist/tools/parallel/update-todo.d.ts +2 -23
  31. package/dist/tools/search.d.ts +11 -142
  32. package/dist/tools/slashCommand.d.ts +2 -9
  33. package/dist/tools/web/cache-docs.d.ts +2 -16
  34. package/dist/tools/web/codesearch.d.ts +2 -13
  35. package/dist/tools/web/webfetch.d.ts +2 -13
  36. package/dist/tools/web/websearch.d.ts +2 -11
  37. package/package.json +4 -4
@@ -5,3 +5,4 @@ export * from "./types/index.js";
5
5
  export * from "./interfaces/index.js";
6
6
  export { ConcurrencyController } from "./concurrency.js";
7
7
  export { ParallelAgentManager, parallelAgentManager } from "./manager.js";
8
+ export { taskWAL } from "./persistence/task-wal.js";
@@ -15,6 +15,7 @@ export declare class TaskPoller {
15
15
  private pruneExpiredTasks;
16
16
  private onTaskComplete?;
17
17
  private pollingInterval?;
18
+ private messageCache;
18
19
  constructor(client: OpencodeClient, store: TaskStore, concurrency: ConcurrencyController, notifyParentIfAllComplete: (parentSessionID: string) => Promise<void>, scheduleCleanup: (taskId: string) => void, pruneExpiredTasks: () => void, onTaskComplete?: ((task: ParallelTask) => void | Promise<void>) | undefined);
19
20
  start(): void;
20
21
  stop(): void;
@@ -0,0 +1,11 @@
1
+ export declare class CleanupScheduler {
2
+ private intervals;
3
+ private directory;
4
+ constructor(directory: string);
5
+ start(): void;
6
+ private schedule;
7
+ stop(): void;
8
+ compactWAL(): Promise<void>;
9
+ cleanDocs(): Promise<void>;
10
+ rotateHistory(): Promise<void>;
11
+ }
@@ -5,32 +5,7 @@
5
5
  * This system moves away from explicit signaling (seals) and relies
6
6
  * strictly on file-based state verification.
7
7
  */
8
- export interface MissionLoopState {
9
- /** Whether loop is active */
10
- active: boolean;
11
- /** Current iteration number */
12
- iteration: number;
13
- /** Maximum allowed iterations */
14
- maxIterations: number;
15
- /** Original task prompt */
16
- prompt: string;
17
- /** Session ID */
18
- sessionID: string;
19
- /** When loop started */
20
- startedAt: string;
21
- /** Last activity timestamp */
22
- lastActivity?: string;
23
- /** Last known progress string (e.g., "3/10") */
24
- lastProgress?: string;
25
- /** Number of iterations without progress */
26
- stagnationCount?: number;
27
- }
28
- export interface MissionLoopOptions {
29
- /** Maximum iterations before stopping (default: 1000) */
30
- maxIterations?: number;
31
- /** Countdown seconds before auto-continue (default: 3) */
32
- countdownSeconds?: number;
33
- }
8
+ import type { MissionLoopState, MissionLoopOptions } from "../../shared/loop/interfaces/mission-loop.js";
34
9
  /**
35
10
  * Read loop state from disk
36
11
  */
@@ -71,7 +46,3 @@ export declare function generateCompletionNotification(state: MissionLoopState):
71
46
  * Generate max iterations reached notification
72
47
  */
73
48
  export declare function generateMaxIterationsNotification(state: MissionLoopState): string;
74
- /**
75
- * Stagnation intervention prompt
76
- */
77
- export declare const STAGNATION_INTERVENTION = "\n<system_intervention type=\"stagnation_detected\">\n\u26A0\uFE0F **\uACBD\uACE0: \uC9C4\uD589 \uC815\uCCB4 \uAC10\uC9C0 (STAGNATION DETECTED)**\n\uCD5C\uADFC \uC5EC\uB7EC \uD134 \uB3D9\uC548 \uC2E4\uC9C8\uC801\uC778 \uC9C4\uC804\uC774 \uAC10\uC9C0\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uB2E8\uC21C \"\uBAA8\uB2C8\uD130\uB9C1\"\uC774\uB098 \uAC19\uC740 \uD589\uB3D9\uC744 \uBC18\uBCF5\uD558\uB294 \uAC83\uC740 \uAE08\uC9C0\uB429\uB2C8\uB2E4.\n\n**\uC790\uC728\uC801 \uC9C4\uB2E8 \uBC0F \uD574\uACB0 \uC9C0\uCE68:**\n1. **\uC2E4\uC2DC\uAC04 \uB85C\uADF8 \uD655\uC778**: `check_background_task` \uB610\uB294 `read_file`\uC744 \uC0AC\uC6A9\uD558\uC5EC \uC9C4\uD589 \uC911\uC778 \uC791\uC5C5\uC758 \uCD9C\uB825 \uB85C\uADF8\uB97C \uC9C1\uC811 \uD655\uC778\uD558\uC2ED\uC2DC\uC624.\n2. **\uD504\uB85C\uC138\uC2A4 \uC0DD\uC874 \uC9C4\uB2E8**: \uC791\uC5C5\uC774 \uC880\uBE44 \uC0C1\uD0DC\uC774\uAC70\uB098 \uBA48\uCD98 \uAC83 \uAC19\uB2E4\uBA74 \uACFC\uAC10\uD558\uAC8C `kill`\uD558\uACE0 \uB2E8\uACC4\uB97C \uC138\uBD84\uD654\uD558\uC5EC \uB2E4\uC2DC \uC2E4\uD589\uD558\uC2ED\uC2DC\uC624.\n3. **\uC804\uB7B5 \uC804\uD658**: \uB3D9\uC77C\uD55C \uC811\uADFC \uBC29\uC2DD\uC774 \uC2E4\uD328\uD558\uACE0 \uC788\uB2E4\uBA74, \uB2E4\uB978 \uB3C4\uAD6C\uB098 \uBC29\uBC95\uC744 \uC0AC\uC6A9\uD558\uC5EC \uBAA9\uD45C\uC5D0 \uB3C4\uB2EC\uD558\uC2ED\uC2DC\uC624.\n\n**\uC9C0\uAE08 \uBC14\uB85C \uB2A5\uB3D9\uC801\uC73C\uB85C \uAC1C\uC785\uD558\uC2ED\uC2DC\uC624. \uB300\uAE30\uD558\uC9C0 \uB9C8\uC2ED\uC2DC\uC624.**\n</system_intervention>";
@@ -13,12 +13,14 @@
13
13
  import type { PluginInput } from "@opencode-ai/plugin";
14
14
  import type { ConcurrencyController } from "../agents/concurrency.js";
15
15
  import { type TaskStatus, type TrackedTask, type TaskCompletionInfo } from "../../shared/index.js";
16
+ import type { TodoSyncService } from "../sync/todo-sync-service.js";
16
17
  export type { TaskStatus, TrackedTask, TaskCompletionInfo } from "../../shared/index.js";
17
18
  type OpencodeClient = PluginInput["client"];
18
19
  export declare class TaskToastManager {
19
20
  private tasks;
20
21
  private client;
21
22
  private concurrency;
23
+ private todoSync;
22
24
  /**
23
25
  * Initialize the manager with OpenCode client
24
26
  */
@@ -27,6 +29,10 @@ export declare class TaskToastManager {
27
29
  * Set concurrency controller (can be set after init)
28
30
  */
29
31
  setConcurrencyController(concurrency: ConcurrencyController): void;
32
+ /**
33
+ * Set TodoSyncService for TUI status synchronization
34
+ */
35
+ setTodoSync(service: TodoSyncService): void;
30
36
  /**
31
37
  * Add a new task and show consolidated toast
32
38
  */
@@ -0,0 +1,5 @@
1
+ import { type Todo } from "../../shared/index.js";
2
+ /**
3
+ * Parses markdown content into Todo objects
4
+ */
5
+ export declare function parseTodoMd(content: string): Todo[];
@@ -0,0 +1,35 @@
1
+ import type { PluginInput } from "@opencode-ai/plugin";
2
+ type OpencodeClient = PluginInput["client"];
3
+ interface TrackedTaskTodo {
4
+ id: string;
5
+ description: string;
6
+ status: string;
7
+ agent: string;
8
+ isBackground: boolean;
9
+ parentSessionID?: string;
10
+ }
11
+ export declare class TodoSyncService {
12
+ private client;
13
+ private directory;
14
+ private todoPath;
15
+ private fileTodos;
16
+ private taskTodos;
17
+ private updateTimeout;
18
+ private watcher;
19
+ private activeSessions;
20
+ constructor(client: OpencodeClient, directory: string);
21
+ start(): Promise<void>;
22
+ registerSession(sessionID: string): void;
23
+ unregisterSession(sessionID: string): void;
24
+ private reloadFileTodos;
25
+ /**
26
+ * Called by TaskToastManager when tasks change
27
+ */
28
+ updateTaskStatus(task: TrackedTaskTodo): void;
29
+ removeTask(taskId: string): void;
30
+ private broadcastUpdate;
31
+ private scheduleUpdate;
32
+ private sendTodosToSession;
33
+ stop(): void;
34
+ }
35
+ export {};
@@ -19,15 +19,15 @@ export declare class HookRegistry {
19
19
  private prepareMetadata;
20
20
  private sortHooks;
21
21
  private topologicalSort;
22
- executePreTool(ctx: HookContext, tool: string, args: any): Promise<{
22
+ executePreTool(ctx: HookContext, tool: string, args: Record<string, unknown>): Promise<{
23
23
  action: typeof HOOK_ACTIONS.ALLOW | typeof HOOK_ACTIONS.BLOCK | typeof HOOK_ACTIONS.MODIFY;
24
- modifiedArgs?: any;
24
+ modifiedArgs?: Record<string, unknown>;
25
25
  reason?: string;
26
26
  }>;
27
- executePostTool(ctx: HookContext, tool: string, input: any, output: {
27
+ executePostTool(ctx: HookContext, tool: string, input: Record<string, unknown>, output: {
28
28
  title: string;
29
29
  output: string;
30
- metadata: any;
30
+ metadata: Record<string, unknown>;
31
31
  }): Promise<void>;
32
32
  executeChat(ctx: HookContext, message: string): Promise<{
33
33
  action: typeof HOOK_ACTIONS.PROCESS | typeof HOOK_ACTIONS.INTERCEPT;
@@ -7,7 +7,7 @@ export interface HookContext {
7
7
  sessionID: string;
8
8
  agent?: string;
9
9
  directory: string;
10
- sessions: Map<string, any>;
10
+ sessions: Map<string, unknown>;
11
11
  }
12
12
  export interface HookMetadata {
13
13
  name: string;
@@ -31,9 +31,9 @@ export type HookResult = {
31
31
  */
32
32
  export interface PreToolUseHook {
33
33
  name: string;
34
- execute(context: HookContext, tool: string, args: any): Promise<{
34
+ execute(context: HookContext, tool: string, args: Record<string, unknown>): Promise<{
35
35
  action: typeof HOOK_ACTIONS.ALLOW | typeof HOOK_ACTIONS.BLOCK | typeof HOOK_ACTIONS.MODIFY;
36
- modifiedArgs?: any;
36
+ modifiedArgs?: Record<string, unknown>;
37
37
  reason?: string;
38
38
  }>;
39
39
  }
@@ -43,10 +43,10 @@ export interface PreToolUseHook {
43
43
  */
44
44
  export interface PostToolUseHook {
45
45
  name: string;
46
- execute(context: HookContext, tool: string, input: any, output: {
46
+ execute(context: HookContext, tool: string, input: Record<string, unknown>, output: {
47
47
  title: string;
48
48
  output: string;
49
- metadata: any;
49
+ metadata: Record<string, unknown>;
50
50
  }): Promise<{
51
51
  output?: string;
52
52
  }>;