This document describes the current implemented layout of the repository.
burns/
apps/
daemon/ # Bun HTTP daemon + local persistence + workspace/workflow services
web/ # React/Vite frontend
packages/
client/ # Typed API client for the daemon
shared/ # Shared Zod schemas and domain types
config/ # Placeholder package for shared tooling config
docs/
codebase-layout.md
daemon-api-reference.md
burns-spec.md
package.json
bun.lock
tsconfig.base.jsonPrimary backend/control-plane application.
Key directories:
src/server: HTTP app and route handlerssrc/services: business logic for workspaces, workflows, runs/approvals, git, diagnostics, and Smithers instance lifecyclesrc/jobs: process entrypoints used by daemon-managed child workers (for example workspace Smithers runner)src/agents: wrappers for CLI-based agents (claude,codex,gemini,pi)src/db: Bun SQLite client and workspace repositorysrc/domain: default workflow templates and seed fixture datasrc/config: app defaults and filesystem paths
Key runtime behavior:
- Serves API on
http://localhost:7332 - Persists workspace metadata in
~/.burns/burns.sqliteby default across direct daemon/web, CLI, and desktop runs - Defaults the workspace creation root to
~/Documents/Burns - Stores workflow source files per workspace under
.smithers/workflows - Supervises one Smithers process per workspace (when enabled), including crash restart and shutdown handling
Frontend built with React 19, React Router, and TanStack Query.
Key directories:
src/app: app shell, route definitions, and top-level providerssrc/app/routes: page-level routes (workflows,workspaces/new,settings,w/:workspaceId/*)src/features: feature hooks by domain (workspaces,workflows,runs,approvals,agents,settings)src/components/ui: shadcn/base-ui primitivessrc/components/ai-elements: AI element wrappers used by workflow generation/edit flowssrc/lib/api/client.ts: singletonBurnsClientinstance
State conventions:
- Server state is managed with TanStack Query
- Active workspace selection is stored in localStorage (
burns.active-workspace-id)
Shared contract package with Zod schemas and inferred types:
- workspaces
- workflows
- runs
- approvals
- settings
- agent CLI metadata and workflow generation/edit payloads
Typed HTTP client (BurnsClient) used by the web app:
- wraps daemon API calls
- parses API responses with
packages/sharedschemas - normalizes errors to thrown
Errorinstances
Reserved package for shared linting/TypeScript config. It is present but intentionally minimal right now.
- Web app loads and reads active workspace context.
- Web app calls daemon endpoints via
BurnsClient. - Daemon route handlers validate request bodies (where applicable) with shared schemas.
- Daemon services interact with SQLite, local filesystem, git, and optional agent CLIs.
- Results are returned as JSON and cached in TanStack Query on the frontend.
- Overview route provides workspace summary cards for branch, workflows, active runs, and approvals, plus local
Open FolderandCopy Pathquick actions when using a loopback daemon URL. - Runs route supports one-click run starts per workflow and run list navigation to run detail.
- Run detail consumes persisted event history and attaches SSE with reconnect using
afterSeq. - Approvals route provides pending approval actions (approve/deny) with operator attribution.
- Workspace server control calls (
status,start,restart,stop) are exposed in the client API and backed by daemon routes.