Electron process model
The main process owns every privileged and native operation; the renderer is an unprivileged React client of explicit IPC APIs.
AgentDock follows Electron's standard process split, applied consistently: nothing privileged runs in the renderer.
Main process
Owns CLI detection and spawning, the SQLite database, git operations, the filesystem, and (in AgentDock Pro) AIgency orchestration. It's organized into feature-scoped services under src/main/services — see Main-process services.
Renderer
A React application with no direct Node.js or Electron API access. It presents state and dispatches user actions, and everything privileged happens by calling into the main process over IPC — see IPC architecture.
Preload
A context-isolated bridge script sits between the two, exposing a curated window.agentDock API rather than raw ipcRenderer — see Preload bridge.
Why this split matters
Keeping native/privileged work entirely in the main process means a renderer-level bug or a malicious page can't reach the filesystem, spawn processes, or touch git directly — it can only call the specific, typed methods the preload bridge exposes. See Security model for the full reasoning.