opencode-orchestrator 1.2.59 โ†’ 1.2.60

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 (2) hide show
  1. package/README.md +66 -115
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,7 +1,14 @@
1
+ <div align="center">
2
+
3
+ > ๐Ÿ” **Also by the same author** โ€” [**pentesting**](https://www.npmjs.com/package/pentesting): Autonomous Penetration Testing AI Agent CLI ยท `npm install -g pentesting` ยท [Homepage](https://pentesting.agnusdei.kr)
4
+
5
+ </div>
6
+
7
+ ---
8
+
1
9
  <div align="center">
2
10
  <img src="assets/logo.png" alt="logo" width="200" />
3
11
  <h1>OpenCode Orchestrator</h1>
4
-
5
12
  <p>Production-Grade Multi-Agent Orchestration Engine for High-Integrity Software Engineering</p>
6
13
 
7
14
  [![MIT License](https://img.shields.io/badge/license-MIT-red.svg)](LICENSE)
@@ -23,8 +30,6 @@ Inside an OpenCode environment:
23
30
 
24
31
  ---
25
32
 
26
- ---
27
-
28
33
  ## ๐Ÿš€ Engine Workflow
29
34
 
30
35
  OpenCode Orchestrator utilizes a **Hub-and-Spoke Topology** with **Work-Stealing Queues** to execute complex engineering tasks through parallel, context-isolated sessions.
@@ -64,13 +69,24 @@ OpenCode Orchestrator utilizes a **Hub-and-Spoke Topology** with **Work-Stealing
64
69
 
65
70
  ---
66
71
 
72
+ ## โšก Elite Multi-Agent Swarm
73
+
74
+ | Agent | Expertise | Capability |
75
+ |:------|:----------|:-----------|
76
+ | **Commander** | Mission Hub | Session pooling, parallel thread control, state rehydration, work-stealing coordination |
77
+ | **Planner** | Architect | Symbolic mapping, dependency research, roadmap generation, file-level planning |
78
+ | **Worker** | Implementer | High-throughput coding, TDD workflow, documentation, isolated file execution |
79
+ | **Reviewer** | Auditor | Rigid verification, LSP/Lint authority, integration testing, final mission seal |
80
+
81
+ ---
82
+
67
83
  ## ๐Ÿ› ๏ธ Core Capabilities
68
84
 
69
85
  ### ๐Ÿ”’ Atomic MVCC State Synchronization
70
- The engine solves the "Concurrent TODO Update" problem using **Multi-Version Concurrency Control (MVCC) + Mutex**. Agents can safely mark tasks as complete in parallel without data loss or race conditions. Every state change is cryptographically hashed and logged for a complete audit trail.
86
+ Solves the "Concurrent TODO Update" problem using **MVCC + Mutex**. Agents safely mark tasks complete in parallel without data loss or race conditions. Every state change is cryptographically hashed and logged.
71
87
 
72
88
  ### ๐Ÿงฉ Advanced Hook Orchestration
73
- Execution flows are governed by a **Priority-Phase Hook Registry**. Hooks (Safety, UI, Protocol) are grouped into phases (`early`, `normal`, `late`) and executed using a **Topological Sort** to handle complex dependencies automatically, ensuring a predictable and stable environment.
89
+ Execution flows governed by a **Priority-Phase Hook Registry**. Hooks are grouped into phases (`early`, `normal`, `late`) and executed via **Topological Sort** for predictable, dependency-aware ordering.
74
90
 
75
91
  ### ๐Ÿ›ก๏ธ Autonomous Recovery
76
92
  - **Self-healing loops** with adaptive stagnation detection
@@ -78,130 +94,57 @@ Execution flows are governed by a **Priority-Phase Hook Registry**. Hooks (Safet
78
94
  - **Auto-retry with backoff**: Exponential backoff for transient failures
79
95
 
80
96
  ### ๐ŸŽฏ State-Level Session Isolation
81
- Reused sessions in the **SessionPool** are explicitly reset using server-side compaction triggered by health monitors. This ensures that previous task context (old error messages, stale file references) never leaks into new tasks, maintaining 100% implementation integrity.
97
+ Reused sessions in the **SessionPool** are explicitly reset via server-side compaction, ensuring previous task context never leaks into new tasks.
82
98
 
83
99
  ### ๐Ÿš€ Zero-Payload Turbo Mode
84
- Leverages `system.transform` to unshift massive agent instruction sets on the server side. This reduces initial message payloads by **90%+**, slashing latency and preventing context fragmentation during long autonomous loops.
85
-
86
- ---
87
-
88
- ## ๐Ÿ› ๏ธ Infrastructure & Reliability
89
-
90
- ### ๐Ÿ”’ Resource Safety & Reliability
91
- - **RAII Pattern (ConcurrencyToken)**: Guaranteed resource cleanup with zero leaks
92
- - **ShutdownManager**: Priority-based graceful shutdown with 5-second timeout per handler
93
- - **Automatic Backups**: All config changes backed up with rollback support
94
- - **Atomic File Operations**: Temp file + rename for corruption-proof writes
95
- - **Finally Blocks**: Guaranteed cleanup in all critical paths
96
- - **Zero Resource Leaks**: File watchers, event listeners, concurrency slots all properly released
97
-
98
- ### โšก Performance Optimizations
99
- - **Work-Stealing Queues**: Chase-Lev deque implementation for 90%+ CPU utilization
100
- - Planner: 2 workers, Worker: 8 workers, Reviewer: 4 workers
101
- - LIFO for owner (cache locality), FIFO for thieves (fairness)
102
- - **Memory Pooling**: 80% GC pressure reduction
103
- - Object Pool: 200 ParallelTask instances (50 prewarmed)
104
- - String Interning: Deduplication for agent names, status strings
105
- - Buffer Pool: Reusable ArrayBuffers (1KB, 4KB, 16KB, 64KB)
106
- - **Session Reuse**: 90% faster session creation (500ms โ†’ 50ms)
107
- - Pool size: 5 sessions per agent type
108
- - Max reuse: 10 times per session
109
- - Health check: Every 60 seconds
110
- - **Rust Connection Pool**: 10x faster tool calls (50-100ms โ†’ 5-10ms)
111
- - Max 4 persistent processes
112
- - 30-second idle timeout
113
- - **Adaptive Polling**: Dynamic 500ms-5s intervals based on system load
114
-
115
- ### ๐Ÿ›ก๏ธ Safety Features
116
- - **Circuit Breaker**: Auto-recovery from API failures (5 failures โ†’ open)
117
- - **Resource Pressure Detection**: Rejects low-priority tasks when memory > 80%
118
- - **Terminal Node Guard**: Prevents infinite recursion (depth limit enforcement)
119
- - **Auto-Scaling**: Concurrency slots adjust based on success/failure rate
120
-
121
- ---
122
-
123
- ## ๐Ÿ› ๏ธ Key Innovations
100
+ Leverages `system.transform` to unshift agent instruction sets server-side, reducing initial message payloads by **90%+** and preventing context fragmentation.
124
101
 
125
102
  ### ๐Ÿง  Hierarchical Memory System
126
- Maintains focus across thousands of conversation turns using a 4-tier memory structure and **EMA-based Context Gating** to preserve "Architectural Truth" while pruning operational noise.
127
-
128
- ### Dynamic Concurrency Auto-Scaling
129
- Slots for parallel implementation scale up automatically after a **3-success streak** and scale down aggressively upon detection of API instability or implementation failures.
130
-
131
- ### ๐Ÿ›ก๏ธ Neuro-Symbolic Safety
132
- Combines LLM reasoning with deterministic **AST/LSP verification**. Every code change is verified by native system tools before being accepted into the master roadmap.
103
+ Maintains focus across thousands of conversation turns using a 4-tier memory structure with **EMA-based Context Gating** to preserve architectural truth while pruning noise.
133
104
 
134
105
  ### ๐Ÿ”„ Adaptive Intelligence Loop
135
- - **Stagnation Detection**: Automatically senses when no progress is made across multiple iterations
136
- - **Diagnostic Intervention**: Forces the agent into a "Diagnostic Mode" when stagnation is detected, mandating log audits and strategy pivots
137
- - **Proactive Agency**: Mandates Speculative Planning and Parallel Thinking during background task execution
138
-
139
- ### ๐Ÿ“Š Native TUI Integration
140
- 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.
141
-
142
- ### โšก Event-Driven Architecture
143
- Utilizes a hybrid event-driven pipeline (`EventHandler` + `TaskPoller`) to maximize responsiveness while maintaining robust state tracking and resource cleanup.
144
-
145
- ### ๐Ÿ”’ Secure Configuration
146
- 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.
106
+ - **Stagnation Detection**: Senses when no progress is made across iterations
107
+ - **Diagnostic Intervention**: Forces "Diagnostic Mode" mandating log audits and strategy pivots
108
+ - **Proactive Agency**: Mandates Speculative Planning during background task execution
147
109
 
148
110
  ---
149
111
 
150
- ## โšก Elite Multi-Agent Swarm
112
+ ## ๏ฟฝ Performance Benchmarks
151
113
 
152
- | Agent | Expertise | Capability |
153
- |:------|:-----|:---|
154
- | **Commander** | Mission Hub | Session pooling, parallel thread control, state rehydration, work-stealing coordination |
155
- | **Planner** | Architect | Symbolic mapping, dependency research, roadmap generation, file-level planning |
156
- | **Worker** | Implementer | High-throughput coding, TDD workflow, documentation, isolated file execution |
157
- | **Reviewer** | Auditor | Rigid verification, LSP/Lint authority, integration testing, final mission seal |
114
+ | Metric | Improvement |
115
+ |:-------|:------------|
116
+ | CPU Utilization | 90%+ (up from 50-70%) |
117
+ | Tool Call Speed | 10x faster (5-10ms vs 50-100ms) via Rust pool |
118
+ | Session Creation | 90% faster (50ms vs 500ms) via session pooling |
119
+ | Memory Usage | 60% reduction via object/string/buffer pooling |
120
+ | GC Pressure | 80% reduction |
121
+ | Token Efficiency | 40% reduction via Incremental State & System Transform |
122
+ | Sync Accuracy | 99.95% via MVCC+Mutex |
123
+ | Parallel Efficiency | 80% improvement (50% โ†’ 90%+) |
158
124
 
159
125
  ---
160
126
 
161
- ## ๐Ÿ“ˆ Performance Benchmarks
162
-
163
- ### Throughput & Efficiency
164
- - **Concurrent Sessions**: 50+ parallel agent sessions with work-stealing
165
- - **CPU Utilization**: 90%+ (up from 50-70%)
166
- - **Tool Call Speed**: 10x faster (5-10ms vs 50-100ms) via Rust connection pool
167
- - **Session Creation**: 90% faster (50ms vs 500ms) via session pooling
168
- - **Processing Speed**: 3-5x baseline throughput
127
+ ## ๐Ÿ—๏ธ Infrastructure & Reliability
169
128
 
170
- ### Resource Efficiency
171
- - **Memory Usage**: 60% reduction (40% of baseline) via pooling
172
- - **GC Pressure**: 80% reduction via object/string/buffer pooling
173
- - **Token Efficiency**: 40% reduction via Incremental State & System Transform
174
-
175
- ### Reliability
176
- - **Sync Accuracy**: 99.95% reliability via MVCC+Mutex transaction logic
177
- - **Mission Survival**: 100% uptime through plugin restarts via S.H.R (Self-Healing Rehydration)
178
- - **Resource Leaks**: Zero (guaranteed by RAII pattern)
179
- - **Config Safety**: 100% (atomic writes + auto-backup + rollback)
180
-
181
- ### Scalability
182
- - **Work-Stealing Efficiency**: 80% improvement in parallel efficiency (50% โ†’ 90%+)
183
- - **Adaptive Polling**: Dynamic 500ms-5s based on load
184
- - **Auto-Scaling**: Concurrency slots adjust automatically based on success rate
185
-
186
- ---
129
+ ### Resource Safety
130
+ - **RAII Pattern**: Guaranteed resource cleanup with zero leaks
131
+ - **ShutdownManager**: Priority-based graceful shutdown (5s timeout per handler)
132
+ - **Atomic File Operations**: Temp file + rename for corruption-proof writes
133
+ - **Automatic Backups**: Timestamped config backups with rollback support
187
134
 
188
- ## ๐Ÿ—๏ธ Technical Stack
135
+ ### Safety Features
136
+ - **Circuit Breaker**: Auto-recovery from API failures (5 failures โ†’ open)
137
+ - **Resource Pressure Detection**: Rejects low-priority tasks when memory > 80%
138
+ - **Terminal Node Guard**: Prevents infinite recursion via depth limit
139
+ - **Auto-Scaling**: Concurrency slots adjust based on success/failure rate
189
140
 
141
+ ### Technical Stack
190
142
  - **Runtime**: Node.js 18+ (TypeScript)
191
143
  - **Tools**: Rust-based CLI tools (grep, glob, ast) via connection pool
192
144
  - **Concurrency**: Chase-Lev work-stealing deque + priority queues
193
145
  - **Memory**: Object pooling + string interning + buffer pooling
194
146
  - **State Management**: MVCC + Mutex
195
- - **Safety**: RAII pattern + circuit breaker + resource pressure detection
196
-
197
- ---
198
-
199
- ## ๐Ÿ“š Documentation
200
-
201
- - [Why We Built a Custom Orchestrator Instead of Using OpenCode's APIs โ†’](docs/WHY_CUSTOM_ORCHESTRATOR.md)
202
- - [System Architecture Deep-Dive โ†’](docs/SYSTEM_ARCHITECTURE.md)
203
- - [Windows Configuration Guide โ†’](docs/WINDOWS_CONFIGURATION.md)
204
- - [Developer Notes โ†’](docs/DEVELOPERS_NOTE.md)
147
+ - **Safety**: RAII + circuit breaker + resource pressure detection
205
148
 
206
149
  ---
207
150
 
@@ -210,12 +153,11 @@ Runtime agent configuration is strictly validated using **Zod schemas**, ensurin
210
153
  ### Safe Installation
211
154
  The installation process is **production-safe** with multiple protection layers:
212
155
 
213
- 1. โœ… **Never overwrites** - always merges with existing config
214
- 2. โœ… **Automatic backups** - timestamped, last 5 kept
215
- 3. โœ… **Atomic writes** - temp file + rename (OS-level atomic)
216
- 4. โœ… **Write verification** - ensures correctness after every change
217
- 5. โœ… **Automatic rollback** - restores from backup on any failure
218
- 6. โœ… **Cross-platform** - Windows (native, Git Bash, WSL), macOS, Linux
156
+ 1. โœ… **Never overwrites** โ€” always merges with existing config
157
+ 2. โœ… **Automatic backups** โ€” timestamped, last 5 kept
158
+ 3. โœ… **Atomic writes** โ€” temp file + rename (OS-level atomic)
159
+ 4. โœ… **Automatic rollback** โ€” restores from backup on any failure
160
+ 5. โœ… **Cross-platform** โ€” Windows (native, Git Bash, WSL2), macOS, Linux
219
161
 
220
162
  ### Configuration Logs
221
163
  - Unix: `/tmp/opencode-orchestrator.log`
@@ -223,9 +165,18 @@ The installation process is **production-safe** with multiple protection layers:
223
165
 
224
166
  ---
225
167
 
168
+ ## ๐Ÿ“š Documentation
169
+
170
+ - [Why We Built a Custom Orchestrator โ†’](docs/WHY_CUSTOM_ORCHESTRATOR.md)
171
+ - [System Architecture Deep-Dive โ†’](docs/SYSTEM_ARCHITECTURE.md)
172
+ - [Windows Configuration Guide โ†’](docs/WINDOWS_CONFIGURATION.md)
173
+ - [Developer Notes โ†’](docs/DEVELOPERS_NOTE.md)
174
+
175
+ ---
176
+
226
177
  ## ๐Ÿ“„ License
227
178
 
228
- MIT License - see [LICENSE](LICENSE) for details.
179
+ MIT License โ€” see [LICENSE](LICENSE) for details.
229
180
 
230
181
  ---
231
182
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "opencode-orchestrator",
3
3
  "displayName": "OpenCode Orchestrator",
4
4
  "description": "Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).",
5
- "version": "1.2.59",
5
+ "version": "1.2.60",
6
6
  "author": "agnusdei1207",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "scripts": {
42
42
  "docker:build-all": "docker compose run --rm dev && docker compose run --rm win-builder",
43
43
  "docker:build-win": "docker compose run --rm win-builder",
44
- "docker:rust-dist": "docker compose run --rm dev && sudo chown -R $(id -u):$(id -g) bin/ 2>/dev/null || true",
44
+ "docker:rust-dist": "docker compose run --rm dev && (sudo chown -R $(id -u):$(id -g) bin/ 2>/dev/null || true)",
45
45
  "docker:test": "docker compose run --rm test",
46
46
  "docker:clean": "docker compose down -v",
47
47
  "build": "rm -rf dist && npx esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --format=esm && tsc --emitDeclarationOnly && mkdir -p dist/scripts && npx esbuild scripts/postinstall.ts --bundle --outfile=dist/scripts/postinstall.js --platform=node --format=esm && npx esbuild scripts/preuninstall.ts --bundle --outfile=dist/scripts/preuninstall.js --platform=node --format=esm",