Files

1 line
42 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "anyiwang/opencovibe", "files": {"README.md": {"a8f8fddcd87b5fe9cda7a4309fb7f0e305a68697": {"t": 1785595134.063932, "n": 11266, "h": "5815137039e31755", "c": "<p align=\"center\">\n <img src=\"static/logo-text.png\" width=\"360\" alt=\"OpenCovibe\">\n</p>\n\n<p align=\"center\">\n <strong>Local-first desktop app for AI-assisted vibe coding</strong>\n</p>\n\n<p align=\"center\">\n <a href=\"#why-opencovibe\">Why</a> &middot;\n <a href=\"#key-capabilities\">Capabilities</a> &middot;\n <a href=\"#quick-start\">Quick Start</a> &middot;\n <a href=\"#supported-providers\">Providers</a> &middot;\n <a href=\"#architecture\">Architecture</a> &middot;\n <a href=\"#license\">License</a>\n</p>\n\n<p align=\"center\">\n <b>English</b> | <a href=\"README.zh-CN.md\">简体中文</a>\n</p>\n\n---\n\n<p align=\"center\">\n <img src=\"static/screenshot.png\" width=\"800\" alt=\"OpenCovibe Screenshot\">\n</p>\n\n## Why OpenCovibe?\n\nAI coding CLIs like Claude Code are powerful, but they run inside a terminal. That means no persistent dashboard, no visual diff review, no cross-session history, and no multi-provider switching. OpenCovibe wraps these CLIs with a native desktop UI that adds the layers the terminal can't provide — while keeping all your data **stored locally**. (Remote model APIs require network access; the app itself has no cloud backend.)\n\n| Agent | Status |\n|-------|--------|\n| [Claude Code](https://github.com/anthropics/claude-code) | Supported |\n| [Codex](https://github.com/openai/codex) | Supported — interactive `app-server` mode (default) with `exec` fallback |\n\n**Platform status**: Currently developed and tested primarily on **macOS**. Windows and Linux builds are functional but have not been thoroughly tested for compatibility — contributions and bug reports are welcome.\n\n**Core principle**: Wrap the CLI, surface the work, keep it local.\n\n## Key Capabilities\n\n### What the CLI doesn't give you\n\n| Capability | What OpenCovibe adds |\n|------------|---------------------|\n| **Visual Tool Cards** | Every tool call (Read, Edit, Bash, Grep, Write, WebFetch, …) rendered as an inline card with syntax-highlighted diffs, structured output, and one-click copy |\n| **Run History & Replay** | Browse all past sessions, full event replay, resume / fork from any point, soft-delete with recovery |\n| **Multi-Provider Switching** | Use Claude Code with 15+ API providers (DeepSeek, Kimi, Zhipu, Bailian, DouBao, MiniMax, OpenRouter, Ollama, …) — hot-switch without restarting |\n| **Remote Browser Access** | Embedded web server for browser-based access over LAN or HTTP tunnels (ngrok / cloudflared) |\n| **File Explorer** | Browse and edit project files with syntax highlighting, markdown preview, image preview, and git diff view |\n| **Memory Editor** | Create and edit CLAUDE.md, project-scoped and user-scoped memory files with live preview |\n| **Agent Management** | Visual editor to create, edit, and manage custom agent definitions (.md files) with form and source modes |\n| **Permission Rules** | Manage CLI permission allow/deny rules at user and project level with a visual rule editor |\n| **Usage Analytics** | Per-model token breakdown, cost tracking, daily heatmap, stacked model chart, session-level stats |\n| **Team Dashboard** | Read-only view into Claude Code multi-agent teams — task lists, teammate status, message flow |\n| **Activity Monitor** | Real-time hook event stream, tool activity timeline, file tracking panel, subagent tracking with nested tool cards |\n| **Plugin Marketplace** | Browse, install, and manage Claude Code plugins and skills from a visual marketplace |\n| **MCP Management** | Discover MCP servers, view per-server status, reconnect / toggle from a panel |\n| **Inline Permissions** | Rich permission review UI with batch Allow/Deny panel, CLI-suggested \"Always Allow\" rules, and AskUserQuestion rendering |\n| **CLI Session Import** | Discover and import existing Claude Code CLI sessions into OpenCovibe |\n| **Rewind** | Checkpoint and selectively revert file changes with dry-run preview |\n| **Remote Hosts** | Configure SSH hosts for remote CLI execution with key generation wizard and connectivity testing |\n| **Preview & Element Picker** | Open a localhost preview in a companion window, interactively pick page elements, and insert structured context (DOM path, styles, HTML snippet) into the chat |\n| **Ralph Loop** | Auto-iterate the same prompt until a completion condition is met — hands-free coding with configurable max iterations |\n| **Doctor Diagnostics** | System health checks for CLI, platform, SSH, and proxy configuration |\n\n### Features\n\n- **Rich Chat UI** — Markdown, syntax highlighting, thinking blocks, image attachments, file diffs, collapsible tool burst groups\n- **Session Control** — Create, resume, fork, rename sessions; plan mode toggle; model hot-switch; context history tracking\n- **Drag & Drop** — Native file drag-drop for images, PDFs, directories, and path references\n- **Project Folders** — Sidebar project selector with per-project scoping for memory, permissions, and sessions\n- **Inline Slash Commands** — `/model`, `/diff`, `/todos`, `/tasks`, `/doctor`, `/copy`, `/stats`, `/preview`, `/ralph`, and more — rendered natively in-app\n- **Keyboard Shortcuts** — Fully customizable keybindings with chord support and conflict detection\n- **Hook Manager** — Configure upstream CLI hooks for event-driven automation\n- **i18n** — English and Chinese (Simplified) with lightweight reactive runtime\n- **System Tray** — Hide to tray; background sessions keep running with native notifications\n- **Dark / Light Theme** — CSS variable-based theming with UI zoom control\n- **Auto Update** — In-app update checker with download links\n- **Setup Wizard** — Guided CLI detection, authentication, and provider configuration on first launch\n\n## Quick Start\n\n### Option A: Download Pre-built Binary (macOS)\n\nDownload the latest `.dmg` from [Releases](https://github.com/AnyiWang/OpenCovibe/releases) — universal binary, supports both Apple Silicon and Intel Macs.\n\n> **Note**: The app is not code-signed. On first launch, right-click and select \"Open\" to bypass macOS Gatekeeper.\n\n### Option B: Automated Setup (macOS)\n\n```bash\ngit clone https://github.com/AnyiWang/OpenCovibe.git\ncd OpenCovibe\n./scripts/setup.sh # add --yes to skip confirmation prompts\nnpm run tauri dev\n```\n\nThe setup script detects missing dependencies (Xcode CLI Tools, Homebrew, Node.js, Rust) and installs them automatically.\n\n### Option C: Manual Setup\n\n**Prerequisites:**\n\n- [Node.js](https://nodejs.org/) >= 20\n- [Rust](https://rustup.rs/) >= 1.75\n\n**macOS:**\n```bash\nxcode-select --install\nbrew install node\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n**Linux (Debian/Ubuntu):**\n```bash\nsudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \\\n libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n**Windows:**\n```powershell\n# Install Rust from https://rustup.rs\n# Install Node.js from https://nodejs.org\n```\n\n**Build & Run:**\n\n```bash\ngit clone https://github.com/AnyiWang/OpenCovibe.git\ncd OpenCovibe\nnpm install\nnpm run tauri dev\n```\n\n### Setup Wizard\n\nOn first launch, OpenCovibe guides you through:\n\n1. **CLI Detection** — Auto-detects Claude Code and Codex CLIs, offers installation if missing\n2. **Authentication** — OAuth login or API key for 15+ providers\n3. **Ready** — Start coding\n\nYou can re-run the wizard anytime from **Settings > General > Setup Wizard**.\n\n## Supported Providers\n\n### LLM Providers\n\n| Provider | Endpoint | Auth |\n|----------|----------|------|\n| Anthropic | Official API | API Key |\n| DeepSeek | `api.deepseek.com/anthropic` | Bearer |\n| Kimi (Moonshot) | `api.moonshot.cn/anthropic` | Bearer |\n| Kimi For Coding | `api.kimi.com/coding/` | Bearer |\n| Zhipu (智谱) | `open.bigmodel.cn/api/anthropic` | Bearer |\n| Zhipu (智谱 Intl) | `api.z.ai/api/anthropic` | Bearer |\n| Bailian (Coding Plan) | `coding.dashscope.aliyuncs.com/apps/anthropic` | Bearer |\n| Bailian (百炼 API) | `dashscope.aliyuncs.com/apps/anthropic` | Bearer |\n| DouBao (豆包) | `ark.cn-beijing.volces.com/api/coding` | Bearer |\n| MiniMax | `api.minimax.io/anthropic` | Bearer |\n| MiniMax (China) | `api.minimaxi.com/anthropic` | Bearer |\n| Xiaomi MiMo (小米) | `api.xiaomimimo.com/anthropic` | Bearer |\n| Xiaomi MiMo (Token Plan) | `token-plan-cn.xiaomimimo.com/anthropic` | Bearer |\n| Tencent Hunyuan (混元) | `api.hunyuan.cloud.tencent.com/anthropic` | Bearer |\n| SiliconFlow (硅基流动) | `api.siliconflow.com/` | Bearer |\n\n### API Gateway\n\n| Platform | Endpoint | Auth |\n|----------|----------|------|\n| Vercel AI Gateway | `ai-gateway.vercel.sh` | Bearer |\n| OpenRouter | `openrouter.ai/api` | Bearer |\n| AiHubMix | `aihubmix.com` | Bearer |\n| ZenMux | `zenmux.ai/api/anthropic` | Bearer |\n\n### Local\n\n| Platform | Endpoint |\n|----------|----------|\n| Ollama | `localhost:11434` |\n| [CC Switch](https://github.com/farion1231/cc-switch) | `localhost:15721` |\n| [Claude Code Router](https://github.com/musistudio/claude-code-router) | `localhost:3456` |\n| Custom | Any Anthropic-compatible endpoint |\n\n## Architecture\n\n<p align=\"center\">\n <img src=\"static/architecture.svg\" width=\"700\" alt=\"Architecture\">\n</p>\n\n**Tech Stack:**\n\n| Layer | Technology |\n|-------|-----------|\n| Framework | [Tauri v2](https://v2.tauri.app/) (Rust backend + WebView) |\n| Frontend | [Svelte 5](https://svelte.dev/) + [SvelteKit](https://svelte.dev/docs/kit/) (adapter-static) |\n| Styling | [Tailwind CSS](https://tailwindcss.com/) v3 + CSS variables |\n| Terminal | [xterm.js](https://xtermjs.org/) |\n| Markdown | [marked](https://marked.js.org/) + [highlight.js](https://highlightjs.org/) + [DOMPurify](https://github.com/cure53/DOMPurify) |\n| i18n | Custom lightweight runtime (en + zh-CN) |\n| Testing | [Vitest](https://vitest.dev/) |\n\n**Agent Communication:**\n\nEach session is a long-lived, multi-turn process managed by a per-run session actor. **Claude Code** communicates over a bidirectional stream-JSON protocol (stdin/stdout) with an interactive control protocol. **Codex** supports two transports: `codex app-server` (bidirectional JSON-RPC — the **default**, unlocking interactive approvals, mid-turn steer, fork/rewind/compact/goal, image input, and live command output) or `codex exec` (one-shot NDJSON per turn — a fallback, selectable in Settings for older Codex CLIs).\n\n**Data Storage:**\n\nAll data is stored locally at `~/.opencovibe/` — no cloud, no database.\n\n```\n~/.opencovibe/\n├── settings.json # User settings\n├── runs/ # Session history\n│ └── {run-id}/\n│ ├── meta.json # Run metadata\n│ ├── events.jsonl # Event log\n│ └── artifacts.json # Summary\n└── keybindings.json # Custom shortcuts\n```\n\n## Development\n\n```bash\nnpm install # Install dependencies\nnpm run tauri dev # Dev mode with hot-reload\nnpm test # Run tests\nnpm run lint:fix # Lint\nnpm run format # Format\n```\n\n## Contributing\n\nContributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, coding conventions, and PR guidelines.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=AnyiWang/OpenCovibe&type=Date)](https://star-history.com/#AnyiWang/OpenCovibe&Date)\n\n## License\n\nLicensed under the [Apache License 2.0](LICENSE).\n\nCopyright 2025-2026 OpenCovibe Contributors.\n"}}, "README.zh-CN.md": {"a8f8fddcd87b5fe9cda7a4309fb7f0e305a68697": {"t": 1785595136.5821543, "n": 7289, "h": "a379690a0302644e", "c": "<p align=\"center\">\n <img src=\"static/logo-text.png\" width=\"360\" alt=\"OpenCovibe\">\n</p>\n\n<p align=\"center\">\n <strong>本地优先的 AI 辅助编程桌面应用</strong>\n</p>\n\n<p align=\"center\">\n <a href=\"#为什么选择-opencovibe\">为什么</a> &middot;\n <a href=\"#核心能力\">核心能力</a> &middot;\n <a href=\"#快速开始\">快速开始</a> &middot;\n <a href=\"#支持的平台\">平台</a> &middot;\n <a href=\"#架构\">架构</a> &middot;\n <a href=\"#许可证\">许可证</a>\n</p>\n\n<p align=\"center\">\n <a href=\"README.md\">English</a> | <b>简体中文</b>\n</p>\n\n---\n\n<p align=\"center\">\n <img src=\"static/screenshot.png\" width=\"800\" alt=\"OpenCovibe 截图\">\n</p>\n\n## 为什么选择 OpenCovibe?\n\nClaude Code 等 AI 编程 CLI 功能强大,但它们运行在终端里。这意味着没有持久化的面板、没有可视化的 Diff 审查、没有跨会话历史、也无法自由切换多个 API 平台。OpenCovibe 用原生桌面 UI 包装这些 CLI,补上终端无法提供的那些能力层 —— 同时保持所有数据**本地存储**。(调用远程模型 API 需要联网;应用本身没有云端后台。)\n\n| Agent | 状态 |\n|-------|------|\n| [Claude Code](https://github.com/anthropics/claude-code) | 已适配 |\n| [Codex](https://github.com/openai/codex) | 已适配 —— 交互式 `app-server` 模式(默认),`exec` 作为回退 |\n\n**平台状态**:目前主要在 **macOS** 上开发和测试。Windows 和 Linux 可以构建运行,但尚未进行充分的兼容性调整和测试,欢迎提交问题报告和贡献。\n\n**核心原则**:封装 CLI,可视化工作,数据本地化。\n\n## 核心能力\n\n### CLI 不提供、OpenCovibe 补上的\n\n| 能力 | OpenCovibe 增加了什么 |\n|------|----------------------|\n| **可视化工具卡片** | 每个工具调用(Read、Edit、Bash、Grep、Write、WebFetch……)都渲染为内联卡片,带语法高亮 Diff、结构化输出和一键复制 |\n| **运行历史与回放** | 浏览所有历史会话,完整事件回放,从任意节点恢复 / 分叉,支持软删除和恢复 |\n| **多平台热切换** | 用 Claude Code 接入 15+ API 平台(DeepSeek、Kimi、智谱、百炼、豆包、MiniMax、OpenRouter、Ollama……),无需重启即可切换 |\n| **浏览器远程访问** | 内嵌 Web 服务器,支持局域网浏览器访问或通过 HTTP 隧道(ngrok / cloudflared)远程访问 |\n| **文件浏览器** | 浏览和编辑项目文件,支持语法高亮、Markdown 预览、图片预览和 Git Diff 查看 |\n| **Memory 编辑器** | 创建和编辑 CLAUDE.md、项目级和用户级 Memory 文件,支持实时预览 |\n| **Agent 管理** | 可视化编辑器创建、编辑、管理自定义 Agent 定义(.md 文件),支持表单模式和源码模式 |\n| **权限规则管理** | 可视化管理 CLI 权限允许/拒绝规则,支持用户级和项目级配置 |\n| **用量分析** | 按模型的 Token 分解、成本追踪、每日热力图、模型堆叠图表、会话级统计 |\n| **团队面板** | 只读查看 Claude Code 多 Agent 团队协作 —— 任务列表、队友状态、消息流 |\n| **活动监控** | 实时 Hook 事件流、工具活动时间线、文件追踪面板、嵌套工具卡片的子 Agent 追踪 |\n| **插件市场** | 可视化浏览、安装、管理 Claude Code 插件和技能 |\n| **MCP 管理** | 发现 MCP 服务器、查看逐服务器状态、一键重连 / 启停 |\n| **内联权限审查** | 丰富的权限审查 UI,批量允许/拒绝面板、CLI 建议的\"始终允许\"规则、AskUserQuestion 渲染 |\n| **CLI 会话导入** | 发现并导入已有的 Claude Code CLI 会话到 OpenCovibe |\n| **Rewind 回退** | 检查点式文件回退,支持 dry-run 预览和逐文件选择 |\n| **远程主机** | 配置 SSH 远程主机执行 CLI,支持密钥生成向导和连接测试 |\n| **预览与元素选取** | 在伴侣窗口中打开 localhost 预览,交互式选取页面元素,将结构化上下文(DOM 路径、样式、HTML 片段)插入对话 |\n| **Ralph 循环** | 自动迭代同一提示直到完成条件满足——免手动编码,支持自定义最大迭代次数 |\n| **系统诊断** | CLI、平台、SSH 和代理配置的系统健康检查 |\n\n### 更多功能\n\n- **富文本聊天 UI** — Markdown、语法高亮、思考块、图片附件、文件 Diff、工具突发折叠分组\n- **会话控制** — 创建、恢复、分叉、重命名会话;计划模式切换;模型热切换;上下文历史追踪\n- **拖拽上传** — 原生文件拖拽,支持图片、PDF、目录和路径引用\n- **项目文件夹** — 侧栏项目选择器,Memory、权限和会话按项目隔离\n- **内联斜杠命令** — `/model`、`/diff`、`/todos`、`/tasks`、`/doctor`、`/copy`、`/stats`、`/preview`、`/ralph` 等——在应用内原生渲染\n- **快捷键** — 完全可自定义的键绑定,支持组合键和冲突检测\n- **Hook 管理** — 配置上游 CLI Hook,实现事件驱动自动化\n- **国际化** — 轻量响应式运行时,支持英文和简体中文\n- **系统托盘** — 最小化到托盘;后台会话持续运行,支持原生通知\n- **深色 / 浅色主题** — 基于 CSS 变量的主题系统,支持 UI 缩放\n- **自动更新** — 应用内更新检测与下载链接\n- **安装向导** — 首次启动引导 CLI 检测、认证和平台配置\n\n## 快速开始\n\n### 方式 A:下载预编译包(macOS)\n\n从 [Releases](https://github.com/AnyiWang/OpenCovibe/releases) 下载最新 `.dmg` —— 通用二进制,同时支持 Apple Silicon 和 Intel Mac。\n\n> **注意**:应用未经代码签名。首次启动时,右键点击应用选择\"打开\"以绕过 macOS Gatekeeper。\n\n### 方式 B:自动安装(macOS)\n\n```bash\ngit clone https://github.com/AnyiWang/OpenCovibe.git\ncd OpenCovibe\n./scripts/setup.sh # 加 --yes 跳过确认提示\nnpm run tauri dev\n```\n\n安装脚本自动检测并安装缺少的依赖(Xcode CLI Tools、Homebrew、Node.js、Rust)。\n\n### 方式 C:手动安装\n\n**前置条件:**\n\n- [Node.js](https://nodejs.org/) >= 20\n- [Rust](https://rustup.rs/) >= 1.75\n\n**macOS:**\n```bash\nxcode-select --install\nbrew install node\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n**Linux (Debian/Ubuntu):**\n```bash\nsudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \\\n libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\n**Windows:**\n```powershell\n# 从 https://rustup.rs 安装 Rust\n# 从 https://nodejs.org 安装 Node.js\n```\n\n**构建与运行:**\n\n```bash\ngit clone https://github.com/AnyiWang/OpenCovibe.git\ncd OpenCovibe\nnpm install\nnpm run tauri dev\n```\n\n### 安装向导\n\n首次启动时,OpenCovibe 会引导你完成:\n\n1. **CLI 检测** — 自动检测 Claude Code 和 Codex CLI,未安装则提供安装引导\n2. **认证** — OAuth 登录或 API Key,支持 15+ 平台\n3. **就绪** — 开始编程\n\n你可以随时从**设置 > 通用 > 安装向导**重新运行。\n\n## 支持的平台\n\n### LLM 厂商\n\n| 厂商 | 端点 | 认证方式 |\n|------|------|---------|\n| Anthropic | 官方 API | API Key |\n| DeepSeek | `api.deepseek.com/anthropic` | Bearer |\n| Kimi(月之暗面) | `api.moonshot.cn/anthropic` | Bearer |\n| Kimi For Coding | `api.kimi.com/coding/` | Bearer |\n| 智谱 | `open.bigmodel.cn/api/anthropic` | Bearer |\n| 智谱(国际) | `api.z.ai/api/anthropic` | Bearer |\n| 百炼(阿里云 Coding Plan) | `coding.dashscope.aliyuncs.com/apps/anthropic` | Bearer |\n| 百炼(阿里云 API) | `dashscope.aliyuncs.com/apps/anthropic` | Bearer |\n| 豆包(字节跳动) | `ark.cn-beijing.volces.com/api/coding` | Bearer |\n| MiniMax | `api.minimax.io/anthropic` | Bearer |\n| MiniMax(中国) | `api.minimaxi.com/anthropic` | Bearer |\n| 小米 MiMo | `api.xiaomimimo.com/anthropic` | Bearer |\n| 小米 MiMo(订阅 Token Plan) | `token-plan-cn.xiaomimimo.com/anthropic` | Bearer |\n| 腾讯混元 | `api.hunyuan.cloud.tencent.com/anthropic` | Bearer |\n| SiliconFlow(硅基流动) | `api.siliconflow.com/` | Bearer |\n\n### API 代理\n\n| 平台 | 端点 | 认证方式 |\n|------|------|---------|\n| Vercel AI Gateway | `ai-gateway.vercel.sh` | Bearer |\n| OpenRouter | `openrouter.ai/api` | Bearer |\n| AiHubMix | `aihubmix.com` | Bearer |\n| ZenMux | `zenmux.ai/api/anthropic` | Bearer |\n\n### 本地\n\n| 平台 | 端点 |\n|------|------|\n| Ollama | `localhost:11434` |\n| [CC Switch](https://github.com/farion1231/cc-switch) | `localhost:15721` |\n| [Claude Code Router](https://github.com/musistudio/claude-code-router) | `localhost:3456` |\n| 自定义 | 任何 Anthropic 兼容端点 |\n\n## 架构\n\n<p align=\"center\">\n <img src=\"static/architecture-zh.svg\" width=\"700\" alt=\"架构\">\n</p>\n\n**技术栈:**\n\n| 层级 | 技术 |\n|------|------|\n| 框架 | [Tauri v2](https://v2.tauri.app/)(Rust 后端 + WebView) |\n| 前端 | [Svelte 5](https://svelte.dev/) + [SvelteKit](https://svelte.dev/docs/kit/)(adapter-static) |\n| 样式 | [Tailwind CSS](https://tailwindcss.com/) v3 + CSS 变量 |\n| 终端 | [xterm.js](https://xtermjs.org/) |\n| Markdown | [marked](https://marked.js.org/) + [highlight.js](https://highlightjs.org/) + [DOMPurify](https://github.com/cure53/DOMPurify) |\n| 国际化 | 轻量自建运行时 (en + zh-CN) |\n| 测试 | [Vitest](https://vitest.dev/) |\n\n**Agent 通信:**\n\n每个会话都是由独立的 session actor 管理的长连接多轮进程。**Claude Code** 通过双向 stream-JSON 协议(stdin/stdout)通信,带交互式控制协议。**Codex** 支持两种传输方式:`codex app-server`(双向 JSON-RPC —— **默认**,解锁交互式审批、turn 中途 steer、fork/rewind/compact/goal、图片输入和实时命令输出)或 `codex exec`(每轮一次性 NDJSON —— 回退方案,可在设置中为旧版 Codex CLI 选用)。\n\n**数据存储:**\n\n所有数据本地存储在 `~/.opencovibe/` —— 无云端,无数据库。\n\n```\n~/.opencovibe/\n├── settings.json # 用户设置\n├── runs/ # 会话历史\n│ └── {run-id}/\n│ ├── meta.json # 运行元数据\n│ ├── events.jsonl # 事件日志\n│ └── artifacts.json # 摘要\n└── keybindings.json # 自定义快捷键\n```\n\n## 开发\n\n```bash\nnpm install # 安装依赖\nnpm run tauri dev # 热重载开发模式\nnpm test # 运行测试\nnpm run lint:fix # 代码检查\nnpm run format # 代码格式化\n```\n\n## 参与贡献\n\n欢迎贡献!请通过 [Issue](https://github.com/AnyiWang/OpenCovibe/issues) 提交 Bug 报告或功能建议,也欢迎提交 Pull Request。\n\n## 许可证\n\n基于 [Apache License 2.0](LICENSE) 许可。\n\nCopyright 2025-2026 OpenCovibe Contributors.\n"}}, "src/lib/utils/platform-presets.ts": {"a8f8fddcd87b5fe9cda7a4309fb7f0e305a68697": {"t": 1785674200.2256787, "n": 14123, "h": "0d40e621c84ccd26", "c": "import type { PlatformPreset } from \"$lib/types\";\n\nexport const PLATFORM_PRESETS: PlatformPreset[] = [\n // ── LLM Providers ──\n {\n id: \"anthropic\",\n // The CLI being wrapped is \"Claude Code\" (Anthropic is the company). Label the native\n // option by the CLI name; third-party providers below keep their own names.\n name: \"Claude Code\",\n base_url: \"\",\n auth_env_var: \"ANTHROPIC_API_KEY\",\n description: \"Claude official API\",\n key_placeholder: \"your-anthropic-api-key\",\n category: \"provider\",\n },\n {\n id: \"deepseek\",\n name: \"DeepSeek\",\n base_url: \"https://api.deepseek.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"DeepSeek API\",\n key_placeholder: \"your-deepseek-key\",\n category: \"provider\",\n models: [\"deepseek-v4-pro[1m]\", \"deepseek-v4-flash\"],\n extra_env: { API_TIMEOUT_MS: \"600000\" },\n docs_url: \"https://api-docs.deepseek.com/quick_start/agent_integrations/claude_code\",\n },\n {\n id: \"kimi\",\n name: \"Kimi (Moonshot)\",\n base_url: \"https://api.moonshot.cn/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Moonshot AI\",\n key_placeholder: \"your-kimi-key\",\n category: \"provider\",\n models: [\"kimi-k2.5\"],\n docs_url: \"https://platform.moonshot.ai/docs/guide/agent-support\",\n },\n {\n id: \"kimi-coding\",\n name: \"Kimi For Coding\",\n base_url: \"https://api.kimi.com/coding/\",\n auth_env_var: \"ANTHROPIC_API_KEY\",\n description: \"Kimi Code membership\",\n key_placeholder: \"your-kimi-coding-key\",\n category: \"provider\",\n docs_url: \"https://www.kimi.com/code/docs/en/third-party-tools/other-coding-agents.html\",\n },\n {\n id: \"zhipu\",\n name: \"Zhipu (智谱)\",\n base_url: \"https://open.bigmodel.cn/api/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Zhipu AI — bigmodel.cn\",\n key_placeholder: \"your-zhipu-key\",\n category: \"provider\",\n models: [\"glm-5.1\", \"glm-5-turbo\", \"glm-4.5-air\"],\n extra_env: { API_TIMEOUT_MS: \"3000000\" },\n docs_url: \"https://docs.bigmodel.cn/cn/guide/develop/claude/introduction\",\n },\n {\n id: \"zhipu-intl\",\n name: \"Zhipu (智谱 Intl)\",\n base_url: \"https://api.z.ai/api/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Zhipu AI — z.ai\",\n key_placeholder: \"your-zhipu-key\",\n category: \"provider\",\n models: [\"glm-5.1\", \"glm-5-turbo\", \"glm-4.5-air\"],\n extra_env: { API_TIMEOUT_MS: \"3000000\" },\n docs_url: \"https://docs.z.ai/devpack/tool/claude\",\n },\n {\n id: \"bailian\",\n name: \"Bailian (Coding Plan)\",\n base_url: \"https://coding.dashscope.aliyuncs.com/apps/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Alibaba subscription plan\",\n key_placeholder: \"sk-sp-xxxxx\",\n category: \"provider\",\n models: [\"qwen3.5-plus\", \"qwen3-coder-next\"],\n docs_url: \"https://help.aliyun.com/zh/model-studio/coding-plan\",\n },\n {\n id: \"bailian-api\",\n name: \"Bailian (\\u767e\\u70bc API)\",\n base_url: \"https://dashscope.aliyuncs.com/apps/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Alibaba pay-as-you-go\",\n key_placeholder: \"sk-xxxxx\",\n category: \"provider\",\n models: [\"qwen3.5-plus\", \"qwen3-coder-next\"],\n docs_url: \"https://help.aliyun.com/zh/model-studio/anthropic-api-messages\",\n },\n {\n id: \"doubao\",\n name: \"DouBao (\\u8c46\\u5305)\",\n base_url: \"https://ark.cn-beijing.volces.com/api/coding\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"ByteDance Volcengine\",\n key_placeholder: \"your-doubao-key\",\n category: \"provider\",\n models: [\"doubao-seed-code-preview-latest\"],\n docs_url: \"https://www.volcengine.com/docs/82379/1949118\",\n },\n {\n id: \"minimax\",\n name: \"MiniMax (International)\",\n base_url: \"https://api.minimax.io/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"MiniMax AI — api.minimax.io\",\n key_placeholder: \"your-minimax-key\",\n category: \"provider\",\n models: [\"MiniMax-M3\"],\n extra_env: { API_TIMEOUT_MS: \"3000000\" },\n docs_url: \"https://platform.minimax.io/docs/token-plan/claude-code\",\n },\n {\n id: \"minimax-cn\",\n name: \"MiniMax (China)\",\n base_url: \"https://api.minimaxi.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"MiniMax AI — api.minimaxi.com\",\n key_placeholder: \"your-minimax-key\",\n category: \"provider\",\n models: [\"MiniMax-M3\"],\n extra_env: { API_TIMEOUT_MS: \"3000000\" },\n docs_url: \"https://platform.minimax.io/docs/token-plan/claude-code\",\n },\n {\n id: \"mimo\",\n name: \"Xiaomi MiMo (\\u5c0f\\u7c73)\",\n base_url: \"https://api.xiaomimimo.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Xiaomi AI \\u2014 pay-as-you-go\",\n key_placeholder: \"your-mimo-key\",\n category: \"provider\",\n models: [\"mimo-v2.5-pro\"],\n docs_url: \"https://platform.xiaomimimo.com/docs/zh-CN/integration/claudecode\",\n },\n {\n id: \"mimo-tp\",\n name: \"Xiaomi MiMo (Token Plan)\",\n base_url: \"https://token-plan-cn.xiaomimimo.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Xiaomi subscription plan\",\n key_placeholder: \"tp-xxxxx\",\n category: \"provider\",\n models: [\"mimo-v2.5-pro\"],\n docs_url: \"https://platform.xiaomimimo.com/docs/zh-CN/integration/claudecode\",\n },\n {\n id: \"hunyuan\",\n name: \"Tencent Hunyuan (\\u6df7\\u5143)\",\n base_url: \"https://api.hunyuan.cloud.tencent.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Tencent AI\",\n key_placeholder: \"sk-xxxxxxxx\",\n category: \"provider\",\n models: [\"hunyuan-2.0-thinking-20251109\", \"hunyuan-2.0-instruct-20251111\"],\n docs_url: \"https://cloud.tencent.com/document/product/1729/127293\",\n },\n {\n id: \"siliconflow\",\n name: \"SiliconFlow (\\u7845\\u57fa\\u6d41\\u52a8)\",\n base_url: \"https://api.siliconflow.com/\",\n auth_env_var: \"ANTHROPIC_API_KEY\",\n description: \"Multi-model cloud\",\n key_placeholder: \"sk-xxxxx\",\n category: \"provider\",\n docs_url: \"https://docs.siliconflow.com/en/usercases/use-siliconcloud-in-ClaudeCode\",\n },\n {\n id: \"stepfun\",\n name: \"StepFun (阶跃星辰)\",\n base_url: \"https://api.stepfun.ai/step_plan\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"StepFun Step Plan\",\n key_placeholder: \"your-stepfun-key\",\n category: \"provider\",\n models: [\"step-3.7-flash\"],\n docs_url: \"https://platform.stepfun.ai/docs/en/step-plan/integrations/claude-code\",\n },\n {\n id: \"longcat\",\n name: \"LongCat (美团)\",\n base_url: \"https://api.longcat.chat/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Meituan LongCat\",\n key_placeholder: \"your-longcat-key\",\n category: \"provider\",\n models: [\"LongCat-2.0-Preview\"],\n docs_url: \"https://longcat.chat/platform/docs/ClaudeCode.html\",\n },\n {\n id: \"iflytek\",\n name: \"iFlytek Astron (讯飞星辰)\",\n base_url: \"https://maas-coding-api.cn-huabei-1.xf-yun.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"iFlytek Coding Plan\",\n key_placeholder: \"your-iflytek-key\",\n category: \"provider\",\n models: [\"astron-code-latest\"],\n extra_env: { API_TIMEOUT_MS: \"600000\" },\n docs_url: \"https://www.xfyun.cn/doc/spark/CodingPlan.html\",\n },\n {\n id: \"tencent-coding\",\n name: \"Tencent Coding Plan (TokenHub)\",\n base_url: \"https://api.lkeap.cloud.tencent.com/coding/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Tencent TokenHub subscription\",\n key_placeholder: \"sk-sp-xxxxx\",\n category: \"provider\",\n docs_url: \"https://cloud.tencent.com/document/product/1823/130097\",\n },\n\n // ── API Proxy ──\n {\n id: \"vercel\",\n name: \"Vercel AI Gateway\",\n base_url: \"https://ai-gateway.vercel.sh\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Vercel unified gateway\",\n key_placeholder: \"your-ai-gateway-api-key\",\n category: \"proxy\",\n docs_url: \"https://vercel.com/docs/ai-gateway/anthropic-compat\",\n },\n {\n id: \"openrouter\",\n name: \"OpenRouter\",\n base_url: \"https://openrouter.ai/api\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Multi-provider gateway\",\n key_placeholder: \"your-openrouter-key\",\n category: \"proxy\",\n docs_url: \"https://openrouter.ai/docs/cookbook/coding-agents/claude-code-integration\",\n },\n {\n id: \"aihubmix\",\n name: \"AiHubMix\",\n base_url: \"https://aihubmix.com\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"AI aggregation platform\",\n key_placeholder: \"your-aihubmix-key\",\n category: \"proxy\",\n docs_url: \"https://docs.aihubmix.com/en/api/Claude-Code\",\n },\n {\n id: \"requesty\",\n name: \"Requesty\",\n base_url: \"https://router.requesty.ai\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Multi-provider router (300+ models)\",\n key_placeholder: \"your-requesty-key\",\n category: \"proxy\",\n docs_url: \"https://docs.requesty.ai/integrations/claude-code\",\n },\n {\n id: \"fireworks\",\n name: \"Fireworks AI\",\n base_url: \"https://api.fireworks.ai/inference\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Fast OSS model inference\",\n key_placeholder: \"your-fireworks-key\",\n category: \"proxy\",\n docs_url: \"https://docs.fireworks.ai/tools-sdks/anthropic-compatibility\",\n },\n {\n id: \"deepinfra\",\n name: \"DeepInfra\",\n base_url: \"https://api.deepinfra.com/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"OSS model inference\",\n key_placeholder: \"your-deepinfra-token\",\n category: \"proxy\",\n docs_url: \"https://docs.deepinfra.com/integrations/anthropic\",\n },\n {\n id: \"novita\",\n name: \"Novita AI\",\n base_url: \"https://api.novita.ai/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Multi-model OSS host\",\n key_placeholder: \"your-novita-key\",\n category: \"proxy\",\n docs_url: \"https://novita.ai/docs/guides/claude-code\",\n },\n {\n id: \"zenmux\",\n name: \"ZenMux\",\n base_url: \"https://zenmux.ai/api/anthropic\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Multi-model API gateway\",\n key_placeholder: \"sk-ss-v1-xxx\",\n category: \"proxy\",\n extra_env: { API_TIMEOUT_MS: \"30000000\" },\n docs_url: \"https://zenmux.ai/docs/best-practices/claude-code.html\",\n },\n\n // ── Local Proxy ──\n {\n id: \"ccswitch\",\n name: \"CC Switch\",\n base_url: \"http://127.0.0.1:15721\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"CC Switch local proxy\",\n key_placeholder: \"(leave empty)\",\n category: \"local\",\n docs_url: \"https://github.com/farion1231/cc-switch\",\n setup_hint: \"settings_local_setupHint_ccswitch\",\n },\n {\n id: \"ccr\",\n name: \"Claude Code Router\",\n base_url: \"http://127.0.0.1:3456\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Local proxy for third-party providers\",\n key_placeholder: \"(leave empty)\",\n models: [\"claude-sonnet-4-6\"],\n category: \"local\",\n docs_url: \"https://github.com/musistudio/claude-code-router\",\n setup_hint: \"settings_local_setupHint_ccr\",\n },\n\n // ── Local Inference ──\n {\n id: \"ollama\",\n name: \"Ollama\",\n base_url: \"http://localhost:11434\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Local LLM (no key needed)\",\n key_placeholder: \"(leave empty for local)\",\n category: \"local\",\n setup_hint: \"settings_local_setupHint_ollama\",\n },\n\n // ── Custom ──\n {\n id: \"custom\",\n name: \"Custom\",\n base_url: \"\",\n auth_env_var: \"ANTHROPIC_AUTH_TOKEN\",\n description: \"Custom API endpoint\",\n key_placeholder: \"your-api-key\",\n category: \"custom\",\n },\n];\n\nexport const PRESET_CATEGORIES = [\n { id: \"provider\", label: \"LLM Providers\" },\n { id: \"proxy\", label: \"API Proxy\" },\n { id: \"local\", label: \"Local\" },\n { id: \"custom\", label: \"Custom\" },\n] as const;\n\n/**\n * Build a merged platform list from static presets + dynamic custom credentials.\n * Excludes the single \"custom\" placeholder — custom entries use \"custom-{timestamp}\" ids.\n */\nexport function buildPlatformList(\n credentials: import(\"$lib/types\").PlatformCredential[],\n): PlatformPreset[] {\n const builtins = PLATFORM_PRESETS.filter((p) => p.id !== \"custom\");\n const customs: PlatformPreset[] = credentials\n .filter((c) => c.platform_id.startsWith(\"custom-\"))\n .map((c) => ({\n id: c.platform_id,\n name: c.name ?? \"Custom\",\n base_url: c.base_url ?? \"\",\n auth_env_var: (c.auth_env_var ?? \"ANTHROPIC_AUTH_TOKEN\") as PlatformPreset[\"auth_env_var\"],\n description: \"Custom endpoint\",\n key_placeholder: \"your-api-key\",\n category: \"custom\" as const,\n models: c.models,\n extra_env: c.extra_env,\n }));\n return [...builtins, ...customs];\n}\n\n/**\n * Expand a credential's models array into [opus, sonnet, haiku] tier tuple.\n * Mirrors backend resolve_model_tiers expansion:\n * 1 model → all same; 2 models → [0]=opus+sonnet, [1]=haiku; 3+ → positional.\n */\nexport function expandModelsToTiers(models?: string[]): [string, string, string] {\n if (!models || models.length === 0) return [\"\", \"\", \"\"];\n if (models.length === 1) return [models[0], models[0], models[0]];\n if (models.length === 2) return [models[0], models[0], models[1]];\n return [models[0], models[1], models[2]];\n}\n\n/**\n * Compress [opus, sonnet, haiku] tier inputs back to a models array for storage.\n * Returns undefined when all three are empty (→ backend falls back to preset).\n */\nexport function compressModelsFromTiers(\n opus: string,\n sonnet: string,\n haiku: string,\n): string[] | undefined {\n const o = opus.trim(),\n s = sonnet.trim(),\n h = haiku.trim();\n if (!o && !s && !h) return undefined;\n return [o, s, h];\n}\n\n/** Check if a platform_id represents a user-created custom endpoint. */\nexport function isCustomPlatform(platformId: string): boolean {\n return platformId.startsWith(\"custom-\");\n}\n\n/** Find a credential by platform_id. */\nexport function findCredential(\n credentials: import(\"$lib/types\").PlatformCredential[],\n platformId: string,\n): import(\"$lib/types\").PlatformCredential | undefined {\n return credentials.find((c) => c.platform_id === platformId);\n}\n"}}, "src/lib/utils/codex-provider-presets.ts": {"a8f8fddcd87b5fe9cda7a4309fb7f0e305a68697": {"t": 1785674607.0635102, "n": 3817, "h": "f8e9ca6e423ce8e7", "c": "// Codex third-party provider presets (OpenAI Responses API).\n//\n// Codex (≥0.99) ONLY speaks `wire_api = \"responses\"` — `chat` was removed. So only providers\n// that natively implement the OpenAI Responses API (`/v1/responses`) work directly. The Chinese\n// first-party providers in the Claude grid are Chat-Completions-only and need a translation proxy,\n// so they are intentionally NOT listed here. Verified-working set: Responses-capable gateways +\n// Ollama (local) + Custom. See memory codex-integration-audit-2026-06 / the provider research.\n//\n// Default `model` strings verified against each gateway's own Codex docs (2026-06): Vercel and\n// Requesty document gpt-5.5; AiHubMix documents gpt-5.2 (5.5 not yet listed there); ZenMux uses\n// gpt-5.2-codex. Pin to what each gateway actually publishes, not the absolute newest OpenAI model\n// — a model the gateway hasn't onboarded yet would fail out of the box.\n//\n// At spawn we inject these as `codex exec -c model_providers.<id>.{base_url,env_key,wire_api,\n// requires_openai_auth=false}` plus the API key via the env var named by `env_key`.\n\nexport interface CodexProviderPreset {\n id: string;\n name: string;\n description: string;\n /** OpenAI-compatible base URL implementing the Responses API. */\n base_url: string;\n /** Env var name the API key is injected under (we set it at spawn). */\n env_key: string;\n /** Suggested model id (provider-side, OpenAI format). Empty → user fills / Codex default. */\n model: string;\n key_placeholder: string;\n /** Keyless (local) providers like Ollama need no API key. */\n keyless?: boolean;\n /** Custom = user supplies base_url/env_key/model. */\n custom?: boolean;\n docs_url?: string;\n}\n\nexport const CODEX_PROVIDER_PRESETS: CodexProviderPreset[] = [\n {\n id: \"vercel\",\n name: \"Vercel AI Gateway\",\n description: \"Responses API gateway\",\n base_url: \"https://ai-gateway.vercel.sh/v1\",\n env_key: \"AI_GATEWAY_API_KEY\",\n model: \"openai/gpt-5.5\",\n key_placeholder: \"vck_…\",\n docs_url: \"https://vercel.com/docs/ai-gateway/codex\",\n },\n {\n id: \"aihubmix\",\n name: \"AiHubMix\",\n description: \"AI aggregation (Responses)\",\n base_url: \"https://aihubmix.com/v1\",\n env_key: \"AIHUBMIX_API_KEY\",\n model: \"gpt-5.2\",\n key_placeholder: \"sk-…\",\n docs_url: \"https://docs.aihubmix.com/en/api/Codex-CLI\",\n },\n {\n id: \"requesty\",\n name: \"Requesty\",\n description: \"Multi-provider router (Responses)\",\n base_url: \"https://router.requesty.ai/v1\",\n env_key: \"REQUESTY_API_KEY\",\n // Requesty requires the openai-responses/ model prefix for Codex.\n model: \"openai-responses/gpt-5.5\",\n key_placeholder: \"sk-…\",\n docs_url: \"https://docs.requesty.ai/integrations/openai-codex\",\n },\n {\n id: \"fireworks\",\n name: \"Fireworks AI\",\n description: \"Responses API (beta)\",\n base_url: \"https://api.fireworks.ai/inference/v1\",\n env_key: \"FIREWORKS_API_KEY\",\n model: \"\",\n key_placeholder: \"fw_…\",\n docs_url: \"https://docs.fireworks.ai/tools-sdks/openai-compatibility\",\n },\n {\n id: \"zenmux\",\n name: \"ZenMux\",\n description: \"Multi-model gateway (Responses)\",\n base_url: \"https://zenmux.ai/api/v1\",\n env_key: \"ZENMUX_API_KEY\",\n model: \"openai/gpt-5.2-codex\",\n key_placeholder: \"sk-…\",\n docs_url: \"https://docs.zenmux.ai/guide/quickstart.html\",\n },\n {\n id: \"ollama\",\n name: \"Ollama\",\n description: \"Local models (no key)\",\n base_url: \"http://localhost:11434/v1\",\n env_key: \"\",\n model: \"\",\n key_placeholder: \"\",\n keyless: true,\n docs_url: \"https://docs.ollama.com/integrations/codex\",\n },\n {\n id: \"custom\",\n name: \"Custom\",\n description: \"Custom Responses endpoint\",\n base_url: \"\",\n env_key: \"OPENAI_API_KEY\",\n model: \"\",\n key_placeholder: \"sk-…\",\n custom: true,\n },\n];\n"}}}}