Architecture
System architecture
A high-level map of components, data flow, and isolation boundaries.
Components
- Electron shell — desktop process, owns local files.
- Next.js dashboard — the UI layer running inside Electron.
- AI CLI adapter — wraps Claude Code / Codex / Gemini CLI behind a stable interface.
- MCP Playwright — drives the real browser for contact-form submission.
- Chrome DevTools MCP (optional) — second defense layer for pre-send inspection.
- Local data files — settings.json, action-log.json, contact-history.json, targets.xlsx, screenshots/.
Data flow
- UI dispatches an action (build list, draft message, approve, submit).
- The action goes through the policy layer (rate limits, exclusion checks).
- AI calls go through the adapter to the selected CLI.
- Submissions go through Playwright; Chrome DevTools MCP (if enabled) captures screenshot, console, and network.
- Every step is appended to action-log.json.
Isolation boundaries
- Local vs. AI provider — only the prompt is sent; account data stays local except for the prompt content you compose.
- App vs. host OS — file access is scoped to the app data directory.
- Daily Chrome vs. AI Chrome — when using Chrome DevTools MCP, run in
--isolatedmode by default.
Where to read code
The repository at github.com/joseikininsight-hue/sales-claw-ts is the source of truth.
Autonomy loop
Long-running runs use Claude Code's /goal command (since 2.1.139). The pipeline is structured so that humans approve before every send — the autonomy applies to research, drafting, and queueing.