前言¶
在 DeepSeek Harness(DSH)裏,第三方插件市場 dshmarket 可以通過設置頁相關槽位完成安裝與配置,但沒有註冊 sidebar.footer.action,因此在 Web 左側邊欄底部看不到入口。官方內置的 dsh-community-market 自帶側邊欄入口,而桌面端在一個 profile 裏對市場提供方是二選一,不能同時掛兩套市場 UI。
dsh-market-sidebar 是 Palpitate1388 維護的獨立配套插件:不修改 dshmarket 本體,只在側邊欄底部補一個入口,位置在 Agents-Anywhere「遠程控制」的右側。下面介紹它解決什麼問題、如何工作,以及如何在 profile 裏安裝與調整。
這是什麼¶
- 名稱:
dsh-market-sidebar(npm 包名,GitHub:Palpitate1388/dsh-market-sidebar) - 版本(package.json):1.0.0
- 許可證:MIT
- 定位:把
dshmarket的入口放進 DSH Web 左側邊欄底部;市場自我更新(例如dshmarket -> dshmarket@x.y.z)不會動本包文件。
爲什麼需要它¶
dshmarket 已註冊的槽位包括 settings.section、settings.plugins.tab、plugins.bundle.config、settings.plugin.item,以及僅用於安裝提示的 shell.overlay,未註冊 sidebar.footer.action。官方 dsh-community-market 有側邊欄入口,但 profile 內市場提供方由桌面端強制二選一。本包作爲外掛配套,與 dshmarket 解耦,便於在選用 dshmarket 時仍能從側邊欄打開市場面板。
核心功能¶
側邊欄入口與排序¶
- 註冊
sidebar.footer.action槽位;與 Agents-Anywhere「遠程控制」共用底部一行。 - 排序按
(priority, order)升序:「遠程控制」爲order: 26,本包爲order: 27,因此落在其右側。 - 通過 CSS 把宿主內聯
display: contents的錨點改爲橫向 flex,並用:has()配合本條目data-icon="market-sidebar"做margin-left: auto,將入口推到該行最右端(不依賴宿主 CSS 模塊類名)。
點擊行爲¶
點擊後打開浮層,內容由市場服務提供:ctx.provide("market", marketControl) 後調用 market.render(),將市場面板嵌入宿主容器;bundle 經宿主模塊表解析 React,與調用方共享同一 React 實例。
依賴 market 時的安全註冊¶
註冊邏輯在 ctx.inject(["market"], ...) 中:若未安裝 dshmarket、被禁用,或桌面端已切到官方社區市場,則不註冊任何 UI,避免出現無效按鈕。
宿主端爲空實現¶
lib/index.js 僅含空的 apply,刻意不在宿主端執行業務邏輯:DSH 啓動全有全無,宿主端拋錯會導致整個 profile 無法啓動;功能均在客戶端 lib/client.js(window.__ModuleLoader__.load)完成。
安裝與啓用¶
本插件沒有文檔中的 dsh plugin add github:... 一類命令;安裝方式爲把包放入 profile 的 local-plugins/,並在 profile 的 package.json 中聲明 file: 依賴與 bundle 列表。
- 將本倉庫內容放到目標 profile 的
local-plugins/dsh-market-sidebar/下。 - 在 profile 的
package.json中增加依賴,並把包名寫入dsh.profile.bundles:
{
"dependencies": {
"dsh-market-sidebar": "file:./local-plugins/dsh-market-sidebar"
},
"dsh": {
"profile": {
"bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "dsh-market-sidebar"]
}
}
}
- 執行
pnpm install(帶cordis.patch.yml的file:依賴滿足 reconcile 保留條件,不會被當成多餘包清掉)。 - 重啓 DSH 後生效。
cordis.patch.yml 會把本插件 insert 進 profile 層棧;package.json 中聲明瞭 dsh.bundle.patch 與 dsh.client.platform: web。
典型用法與調整¶
打開市場¶
側邊欄底部(「遠程控制」同一行、偏右)點擊市場入口,浮層內即爲 dshmarket 提供的完整市場面板(需 profile 中已啓用 dshmarket 且桌面端未強制使用官方社區市場)。
調整入口位置¶
修改 lib/client.js 中的 ORDER 常量:
ORDER |
位置 |
|---|---|
| 小於 26 | 「遠程控制」左側 |
| 大於 26 | 「遠程控制」右側 |
若希望緊貼「遠程控制」而不是貼到行尾,刪除 STYLE_TEXT 裏最後一條針對 [data-slot="sidebar.footer.action"]>:has(...) 的規則即可。客戶端 bundle 改動需重啓 DSH 纔會進入模塊圖。
卸載¶
從 profile package.json 刪除 dsh-market-sidebar 依賴與 dsh.profile.bundles 中的同名條目,刪除 local-plugins/dsh-market-sidebar/ 目錄,然後重啓 DSH。
適用場景與注意¶
適合誰:已在 profile 中使用 dshmarket、希望從 Web 左側邊欄快速打開市場,又不想改 dshmarket 源碼或與其更新流程綁死的開發者。
權限與安全:插件隨當前 DSH profile 與進程權限運行;安裝前請閱讀 GitHub 倉庫 源碼與 MIT 許可證,確認與您的環境策略一致。社區插件目錄(如 SkillHub)爲獨立生態站點,與 DeepSeek / 幻方無官方從屬關係。
構建說明:lib/client.js 爲手寫客戶端 bundle,無單獨構建步驟;react、@deepseek-ai/dsh-client-store、@deepseek-ai/dsh-client-ui-primitives 等平臺 seed 可直接 require。
結尾¶
dsh-market-sidebar 用最小 patch 補上 dshmarket 缺失的側邊欄槽位,並與官方社區市場二選一的約束兼容(無 market 時不註冊 UI)。需要細節時可查倉庫 README 與 lib/client.js。
- 目錄頁:https://www.skillhub.cn/plugins/Palpitate1388/dsh-market-sidebar
- GitHub:https://github.com/Palpitate1388/dsh-market-sidebar