09System Architecture
SECTION 09•INTERNALS
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
| Channel | Direction | Payload & Purpose |
|---|---|---|
| orbit:turn:start | Renderer → Main | { conversationId, prompt, projectRoot } |
| orbit:turn:cancel | Renderer → Main | { turnId } (dispatches tree-kill SIGTERM) |
| orbit:interaction:respond | Renderer → Main | { requestId, approved, responseText } |
| orbit:stream:event | Main → Renderer | TypedTurnEvent (chunk, tool_call, error, complete) |