Event Bus

Stackie uses an internal event bus to broadcast sandbox and installation activity in real time. Events are consumed by the dashboard, the system tray, and AI agent subscriptions.

Lifecycle Events

Lifecycle events fire when sandboxes change state:

ActionDescription
createSandbox created (before start)
startSandbox process started
stopSandbox stopped gracefully
dieSandbox process exited unexpectedly
killSandbox force-killed
destroySandbox fully removed
renameSandbox renamed
restartSandbox restarted
pauseSandbox paused
unpauseSandbox unpaused

Install Events

Install events fire during stackie up:

  • Download progress (bytes received, total bytes)
  • Extraction progress
  • Compilation progress (for source-built packages)
  • Installation complete

Where Events Appear

  • Dashboard — the SSE stream at /api/events delivers events to the browser UI
  • System tray — the tray icon updates colour on sandbox start/stop
  • AI agents — MCP resource subscriptions notify agents of state changes