1.8 KiB
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
BrowserWindowcreation withcontextIsolation: true,nodeIntegration: false, andsandbox: 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:sqlitedatabase under profile directory- WAL enabled
- logs, artifacts, and backups stored as profile files
- secrets encrypted with Electron
safeStoragewhen available, otherwise vault fallback