前言¶
在 DSH 的 Web 設置中,插件列表頁可能列出較多模塊,單個卡片不一定能直接說明其用途。下面介紹 dsh-plugin-description:它爲 Web 設置中的插件列表頁添加中英文功能說明,併發布 pluginDescriptions 服務,供同一 DSH 進程內的 Host 側插件註冊或覆蓋說明。
這是什麼¶
dsh-plugin-description 是一個 DeepSeek Harness 組合插件,維護者爲 MysaDC,許可證爲 MIT。
它面向可正常運行的 DeepSeek Harness Web profile。安裝後,它會在 Web 設置的插件列表頁中爲插件卡片補充說明,並提供 pluginDescriptions 服務與 GET /plugin-descriptions 數據端點。
它聲明 dsh.bundle 補丁 cordis.patch.yml,dsh plugin add 安裝後自動插入組合行:同一行會進入宿主組合的 Node part 與瀏覽器插件名冊的 Client part,DSH 每次啓動自動掛載,不需要手動改寫組合文件。
核心功能¶
- 在 Web 設置的插件列表頁中,爲每張插件卡片顯示中英文功能說明。
- 展開卡片可查看完整說明、Loader 條目 id、配置狀態與 Cordis 掛載狀態。
- 發佈
pluginDescriptions服務,供同一 DSH 進程內的 Host 側插件註冊或覆蓋說明。 - 提供
GET /plugin-descriptions數據端點。 - 內置覆蓋 DSH 出廠組合全部 134 個模塊名的說明字典。
- 搜索框同時匹配插件名、Loader 條目 id 與說明文字,並隨界面語言
zh/en切換。 - 支持在頁面中「編輯說明」,可保存自定義說明、只改當前卡片或恢復默認。
- 用戶自定義說明會持久化到
<DSH_HOME>/plugin-descriptions.json。 - 支持從 GitHub Release、GitHub 倉庫/tag、
link或手動方式安裝。
安裝與啓用¶
安裝前需要一個可正常運行的 DeepSeek Harness Web profile。dsh plugin 依賴 pnpm。
如果 pnpm 提示:
ERR_PNPM_ADDING_TO_ROOT
可以在 profile 目錄的 .npmrc 中添加:
ignore-workspace-root-check=true
然後重試安裝命令。
從 GitHub Release 安裝¶
默認安裝最新 Release 的安裝件:
npx @deepseek-ai/dsh plugin --profile web add https://github.com/MysaDC/dsh-plugin-description/releases/latest/download/dsh-plugin-description.tgz
上面的命令不帶版本號,指向 releases/latest/download 下的固定名安裝件。以後升級時重跑同一命令即可。
如果需要固定版本,可以使用具體版本安裝件。下面是資料中的版本示例:
npx @deepseek-ai/dsh plugin --profile web add https://github.com/MysaDC/dsh-plugin-description/releases/download/v1.2.1/dsh-plugin-description-1.2.1.tgz
從 Git 安裝¶
安裝默認分支的最新代碼:
npx @deepseek-ai/dsh plugin --profile web add github:MysaDC/dsh-plugin-description
安裝固定 tag:
npx @deepseek-ai/dsh plugin --profile web add github:MysaDC/dsh-plugin-description#v1.2.1
驗證安裝¶
安裝後啓動 Web:
npx @deepseek-ai/dsh web
也可以查看 profile 配置中是否出現 plugin-description:
npx @deepseek-ai/dsh web --dump-config | grep -n "plugin-description"
如果命令輸出中出現 plugin-description,並且「設置 → 插件 → 插件列表」中的卡片帶說明,即表示已加載。
升級與卸載¶
升級到最新 Release 安裝件,可以重跑安裝命令:
npx @deepseek-ai/dsh plugin --profile web add https://github.com/MysaDC/dsh-plugin-description/releases/latest/download/dsh-plugin-description.tgz
卸載插件:
npx @deepseek-ai/dsh plugin --profile web remove dsh-plugin-description
卸載後會移除相關依賴與 bundle 層,組合文件不會被改寫。隨後重啓:
npx @deepseek-ai/dsh web
典型用法¶
在頁面中編輯說明¶
- 打開「設置 → 插件 → 插件列表」。
- 展開任意插件卡片,點擊「編輯說明」。
- 填寫中文和英文說明,點擊「保存」。
默認情況下,同名插件的所有卡片一起更新;如果勾選「只改當前卡片」,則只更新當前這張卡片。被自定義過的卡片會顯示「已自定義」徽標,編輯態中點擊「恢復默認」可退回內置說明。
用戶自定義說明會保存到:
<DSH_HOME>/plugin-descriptions.json
該文件與 settings.yaml 同級。升級、重裝插件不會丟失自定義說明,也可以直接用文本編輯器修改該文件,重新打開頁面後生效。
示例結構:
{
"modules": { "@your-scope/your-plugin": { "zh": "中文說明", "en": "English description" } },
"entries": { "your-row-id": { "zh": "只改這一張卡片的說明" } }
}
說明的最終優先級爲:
用戶字典 > 插件運行時註冊 > 內置特殊條目 > 內置字典
出於安全考慮,頁面中的寫操作只接受本機迴環地址請求,與 DSH 設置 API 同級約束。
讓其他插件註冊自己的說明¶
本插件的 Host 半會在宿主組合中發佈 pluginDescriptions 服務。同一 DSH 進程內的 Host 側插件可以讀取該服務,並註冊自己的說明。
示例:
return {
apply(ctx) {
const descriptions = ctx.get('pluginDescriptions');
if (descriptions === undefined) return;
ctx.effect(() => descriptions.register([
{
moduleName: '@your-scope/your-plugin',
zh: '你的插件的中文說明。',
en: 'English description.'
},
{
entryId: 'your-row-id',
zh: '針對特定條目 id 的說明。'
}
]))
},
}
接入要點:
register(entries)接收{ moduleName?, entryId?, zh, en? }數組。register(entries)返回一個 disposer,可精確撤銷本次註冊的條目。- 將註冊邏輯放進
ctx.effect,隨插件 fiber 生命週期清理。 resolve(moduleName, entryId)按entryId→moduleName的順序查詢註冊表。- 其他插件讀取
pluginDescriptions時必須判空。 - 如果希望作爲硬依賴,可以聲明:
inject: ['pluginDescriptions']
此時 Cordis 會在服務出現前掛起插件。
適用場景與注意¶
適合在以下場景使用:
- 需要在 DSH Web 插件列表頁快速理解每個插件模塊的作用。
- 希望爲同一插件的多個 Loader 條目配置不同說明。
- 希望其他 Host 側插件通過統一服務註冊自己的說明。
- 希望保留一份可持久化的用戶說明字典,升級插件後不丟失自定義內容。
使用前注意:
- 需要可正常運行的 DeepSeek Harness Web profile。
dsh plugin依賴pnpm。- 它會作爲 DSH 組合插件在 DSH 進程中運行,安裝前建議按自身安全策略檢查源碼、依賴與許可證。
- 本插件只做可選服務讀取,沒有硬注入依賴。如果確實出現瀏覽器頁白屏或啓動失敗,可以把組合行設置爲:
disabled: true
以排除該組合行。
內置說明字典提取自 DeepSeek Harness 各官方包 README 首段,並經過人工校對;個別條目有專屬說明。
鏈接¶
已覈實資料中未提供目錄頁地址。GitHub 倉庫地址如下:
https://github.com/MysaDC/dsh-plugin-description