JSPM

opencode-orchestrator

0.6.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2599
  • Score
    100M100P100Q105921F
  • License MIT

Distributed Cognitive Architecture for OpenCode. Turns simple prompts into specialized multi-agent workflows (Planner, Coder, Reviewer).

Package Exports

  • opencode-orchestrator

Readme

Logo

OpenCode Orchestrator 🎯

Enterprise-Grade Autonomous Multi-Agent Plugin for OpenCode

MIT License npm Tests


πŸš€ What's New in v0.6.0

Ultimate Agent Architecture - Production-ready distributed agent orchestration!

Feature Description
♾️ Unlimited Mode No step limits - runs until mission complete
🧠 Anti-Hallucination Research before coding, verify with docs
⚑ 50x Parallel Sessions Massive concurrent task execution
πŸ“Š Auto Memory Management GC, archiving, zero memory leaks
πŸ”„ Auto Recovery Handles rate limits, errors automatically
πŸ“‘ Event-Driven Real-time pub/sub across all components

πŸ›οΈ System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           πŸ‘€ USER REQUEST                                   β”‚
β”‚                        OpenCode Terminal / UI                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        πŸ”Œ ORCHESTRATOR PLUGIN                               β”‚
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  Session State  β”‚  β”‚                   7 AGENTS                      β”‚  β”‚
β”‚  β”‚  Map<id,state>  β”‚  β”‚  🎯 Commander (primary)                         β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚     ↓ delegate_task / OpenCode Task tool        β”‚  β”‚
β”‚                       β”‚  πŸ—οΈ Architect  πŸ”¨ Builder  πŸ” Inspector         β”‚  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚  πŸ’Ύ Recorder   πŸ“š Librarian πŸ”¬ Researcher       β”‚  β”‚
β”‚  β”‚  Plugin Hooks   β”‚  β”‚     (subagents, hidden)                         β”‚  β”‚
β”‚  β”‚  config         β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β”‚  chat.message   β”‚                                                       β”‚
β”‚  β”‚  tool.execute   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚                  12 TOOLS                       β”‚  β”‚
β”‚                       β”‚  delegate_task    get_task_result   list_tasks  β”‚  β”‚
β”‚                       β”‚  webfetch         websearch         codesearch  β”‚  β”‚
β”‚                       β”‚  run_background   grep_search       mgrep       β”‚  β”‚
β”‚                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      βš™οΈ PARALLEL AGENT MANAGER                              β”‚
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ TaskLauncher β”‚  β”‚  TaskPoller  β”‚  β”‚    ConcurrencyController        β”‚   β”‚
β”‚  β”‚   launch()   β”‚  β”‚   poll()     β”‚  β”‚    MAX=50, PER_AGENT=10         β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚                    TaskStore (MAX: 1000 tasks)                      β”‚   β”‚
β”‚  β”‚    pending β†’ running β†’ completed/error β†’ archived (disk)            β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       πŸ”„ CHILD SESSIONS POOL (up to 50)                     β”‚
β”‚                                                                             β”‚
β”‚    Session 1        Session 2        Session 3            Session N         β”‚
β”‚    Builder πŸ”¨       Librarian πŸ“š     Inspector πŸ”         ...               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           πŸ“‘ EVENT BUS                                      β”‚
β”‚                                                                             β”‚
β”‚    task.started | task.completed | task.failed | session.idle               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Key Differentiators

Capability OpenCode Orchestrator Basic Plugins
Parallel Sessions Up to 50 concurrent Single session
Memory Management Auto GC + disk archiving Memory leaks
Error Recovery Pattern-based auto retry Crash
Context Sharing Parent-child merge Isolated
Event System Real-time pub/sub None
Task Decomposition 3-level hierarchy Flat

Installation

npm install -g opencode-orchestrator

Restart OpenCode after installation.


Usage

πŸš€ Two Modes of Operation

Mode Trigger Behavior
Commander Mode 🎯 /task "mission" Full autonomous execution until MISSION COMPLETE
Chat Mode πŸ’¬ Regular conversation Simple Q&A, no autonomous behavior

Use /task when you need the AI to complete a mission autonomously:

/task "Fix the login bug in the docker-compose environment"
/task "Add dark mode support to the entire app"
/task "Refactor the API to use TypeScript"

What Commander Mode Does:

  • ♾️ Runs until done β€” Never stops until "MISSION COMPLETE"
  • 🧠 Anti-Hallucination β€” Researches docs before coding
  • ⚑ Parallel Execution β€” Up to 50 concurrent agents
  • πŸ”„ Auto-Recovery β€” Handles errors automatically
  • πŸ“Š Trriage System β€” Adapts strategy to complexity (L1/L2/L3)
Commander TUI

/task "mission" triggers full Commander mode


πŸ’¬ Chat Mode - Regular Conversation (Simple Q&A)

Just type normally without /task for simple questions:

How do I add a loading spinner?
What's the difference between useState and useReducer?

Chat Mode is just regular conversation β€” no autonomous execution, no parallel agents, no mission tracking.


πŸ’‘ Pro Tip: Use /task for anything that requires multiple steps, file changes, or verification. Use Chat Mode for quick questions.


The 7 Agents

Agent Role Responsibility
Commander 🎯 Orchestrator Autonomous mission control
Architect πŸ—οΈ Planner Hierarchical task decomposition
Builder πŸ”¨ Developer Full-stack implementation
Inspector πŸ” Quality Audit, auto-fix & doc verification
Recorder πŸ’Ύ Context Progress tracking
Librarian πŸ“š Research Documentation & API research
Researcher πŸ”¬ Investigation Pre-task research & analysis

πŸ› οΈ Available Tools

Tool Description
delegate_task Delegate work to subagent (async/sync)
get_task_result Get result from delegated task
list_tasks List all running/completed tasks
cancel_task Cancel a running task
webfetch Fetch URL content as Markdown
websearch Search web (SearXNG β†’ Brave β†’ DuckDuckGo)
codesearch Search open source code patterns
cache_docs Manage cached documentation
run_background Run command in background
check_background / list_background Monitor background jobs
grep_search / glob_search / mgrep Fast file search

πŸ“Š Resource Guarantees

Resource Limit Safety Mechanism
Parallel Sessions 50 Queue overflow protection
Tasks in Memory 1,000 Auto GC + disk archive
Notifications 100/parent FIFO eviction
Event History 100 Ring buffer
Session TTL 60 min Auto cleanup
Poll Interval 1 second Fast completion detection

πŸ§ͺ Test Coverage

Test Files:  18 passed
Tests:       198 passed
Duration:    ~4.3s

Uninstall

npm uninstall -g opencode-orchestrator

πŸ”§ Debugging

Log file location:

# Find log path (macOS uses /var/folders/...)
npm run log
# or:
tail -f "$(node -e 'console.log(require("os").tmpdir())')/opencode-orchestrator.log"

# Windows
# C:\Users\<username>\AppData\Local\Temp\opencode-orchestrator.log

Documentation


License

MIT License. LICENSE


Enterprise-scale. Memory-safe. Self-healing. Unlimited.