Docs / How it works

Stack of the local admin app

Status: in use (app/). Node 22.20 or newer (engines of app/package.json and apps/installer), pnpm from packageManager, TypeScript 6.0.3 (the typescript line of the app/pnpm-workspace.yaml catalog and the root devDependencies; 7.x waits until typescript-eslint admits it and next build's type check is measured on it, P69). Pairs with 06.

Language: TypeScript only

The app is local, so there is no reason to keep a second language. One toolchain (Node + pnpm), one set of types from the database to the screen.

Where files live (HUB_HOME)

Every location comes from one function, hubPaths() in @hub/config/paths. Nothing else joins a repo root onto projects, state, config, .claude/skills or data (a gate test fails on new direct joins).

What lives in SQLite (working state only)

The schema is app/packages/db/src/schema.ts; every table has a project column. Client keys (clients, client_identifiers), marks, drafts (status ready hold done sent skipped; Checked is a flag, not a status), the Hub's own record of each Mail draft version it wrote (mail_versions, and mail_writes for a write in flight, so a late save of Mail's is adopted by hash: P65), batches, send_log (mail and, since 0027, messenger sends: channel, messenger_draft_id) and send_control, safety_rules, inbox_rows, enrollments (follow-up sequences, 23), the project index (projects, project_addresses, project_questions), the knowledge index (knowledge_docs, and the FTS5 virtual table knowledge_fts its migration makes), the messenger tables (messenger_accounts, messenger_chats, messenger_messages, messenger_drafts; since 0025 messenger_chats also holds each linked chat's rules, P71 M2b; messenger_triage, the pre-analysis verdict per message, deleted with its message, 0029; messenger_link_refusals, the HMAC of each chat the owner said is not a client, P84, 0028; unlinking a chat deletes its messages, verdicts and drafts in the same transaction, and the server purges expired messages at start and every hour, connected or not), agent_settings (the agent's model and advisor per project, set on Settings ▸ Agent, P55), the LLM ledger llm_calls (one row per attempt, P78, 27), owner_fixes (a refusal of the agent's tool only the owner can fix, one row per project and code, shown on Overview until the tool's next success or 24 hours, P133, 0038), and the action log agent_runs and agent_events. Mail is read live and Notion stays the CRM; the Notion side has a dump and a dry-run restore (app/packages/notion/README.md).

Rules for agents who change the app

app/@rules/.

Monorepo

Turborepo + pnpm workspaces, best practices. Domains are packages, so each can be tested and replaced alone:

Update this page when the architecture changes.

Source: @docs/core/08-local-app-stack.md