- Home
- Plugins
- UI Enhancements
- dsh-sleep-send
A
dsh-sleep-send
awu12277/dsh-sleep-send
Schedule-send button and panel to the right of the composer, with smart time slots, a custom date/time picker, several queued sends at once, and localStorage persistence that restores pending tasks after a page reload.
Install
dsh plugin --profile web add github:awu12277/dsh-sleep-sendREADME
dsh-sleep-send
DSH Web 的定时发送 Cordis 客户端插件:在输入框右侧提供「定时发送」按钮与配置面板,支持智能时段、自定义日期时间、多个定时任务,并通过 localStorage 持久化任务,刷新页面后自动恢复。
🕐 "sleep-send" —— 把消息"睡"到合适的时刻再发送:默认只在 12:00–14:00 与 18:00–次日 08:00 这类得体时段内自动挑最近的时间发出,也可以完全自定义日期与时刻。
功能
- 输入框右侧按钮:
conversation.input.right槽位,紧挨发送按钮;空草稿禁用、输入后激活。 - 智能时段(默认):在
12:00 – 14:00、18:00 – 次日 08:00两个时段内自动选取最近的可发送时间(当前时间 + 2 分钟起;不在时段内则取下一时段起点)。 - 自定义日期时间:时间选择器 + 日期快捷(今天 / 明天 / 后天)+ 原生日期选择器(过去日期不可选);已过时间自动顺延一天;发送时间按具体日期显示(如
8月19日 周三 12:00)。 - 多个定时任务:确认后追加任务并清空输入框(输入框恢复自由,可连续排队多条);弹窗内可查看 / 逐个删除已设定任务;工具行芯片显示任务数徽标 + 下次发送时间 + 实时倒计时。
- localStorage 持久化(
dsh.sched-send.v1):任务与自定义偏好刷新后自动恢复;恢复时未到期任务保留、15 分钟内过期的自动补发、更早的过期任务丢弃。 - 防误覆盖:到点发送前若输入框内容已被修改,自动取消本次发送而不是覆盖新内容。
- 无障碍与性能:全部可交互元素带
:focus-visible焦点环;动画遵循prefers-reduced-motion;脉冲动画仅使用 transform/opacity。
截图
| 工具行按钮与武装芯片 | 配置弹窗(智能时段) | 配置弹窗(自定义日期时间) |
|---|---|---|
![]() | ![]() | ![]() |
截图为清新天蓝主题;替换
docs/screenshots/下同名文件即可更新。
安装
已发布到 npm,一条命令安装到你的 web profile:
dsh plugin --profile web add dsh-sleep-send
- 本地开发安装:
dsh plugin --profile web add file:D:\projects\github\sleep-send - 或直接通过 git:
dsh plugin --profile web add github:Awu12277/dsh-sleep-send - 安装后重启
dsh web生效;卸载:dsh plugin --profile web remove dsh-sleep-send
也可以作为普通库安装(源码 / 集成参考):
npm install dsh-sleep-send
包结构(DSH web 插件协议):
dsh-sleep-send/
├── index.js # host 侧 cordis 插件骨架(纯 client 插件,无 host 逻辑)
├── client.js # 浏览器端:window.__ModuleLoader__.load({ id, factory })
├── cordis.patch.yml # bundle patch:注册 dsh-sleep-send 条目
└── package.json # dsh.bundle.patch + dsh.client.platform: "web"
运行环境
- DSH Web(DeepSeek Harness 的浏览器界面)。client bundle 运行于浏览器页面:
require("react")获取 React;apply(ctx)中的ctx为 client root context;- 通过
ctx.get("slots")访问conversation.input.right与conversation.input.overlay槽位; - 调度定时器优先使用 cordis
timer服务,缺失时自动降级为浏览器定时器; - 任务与偏好持久化在
localStorage['dsh.sched-send.v1'],刷新页面后自动恢复。
- 纯 ESM、零运行时依赖、无需构建。
使用
- 在输入框输入消息;
- 点击输入框右侧的 ⏰ 定时(或 ⚙ 配置)打开配置面板;
- 选择 智能时段 或 自定义时间(含日期快捷 / 日期选择器);
- 点击 加入 · HH:MM 发送 —— 任务加入列表,输入框自动清空,可继续输入下一条并排队;
- 工具行芯片显示最近任务时间与实时倒计时;点击 ✕ 取消全部任务;
- 到点后消息自动发送;等待期间若修改了输入框内容,该任务自动取消(不会覆盖新输入)。
持久化与恢复
- 存储键:
localStorage['dsh.sched-send.v1'],内容为{ mode, custom, schedules }; - 每次任务增删 / 到期发送后即时写回;
- 页面刷新并重新激活插件后,自动认领本会话的持久化任务:
- 未到期任务保留并继续倒计时;
- 15 分钟内过期的任务立即补发;
- 更早的过期任务丢弃(避免刷新后补发陈旧消息)。
数据与隐私
- 所有任务仅保存在当前浏览器的
localStorage中,不上传任何服务器; - 更换浏览器 / 无痕窗口 / 清除站点数据会丢失任务。
开发
npm test # node --check src/index.js


