dsh-session-delete

DSH PLUGIN会话与消息

仓库 nakie-zjm/dsh-session-delete

会话与消息 未标注验证等级 安全审查:未标注 可信度:未标注 可安装插件

为 DeepSeek Harness 侧栏会话行加上永久删除动作,摘除日志与投影缓存,失败安全且无运行时依赖。

一句话选型结论

按资料字段整理

dsh-session-delete 是会话与消息类的 DSH 可安装插件,未做沙盒验证,暂无安全审查结论,列出 5 项功能,没有现成安装命令,需要按仓库 README 接入。验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么;涉及密钥或系统权限的,建议先在隔离环境试装。

分类会话与消息 收录类型可安装插件 验证等级未标注验证等级 安全审查未标注
验证等级 UNKNOWN 未标注验证等级
GitHub 星标 1 复刻 0 · 未关闭 issue 0
最近更新 2026-10-10 创建于 2026-10-09
README 15.6 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
  1. 1
    确认版本与运行环境

    仓库没有标注兼容版本与 Node.js 要求,先确认你的 DSH 版本能装,再继续。

  2. 2
    执行安装命令

    在 DSH 里执行上面的命令;多包仓库要注意区分具体子包名,别装错包。

  3. 3
    确认已挂载

    用 dsh plugin list 查看列表里是否出现这个插件,出现即挂载成功。

  4. 4
    试跑并检查权限

    加载后跑一个最小用例,确认它能正常工作;同时看它申请了哪些文件、命令或网络权限。

兼容 DSH 版本未标注版本不匹配时安装会报错
Node.js 要求未标注来自仓库 package.json 的 engines 字段
前置依赖无需要同时安装的同级依赖
npm 包名未发布到 npm可用 npm view 查看包信息

能做什么

5 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-session-delete:为 DeepSeek Harness 侧栏补上会话永久删除能力

  • 侧栏会话菜单新增永久删除
  • 预检与确认后不可恢复
  • 先隔离重命名再删除
  • 符号链接与身份校验防护
  • 无运行时依赖

上游标签

dsh-plugindsh-plugin-desktopdsh-plugins

验证等级与安全审查

未标注验证等级
自动化流程结论,不是人工审核
验证等级未标注验证等级上游未给出验证结论,安装前请自行确认
安全审查未标注静态分析结论,未标注不代表已通过审查
仓库健康度未标注按仓库活跃度与最近更新时间给出
可信度未标注综合仓库活跃度与验证结果

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 列出了 5 项功能,能直接看出它解决什么问题。

先想清楚的地方

  • 安全审查还没结论,装之前先看仓库改了什么、要什么权限。
  • 没有现成安装命令,要按仓库 README 手动接入。
  • 验证通过不等于安全:插件会读写文件、执行命令或联网,装前先到仓库确认它做了什么。

更适合

  • 需要在会话与消息场景里给 DSH 补能力的人。
  • 能接受在本地装依赖、愿意自己确认权限的人。

不太适合

  • 只使用 DSH 官方内置能力、不接受第三方插件的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
插件验证等级安全审查星标兼容版本安装命令
dsh-session-delete当前 未做沙盒验证 未标注 1 未标注 无
dsh-desktop L3 · 安装规范通过 低风险 3.0 万 未标注 无
openpets L4 · 沙盒安装通过 低风险 1,274 未标注 有
deeptide L4 · 沙盒安装通过 低风险 1,104 0.1.1-rc.2 有
jingyun-dsh L3 · 安装规范通过 低风险 1,004 未标注 有
study-mate 未做沙盒验证 未标注 856 未标注 无

仓库档案

会话与消息
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方nakie-zjm仓库 dsh-session-delete · 默认分支 main
分类会话与消息session
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言JavaScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue1 / 0 / 0收录时的数值,非实时
创建 / 更新2026-10-09 · 2026-10-10最后推送 2026-10-10
本站收录2026-10-09首次进入本站目录的时间

README 全文

15.6 KB
作者原文,中文版优先;只做安全转义,不改内容

@nakie-zjm/dsh-session-delete

中文 | English


中文

给 DeepSeek Harness Desktop加一个会话永久删除动作。

DSH 只提供「归档」:会话日志是 append-only 的,dsh-session-persistence
没有任何删除方法,dsh-workspace 注册表也没有 removeSession。这个插件把
已有的公开服务组合成一个真正的删除操作,并把入口挂到侧栏会话行的 … 菜单里。

安装

包名:@nakie-zjm/dsh-session-delete

方式一:DSH 插件页(推荐,桌面版和 Web 版都适用)

  1. 打开 DSH 的 插件 页面;
  2. 在「添加插件」里填入包名和版本:
@nakie-zjm/dsh-session-delete@0.1.1
  1. 按页面结果操作。桌面版需要完全退出并重启应用——bundle 选择是启动时读取的,
    配置 HMR 不会重新读 profile 的 package.json。

安装器会自动把包加入 profile 依赖、把 bundle 选进 dsh.profile.bundles,包内的
cordis.patch.yml 随层生效,不需要手改任何配置文件。

方式二:dsh plugin 命令行

dsh plugin --profile desktop add @nakie-zjm/dsh-session-delete@0.1.1
dsh plugin --profile web     add @nakie-zjm/dsh-session-delete@0.1.1

官方桌面版的 dsh 命令默认不在 PATH 里,需要先在应用里注册自带的命令
(应用菜单中的 Manage dsh Command…),并在完全退出应用后使用 desktop profile。
从 npm 安装时 --profile 换成你自己的 profile 名。

方式三:不用 dsh plugin 的手动兜底

cd ~/.dsh/profiles/desktop          # 或你的 profile 目录
pnpm add @nakie-zjm/dsh-session-delete@0.1.1

然后在 ~/.dsh/profiles/desktop/package.json 里确认两处(安装器正常情况下会自己写):

{
"dependencies": { "@nakie-zjm/dsh-session-delete": "0.1.1" },
"dsh": { "profile": { "bundles": [ /* …, */ "@nakie-zjm/dsh-session-delete" ] } }
}

重启应用生效。

卸载

dsh plugin --profile desktop remove @nakie-zjm/dsh-session-delete

或在插件页点卸载。卸载只移除插件本身,不会删除任何已有会话。

兼容性

针对 DSH 0.2.0-rc.2 开发与验证。插件依赖下面这些宿主接口,DSH 升级后可能需要跟着更新:

Workspace.detachSession、workspaceRegistry.archiveSession / unarchiveSession / unpinSession、
sessionPersistence.list / resolveCurrentLog、Connection 的 /api exact Fetch 路由注册、
api-session/removed 转发事件、以及客户端插件的 dsh.client 约定与平台种子模块表。

其中只有 resolveCurrentLog 缺失会自动退回布局复刻,其余缺失会降级成警告或明确拒绝,
不会静默删错东西。

行为

只加一个入口:会话行悬停出现的 … 菜单里多一项 永久删除(红色,order 500,
排在归档 400 之后)。不加行内悬停按钮。

  1. 预检:解析会话(先查活动会话,再查持久化列表),并从宿主拿到它真实的日志位置,
    同时把「能不能安全删」全部判完——这一段有任何拒绝都发生在改动任何状态之前;
  2. 确认对话框:显示会话标题和不可恢复的提示,取消不做任何写入;
  3. 确认后:
    - 会话若还在跑回合:先经注册表自己的归档准入接缝(archiveSession({stopActivity:true}))
    停掉这些工作,并把借用的归档标记恢复原状(本来没归档就收回,本来就在归档集合里
    就保留),然后才继续;
    - 从工作区记账中摘除(Workspace.detachSession,会持久化并推送变更);
    - 从归档集合、置顶集合中摘除;
    - 永久删除会话日志目录与投影缓存文档;
    - 发出 api-session/removed,浏览器会话列表立即去掉这一行。

不可恢复。 没有回收站、没有备份、没有撤销。

永久删除怎么做到失败也安全

直接 rm -rf 会在中途失败时留下半棵目录树,而 DSH 下一次启动仍会把它当成会话读。
所以删除走两步隔离:

rename(会话目录 → ~/.dsh/sessions/.dsh-session-delete-<随机>/<会话id>/)   ← 同卷,原子
→ 重新 lstat 校验身份(dev/ino/birthtimeNs 与改记账前一致;目录 size 会随内容
变化,不算身份)
→ rm(隔离目录, recursive, force:false)
→ 再 stat 一次确认真的没了
  • 身份对不上(删除期间被换掉):放回原位,什么都不删,报 unsafe-location;
  • rm 中途失败:报错并告知隔离目录的完整路径,~/.dsh/sessions/ 下不会留下会被误读的目录,只会留下一个 .dsh-session-delete-* 待你处理;
  • 全部成功才清理隔离目录本身。测试断言:删除完成后 .dsh-session-delete-* 一个不剩。

位置与安全

  • 位置来自宿主:会话目录优先取 sessionPersistence.resolveCurrentLog(id) 的答案,
    只有后端答不出来时才退回本插件对布局的复刻(复刻有测试对着真实目录逐条核对)。
    后端答案必须满足 /<项目目录>/<会话id>/transcript 的形状,否则拒绝。
  • 符号链接防护:删除前用 lstat + realpath 证明目标是真目录、父目录就是
    ~/.dsh/sessions/ 下的项目目录、且解析后仍在 sessions 根内(harness home 本身
    经符号链接 / junction 到达时两边都按解析后的路径比较,不会被误判成越界)。指向别处
    就拒绝——测试会造一个 junction 指向根外目录,断言拒绝并且目标文件完好无损。
  • 拒绝不留副作用:身份检查、位置检查、运行中检查都排在第一次持久化写入之前。
    任何拒绝之后,会话仍然在工作区原位、仍然在原有归档/置顶状态,日志一个字节没动。
  • 请求加固:只接受 POST + application/json;浏览器请求必须同源且带
    x-dsh-session-delete-confirmation: delete-session(链接和 HTML 表单设不了自定义头,
    所以跨站导航打不到这个分支;同源判定是 Origin 与请求自身 Host 的主机名比对,
    http 或 https 都算);会话 id 必须匹配 [A-Za-z0-9_-]{1,128};请求体先查
    content-length、再核对读到的长度,超过 8 KiB 直接 413。无 Origin 的原生调用方
    (CLI / Agent 直接 POST loopback)由宿主信任栅栏认证,不需要那个头。

已知边界

  • 正在运行的会话:插件会先停掉它的回合再删。停不下来(宿主没提供归档准入接缝,
    或者停完仍是 live)才拒绝,返回 session-delete/running(HTTP 409),并且此时
    一个文件都没动,归档状态也和删除前完全一样:本来没归档的仍然没归档,把它的工作
    停掉再重试即可;本来就在归档集合里的会保持归档,需要先去侧栏的「显示已归档」筛选里
    取消归档再重试。当前正在对话的这个会话通常属于这一类(它始终 live)。
  • 会话的图片/文件附件是内容寻址的全局存储,其它会话可能共享,所以删除不动
    ~/.dsh/attachments。这会留下孤儿字节,但不会误删别人的数据。
  • 清理中途失败:工作区记账摘除之后,文件步骤(改名 / rm)仍可能失败。此时会话
    已经不属于任何工作区(侧栏刷新后行会消失),磁盘上可能留下 .dsh-session-delete-*
    隔离目录或投影缓存文档;错误信息会说明失败原因(已隔离的会给出隔离目录完整路径),
    重试一次通常能删干净,也可以按路径手工清理。
  • session_projcache 的内存表保留该会话那一行直到重启;磁盘文档已删除,且没有
    日志的会话不会再被水合,所以不影响使用。
  • 删掉就没了。要保留内容,请先用官方的 /export 命令导出一份 ZIP。
  • 与 dsh-session-delete(vtxf 的
    同名插件)不能同时装:两者都注册 sidebar.workspaces.session.menu.item,菜单里会
    出现两个删除项。它侧重目录级批量归档/删除,本插件侧重单会话删除的失败安全与
    运行中会话的处理。

开发

仓库根就是包根。产物只有 lib/client.js 一个文件:

dsh-session-delete/
package.json        main → src/index.js、./client → lib/client.js、dsh.bundle.patch
cordis.patch.yml    bundle 补丁层:插入一行 Loader entry
src/index.js        宿主半(源码 = 产物:删除编排 + /api/session.delete 路由)
src/client.js       浏览器半源码:工厂体,用 require/exports/module
lib/client.js       浏览器半产物:build-client.mjs 套上 lazy-CJS 外壳
scripts/build-client.mjs  唯一的构建步骤;--check 校验产物是否过期
test/host-half.mjs        宿主半端到端(临时 DSH_HOME,真删文件)
test/browser-half.mjs     浏览器半(在 Node 里物化 lib/client.js,桩掉 React 与 fetch)
test/verify-endpoint.mjs  对运行中的实例核对路径推导与可达性
test/deployment-check.mjs 对 verify-endpoint 的回归(桩宿主:404 已挂载 / 报错要说清 URL)

宿主半不需要构建:DSH 的 Loader 用 import 加载它,main 直接指向 src/index.js。

浏览器半需要构建:DSH 只服务一个文件(exports["./client"]),它必须自己调用
window.__ModuleLoader__.load({ id, factory }),而模块表没有相对加载器,所以外壳
不能写进源码再 import。外壳由 scripts/build-client.mjs 套上——源码保持可读,产物
可复现(npm run build:check 校验产物是否过期)。

npm run build     # 生成 lib/client.js
npm test          # 宿主半 75 项 + 浏览器半 47 项 + 部署检查 2 项
npm run verify    # 对运行中的 DSH 实例核对(需应用在跑)
npm run check     # build:check + test,prepublishOnly 会自动跑

npm run verify 不依赖任何机器相关的写死路径:harness home 走 DSH_HOME(默认
~/.dsh)经插件自己的解析器,base URL 依次取命令行参数、DSH_WEB_URL、
再依次探测 19387 / 3000 / 8080 / 8000 / 5173。它只能确认「根目录存在 + 有 DSH 宿主
在跑」;无法判断路由是否挂载——未认证请求会被信任栅栏统一挡成 401,无论路由
在不在。要判定挂载,请用它在 Web UI 控制台里打印的那条已认证 fetch。

本包没有任何运行时依赖:客户端只用平台种子模块表里的
react、react/jsx-runtime、@deepseek-ai/dsh-client-store、
@deepseek-ai/dsh-client-ui-primitives。

许可

MIT


English

Adds one permanent session delete action to DeepSeek Harness (Desktop and Web).

DSH ships archive only: the session log is append-only, dsh-session-persistence
exposes no delete, and the Workspace registry has no removeSession. This plugin
composes the existing public services into a real delete and mounts the entry in
the sidebar session row's … menu.

Install

Package name: @nakie-zjm/dsh-session-delete

Plugins page (recommended): open DSH → Plugins, then add
@nakie-zjm/dsh-session-delete@0.1.1. The installer adds the profile dependency,
selects the bundle in dsh.profile.bundles, and the package's own
cordis.patch.yml applies as a layer — no configuration file is edited by hand.
Desktop requires a full app restart, because bundle selection is read at startup.

CLI:

dsh plugin --profile desktop add @nakie-zjm/dsh-session-delete@0.1.1
dsh plugin --profile web     add @nakie-zjm/dsh-session-delete@0.1.1

The official Desktop build does not put dsh on PATH; register the bundled
command first (Manage dsh Command… in the app menu) and use the desktop
profile after fully quitting the app.

Manual fallback: in ~/.dsh/profiles/, run
pnpm add @nakie-zjm/dsh-session-delete@0.1.1, then confirm the name appears in
both dependencies and dsh.profile.bundles of that profile's package.json.

Uninstall: dsh plugin --profile desktop remove @nakie-zjm/dsh-session-delete,
or use the Plugins page. Uninstalling never deletes existing sessions.

Compatibility: built and verified against DSH 0.2.0-rc.2.

Behaviour

One entry only: a red Delete permanently row (order 500, after archive at 400)
in the session row's … menu. No hover button.

Every check that can refuse — identity, location, and whether the session is
running — runs before the first durable write, so a refusal leaves the session
exactly as it was. Confirming then stops a running turn through the registry's own
archive admission seam (putting the borrowed archive marker back exactly as it
was — cleared if it was not set, kept if it was), detaches the session from its
Workspace, drops it from the archive and pin sets, removes its log directory and
projection cache, and emits api-session/removed so the browser list drops the row.

There is no undo. No trash, no backup. Export with /export first if you want
to keep the transcript.

The recursive removal is staged: the session directory is renamed into a
quarantine directory beside its project directory, its identity (dev/ino/
birthtimeNs — directory size changes with content, so it is not identity) is
re-checked there, and only then removed — so a failed removal can never leave a
half-deleted tree where DSH would read it as a session.

Safety

  • The directory comes from sessionPersistence.resolveCurrentLog(id); the plugin's
    own replica of the layout is only a fallback.
  • lstat + realpath prove the target is a real directory inside the sessions
    root before anything is removed; both sides of that comparison are resolved, so a
    harness home reached through a symlink or junction is not mistaken for an escape,
    while a junction pointing outside is still refused.
  • The route accepts POST + application/json only, requires a same-origin browser
    request (Origin matching the request's own Host, over http or https) carrying
    x-dsh-session-delete-confirmation, pins the session id to
    [A-Za-z0-9_-]{1,128}, and checks the body length before parsing it.
  • Attachments under ~/.dsh/attachments are content-addressed and shared, so they
    are never touched.

Known limits

  • A session whose turn will not stop is refused with session-delete/running
    (HTTP 409) and no file is touched. Its archive state is exactly what it was before
    the attempt: one that was already archived stays archived (unarchive it from the
    sidebar filter before retrying), and an unarchived one just needs its work stopped
    before the retry.
  • A failure mid-cleanup: after the workspace accounting is removed, the file step
    (rename / rm) can still fail. The session is no longer in any workspace (the row
    disappears after a refresh) while a .dsh-session-delete-* quarantine directory or
    the projection cache document may remain on disk; the error explains what failed
    (naming the quarantine path when one was left), a retry usually finishes the
    cleanup, and the leftover can also be removed by hand.
  • Cannot be installed alongside
    dsh-session-delete (vtxf's
    plugin): both register the same menu slot, so the menu would show two delete rows.

Development

npm run build     # regenerate lib/client.js
npm test          # host half (75 checks) + browser half (47 checks) + deployment check (2)
npm run check     # build:check + test — also runs on prepublishOnly

No runtime dependencies: the browser half uses only platform seed modules.

License

MIT

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
dsh-session-delete 怎么安装?

本站没有抓到该条目的安装命令,请到仓库主页确认安装方式;这类条目多数是生态应用或尚未发布安装包的项目。

dsh-session-delete 的验证等级是什么意思?

未标注验证等级。上游未给出验证结论,安装前请自行确认

dsh-session-delete 安全吗?

未标注。

dsh-session-delete 装之前要先确认什么?

先看它会读写哪些文件、执行哪些命令、连接哪些网络地址;验证等级只说明装得上、跑得起来,不等于安全。涉及密钥或系统权限的,建议先在隔离环境试装。

dsh-session-delete 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-session-delete 有哪些功能?

侧栏会话菜单新增永久删除、预检与确认后不可恢复、先隔离重命名再删除、符号链接与身份校验防护、无运行时依赖。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

同名或近似条目

8 条
不同作者的仓库分开列,请确认你要装的是哪一个
会话与消息
按星标排序,可作替代方案

dsh-desktop

dsh-desktop

为 DeepSeek Harness (DSH) 插件生态打造的现代化桌面端解决方案。万物皆「插件」,桌面本身也是「插件」。

L3 · 安装规范通过 3.0 万 星

openpets

openpets

L4 · 沙盒安装通过 1,274 星

deeptide

deeptide

L4 · 沙盒安装通过 1,104 星

jingyun-dsh

jingyun-dsh

井云 DSH 客户端插件,为 DeepSeek Harness 注入会员登录、订阅支付、算力管控与应用市场,让智能体和技能快速变成可交易商品

L3 · 安装规范通过 1,004 星

study-mate

study-mate

StudyMate 是 DSH 的「学习模式」预设与技能包,为数学、计算机科目定制学习路线、讲解课件与练习评估,跨科目共享记忆。

未标注验证等级 856 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 —。