Working on Draggy

Building and architecture

Running from source, the layout of the code, and the two boundaries.

Running from source

npm install
npm run electron:dev

Vite and Electron together with hot reload, on port 5173. A stale Vite process holds that port and the next launch fails; kill it first.

npm run check

Typecheck, lint and around 1,900 tests in a few seconds. CI runs the same command. npm run electron:build writes an installer into dist-electron/.

How it is laid out

FolderHolds
electron/Main process: windows, IPC, SQLite, the file guard, git, the browser, MCP servers, updates
src/agent/The streaming tool-calling loop, permissions, compaction
src/chat/The message list, diffs, approvals, the context wheel
src/tools/Tool definitions and the registry they live in
src/voice/Capture, detection, turn-taking, speech

The two boundaries

electron/preload.cjs is the security one. The renderer has no Node access and reaches the filesystem, network and database only through what is exposed there. Adding a function is a deliberate act.

The session split is the other. Draggy's own window runs under a strict CSP; every external page runs on a separate partition with no policy of ours imposed on it. Merging them applies our policy to other people's sites and renders wreckage.

Conventions

  • Comments explain why, never what, and are two lines at most
  • Twelve languages stay in parity, enforced by a test
  • Every child process goes through the hidden-window spawn helpers
  • Commit messages are one line

CONTRIBUTING.md has the rest, and SECURITY.md covers reporting a vulnerability.