前言¶
DeepSeek Harness (DSH) 的設計理念是“一切皆插件”。在多輪對話與工具執行的過程中,Root Agent(根代理)執行完一輪操作後,往往缺乏一個獨立的、後臺的審查機制來驗證其發現或輸出。dsh-shadow-mind 插件爲 DSH 提供了一個獨立的 bundle,在符合條件的 Root Agent 回合後啓動全新的後臺 Shadow Agents,驗證其結構化發現,並將被接受的報告中繼回 Root 會話,同時通過 Web UI 暴露配置和證據。
這是什麼¶
這是一個由 whutzefengxie-ops 維護的獨立版本化 DeepSeek Harness bundle。它利用 DeepSeek Harness 的擴展機制處理運行時、會話、子代理、權限和持久化。該插件旨在解決 Root Agent 在執行特定工具後缺乏自動審查的問題,通過啓動獨立的 Shadow Agents 進行後臺審查,並將結果反饋給 Root 會話。
核心功能¶
- 後臺代理啓動: 在 Root Agent 完成符合條件的工具使用回合後,自動啓動全新的後臺 Shadow Agents。
- 結構化驗證: 對 Shadow Agents 生成的發現進行結構化驗證。
- 報告中繼: 將通過驗證的報告中繼回 Root 會話。
- Web UI 暴露: 在 Web UI 中暴露配置項和運行證據。
- 實時調度: 提供實時的調度設置,包括超時、報告批處理等。
- Markdown 定義: 支持 Markdown 格式的 Shadow 定義文件。
安裝與啓用¶
安裝前請確保 DSH 版本匹配。當前最新版本 v0.1.6 需要 DSH 0.2.0-rc.2。
- 安裝插件:
npx @deepseek-ai/dsh@0.2.0-rc.2 plugin --profile web add github:whutzefengxie-ops/dsh-shadow-mind#v0.1.6
- 重啓 Profile:安裝完成後重啓選定的 profile。
- 驗證安裝:運行以下命令檢查配置是否生效,輸出中應包含
shadow-mind-runtime和tool-shadow-mind。
dsh --profile web --dump-config
- 移除插件:
dsh plugin --profile web remove @whutzefengxie-ops/dsh-shadow-mind
典型用法¶
- 配置定義文件:
插件定義文件存儲在$DSH_HOME/shadow-minds/*.md。一個最小化的確定性接受定義示例如下:
---
id: acceptance-reviewer
name: Acceptance Reviewer
enabled: true
debug: false
activation_probability: 1
active_for_models:
- '*'
tools: []
capture: since-compaction
context: minimal
think_first: true
---
Review the completed task. If there is a concrete defect or missing requirement, return a concise report with verdict `challenge` or `gap` and only rendered sequence numbers in `refs`. Return `silent` when the review applies but adds nothing actionable, or `not_relevant` when it does not apply.
- 調試運行:
使用零依賴的調試工具追蹤特定會話或運行:
node tools/shadow-debug.mjs trace <childSessionId|runId|rootSessionId>
適用場景與注意¶
- 版本兼容性:v0.1.6 版本僅兼容 DSH
0.2.0-rc.2。舊版本插件需要對應版本的 DSH。 - 源碼安全:GitHub 安裝會使用提交的
lib/目錄。該包沒有prepare腳本,也不需要 pnpmallowBuilds授權。 - 本地存儲:Shadow 定義文件以 Markdown 格式存儲在本地文件系統
$DSH_HOME/shadow-minds/*.md中。 - 運行機制:運行時、會話、子代理等均使用 DeepSeek Harness 的擴展機制。
結尾¶
該插件適合需要在 Root Agent 執行後進行獨立審查和驗證的場景。更多配置細節和示例可參考 GitHub 倉庫。