预期行为
用户在 opencode 配置里写一行 "plugins": ["billion-context"],opencode 用自己的插件机制(Npm.add)装包并负责升级。同一份配置能直接同步到另一台机器,不含任何本机绝对路径。
现状(2026-09-18 实测)
npm latest = 0.1.118,tarball 的 dist/agent/ 只有 dsh-acp.js / omp.js / opencode.js / pi.js,没有 opencode-native.js 。native 插件只存在于未合并的 feat/pi-native-plugin(tip 2c5a6f8)。
package.json:main: dist/index.js,没有 exports (pi-native 分支上 exports 也是 null)。opencode 2.x 解析配置里的裸包名时按 <name>/server 子路径走 Node 解析,没有 exports map 就落不到插件入口。
因此 bili plugin install opencode 只能写 shim 目录:<config dir>/plugins/billion-context/index.js 内容为 export { default } from "<本机 checkout 绝对路径>/dist/agent/opencode-native.js";
后果:配置无法跨机同步(用 yadm/chezmoi 同步 dotfiles 的场景直接坏);升级必须人工 git pull && npm run build;opencode 自己的插件升级机制完全用不上。
release v0.1.119 #922 release v0.1.119 只含 fix(#728): proactive nudge for upstreams that never report usage #731 / test(launcher): isolate the host client, proxy and CA env vars #895 ,不含 native 工作流,短期内 npm 上不会出现。
建议
package.json 显式枚举 exports(opencode 2.x: no-launcher npm-plugin deployment — plugins: ["billion-context"], plugin lazily spawns the proxy #809 里讨论过的形态:不用 wildcard,只暴露稳定子路径),把 opencode 插件入口暴露出来。
native 入口随包发布(确保进 files)。
plugin install opencode 判断自身来源:npm 安装时写裸包名条目,只有本地 git checkout 才写 shim 目录,并在输出里说明这是开发形态、不可跨机。
验收
预期行为
用户在 opencode 配置里写一行
"plugins": ["billion-context"],opencode 用自己的插件机制(Npm.add)装包并负责升级。同一份配置能直接同步到另一台机器,不含任何本机绝对路径。现状(2026-09-18 实测)
latest = 0.1.118,tarball 的dist/agent/只有dsh-acp.js / omp.js / opencode.js / pi.js,没有opencode-native.js。native 插件只存在于未合并的feat/pi-native-plugin(tip2c5a6f8)。package.json:main: dist/index.js,没有exports(pi-native 分支上exports也是 null)。opencode 2.x 解析配置里的裸包名时按<name>/server子路径走 Node 解析,没有 exports map 就落不到插件入口。bili plugin install opencode只能写 shim 目录:<config dir>/plugins/billion-context/index.js内容为export { default } from "<本机 checkout 绝对路径>/dist/agent/opencode-native.js";git pull && npm run build;opencode 自己的插件升级机制完全用不上。release v0.1.119只含 fix(#728): proactive nudge for upstreams that never report usage #731 / test(launcher): isolate the host client, proxy and CA env vars #895,不含 native 工作流,短期内 npm 上不会出现。建议
package.json显式枚举exports(opencode 2.x: no-launcher npm-plugin deployment — plugins: ["billion-context"], plugin lazily spawns the proxy #809 里讨论过的形态:不用 wildcard,只暴露稳定子路径),把 opencode 插件入口暴露出来。files)。plugin install opencode判断自身来源:npm 安装时写裸包名条目,只有本地 git checkout 才写 shim 目录,并在输出里说明这是开发形态、不可跨机。验收
npm pack billion-context@<新版>的 tarball 含 opencode native 插件入口"plugins": ["billion-context"](零绝对路径)即可加载插件并自拉起代理