Symphony Bus
The Symphony Bus (src/lib/symphonyBus.ts) is the real-time messaging system that lets all
participants — human or AI — communicate. An intent from the Conductor is broadcast, and the
ensemble of Virtuosos reacts, harmonizing outputs into a single multi-modal result.
It is implemented as a custom EventTarget-based bus with task lifecycle management,
commission chaining, and telemetry hooks.
Events
| Event | Fired when |
|---|---|
task:start | A Virtuoso begins a commissioned task |
task:progress | Intermediate progress (streaming chunks, sub-steps) |
task:success | The task completed and produced a result |
task:error | The task failed |
commission:chain | A completed task commissions a follow-up task on another Virtuoso |
Task lifecycle
Commission chaining
Commission chaining is how multi-step orchestration happens without central micromanagement: a Virtuoso finishing a task can commission another specialist with its output as input. For example:
- Visionary analyzes frames → emits
task:success - Result chains to the Analyst via
commission:chainfor synthesis - The Critic evaluates the synthesis; on rejection, the chain retries with feedback
- The Chronicler formats the approved result for export
Usage
import { symphonyBus, Events } from '@/lib/symphonyBus'
symphonyBus.addEventListener(Events.TASK_SUCCESS, e => {
const task = (e as CustomEvent).detail
console.log(`${task.virtuoso} finished:`, task.result)
})The useSymphony hook (src/hooks/useSymphony.ts) wraps subscription and cleanup for React
components, and powers the Orchestra Visualizer — the live panel of glowing orbs showing each
active Virtuoso’s status.