opencode-orchestrator 1.2.4 → 1.2.11

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 (34) hide show
  1. package/README.md +8 -2
  2. package/dist/core/agents/agent-registry.d.ts +0 -1
  3. package/dist/core/loop/mission-loop.d.ts +1 -30
  4. package/dist/hooks/registry.d.ts +4 -4
  5. package/dist/hooks/types.d.ts +5 -5
  6. package/dist/index.js +15596 -1802
  7. package/dist/plugin-handlers/chat-message-handler.d.ts +17 -1
  8. package/dist/plugin-handlers/interfaces/index.d.ts +1 -0
  9. package/dist/plugin-handlers/interfaces/tool-hook.d.ts +14 -0
  10. package/dist/plugin-handlers/tool-execute-handler.d.ts +2 -11
  11. package/dist/plugin-handlers/tool-execute-pre-handler.d.ts +2 -7
  12. package/dist/shared/constants/system-messages.d.ts +2 -0
  13. package/dist/shared/loop/interfaces/index.d.ts +3 -2
  14. package/dist/shared/loop/interfaces/mission-loop.d.ts +29 -0
  15. package/dist/tools/ast/index.d.ts +3 -28
  16. package/dist/tools/background-cmd/check.d.ts +2 -11
  17. package/dist/tools/background-cmd/kill.d.ts +2 -9
  18. package/dist/tools/background-cmd/list.d.ts +2 -14
  19. package/dist/tools/background-cmd/run.d.ts +2 -15
  20. package/dist/tools/callAgent.d.ts +2 -17
  21. package/dist/tools/lsp/index.d.ts +2 -11
  22. package/dist/tools/parallel/cancel-task.d.ts +2 -9
  23. package/dist/tools/parallel/delegate-task.d.ts +2 -25
  24. package/dist/tools/parallel/get-task-result.d.ts +2 -9
  25. package/dist/tools/parallel/list-tasks.d.ts +2 -9
  26. package/dist/tools/parallel/update-todo.d.ts +2 -23
  27. package/dist/tools/search.d.ts +11 -142
  28. package/dist/tools/slashCommand.d.ts +2 -9
  29. package/dist/tools/web/cache-docs.d.ts +2 -16
  30. package/dist/tools/web/codesearch.d.ts +2 -13
  31. package/dist/tools/web/webfetch.d.ts +2 -13
  32. package/dist/tools/web/websearch.d.ts +2 -11
  33. package/package.json +4 -4
  34. package/dist/core/progress/terminal-monitor.d.ts +0 -13
package/README.md CHANGED
@@ -93,8 +93,14 @@ Combines LLM reasoning with deterministic **AST/LSP verification**. Every code c
93
93
  - **Diagnostic Intervention**: Forces the agent into a "Diagnostic Mode" when stagnation is detected, mandating log audits and strategy pivots.
94
94
  - **Proactive Agency**: Mandates Speculative Planning and Parallel Thinking during background task execution.
95
95
 
96
- ### 📊 Real-time TUI Monitor
97
- A live dashboard directly in your TUI. Monitor **Mission Progress**, active **Agent Sub-sessions**, and **Technical Metrics** through optimized, protocol-safe channels.
96
+ ### 📊 Native TUI Integration
97
+ Seamless integration with OpenCode's native TUI via **TaskToastManager**. Provides non-intrusive, real-time feedback on **Mission Progress**, active **Agent Sub-sessions**, and **Technical Metrics** using protocol-safe Toast notifications.
98
+
99
+ ### ⚡ Event-Driven Architecture
100
+ Utilizes a hybrid event-driven pipeline (`EventHandler` + `TaskPoller`) to maximize responsiveness while maintaining robust state tracking and resource cleanup.
101
+
102
+ ### 🔒 Secure Configuration
103
+ Runtime agent configuration is strictly validated using **Zod schemas**, ensuring that custom agent definitions in `agents.json` are type-safe and error-free before execution.
98
104
 
99
105
  ---
100
106
 
@@ -25,5 +25,4 @@ export declare class AgentRegistry {
25
25
  * Load custom agents from .opencode/agents.json
26
26
  */
27
27
  private loadCustomAgents;
28
- private isValidAgentDefinition;
29
28
  }
@@ -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>";
@@ -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
  }>;