dsh-later 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,51 @@
1
+ # 更新日志
2
+
3
+ 本文件记录面向使用者的重要变更。细粒度提交历史见 git log。
4
+
5
+ ## 2026-09-12
6
+
7
+ - **chore!** 插件改名 `dsh-session-scheduler` → **`dsh-later`**:消除与核心
8
+ 引擎 `dsh-schedule` 的命名撞车,贴合 `/later` 用户心智。变更范围:
9
+ 包名、cordis 条目 id(`later`)、settings 命名空间(`dsh-later`)、
10
+ sidecar 目录(`plugin-state/later/`)、client 端 localStorage key。
11
+ - sidecar 自动迁移:首次启动把旧目录 `plugin-state/session-scheduler/`
12
+ 的所有权文件搬到新目录(rename 优先,失败逐文件复制,幂等),
13
+ 已设定提醒不丢失。
14
+ - 升级前已暂存在浏览器 localStorage 的离线任务不再读取(量级通常为
15
+ 0;如需找回,手动把 key `dsh-session-scheduler:pending` 改名为
16
+ `dsh-later:pending`)。
17
+ - 历史会话日志中的 `session-scheduler/user-schedule` 事件键与环境变量
18
+ `DSH_SESSION_SCHEDULER_STATE_DIR` 保持读兼容(后者仍被识别,新名为
19
+ `DSH_LATER_STATE_DIR`)。
20
+ - 已装旧版的机器需先 `dsh plugin remove` 旧插件再 add 新版(包名已变)。
21
+
22
+ ## 2026-09-10
23
+
24
+ - **fix!** 用户任务所有权移出会话日志,改存插件 sidecar 文件
25
+ (`~/.dsh/plugin-state/session-scheduler/<sessionId>.json`),根治「宿主
26
+ 持久化静默丢行 → 历史 seq 缺口 → 整份会话拒读」事故。`/later` 的代发
27
+ 形态、GUI 面板归属、fork 隔离语义不变。
28
+ ⚠️ 降级单向门:本版本后新建的任务无伴生事件行,回退旧版插件时这些任务
29
+ 在面板不显示(引擎触发不受影响)。整机备份请包含
30
+ `plugin-state/session-scheduler/` 目录。
31
+ - **chore!** 仓库结构对齐项目布局:插件包移入 `dsh-session-scheduler/`
32
+ 子目录,设计工作区(PRD / 设计文档 / 源码分析)入库。
33
+ - docs: 根 README 恢复为插件版;项目总览留档 `docs/project-overview.md`
34
+ (仓库根)。
35
+
36
+ ## 2026-09-09
37
+
38
+ - docs+tooling: README 媒体刷新,新增截图采集流水线(`scripts/capture/`)。
39
+
40
+ ## 2026-09-08
41
+
42
+ - feat: 会话状态图标添加动画效果。
43
+ - docs: README 全面改版为用户向介绍/展示/使用,技术内容移入 docs/。
44
+
45
+ ## 2026-09 及更早(v1.0.0)
46
+
47
+ - 用户工具 `user_schedule_create/list/delete/edit` + `/later`、`/schedule`
48
+ slash 命令;`userSchedules` 会话投影(GUI 面板 + dock + 输入框按钮)。
49
+ - 独立调度器(`runtime.ts`):用户创建的提醒到点 dispatch + followup 注入,
50
+ 与 dsh-schedule 共用日志互不双触发。
51
+ - 智能时段排期(工作时间/午休/晚间静默)、时区处理、注入防护 framing。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-session-scheduler contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,213 @@
1
+ <div align="center">
2
+
3
+ <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="64" alt="scheduled"/>
4
+ <img src="assets/icons/icon-presence-urgent.svg?v=18" width="64" alt="urgent"/>
5
+ <img src="assets/icons/icon-presence-overdue.svg?v=18" width="64" alt="overdue"/>
6
+
7
+ # dsh-later — In-Session Scheduled Message Plugin
8
+
9
+ [中文](./README.md) | **English**
10
+
11
+ </div>
12
+
13
+ > Set reminders for yourself inside DSH: **set by you, delivered into the current conversation, driven server-side, available across devices** — on time, even with the browser closed.
14
+
15
+ **`/later` delayed send** — no panel needed: type one line in the input box and it is sent later as yourself (demo: typing `/later +5s`, `+3m`, `+1h20m` character by character, then Enter to start the countdowns; the `+5s` one really lands when due):
16
+
17
+ <p align="center">
18
+ <img src="docs/media/docs-later-full.gif" width="760" alt="/later demo: type /later +5s 检查部署结果 → Enter → dock countdown → delivered as yourself when due"/>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## How to use
24
+
25
+ ### Schedule panel
26
+
27
+ Click the **"Schedule send"** button to the right of the input box. The panel uses the **input box content** as the reminder text; pick a time, then click **"Add · send at HH:MM"** (the button stays disabled until a time is chosen). A countdown row then appears above the input box.
28
+
29
+ | Capability | Description |
30
+ |---|---|
31
+ | Quick chips | One-tap `in 10 minutes` / `in 1 hour` / `work hours` (configurable in settings) |
32
+ | Custom time | "Custom…" opens date + time inputs |
33
+ | Send preview | See the exact due-time form before confirming |
34
+ | Task list | All scheduled items, deletable one by one |
35
+ | Cancel all | Cancel action on the chip clears every reminder in this conversation |
36
+
37
+ ### Time formats
38
+
39
+ All of these are accepted (`/schedule`, `/later`, and the panel's custom time share the same parser):
40
+
41
+ | Kind | Examples |
42
+ |---|---|
43
+ | Relative duration | `+30m` · `+1h30m` · `+90s` · `+1w` · `30分钟后` · `半小时后` |
44
+ | Time today | `15:32` · `9点` · `9点半` · `1532` |
45
+ | Relative day + time | `明天9点` · `后天 10:00` |
46
+ | Date + time | `8月21日 15:32` · `2026-08-21 15:32` · `0821-1532` |
47
+
48
+ A bare time (like `1532`) rolls over to tomorrow if it has already passed today (up to 7 days). Writing `明天`/`后天` is taken literally — if that time has passed you are told to use a concrete date instead. A month/day only (like `8月21日`) rolls over to next year when this year's has passed.
49
+
50
+ ### Commands
51
+
52
+ | Command | Effect |
53
+ |---|---|
54
+ | `/schedule <time> <content>` | Create a reminder (shows up in the conversation when due) |
55
+ | `/later <time> <content>` | Delayed send: deliver the content later as yourself |
56
+ | `/schedule every <interval> <content>` | Recurring reminder (interval ≥ 5 min) |
57
+
58
+ ```
59
+ /schedule 明天9点 提交周报
60
+ /later 1532 提醒团队同步进度
61
+ ```
62
+
63
+ The model can also call user tools on your behalf to create/inspect/delete/edit reminders (`user_schedule_create` / `user_schedule_list` / `user_schedule_delete` / `user_schedule_edit`).
64
+
65
+ ### Pending dock
66
+
67
+ The countdown rows above the input box. Each row ends with three buttons: **Edit reminder** (change the text inline), **Delete reminder** (cancel that item), and **Send now** (push it to the agent immediately, skipping the countdown).
68
+
69
+ > ⚠️ "Send now" is not a confirm button — it **immediately** delivers the reminder text to the agent and wakes the model. To cancel, use Delete.
70
+
71
+ ### Sidebar presence indicator
72
+
73
+ Conversations with active reminders show a pixel clock in their sidebar row (alongside the "active" orb):
74
+
75
+ | Icon | Meaning |
76
+ |---|---|
77
+ | <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="28" alt="scheduled"/> | Purple · has scheduled reminders |
78
+ | <img src="assets/icons/icon-presence-urgent.svg?v=18" width="28" alt="urgent"/> | Amber · next fire within 5 minutes |
79
+ | <img src="assets/icons/icon-presence-overdue.svg?v=18" width="28" alt="overdue"/> | Red · overdue (waiting for the session to become idle) |
80
+
81
+ Hover shows "count · next fire time".
82
+
83
+ ---
84
+
85
+ ## Screenshots
86
+
87
+ **Schedule panel** — quick slots / custom time / pending list:
88
+
89
+ <img src="docs/media/screenshot-panel.png" width="340" alt="Schedule panel"/>
90
+
91
+ **Pending dock** — countdown rows above the input box (inline edit / cancel):
92
+
93
+ <img src="docs/media/screenshot-dock.png" width="700" alt="Pending dock and input box"/>
94
+
95
+ **A real due-time firing** — when the time comes, a `⏰ Scheduled reminder` message appears in the conversation (fires even with the page closed):
96
+
97
+ <img src="docs/media/screenshot-fired.png" width="560" alt="Due-time reminder message"/>
98
+
99
+ **Animated demos**:
100
+
101
+ | Creating a reminder (type → panel → add → dock) | Firing when due (countdown → message arrives) |
102
+ |---|---|
103
+ | <img src="docs/media/docs-scheduler-create.gif" width="380" alt="Create reminder demo"/> | <img src="docs/media/docs-scheduler-fired.gif" width="380" alt="Due firing demo"/> |
104
+
105
+ **`/later` shortcut** — skip the panel and type one line in the composer to send as yourself later:
106
+
107
+ <img src="docs/media/docs-later.gif" width="760" alt="/later command demo: type /later +60m text, press Enter, dock shows the countdown"/>
108
+
109
+ ---
110
+
111
+ ## Feature overview
112
+
113
+ - **Input-bar timer button**: one click opens the schedule panel — smart time slots / custom time / send preview / pending list / countdown chip.
114
+ - **Pending dock**: a list above the input box; each item can be **cancelled** individually or **edited inline** via its edit icon.
115
+ - **`/later` delayed send**: deliver *the text you are typing right now* later, as yourself (see [the difference](#reminders-vs-delayed-sends-whats-the-difference)).
116
+ - **Sidebar presence indicator**: conversations with active reminders show a pixel clock in the sidebar (purple = scheduled · amber = fires within 5 min · red = overdue); hover shows count and next fire time.
117
+ - **Fires with the page closed**: reminders persist server-side and arrive on time across devices.
118
+ - **Never impersonates you**: when due, the message appears as a `Reminder` — it is never framed as your own words.
119
+ - **Multilingual**: follows the DSH UI language (Chinese / English), live without reload.
120
+ - **Reminders don't carry across sessions**: sessions forked from this one never inherit the parent's reminders.
121
+
122
+ ---
123
+
124
+ ## Reminders vs. delayed sends: what's the difference?
125
+
126
+ | Action | When it takes effect | Who sends it | What you see |
127
+ |---|---|---|---|
128
+ | Enter in the input box | Immediately | You | Normal user bubble |
129
+ | Schedule panel / `/schedule <time> <content>` | When due | The reminder | `Reminder · HH:MM · content` row |
130
+ | `/later <time> <content>` | When due | As yourself | Normal user bubble |
131
+
132
+ > **`/schedule` is not "delayed send"**: pressing Enter on `/schedule …` sends it *immediately* (as a user message); only the **reminder itself** is deferred. If you want "send the text I'm typing now, later, as if I said it", use **`/later`**.
133
+
134
+ ---
135
+
136
+ ## Quick start
137
+
138
+ ### Install into DSH
139
+
140
+ Build in the plugin source directory, then add it to your DSH Web profile:
141
+
142
+ ```sh
143
+ cd dsh-later
144
+ npm install
145
+ npm run build
146
+
147
+ dsh plugin --profile web add "file:/path/to/dsh-later"
148
+ # restart dsh web to activate
149
+ ```
150
+
151
+ > Dev tip: `npm run watch` rebuilds on `src/` changes and runs shape regression tests.
152
+
153
+ ### Your first reminder
154
+
155
+ 1. Open any conversation — a "Schedule" button appears right of the input box;
156
+ 2. Click it → pick a smart slot, or enter a custom time and content;
157
+ 3. Confirm → a countdown chip appears next to the button and the dock shows the pending item;
158
+ 4. When due, a `Reminder` message lands in the conversation — it fires even if you close the page.
159
+
160
+ ---
161
+
162
+ ## Long-text reminders
163
+
164
+ Reminder content is limited to **1000 characters** by default. For longer content, enable `allowLongPrompts` in **DSH Settings → Plugins → Session Scheduler** and set `maxPromptChars`.
165
+
166
+ - **Good for**: code snippets, meeting notes, long quotes, cross-device notes/todos.
167
+ - **Not recommended**: text that could read as instructions (the longer it is, the bigger the risk); a shared public profile (anyone could raise the limit).
168
+
169
+ ---
170
+
171
+ ## Configuration
172
+
173
+ Works out of the box. Adjust in **DSH Settings → Plugins → Session Scheduler** (applies live, no restart):
174
+
175
+ | Field | Description | Default |
176
+ |---|---|---|
177
+ | Show schedule button | Whether the timer button shows on the input bar (hiding it never affects existing reminders or the dock) | Shown |
178
+ | Max schedules per session | Max reminders allowed in one conversation | 100 |
179
+ | Allow long prompts | Lift the 1000-character default cap | Off |
180
+ | Custom cap | Character cap when `allowLongPrompts` is on | 1000 |
181
+ | Work hours / lunch / night quiet | Five HH:mm fields driving smart slots and auto-scheduling | See settings page |
182
+
183
+ > Advanced: defaults can also be overridden at startup via `cordis.patch.yml` (e.g. `maxSchedules`) — see `docs/` and the schema.
184
+
185
+ ---
186
+
187
+ ## Technical documentation
188
+
189
+ Developer- and maintainer-oriented content has moved out of this README:
190
+
191
+ - [Architecture & data flow](./docs/architecture.md) — host/client layering, event flow, layout, scheduler rationale
192
+ - [Key design decisions](./docs/design-decisions.md) — `source` field, slash channel, fork isolation, anti-spoofing tradeoffs
193
+ - [Verification & acceptance criteria](./docs/verification.md) — tests, live E2E, cross-kernel compatibility, AC table
194
+
195
+ ## References
196
+
197
+ - PRD & design docs: `prd.md` and `docs/` in the project root (workspace-level, outside this package)
198
+ - dsh-schedule source analysis: `../references/dsh-schedule-analysis.md`
199
+ - dsh-sleep-send source analysis: `../references/dsh-sleep-send-analysis.md`
200
+
201
+ ## License
202
+
203
+ MIT
204
+
205
+ ---
206
+
207
+ <div align="center">
208
+
209
+ <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="48" alt="scheduled"/>
210
+ <img src="assets/icons/icon-presence-urgent.svg?v=18" width="48" alt="urgent"/>
211
+ <img src="assets/icons/icon-presence-overdue.svg?v=18" width="48" alt="overdue"/>
212
+
213
+ </div>
package/README.md ADDED
@@ -0,0 +1,213 @@
1
+ <div align="center">
2
+
3
+ <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="64" alt="scheduled"/>
4
+ <img src="assets/icons/icon-presence-urgent.svg?v=18" width="64" alt="urgent"/>
5
+ <img src="assets/icons/icon-presence-overdue.svg?v=18" width="64" alt="overdue"/>
6
+
7
+ # dsh-later — 会话内定时消息插件
8
+
9
+ **中文** | [English](./README.en.md)
10
+
11
+ </div>
12
+
13
+ > 在 DSH 里给自己设提醒:**用户自己设、当前对话收到、服务端驱动、跨设备**——到点准时送达,即使你关掉了网页。
14
+
15
+ **`/later` 延迟发送** —— 不开面板,在输入框敲一行就以你的身份稍后发出(演示:逐字输入 `/later +5s` / `+3m` / `+1h20m`,回车后进入倒计时;`+5s` 那条到点真实送达):
16
+
17
+ <p align="center">
18
+ <img src="docs/media/docs-later-full.gif" width="760" alt="/later 命令演示:输入 /later +5s 检查部署结果 → 回车 → dock 倒计时 → 到点以你的身份送达"/>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## 使用方法
24
+
25
+ ### 定时面板
26
+
27
+ 点输入框右侧的 **「定时发送」** 打开面板。面板以**输入框内容**作为提醒内容,选好时间后点 **「加入 · HH:MM 发送」**(未选时间时该按钮不可点)即可;输入框上方随即出现倒计时条。
28
+
29
+ | 能力 | 说明 |
30
+ |---|---|
31
+ | 快捷芯片 | `10分钟后` / `1小时后` / `工作时间` 一键填充(智能时段可在设置里改) |
32
+ | 自定义时间 | 「自定义…」展开日期 + 时间输入框 |
33
+ | 发送预览 | 确认前预览到点后收到的样子 |
34
+ | 任务列表 | 已设定任务,可单个删除 |
35
+ | 取消全部 | 芯片上的取消操作一键清空本会话所有提醒 |
36
+
37
+ ### 时间格式
38
+
39
+ 以下写法都认(`/schedule`、`/later` 与面板自定义时间共用):
40
+
41
+ | 类型 | 示例 |
42
+ |---|---|
43
+ | 相对时长 | `+30m` · `+1h30m` · `+90s` · `+1w` · `30分钟后` · `半小时后` |
44
+ | 当天时刻 | `15:32` · `9点` · `9点半` · `1532` |
45
+ | 相对日 + 时刻 | `明天9点` · `后天 10:00` |
46
+ | 日期 + 时刻 | `8月21日 15:32` · `2026-08-21 15:32` · `0821-1532` |
47
+
48
+ 只写时刻(如 `1532`)时,若今天已过会自动顺延到明天(最多 7 天);写了 `明天`/`后天` 则按字面理解,该时刻已过会提示改用具体日期;只写月日(如 `8月21日`)时,今年已过则顺延到明年。
49
+
50
+ ### 命令
51
+
52
+ | 命令 | 作用 |
53
+ |---|---|
54
+ | `/schedule <时间> <内容>` | 创建一条定时提醒(到点出现在对话里) |
55
+ | `/later <时间> <内容>` | 延迟发送:到点以你的身份发出该内容 |
56
+ | `/schedule every <周期> <内容>` | 周期性提醒(周期 ≥ 5 分钟) |
57
+
58
+ ```
59
+ /schedule 明天9点 提交周报
60
+ /later 1532 提醒团队同步进度
61
+ ```
62
+
63
+ 模型也可以直接调用用户工具为你创建/查询/修改提醒(`user_schedule_create` / `user_schedule_list` / `user_schedule_delete` / `user_schedule_edit`)。
64
+
65
+ ### 待发送 dock
66
+
67
+ 输入框上方的倒计时条,每行行尾三个按钮:**编辑提醒**(就地改内容)、**删除提醒**(取消该条)、**插话发送**(立即推给 agent,不等倒计时)。
68
+
69
+ > ⚠️ 「插话发送」不是「确认」,点了会**马上**把提醒内容发给 agent 并唤醒模型;只想取消请点删除。
70
+
71
+ ### 侧栏状态标识
72
+
73
+ 有活动提醒的会话,行内会出现像素时钟(与「进行中」orb 并存):
74
+
75
+ | 图标 | 含义 |
76
+ |---|---|
77
+ | <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="28" alt="scheduled"/> | 紫 · 有定时中提醒 |
78
+ | <img src="assets/icons/icon-presence-urgent.svg?v=18" width="28" alt="urgent"/> | 琥珀 · 下次触发 ≤ 5 分钟 |
79
+ | <img src="assets/icons/icon-presence-overdue.svg?v=18" width="28" alt="overdue"/> | 红 · 已到期(等待会话空闲派发) |
80
+
81
+ 鼠标悬停可见「任务数 · 下次时间」。
82
+
83
+ ---
84
+
85
+ ## 界面展示
86
+
87
+ **定时面板** —— 快捷时段 / 自定义时间 / 已设定任务列表:
88
+
89
+ <img src="docs/media/screenshot-panel.png" width="340" alt="定时提醒面板"/>
90
+
91
+ **待发送 dock** —— 输入框上方倒计时条(行内编辑 / 取消;下方即输入框):
92
+
93
+ <img src="docs/media/screenshot-dock.png" width="700" alt="待发送 dock 与输入框"/>
94
+
95
+ **到期真实触发** —— 到点后对话里出现「⏰ 定时提醒」消息(关网页也照常触发):
96
+
97
+ <img src="docs/media/screenshot-fired.png" width="560" alt="到期提醒消息"/>
98
+
99
+ **动图演示**:
100
+
101
+ | 创建定时提醒(输入 → 面板 → 加入 → dock) | 到期触发(倒计时 → 收到消息) |
102
+ |---|---|
103
+ | <img src="docs/media/docs-scheduler-create.gif" width="380" alt="创建定时提醒演示"/> | <img src="docs/media/docs-scheduler-fired.gif" width="380" alt="到期触发演示"/> |
104
+
105
+ **`/later` 快捷命令** —— 不打面板,直接在输入框敲一行就以你的身份延迟发送:
106
+
107
+ <img src="docs/media/docs-later.gif" width="760" alt="/later 命令演示:输入 /later +60m 内容 → 回车 → dock 出现倒计时"/>
108
+
109
+ ---
110
+
111
+ ## 特性一览
112
+
113
+ - **输入框定时按钮**:一键打开定时面板——智能时段 / 自定义时间 / 发送预览 / 已设定任务列表 / 倒计时。
114
+ - **待发送 dock**:输入框上方的提醒列表,每条可单独**取消**,或点击编辑图标**行内修改内容**。
115
+ - **`/later` 延迟发送**:把「你现在打的这句话」稍后以你的身份发出去(和定时提醒的区别见[这里](#定时提醒和延迟发送有什么区别))。
116
+ - **侧栏状态标识**:有活动提醒的会话,侧栏显示像素时钟(紫=定时中 · 琥珀=5 分钟内 · 红=已到期),悬停可见任务数与下次时间。
117
+ - **关网页也能触发**:提醒保存在服务端,关网页、换设备都会准时到达。
118
+ - **不会冒充你本人**:到点后显示为「定时提醒」消息,而不是假装是你自己发的。
119
+ - **多语言**:跟随 DSH 界面语言(中文 / English),切换即时生效。
120
+ - **提醒不跨会话**:由当前会话派生出的子会话,不会带上父会话的提醒。
121
+
122
+ ---
123
+
124
+ ## 定时提醒和延迟发送,有什么区别?
125
+
126
+ | 动作 | 什么时候生效 | 谁发出 | 你看到 |
127
+ |---|---|---|---|
128
+ | 输入框 Enter 直接发 | 立即 | 你 | 普通用户气泡 |
129
+ | 定时面板 / `/schedule <时间> <内容>` | 到点 | 定时提醒 | `定时提醒 · HH:MM · 内容` 提醒行 |
130
+ | `/later <时间> <内容>` | 到点 | 以你的身份 | 普通用户气泡 |
131
+
132
+ > **`/schedule` 不是「延迟发送」**:输入框里那行 `/schedule …` 一按回车就会**立刻**发出去(作为一条用户消息),被推迟的只是**提醒本身**。如果你想要的是「把我现在打的这句话,过会儿当作我亲口发的」,请用 **`/later`**。
133
+
134
+ ---
135
+
136
+ ## 快速开始
137
+
138
+ ### 安装到 DSH
139
+
140
+ 在插件源码目录构建后装入 DSH Web profile:
141
+
142
+ ```sh
143
+ cd dsh-later
144
+ npm install
145
+ npm run build
146
+
147
+ dsh plugin --profile web add "file:/path/to/dsh-later"
148
+ # 重启 dsh web 后生效
149
+ ```
150
+
151
+ > 开发提示:`npm run watch` 监听 `src/` 自动重建并跑形状回归测试,改动即时生效。
152
+
153
+ ### 第一条提醒
154
+
155
+ 1. 打开任意会话,输入框右侧出现「定时」按钮;
156
+ 2. 点击按钮 → 选一个智能时段,或填自定义时间与内容;
157
+ 3. 点确认 → 按钮旁出现倒计时芯片,输入框上方 dock 显示待发条目;
158
+ 4. 到点后对话里收到「定时提醒」消息——关掉网页也会触发。
159
+
160
+ ---
161
+
162
+ ## 长文本提醒
163
+
164
+ 提醒内容默认上限 **1000 字符**。需要更长时,在 **DSH 设置 → 插件 → Session Scheduler** 开启 `allowLongPrompts` 并设置 `maxPromptChars`。
165
+
166
+ - **适合**:代码片段、会议纪要、长引文、跨设备日记/待办。
167
+ - **不建议**:提醒内容里包含可能被当成「指令」的话(内容越长风险越大);多人共享同一台设备的公共 profile(任何人都能调大)。
168
+
169
+ ---
170
+
171
+ ## 配置
172
+
173
+ 默认开箱即用。可在 **DSH 设置 → 插件 → Session Scheduler** 调整(保存即时生效,无需重启):
174
+
175
+ | 字段 | 说明 | 默认 |
176
+ |---|---|---|
177
+ | 显示定时按钮 | 输入框右侧是否显示定时按钮(隐藏不影响已创建的提醒触发与 dock 显示) | 显示 |
178
+ | 单会话任务上限 | 一个会话内最多允许的提醒数 | 100 |
179
+ | 允许长文本 | 解除 1000 字符默认下限 | 关闭 |
180
+ | 自定义上限 | `allowLongPrompts` 开启时的字符上限 | 1000 |
181
+ | 工作时间 / 午休 / 晚间静默 | 智能时段 5 个 HH:mm 字段,决定快捷芯片与智能排期 | 见设置页 |
182
+
183
+ > 进阶:也可以用 `cordis.patch.yml` 在启动期覆盖默认值(如 `maxSchedules`),见 `docs/` 与 schema。
184
+
185
+ ---
186
+
187
+ ## 技术文档
188
+
189
+ 以下内容面向开发者与维护者,已移出本 README:
190
+
191
+ - [架构与数据流](./docs/architecture.md) — 宿主/客户端分层、事件流、目录结构、调度器原理
192
+ - [关键设计决策](./docs/design-decisions.md) — source 字段、slash 通道、fork 隔离、注入防护等取舍
193
+ - [验证状态与验收对照](./docs/verification.md) — 测试、线上 E2E、跨内核代次兼容、AC 对照表
194
+
195
+ ## 参考
196
+
197
+ - PRD 与设计文档:项目根目录 `prd.md`、`docs/`
198
+ - dsh-schedule 源码分析:`../references/dsh-schedule-analysis.md`
199
+ - dsh-sleep-send 源码分析:`../references/dsh-sleep-send-analysis.md`
200
+
201
+ ## 许可
202
+
203
+ MIT
204
+
205
+ ---
206
+
207
+ <div align="center">
208
+
209
+ <img src="assets/icons/icon-presence-scheduled.svg?v=18" width="48" alt="scheduled"/>
210
+ <img src="assets/icons/icon-presence-urgent.svg?v=18" width="48" alt="urgent"/>
211
+ <img src="assets/icons/icon-presence-overdue.svg?v=18" width="48" alt="overdue"/>
212
+
213
+ </div>
@@ -0,0 +1,19 @@
1
+ # dsh-later bundle patch:把 host 插件行插入 loader 树。
2
+ # 作为 dsh.bundle.patch 自动挂载(dsh plugin add 后即生效);
3
+ # client 端通过 package.json 的 dsh.client 声明进入 boot 图。
4
+ #
5
+ # 配置说明(全部可选,默认开箱即用):
6
+ # - smart-window:智能时段配置(默认工作时间 09:00–18:00、午休 12:00–14:00、
7
+ # 晚间 18:00–22:00、夜间静默)。
8
+ # - max-schedules:单 session 任务上限(默认 100)。
9
+ - insert:
10
+ - id: later
11
+ name: dsh-later
12
+ # config: # ← 需要时取消注释
13
+ # maxSchedules: 100
14
+ # smartWindow:
15
+ # workStart: "09:00"
16
+ # workEnd: "18:00"
17
+ # lunchStart: "12:00"
18
+ # lunchEnd: "14:00"
19
+ # eveningEnd: "22:00"