DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-plugin-process-cleanup

z

dsh-plugin-process-cleanup

Manifest valid

Tidy temp files after a DSH task: delete or move them into .dsh-trash. DSH task cleanup: clean up the round's process files, delete them directly or move them into the trash directory.

UI (client)hasBundlePatchMachine translated

dsh-plugin-process-cleanup

任务收尾清理:在会产生文件的任务里提醒模型先清理过程文件,再给出最终答复。

开关是会话级的:每个会话在输入框左侧有自己的开关,默认关闭;打开只影响当前会话,不会让别的会话也清理。设置里的是全局配置(清理方式、新会话是否默认开启)。

插件自己不判断、不删文件。它把清理准则加入系统提示词,并在写文件类的工具调用之后追加一条通知类提醒;模型在同一个回合里、给出最终答复之前完成判断与清理。清理动作由模型通过会话正常的 shell 工具执行——沙箱、审批、审计仍然生效。

设计要点:插件不会在最终答复之后再追加一步模型动作。那样会把真正的答复挤进折叠的过程区、让清理消息变成界面上的“最终答复”。现在提醒只出现在过程里,最后一条助手消息始终是用户的答复。

两个位置

  • 设置 → 通用(全局):清理方式(移到回收目录 / 直接删除)和「新会话默认开启」。只决定新会话的初始状态,不改动已打开的会话。
  • 输入框左侧的扫帚图标(当前会话):本会话开关,默认关;只影响当前会话。

配置

字段默认说明
defaultEnabledfalse新打开的会话是否默认开启收尾清理。
modetrashtrash 移到工作区 .dsh-trash/<会话>/turn-<轮次>/;delete 直接删除。
skipSubagentstrue子代理会话不单独提示,由父会话统一处理。

会话开关保存在 Host 进程内,随会话关闭而清除;重启后所有会话回到「默认关闭」(或全局默认)。

触发条件

满足以下条件时,插件会在工具调用之后追加一次提醒:

  1. 当前会话的开关打开;
  2. 调用的是 write / edit / pwsh / bash / 子代理类工具(写文件/改文件每次提醒;shell 与子代理每回合最多一次);
  3. 是根会话(子代理默认跳过);
  4. 没有进行中的目标(goal 处于 active / paused / blocked 时跳过,complete 后照常提醒);
  5. 本轮不是失败的写入。

系统提示词里的常驻准则只在满足 1、3、4 时出现。

安全边界

  • 模型先判断“任务是否完成”,未完成时保留,不做清理。
  • 提示词要求只操作工作目录内的精确路径,禁止通配符,禁止工作目录之外的内容。
  • 交付物、用户已有文件、源码、配置、依赖、.git 一律保留;不确定时保留并列出让用户确认。
  • trash 模式只移动不删除,需要时可以从 .dsh-trash/ 取回;插件不会自动清空回收目录。
  • 删除被拒绝或文件被占用时,模型列出未处理文件后结束,不重试。

实现说明

会话开关没有生成的 Remote 可用(本地 bundle 没有 Typert 代码生成),所以 Host 在 /process-cleanup/session 暴露一个仅回环可用的前缀路由:GET ?id=<sessionId> 读取,POST {sessionId, enabled} 写入,写入必须带 x-process-cleanup-ui: 1。客户端设置行仍通过 ctx.configForms 读写全局配置;提醒通过 tools/post-execute 的 additionalContexts 注入,来源为 process-cleanup 通知。

开发

node test/policy.test.mjs   # 纯文案与路径规则
node test/host.test.mjs     # 提醒门控、会话隔离、路由(假 ctx / 假 agent)

纯函数在 policy.js,Host 接线在 index.js,Web 两处在 client.js。

Comments

Loading…

Similar plugins

dsh-session-hygiene

by liudapeng0311

Delete sessions into a recoverable trash, clean up sessions orphaned by deleted workspaces, and group workspaces into categories. A DSH plugin.

Manifest valid

★ 0

MIT

JavaScript

Nov 9, 2026

dsh plugin --profile web add dsh-session-hygiene

by strikesuitzero

Moves the DSH temp cache to a configurable directory and cleans it with an allowlist; manages archived sessions and workspace temp folders. Bilingual (EN/ZH). MIT.

Manifest valid

★ 0

MIT

JavaScript

Nov 9, 2026

dsh plugin --profile web add dsh-cache-cleaner

by xxiiiixx

Workspace Tmp for DeepSeek Harness: gives the agent a temporary directory beside the workspace for test files and scratch output, with a workspace_tmp tool and automatic deletion, so nothing pollutes

Manifest valid

★ 0

MIT

JavaScript

Oct 19, 2026

dsh plugin --profile web add dsh-workspace-tmp

by hongdougao111

DSH 归档会话清理:把已归档的会话移进可还原的回收站,或彻底删除。

Development & InfrastructureSessions & MessagesManifest valid

★ 4

MIT

JavaScript

Nov 12, 2026

dsh plugin --profile web add dsh-archive-trash

by yezitotempeace

保证 /tmp 清理守护进程常驻:进程内看门狗自动复活 + 兜底清理,附设置页(状态/配置/清理/演练)

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Oct 20, 2026

dsh plugin --profile web add dsh-tmp-cleaner

by Trisia

Stop leaving DSH to make a temp folder. One-click throwaway workspaces with optional cleanup · 告别手动建目录,DSH 一键临时工作区,删除可控

Manifest valid

★ 0

MIT

TypeScript

Oct 20, 2026

dsh plugin --profile web add @cliven/dsh-tmp-wks