← 返回列表
⚠ 装前注意
双端插件脚手架,含类型检查、测试与 CI
基本兼容但装前注意:未发布到 npm registry,仅可从源码安装 · 最近上游提交 2026/8/27 · 已提供中文文档
deepseek-harness 插件开发模板。
综合分
49.7
GitHub 分
49.7
用户评分
—
★ Stars
47
周下载量
—
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add bugmaker2/dsh-plugin-template未发布到 npm registry,仅可从源码安装,改用 GitHub 源安装
数据截至 2026/8/28(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
安装兼容性检查⚠ 装前注意
以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。
✗npm 包dsh-plugin-template(未发布到 npm,仅可源码安装)
✓Node 引擎要求 ^22.19 || >=24 · 基线 Node 22.19 满足
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明
未发布到 npm registry,仅可从源码安装
验证方式:npm registry 存在性 + package.json 静态校验 · 最后验证 2026/9/17 15:49:45
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-typert-protocol@deepseek-ai/dsh-typert-registry@deepseek-ai/schemastery@deepseek-ai/dsh-client-runtime@deepseek-ai/dsh-client-ui-slots@deepseek-ai/dsh-client-locale@deepseek-ai/dsh-client-ui-primitives用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动
README
dsh-plugin-template dsh.so security dsh.so install 一个完整的双端 DeepSeek Harness 插件模板。它演示了完整的插件能力面——Host 端暴露 Typert Remote,Client 端把该 Remote 挂载进 React 视图——并且类型检查、lint、单元测试、CI 和发布元数据全部接好。 开箱即用会注册一个 greet Remote:Host 端用可配置的前缀拼出 "Hello, ",Client 端在一个新的 "Greet" tab 里渲染结果。 目录结构 package.json # dsh.bundle + dsh.client manifest、脚本、peer 依赖 cordis.patch.yml # 把 Host 插件行挂载进 profile dsh.plugin.json # dsh.so 注册表 manifest src/index.ts # Host 入口:Config schema + Typert manifest 注册 src/runtime.ts # Host Remote 服务(TypertRemoteService) src/typert.ts # Typert 模型 manifest src/contract.ts # Host/Client 共享的严格 wire contract src/types.ts # 共享类型 src/client/index.tsx # Client 入口:挂载 Remote + 注册视图 slot src/client/remote.ts # Client Remote 贡献 + 类型化 namespace src/client/locales.ts # 中英文字典 src/client/view.tsx # 最小 React 视图 src/client/styles.ts # 主题 token 样式 tests/ # vitest 单元测试(contract + runtime) build.mjs # esbuild 双端构建(Host ESM + Client CJS) .github/workflows/ci.yml Harness 唯一需要的 manifest 是 package.json:dsh.bundle.patch 让包成为可安装的 profile bundle,dsh.client 声明 Web 客户端 bundle 及其注入的客户端包。Host 入口是普通 Cordis name/apply 导出;Client 入口被打包成 lib/client.js,由 Web harness 的模块加载器加载。 环境要求 - Node.js >= 22.19(或 >= 24) - pnpm >= 9 - DeepSeek Harness >=0.1.0-rc.6 从本地目录安装 pnpm install pnpm run build dsh plugin --profile web add . 重新构建插件后重启 Web Harness。会话视图环中会出现一个 "Greet" tab,显示 Hello, DSH。 卸载: dsh plugin --profile web remove dsh-plugin-template 从 Git 安装 dsh plugin --profile web add github:you/dsh-plugin-template Git 安装拉取的是源码而非构建产物,因此 pnpm 会运行 prepare 脚本来构建 lib/。pnpm ≥10 在得到允许前会阻止该构建;第一次 add 失败时,dsh 会给出修法——把它打印的包键复制进该 profile 的 pnpm-workspace.yaml: allowBuilds: dsh-plugin-template: true 然后重新执行 add。该授权允许包在安装时运行代码,因此只对可信的包授权(并锁定 commit)。 开发 pnpm run check check 依次执行 typecheck、lint、test 和 build。CI 在 pnpm install --frozen-lockfile 之后运行同一命令。 单独脚本: pnpm run build # esbuild 双端打包 + 声明文件生成 pnpm run typecheck # 对 src 和 tests 运行 tsc pnpm run lint # eslint pnpm run test # vitest 重命名包 改名时以下位置必须保持一致: - package.json → name、exports、files - build.mjs → __ModuleLoader__.load id - src/index.ts → name - src/client/remote.ts → 包 id 与服务 key 的 TypertRemoteNamespace$… 十六进制名 - src/client/locales.ts → locale namespace key - src/client/index.tsx → slot id - src/typert.ts → package - src/contract.ts → invocation id - cordis.patch.yml → id 和 name - dsh.plugin.json → id 被发现 给 fork 添加 GitHub topic dsh-plugin: gh api --method PUT repos/YOUR-USER/dsh-plugin-template/topics \ -H 'Accept: application/vnd.github+json' \ -f 'names[]=dsh-plugin' 许可证 MIT
扫码进群