# opencode - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 opencode 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`.opencode/skills/effect/SKILL.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md` Claim：`clm_0004` supported 0.86

## 它能做什么

- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`.opencode/skills/effect/SKILL.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md`, `packages/docs/README.md` Claim：`clm_0002` supported 0.86

## 怎么开始

- `curl -fsSL https://opencode.ai/install | bash` 证据：`README.md` Claim：`clm_0005` supported 0.86
- `npm i -g opencode-ai@latest        # or bun/pnpm/yarn` 证据：`README.md` Claim：`clm_0006` supported 0.86
- `npm i -g mint` 证据：`packages/docs/README.md` Claim：`clm_0007` supported 0.86

## 继续前判断卡

- **当前建议**：需要管理员/安全审批
- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。

### 30 秒判断

- **现在怎么做**：需要管理员/安全审批
- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装
- **先别相信**：工具权限边界不能在安装前相信。
- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件

### 现在可以相信

- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0003` supported 0.86
- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`.opencode/skills/effect/SKILL.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md` Claim：`clm_0004` supported 0.86
- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.opencode/skills/effect/SKILL.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md` Claim：`clm_0001` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md`, `packages/docs/README.md` Claim：`clm_0002` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0005` supported 0.86

### 现在还不能相信

- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。
- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.opencode/skills/effect/SKILL.md`, `AGENTS.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md`
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`, `packages/docs/README.md`
- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.opencode/skills/effect/SKILL.md`, `AGENTS.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`, `packages/docs/README.md`
- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`packages/llm/README.md`, `packages/opencode/test/tool/fixtures/models-api.json`, `sst-env.d.ts`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）
- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0008` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md`, `packages/docs/README.md` Claim：`clm_0009` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`.opencode/skills/effect/SKILL.md`, `packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`, `packages/opencode/test/fixture/skills/cloudflare/SKILL.md` Claim：`clm_0001` supported 0.86
- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md`, `packages/docs/README.md` Claim：`clm_0002` supported 0.86

### 上下文规模

- 文件总数：4944
- 重要文件覆盖：40/4944
- 证据索引条目：77
- 角色 / Skill 条目：3

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 opencode 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 opencode 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 opencode 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 3 个角色 / Skill / 项目文档条目。

- **effect**（skill）：Work with Effect v4 / effect-smol TypeScript code in this repo 激活提示：当用户任务与“effect”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`.opencode/skills/effect/SKILL.md`
- **agents-sdk**（skill）：Build AI agents on Cloudflare Workers using the Agents SDK. Load when creating stateful agents, durable workflows, real-time WebSocket apps, scheduled tasks, MCP servers, or chat applications. Covers Agent class, state management, callable RPC, Workflows integration, and React hooks. 激活提示：当用户任务与“agents-sdk”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`packages/opencode/test/fixture/skills/agents-sdk/SKILL.md`
- **cloudflare**（skill）：Comprehensive Cloudflare platform skill covering Workers, Pages, storage KV, D1, R2 , AI Workers AI, Vectorize, Agents SDK , networking Tunnel, Spectrum , security WAF, DDoS , and infrastructure-as-code Terraform, Pulumi . Use for any Cloudflare development task. 激活提示：当用户任务与“cloudflare”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`packages/opencode/test/fixture/skills/cloudflare/SKILL.md`

## 证据索引

- 共索引 77 条证据。

- **Mintlify Starter Kit**（documentation）：Use the starter kit to get your docs deployed and ready to customize. 证据：`packages/docs/README.md`
- **Installation**（documentation）：English 简体中文 繁體中文 한국어 Deutsch Español Français Italiano Dansk 日本語 Polski Русский Bosanski العربية Norsk Português Brasil ไทย Türkçe Українська বাংলা Ελληνικά Tiếng Việt 证据：`README.md`
- **opencode GitHub Action**（documentation）：A GitHub Action that integrates opencode https://opencode.ai directly into your GitHub workflow. 证据：`github/README.md`
- **Locale Glossaries**（documentation）：Use this folder for locale-specific translation guidance that supplements .opencode/agent/translator.md . 证据：`.opencode/glossary/README.md`
- **Usage**（documentation）：Dependencies for these templates are managed with pnpm https://pnpm.io using pnpm up -Lri . 证据：`packages/app/README.md`
- **SolidStart**（documentation）：Everything you need to build a Solid project, powered by solid-start https://start.solidjs.com ; 证据：`packages/console/app/README.md`
- **CI containers**（documentation）：Prebuilt images intended to speed up GitHub Actions jobs by baking in large, slow-to-install dependencies. These are designed for Linux jobs that can use job.container in workflows. 证据：`packages/containers/README.md`
- **Readme**（documentation）：This is a temporary package used primarily for GitHub Copilot compatibility. 证据：`packages/core/src/github-copilot/README.md`
- **OpenCode Desktop**（documentation）：The OpenCode Desktop app, built with Electron. 证据：`packages/desktop/README.md`
- **Tauri Icons**（documentation）：Here's the process I've been using to create icons: 证据：`packages/desktop/icons/README.md`
- **SolidStart**（documentation）：Everything you need to build a Solid project, powered by solid-start https://start.solidjs.com ; 证据：`packages/enterprise/README.md`
- **@opencode-ai/http-recorder**（documentation）：Record and replay HTTP and WebSocket traffic for Effect's HttpClient . Tests exercise real request shapes against deterministic, version-controlled cassettes — no manual mocks, no flakes from upstream drift. 证据：`packages/http-recorder/README.md`
- **@opencode-ai/llm**（documentation）：Schema-first LLM core for opencode. One typed request, response, event, and tool language; provider quirks live in adapters, not in calling code. 证据：`packages/llm/README.md`
- **js**（documentation）：This project was created using bun init in bun v1.2.12. Bun https://bun.sh is a fast all-in-one JavaScript runtime. 证据：`packages/opencode/README.md`
- **Readme**（documentation）：This is a plugin to simulate a remote environment locally. Add this to .opencode/opencode.jsonc : 证据：`packages/opencode/src/control-plane/dev/README.md`
- **OpenAI Responses WebSocket**（documentation）：Enabled by default on local , dev , and beta . On latest and prod , set OPENCODE EXPERIMENTAL WEBSOCKETS=true . 证据：`packages/opencode/src/plugin/openai/README.md`
- **Goal**（documentation）：tl;dr All of these APIs work, are properly type-checked, and are sync events are backwards compatible with Bus : 证据：`packages/opencode/src/sync/README.md`
- **@opencode-ai/slack**（documentation）：Slack bot integration for opencode that creates threaded conversations. 证据：`packages/slack/README.md`
- **OpenCode Stats**（documentation）：Stats is a separate site from the console. Runtime, database, and domain services live in core ; the SolidStart website lives in app ; deployable Lambda entrypoints live in function . 证据：`packages/stats/README.md`
- **Starlight Starter Kit: Basics**（documentation）：! Built with Starlight https://astro.badg.es/v2/built-with-starlight/tiny.svg https://starlight.astro.build 证据：`packages/web/README.md`
- **opencode VS Code Extension**（documentation）：A Visual Studio Code extension that integrates opencode https://opencode.ai directly into your development workflow. 证据：`sdks/vscode/README.md`
- **Package**（package_manifest）：{ "name": "github", "module": "index.ts", "type": "module", "private": true, "license": "MIT", "devDependencies": { "@types/bun": "catalog:" }, "peerDependencies": { "typescript": "^5" }, "dependencies": { "@actions/core": "1.11.1", "@actions/github": "6.0.1", "@octokit/graphql": "9.0.1", "@octokit/rest": "catalog:", "@opencode-ai/sdk": "workspace: " } } 证据：`github/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "opencode", "description": "AI-powered development tool", "private": true, "type": "module", "packageManager": "bun@1.3.14", "scripts": { "dev": "bun run --cwd packages/opencode --conditions=browser src/index.ts", "dev:desktop": "bun --cwd packages/desktop dev", "dev:web": "bun --cwd packages/app dev", "dev:console": "ulimit -n 10240 2 /dev/null; bun run --cwd packages/console/app dev", "dev:stats": "bun sst shell --stage=production -- bun run --cwd packages/stats/app dev", "dev:storybook": "bun --cwd packages/storybook storybook", "lint": "oxlint", "typecheck": "bun turbo typecheck", "upgrade-opentui": "bun run script/upgrad… 证据：`package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/app", "version": "1.15.13", "description": "", "type": "module", "exports": { ".": "./src/index.ts", "./desktop-menu": "./src/desktop-menu.ts", "./vite": "./vite.js", "./index.css": "./src/index.css" }, "scripts": { "typecheck": "tsgo -b", "start": "vite", "dev": "vite", "build": "vite build", "serve": "vite preview", "test": "bun run test:unit", "test:ci": "mkdir -p .artifacts/unit && bun test --preload ./happydom.ts ./src --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", "test:unit": "bun test --preload ./happydom.ts ./src", "test:unit:watch": "bun test --watch --preload ./happydom.ts ./src", "test:e2e": "playwright test", "test:e2e:local": "playwrigh… 证据：`packages/app/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/cli", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "bin": { "opencode": "./src/index.ts" }, "scripts": { "build": "bun run script/build.ts", "dev": "bun run src/index.ts", "typecheck": "tsgo --noEmit" }, "dependencies": { "@effect/platform-node": "catalog:", "@opencode-ai/core": "workspace: ", "effect": "catalog:" }, "devDependencies": { "@tsconfig/bun": "catalog:", "@types/bun": "catalog:", "@typescript/native-preview": "catalog:" } } 证据：`packages/cli/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/console-app", "version": "1.15.13", "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", "dev:remote": "VITE AUTH URL=https://auth.dev.opencode.ai VITE STRIPE PUBLISHABLE KEY=pk test 51RtuLNE7fOCwHSD4mewwzFejyytjdGoSDK7CAvhbffwaZnPbNb2rwJICw6LTOXCmWO320fSNXvb5NzI08RZVkAxd00syfqrW7t bun sst shell --stage=dev bun dev", "build": "bun ./script/generate-sitemap.ts && vite build && bun ../../opencode/script/schema.ts ./.output/public/config.json ./.output/public/tui.json", "start": "vite start" }, "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@ibm/plex": "6.4.1", "@jsx-email/render": "1.1.1", "@kobalte/c… 证据：`packages/console/app/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-core", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@jsx-email/render": "1.1.1", "@opencode-ai/console-mail": "workspace: ", "@opencode-ai/console-resource": "workspace: ", "@planetscale/database": "1.19.0", "aws4fetch": "1.0.20", "drizzle-orm": "catalog:", "postgres": "3.4.7", "stripe": "18.0.0", "ulid": "catalog:", "zod": "catalog:" }, "exports": { "./ .js": "./src/ .ts", "./ ": "./src/ " }, "scripts": { "db": "sst shell drizzle-kit", "db-dev": "sst shell --stage dev -- drizzle-kit", "db-prod": "sst shell --stage product… 证据：`packages/console/core/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/console-function", "version": "1.15.13", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit" }, "devDependencies": { "@cloudflare/workers-types": "catalog:", "@tsconfig/node22": "22.0.2", "@types/node": "catalog:", "openai": "5.11.0", "typescript": "catalog:", "@typescript/native-preview": "catalog:" }, "dependencies": { "@ai-sdk/anthropic": "3.0.64", "@ai-sdk/openai": "3.0.48", "@ai-sdk/openai-compatible": "2.0.37", "@opencode-ai/console-core": "workspace: ", "@opencode-ai/console-resource": "workspace: ", "@openauthjs/openauth": "0.0.0-20250322224806", "ai": "catalog:… 证据：`packages/console/function/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/console-mail", "version": "1.15.13", "dependencies": { "@jsx-email/all": "2.2.3", "@jsx-email/cli": "1.4.3", "@tsconfig/bun": "1.0.9", "@types/react": "18.0.25", "react": "18.2.0", "solid-js": "catalog:" }, "exports": { "./ ": "./emails/templates/ " }, "$schema": "https://json.schemastore.org/package.json", "private": true, "scripts": { "dev": "email preview emails/templates" }, "type": "module", "license": "MIT" } 证据：`packages/console/mail/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/console-resource", "license": "MIT", "dependencies": { "@cloudflare/workers-types": "catalog:" }, "exports": { ".": { "production": { "import": "./resource.cloudflare.ts" }, "import": "./resource.node.ts" } }, "devDependencies": { "@cloudflare/workers-types": "catalog:", "@tsconfig/node22": "22.0.2", "@types/node": "catalog:", "cloudflare": "5.2.0" } } 证据：`packages/console/resource/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/console-support", "version": "1.15.13", "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "dev": "sst shell --stage production -- vite dev" }, "dependencies": { "@cloudflare/vite-plugin": "1.15.2", "@opencode-ai/console-core": "workspace: ", "@solidjs/meta": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", "nitro": "3.0.1-alpha.1", "solid-js": "catalog:", "vite": "catalog:" }, "devDependencies": { "@types/bun": "catalog:", "@typescript/native-preview": "catalog:", "typescript": "catalog:", "wrangler": "4.50.0" }, "engines": { "node": " =22" } } 证据：`packages/console/support/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.13", "name": "@opencode-ai/core", "type": "module", "license": "MIT", "private": true, "scripts": { "db": "bun drizzle-kit", "migration": "bun run script/migration.ts", "fix-node-pty": "bun run script/fix-node-pty.ts", "test": "bun test", "test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", "typecheck": "tsgo --noEmit" }, "bin": { "opencode": "./bin/opencode" }, "exports": { "./ ": "./src/ .ts" }, "imports": { " sqlite": { "bun": "./src/database/sqlite.bun.ts", "node": "./src/database/sqlite.node.ts", "default": "./src/database/sqlite.bun.ts"… 证据：`packages/core/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/desktop", "private": true, "version": "1.15.13", "type": "module", "license": "MIT", "homepage": "https://opencode.ai", "author": { "name": "OpenCode", "email": "hello@opencode.ai" }, "scripts": { "typecheck": "tsgo -b", "predev": "bun ./scripts/predev.ts", "dev": "electron-vite dev", "prebuild": "bun ./scripts/prebuild.ts", "build": "electron-vite build", "preview": "electron-vite preview", "package": "electron-builder --config electron-builder.config.ts", "package:mac": "electron-builder --mac --config electron-builder.config.ts", "package:win": "electron-builder --win --config electron-builder.config.ts", "package:linux": "electron-builder --linux --config electro… 证据：`packages/desktop/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.13", "name": "@opencode-ai/effect-drizzle-sqlite", "type": "module", "license": "MIT", "private": true, "scripts": { "test": "bun test --timeout 30000", "test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", "typecheck": "tsgo --noEmit" }, "exports": { ".": "./src/index.ts", "./effect-sqlite": "./src/effect-sqlite/index.ts", "./effect-sqlite/migrator": "./src/effect-sqlite/migrator.ts", "./sqlite-core/effect": "./src/sqlite-core/effect/index.ts" }, "devDependencies": { "@effect/sql-sqlite-bun": "catalog:", "@tsconfig/bun": "catalog:", "@types/b… 证据：`packages/effect-drizzle-sqlite/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.10", "name": "@opencode-ai/effect-sqlite-node", "type": "module", "license": "MIT", "private": true, "scripts": { "typecheck": "tsgo --noEmit" }, "exports": { ".": "./src/index.ts" }, "devDependencies": { "@tsconfig/bun": "catalog:", "@types/node": "catalog:", "@typescript/native-preview": "catalog:" }, "dependencies": { "effect": "catalog:" } } 证据：`packages/effect-sqlite-node/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/enterprise", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "dev": "vite dev", "build": "vite build", "build:cloudflare": "OPENCODE DEPLOYMENT TARGET=cloudflare vite build", "start": "vite start", "shell-prod": "sst shell --target Teams --stage production" }, "dependencies": { "@opencode-ai/core": "workspace: ", "@opencode-ai/ui": "workspace: ", "aws4fetch": "^1.0.20", "@pierre/diffs": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", "@solidjs/meta": "catalog:", "hono": "catalog:", "hono-openapi": "catalog:", "js-base64": "3.7.7", "luxon": "catalog:", "nitro": "3.0.1-alpha.… 证据：`packages/enterprise/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/function", "version": "1.15.13", "$schema": "https://json.schemastore.org/package.json", "private": true, "type": "module", "license": "MIT", "devDependencies": { "@cloudflare/workers-types": "catalog:", "@tsconfig/node22": "22.0.2", "@types/node": "catalog:", "typescript": "catalog:" }, "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "catalog:", "hono": "catalog:", "jose": "6.0.11" } } 证据：`packages/function/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.13", "name": "@opencode-ai/http-recorder", "type": "module", "license": "MIT", "private": true, "scripts": { "test": "bun test --timeout 30000", "test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", "typecheck": "tsgo --noEmit" }, "exports": { ".": "./src/index.ts", "./ ": "./src/ .ts" }, "devDependencies": { "@tsconfig/bun": "catalog:", "@types/bun": "catalog:", "@typescript/native-preview": "catalog:" }, "dependencies": { "@effect/platform-node": "catalog:", "effect": "catalog:" } } 证据：`packages/http-recorder/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.13", "name": "@opencode-ai/llm", "type": "module", "license": "MIT", "private": true, "scripts": { "setup:recording-env": "bun run script/setup-recording-env.ts", "test": "bun test --timeout 30000", "typecheck": "tsgo --noEmit" }, "exports": { ".": "./src/index.ts", "./route": "./src/route/index.ts", "./provider": "./src/provider.ts", "./providers": "./src/providers/index.ts", "./providers/amazon-bedrock": "./src/providers/amazon-bedrock.ts", "./providers/anthropic": "./src/providers/anthropic.ts", "./providers/azure": "./src/providers/azure.ts", "./providers/cloudflare": "./src/providers/cloudflare.ts", "./providers… 证据：`packages/llm/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "version": "1.15.13", "name": "opencode", "type": "module", "license": "MIT", "private": true, "scripts": { "typecheck": "tsgo --noEmit", "test": "bun test --timeout 30000", "test:ci": "mkdir -p .artifacts/unit && bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", "test:httpapi": "bun run script/httpapi-exercise.ts --mode coverage --fail-on-missing --fail-on-skip && bun run script/httpapi-exercise.ts --mode auth --fail-on-missing --fail-on-skip && bun run script/httpapi-exercise.ts --mode effect --fail-on-missing --fail-on-skip", "bench:test": "bun run script/bench-test-suite.ts", "profile:test":… 证据：`packages/opencode/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/plugin", "version": "1.15.13", "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "build": "tsc" }, "exports": { ".": "./src/index.ts", "./tool": "./src/tool.ts", "./tui": "./src/tui.ts" }, "files": "dist" , "dependencies": { "@opencode-ai/sdk": "workspace: ", "effect": "catalog:", "zod": "catalog:" }, "peerDependencies": { "@opentui/core": " =0.3.1", "@opentui/keymap": " =0.3.1", "@opentui/solid": " =0.3.1" }, "peerDependenciesMeta": { "@opentui/core": { "optional": true }, "@opentui/keymap": { "optional": true }, "@opentui/solid": { "optional": true } }, "devDependencies": { "@opent… 证据：`packages/plugin/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package", "name": "@opencode-ai/script", "license": "MIT", "dependencies": { "semver": "^7.6.3" }, "devDependencies": { "@types/bun": "catalog:", "@types/semver": "^7.5.8" }, "exports": { ".": "./src/index.ts" } } 证据：`packages/script/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/sdk", "version": "1.15.13", "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "build": "bun ./script/build.ts" }, "exports": { ".": "./src/index.ts", "./client": "./src/client.ts", "./server": "./src/server.ts", "./v2": "./src/v2/index.ts", "./v2/client": "./src/v2/client.ts", "./v2/gen/client": "./src/v2/gen/client/index.ts", "./v2/server": "./src/v2/server.ts" }, "files": "dist" , "devDependencies": { "@hey-api/openapi-ts": "0.90.10", "@tsconfig/node22": "catalog:", "@types/cross-spawn": "catalog:", "@types/node": "catalog:", "@typescript/native-preview": "catalog:", "typescript":… 证据：`packages/sdk/js/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/slack", "version": "1.15.13", "type": "module", "license": "MIT", "scripts": { "dev": "bun run src/index.ts", "typecheck": "tsgo --noEmit" }, "dependencies": { "@opencode-ai/sdk": "workspace: ", "@slack/bolt": "^3.17.1" }, "devDependencies": { "@types/node": "catalog:", "typescript": "catalog:", "@typescript/native-preview": "catalog:" } } 证据：`packages/slack/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/stats-app", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "scripts": { "typecheck": "tsgo --noEmit", "dev": "vite dev --host 0.0.0.0", "build": "vite build", "start": "vite start" }, "dependencies": { "@ibm/plex": "6.4.1", "@opencode-ai/stats-core": "workspace: ", "@opencode-ai/ui": "workspace: ", "@solidjs/meta": "catalog:", "@solidjs/router": "catalog:", "@solidjs/start": "catalog:", "d3-geo": "3.1.1", "d3-scale": "4.0.2", "effect": "catalog:", "i18n-iso-countries": "7.14.0", "nitro": "3.0.1-alpha.1", "solid-js": "catalog:", "sst": "catalog:", "topojson-client": "3.1.0", "vite": "c… 证据：`packages/stats/app/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/stats-core", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "exports": { ".": "./src/index.ts", "./athena": "./src/athena.ts", "./config": "./src/config.ts", "./database": "./src/database.ts", "./database/ ": "./src/database/ .ts", "./domain/ ": "./src/domain/ .ts", "./runtime": "./src/runtime.ts", "./stat-sync": "./src/stat-sync.ts" }, "scripts": { "db:generate": "drizzle-kit generate --config=drizzle.config.ts", "db:migrate": "bun src/migrate.ts", "db:push": "drizzle-kit push --config=drizzle.config.ts", "db:studio": "drizzle-kit studio --config=drizzle.config.ts", "honeycomb:backfi… 证据：`packages/stats/core/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/stats-server", "version": "1.15.13", "private": true, "type": "module", "license": "MIT", "main": "./src/server.ts", "exports": { ".": "./src/server.ts" }, "scripts": { "start": "bun src/server.ts", "typecheck": "tsgo --noEmit" }, "dependencies": { "@aws-sdk/client-firehose": "3.933.0", "@effect/platform-node": "catalog:", "@opencode-ai/stats-core": "workspace: ", "effect": "catalog:", "sst": "catalog:" }, "devDependencies": { "@tsconfig/node22": "catalog:", "@types/bun": "catalog:", "@types/node": "catalog:", "@typescript/native-preview": "catalog:", "typescript": "catalog:" }, "engines": { "node": " =22" } } 证据：`packages/stats/server/package.json`
- **Package**（package_manifest）：{ "$schema": "https://json.schemastore.org/package.json", "name": "@opencode-ai/storybook", "private": true, "type": "module", "scripts": { "storybook": "storybook dev -p 6006", "build": "storybook build" }, "devDependencies": { "@tailwindcss/vite": "catalog:", "@opencode-ai/ui": "workspace: ", "@solidjs/meta": "catalog:", "@storybook/addon-a11y": "^10.2.13", "@storybook/addon-docs": "^10.2.13", "@storybook/addon-links": "^10.2.13", "@storybook/addon-onboarding": "^10.2.13", "@storybook/addon-vitest": "^10.2.13", "@tsconfig/node22": "catalog:", "@types/node": "catalog:", "@types/react": "18.0.25", "react": "18.2.0", "solid-js": "catalog:", "storybook": "^10.2.13", "storybook-solidjs-vite":… 证据：`packages/storybook/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/ui", "version": "1.15.13", "type": "module", "license": "MIT", "exports": { "./package.json": "./package.json", "./ ": "./src/components/ .tsx", "./session-diff": "./src/components/session-diff.ts", "./i18n/ ": "./src/i18n/ .ts", "./pierre": "./src/pierre/index.ts", "./pierre/ ": "./src/pierre/ .ts", "./hooks": "./src/hooks/index.ts", "./context": "./src/context/index.ts", "./context/ ": "./src/context/ .tsx", "./styles": "./src/styles/index.css", "./styles/tailwind": "./src/styles/tailwind/index.css", "./theme": "./src/theme/index.ts", "./theme/ ": "./src/theme/ .ts", "./theme/context": "./src/theme/context.tsx", "./icons/provider": "./src/components/provider-icons/… 证据：`packages/ui/package.json`
- **Package**（package_manifest）：{ "name": "@opencode-ai/web", "type": "module", "license": "MIT", "version": "1.15.13", "scripts": { "dev": "astro dev", "dev:remote": "VITE API URL=https://api.opencode.ai astro dev", "start": "astro dev", "build": "astro build", "preview": "astro preview", "astro": "astro" }, "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", "@astrojs/solid-js": "5.1.0", "@astrojs/starlight": "0.34.3", "@fontsource/ibm-plex-mono": "5.2.5", "@shikijs/transformers": "3.20.0", "@solid-primitives/resize-observer": "2.1.5", "@types/luxon": "catalog:", "ai": "catalog:", "astro": "5.7.13", "diff": "catalog:", "js-base64": "3.7.7", "lang-map": "0.4.0", "luxon": "catalog:", "m… 证据：`packages/web/package.json`
- **Package**（package_manifest）：{ "name": "opencode", "displayName": "opencode", "description": "opencode for VS Code", "version": "1.15.13", "publisher": "sst-dev", "repository": { "type": "git", "url": "https://github.com/anomalyco/opencode" }, "license": "MIT", "icon": "images/icon.png", "galleryBanner": { "color": " 000000", "theme": "dark" }, "engines": { "vscode": "^1.94.0" }, "categories": "Other" , "activationEvents": , "main": "./dist/extension.js", "contributes": { "commands": { "command": "opencode.openTerminal", "title": "Open opencode", "icon": { "light": "images/button-dark.svg", "dark": "images/button-light.svg" } }, { "command": "opencode.openNewTerminal", "title": "Open opencode in new tab", "icon": { "li… 证据：`sdks/vscode/package.json`
- **Commits and PR Titles**（documentation）：- To regenerate the JavaScript SDK, run ./packages/sdk/js/script/build.ts . - The default branch in this repo is dev . - Local main ref may not exist; use dev or origin/dev for diffs. 证据：`AGENTS.md`
- **Debugging**（documentation）：- NEVER try to restart the app, or the server process, EVER. 证据：`packages/app/AGENTS.md`
- **Desktop package notes**（documentation）：- Renderer process should only call window.api from src/preload . - Main process should register IPC handlers in src/main/ipc.ts . 证据：`packages/desktop/AGENTS.md`
- **Effect Drizzle SQLite**（documentation）：This package vendors a Drizzle Effect SQLite adapter for this repo. 证据：`packages/effect-drizzle-sqlite/AGENTS.md`
- **LLM Package Guide**（documentation）：- Prefer HttpClient.HttpClient / HttpClientResponse.HttpClientResponse over web fetch / Response at package boundaries. - Use Stream.Stream for streaming data flow. Avoid ad hoc async generators or manual web reader loops unless an Effect Stream API cannot model the behavior. - Use Effect Schema codecs for JSON encode/decode Schema.fromJsonString ... instead of direct JSON.parse / JSON.stringify in implementation code. - In Effect.gen , yield yieldable errors directly return yield new MyError ... instead of Effect.fail new MyError ... . - Use Effect.void instead of Effect.succeed undefined when the successful value is intentionally void. 证据：`packages/llm/AGENTS.md`
- **opencode database guide**（documentation）：- Schema : Drizzle schema lives in packages/core/src/ / .sql.ts . - Migrations : database migrations live in packages/core and are applied by core. 证据：`packages/opencode/AGENTS.md`
- **HttpApi Route Patterns**（documentation）：Use HttpApiBuilder.group ... for normal HTTP endpoints, including streaming HTTP responses such as server-sent events. Handlers should yield stable services once while building the handler layer, then close over those services in endpoint implementations. 证据：`packages/opencode/src/server/routes/instance/httpapi/AGENTS.md`
- **Session LLM Runtime Boundaries**（documentation）：../llm.ts is the opencode session LLM service. It owns opencode concerns: auth, config, model/provider resolution, plugins, permissions, telemetry headers, and runtime selection. It is the only file in this area that should know about the full session request shape. 证据：`packages/opencode/src/session/llm/AGENTS.md`
- **Agents**（documentation）：To start the stats site locally, run bun dev:stats from the repo root. 证据：`packages/stats/AGENTS.md`
- 其余 17 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`packages/docs/README.md`, `README.md`, `github/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`packages/docs/README.md`, `README.md`, `github/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **系统架构与核心服务**：importance `high`
  - source_paths: package.json, packages/opencode/src/index.ts, packages/opencode/src/server/server.ts, packages/opencode/src/server/routes/instance/httpapi/server.ts, packages/opencode/src/cli/cmd/serve.ts
- **LLM 集成、代理与认证**：importance `high`
  - source_paths: packages/llm/src/llm.ts, packages/llm/src/protocols/index.ts, packages/llm/src/providers/anthropic.ts, packages/llm/src/providers/openai.ts, packages/llm/src/providers/amazon-bedrock.ts
- **前端、桌面与 UI 组件**：importance `medium`
  - source_paths: packages/desktop/src/main/index.ts, packages/desktop/src/renderer/index.tsx, packages/desktop/electron.vite.config.ts, packages/app/src/entry.tsx, packages/app/src/app.tsx
- **扩展、配置、部署与运维**：importance `high`
  - source_paths: packages/core/src/plugin/index.ts, packages/core/src/plugin/provider.ts, packages/opencode/src/plugin/index.ts, packages/opencode/src/plugin/loader.ts, packages/opencode/src/mcp/index.ts

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `7f8412ec3e8b964ae3794e5c38e67dbe100c4cc7`
- inspected_files: `README.md`, `package.json`, `packages/effect-drizzle-sqlite/sst-env.d.ts`, `packages/effect-drizzle-sqlite/package.json`, `packages/effect-drizzle-sqlite/tsconfig.json`, `packages/effect-drizzle-sqlite/AGENTS.md`, `packages/ui/sst-env.d.ts`, `packages/ui/package.json`, `packages/ui/tsconfig.json`, `packages/ui/vite.config.ts`, `packages/storybook/sst-env.d.ts`, `packages/storybook/package.json`, `packages/storybook/tsconfig.json`, `packages/llm/sst-env.d.ts`, `packages/llm/README.md`, `packages/llm/package.json`, `packages/llm/tsconfig.json`, `packages/llm/AGENTS.md`, `packages/core/sst-env.d.ts`, `packages/core/package.json`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：Crash at start

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Crash at start
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/28996 | 来源讨论提到 linux 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：High CPU usage in newer versions of OpenCode

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：High CPU usage in newer versions of OpenCode
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/30086 | 来源讨论提到 npm 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 来源证据：Desktop: sidecar dies silently on Windows, renderer loses connection (event stream error)

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：Desktop: sidecar dies silently on Windows, renderer loses connection (event stream error)
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/30597 | 来源讨论提到 node 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 来源证据：[BUG] Session title generation fails silently since v1.3.3 — effort parameter leaks into small model call

- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：[BUG] Session title generation fails silently since v1.3.3 — effort parameter leaks into small model call
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/20269 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 来源证据：failed to send command

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：failed to send command
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/30596 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 来源证据：fix(tui): TUI message list doesn't update for cross-instance agent messages

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：fix(tui): TUI message list doesn't update for cross-instance agent messages
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/22588 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 7: 来源证据：lo Error 0 A JavaScript error occurred in the main process

- Trigger: GitHub 社区证据显示该项目存在一个维护/版本相关的待验证问题：lo Error 0 A JavaScript error occurred in the main process
- Why it matters: 可能阻塞安装或首次运行。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/30297 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 来源证据：Missing Authentication header when I try to use open code

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Missing Authentication header when I try to use open code
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/25757 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：TUI double-ESC loops and Desktop stop button fails to interrupt

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：TUI double-ESC loops and Desktop stop button fails to interrupt
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/anomalyco/opencode/issues/24217 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 可能修改宿主 AI 配置

- Trigger: 项目面向 Claude/Cursor/Codex/Gemini/OpenCode 等宿主，或安装命令涉及用户配置目录。
- Host AI rule: 列出会写入的配置文件、目录和卸载/回滚步骤。
- Why it matters: 安装可能改变本机 AI 工具行为，用户需要知道写入位置和回滚方法。
- Evidence: capability.host_targets | github_repo:975734319 | https://github.com/anomalyco/opencode | host_targets=local_cli
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
