How layernorm/overlay-desktop works
Overlay Desktop is a macOS desktop client for chat, voice input, notes, files, and permissioned agent operations. A user works in the renderer; the preload bridge exposes desktop capabilities to the main process, which owns host operations and coordinates local or server-backed services. A central agent-policy layer checks tool authorization and approval requirements. Other major branches include browser sessions, notebook and knowledge management, transcription, account and billing, and hosted AI. The README documents product boundaries; sampled source confirms selected internals, so uncertain module-to-module wiring is omitted.
Main entry points: index.ts Preload bridge · chat-ipc.ts Chat IPC · chat-service.ts Chat service · agent-service.ts Agent service
Components 25
Desktop interface
- React renderer
src/renderer/src/App.tsx - Notebook UI
packages/overlay-modules-react/src/notes.tsx - Notebook editor
packages/overlay-app-core/src/notebook-editor-controller.ts - Browser interface
src/renderer/src/components/browser/BrowserPanel.tsx
Electron runtime
- Preload bridge
src/preload/index.ts - Main process
src/main/index.ts - Chat IPC
src/main/ipc/chat-ipc.ts - Agent IPC
src/main/ipc/agent-ipc.ts - Knowledge IPC
src/main/ipc/knowledge-ipc.ts
Chat and knowledge
- Chat service
src/main/services/chat-service.ts - Unified chat
src/main/services/ai/unified-chat-service.ts - LLM gateway
packages/overlay-llm-gateway/src/index.ts - Context engine
src/main/services/context/ContextEngine.ts - Cloud memory
src/main/services/memory/CloudMemoryService.ts - Document ingestion
src/main/services/memory/DocumentIngestionService.ts
Host capabilities
- Browser manager
src/main/services/browser-manager.ts - Agent policy
src/main/services/security/agent-policy/agent-policy-engine.ts - Agent service
src/main/services/agent/agent-service.ts - Native approval
src/main/services/security/agent-policy/approval-coordinator.ts - Transcription service
src/main/services/transcription-request.ts - Parakeet engine
ParakeetServer/Sources/ParakeetCore/ParakeetEngine.swift
Account services
- Account and billing
src/main/services/subscription-service.ts - Secure storage
src/main/services/security/safe-storage-service.ts
Other components
- Desktop user
- Overlay Server
Connections 24
- Desktop user → React renderer: uses
- React renderer → Preload bridge: requests capabilities
- Preload bridge → Main process: bridges IPC
- Main process → Chat IPC: dispatches
- Chat IPC → Chat service: handles chat
- Chat service → Unified chat: requests responses
- Unified chat → LLM gateway: routes model requests
- LLM gateway → Overlay Server: connects hosted models
- Chat service → Context engine: builds context
- Context engine → Cloud memory: retrieves memories
- Desktop user → Notebook UI: edits notes
- Notebook UI → Notebook editor: updates editor state
- Preload bridge → Knowledge IPC: bridges knowledge IPC
- Knowledge IPC → Document ingestion: imports documents
- Desktop user → Browser interface: browses
- Browser interface → Browser manager: controls browser
- Chat IPC → Agent service: invokes agent operations
- Agent service → Agent policy: checks tool access
- Agent service → Native approval: requests approval
- Desktop user → Transcription service: provides voice input
- Transcription service → Parakeet engine: transcribes locally
- Desktop user → Account and billing: manages account
- Account and billing → Overlay Server: checks account and entitlements
- Account and billing → Secure storage: stores session secrets