# Regolith Personal AI assistant with multi-channel support (WhatsApp + Discord) and multi-runtime backends (Claude Agent SDK + OpenCode). See [README.md](README.md) for setup. ## Quick Context Single Node.js process that connects to WhatsApp and/or Discord, routes messages to Claude Agent SDK (in containers) or OpenCode runtime. Each group has isolated filesystem and memory. ## Key Files | File | Purpose | |------|---------| | `src/index.ts` | Orchestrator: multi-channel setup, state, message loop, agent invocation | | `src/channels/whatsapp.ts` | WhatsApp connection, auth, send/receive | | `src/channels/discord.ts` | Discord bot connection, mention handling, attachments, reply context | | `src/channels/chunk-text.ts` | Message chunking (2000-char Discord limit) | | `src/router.ts` | Message formatting, outbound routing, `findChannel` | | `src/config.ts` | Trigger pattern, paths, intervals, Discord/OpenCode config | | `src/opencode/runtime.ts` | OpenCode AI backend (CLI + SDK modes) | | `src/opencode/session-store.ts` | SQLite session persistence for OpenCode | | `src/opencode/live-sessions.ts` | In-memory session manager with idle cleanup | | `src/opencode/types.ts` | OpenCode type definitions | | `src/container-runner.ts` | Spawns agent containers with mounts | | `src/task-scheduler.ts` | Runs scheduled tasks | | `src/db.ts` | SQLite operations | | `groups/{name}/CLAUDE.md` | Per-group memory (isolated) | ## Configuration | Variable | Default | Purpose | |----------|---------|---------| | `ASSISTANT_NAME` | Andy | Trigger word for the bot | | `DISCORD_BOT_TOKEN` | (empty) | Discord bot token; set to enable Discord | | `DISCORD_ONLY` | false | Skip WhatsApp when true | | `OPENCODE_MODE` | cli | OpenCode mode: "cli" or "sdk" | | `OPENCODE_MODEL` | (unset) | Model name for OpenCode | | `OPENCODE_TIMEOUT` | 120 | Timeout in seconds | | `OPENCODE_SESSION_TTL_HOURS` | 24 | Session TTL in hours | ## Skills | Skill | When to Use | |-------|-------------| | `/setup` | First-time installation, authentication, service configuration | | `/customize` | Adding channels, integrations, changing behavior | | `/debug` | Container issues, logs, troubleshooting | ## Development ```bash npm run dev # Run with hot reload npm run build # Compile TypeScript npm test # Run tests npm run typecheck # Type check without emitting ```