DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-workspace-tidy

d

dsh-workspace-tidy

Manifest valid

Workspace tidy-up plugin: moves stray temp files, render leftovers and generated scripts into a hidden .dsh folder at the end of each turn, keeping the workspace root clean without blocking or deletin

hasBundlePatch

dsh-workspace-tidy

把工作区里生成的过程文件(脚本、临时文件、渲染残留)统一收进一个隐藏目录 .dsh\,保持工作区根目录干净。只移动、不删除,每次移动都写日志,可回滚。

工作方式

插件是 Host-only bundle,没有界面,安装后自动运行:

时机触发事件收什么
每轮回复结束agent/turn-stopping临时残留:*.tmp、*.log、*.bak、*.orig、~$*、.dsh-*、.dsh-office-*
会话结束session/disposed上面全部 + 生成的脚本(*.py、*.ps1、*.sh、*.bat、*.cmd),脚本需静置 30 秒
会话创建 / 插件启动 / 每 10 分钟session/created、apply、interval上面全部;脚本只收 12 小时前的旧文件
任意时机目录__pycache__\、.pytest_cache\ 整目录移入 .dsh\tmp\cache\

收纳位置:

.dsh\
├─ office\           .dsh-office-* 渲染残留
├─ tmp\              临时文件、日志、日志备份
│  ├─ scripts\       生成的脚本
│  └─ cache\         __pycache__ 等缓存目录
└─ tidy-log.jsonl    每次移动的 JSONL 记录

保护措施:

  • 只处理 120 秒内没有写入的文件,正在写的文件不会被搬走。
  • 根目录的目录不会被碰(.dsh-office-*、__pycache__ 除外)。
  • 符号链接跳过;AGENTS.md、README.md、清理DSH临时文件.ps1、修复-DSH插件更新.ps1 永不移动。
  • 工作区是 git 仓库时,被 git 跟踪的文件(git ls-files)永不移动——生成脚本常被提交,误搬会破坏仓库状态。
  • 单条移动失败(文件被占用、权限不足)只记录到日志的 failed,同轮其它条目继续处理。
  • 跨盘移动(EXDEV)自动退化为复制后删除。
  • 目标重名自动加 -2、-3,不覆盖已有文件。
  • 默认 dryRun: false;改成 true 只记日志不落盘。

安装

从 npm 安装(推荐,预构建、无需 git 构建授权):

pnpm dsh plugin --profile <profile> add dsh-workspace-tidy

或从 GitHub 安装(跟随 main 最新提交):

pnpm dsh plugin --profile <profile> add github:dengwei84/dsh-workspace-tidy

也可以在 dshmarket 里搜索「工作区自动整理」——本插件已收录(2026-11-14), 详情页 https://awesome-dsh-plugin.com/p/dengwei84/dsh-workspace-tidy/。 npm 页面:https://www.npmjs.com/package/dsh-workspace-tidy。

本地开发时用目录安装(链接形式,改完 index.js 在插件管理里关再开一次即可生效):

# 或在会话里让代理调用 plugin_manager install_bundle,target 传包目录的绝对路径
pnpm dsh plugin --profile <profile> add "D:\AI\DeepSeek\_过程\04-脚本工具\dsh-workspace-tidy"

卸载:

pnpm dsh plugin --profile <profile> remove dsh-workspace-tidy

验证

node --test "D:\AI\DeepSeek\_过程\04-脚本工具\dsh-workspace-tidy\test\"

6 个用例覆盖:每轮只收临时残留并保护脚本与 keep 名单、会话结束只搬静置 30 秒以上的脚本、 git 跟踪的脚本不动、单条失败不影响其余条目、maxEntries 先筛候选再截断、dryRun 只记日志。 test\verify.mjs 是更早的手工冒烟脚本,保留作参考。

包内文件:

  • package.json:dsh.bundle.patch 指向 cordis.patch.yml
  • cordis.patch.yml:insert 一个 id 为 workspace-tidy 的 row
  • index.js:插件本体
  • locale\{en,zh}.json、icon.svg:插件列表里的名称、说明与图标

配置

在 profile 的 cordis.patch.yml 里给这个 row 加 config,或安装时由调用方传入:

- insert:
    - id: workspace-tidy
      name: dsh-workspace-tidy
      config:
        target: .dsh
        minAgeSeconds: 120
        scriptMinAgeSeconds: 30
        scriptMinAgeHours: 12
        skipGitTracked: true
        intervalMinutes: 10
        dryRun: false
键默认说明
target.dsh收纳目录,相对工作区根目录
junkPatterns见上表每轮收的临时文件 glob
officeDirs.dsh-office-*整目录收的渲染残留
cacheDirs__pycache__、.pytest_cache整目录收的缓存
scriptPatterns.py/.ps1/.sh/.bat/.cmd会话结束才收的脚本 glob
keepAGENTS.md、README.md、清理DSH临时文件.ps1、修复-DSH插件更新.ps1永不移动的文件名
minAgeSeconds120文件至少静置多久才收
scriptMinAgeSeconds30会话结束时脚本至少静置多久才收
scriptMinAgeHours12启动扫描时脚本至少多旧才收
skipGitTrackedtrue跳过 git 跟踪的文件
dryRunfalse只记录不移动
maxEntries500每轮最多处理的候选条目
intervalMinutes10活跃会话的周期扫描间隔,0 关闭

回滚

.dsh\tidy-log.jsonl 每行是一次移动:

{"at":"2026-11-13T06:00:00.000Z","mode":"turn","root":"D:\\AI\\DeepSeek","dryRun":false,
 "moves":[{"from":"D:\\AI\\DeepSeek\\out.tmp","to":"D:\\AI\\DeepSeek\\.dsh\\tmp\\out.tmp"}],
 "failed":[]}

把所有 to 移回 from 即可恢复;某一行只想撤销一部分时按 moves 逐条处理。

$lines = Get-Content ".dsh\tidy-log.jsonl" | ForEach-Object { $_ | ConvertFrom-Json }
foreach ($line in $lines) {
  foreach ($m in $line.moves) {
    if (Test-Path -LiteralPath $m.to) { Move-Item -LiteralPath $m.to -Destination $m.from -Force }
  }
}

边界

  • 不删除任何文件;清理 .dsh\ 由用户或收尾脚本决定。
  • 不处理工作区外的路径;只扫描会话工作区根目录第一层。
  • 与 Windows 计划任务 DSH-DeepSeek-Process-Tidy 作用重叠,安装插件后应 -Unregister 该任务,避免两边同时搬同一批文件。

发布

想进 DSH 插件市场(dshmarket)看 PUBLISH.md:市场没有上传入口, 收录方式是公开仓库 + 向 awesome-dsh-plugin 提一个 data/plugins/<owner>__<repo>.yml(模板见 market-entry.yml)。

License

MIT,见 LICENSE。

Comments

Loading…

Similar plugins

dsh-plugin-process-cleanup

by zh-Littlebird

Tidy temp files after a DSH task: delete or move them into .dsh-trash. DSH 任务收尾清理:清理本轮过程文件,直接删除或移入回收目录。

Manifest valid

★ 0

MIT

JavaScript

Nov 8, 2026

dsh plugin --profile web add dsh-plugin-process-cleanup

by s0meb0dy3

Creates a throwaway workspace with its own folder and session, manages running ones from a sidebar panel, and moves finished folders to the system Trash.

Development & InfrastructureSessions & MessagesManifest valid

★ 3

↓ 1.2k/wk

MIT

JavaScript

Oct 31, 2026

dsh plugin --profile web add @s0meb0dy3/dsh-scratch-workspace

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 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

by Rainier-Z

A DeepSeek Harness plugin that periodically detects added, modified, and deleted files in a workspace and reports the changes.

Workflow & AutomationDevelopment & InfrastructureManifest valid

★ 2

↓ 125/wk

MIT

JavaScript

Sep 27, 2026

dsh plugin --profile web add dsh-workspace-monitor

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