Monorepo layout
Apps
apps/electron
- Electron shell that embeds the server and renders the web app.
- Best UX for the Founder.
- Local-first access to settings, chat, approvals, and reporting.
apps/web
- Vue 3 SPA built with Vite.
- Lightweight operational client for review, approvals, and monitoring.
- Persists chat session selection in browser state for fast restore.
apps/server
- Fastify HTTP API at
/api/v1. - Agent orchestration, background jobs, scheduled runs.
- Budget metering and audit log writing.
- Skill discovery and activation.
- Plugin discovery, enablement, and capability registration.
- Tool policy service (enable/disable + custom fields) synced to the executor.
- Multi-session chat orchestration.
- Startup migration safety can switch the server into read-only mode for write operations.
Server bootstrap composition
apps/server/src/app.ts is intentionally a thin composition root. Bootstrapping concerns live under apps/server/src/bootstrap/:
Async execution lanes
The server runs an in-process queue with three lanes:agent.run— executes agent workflows and updates run lifecycle state.tool.execute— executes tool calls through runtime policy and the audit pipeline.task.execute— executes ready tasks (single task or agent batch) with heartbeat and audit integration.
- Agent concurrency:
max(2, floor(cpu/2)) - Tool concurrency:
max(4, cpu)
FAMILYCO_QUEUE_AGENT_CONCURRENCY and FAMILYCO_QUEUE_TOOL_CONCURRENCY.
Packages
High-level flow
- Founder sends a directive in Chat.
- Server creates an AgentRun.
- Executive Agent interprets intent.
- Planner creates or updates Projects and Tasks.
- Agent router selects enabled Skills.
- If approval is needed, an ApprovalRequest is created and the run pauses in
waiting_approval. - When approved, execution continues.
- BudgetUsage and AuditLog entries are written throughout.
Tool policy flow
- Runtime tool definitions are collected from built-in tools and enabled plugins.
- Tool policy state is persisted in settings:
tools.registry— enabled/disabled plugin tools.tools.customFields— per-tool custom field values.
- Required custom fields are validated before enabling plugin tools.
- The chat engine receives a tool list filtered by agent level; enabled plugin tools remain available in the prompt and tool context.
- The executor injects persisted custom field values into plugin tool execution arguments.
Runtime safeguards
- Migration safety runs during startup before normal mutation traffic.
- Health endpoint reports queue stats, migration status, and read-only mode.
- Heartbeat runtime polls due agents and enqueues heartbeat runs with cooldown and in-flight protections.
- Cron runtime polls due jobs, records run history, and persists last/next schedule markers.
Design constraints
- Business rules live in
packages/coreorpackages/agent-runtime, not in UI. - UI apps call use-cases or service methods instead of embedding orchestration logic.
- Prisma schema is the persistence contract.
packages/coremust not import other internal packages.- Significant side effects must go through the approval flow.
- Database access goes through repository abstractions.
- Event names are explicit and past-tense or command-like, not vague.
Recommended UI navigation
Chat · Inbox · Agents · Projects · Tasks · Budget · Audit Log · Skills · SettingsNext steps
Domain model
Entities, relationships, and invariants.
Agent operating model
Hierarchy, run lifecycle, and clarification policy.
Approval policy
What requires approval and how it resolves.
Skills standard
How skills are stored, discovered, and toggled.