dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
给 DSH(DeepSeek Harness)已装插件配中文名与一句话说明:官方「插件」页(含插件包卡片与详情)原地显示中文,启动时自动翻译新插件,无 UI 入口。Chinese names for installed DSH plugins. MIT licensed.
版本更新记录见 CHANGELOG.md,或在 GitHub Releases 查看。
给 DSH(DeepSeek Harness)已安装插件配「中文名 + 一句话说明」:官方「插件」页的已安装插件行、插件包卡片与详情页都会原地显示中文名与中文描述(由 host 覆盖显示元数据);新装插件会在启动后自动翻译。同时给 skills(技能) 补中文说明:/ 技能菜单里每条技能显示「英文原描述 |中文:;用法:」。本插件没有任何 UI 入口(没有 tab、没有设置项),管理通过 loopback HTTP API 或让 AI 代改。
plugin_manager install_bundle 从 GitHub 或 npm 安装到 DSH profile)listBundles)都会直接显示中文名与中文描述;未翻译的插件回退英文。默认开启。/ 技能菜单里每条技能追加「|中文:作用;用法:怎么用」,看懂技能是做什么、什么时候用(见「技能中文翻译」)。source(ai / manual)的 JSON,导入时保留来源,只接受已安装插件名(≤64KB)。/plugin-labels.json(v2),技能说明在 /plugin-labels-skills.json(v1);均 UTF-8 无 BOM、原子写,旧 v1 标签数据可迁移读取。官方「插件」页的已安装插件行、插件包卡片与详情页直接显示中文名与中文描述(v0.6.0+,v0.7.0 起补上包级卡片):
v0.7.0 起插件没有任何 UI 入口:没有「中文名」tab,也没有设置项。中文名由 host 覆盖官方显示元数据实现,管理与编辑走 HTTP API(见「使用」)。
v0.6.0 起,host 半边会在运行时包装宿主内部的显示元数据,把标签缓存里的中文名与一句话说明作为 {en, zh} 覆盖到官方页面上。这是纯显示层覆盖:不改任何插件包文件,也不影响包身份、安装、更新与卸载;默认开启。v0.6.1 起改用 symbol 标记识别 wrapper(Cordis 的 ctx.get 返回 traceable Proxy、函数引用每次不同),修复了 patched 状态误判与重复包装;v0.7.0 起同时包装 pluginManager.listBundles(),让插件包卡片也显示中文。
pluginPackages.metaOf()(官方「插件」页的已安装插件行 + 详情页标题/描述)和 pluginManager.listBundles()(插件包卡片,它本来直接读 readPluginMeta)。pluginPackages.metaOf(specifier, parentURL) 读取每个包的显示元数据(它会读该包 locale/*.json 的 meta,缺省回退 package.json 的 name/description);插件包卡片则由 pluginManager.listBundles() 直接 readPluginMeta。官方没有行级扩展点,所以这里在进程内包装这两个方法,用标签缓存补上 title/description 的 {en, zh} 语言映射,其余字段(如 icon、error)原样保留。package.json 而不走这两个方法,则不受影响。DSH_PLUGIN_LABELS_OFFICIAL_META=0,然后重启 DSH(会同时关闭上述两处覆盖)。未设置、设为 1 或其它值都保持默认开启。GET /api/plugin-labels/list 的响应里 officialMeta 字段({enabled, patched, service, bundles})可确认两处覆盖是否已生效,默认应为 enabled:true, patched:true, bundles:true。host 启动约 4 秒后会自动补一次缺失标签:
MAX_PENDING_PER_CALL),只补空缺、不会覆盖手改标签,剩余的下次启动/手动调用再补。DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0,然后重启 DSH;未设置/1/其它值均为开启。POST /api/plugin-labels/translate(见「使用」)。用户的技能大多是英文。命中翻译缓存后,本插件会把技能描述替换成纯中文(不再显示英文原文,/ 菜单一行显示完整中文):
中文:<中文作用>;用法:<什么时候用、怎么触发>skills 服务的 snapshot/list,命中缓存才替换描述,未命中保持原样(/ 菜单走 skills.list,模型侧技能目录走同一份 description)。/plugin-labels-skills.json(独立于插件标签缓存,version: 1,UTF-8 无 BOM、原子写);每条 {zh ≤22 字, usage ≤40 字, source: "ai" | "manual", at}。GET /api/plugin-labels/skills、POST /api/plugin-labels/skills/translate、POST /api/plugin-labels/skills/label。MAX_SKILLS_PER_AUTO);只补空缺、不覆盖手改;DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0 同时关闭插件与技能自动翻译。ctx.get("skills"))不可用时静默跳过,不影响其它功能。GET /api/plugin-labels/list 的 officialMeta.skills 可确认包装是否已生效。npm publish 后)在 DSH 插件页 → 添加插件 → 填包名 dsh-plugin-labels;或在创造模式会话里 plugin_manager → install_bundle → target: "dsh-plugin-labels"。发布后 profile 依赖形如 "dsh-plugin-labels": "dsh-plugin-labels@^0.9.3"。
在 DSH 插件页 → 添加插件 → 填本仓库的 Git 地址(https://github.com/qyy2005/dsh-plugin-labels),DSH 会拉取并安装;此时 profile 依赖形如 github:qyy2005/dsh-plugin-labels。私有仓库需具备相应访问权限。
link: 形式)用 plugin_manager → install_bundle → target 填本目录绝对路径,profile 依赖形如 link:,node_modules/dsh-plugin-labels 是指向本目录的符号链接。
lib/index.js 后需重启 DSH 才生效(v0.7.0 起 client 已无 UI)。package.json 来安装(易被 pnpm 清理)。v0.9.3 起没有 UI 入口,全部通过 7 个 loopback HTTP API 操作(也可以让 AI/脚本代改):
# 查看已装插件 + 标签 + 诊断字段(officialMeta)
Invoke-WebRequest -UseBasicParsing http://127.0.0.1:<端口>/api/plugin-labels/list
# 补翻译(无参 = 只补空缺;最多 20 条/次)
Invoke-RestMethod -Method Post -ContentType 'application/json' `
-Body '{}' http://127.0.0.1:<端口>/api/plugin-labels/translate
# 显式重翻指定插件
Invoke-RestMethod -Method Post -ContentType 'application/json' `
-Body '{"names":["@linxin666/dsh-remote-web-ui"]}' http://127.0.0.1:<端口>/api/plugin-labels/translate
# 手改一条(source=manual),或恢复 AI:{"name":"...","action":"reset"}
Invoke-RestMethod -Method Post -ContentType 'application/json' `
-Body '{"name":"@linxin666/dsh-remote-web-ui","title":"远程网页访问","oneLine":"扫码配对手机和电脑共用网页界面。"}' `
http://127.0.0.1:<端口>/api/plugin-labels/label
# 导入导出的 JSON(只保留已装插件名,保留 ai/manual 来源)
Invoke-RestMethod -Method Post -ContentType 'application/json' -InFile labels.json `
http://127.0.0.1:<端口>/api/plugin-labels/import
# 技能:列出技能 + 已缓存的中文说明
Invoke-WebRequest -UseBasicParsing http://127.0.0.1:<端口>/api/plugin-labels/skills
# 技能:补翻译缺失的技能说明(每次最多 20 条;可重复调用补剩余)
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{}' `
http://127.0.0.1:<端口>/api/plugin-labels/skills/translate
# 技能:手改一条技能说明(source=manual,自动翻译不会覆盖)
Invoke-RestMethod -Method Post -ContentType 'application/json' `
-Body '{"name":"office","zh":"Office 文档处理","usage":"对 AI 说:用 office 技能处理文档"}' `
http://127.0.0.1:<端口>/api/plugin-labels/skills/label端口就是当前 DSH Web GUI 的端口;这些路由只接受 loopback 请求且必须是 POST(/list、/skills 为 GET)。自动翻译会替你补空缺,手改过的条目不会被自动覆盖。
node scripts/gen-doc.mjs 会在本地生成 PLUGINS.zh.md 与 PLUGINS.zh.html:中文名、原始包名、一句话作用、版本、说明(AI 生成 / 手改 / 待翻译)。HTML 是单文件、内联样式、可搜索、随系统深浅色,双击即可打开,无需联网。内容来自你本机的标签缓存与已装插件清单,默认不提交到仓库(已 gitignore)。
重新生成(装/卸插件,或翻译/手改标签之后):
node scripts/gen-doc.mjs # 默认读取 $env:DSH_HOME(或 ~/.dsh)的 desktop profile
node scripts/gen-doc.mjs --home "$env:DSH_HOME" --profile desktop
npm run docs # 等价于 node scripts/gen-doc.mjs生成器只读本地标签缓存与 profile 清单,产物不含本机路径、DSH_HOME、用户名或 token;生成的两个文件只留在本地(已 gitignore),不要手工编辑。
require("react")。pluginPackages.metaOf()(官方页行/详情)与 pluginManager.listBundles()(插件包卡片),技能中文包装 skills 服务的 snapshot/list,client 只注册 locale 字典。lib/index.js(inject: ["webServer"]);client 是手写的 __ModuleLoader__ bundle lib/client.js(v0.7.0 起只注册 locale,无 UI),仅 require("react")。GET /api/plugin-labels/listPOST /api/plugin-labels/translate(无参=补空缺;{names:[...]}=显式重翻)POST /api/plugin-labels/label({name,title,oneLine} 或 {name,action:"reset"})POST /api/plugin-labels/importGET /api/plugin-labels/skills(技能列表 + 已缓存中文说明)POST /api/plugin-labels/skills/translate(补技能说明,单飞锁,并发 409)POST /api/plugin-labels/skills/label({name,zh,usage} 手改技能说明)apply 里注册一个 4 秒后执行一次的定时器(unref),先 translatePending 补插件标签、再 translateSkillsPending 补最多 10 条技能说明;可用 DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0 关闭;异常只 warn。installOfficialMeta / installBundleMeta / installSkillTranslations 用 symbol 标记识别 wrapper,幂等、可 dispose、服务替换后重打、失败静默回退。DSH_PLUGIN_LABELS_OFFICIAL_META=0 关闭前两个显示覆盖(技能翻译不受影响)。sec-fetch-site 跨站拒绝、POST-only、翻译单飞锁(插件与技能各一把,并发 409)、AbortSignal.timeout(120s)、未预期异常统一 500 不泄漏路径。/plugin-labels.json(v2,旧 v1 可迁移)、技能说明 /plugin-labels-skills.json(v1);均 UTF-8 无 BOM,临时文件 + rename 原子写,单条非法条目丢弃。node --check lib/index.js、node --check lib/client.js;host 可用桩 ctx 跑冒烟。dsh-plugin-labels/
├─ .gitignore # 忽略 node_modules、日志与本地内部文档
├─ .github/
│ ├─ ISSUE_TEMPLATE/ # Bug / Feature 的 issue forms
│ └─ workflows/ci.yml # GitHub Actions:node --check + JSON/BOM 校验
├─ docs/
│ └─ official-page.png # 官方「插件」页原地显示中文名的截图
├─ package.json # manifest(dsh.bundle 组合 patch、dsh.client 平台与 inject)
├─ cordis.patch.yml # bundle 组合 patch
├─ lib/
│ ├─ index.js # host:HTTP API + 显示覆盖 + 技能中文 + 自动翻译 + 缓存
│ └─ client.js # client:模块骨架,仅注册 locale(v0.7.0 起无 UI)
├─ locale/
│ ├─ zh.json # 插件元数据(中文)
│ └─ en.json # 插件元数据(英文)
├─ icon.svg # 插件图标
├─ scripts/
│ └─ gen-doc.mjs # 生成 PLUGINS.zh.* 速查文档(本地生成,已 gitignore)
├─ README.md
└─ LICENSEMIT,见 LICENSE。Copyright (c) 2026 qyy2005
dsh-plugin-labels is a DSH (DeepSeek Harness) plugin that gives every installed plugin a Chinese name and a one-line explanation. The labels are shown in place on the official Plugins page: the installed-plugin rows, the detail pages and the plugin package cards (pluginManager.listBundles) all display the Chinese name and description, falling back to English for plugins without a label. The plugin has no UI entry point (no tab, no settings item): labels are managed through loopback HTTP routes (or by an AI/script calling them), and results are cached under /plugin-labels.json with manual edits never overwritten by automatic translation.
It also translates skills: each skill description in the / skill menu gets a Chinese purpose and usage hint appended (English description |中文:…;用法:…), cached separately in /plugin-labels-skills.json and managed through GET/POST /api/plugin-labels/skills…. Only the catalogue description is translated, the skill body stays English; the model-side catalogue truncates descriptions at 500 characters.
Each label is a Chinese name (≤10 characters) plus a one-line explanation (≤80 characters) that must explain how to use the plugin: the problem it solves, where in DSH the user enters or operates it, and a concrete first step. When the entry point cannot be inferred, the model is instructed to write 入口以界面为准 instead of inventing menus.
Newly installed plugins are translated automatically: about 4 seconds after host startup one pass fills up to 20 missing labels and then up to 10 skill explanations (set DSH_PLUGIN_LABELS_AUTO_TRANSLATE=0 and restart DSH to disable it). The display overrides can be disabled together with DSH_PLUGIN_LABELS_OFFICIAL_META=0; GET /api/plugin-labels/list reports officialMeta: {enabled, patched, service, bundles, skills} for diagnostics. These hooks require one DSH restart after installation.
The client half is a hand-written __ModuleLoader__ bundle with no build step that only requires react (v0.7.0: locale registration only, no UI); the host half is an ESM plugin exposing seven loopback-only HTTP routes plus the display overrides, the skill translation hook and the startup auto-translate. Verified on DSH desktop 0.2.1-rc.2 / rc.3. MIT licensed.