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.
- package/README.md +5 -15
- package/bin/orchestrator +0 -0
- package/bin/orchestrator-linux-arm64 +0 -0
- package/bin/orchestrator-linux-x64 +0 -0
- package/bin/orchestrator-macos-arm64 +0 -0
- package/bin/orchestrator-macos-x64 +0 -0
- package/bin/orchestrator-windows-x64.exe +0 -0
- package/dist/agents/prompts/common/ast.d.ts +4 -0
- package/dist/agents/prompts/common/index.d.ts +2 -0
- package/dist/agents/prompts/common/lsp.d.ts +4 -0
- package/dist/agents/prompts/reviewer/index.d.ts +1 -0
- package/dist/agents/prompts/reviewer/lsp-tools.d.ts +1 -0
- package/dist/agents/prompts/worker/index.d.ts +1 -0
- package/dist/agents/prompts/worker/lsp-tools.d.ts +1 -0
- package/dist/core/commands/types/background-task-status.d.ts +13 -1
- package/dist/core/context/context-window-monitor.d.ts +59 -0
- package/dist/core/context/index.d.ts +6 -0
- package/dist/core/loop/mission-seal.d.ts +1 -1
- package/dist/index.js +901 -570
- package/dist/shared/agent/constants/index.d.ts +0 -2
- package/dist/shared/agent/constants/names.d.ts +1 -0
- package/dist/shared/agent/index.d.ts +2 -1
- package/dist/shared/agent/types/index.d.ts +1 -0
- package/dist/shared/agent/types/status-types.d.ts +5 -0
- package/dist/shared/agent/utils/index.d.ts +7 -0
- package/dist/shared/core/constants/cli.d.ts +26 -0
- package/dist/shared/core/constants/index.d.ts +3 -0
- package/dist/shared/core/constants/limits.d.ts +19 -0
- package/dist/shared/core/constants/status-labels.d.ts +32 -0
- package/dist/shared/errors/constants/error-patterns.d.ts +13 -0
- package/dist/shared/errors/constants/error-type.d.ts +13 -0
- package/dist/shared/errors/constants/index.d.ts +5 -0
- package/dist/shared/errors/detection.d.ts +1 -1
- package/dist/shared/errors/index.d.ts +2 -2
- package/dist/shared/errors/retry.d.ts +1 -1
- package/dist/shared/errors/types/error-pattern-type.d.ts +5 -0
- package/dist/shared/errors/types/index.d.ts +4 -0
- package/dist/shared/loop/constants/mission-seal.d.ts +2 -2
- package/dist/shared/prompt/constants/status.d.ts +17 -16
- package/dist/shared/session/constants/events/document-events.d.ts +7 -0
- package/dist/shared/session/constants/events/index.d.ts +28 -0
- package/dist/shared/session/constants/events/message-events.d.ts +6 -0
- package/dist/shared/session/constants/events/mission-events.d.ts +8 -0
- package/dist/shared/session/constants/events/session-events.d.ts +10 -0
- package/dist/shared/session/constants/events/special-events.d.ts +6 -0
- package/dist/shared/session/constants/events/task-events.d.ts +9 -0
- package/dist/shared/session/constants/events/todo-events.d.ts +8 -0
- package/dist/shared/session/constants/index.d.ts +1 -4
- package/dist/shared/tool/constants/common/index.d.ts +7 -0
- package/dist/shared/tool/constants/common/labels.d.ts +16 -0
- package/dist/shared/tool/constants/common/languages.d.ts +9 -0
- package/dist/shared/tool/constants/common/output-labels.d.ts +20 -0
- package/dist/shared/tool/constants/common/sources.d.ts +8 -0
- package/dist/shared/tool/constants/index.d.ts +3 -0
- package/dist/shared/tool/constants/lsp/index.d.ts +5 -0
- package/dist/shared/tool/constants/lsp/lsp-severity-labels.d.ts +9 -0
- package/dist/shared/tool/constants/lsp/lsp-severity.d.ts +9 -0
- package/dist/shared/tool/constants/parallel/index.d.ts +4 -0
- package/dist/shared/tool/constants/parallel/logging.d.ts +6 -0
- package/dist/shared/tool/constants/tool-names.d.ts +3 -0
- package/dist/shared/tool/index.d.ts +1 -0
- package/dist/shared/tool/interfaces/ast/ast-replace-result.d.ts +8 -0
- package/dist/shared/tool/interfaces/ast/ast-search-result.d.ts +13 -0
- package/dist/shared/tool/interfaces/ast/index.d.ts +5 -0
- package/dist/shared/tool/interfaces/index.d.ts +6 -0
- package/dist/shared/tool/interfaces/lsp/index.d.ts +7 -0
- package/dist/shared/tool/interfaces/lsp/lsp-command-result.d.ts +8 -0
- package/dist/shared/tool/interfaces/lsp/lsp-diagnostic.d.ts +11 -0
- package/dist/shared/tool/interfaces/lsp/lsp-rename-location.d.ts +9 -0
- package/dist/shared/tool/interfaces/lsp/lsp-rename-result.d.ts +9 -0
- package/dist/shared/tool/interfaces/parallel/index.d.ts +5 -0
- package/dist/shared/tool/interfaces/parallel/poll-result.d.ts +10 -0
- package/dist/shared/tool/interfaces/parallel/session-client.d.ts +47 -0
- package/dist/tools/ast/index.d.ts +41 -0
- package/dist/tools/lsp/index.d.ts +20 -0
- package/dist/tools/search.d.ts +10 -0
- package/dist/utils/sanity/checker.d.ts +8 -0
- package/dist/utils/sanity/constants/escalation-prompt.d.ts +4 -0
- package/dist/utils/sanity/constants/index.d.ts +6 -0
- package/dist/utils/sanity/constants/recovery-prompt.d.ts +4 -0
- package/dist/utils/sanity/constants/severity.d.ts +8 -0
- package/dist/utils/sanity/index.d.ts +7 -0
- package/dist/utils/sanity/interfaces/index.d.ts +4 -0
- package/dist/utils/sanity/interfaces/sanity-result.d.ts +9 -0
- package/dist/utils/sanity/types/index.d.ts +4 -0
- package/dist/utils/sanity/types/severity.d.ts +5 -0
- package/package.json +20 -6
- package/dist/shared/agent/constants/status.d.ts +0 -15
- package/dist/shared/errors/patterns.d.ts +0 -27
- package/dist/shared/session/constants/event-types.d.ts +0 -77
- package/dist/shared/session/constants/session-events.d.ts +0 -17
- 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/
|
|
2
|
+
<img src="assets/logo.png" alt="logo" width="280" />
|
|
3
3
|
<h1>OpenCode Orchestrator</h1>
|
|
4
4
|
|
|
5
5
|
[](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
|
-
##
|
|
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
|
-
##
|
|
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
|
|
package/bin/orchestrator
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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";
|
|
@@ -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
|
-
|
|
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:
|
|
36
|
+
/** Maximum iterations before stopping (default: 1000) */
|
|
37
37
|
maxIterations?: number;
|
|
38
38
|
/** Countdown seconds before auto-continue (default: 3) */
|
|
39
39
|
countdownSeconds?: number;
|