dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH recycle bin plugin: archive trash, batch restore/purge, sidebar batch archive
Recycle Bin for DeepSeek Harness 为 DSH 增加独立回收站:归档对话可移入回收站、批量还原、彻底删除,并支持左侧栏批量归档。
A standalone DSH recycle bin plugin: move archived conversations into a recoverable trash, batch restore or permanently purge, plus sidebar batch archive.
为 DeepSeek Harness (DSH) 提供独立的回收站管理能力。插件通过 DSH 官方 UI 插槽与独立 HTTP 路由工作,不修改 DSH 核心代码,也不修改其它插件源码;卸载后原界面可恢复。
This plugin adds a recycle-bin workflow to DSH through official UI slots and its own namespaced HTTP routes. It does not modify DSH core or any existing plugin source; uninstalling restores the original UI.
path / os / fs,兼容 Windows、Linux、macOSpath / os / fs; supports Windows, Linux, and macOS同时适配 DSH 0.1.5 与 0.1.7(rc 线)。
中文:
@deepseek-ai/dsh-client-ui-primitives 的图标导出从像素尺寸后缀(IconTrashOutline16 / …14 / …20)改成了描边粗细后缀(IconTrashOutlineRegular / …Medium)。客户端半包现在把两代名字都探一遍(primitives[modern] ?? primitives[legacy]),因此同一份 bundle 在 0.1.5 与 0.1.7+ 上都能拿到组件。旧写法在新版会解构成 undefined,React 报 error #130,slot 条目崩溃 —— 表现是界面完全没反应(而不是弹错误),这一点很容易误判成“插件没装好”。workspaceRegistry.unarchiveSession() / unpinSession() 与 Workspace.detachSession()(幂等、随 registry 写链串行);0.1.5 及更早的 enqueueOperation + setState / 工作区表直写路径保留为回退。sessions/--<项目 slug>--/<会话 id>/,更早是 sessions/<slug>/<id>/,无 cwd 的会话在 _no-cwd/;插件会同时按原样 id 与 DSH 的 encodeSegment 规则比对,两种布局都能定位(日志文件名从 session.jsonl[.zstd] 变为 session.vN.jsonl[.zstd] 不影响删除整目录)。ctx.workspaces.refresh()(工作区快照改由 follow 流驱动),插件在该方法缺失时退化为 no-op;ctx.sessions.refresh() 仍存在。workspace/session-active 拒绝归档(不会中断任务),批量归档会跳过这些会话并在控制台记录。English:
unarchiveSession, unpinSession, Workspace.detachSession), with the pre-0.1.7 domain-state path kept as a fallback.sessions/--<slug>--/<id>/ (0.1.5+) and sessions/<slug>/<id>/ (older), matching ids literally and via DSH's encodeSegment rule.ctx.workspaces.refresh() in 0.1.7 by degrading the manual refresh to a no-op.⚠️ 当前插件仍在测试阶段。请先在隔离沙盒、模拟环境或 DSH 测试实例中完整验证,再部署到生产环境或公开发布。
⚠️ This plugin is still in testing. Please validate it in an isolated sandbox, simulation environment, or a DSH test instance before deploying to production or publishing.
dsh plugin --profile web add /path/to/dsh-recycle-bin
安装后重启 DSH Web 生效。
Restart DSH Web after installation.
dsh plugin --profile web add github:qwertyuiop314/dsh-recycle-bin
dsh plugin --profile web remove dsh-recycle-bin
卸载并重启后,回收站入口和批量归档增强会移除。
After uninstall and restart, the recycle-bin entry and sidebar batch-archive enhancement are removed.
<DSH_HOME 或 ~/.dsh>/cache/dsh-recycle-bin/state.json/dsh-recycle-bin/*,不占用其它插件命名空间<DSH_HOME or ~/.dsh>/cache/dsh-recycle-bin/state.json/dsh-recycle-bin/* and do not conflict with other plugins| Part | File | Mechanism |
|---|---|---|
| Host routes | lib/index.js | Registers /dsh-recycle-bin/* routes; manages trash state, unarchive, restore, and permanent purge |
| Browser UI | lib/client.js | Registers the sidebar footer action and recycle-bin panel; adds sidebar batch-archive DOM enhancement |
cordis.patch.yml is the bundle patch layer: it inserts the dsh-recycle-bin row when the bundle is listed in the profile.
<DSH_HOME 或 ~/.dsh>/cache/dsh-recycle-bin/state.jsonsessionId、trashedAt、deletedAt 等元数据,不包含对话正文dsh-recycle-bin/
├── package.json
├── cordis.patch.yml
├── README.md
├── README.en.md
├── lib/
│ ├── index.js # Host: HTTP routes + state + purge/unarchive logic
│ └── client.js # Browser: sidebar entry + recycle-bin panel + batch archive
└── test/
└── plugin.test.mjs # Automated tests
运行测试 / Run tests:
npm test
MIT
本插件同样是人类与 AI 的混合双打产物:需求是人类提的,方向是人类定的,代码的“手”(其实是 token)主要出自模型。
请把它当作一份参考实现来用——就像菜谱:照着做可以,但别指望不粘锅:
说人话:回收站能正常清空是缘,误删能救回来是福;踩坑了一起填,改好了记得回来分享 😄