diff --git a/.env.example b/.env.example index 873d8410..848020ba 100644 --- a/.env.example +++ b/.env.example @@ -108,7 +108,7 @@ PASSKEY_ORIGIN=http://localhost:5003 # questions, permission requests, errors, and session completions). # # Setup: -# 1. Generate keys: npx web-push generate-vapid-keys +# 1. Generate keys: pnpm dlx web-push generate-vapid-keys # 2. Set VAPID_PUBLIC_KEY and VAPID_PRIVATE_KEY from the output # 3. Set VAPID_SUBJECT to a mailto: address (REQUIRED for iOS/Safari) # diff --git a/README.md b/README.md index f34c67e3..5efae238 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ For OAuth, Passkeys, Push Notifications (VAPID), and advanced configuration, see OpenCode Manager ships an `ocm` CLI (from `ocm-cli/`) that attaches your local OpenCode TUI to a repo hosted on the Manager. It lists ready repos, attaches via the Manager's `/api/opencode-proxy` (so prompts run on the Manager's filesystem against a single shared OpenCode server), and can tarball-sync the working tree up or down with `ocm push` / `ocm pull`. Running `ocm` inside a local clone auto-detects the matching Manager repo by `origin` URL. -See the [`ocm` CLI guide](docs/opencode-manager-workspaces.md) for setup and commands. +See the [`ocm` CLI guide](docs/ocm-cli.md) for setup and commands. ## Documentation @@ -115,7 +115,7 @@ See the [`ocm` CLI guide](docs/opencode-manager-workspaces.md) for setup and com - [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 -- [`ocm` CLI](docs/opencode-manager-workspaces.md) — Attach local OpenCode TUI to Manager repos +- [`ocm` CLI](docs/ocm-cli.md) — Attach local OpenCode TUI to Manager repos ## License diff --git a/docs/configuration/docker.md b/docs/configuration/docker.md index 7eaf2d44..3c8bcf3f 100644 --- a/docs/configuration/docker.md +++ b/docs/configuration/docker.md @@ -47,6 +47,7 @@ services: - HOST=0.0.0.0 - PORT=5003 - OPENCODE_SERVER_PORT=5551 + - OPENCODE_HOST=127.0.0.1 - DATABASE_PATH=/app/data/opencode.db - WORKSPACE_PATH=/workspace - PROCESS_START_WAIT_MS=2000 diff --git a/docs/configuration/environment.md b/docs/configuration/environment.md index 0640ea63..93a44827 100644 --- a/docs/configuration/environment.md +++ b/docs/configuration/environment.md @@ -46,7 +46,7 @@ Complete reference for all configuration options. Generate VAPID public/private key pair: ```bash -npx web-push generate-vapid-keys +pnpm dlx web-push generate-vapid-keys ``` Add to `.env`: @@ -94,9 +94,20 @@ When configured, users can enable push notifications in Settings → Notificatio |----------|-------------|---------| | `OPENCODE_SERVER_PORT` | Port for the OpenCode CLI server | `5551` | | `OPENCODE_HOST` | OpenCode server bind address | `127.0.0.1` | +| `OPENCODE_PUBLIC_URL` | Public URL passed to OpenCode for OAuth callbacks | - | +| `OPENCODE_HEALTH_WATCH_ENABLED` | Enable OpenCode health watcher and recovery | `true` (`false` in tests) | +| `OPENCODE_HEALTH_POLL_MS` | OpenCode health watcher poll interval | `30000` | +| `OPENCODE_HEALTH_FAILURE_THRESHOLD` | Failed health checks before recovery starts | `2` | | `OPENCODE_SERVER_PASSWORD` | Basic Auth password required when binding OpenCode to a non-loopback host. Can also be set via UI (Settings → OpenCode → Server Auth). DB-stored passwords override this env var. | - | | `OPENCODE_SERVER_USERNAME` | Basic Auth username | `opencode` | +## OpenCode Import + +| Variable | Description | Default | +|----------|-------------|---------| +| `OPENCODE_IMPORT_CONFIG_PATH` | Existing standalone OpenCode `opencode.json` to import on first startup | - | +| `OPENCODE_IMPORT_STATE_PATH` | Existing standalone OpenCode state directory to import on first startup | - | + ## Timeouts | Variable | Description | Default | @@ -178,7 +189,7 @@ K7gNU3sdo+OL0wNhqoVWhr3g6s1xYv72ol/pe/Unols= Generate VAPID public/private key pair for push notifications: ```bash -npx web-push generate-vapid-keys +pnpm dlx web-push generate-vapid-keys ``` Output example: @@ -201,11 +212,4 @@ mailto:you@example.com ## Environment Precedence -Variables are loaded in this order (later overrides earlier): - -1. System environment variables -2. `.env` file in project root -3. Docker Compose `environment` section -4. Docker Compose `env_file` reference - -``` +Local runtime loads `.env` from the project root with `dotenv` without overriding variables that are already present in the process environment. Docker Compose reads `.env` for interpolation, then passes the explicit `environment` entries from `docker-compose.yml` into the container. diff --git a/docs/features/ai-config.md b/docs/features/ai-config.md index d2d56736..927efb83 100644 --- a/docs/features/ai-config.md +++ b/docs/features/ai-config.md @@ -40,13 +40,13 @@ To browse all available models: You can switch models at any point during a session without losing context. The new model is used for all subsequent messages. -## Provider Credentials +## Providers Configure API keys or OAuth for AI providers. ### API Key Method -1. Go to **Settings > Provider Credentials** +1. Go to **Settings > Providers** 2. Select a provider (OpenAI, Anthropic, etc.) 3. Enter your API key 4. Click **Save** @@ -55,7 +55,7 @@ Configure API keys or OAuth for AI providers. For providers that support OAuth (Anthropic, GitHub Copilot): -1. Go to **Settings > Provider Credentials** +1. Go to **Settings > Providers** 2. Select a provider with the OAuth badge 3. Click **Add OAuth** 4. Choose authorization method: diff --git a/docs/features/git.md b/docs/features/git.md index d42c7738..bfa83ce6 100644 --- a/docs/features/git.md +++ b/docs/features/git.md @@ -27,13 +27,13 @@ OpenCode Manager scans that folder for nested git repositories and links each on For private repositories, configure a GitHub Personal Access Token: -1. Go to **Settings > Credentials** +1. Go to **Settings > Git > Credentials** 2. Enter your GitHub PAT 3. Ensure the token has `repo` scope ### SSH Repositories -SSH key authentication added for git repositories. Configure SSH keys in Settings > Credentials. +SSH key authentication added for git repositories. Configure SSH keys in Settings > Git > Credentials. ## Git Worktrees diff --git a/docs/features/mcp.md b/docs/features/mcp.md index 3d61a108..21cad152 100644 --- a/docs/features/mcp.md +++ b/docs/features/mcp.md @@ -131,15 +131,6 @@ Toggle servers on/off: Disabled servers won't be started or connected. -### Edit Configuration - -Modify server settings: - -1. Click the **Edit** button on a server -2. Update configuration -3. Click **Save** -4. Server will restart with new settings - ### Delete Server Remove a server: @@ -147,14 +138,9 @@ Remove a server: 1. Click the **Delete** button 2. Confirm deletion -### Restart Server +### Refresh Status -Force restart a server: - -1. Click the **Restart** button -2. Server process is stopped and restarted - -Useful after configuration changes or if a server becomes unresponsive. +Use the refresh button in **Settings > MCP Servers** to reload the current connection status after changing a server outside the UI or completing OAuth. ## Server Status @@ -162,33 +148,15 @@ Monitor server health: | Status | Description | |--------|-------------| -| Running | Server is active and connected | -| Starting | Server is launching | -| Stopped | Server is disabled | -| Error | Server failed to start | - -Click on a server to see detailed status and logs. +| Connected | Server is active and connected | +| Disabled | Server is configured but disabled | +| Auth Required | Remote server needs OAuth authentication | +| Registration Required | Remote server needs OAuth client registration | +| Failed | Server failed to start or connect | ## Tool Permissions -Control which tools AI can access: - -### Global Settings - -In **Settings > MCP Servers**: - -- **Allow All Tools** - AI can use any tool -- **Require Confirmation** - Ask before using tools -- **Deny by Default** - Block tools unless allowed - -### Per-Agent Settings - -Configure tool access for custom agents: - -1. Go to **Settings > Agents** -2. Edit an agent -3. Set **Allowed Tools** -4. Save changes +The MCP server manager adds, toggles, authenticates, and deletes server configurations. Tool access is controlled by the active OpenCode configuration and any custom agent configuration, not by a separate global MCP permission mode in this screen. ## Troubleshooting @@ -196,14 +164,14 @@ Configure tool access for custom agents: 1. Check the command is installed: `npx -y @modelcontextprotocol/server-` 2. Verify environment variables are set -3. Check server logs for errors +3. Check the displayed status error 4. Try running the command manually ### Tools Not Appearing -1. Verify server status is "Running" +1. Verify server status is "Connected" 2. Check server provides the expected tools -3. Restart the server +3. Refresh server status 4. Check AI model supports tool use ### Connection Issues diff --git a/docs/features/notifications.md b/docs/features/notifications.md index 91386045..acfdd567 100644 --- a/docs/features/notifications.md +++ b/docs/features/notifications.md @@ -50,7 +50,7 @@ Apple's Push Notification Service (APNs) has strict requirements: Generate VAPID public/private key pair: ```bash -npx web-push generate-vapid-keys +pnpm dlx web-push generate-vapid-keys ``` Output: @@ -113,4 +113,3 @@ Control which events trigger notifications: - **Question Asked** - Get notified when agent has a question (default: on) - **Session Error** - Get notified on session errors (default: on) - **Session Complete** - Get notified when session finishes (default: off) - diff --git a/docs/features/opencode-workspaces.md b/docs/features/opencode-workspaces.md index 61f9017b..4384c953 100644 --- a/docs/features/opencode-workspaces.md +++ b/docs/features/opencode-workspaces.md @@ -1,5 +1,5 @@ # OpenCode Workspaces (Repo Targets) -> This page has been relocated to [opencode-manager-workspaces.md](../opencode-manager-workspaces.md) per Phase 6 requirements. +> This page has been relocated to the [`ocm` CLI guide](../ocm-cli.md). -See the full documentation at [docs/opencode-manager-workspaces.md](../opencode-manager-workspaces.md). +See the full documentation at [docs/ocm-cli.md](../ocm-cli.md). diff --git a/docs/features/skills.md b/docs/features/skills.md index 7ebf5f3d..2772f317 100644 --- a/docs/features/skills.md +++ b/docs/features/skills.md @@ -17,11 +17,6 @@ Each skill is a `SKILL.md` file with YAML frontmatter and a markdown body: --- name: my-skill description: Short description of what this skill does -license: MIT -compatibility: opencode >= 1.0 -metadata: - author: your-name - version: 1.0.0 --- Your skill instructions go here. This is the content that gets injected into the AI agent's context when the skill is loaded. @@ -33,9 +28,6 @@ injected into the AI agent's context when the skill is loaded. |-------|----------|-------------| | `name` | Yes | Lowercase alphanumeric with hyphens (e.g., `my-skill`). Max 64 characters. | | `description` | Yes | What the skill does. Max 1024 characters. | -| `license` | No | License identifier (e.g., `MIT`) | -| `compatibility` | No | Version compatibility note | -| `metadata` | No | Key-value pairs for additional context | ### Naming Rules @@ -69,11 +61,7 @@ All endpoints are under `/api/settings/skills`. "name": "my-skill", "description": "Runs type check and lint", "body": "Instructions for the AI agent...", - "scope": "global", - "license": "MIT", - "compatibility": "opencode >= 1.0", - "metadata": { "author": "your-name" }, - "repoId": 1 + "scope": "global" } ``` @@ -81,12 +69,11 @@ All endpoints are under `/api/settings/skills`. ### Update Request -All fields are optional. Set a field to `null` to clear it. +All fields are optional. Omit fields you do not want to change. ```json { "description": "Updated description", - "body": "Updated instructions", - "license": null + "body": "Updated instructions" } ``` diff --git a/docs/features/tts.md b/docs/features/tts.md index 8cad5099..7f886254 100644 --- a/docs/features/tts.md +++ b/docs/features/tts.md @@ -34,7 +34,7 @@ Works in modern browsers: ### Setup -1. Go to **Settings > TTS** +1. Go to **Settings > Voice** 2. Enable **TTS** 3. Select **Built-in Browser** provider 4. Choose a voice from available browser voices @@ -74,7 +74,7 @@ Connect to OpenAI-compatible TTS endpoints for higher quality voices. ### Setup -1. Go to **Settings > TTS** +1. Go to **Settings > Voice** 2. Enable **TTS** 3. Select **External API** provider 4. Enter the **TTS Server URL**: diff --git a/docs/getting-started/first-run.md b/docs/getting-started/first-run.md index 92fc76bd..d500bb1b 100644 --- a/docs/getting-started/first-run.md +++ b/docs/getting-started/first-run.md @@ -20,7 +20,7 @@ Click **Create Account** to continue. After account creation, configure an AI provider: -1. Navigate to **Settings > Provider Credentials** +1. Navigate to **Settings > Providers** 2. Select a provider 3. Enter API key or connect via OAuth 4. Save configuration diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 0326b748..059ddfc6 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -45,7 +45,7 @@ On first launch, you'll be redirected to the setup page: Before chatting, you need to configure at least one AI provider: 1. Go to **Settings** (gear icon) -2. Select **Provider Credentials** +2. Select **Providers** 3. Choose a provider (e.g., Anthropic, OpenAI) 4. Enter your **API key** or click **Add OAuth** for supported providers 5. Click **Save** @@ -73,7 +73,7 @@ Choose the onboarding flow that matches your setup: If you already used standalone OpenCode in those repositories, existing chats appear as soon as the discovered repo path matches the original OpenCode path. !!! note "Private Repositories" - For private repos, configure a GitHub Personal Access Token in Settings > Credentials first. + For private repos, configure a GitHub Personal Access Token in Settings > Git > Credentials first. ## 5. Start Chatting diff --git a/docs/opencode-manager-workspaces.md b/docs/ocm-cli.md similarity index 98% rename from docs/opencode-manager-workspaces.md rename to docs/ocm-cli.md index 4afedec1..1c7240e1 100644 --- a/docs/opencode-manager-workspaces.md +++ b/docs/ocm-cli.md @@ -1,4 +1,4 @@ -# OpenCode Manager `ocm` CLI +# `ocm` CLI `ocm` is a small CLI that attaches your local OpenCode TUI to a repo hosted on an OpenCode Manager. Prompts execute on the Manager's filesystem against a single shared OpenCode server, while your laptop terminal hosts the TUI. @@ -49,9 +49,7 @@ The plugin itself is a no-op — it does not register tools, commands, or hooks. If you don't use the OpenCode plugin loader, install globally: ```bash -bun add -g @opencode-manager/ocm-cli -# or -npm i -g @opencode-manager/ocm-cli +pnpm add -g @opencode-manager/ocm-cli ``` This puts `ocm` on your PATH via the package manager's own bin shim. The `~/.local/bin` symlink is skipped for global installs. diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 7f2151ea..bff7979a 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -111,7 +111,7 @@ ADMIN_PASSWORD_RESET=true **Solutions:** -1. Configure GitHub PAT in Settings > Credentials +1. Configure GitHub PAT in Settings > Git > Credentials 2. Ensure PAT has `repo` scope 3. Check PAT hasn't expired diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 83b52387..beb3371c 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -21,14 +21,10 @@ export default defineConfig(({ mode }) => { server: { host: "0.0.0.0", port: 5173, - allowedHosts: ["test.getfit.us"], proxy: { "/api": { target: `http://localhost:${backendPort}`, changeOrigin: true, - headers: { - 'Access-Control-Allow-Origin': 'https://test.getfit.us', - }, }, }, }, diff --git a/mkdocs.yml b/mkdocs.yml index da418467..3bc3d233 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -37,6 +37,7 @@ nav: - MCP Servers: features/mcp.md - Assistant Mode: features/assistant-mode.md - Assistant Internal API: features/assistant-internal-api.md + - ocm CLI: ocm-cli.md - Text-to-Speech: features/tts.md - Speech-to-Text: features/stt.md - Push Notifications: features/notifications.md diff --git a/shared/src/config/env.ts b/shared/src/config/env.ts index 9e903399..0c8b8f3d 100644 --- a/shared/src/config/env.ts +++ b/shared/src/config/env.ts @@ -99,7 +99,7 @@ export const ENV = { AUTH: { SECRET: getEnvString('AUTH_SECRET', process.env.NODE_ENV === 'production' ? '' : generateDefaultSecret()), - TRUSTED_ORIGINS: getEnvString('AUTH_TRUSTED_ORIGINS', 'http://localhost:5173,http://localhost:5003,https://test.getfit.us'), + TRUSTED_ORIGINS: getEnvString('AUTH_TRUSTED_ORIGINS', 'http://localhost:5173,http://localhost:5003'), SECURE_COOKIES: getEnvBoolean('AUTH_SECURE_COOKIES', getEnvString('NODE_ENV', 'development') === 'production'), ADMIN_EMAIL: process.env.ADMIN_EMAIL, ADMIN_PASSWORD: process.env.ADMIN_PASSWORD,