dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
English | 中文
DSH(DeepSeek Harness)Web 插件:记住左侧边栏与右侧面板的宽度,刷新或重启后恢复。
DSH 的布局壳(@deepseek-ai/dsh-client-ui-layout)把两侧宽度放在瞬时状态里:
null,首次打开取视口 45%,clamp 到 300px–视口 70%;刷新、重启后回到默认值。dsh.sidebar-right.v1.),所以重启后可能面板仍打开、宽度却已被重置。插件只记忆宽度,不改打开状态、标签页或分栏。
[data-side="sidebar"|"rightbar"])的 pointerdown / pointerup,手势结束后读取布局壳内联 grid-template-columns 的稳定列宽。setSidebar() / setRightbar(),与拖拽手柄走同一条 action。data-sidebar-collapsed 属性,重新展开时重新应用记忆宽度(原生行为是回到 280px)。localStorage 单键 dsh.layout-memory.v1:
{ "v": 1, "left": 340, "right": 900 }存储不可用(隐私模式、配额)或 JSON 损坏时,只关闭记忆,不影响页面。
安装会修改 %USERPROFILE%.dsh 下的 profile 配置,请确认后执行。支持 HMR 的 profile 通常会自动重组;不要自动重启 DSH 或打断正在运行的会话。仓库:
从插件页安装:侧边栏「插件」→「添加插件」,填入仓库地址 https://github.com/AkotaP/dsh-layout-memory。DSH 会先用 git ls-remote 探测仓库,再交给 pnpm;装完确认列表里该插件为启用状态。
命令行安装:
dsh plugin --profile desktop add https://github.com/AkotaP/dsh-layout-memory让 agent 安装(把下面这段发给 DSH 里的 agent):
把https://github.com/AkotaP/dsh-layout-memory装进当前 DSH 的 desktop profile:用侧边栏「插件」页的「添加插件」,或dsh plugin --profile desktop add https://github.com/AkotaP/dsh-layout-memory。装完确认 profile 的dsh.profile.bundles里包含dsh-layout-memory,并确认插件页能看到该插件;只有宿主明确要求时才询问是否重启,不要自动重启。
本地开发(link 方式,源码改动实时生效):
$profileDir = $env:DSH_PROFILE_DIR # 例如 ~/.dsh/profiles/desktop
$repo = "E:\Data\Project\dsh\dsh-layout-memory"
# 1. profile package.json 的 dependencies 中加 link:
# "dsh-layout-memory": "link:E:/Data/Project/dsh/dsh-layout-memory"
# 2. dsh.profile.bundles 中加入 dsh-layout-memory
# 3. 建立链接
New-Item -ItemType Junction -Path "$profileDir\node_modules\dsh-layout-memory" -Target $repo包内 cordis.patch.yml 已带 insert 行,不要再往 profile patch 里重复添加。
装好后可用宿主的只读健康路由确认(端口以实际 DSH Web 服务为准):
curl http://127.0.0.1:<DSH-Web-端口>/dsh-layout-memory/health # {"loaded":true}卸载:在插件页卸载,或 dsh plugin --profile desktop remove dsh-layout-memory,并确认 dsh.profile.bundles 中已移除。
离线测试:
cd E:\Data\Project\dsh\dsh-layout-memory
node --test --test-isolation=nonectx.layout 的公开接口里(ILayout 只有面板切换)。插件通过 LayoutController 实例上的私有 panels 字段取 setSidebar / setRightbar,并做特性检测;未来布局包若移除该字段,插件会降级为只记录不恢复,并在控制台警告。从 dsh.profile.bundles 移除 dsh-layout-memory,删除 node_modules 下的链接;如需清除记忆,再删除 localStorage 的 dsh.layout-memory.v1。
>=20>=0.2.1-rc.2