DSH Plugins Marketplace

DSH Plugins

Plugins

/

Workflow & Automation

/

dsh-waitiforud

d

dsh-waitiforud

Manifest valid

In a folder that has already been used for a task, the model still reads its contents when the next task starts, which can mix up the context, add thinking overhead and spend extra tokens. This plugin

hasBundlePatch

@local/waitiforud — D 盘「轮换工作区」插件(多槽位版)

License: MIT

在 D 盘根目录常驻三个空槽位 waitiforud1、waitiforud2、waitiforud3,一起置顶在 DSH 工作区列表最上方。用户在任意一个里干活;哪个被用过,任务一结束就按摘要把它改名归档, 并立刻补建一个同名的空槽位,三个槽位重新按 1、2、3 置顶。

一轮的完整流程

步骤发生什么由谁触发
1`D:\waitiforud12
2用户挑一个槽位干活,产物写在里面用户
3模型在回合最后调 waitiforud(action="name", title="摘要") 上报归档名系统提示里的约定驱动模型
4回合收尾(agent/turn-stopping):把当前工作目录所在的那个槽位改名为 摘要插件
5立刻重建同名的空槽位(waitiforud2 被改名就补 waitiforud2)插件
6三个槽位重新按 1、2、3 置顶插件

没上报名字也能跑:命名依次退回「会话标题 → 文件内容线索 → 任务-YYYYMMDD-HHMM」。

工具 waitiforud

action作用
status列出三个槽位各自状态、在工作区排第几、若现在轮换会叫什么名、上次改名结果
ensure只建目录 + 登记置顶,不改名(可带 slot)
name只登记本轮结束时要用的归档名,不立刻改名;回合结束时自动落地(推荐用法)
rotate立刻改名 + 补建同名空槽位 + 置顶(调试或手动强制时用)

参数:slot(省略时按当前工作目录自动识别,识别不到用第一个)、title(≤20 字,自动清洗)。

归档名优先级

  1. 模型通过 action="name" 上报的 title
  2. DSH 自动生成的会话标题
  3. 槽位里的文件内容线索(Markdown 标题 > 首个短行 > 文件名;最近 6 小时改过的加分)
  4. 任务-20261116-2250

所有名字都会过一遍清洗:去掉 \ / : * ? " < > | 与控制字符、折叠空格、去掉首尾点和空格、 避开 CON/NUL/COM1 等保留设备名、按字符截断到 20 字(中文一个字算一个)。 重名自动加 -2、-3。

部署

0. 先拿到代码

克隆本仓库,或下载 ZIP 解压到 D:\插件\waitiforud(路径随你,下面示例按这个写):

git clone https://github.com/CG-7S/dsh-waitiforud.git D:/插件/waitiforud

包名 @local/waitiforud 里的 @local 只是个本地作用域标识,不影响从任意目录安装。

A. 直接安装(本机已用这条)

plugin_manager install_bundle(target="link:D:/插件/waitiforud")

B. 手动写进 profile

C:\Users\lenovo\.dsh\profiles\desktop\package.json:

{
  "dependencies": { "@local/waitiforud": "link:D:/插件/waitiforud" },
  "dsh": { "profile": { "bundles": ["@local/waitiforud"] } }
}

然后重启 DSH(或让 Host 重新加载 profile)。

C. 改了代码之后怎么重载

本地 link 插件不走 HMR,必须让 bundle 重新加载:

plugin_manager action=set_bundle target="@local/waitiforud" enabled=false
plugin_manager action=set_bundle target="@local/waitiforud" enabled=true

注意要用包全名:set_plugin 要的是 entryId,传包名会报 unknown-plugin。

D. 验证

waitiforud(action="status")

期望输出形如:

槽位根目录:D:\
- waitiforud1:空;工作区第 1/14 位(已置顶)
- waitiforud2:空;工作区第 2/14 位(已置顶)
- waitiforud3:空;工作区第 3/14 位(已置顶)

配置项(cordis.patch.yml 的 config)

键默认说明
slotNames[waitiforud1, waitiforud2, waitiforud3]槽位名,顺序即工作区排列顺序;可增可减
rootDirD:\槽位所在根目录,必须写成盘符路径
autoRotatetrue回合结束时自动改名 + 补建
pinToptrue自动登记进工作区并置顶
prompttrue往系统提示里放使用约定
sectionOrder120约定段排序
maxNameLength20归档名长度上限
retireSlots[waitiforud]旧版单槽位名:空着就顺手清理(删空目录 + 撤销工作区登记),有东西就一律不动

想加第四个槽位,只要在 slotNames 里加一项,重载后自动建目录、登记、置顶。

停用 / 卸载

plugin_manager action=set_bundle target="@local/waitiforud" enabled=false

停用后槽位目录和归档目录都不会被删(插件只动自己建的东西,改名失败时甚至不会补建)。 彻底卸载:从 profile 的 dependencies / bundles 里删掉该条目。

注意事项

  • 只在「工作目录正好是某个槽位」时轮换。在 D:\插件 等其它工作区里干活时插件不动手。
  • 归档后的旧目录不会再登记进工作区:登记以 path 为身份,旧路径已失;每轮都登记会让列表无限膨胀、 会话归属也会乱。想让它出现在列表里,用 DSH 自己的工作区「添加」按钮。
  • Windows 下目录被资源管理器/终端占着时 rename 会 EPERM/EBUSY,插件会重试 5 次; 仍失败就报错并保持原样,绝不会出现「两个同名槽位」。
  • 三个槽位互相独立:waitiforud1 轮换不影响 waitiforud2/3 里的内容。
  • 旧单槽位 waitiforud(retireSlots 里的名字):目录空着就删掉并撤销登记;里面还有东西就 按摘要改名归档一次、不补建同名空目录,同时撤销它的工作区登记。触发方式两种:在它里面干活 的会话结束时自动跑,或手动 action="rotate" slot="waitiforud"。 为什么会有这条:升级成三槽位后,旧目录既不是槽位、又因为非空躲过了清理,就会变成 「看起来是槽位、其实干完活不归档」的坑。
  • 纯 Host 侧实现,不联网、不起子进程、不读凭据;只对 D:\ 下这几个槽位做 stat/readdir/readFile/rename/mkdir/rmdir。

文件结构

waitiforud/
├── index.js          # 插件实现(纯函数 + 核心动作 + 工具 + 钩子)
├── package.json      # @local/waitiforud,声明 dsh.bundle.patch
├── cordis.patch.yml  # 插件加载配置
├── locale/zh.json    # 中文名与描述
├── locale/en.json    # 英文名与描述
├── icon.svg          # 图标:文件夹 + 循环箭头
├── test/selftest.mjs # 自测:假 ctx + 真文件系统
└── README.md         # 本文

自测

npm test                 # 或在仓库根执行 node test/selftest.mjs
node test/selftest.mjs D:/某个空目录    # 换一个临时根目录

56 项断言,覆盖:三槽位置顶顺序、只轮换「cwd 所在」的那个槽位、槽位缺失补建、同名冲突加 -2、 目录被占用(EPERM/EBUSY)时不补建、旧单槽位归档、命名清洗与截断、工具输出永远贴合 schema。 测试目录用 test/.tmp/,跑完自动清理。

许可

MIT,见 LICENSE。

Comments

Loading…

Similar plugins

dsh-task-workspace

by Zilong6666

DSH task workspace convention: one folder per task, one PROGRESS.md per task (overwritten each update), and per-task git once a task runs long.

Workflow & AutomationManifest valid

★ 0

MIT

JavaScript

Oct 4, 2026

dsh plugin --profile web add dsh-task-workspace

Scheduled DSH tasks: each topic keeps its own folder and task-detail file, runs by cron or manually, and renders a timestamped PNG or PDF report that can be pushed to Lark.

Workflow & AutomationManifest valid

★ 1

MIT

TypeScript

dsh plugin --profile web add dsh-atan-daily

by zihangii

DSH plugin: every background task across sessions on one page, grouped by workspace, session, or script — with output tail and stop controls.

Manifest valid

★ 0

MIT

JavaScript

Nov 18, 2026

dsh plugin --profile web add dsh-job-desk

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 121212165

dsh plugin: compiles a rough need into a versioned task book, then hands it to any AI window losslessly via a read-back handshake (/forge /relay /ack /answer /forge-list)

Workflow & AutomationManifest valid

★ 0

MIT

TypeScript

Oct 7, 2026

dsh plugin --profile web add dsh-plugin-task-forge

by a1286743184

DSH plugin: workspace & session provisioning plus cross-directory session dispatch — hand a task to a real session in another project directory and get the report back.

Manifest valid

★ 0

MIT

JavaScript

Nov 13, 2026

dsh plugin --profile web add dsh-workspace-dispatch