diff --git a/.env.example b/.env.example
index cf4b7015..c0d36920 100644
--- a/.env.example
+++ b/.env.example
@@ -5,7 +5,7 @@
# ============================================
# Backend Server Configuration
# ============================================
-PORT=5001
+PORT=5003
HOST=0.0.0.0
CORS_ORIGIN=http://localhost:5173
NODE_ENV=production
@@ -109,8 +109,7 @@ PASSKEY_ORIGIN=http://localhost:5003
# Frontend Configuration (Vite)
# These are optional - frontend uses defaults if not set
# ============================================
-# VITE_API_URL=http://localhost:5001
-# VITE_SERVER_PORT=5001
+# VITE_API_URL=http://localhost:5003
# VITE_OPENCODE_PORT=5551
# VITE_MAX_FILE_SIZE_MB=50
# VITE_MAX_UPLOAD_SIZE_MB=50
diff --git a/README.md b/README.md
index 09d91b56..400a0388 100644
--- a/README.md
+++ b/README.md
@@ -2,13 +2,28 @@
-# OpenCode Manager
+
+ Mobile-first web interface for OpenCode AI agents. Manage, control, and code from any device.
+
-Mobile-first web interface for [OpenCode](https://opencode.ai) AI agents. Manage, control, and code from any device - your phone, tablet, or desktop.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
## Quick Start
@@ -16,194 +31,60 @@ Mobile-first web interface for [OpenCode](https://opencode.ai) AI agents. Manage
```bash
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
+cp .env.example .env
docker-compose up -d
# Open http://localhost:5003
```
On first launch, you'll be prompted to create an admin account. That's it!
+For local development setup, see the [Development Guide](https://chriswritescode-dev.github.io/opencode-manager/development/setup/).
+
## Screenshots
-| Chat (Mobile) |
-
-
- |
-
-
-| File Browser (Mobile) |
-
-
- |
-
-
-| Inline Diff View |
-
-
- |
+Chat (Mobile)
 |
+File Browser (Mobile)
 |
+Inline Diff View
 |
## Features
-### Repository & Git
-- **Multi-Repository Support** - Clone and manage multiple git repos with private repo support via GitHub PAT
-- **SSH Authentication** - SSH key authentication for git repositories
-- **Git Worktrees** - Work on multiple branches simultaneously
-- **Source Control Panel** - View changes, commits, and branches in a unified interface
-- **Diff Viewer** - Unified diffs with line numbers and change counts
-- **Push PRs** - Create and push pull requests directly from the UI
-
-### File Management
-- **Directory Browser** - Navigate files with tree view and search
-- **Syntax Highlighting** - Code preview with highlighting for all major languages
-- **File Operations** - Create, rename, delete, and drag-and-drop upload
-- **ZIP Download** - Download repos as ZIP (respects .gitignore)
-
-### Chat & Sessions
-- **Real-time Streaming** - Live message streaming with SSE
-- **Slash Commands** - Built-in (`/help`, `/new`, `/compact`) and custom commands
-- **File Mentions** - Reference files with `@filename` autocomplete
-- **Plan/Build Modes** - Toggle between read-only and file-change modes
-- **Mermaid Diagrams** - Visual diagram rendering in chat
-- **Text-to-Speech** - Listen to AI responses with browser or OpenAI-compatible TTS
-- **Speech-to-Text** - Dictate messages using browser speech recognition or OpenAI-compatible STT
-
-### AI Configuration
-- **Model Selection** - Browse and filter available AI models
-- **Provider Management** - Configure API keys or OAuth for providers
-- **OAuth Support** - Secure OAuth login for Anthropic and GitHub Copilot
-- **Custom Agents** - Create agents with custom system prompts and tool permissions
-- **MCP Servers** - Add local or remote MCP servers with pre-built templates
-- **Memory Plugin** - Persistent project knowledge with semantic search, planning state, and compaction awareness
-
-### Mobile & PWA
-- **Mobile-First Design** - Responsive UI optimized for mobile
-- **PWA Installable** - Add to home screen on any device
-- **iOS Optimized** - Proper keyboard handling and swipe navigation
-- **Push Notifications** - Background alerts for agent events when app is closed
-
-## Installation
-
-### Docker (Recommended)
-
-```bash
-git clone https://github.com/chriswritescode-dev/opencode-manager.git
-cd opencode-manager
-docker-compose up -d
-```
-
-The container automatically installs OpenCode, builds the frontend, and sets up persistent volumes.
-
-**Common commands:**
-```bash
-docker-compose up -d # Start
-docker-compose down # Stop
-docker-compose logs -f # View logs
-docker-compose restart # Restart
-```
-
-### Local Development
-
-For contributors who want to develop locally:
-
-```bash
-# Prerequisites: pnpm, Bun, OpenCode TUI (npm i -g @opencode/tui)
-
-git clone https://github.com/chriswritescode-dev/opencode-manager.git
-cd opencode-manager
-pnpm install
-cp .env.example .env
-pnpm dev
-```
+- **Git** — Multi-repo support, SSH authentication, worktrees, unified diffs with line numbers, PR creation
+- **Files** — Directory browser with tree view, syntax highlighting, create/rename/delete, ZIP download
+- **Chat** — Real-time streaming (SSE), slash commands, `@file` mentions, Plan/Build modes, Mermaid diagrams
+- **Audio** — Text-to-speech (browser + OpenAI-compatible), speech-to-text (browser + OpenAI-compatible)
+- **AI** — Model selection, provider config, OAuth for Anthropic/GitHub Copilot, custom agents with system prompts
+- **MCP** — Local and remote MCP server support with pre-built templates
+- **Memory** — Persistent project knowledge with semantic search, planning state, and compaction awareness
+- **Mobile** — Responsive UI, PWA installable, iOS-optimized with proper keyboard handling and swipe navigation
## Configuration
-### Authentication
-
-OpenCode Manager uses single-user authentication. Create your admin account on first launch, or pre-configure via environment variables:
-
```bash
+# Required for production
+AUTH_SECRET=your-secure-random-secret # Generate with: openssl rand -base64 32
+
# Pre-configured admin (optional)
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=your-secure-password
-# Required for production
-AUTH_SECRET=your-secure-random-secret # Generate with: openssl rand -base64 32
+# For LAN/remote access
+AUTH_TRUSTED_ORIGINS=http://localhost:5003,https://yourl33tdomain.com
+AUTH_SECURE_COOKIES=false # Set to true when using HTTPS
```
-### Remote/LAN Access
-
-For HTTP access on local networks:
-
-```bash
-AUTH_TRUSTED_ORIGINS=http://localhost:5003
-AUTH_SECURE_COOKIES=false # Required when not using HTTPS (cookies won't work over plain HTTP otherwise)
-```
-
-### OAuth Providers (Optional)
-
-Enable social login by configuring OAuth credentials:
-
-```bash
-# GitHub
-GITHUB_CLIENT_ID=...
-GITHUB_CLIENT_SECRET=...
-
-# Google
-GOOGLE_CLIENT_ID=...
-GOOGLE_CLIENT_SECRET=...
-
-# Discord
-DISCORD_CLIENT_ID=...
-DISCORD_CLIENT_SECRET=...
-```
-
-### Passkeys
-
-For WebAuthn/passkey support:
-
-```bash
-PASSKEY_RP_ID=yourdomain.com
-PASSKEY_RP_NAME=OpenCode Manager
-PASSKEY_ORIGIN=https://yourdomain.com
-```
-
-### Push Notifications (VAPID)
-
-Enable push notifications for the PWA (background alerts for agent questions, permission requests, errors, and session completions):
-
-```bash
-# Generate keys: npx web-push generate-vapid-keys
-VAPID_PUBLIC_KEY=your-public-key
-VAPID_PRIVATE_KEY=your-private-key
-VAPID_SUBJECT=mailto:you@yourdomain.com
-```
-
-**Important**: `VAPID_SUBJECT` MUST use `mailto:` format for iOS/Safari push notifications to work. Apple's push service rejects `https://` subjects.
-
-### Dev Server Ports
-
-The Docker container exposes ports `5100-5103` for running dev servers inside repositories:
-
-```bash
-# Example: Vite
-server: { port: 5100, host: '0.0.0.0' }
-
-# Access at http://localhost:5100
-```
+For OAuth, Passkeys, Push Notifications (VAPID), and advanced configuration, see the [Configuration Guide](https://chriswritescode-dev.github.io/opencode-manager/configuration/environment/).
## Documentation
-For detailed guides and configuration reference, see the **[Documentation Site](https://chriswritescode-dev.github.io/opencode-manager)**.
-
-- [Getting Started](https://chriswritescode-dev.github.io/opencode-manager/getting-started/installation/) - Installation and first-run setup
-- [Features](https://chriswritescode-dev.github.io/opencode-manager/features/overview/) - Deep dive on all features
-- [Configuration](https://chriswritescode-dev.github.io/opencode-manager/configuration/environment/) - Environment variables and advanced setup
-- [Troubleshooting](https://chriswritescode-dev.github.io/opencode-manager/troubleshooting/) - Common issues and solutions
-- [Development](https://chriswritescode-dev.github.io/opencode-manager/development/setup/) - Contributing and local development
-
+- [Getting Started](https://chriswritescode-dev.github.io/opencode-manager/getting-started/installation/) — Installation and first-run setup
+- [Features](https://chriswritescode-dev.github.io/opencode-manager/features/overview/) — Deep dive on all features
+- [Configuration](https://chriswritescode-dev.github.io/opencode-manager/configuration/environment/) — Environment variables and advanced setup
+- [Troubleshooting](https://chriswritescode-dev.github.io/opencode-manager/troubleshooting/) — Common issues and solutions
+- [Development](https://chriswritescode-dev.github.io/opencode-manager/development/setup/) — Contributing and local development
## License
diff --git a/docs/configuration/docker.md b/docs/configuration/docker.md
index af038aad..1cd204b6 100644
--- a/docs/configuration/docker.md
+++ b/docs/configuration/docker.md
@@ -7,9 +7,24 @@ Advanced Docker setup and configuration options.
```bash
git clone https://github.com/chriswritescode-dev/opencode-manager.git
cd opencode-manager
+
+# Copy and configure environment
+cp .env.example .env
+
+# Generate a secure AUTH_SECRET
+openssl rand -base64 32
+# Add the output to AUTH_SECRET in .env
+
+# Start the container
docker-compose up -d
```
+!!! warning "AUTH_SECRET Required"
+ The container will not start without `AUTH_SECRET` set in your `.env` file. Generate one with:
+ ```bash
+ openssl rand -base64 32
+ ```
+
## docker-compose.yml
Default configuration:
@@ -27,11 +42,31 @@ services:
- "5101:5101" # Dev server 2
- "5102:5102" # Dev server 3
- "5103:5103" # Dev server 4
+ environment:
+ - NODE_ENV=${NODE_ENV:-production}
+ - HOST=0.0.0.0
+ - PORT=5003
+ - OPENCODE_SERVER_PORT=5551
+ - DATABASE_PATH=/app/data/opencode.db
+ - WORKSPACE_PATH=/workspace
+ - AUTH_SECRET=${AUTH_SECRET}
+ - AUTH_TRUSTED_ORIGINS=${AUTH_TRUSTED_ORIGINS:-http://localhost:5003}
+ - ADMIN_EMAIL=${ADMIN_EMAIL:-}
+ - ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
+ # OAuth providers (optional)
+ - GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID:-}
+ - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-}
+ # Passkeys (optional)
+ - PASSKEY_RP_ID=${PASSKEY_RP_ID:-localhost}
+ - PASSKEY_RP_NAME=${PASSKEY_RP_NAME:-OpenCode Manager}
+ - PASSKEY_ORIGIN=${PASSKEY_ORIGIN:-http://localhost:5003}
+ # Push notifications (optional)
+ - VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY:-}
+ - VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY:-}
+ - VAPID_SUBJECT=${VAPID_SUBJECT:-}
volumes:
- opencode-workspace:/workspace
- opencode-data:/app/data
- environment:
- - NODE_ENV=production
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5003/api/health"]
@@ -47,6 +82,42 @@ volumes:
driver: local
```
+## Environment Variables
+
+Create a `.env` file in the project root. The docker-compose.yml automatically reads variables from `.env`:
+
+```bash
+# Required
+AUTH_SECRET=generate-with-openssl-rand-base64-32
+
+# Optional - pre-configured admin
+ADMIN_EMAIL=admin@example.com
+ADMIN_PASSWORD=your-secure-password
+
+# Optional - OAuth providers
+GITHUB_CLIENT_ID=your-client-id
+GITHUB_CLIENT_SECRET=your-client-secret
+
+# Optional - passkeys
+PASSKEY_RP_ID=localhost
+PASSKEY_ORIGIN=http://localhost:5003
+
+# Optional - push notifications
+VAPID_PUBLIC_KEY=BMx-1234567890abcdefghijklmnopqrstuv...
+VAPID_PRIVATE_KEY=abcd1234567890abcdef...
+VAPID_SUBJECT=mailto:you@example.com
+```
+
+## Entrypoint Behavior
+
+The container entrypoint (`scripts/docker-entrypoint.sh`) automatically:
+
+1. **Installs Bun** if not present
+2. **Installs OpenCode** if not present
+3. **Upgrades OpenCode** if below minimum version (1.0.137)
+4. **Validates AUTH_SECRET** is set (required for startup)
+5. **Validates memory plugin** installation
+
## Port Configuration
### Main Application
@@ -132,36 +203,6 @@ Contains:
Uses a named volume for data persistence.
-## Environment Variables
-
-### Using .env File
-
-Create `.env` in project root:
-
-```bash
-AUTH_SECRET=your-secret-here
-ADMIN_EMAIL=admin@example.com
-ADMIN_PASSWORD=secure-password
-```
-
-Reference in docker-compose.yml:
-
-```yaml
-env_file:
- - .env
-```
-
-### Inline Environment
-
-Set directly in docker-compose.yml:
-
-```yaml
-environment:
- - NODE_ENV=production
- - AUTH_SECRET=your-secret-here
- - ADMIN_EMAIL=admin@example.com
-```
-
## Health Checks
The container includes health checks:
@@ -256,11 +297,11 @@ docker-compose build
# Rebuild without cache
docker-compose build --no-cache
-# Pull latest base images
-docker-compose pull
-
-# Update and restart
-docker-compose pull && docker-compose up -d --build
+# Update and restart (uses upgrade script)
+docker-compose down
+git pull
+docker-compose build --no-cache
+docker-compose up -d
```
### Debugging
@@ -302,41 +343,3 @@ docker exec -it opencode-manager vi /workspace/.config/opencode/AGENTS.md
### Precedence
Global instructions merge with repository-specific `AGENTS.md` files. Repository instructions take precedence.
-
-## Troubleshooting
-
-### Container Won't Start
-
-```bash
-# Check logs
-docker-compose logs
-
-# Check if port is in use
-lsof -i :5003
-
-# Try running in foreground
-docker-compose up
-```
-
-### Permission Issues
-
-```bash
-# Fix workspace permissions
-sudo chown -R $(id -u):$(id -g) ./workspace ./data
-
-# Or run with specific user
-docker-compose run --user $(id -u):$(id -g) opencode-manager
-```
-
-### Out of Disk Space
-
-```bash
-# Check Docker disk usage
-docker system df
-
-# Clean up unused resources
-docker system prune -a
-
-# Remove unused volumes
-docker volume prune
-```
diff --git a/docs/development/contributing.md b/docs/development/contributing.md
index 55e8b172..848d2560 100644
--- a/docs/development/contributing.md
+++ b/docs/development/contributing.md
@@ -13,82 +13,21 @@ Guide for contributing to OpenCode Manager.
## Code Style
-### General Guidelines
-
-- **No comments** - Code should be self-documenting
-- **No console.log** - Use proper logging
-- **Strict TypeScript** - Proper typing everywhere
-- **Named imports** - No default imports
-- **DRY principles** - Don't repeat yourself
-- **SOLID design** - Follow SOLID principles
-
-### Backend (Bun + Hono)
-
-```typescript
-// Route handler
-app.get('/api/repos', async (c) => {
- const repos = await repoService.listAll()
- return c.json(repos)
-})
-
-// Service
-export const repoService = {
- async listAll(): Promise {
- return db.query.repositories.findMany()
- }
-}
-```
-
-Guidelines:
-
-- Use Zod for validation
-- Async/await (no .then() chains)
-- Structured error handling
-- Follow existing patterns
-
-### Frontend (React + Vite)
-
-```typescript
-import { useState } from 'react'
-import { Button } from '@/components/ui/button'
-import { useRepositories } from '@/hooks/useRepositories'
-
-export function RepoList() {
- const { data: repos } = useRepositories()
-
- return (
-
- {repos?.map(repo => (
-
- ))}
-
- )
-}
-```
-
-Guidelines:
-
-- Use `@/` alias for imports
-- React Query for server state
-- React Hook Form + Zod for forms
-- Radix UI + Tailwind for components
+- No comments — code should be self-documenting
+- No console.log — use proper logging
+- Strict TypeScript — proper typing everywhere
+- Named imports — no default imports
+- DRY principles — don't repeat yourself
+- SOLID design — follow SOLID principles
## Pull Request Process
### Before Submitting
-1. **Run linting**: `pnpm lint`
-2. **Run tests**: `pnpm test`
-3. **Check types**: `pnpm typecheck`
-4. **Test manually**: Verify your changes work
-
-### PR Guidelines
-
-- Keep PRs focused on a single feature/fix
-- Write clear commit messages
-- Include tests for new functionality
-- Update documentation if needed
-- Reference related issues
+1. Run linting: `pnpm lint`
+2. Run tests: `pnpm test`
+3. Check types: `pnpm typecheck`
+4. Verify your changes work manually
### Commit Messages
@@ -109,106 +48,3 @@ fix: resolve session expiry on mobile
docs: update installation guide
refactor: extract git service from routes
```
-
-## Testing
-
-### Writing Tests
-
-```typescript
-import { describe, it, expect, beforeEach } from 'vitest'
-
-describe('featureName', () => {
- beforeEach(() => {
- // Setup
- })
-
- it('should do something', async () => {
- const result = await doSomething()
- expect(result).toBe(expected)
- })
-})
-```
-
-### Coverage Requirements
-
-- Minimum 80% coverage
-- Cover edge cases
-- Test error conditions
-
-### Running Tests
-
-```bash
-# All tests
-pnpm test
-
-# With coverage
-cd backend && vitest --coverage
-
-# Single file
-cd backend && vitest path/to/test.ts
-```
-
-## Architecture Decisions
-
-### Why Bun?
-
-- Fast startup and execution
-- Built-in TypeScript support
-- SQLite driver included
-- Modern JavaScript runtime
-
-### Why Hono?
-
-- Lightweight and fast
-- TypeScript-first
-- Works with Bun natively
-- Simple, Express-like API
-
-### Why React Query?
-
-- Automatic caching and refetching
-- Server state management
-- Optimistic updates
-- SSE support for streaming
-
-### Why Radix UI?
-
-- Accessible by default
-- Unstyled (pairs with Tailwind)
-- Headless components
-- Production-ready
-
-## Adding Features
-
-### New API Endpoint
-
-1. Create route in `backend/src/routes/`
-2. Add service logic in `backend/src/services/`
-3. Define types in `shared/`
-4. Add tests
-5. Update API client in frontend
-
-### New UI Component
-
-1. Create component in `frontend/src/components/`
-2. Use Radix UI primitives if applicable
-3. Style with Tailwind
-4. Add to relevant page
-5. Test responsiveness
-
-### New Feature Flag
-
-1. Add to settings schema
-2. Create migration if needed
-3. Add UI toggle in settings
-4. Check flag in relevant code
-
-## Getting Help
-
-- **Questions**: Open a GitHub Discussion
-- **Bugs**: Open a GitHub Issue
-- **Features**: Open a GitHub Issue with `feature` label
-
-## License
-
-By contributing, you agree that your contributions will be licensed under the MIT License.
diff --git a/docs/development/setup.md b/docs/development/setup.md
index c58033ec..3f2fce8a 100644
--- a/docs/development/setup.md
+++ b/docs/development/setup.md
@@ -7,7 +7,6 @@ Guide for setting up a local development environment.
- [pnpm](https://pnpm.io/installation) - Package manager (required for workspaces)
- [Bun](https://bun.sh) - Backend runtime
- [OpenCode TUI](https://opencode.ai) - `npm install -g @opencode/tui`
-- [Node.js 24+](https://nodejs.org/en/about/previous-releases)
## Installation
@@ -18,11 +17,16 @@ cd opencode-manager
# Install dependencies
pnpm install
+```
-# Copy environment configuration
-cp .env.example .env
+The `pnpm dev` command automatically runs `scripts/setup-dev.sh` first, which:
+- Checks prerequisites (pnpm, bun, git, OpenCode TUI)
+- Creates required workspace directories
+- Copies `.env.example` to `.env` if missing
-# Start development servers
+Then start development servers:
+
+```bash
pnpm dev
```
@@ -39,19 +43,27 @@ opencode-manager/
│ ├── src/
│ │ ├── routes/ # API route handlers
│ │ ├── services/ # Business logic
-│ │ ├── db/ # Database schema and queries
+│ │ ├── db/ # Database migrations and queries
+│ │ │ └── migrations/ # Numbered migration files
+│ │ ├── types/ # TypeScript types
+│ │ ├── utils/ # Utility functions
│ │ └── index.ts # Entry point
-│ └── tests/ # Backend tests
+│ └── test/ # Backend tests
├── frontend/ # React + Vite SPA
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── pages/ # Page components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── api/ # API client
-│ │ └── lib/ # Utilities
+│ │ ├── lib/ # Utilities
+│ │ ├── stores/ # Zustand stores
+│ │ └── contexts/ # React contexts
│ └── public/ # Static assets
-├── shared/ # Shared types and utilities
-├── scripts/ # Build and Docker entrypoint scripts
+├── shared/ # @opencode-manager/shared types and utilities
+├── packages/memory/ # Memory plugin package
+├── workspace/ # Runtime workspace for OpenCode
+├── docs/ # Documentation
+├── scripts/ # Build and utility scripts
├── Dockerfile # Docker image definition
└── docker-compose.yml # Docker Compose configuration
```
@@ -61,7 +73,9 @@ opencode-manager/
### Root Level
```bash
-pnpm dev # Start both backend and frontend
+pnpm dev # Start both backend and frontend (runs setup-dev.sh first)
+pnpm dev:backend # Start backend only
+pnpm dev:frontend # Start frontend only
pnpm build # Build both packages
pnpm lint # Lint both packages
pnpm test # Run all tests
@@ -71,11 +85,13 @@ pnpm test # Run all tests
```bash
cd backend
-bun run dev # Start with hot reload
-bun test # Run tests
-bun test # Run single test file
-bun run lint # ESLint
-bun run typecheck # TypeScript check
+bun --watch src/index.ts # Start with hot reload
+pnpm test # Run tests (uses Vitest)
+vitest # Run single test file
+vitest --ui # Test UI
+vitest --coverage # Coverage report
+eslint . --ext .ts # Lint
+tsc --noEmit # TypeScript check
```
### Frontend
@@ -90,7 +106,7 @@ pnpm typecheck # TypeScript check
## Database
-Using Bun's built-in SQLite (`bun:sqlite`) with hand-written migrations.
+Using Bun's built-in SQLite (`bun:sqlite`) with numbered migrations.
### Location
@@ -99,8 +115,9 @@ Using Bun's built-in SQLite (`bun:sqlite`) with hand-written migrations.
### Schema Changes
-1. Edit migrations in `backend/src/db/migrations.ts`
-2. Migrations run automatically on startup
+1. Add new migration file in `backend/src/db/migrations/` (e.g., `007-new-feature.ts`)
+2. Export the migration in `backend/src/db/migrations/index.ts`
+3. Migrations run automatically on startup
### Inspection
@@ -119,13 +136,16 @@ SELECT * FROM user; # View data
```bash
# All tests
-cd backend && bun test
+cd backend && pnpm test
# Single file
-cd backend && bun test src/services/repo.test.ts
+cd backend && pnpm test src/services/repo.test.ts
+
+# With UI
+cd backend && pnpm test:ui
# With coverage
-cd backend && bun test --coverage
+cd backend && pnpm test -- --coverage
```
### Writing Tests
@@ -150,13 +170,12 @@ Minimum 80% coverage is enforced.
### Backend
-Logs output to terminal when running `pnpm dev`.
-
-For more detailed debugging:
+Logs output to terminal when running `pnpm dev`. For verbose debug logging:
```bash
-cd backend
-DEBUG=* bun run dev
+# Add to .env
+DEBUG=true
+LOG_LEVEL=debug
```
### Frontend
@@ -166,13 +185,6 @@ DEBUG=* bun run dev
3. Check Network tab for API calls
4. Use React DevTools extension
-### VS Code
-
-Launch configurations are provided in `.vscode/launch.json`:
-
-- **Debug Backend** - Attach debugger to backend
-- **Debug Frontend** - Launch Chrome with debugging
-
## Building
### Development Build
@@ -228,6 +240,6 @@ rm -rf */tsconfig.tsbuildinfo
```bash
# Reset database
-rm -f backend/data/opencode.db
+rm -f data/opencode.db
pnpm dev # Database is recreated
```
diff --git a/docs/features/memory.md b/docs/features/memory.md
index cabac9ee..85016e99 100644
--- a/docs/features/memory.md
+++ b/docs/features/memory.md
@@ -1,4 +1,4 @@
-# Memory Plugin (Optional)
+# Memory Plugin
`@opencode-manager/memory` is an **optional** OpenCode plugin that stores and recalls project knowledge across sessions using vector embeddings and semantic search.
@@ -8,6 +8,8 @@
!!! tip "Works with Standalone OpenCode"
This plugin can also be used with standalone OpenCode installations outside of OpenCode Manager. Simply install the package and add it to your `opencode.json` plugins array.
+---
+
## Installation
```bash
@@ -24,14 +26,18 @@ Then register the plugin in your `opencode.json`:
}
```
+---
+
## Configuration
-On first run, the plugin writes a default config to:
+On first run, the plugin copies a bundled `config.json` to the global data directory:
- `~/.local/share/opencode/memory/config.json`
- Falls back to `$XDG_DATA_HOME/opencode/memory/config.json`
-The file is only created if it does not already exist.
+The file is only created if it does not already exist. The config is validated on load — if it fails validation, defaults are used automatically.
+
+### Full Default Config
```json
{
@@ -57,7 +63,7 @@ The file is only created if it does not already exist.
}
```
-For API-based embeddings:
+### API-Based Embedding Example
```json
{
@@ -79,7 +85,7 @@ For API-based embeddings:
Set `baseUrl` to point at any OpenAI-compatible self-hosted service (vLLM, Ollama, LocalAI, LiteLLM, text-embeddings-inference). The URL is automatically normalized — providing `http://localhost:11434` appends `/v1/embeddings`.
-### Options
+### All Options
| Key | Description | Default |
|-----|-------------|---------|
@@ -88,141 +94,447 @@ Set `baseUrl` to point at any OpenAI-compatible self-hosted service (vLLM, Ollam
| `embedding.dimensions` | Vector dimensions (auto-detected for known models) | — |
| `embedding.apiKey` | API key for OpenAI/Voyage | — |
| `embedding.baseUrl` | Custom endpoint for self-hosted services | — |
-| `dataDir` | SQLite database directory | `~/.local/share/opencode/memory` |
+| `embedding.serverGracePeriod` | Time (ms) before idle embedding server shuts down | `30000` |
+| `dataDir` | SQLite database and embedding server directory | `~/.local/share/opencode/memory` |
| `dedupThreshold` | Similarity threshold for deduplication (0.05–0.40) | `0.25` |
| `logging.enabled` | Write logs to file | `false` |
| `logging.file` | Log file path (10MB limit, auto-rotated) | `…/logs/memory.log` |
-| `compaction.customPrompt` | Use optimized compaction prompt | `true` |
+| `compaction.customPrompt` | Use optimized compaction prompt for session continuity | `true` |
| `compaction.inlinePlanning` | Include planning state in compaction context | `true` |
| `compaction.maxContextTokens` | Max tokens for injected memory context | `4000` |
| `compaction.snapshotToKV` | Save pre-compaction snapshot for recovery | `true` |
+---
+
+## Architecture
+
+The plugin is composed of several subsystems that work together:
+
+```
+┌──────────────────────────────────────────────────┐
+│ Memory Plugin │
+├─────────┬──────────┬───────────┬─────────────────┤
+│ Tools │ Agents │ Hooks │ Compaction │
+├─────────┴──────────┴───────────┴─────────────────┤
+│ Memory Service │
+├──────────────┬────────────────┬───────────────────┤
+│ Embedding │ Vec Search │ Cache │
+│ Service │ (sqlite-vec) │ (In-Memory) │
+├──────────────┴────────────────┴───────────────────┤
+│ SQLite Database (WAL) │
+│ memories | session_state | metadata │
+└──────────────────────────────────────────────────┘
+```
+
+### Storage Layer
+
+The plugin uses a single SQLite database in WAL mode with three tables:
+
+| Table | Purpose |
+|-------|---------|
+| `memories` | Stores all memory records with scope, content, access tracking |
+| `session_state` | Key-value store for planning state and compaction snapshots with TTL |
+| `plugin_metadata` | Tracks the active embedding model and dimensions for drift detection |
+
+SQLite pragmas are tuned for concurrent access:
+
+- `journal_mode=WAL` — concurrent reads during writes
+- `busy_timeout=5000` — wait up to 5s on lock contention
+- `synchronous=NORMAL` — balanced durability and performance
+
+### Vector Search
+
+Vector similarity search is powered by `sqlite-vec`, a SQLite extension. The vec service:
+
+- Initializes lazily after the database is ready
+- Falls back to a no-op service if the extension is unavailable (search still works via exact match, just without semantic ranking)
+- Supports insert, delete, search, and similarity-threshold queries
+- Scoped by project ID for multi-project isolation
+
+### Embedding Subsystem
+
+The embedding system has three provider types and a shared server architecture:
+
+#### Local Provider
+
+Uses `@huggingface/transformers` to run `all-MiniLM-L6-v2` locally. The model is loaded lazily on first use with a warmup hint at plugin initialization.
+
+#### Shared Embedding Server
+
+When using the `local` provider, the plugin runs a shared Unix socket server (`embedding.sock`) that:
+
+1. Loads the model once into memory
+2. Serves embedding requests to multiple plugin instances via Unix domain socket
+3. Uses reference counting — clients send `connect`/`disconnect` messages
+4. Auto-shuts down after a configurable grace period (default 30s) when the last client disconnects
+5. Uses PID files and startup locks to prevent duplicate server instances
+6. Falls back to in-process embedding if the server fails to start
+
+This architecture means the model is loaded once regardless of how many OpenCode sessions are running.
+
+#### API Provider
+
+Supports OpenAI and Voyage embedding APIs:
+
+- Batch processing in chunks of 100 texts
+- Automatic URL normalization for self-hosted endpoints
+- Bearer token authentication
+
+#### Embedding Cache
+
+All embeddings are cached in memory using SHA-256 content hashes. Cache entries expire after 24 hours. This prevents redundant API calls or model inference for identical content.
+
+### Embedding Sync
+
+On startup, the plugin checks for memories that lack embeddings (e.g., from a model change or failed previous embedding) and backfills them automatically:
+
+- Processes in batches of 50
+- Retries failed embeddings up to 3 times
+- Stops early if an entire batch fails (prevents infinite loops)
+- Caps at 100 iterations to bound startup time
+
+### Auto-Validation
+
+After the vec service initializes, the plugin compares the configured embedding model/dimensions against what's stored in `plugin_metadata`. If there's a mismatch (model drift), it automatically triggers a reindex — no manual `memory-health reindex` needed.
+
+---
+
## Memory Model
### Scopes
-| Scope | Description |
+Every memory belongs to exactly one scope:
+
+| Scope | Purpose | Examples |
+|-------|---------|---------|
+| `convention` | Rules and patterns to follow | "Use named imports only", "Tests use describe/it blocks" |
+| `decision` | Architectural choices with rationale | "Chose SQLite over PostgreSQL for simplicity" |
+| `context` | Reference information | "Entry point is src/index.ts", "Prices stored as integers" |
+
+### Fields
+
+Each memory record contains:
+
+| Field | Description |
|-------|-------------|
-| `convention` | Coding style rules, naming patterns, workflow preferences |
-| `decision` | Architectural choices and their rationale |
-| `context` | Project structure, key file locations, domain knowledge, known issues |
+| `id` | Auto-incrementing integer primary key |
+| `projectId` | The OpenCode project this memory belongs to |
+| `scope` | `convention`, `decision`, or `context` |
+| `content` | The memory text |
+| `filePath` | Optional file path reference |
+| `accessCount` | How many times this memory has been read |
+| `lastAccessedAt` | Timestamp of last access |
+| `createdAt` | Creation timestamp |
+| `updatedAt` | Last modification timestamp |
-### Statuses
-
-| Status | Description |
-|--------|-------------|
-| `active` | Available for injection and search |
-| `archived` | Preserved but excluded from injection |
-| `deleted` | Soft-deleted, not returned |
-
-## Tools
-
-The plugin registers seven tools that the AI agent can call directly:
-
-| Tool | Description |
-|------|-------------|
-| `memory-read` | Search memories by semantic query or list by scope |
-| `memory-write` | Store a new memory with a scope |
-| `memory-edit` | Update the content or scope of an existing memory |
-| `memory-delete` | Soft-delete a memory by ID |
-| `memory-health` | Check plugin health or reindex all embeddings |
-| `memory-planning-update` | Update session planning state (phases, objectives, progress) |
-| `memory-planning-get` | Get the current planning state for a session |
-
-### memory-read
-
-```
-query (optional) - Semantic search query
-scope (optional) - Filter by convention | decision | context
-limit (optional) - Max results (default: 10)
-```
-
-When `query` is provided, results are ranked by vector similarity. Without `query`, memories are listed in order.
-
-### memory-write
-
-```
-content - The memory content to store
-scope - convention | decision | context
-```
-
-Deduplication runs automatically — if a semantically similar memory already exists, the write is skipped and the existing ID is returned.
-
-### memory-edit
-
-```
-id - Memory ID to update
-content - New content
-scope (optional) - New scope
-```
-
-### memory-delete
-
-```
-id - Memory ID to delete
-```
-
-### memory-health
-
-```
-action - check (default) | reindex
-```
-
-Use `check` to view embedding provider status, database health, memory count, and whether a reindex is needed. Use `reindex` to regenerate all embeddings after changing the model or dimensions.
-
-!!! warning "Model Changes Require Reindex"
- If you change `embedding.model` or `embedding.dimensions`, existing embeddings will have mismatched dimensions and search will fail. Run `memory-health` with `action: reindex` after any model change.
-
-### memory-planning-update
-
-```
-sessionID - The session ID to update
-objective (optional) - The main task/goal
-current (optional) - Current phase or activity
-next (optional) - What comes next
-phases (optional) - Phase list with title, status, and optional notes
-findings (optional) - Key discoveries (appended to existing)
-errors (optional) - Errors to avoid (appended to existing)
-```
-
-Merges new fields with existing state. Findings and errors are deduplicated and appended rather than replaced.
-
-### memory-planning-get
-
-```
-sessionID - The session ID to retrieve planning state for
-```
-
-Returns the current planning state including objective, phases, findings, and errors.
-
-## Planning State
-
-Planning state is separate from memories. It stores temporary session data — objectives, phase progress, findings, and errors — with a **7-day TTL**. After expiry, planning state is automatically cleaned up.
-
-Use planning state to track multi-step tasks within a session. The plugin injects active planning state into compaction context so progress survives context window resets.
-
-Memories, by contrast, are persisted indefinitely and retrieved via semantic search across all sessions.
-
-## Automatic Extraction
-
-After a session is compacted, the plugin automatically invokes the `ocm - Memory` agent to review the compaction summary and extract durable knowledge using `memory-write`. It checks for duplicates before writing by calling `memory-read` first.
-
-Only persistent knowledge is stored — ephemeral task progress and session-specific notes are skipped.
-
-## Compaction Awareness
-
-When a session compaction is triggered, the plugin injects context into the compaction prompt:
-
-- **Project memories** — up to 10 conventions and 10 decisions are included under a `## Project Memory` section so the AI's summary preserves them
-- **Planning state** — active objective, current phase, next steps, and findings are prepended if present
-- **Custom compaction prompt** — replaces the default prompt with one optimized for continuation context
-
-A pre-compaction snapshot is also saved to key-value storage for recovery if needed.
-
-## Deduplication
+### Deduplication
Before storing a new memory, the plugin:
-1. Checks for exact content matches
-2. Computes vector similarity against existing memories
-3. Skips the write if similarity exceeds `dedupThreshold`
+1. Checks for an exact content match in the same project
+2. Computes vector similarity against all existing project memories
+3. Skips the write if similarity exceeds `dedupThreshold` (default 0.25)
+4. Uses a transaction with double-check locking to prevent race conditions
+
+When deduplication triggers, the existing memory's ID is returned instead of creating a duplicate.
+
+---
+
+## Tools
+
+The plugin registers seven tools that the AI agent can call:
+
+### memory-read
+
+Search and retrieve project memories.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `query` | string | No | Semantic search query |
+| `scope` | enum | No | Filter by `convention`, `decision`, or `context` |
+| `limit` | number | No | Max results (default: 10) |
+
+When `query` is provided, results are ranked by vector similarity. Without `query`, memories are listed in chronological order. Access counts are tracked for every read.
+
+### memory-write
+
+Store a new project memory with automatic deduplication.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `content` | string | Yes | The memory content to store |
+| `scope` | enum | Yes | `convention`, `decision`, or `context` |
+
+Returns the memory ID and whether deduplication matched an existing memory.
+
+### memory-edit
+
+Update the content or scope of an existing memory. Re-embeds the content if changed.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `id` | number | Yes | Memory ID to update |
+| `content` | string | Yes | New content |
+| `scope` | enum | No | New scope (keeps existing if omitted) |
+
+### memory-delete
+
+Soft-delete a memory by ID. The memory must exist or an error is returned.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `id` | number | Yes | Memory ID to delete |
+
+### memory-health
+
+Check plugin health or trigger a reindex of all embeddings.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `action` | enum | No | `check` (default) or `reindex` |
+
+**Check** returns:
+
+- Overall status: `ok`, `degraded`, or `error`
+- Embedding provider status and operational state
+- Shared embedding server status (running, client count, uptime)
+- Database health and total memory count
+- Configured vs. indexed model comparison
+- Whether a reindex is needed
+
+**Reindex** regenerates all embeddings with the configured model:
+
+- Verifies the provider is operational before starting
+- Processes memories in batches of 50
+- Updates the `plugin_metadata` table on success
+- Reports total, success, and failure counts
+
+!!! warning "Model Changes Require Reindex"
+ If you change `embedding.model` or `embedding.dimensions`, existing embeddings will have mismatched dimensions. Auto-validation handles this on startup, but you can also trigger it manually with `memory-health reindex`.
+
+### memory-planning-update
+
+Update the session planning state. Uses merge semantics — only updates fields you provide.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `sessionID` | string | Yes | The session ID |
+| `objective` | string | No | The main task/goal |
+| `current` | string | No | Current phase or activity |
+| `next` | string | No | What comes next |
+| `phases` | array | No | Phase list: `[{title, status, notes?}]` |
+| `findings` | array | No | Key discoveries (appended, deduplicated) |
+| `errors` | array | No | Errors to avoid (appended, deduplicated) |
+
+Findings and errors use append semantics with deduplication — new entries are added to existing ones rather than replacing them.
+
+### memory-planning-get
+
+Retrieve the current planning state for a session.
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `sessionID` | string | Yes | The session ID |
+
+Returns a formatted view of the planning state including objective, current phase, phases with status icons (`[x]` completed, `[~]` in progress, `[ ]` pending), findings, and errors.
+
+---
+
+## Planning State
+
+Planning state is separate from memories. It tracks temporary session progress — objectives, phase completion, findings, and blockers.
+
+| Property | Memories | Planning State |
+|----------|----------|----------------|
+| Persistence | Indefinite | 7-day TTL |
+| Scope | Cross-session, semantic search | Single session |
+| Purpose | Durable project knowledge | Task progress tracking |
+| Cleanup | Manual (delete/archive) | Automatic (expired entries removed every 30 minutes) |
+| Compaction snapshot TTL | N/A | 24 hours |
+
+The plugin injects active planning state into compaction context so task progress survives context window resets. After compaction, the Memory agent extracts any durable knowledge from the compaction summary and stores it as memories.
+
+---
+
+## Agents
+
+The plugin registers three agents that are configured into OpenCode:
+
+### Code Agent (primary)
+
+- **Display name:** `Code`
+- **Mode:** `primary` (replaces the default agent)
+- **Role:** Primary coding agent with memory awareness
+
+The Code agent's system prompt instructs it to:
+
+- Check memory before modifying unfamiliar code areas
+- Store architectural decisions and discovered patterns
+- Use the Memory subagent for complex retrieval tasks
+- Use the Review subagent for convention-aware code review
+- Follow a before/during/after workflow for memory integration
+
+### Memory Agent (subagent)
+
+- **Display name:** `Memory`
+- **Mode:** `subagent`
+- **Role:** Institutional memory manager
+
+The Memory agent handles:
+
+- Strategic retrieval across scopes with prioritized results
+- Storage with proper scope categorization and rationale
+- Contradiction detection between overlapping memories
+- Curation: merging duplicates, archiving outdated entries
+- Planning state management after compaction events
+- Post-compaction knowledge extraction (invoked automatically)
+
+### Memory Review Agent (subagent)
+
+- **Display name:** `Memory Review`
+- **Mode:** `subagent`
+- **Temperature:** 0.0 (deterministic)
+- **Excluded tools:** `write`, `edit`, `apply_patch` (read-only)
+- **Role:** Convention-aware code review
+
+The Review agent checks code against stored conventions and decisions, providing structured findings at Critical/Warning/Suggestion levels with specific file and line references.
+
+### Built-in Agent Enhancements
+
+The plugin also modifies built-in OpenCode agents:
+
+| Agent | Enhancement |
+|-------|-------------|
+| `plan` | Gets access to `memory-read`, `memory-planning-update`, and `memory-planning-get` tools |
+| `build` | Hidden (replaced by the Code agent) |
+
+The default agent is set to `Code`.
+
+---
+
+## Hooks
+
+The plugin registers several hooks into OpenCode's lifecycle:
+
+### chat.message
+
+- Tracks session initialization (first message per session)
+- Detects keyword patterns in user messages for memory activation
+
+### experimental.chat.system.transform
+
+When keyword activation is detected (e.g., "remember this", "project memory", "recall"), injects a system message informing the AI about available memory tools.
+
+### event
+
+Listens for `session.compacted` events and triggers automatic knowledge extraction by prompting the Memory agent to:
+
+1. Review the compaction summary
+2. Extract durable knowledge using `memory-write`
+3. Extract planning state using `memory-planning-update`
+4. Check for duplicates before storing
+
+### experimental.session.compacting
+
+The core compaction hook that fires when a session is about to be compacted. It injects context to preserve knowledge across context window resets:
+
+1. **Planning state** — If `inlinePlanning` is enabled, fetches and formats the current session's planning state (objective, phases, findings, errors)
+
+2. **Prior compaction snapshot** — If `snapshotToKV` is enabled, retrieves the previous compaction's snapshot for continuity (timestamp, branch, prior planning state)
+
+3. **Project memories** — Fetches up to 10 conventions and 10 decisions for the project and formats them under `### Conventions` and `### Decisions` headings
+
+4. **Token budgeting** — All sections are trimmed to fit within `maxContextTokens` (default 4000). Sections are prioritized: planning state > prior snapshot > memories. Lower-priority sections are truncated first.
+
+5. **Custom prompt** — If `customPrompt` is enabled, replaces the default compaction prompt with one optimized for continuation context that preserves active tasks, file paths, decisions, and todo state
+
+6. **Snapshot storage** — Saves a pre-compaction snapshot (planning state, branch, timestamp) to session state for the next compaction cycle
+
+7. **Diagnostics** — Appends a summary line showing how many planning phases, conventions, decisions, and tokens were injected
+
+---
+
+## Keyword Activation
+
+The plugin detects natural language cues in user messages and activates memory features:
+
+| Pattern | Effect |
+|---------|--------|
+| "remember this/that" | Activates memory context injection |
+| "recall" | Activates memory context injection |
+| "what do you know about" | Activates memory context injection |
+| "project memory" | Activates memory context injection |
+| "do you remember" | Activates memory context injection |
+| "stored memory" / "from memory" | Activates memory context injection |
+
+When activated, a system message is injected into the session informing the AI about available memory tools and scopes. Activation is per-session and sticky — once triggered, it remains active for the session.
+
+---
+
+## Data Lifecycle
+
+### Startup Sequence
+
+1. Load and validate config from global data directory
+2. Create embedding provider (local/API)
+3. Warmup embedding provider (non-blocking)
+4. Initialize SQLite database with WAL mode
+5. Create memory service with no-op vec service
+6. Start session state cleanup interval (every 30 min)
+7. Delete expired session state entries
+8. Initialize vec service asynchronously:
+ - If available: sync missing embeddings, auto-validate model drift
+ - If unavailable: continue with no-op (semantic search degraded)
+
+### Cleanup
+
+On process exit, `SIGINT`, or `SIGTERM`:
+
+1. Dispose vec service
+2. Destroy in-memory cache
+3. Dispose embedding provider (disconnect from shared server or release model)
+4. Stop session state cleanup interval
+5. Close SQLite database
+
+The cleanup function is idempotent — calling it multiple times is safe.
+
+### Data Locations
+
+| File | Location | Purpose |
+|------|----------|---------|
+| `memory.db` | `{dataDir}/` | SQLite database with all memories and session state |
+| `config.json` | `{dataDir}/` | Plugin configuration |
+| `embedding.sock` | `{dataDir}/` | Unix socket for shared embedding server |
+| `embedding.pid` | `{dataDir}/` | PID file for the embedding server process |
+| `embedding.startup.lock` | `{dataDir}/` | Directory-based lock to prevent duplicate server starts |
+| `memory.log` | `{dataDir}/logs/` | Debug log (when logging is enabled) |
+| `models/` | `{dataDir}/` | Hugging Face model cache for local embeddings |
+
+---
+
+## Troubleshooting
+
+### Plugin shows "degraded" status
+
+The embedding provider is not operational. For local embeddings, the model may not have downloaded. For API providers, check your API key and network connectivity. Run `memory-health` with `action: check` for details.
+
+### Search returns no results
+
+- Verify memories exist with `memory-read` (no query, no scope)
+- Check if a reindex is needed: `memory-health check` — look for "Reindex required"
+- If using a new model, run `memory-health reindex`
+
+### Embedding server won't start
+
+- Check if another process holds the startup lock: look for `embedding.startup.lock` directory in the data dir
+- If stale, delete it manually: `rm -rf ~/.local/share/opencode/memory/embedding.startup.lock`
+- Check if the socket file exists but the process is dead: `rm ~/.local/share/opencode/memory/embedding.sock`
+- Verify Bun is installed and available on PATH
+
+### Planning state not persisting
+
+Planning state has a 7-day TTL. If the session is older than 7 days, the state has been automatically cleaned up. Compaction snapshots have a shorter 24-hour TTL.
+
+### Memory not injected during compaction
+
+Check that `compaction.customPrompt` and `compaction.inlinePlanning` are both `true` in your config. Verify that memories exist for the project by running `memory-read` without filters.
diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css
index 82e21beb..a91d2ea5 100644
--- a/docs/stylesheets/extra.css
+++ b/docs/stylesheets/extra.css
@@ -1,3 +1,118 @@
+:root > [data-md-color-scheme="slate"] {
+ --md-default-bg-color: #141414;
+ --md-default-fg-color: #fafafa;
+ --md-default-fg-color--light: #d4d4d8;
+ --md-default-fg-color--lighter: #71717a;
+ --md-default-fg-color--lightest: #3f3f46;
+ --md-code-bg-color: #1a1a1a;
+ --md-code-fg-color: #fafafa;
+ --md-typeset-a-color: #60a5fa;
+ --md-typeset-a-color--light: #93c5fd;
+ --md-primary-fg-color: #0d0d0d;
+ --md-primary-fg-color--light: #1a1a1a;
+ --md-primary-bg-color: #fafafa;
+ --md-accent-fg-color: #60a5fa;
+ --md-accent-bg-color: #fb923c;
+ --md-header-bg-color: #0d0d0d;
+ --md-footer-bg-color: #0d0d0d;
+ --md-sidebar-bg-color: #141414;
+ --md-border-color: #2a2a2a;
+ --md-typeset-mark-bg: #1d4ed833;
+ --md-typeset-kbd-bg: #27272a;
+ --md-typeset-kbd-border-color: #3f3f46;
+ --md-typeset-table-header-bg: #141414;
+ --md-typeset-table-row-alt-bg: #141414;
+}
+
+.md-header {
+ background-color: var(--md-header-bg-color) !important;
+}
+
+.md-header__title {
+ font-weight: 600;
+}
+
+.md-sidebar {
+ background-color: var(--md-sidebar-bg-color) !important;
+}
+
+.md-tabs {
+ background-color: #1a1a1a !important;
+}
+
+.md-tabs__link--active,
+.md-tabs__link:hover {
+ color: #60a5fa !important;
+}
+
+.md-nav__link--active,
+.md-nav__link:hover {
+ color: #60a5fa !important;
+}
+
+.md-nav__item--active > .md-nav__link {
+ color: #60a5fa !important;
+}
+
+.md-header__topic .md-ellipsis {
+ color: #fafafa;
+}
+
+.md-header__button.md-logo,
+.md-header__button[for="__search"] {
+ color: #fafafa !important;
+}
+
+.md-source__repository {
+ color: #fb923c !important;
+}
+
+.md-source__fact {
+ color: #fb923c99 !important;
+}
+
+.md-footer {
+ background-color: var(--md-footer-bg-color) !important;
+}
+
+.md-typeset table:not([class*="narrow"]) th {
+ background-color: var(--md-typeset-table-header-bg);
+}
+
+.md-typeset table:not([class*="narrow"]) tr:nth-child(even) {
+ background-color: var(--md-typeset-table-row-alt-bg);
+}
+
+.md-typeset .admonition,
+.md-typeset details {
+ background-color: #141414;
+ border-color: #2a2a2a;
+}
+
+.md-typeset .admonition-title,
+.md-typeset details > summary {
+ background-color: #1a1a1a;
+ border-color: #2a2a2a;
+}
+
+.md-typeset kbd {
+ background-color: var(--md-typeset-kbd-bg);
+ border-color: var(--md-typeset-kbd-border-color);
+ color: var(--md-default-fg-color);
+}
+
+.md-search__input {
+ background-color: #141414 !important;
+}
+
+.md-search__input::placeholder {
+ color: #71717a;
+}
+
+.md-source-file {
+ color: #71717a;
+}
+
.screenshot-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
@@ -45,8 +160,30 @@
color: var(--md-default-fg-color--light);
}
-.md-typeset table:not([class]) {
- font-size: 0.8rem;
+.md-typeset table {
+ display: table;
+ width: 100%;
+ table-layout: auto;
+ word-wrap: break-word;
+}
+
+.md-typeset table td,
+.md-typeset table th {
+ max-width: 500px;
+}
+
+.md-typeset table th:first-child,
+.md-typeset table td:first-child {
+ width: 35%;
+ min-width: 250px;
+}
+
+.md-grid {
+ max-width: 1400px;
+}
+
+.md-content {
+ max-width: 1200px;
}
.md-typeset .admonition,
diff --git a/mkdocs.yml b/mkdocs.yml
index f5bc8b80..df6bee18 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -9,18 +9,7 @@ theme:
- scheme: slate
primary: blue grey
accent: cyan
- toggle:
- icon: material/brightness-7
- name: Switch to light mode
- - scheme: default
- primary: blue grey
- accent: cyan
- toggle:
- icon: material/brightness-4
- name: Switch to dark mode
features:
- - navigation.sections
- - navigation.expand
- navigation.top
- navigation.tracking
- navigation.tabs
@@ -43,6 +32,7 @@ nav:
- File Browser: features/files.md
- Chat & Sessions: features/chat.md
- AI Configuration: features/ai-config.md
+ - Memory Plugin: features/memory.md
- MCP Servers: features/mcp.md
- Text-to-Speech: features/tts.md
- Speech-to-Text: features/stt.md