nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Htao-uu/dsh-archived-chat-cleanup
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A DSH plugin that deletes archived sessions together with their exclusively-referenced attachment objects and derived request-image caches — one reference-aware, journalled, reversible transaction. Install by package name:
dsh-archived-chat-cleanup.
通过 DSH 输入包名安装(推荐):在 DSH 插件管理器里输入 dsh-archived-chat-cleanup,
或使用 CLI:
dsh plugin --profile web add dsh-archived-chat-cleanup
安装/升级后需要重启宿主(模块缓存按包说明符生效)。
从源码安装(本地开发):
dsh plugin --profile web add <插件目录的绝对路径>
DSH stores attachments content-addressed: one object can be referenced by many sessions, so
deleting a session must not blindly delete its attachments. This plugin deletes only archived
sessions, cascades into their subagent child sessions, scans every surviving session for
sha256: references, removes only unreferenced attachment objects, clears the
request-images derived caches, and updates the live indexes through the running services.
Every file move is journalled and reversible, including crash recovery on the next boot.
It ships a Host half (delete_archived_session tool + archivedCleanup Remote namespace) and
a browser half (two rows in the archived session's “…” menu). See the Chinese sections below
for the full behaviour, transaction protocol and test coverage.
删除已归档会话,并按引用关系回收附件实体;整个过程是一个可回滚的事务。 Host 半 + 浏览器半在同一个包里,安装后提供三个入口:会话「...」菜单、模型工具、Remote API。
DSH 的附件是内容寻址的:同一张图被多个会话引用时磁盘上只有一份。
所以"删除会话"不能简单地把附件一起删掉,必须先判断还有没有别的会话在引用。
DSH 自身没有删除会话的 API(sessionPersistence / attachments 都没有 delete),
这些数据只能由插件自己按事务方式落盘删除。
一次删除调用按顺序完成:
workspaceRegistry.archivedSessionIds(界面上的"已归档")里。
非归档会话直接拒绝(session-not-archived)。one 模式整体拒绝(target-live);all 模式跳过该会话及其全部子会话并在结果里报告(skippedLive),绝不删正在写的日志。sha256:<64hex>。attachments/v1/objects/、
文件对象 file-objects/、以及别名目录 files/);<cacheRoot>/request-images 与旧版遗留的 attachments/v1/request-images
整体清掉(按"源对象+请求尺寸"派生,无法精确归属到某个会话,且下次看图会自动重建)。session_projcache 域)、
message_feedback 记录、workspace 归属与归档集合。
索引一律走活着的服务/域,不直接改文件——workspaceRegistry 会在内存里缓存状态,
直接改文件会被它写回(这正是前两次手工清理踩过的坑)。rename 进隔离区(同卷、原子),每步写一次 journal;rolled-back(隔离区清掉,journal 留作审计)。rollback-incomplete 表示恢复不完全,需人工看 journal。unsafe-path 中止。| 入口 | 说明 |
|---|---|
| 会话「...」菜单 | 仅在该会话已归档时显示"删除已归档会话…"(order 500)与"清理全部已归档会话…"(order 501),点两次才执行 |
模型工具 delete_archived_session |
{ mode: "one"\|"all", session_id?, dry_run?, confirm };dry_run:true 只报告计划;真正删除需 confirm:true |
Remote 命名空间 archivedCleanup |
端点 archivedCleanup/status、/preview、/deleteArchived,参数按名字传 { mode, sessionId, confirm } |
ctx.sessionPersistence.root(回退:Loader 配置 / DSH_HOME/sessions)ctx.attachments.root(回退 DSH_HOME/attachments/v1)ctx.attachments.cacheRoot(回退 DSH_HOME/cache/attachments)DSH_HOME/plugin-data/archived-cleanup/(transactions/ journal,reports/ 执行报告)CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: session-management。