rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:cchenxi/dsh-session-delete
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
给 DeepSeek Harness(DSH)加一个会话删除按钮 —— 悬停即现,二次确认,真删文件。
DSH 内置只有「归档」:会话从侧栏隐藏,日志原样留在磁盘。本插件补上缺失的一环——真正把会话从磁盘删掉。
取消 / 永久删除。POST /api/session/delete,Host 删除磁盘文件并返回结果,页面刷新,该会话消失。删除的文件与记录:
| 路径 | 内容 | 处理 |
|---|---|---|
<DSH_HOME>/sessions/<workspace>/<session>/ |
会话完整日志(zstd JSONL,含所有轮次与工具调用) | 删除 |
<DSH_HOME>/storages/session_projcache/sessions/<session>.json |
标题、todos、用量、上下文压力等投影缓存 | 删除 |
<DSH_HOME>/storages/workspace.json 中的 sessionIds |
工作区记账 | 自动摘除(不手改也能自愈) |
不做的事:不动 attachments/(内容哈希去重、跨会话共享),不动 archivedSessionIds / pinnedSessionIds(被删 id 成为无害孤儿,注册表在下次成员写入时剪枝)。
409 session/live):正在写的日志被删会损坏对话,必须先关闭该会话。所以当前打开的这条永远删不掉——这是特性,不是 bug。<DSH_HOME>/sessions 的严格子目录,否则 400 拒绝,防止符号链接 / 手工构造的 id 越界删除。/api 前缀),非 owner principal 一律 403。前置:Node.js ≥ 18 仅用于跑测试;DSH 桌面版或 dsh CLI profile(0.2.2-rc.1 起验证)。
git clone git@github.com:cchenxi/dsh-session-delete.git D:\workspace\repositories\dsh-session-delete
pwsh -File D:\workspace\repositories\dsh-session-delete\scripts\install.ps1
脚本会在 profile 的 plugins\session-delete 建立指向仓库的 junction(目录联接),并打印需要追加到 cordis.patch.yml 的片段。仓库更新后重启 DSH 即生效,无需重新拷贝。
把仓库放到任意目录(例如 D:\workspace\repositories\dsh-session-delete)。
在 profile 的 plugins 下建立联接或直接拷贝:
$profile = "$env:USERPROFILE\.dsh\profiles\desktop"
New-Item -ItemType Junction -Path "$profile\plugins\session-delete" `
-Target "D:\workspace\repositories\dsh-session-delete"
在 <profile>\cordis.patch.yml 末尾追加:
- insert:
- id: session-delete
name: "./plugins/session-delete/lib/index.js"
完全退出 DSH 再打开(托盘 → 退出,确认没有 DeepSeek Harness 进程)。
为什么不放
node_modules:profile 不是 npm 工程,pnpm install会把不在dependencies里的包当 extraneous 清掉;相对路径引用不受影响。
<DSH_HOME>\sessions 下对应目录消失。删除 cordis.patch.yml 里那段 insert,再删掉 plugins\session-delete,重启 DSH。
cd D:\workspace\repositories\dsh-session-delete
node test/plugin.test.mjs
测试不启动 DSH:Host 半侧用 mock ctx(内存 Service 替身)跑通路由、路径闸门、live 拒绝、404/405;浏览器半侧在 node:vm 里执行 bundle,校验 __ModuleLoader__ 注册 id、apply/inject 导出与两个槽位注册。
lib/index.js Host 半侧:Cordis 插件,注册 exact Fetch route,执行删除
lib/client.js 浏览器半侧:__ModuleLoader__.load CJS factory,槽位 + 对话框
依赖的 DSH 公共面(均为插件可用接口,无 monkey patch):
ctx.slots(inject / register)、ctx.locale、@deepseek-ai/dsh-client-ui-primitives(可选:Tooltip / Modal / Button / 图标,缺失时降级为原生元素);ctx.connection.fetch、ctx.sessionPersistence、ctx.sessions、ctx.workspaceRegistry、ctx.effect。MIT © chenxi
dsh-session-delete adds the missing "delete" verb to DeepSeek Harness sessions.
POST /api/session/delete → the Host removes the session's log directory, its projection-cache record, and its workspace accounting slot → the page reloads.Safety: live sessions are refused (409), targets must live under <DSH_HOME>/sessions, and the route is owner-only via the Connection exact-fetch registry.
Install (PowerShell):
pwsh -File scripts/install.ps1
# then append to <profile>\cordis.patch.yml:
# - insert:
# - id: session-delete
# name: "./plugins/session-delete/lib/index.js"
# and restart DSH completely.
Uninstall: drop the insert entry, remove plugins\session-delete, restart.
MIT © chenxi
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek、deepseek-harness。