nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:KissBlank/dsh-session-manager
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
为 DSH(DeepSeek Harness)补上会话的「彻底删除」和一份集中管理的控制台。DSH 自带的「归档」只是把会话从列表里藏起来;这个插件把残留一起清掉,并提供一个可以筛选、排序、批量清理的页面。
Purge DSH Sessions for good — and manage them from one console: filters, search, sort, bulk delete, with explicit guards before anything running gets killed.

@kissblank/dsh-session-managerdsh >= 0.2.0-rc.1 < 0.3.0-01. 会话菜单里的「彻底删除…」
点开任一会话行的菜单,最下面一行(垃圾桶图标、红色、上方有分隔线)可以删除这一个会话,删除前有确认弹窗。
2. 侧边栏「会话管理」控制台
侧边栏图标栏(「插件」「自动化任务」那一列)新增一个「会话管理」入口,点开是大尺寸独立页面:
已选 N 个、全选当前结果、批量彻底删除;3. 控制台右上角 ⋯ 的清理菜单
workspace.json.bak-*)里如果还留着已经删掉的会话 id,把它抹掉——文件保留,只去掉失效的 id;同时把活动记录(workspace.json 的归档/置顶集合)里指向已删会话的 id 一并清掉。两项分开计数:重写了几份备份、从活动记录里清掉几个 id,只做了其中一项时也只报那一项。三者都不会碰活着的会话:缓存清扫逐条比对仍在磁盘和内存里的会话,目录清扫只在目录确实为空时才删,备份清扫只删「宿主已经不认识的 id」。删除单个会话时不会顺带做这三件事——它们由你手动触发。
<DSH_HOME>/sessions/<工作区>/<会话 id>/,父会话与每个子会话各一份;storages/session_projcache 下的缓存文件,以及它们遗留的逐条备份(<会话 id>.json.bak.<时间戳>)。删除前会先让宿主把写缓冲落盘并释放文件句柄,避免 Windows 上「文件仍被占用」导致删一半;真遇到删不掉的目录,接口会把它列在 leftovers 里而不是假装成功。子会话关系读不到时(宿主的两份会话清单互相矛盾),会回落到直接读日志目录;两份都读不到才标记 descendantsUnresolved,控制台会把这批算作「有文件未删净」而不是干净删除。日志目录本身读不出来时标记 directoriesUnresolved,同样按「有文件未删净」提示。
删除后还会尽力清掉其他插件写在 <DSH_HOME>/storages 与 <DSH_HOME>/<插件目录>/*.json 里的会话引用(例如 dsh-context 的 overview 缓存、dsh-claude-style 的用量记录);如果某个插件把缓存放在别处,那一份需要它自己刷新。
不会删:工作区里的代码与文件、其他会话、fork 出来的分支会话、跨会话共享的附件库、任何设置与凭据。
没有回收站——删了就是删了。磁盘未分配空间与你自己做的外部备份不在插件控制范围内;宿主自己保留的 workspace.json.bak-* 备份里的残留 id,可以用上面「清理陈旧备份」抹掉。
在插件管理器的安装入口填下面任一写法:
@kissblank/dsh-session-manager(可锁版本:@kissblank/dsh-session-manager@1.0.6)github:KissBlank/dsh-session-manager(可锁 tag:github:KissBlank/dsh-session-manager#v1.0.6)1.0.0 起仓库名与 npm 包名统一为 @kissblank/dsh-session-manager,版本号也从 1.0.0 重新开始(更早的 0.x 版本与试验用的包名均已下线)。
装好(或换过包名)之后重启 DSH 桌面端,刷新页面不够——新装的插件要等宿主重新启动才会被加载。之后日常修改本仓库代码时,只改界面刷新页面即可,改到宿主侧逻辑则仍需重启。
删除要动的是宿主自己的数据,所以本插件用到了几个宿主提供的接口:sessions.store 里每个条目的 detach()、sessionProjectionCache.table 的 keys()/delete()、workspaceRegistry 实体的 detachSession()/unarchiveSession()/unpinSession()、sessionPersistence.root 与 flush()、以及 sessionQuery.listSessions()。这些都按 dsh 0.2.1-rc.5 实测行为实现,宿主升级后如果这些接口的形状变了,插件可能静默降级(例如缓存清扫返回 projection-cache-unavailable)。删目录这一步始终只依赖文件系统,不受影响。
个人与组织内部使用免费:可以安装、使用、为了自用改源码。未经作者事先书面许可,不得再分发本插件、也不得发布修改版或 fork(为提交 PR 而建的 fork 可以,但不能单独对外发布),不得用于付费产品/服务,不得删除署名与版权声明。商业使用或二次发布请先联系作者。完整条款见 LICENSE。
⋯ menu in the console: clear projection-cache records whose Session is gone, remove empty sessions/<project>/ folders, and scrub dead Session ids out of stale workspace.json.bak-* backups and out of the live archive/pin sets. None of the three can touch a live Session — ids are compared against the Sessions still on disk and in memory, a folder is removed only after an empty listing, and every id the Host still knows is kept. The backup sweep counts the two halves separately (files rewritten, ids dropped from the live records) and reports only the half that did work.It stops the Session (its running turn and backend jobs, up to 3 s of settling), drops it from every window's list immediately, detaches it from each Workspace and clears its archive/pin records, follows its sub-agent Sessions to any depth and deletes those too, removes every log directory under <DSH_HOME>/sessions/<project>/<id>/, and deletes the projection-cache records and per-record backups (<id>.json.bak.<stamp>) of the whole family. A forked branch is a Session in its own right, not a sub-agent, so it is never carried away with its source.
The Host is flushed before anything is unlinked, so Windows does not fail on a file still held open; a directory that could not be removed is reported back in leftovers instead of being counted as deleted. When the child lookup cannot answer — the Host's live and persisted corpora disagree about one Session — the raw persistence listing is used instead; only if both fail is the family marked descendantsUnresolved, and the console counts that batch as leaving files behind rather than reporting a clean sweep. A sessions root that cannot be listed is marked directoriesUnresolved and treated the same way. After the removal, best-effort scrubbing also drops the deleted ids from JSON caches other plugins keep under <DSH_HOME>/storages and <DSH_HOME>/<plugin>/*.json; a plugin that stores its cache elsewhere has to refresh it itself.
Workspace files, other Sessions, forked branches, the shared attachment store, settings and credentials are not touched. There is no trash: deletion is final, and stale ids left in Host-owned workspace.json.bak-* backups or in the live archive/pin sets can be scrubbed from the same ⋯ menu.
If any selected Session is running, the dialog says how many, and its red confirm button stays disabled until you tick “I understand these running tasks will be interrupted”. More than 10 selections additionally require “I understand this cannot be undone”. Progress is reported per Session (“Stopping tasks (i/n)”), failures are collected instead of aborting the batch, and the sidebar refreshes once at the end.
Install through the plugin manager with any of these specs: @kissblank/dsh-session-manager (pin with @1.0.6), github:KissBlank/dsh-session-manager (pin with #v1.0.6), or a local absolute path. Then restart the DSH desktop app — a page reload is not enough, because the Host decides which plugins the browser loads when it starts. Afterwards, while working on this repository, UI changes come alive on a page reload and Host-side changes need a restart.
Deleting touches the Host's own data, so this plugin reads a few interfaces the Host exposes: detach() on each sessions.store entry, keys()/delete() on sessionProjectionCache.table, detachSession()/unarchiveSession()/unpinSession() on a workspaceRegistry entity, sessionPersistence.root and flush(), and sessionQuery.listSessions(). All of it is implemented against dsh 0.2.1-rc.5 as measured; if a later Host changes those shapes the plugin degrades instead of crashing (a cache sweep reports projection-cache-unavailable). Removing directories only relies on the filesystem and is unaffected.
Free for personal and internal use: install it, use it, modify it for yourself. You may not redistribute the plugin, or publish a modified version or fork, without the Author's prior written permission (a fork opened to send a pull request is fine, but must not be published on its own); you may not use it in a paid product or service, and you may not strip the attribution or copyright notice. Contact the Author first for commercial use or redistribution. The full terms are in LICENSE.
© 2026 Kiss_Blank — all rights reserved, see LICENSE
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: session。