opencode-orchestrator 0.9.64 → 0.9.67

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 (92) hide show
  1. package/README.md +5 -15
  2. package/bin/orchestrator +0 -0
  3. package/bin/orchestrator-linux-arm64 +0 -0
  4. package/bin/orchestrator-linux-x64 +0 -0
  5. package/bin/orchestrator-macos-arm64 +0 -0
  6. package/bin/orchestrator-macos-x64 +0 -0
  7. package/bin/orchestrator-windows-x64.exe +0 -0
  8. package/dist/agents/prompts/common/ast.d.ts +4 -0
  9. package/dist/agents/prompts/common/index.d.ts +2 -0
  10. package/dist/agents/prompts/common/lsp.d.ts +4 -0
  11. package/dist/agents/prompts/reviewer/index.d.ts +1 -0
  12. package/dist/agents/prompts/reviewer/lsp-tools.d.ts +1 -0
  13. package/dist/agents/prompts/worker/index.d.ts +1 -0
  14. package/dist/agents/prompts/worker/lsp-tools.d.ts +1 -0
  15. package/dist/core/commands/types/background-task-status.d.ts +13 -1
  16. package/dist/core/context/context-window-monitor.d.ts +59 -0
  17. package/dist/core/context/index.d.ts +6 -0
  18. package/dist/core/loop/mission-seal.d.ts +1 -1
  19. package/dist/index.js +901 -570
  20. package/dist/shared/agent/constants/index.d.ts +0 -2
  21. package/dist/shared/agent/constants/names.d.ts +1 -0
  22. package/dist/shared/agent/index.d.ts +2 -1
  23. package/dist/shared/agent/types/index.d.ts +1 -0
  24. package/dist/shared/agent/types/status-types.d.ts +5 -0
  25. package/dist/shared/agent/utils/index.d.ts +7 -0
  26. package/dist/shared/core/constants/cli.d.ts +26 -0
  27. package/dist/shared/core/constants/index.d.ts +3 -0
  28. package/dist/shared/core/constants/limits.d.ts +19 -0
  29. package/dist/shared/core/constants/status-labels.d.ts +32 -0
  30. package/dist/shared/errors/constants/error-patterns.d.ts +13 -0
  31. package/dist/shared/errors/constants/error-type.d.ts +13 -0
  32. package/dist/shared/errors/constants/index.d.ts +5 -0
  33. package/dist/shared/errors/detection.d.ts +1 -1
  34. package/dist/shared/errors/index.d.ts +2 -2
  35. package/dist/shared/errors/retry.d.ts +1 -1
  36. package/dist/shared/errors/types/error-pattern-type.d.ts +5 -0
  37. package/dist/shared/errors/types/index.d.ts +4 -0
  38. package/dist/shared/loop/constants/mission-seal.d.ts +2 -2
  39. package/dist/shared/prompt/constants/status.d.ts +17 -16
  40. package/dist/shared/session/constants/events/document-events.d.ts +7 -0
  41. package/dist/shared/session/constants/events/index.d.ts +28 -0
  42. package/dist/shared/session/constants/events/message-events.d.ts +6 -0
  43. package/dist/shared/session/constants/events/mission-events.d.ts +8 -0
  44. package/dist/shared/session/constants/events/session-events.d.ts +10 -0
  45. package/dist/shared/session/constants/events/special-events.d.ts +6 -0
  46. package/dist/shared/session/constants/events/task-events.d.ts +9 -0
  47. package/dist/shared/session/constants/events/todo-events.d.ts +8 -0
  48. package/dist/shared/session/constants/index.d.ts +1 -4
  49. package/dist/shared/tool/constants/common/index.d.ts +7 -0
  50. package/dist/shared/tool/constants/common/labels.d.ts +16 -0
  51. package/dist/shared/tool/constants/common/languages.d.ts +9 -0
  52. package/dist/shared/tool/constants/common/output-labels.d.ts +20 -0
  53. package/dist/shared/tool/constants/common/sources.d.ts +8 -0
  54. package/dist/shared/tool/constants/index.d.ts +3 -0
  55. package/dist/shared/tool/constants/lsp/index.d.ts +5 -0
  56. package/dist/shared/tool/constants/lsp/lsp-severity-labels.d.ts +9 -0
  57. package/dist/shared/tool/constants/lsp/lsp-severity.d.ts +9 -0
  58. package/dist/shared/tool/constants/parallel/index.d.ts +4 -0
  59. package/dist/shared/tool/constants/parallel/logging.d.ts +6 -0
  60. package/dist/shared/tool/constants/tool-names.d.ts +3 -0
  61. package/dist/shared/tool/index.d.ts +1 -0
  62. package/dist/shared/tool/interfaces/ast/ast-replace-result.d.ts +8 -0
  63. package/dist/shared/tool/interfaces/ast/ast-search-result.d.ts +13 -0
  64. package/dist/shared/tool/interfaces/ast/index.d.ts +5 -0
  65. package/dist/shared/tool/interfaces/index.d.ts +6 -0
  66. package/dist/shared/tool/interfaces/lsp/index.d.ts +7 -0
  67. package/dist/shared/tool/interfaces/lsp/lsp-command-result.d.ts +8 -0
  68. package/dist/shared/tool/interfaces/lsp/lsp-diagnostic.d.ts +11 -0
  69. package/dist/shared/tool/interfaces/lsp/lsp-rename-location.d.ts +9 -0
  70. package/dist/shared/tool/interfaces/lsp/lsp-rename-result.d.ts +9 -0
  71. package/dist/shared/tool/interfaces/parallel/index.d.ts +5 -0
  72. package/dist/shared/tool/interfaces/parallel/poll-result.d.ts +10 -0
  73. package/dist/shared/tool/interfaces/parallel/session-client.d.ts +47 -0
  74. package/dist/tools/ast/index.d.ts +41 -0
  75. package/dist/tools/lsp/index.d.ts +20 -0
  76. package/dist/tools/search.d.ts +10 -0
  77. package/dist/utils/sanity/checker.d.ts +8 -0
  78. package/dist/utils/sanity/constants/escalation-prompt.d.ts +4 -0
  79. package/dist/utils/sanity/constants/index.d.ts +6 -0
  80. package/dist/utils/sanity/constants/recovery-prompt.d.ts +4 -0
  81. package/dist/utils/sanity/constants/severity.d.ts +8 -0
  82. package/dist/utils/sanity/index.d.ts +7 -0
  83. package/dist/utils/sanity/interfaces/index.d.ts +4 -0
  84. package/dist/utils/sanity/interfaces/sanity-result.d.ts +9 -0
  85. package/dist/utils/sanity/types/index.d.ts +4 -0
  86. package/dist/utils/sanity/types/severity.d.ts +5 -0
  87. package/package.json +20 -6
  88. package/dist/shared/agent/constants/status.d.ts +0 -15
  89. package/dist/shared/errors/patterns.d.ts +0 -27
  90. package/dist/shared/session/constants/event-types.d.ts +0 -77
  91. package/dist/shared/session/constants/session-events.d.ts +0 -17
  92. package/dist/utils/sanity.d.ts +0 -33
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <img src="assets/starship_approaching_planet.png" alt="logo" width="280" />
2
+ <img src="assets/logo.png" alt="logo" width="280" />
3
3
  <h1>OpenCode Orchestrator</h1>
4
4
 
5
5
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
@@ -9,7 +9,6 @@
9
9
 
10
10
  > **🚀🪐 Multi-Agent Orchestration Plugin for [OpenCode](https://opencode.ai)**
11
11
 
12
- ---
13
12
 
14
13
  ## ⚡ Quick Start
15
14
 
@@ -22,8 +21,6 @@ Then in OpenCode:
22
21
  /task "Build a REST API with authentication"
23
22
  ```
24
23
 
25
- ---
26
-
27
24
  ## ⭐ Core Philosophy
28
25
 
29
26
  ```
@@ -33,9 +30,8 @@ Then in OpenCode:
33
30
  └───────────────────────────────────────────────────┘
34
31
  ```
35
32
 
36
- ---
37
33
 
38
- ## 👨‍🚀 The Agents (Crews)
34
+ ## The Agents
39
35
 
40
36
  | Agent | Role | What It Does |
41
37
  |:------|:-----|:-------------|
@@ -44,7 +40,6 @@ Then in OpenCode:
44
40
  | 🔨 **Worker** | Implementer | Writes code, modifies files, follows the project's patterns |
45
41
  | ✅ **Reviewer** | Verifier | Tests changes, checks for errors, confirms quality |
46
42
 
47
- ---
48
43
 
49
44
  ## 📖 Core Principles
50
45
 
@@ -56,9 +51,8 @@ Then in OpenCode:
56
51
  | 🔄 **Adapt to the Project** | Match the project's existing style and patterns |
57
52
  | 🤝 **Specialized Roles** | Each agent has a clear, focused responsibility |
58
53
 
59
- ---
60
54
 
61
- ## 🏛️ Workflow
55
+ ## 🏛️ Workflow Architecture
62
56
 
63
57
  ```
64
58
  /task "Build REST API"
@@ -71,7 +65,7 @@ Then in OpenCode:
71
65
  ▼ ▼ ▼
72
66
  ┌───────┐ ┌───────┐ ┌───────┐
73
67
  │PLANNER│ │WORKER │ │WORKER │ ← 🔥 50 PARALLEL
74
- │plan.md│ │auth.ts│ │api.ts │ TASKS
68
+ │plan.md│ │auth.ts│ │api.ts │ TASKS CONCURRENTLY
75
69
  └───────┘ └───────┘ └───────┘
76
70
  │ │ │
77
71
  └───────────────┼───────────────┘
@@ -100,9 +94,8 @@ Then in OpenCode:
100
94
  | 🩹 **Auto-Recovery** | Retry failed tasks automatically (up to 3 times) |
101
95
  | 🧬 **Adaptive AI** | Agents learn and adapt based on the project |
102
96
 
103
- ---
104
97
 
105
- ## 🚨 Error Handling
98
+ ## Error Handling
106
99
 
107
100
  | Error | What Happens |
108
101
  |:------|:-------------|
@@ -112,19 +105,16 @@ Then in OpenCode:
112
105
  | ⏱️ Session timeout | Resume from the last checkpoint |
113
106
  | 🔨 Build failure | Fix the issue and retry |
114
107
 
115
- ---
116
108
 
117
109
  ## 📚 Documentation
118
110
 
119
111
  - **[System Architecture](docs/SYSTEM_ARCHITECTURE.md)** — Full technical deep-dive
120
112
 
121
- ---
122
113
 
123
114
  ## 🎹 Developer's Words
124
115
 
125
116
  > [Read the full note →](docs/DEVELOPERS_NOTE.md)
126
117
 
127
- ---
128
118
 
129
119
  ## 📄 License
130
120
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ /**
2
+ * AST Tools Prompt (Common)
3
+ */
4
+ export declare const SHARED_AST_TOOLS: string;
@@ -10,3 +10,5 @@ export { SHARED_WORKSPACE } from "./shared-workspace.js";
10
10
  export { MISSION_SEAL_RULES } from "./mission-seal.js";
11
11
  export { VERIFICATION_REQUIREMENTS } from "./verification.js";
12
12
  export { CORE_PHILOSOPHY } from "./core-philosophy.js";
13
+ export { SHARED_LSP_TOOLS } from "./lsp.js";
14
+ export { SHARED_AST_TOOLS } from "./ast.js";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * LSP Tools Prompt (Common)
3
+ */
4
+ export declare const SHARED_LSP_TOOLS: string;
@@ -10,3 +10,4 @@ export { REVIEWER_OUTPUT } from "./output.js";
10
10
  export { REVIEWER_ASYNC_MONITORING } from "./async-monitoring.js";
11
11
  export { REVIEWER_INTEGRATION_TESTING } from "./integration-testing.js";
12
12
  export { REVIEWER_SYNC_VERIFICATION } from "./sync-verification.js";
13
+ export { REVIEWER_LSP_TOOLS } from "./lsp-tools.js";
@@ -0,0 +1 @@
1
+ export declare const REVIEWER_LSP_TOOLS: string;
@@ -9,3 +9,4 @@ export { WORKER_QUALITY } from "./quality.js";
9
9
  export { WORKER_TDD_WORKFLOW } from "./tdd-workflow.js";
10
10
  export { WORKER_ISOLATION_TESTING } from "./isolation-testing.js";
11
11
  export { WORKER_FILE_ASSIGNMENT } from "./file-assignment.js";
12
+ export { WORKER_LSP_TOOLS } from "./lsp-tools.js";
@@ -0,0 +1 @@
1
+ export declare const WORKER_LSP_TOOLS: string;
@@ -1,4 +1,16 @@
1
1
  /**
2
2
  * BackgroundTaskStatus - Task status union type
3
+ * Uses STATUS_LABEL constants for consistency
3
4
  */
4
- export type BackgroundTaskStatus = "pending" | "running" | "done" | "error" | "timeout";
5
+ import { STATUS_LABEL } from "../../../shared/index.js";
6
+ export type BackgroundTaskStatus = typeof STATUS_LABEL.PENDING | typeof STATUS_LABEL.RUNNING | typeof STATUS_LABEL.DONE | typeof STATUS_LABEL.ERROR | typeof STATUS_LABEL.TIMEOUT;
7
+ /**
8
+ * Background task status constants
9
+ */
10
+ export declare const BACKGROUND_TASK_STATUS: {
11
+ readonly PENDING: "pending";
12
+ readonly RUNNING: "running";
13
+ readonly DONE: "done";
14
+ readonly ERROR: "error";
15
+ readonly TIMEOUT: "timeout";
16
+ };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Context Window Monitor
3
+ *
4
+ * Monitors context window usage and alerts when thresholds are exceeded.
5
+ *
6
+ * Thresholds:
7
+ * - 70%: Info alert - "Still plenty of headroom"
8
+ * - 85%: Warning - Consider compaction
9
+ * - 95%: Critical - Immediate action needed
10
+ */
11
+ export declare const CONTEXT_THRESHOLDS: {
12
+ /** Info level - remind agent there's still room */
13
+ readonly INFO: 0.7;
14
+ /** Warning level - consider compaction soon */
15
+ readonly WARNING: 0.85;
16
+ /** Critical level - immediate action needed */
17
+ readonly CRITICAL: 0.95;
18
+ };
19
+ export declare const CONTEXT_MONITOR_CONFIG: {
20
+ /** Default max tokens for most models */
21
+ readonly DEFAULT_MAX_TOKENS: 200000;
22
+ /** Check interval in milliseconds */
23
+ readonly CHECK_INTERVAL_MS: 30000;
24
+ /** Minimum time between alerts (ms) */
25
+ readonly ALERT_COOLDOWN_MS: 60000;
26
+ };
27
+ /**
28
+ * Calculate context usage percentage
29
+ */
30
+ export declare function calculateUsage(usedTokens: number, maxTokens: number): number;
31
+ /**
32
+ * Get alert level based on usage
33
+ */
34
+ export declare function getAlertLevel(usage: number): "info" | "warning" | "critical" | null;
35
+ /**
36
+ * Format usage for display
37
+ */
38
+ export declare function formatUsage(usage: number, usedTokens: number, maxTokens: number): string;
39
+ /**
40
+ * Check context window usage and alert if needed
41
+ */
42
+ export declare function checkContextWindow(sessionID: string, usedTokens: number, maxTokens?: number): void;
43
+ /**
44
+ * Get injection prompt for context-aware agents
45
+ * This reminds agents about context status when usage is high
46
+ */
47
+ export declare function getContextInjection(usedTokens: number, maxTokens?: number): string | null;
48
+ /**
49
+ * Cleanup session state
50
+ */
51
+ export declare function cleanupSession(sessionID: string): void;
52
+ /**
53
+ * Get current monitor status for debugging
54
+ */
55
+ export declare function getMonitorStatus(sessionID: string): {
56
+ lastAlertTime: number;
57
+ lastAlertLevel: string | null;
58
+ isMonitoring: boolean;
59
+ } | null;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Context Module
3
+ *
4
+ * Context window monitoring and management utilities.
5
+ */
6
+ export { checkContextWindow, getContextInjection, cleanupSession, getMonitorStatus, calculateUsage, getAlertLevel, formatUsage, CONTEXT_THRESHOLDS, CONTEXT_MONITOR_CONFIG, } from "./context-window-monitor.js";
@@ -33,7 +33,7 @@ export interface MissionLoopState {
33
33
  lastActivity?: string;
34
34
  }
35
35
  export interface MissionLoopOptions {
36
- /** Maximum iterations before stopping (default: 20) */
36
+ /** Maximum iterations before stopping (default: 1000) */
37
37
  maxIterations?: number;
38
38
  /** Countdown seconds before auto-continue (default: 3) */
39
39
  countdownSeconds?: number;