前言¶
DSH 的擴展能力可以拆成插件,但社區插件分散在 GitHub。一個倉庫標了 topic:dsh-plugin,並不等於它可用,也不等於它值得信任。如果手動完成搜索、覈對 bundle、審查生命週期腳本、固定版本、修改 profile、確認加載,步驟會比較多。
find-plugin 面向這條鏈路:它在 DSH 中註冊工具,先搜索社區插件,再做靜態檢查和風險披露,經過 DSH approval 後固定 commit 安裝,並校驗安裝結果。
這是什麼¶
find-plugin 是由 graceen2331-prog 維護的 DSH 插件,許可證爲 MIT。它註冊兩個 DSH 工具:find_plugin 和 install_plugin。
V1 直接依賴 GitHub 和 DSH 官方 plugin manager,不引入 registry、embedding、數據庫或 Web UI。
核心功能¶
find_plugin¶
find_plugin 接收:
{ query: string }
它只搜索 GitHub topic:dsh-plugin,本地關鍵詞排序,最多返回 5 項。返回字段包括倉庫名稱、描述、stars、更新時間、GitHub URL、package name 與 bundle patch。
它會檢查根 package.json、dsh.bundle.patch 和 patch 引用的構建入口,列出 install、prepare、postinstall 及明顯風險,並過濾歸檔或禁用倉庫、bundle/profile 混用、危險路徑、空 patch、缺失構建產物等無效候選。
GitHub 未認證搜索額度較低。可選通過 DSH_FIND_PLUGIN_GITHUB_TOKEN、GITHUB_TOKEN 或 GH_TOKEN 提供 token,且 token 只發送給 api.github.com。
install_plugin¶
install_plugin 接收:
{
owner: string
repo: string
profile?: string
}
profile 默認爲 web。執行時,它會獲取 default branch 的完整 commit SHA,並在該 SHA 上重新驗證 bundle;在 DSH approval 中展示倉庫、package、目標 profile、固定 SHA、生命週期腳本和風險;只有 allowed-once 才繼續。
安裝時,通過 DSH 官方 plugin manager 安裝 github:<owner>/<repo>#<40-char-sha>,並使用 --ignore-scripts。之後驗證 profile dependency、SHA pin、dsh.profile.bundles、bundle patch 和官方 --dump-config。
安裝成功後返回 restartRequired: true;V1 默認當前 runtime 不會熱加載新增 bundle。
安裝與啓用¶
前置要求:
- Node.js 20 或更高版本。
pnpm必須在 PATH 中可用,因爲當前 DSH 官方 plugin manager 會在 profile 目錄中調用pnpm。
安裝到 web profile:
npx @deepseek-ai/dsh plugin --profile web add github:graceen2331-prog/find-plugin
然後啓動或重啓 Web surface:
npx @deepseek-ai/dsh web
經過上面的步驟,插件會註冊 find_plugin 與 install_plugin 兩個 DSH 工具。本倉庫已提交 lib/ 構建產物;安裝和運行不依賴本包自身的 prepare、install 或 postinstall。
典型用法¶
在 DSH 中調用 find_plugin 時傳入 { query: string }。拿到候選倉庫後,可以用 install_plugin 安裝其中一個,傳入 { owner: string, repo: string, profile?: string };profile 不傳時默認 web。
對於開發或驗證,倉庫提供以下命令:
pnpm install --ignore-scripts
pnpm test
pnpm pack
發佈前應在空的 DSH_HOME 中執行前面的 GitHub 安裝命令,重啓 Web surface,並從 DSH tool registry 確認兩個工具已經註冊。
適用場景與注意¶
適合在 DSH 中查找社區插件,並在安裝前完成檢查、審批和固定 commit。需要注意:GitHub topic 不是信任信號;靜態檢查只能過濾明顯問題,不能替代完整源碼審計。
DSH 插件最終在 Harness 進程內運行,擁有該進程權限,並不是安全沙箱。
V1 永不執行依賴的生命週期腳本;依賴 prepare 才生成運行文件、且沒有提交構建後 JS 的插件會被過濾或加載失敗。固定頂層倉庫 commit 可以防止檢查與安裝之間的 branch 移動,但不等於完整的供應鏈證明。approval 是一次性授權;拒絕、取消或沒有可用 approval channel 時不會安裝。
安裝前建議檢查源碼、許可證和倉庫狀態。find_plugin 的未認證搜索額度較低,如需要可選用 token;token 只發送給 api.github.com。
結尾¶
find-plugin 的價值在於把社區插件的安裝動作放進一個可檢查、可批准、可固定 commit 的流程裏。它不是替代源碼審計,也不是把 DSH 插件隔離成沙箱,而是減少手動覈對和版本漂移帶來的常見錯誤。
GitHub 倉庫:
https://github.com/graceen2331-prog/find-plugin
目錄頁(插件線索):
https://www.skillhub.cn/plugins/graceen2331-prog/find-plugin