Component Map
Deployment Modes
| Mode | Queue | Storage | Features |
|---|---|---|---|
pico | In-memory | LibSQL file | Single user, local only |
mini | In-memory | LibSQL file | Multi-user, no Redis |
pro | BullMQ + Redis | LibSQL or Turso | Full features, multi-instance |
Request Flow
- HTTP request arrives at Hono router (
src/server.ts) - Auth middleware validates session cookie or Bearer token
- Route handler validates input with Zod schemas
- For chat: lazy-loaded runtime (
ensureChatRuntime()) processes with AI SDK - For tasks:
addTask()enqueues to BullMQ or in-memory queue - Queue worker picks up task, routes to agent adapter via
AgentRegistry - Agent executes tools via
ChatToolHandler(respecting security mode) - Result stored in LibSQL, notifications dispatched asynchronously
Storage Layer
All persistence goes through the storage adapter (src/storage/):
- Schema: Drizzle ORM with LibSQL/SQLite backend
- Tables:
users,sessions,tasks,conversations,messages,memory_chunks,experiences,provider_configs,invite_codes - Migrations:
src/storage/migrations.ts
Key Module Boundaries
| Path | Responsibility |
|---|---|
src/server.ts | Hono app creation, route mounting, server startup |
src/routes/ | HTTP route handlers (thin, delegate to services) |
src/chat/ | Chat engine, conversation management, system prompts |
src/chat/execution/ | Agentic executor, tool handler, session manager |
src/providers/ | AI SDK provider registry (15+ providers) |
src/queue/ | Task queue (BullMQ + in-memory), failure handler |
src/memory/ | Memory sync, search, experience store |
src/plugins/ | Plugin registry, SDK, sandbox, ClawHub client |
src/integrations/ | GitHub, Jira, Linear, Cloudflare, Tailscale clients |
src/mcp/ | MCP server for Claude Code integration |
src/sync/ | Bidirectional sync engine for ticket platforms |
src/auth/ | Session management, OAuth, device identity, pairing |