Files
AgentCompany/docs/08-main-process-implementation.md
T

1.8 KiB

Phase 7: BackendDeveloper Main Process And Preload Implementation

Main Process Responsibilities Implemented

  • single-instance lock with focus restoration on second launch
  • secure BrowserWindow creation with contextIsolation: true, nodeIntegration: false, and sandbox: true
  • custom app:// protocol for packaged renderer content
  • application menu, accelerators, native dialogs, and notifications
  • typed IPC registration with sender validation and schema validation
  • local SQLite profile bootstrap, backup, restore, and settings persistence
  • utility-process orchestration worker for run execution and log/status fan-out
  • updater wiring via electron-updater, gated by settings and environment

Preload Bridge

  • single exposed surface: window.agentCompany
  • no raw Node.js or Electron APIs exposed to renderer
  • typed invoke helpers only
  • renderer event subscription returns unsubscribe function and hides raw Electron event objects

Storage And Secrets

  • node:sqlite database under profile directory
  • WAL enabled
  • logs, artifacts, and backups stored as profile files
  • secrets encrypted with Electron safeStorage when available, otherwise vault fallback

Key Files