09System Architecture
SECTION 09INTERNALS

System Architecture

Electron main process, OrbitRuntime, AntigravityProvider, and IPC contracts.

Process Model Overview

Orbit isolates untrusted rendered content from Node.js system APIs through Electron's process separation architecture.

// Architecture Boundary Diagram
[ Renderer Process ] (Chromium)
└── React 19 UI / Tailwind CSS / Virtualized Turn List
│ (window.orbitAPI via contextBridge)
[ Preload Script ] (Typed Context Isolation)
│ (ipcRenderer.invoke / ipcRenderer.on)
[ Main Process ] (Node.js runtime)
├── OrbitRuntime (State Machine, Turn Coordinator)
├── SQLite Storage Engine (better-sqlite3)
└── AntigravityProvider
└── Child Process: agy executable (stdio streams)

OrbitRuntime & Providers

The OrbitRuntime class coordinates session state transitions, persists incoming chunks into SQLite, and broadcasts typed event envelopes to the renderer. The AntigravityProvider manages the lifecycle of spawned agy processes, translating stdout chunks into structured events.

Typed IPC Contracts

ChannelDirectionPayload & Purpose
orbit:turn:startRenderer → Main{ conversationId, prompt, projectRoot }
orbit:turn:cancelRenderer → Main{ turnId } (dispatches tree-kill SIGTERM)
orbit:interaction:respondRenderer → Main{ requestId, approved, responseText }
orbit:stream:eventMain → RendererTypedTurnEvent (chunk, tool_call, error, complete)