dsh-reminder-notify 0.8.0 → 0.8.1

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.
@@ -0,0 +1,22 @@
1
+ # Desktop reminder (dsh-reminder-notify)
2
+
3
+ Adds a `notify_user` tool to DeepSeek Harness: when work is done (`kind=done`) or a decision is needed (`kind=decide`), a reminder card pops in the bottom-right with the matching voice — never stealing focus, auto-dismissing after N seconds.
4
+
5
+ The card host is the bundled `host/ReminderHost.ps1`, drawn with the system PowerShell 5.1 + WinForms at run time, so the package ships no exe and is not blocked by SmartScreen or antivirus.
6
+
7
+ ## Settings
8
+
9
+ Open "Desktop reminder" in the Plugins page; the panel sits right under the description and has four groups:
10
+
11
+ - **Basics**: duration, position, sound on/off
12
+ - **Sounds**: audio directory ("Browse…" picks a directory), the three per-kind file names (wav / mp3). Once a directory is picked the dropdown lists the audio files in it.
13
+ - **Look**: background image, title icon, accent colours, title/message templates (`{title}` `{message}` `{kind}` `{time}`), plus per-kind overrides for background, icon and templates
14
+ - **Host**: script or exe host, script path, PowerShell path
15
+
16
+ Changes apply on "Save" — no restart needed.
17
+
18
+ ## Known limits
19
+
20
+ - Windows only (`os: ["win32"]`): the card host is WinForms.
21
+ - Each card spawns a PowerShell process; `Add-Type` compilation takes about 0.6 s before the card appears.
22
+ - The card lives with the DSH host process; closing DSH closes a card that is still on screen.
@@ -0,0 +1,22 @@
1
+ # 桌面提醒 dsh-reminder-notify
2
+
3
+ 给 DeepSeek Harness 加一个 `notify_user` 工具:模型在任务收尾(`kind=done`)或征求同意之前(`kind=decide`)调用它,屏幕右下角弹出提醒卡片并播放对应语音,不抢焦点、按秒自动关闭。
4
+
5
+ 卡片宿主是包内的 `host/ReminderHost.ps1`——用系统自带的 PowerShell 5.1 + WinForms 在运行期绘制,仓库里没有任何 exe,下载安装不会被 SmartScreen / 杀软拦。
6
+
7
+ ## 设置
8
+
9
+ 在「插件」页打开「桌面提醒」,描述下方就是设置面板,分四组:
10
+
11
+ - **基本**:停留秒数、弹窗位置、是否播放提示音
12
+ - **提示音**:提示音目录(可点「浏览…」选目录)、三档提示音文件名(wav / mp3),选了目录后下拉框会列出目录里的音频
13
+ - **外观**:背景图、标题图标、强调色、标题/正文模板(`{title}` `{message}` `{kind}` `{time}`),以及每档位单独覆盖的背景 / 图标 / 模板
14
+ - **宿主**:脚本模式或 exe 模式、脚本路径、PowerShell 路径
15
+
16
+ 改完点「保存」,立刻生效,不用重启。
17
+
18
+ ## 已知限制
19
+
20
+ - 仅 Windows(`os: ["win32"]`):卡片宿主是 WinForms。
21
+ - 每次弹卡片要起一个 PowerShell 进程,`Add-Type` 编译约 0.6 s 才出现。
22
+ - 卡片随 DSH 宿主进程存活;DSH 关掉时正在显示的卡片也会一起消失。
package/index.js CHANGED
@@ -26,38 +26,45 @@ const z = await import('@deepseek-ai/schemastery')
26
26
 
27
27
  // 插件页的设置表单由这份 schema 渲染(client.js 再在上面做分组面板)。
28
28
  // 每一项的默认值与 settingsOf() 里的兜底一致:空字符串表示「用包内资源」。
29
+ //
30
+ // 为什么每个字段都要 .volatile():宿主 settings.describe() 只把「可按热更新就地改动」
31
+ // 的字段投影进 namespaces(volatileForm 会跳过没有 volatile 标记的字段),而插件页的
32
+ // 设置面板只对 namespaces 里出现过的条目渲染 form。不标 volatile 的话面板会拿到
33
+ // undefined 并显示「这个页面拿不到插件配置」。
34
+ // 标了 volatile 还有个好处:改完立刻生效,不用重启插件 —— notify() 每次调用都会用
35
+ // settingsOf(config) 现读,所以拿到的就是最新值。
29
36
  export const Config = z === null ? undefined : z.object({
30
- hostMode: z.union(['script', 'exe']).default('script').description('宿主模式:script = 包内 PowerShell 脚本(默认),exe = 老的客户端 exe'),
31
- scriptPath: z.string().default('').description('脚本宿主路径,留空 = 包内 host/ReminderHost.ps1'),
32
- powershellPath: z.string().default('powershell.exe').description('调 PowerShell 用的可执行文件'),
33
- clientDir: z.string().default('').description('exe 模式下的客户端目录,留空 = 包内 assets/'),
34
- audioDir: z.string().default('').description('提示音目录,留空 = 包内 assets/提示音导入/'),
35
- seconds: z.number().min(2).max(600).step(1).default(60).description('弹窗停留秒数(2–600)'),
36
- position: z.union(['br', 'center', 'tr']).default('br').description('弹窗位置:br 右下、center 居中、tr 右上'),
37
- sound: z.boolean().default(true).description('是否播放提示音'),
38
- doneAudio: z.string().default('完成提醒语音.wav').description('done 档位的提示音文件名(wav / mp3,在提示音目录下)'),
39
- decideAudio: z.string().default('需要你来决定.wav').description('decide 档位的提示音文件名(wav / mp3)'),
40
- rawAudio: z.string().default('').description('raw 档位的提示音文件名(wav / mp3),留空 = 静音'),
41
- accentDone: z.string().default('#2ECC71').description('done 档位卡片强调色(#RRGGBB)'),
42
- accentDecide: z.string().default('#F5A623').description('decide 档位卡片强调色'),
43
- accentRaw: z.string().default('#4C8DFF').description('raw 档位卡片强调色'),
44
- cooldownMs: z.number().min(0).step(100).default(1500).description('同档位提醒的最小间隔(毫秒)'),
45
- cardBackground: z.string().default('').description('卡片背景图路径(png / jpg),留空 = 纯色背景'),
46
- cardIcon: z.string().default('').description('标题左侧的小图标路径(png / ico),留空 = 不显示'),
47
- doneCardBackground: z.string().default('').description('done 档位单独用的背景图,留空 = 用上面的通用背景'),
48
- decideCardBackground: z.string().default('').description('decide 档位单独用的背景图,留空 = 用通用背景'),
49
- rawCardBackground: z.string().default('').description('raw 档位单独用的背景图,留空 = 用通用背景'),
50
- doneCardIcon: z.string().default('').description('done 档位单独用的标题图标,留空 = 用通用图标'),
51
- decideCardIcon: z.string().default('').description('decide 档位单独用的标题图标,留空 = 用通用图标'),
52
- rawCardIcon: z.string().default('').description('raw 档位单独用的标题图标,留空 = 用通用图标'),
53
- titleTemplate: z.string().default('{title}').description('标题模板,可用占位符 {title} {message} {kind} {time}'),
54
- messageTemplate: z.string().default('{message}').description('正文模板,可用占位符 {title} {message} {kind} {time}'),
55
- doneTitleTemplate: z.string().default('').description('done 档位单独的标题模板,留空 = 用上面的通用模板'),
56
- doneMessageTemplate: z.string().default('').description('done 档位单独的正文模板,留空 = 用通用模板'),
57
- decideTitleTemplate: z.string().default('').description('decide 档位单独的标题模板,留空 = 用通用模板'),
58
- decideMessageTemplate: z.string().default('').description('decide 档位单独的正文模板,留空 = 用通用模板'),
59
- rawTitleTemplate: z.string().default('').description('raw 档位单独的标题模板,留空 = 用通用模板'),
60
- rawMessageTemplate: z.string().default('').description('raw 档位单独的正文模板,留空 = 用通用模板'),
37
+ hostMode: z.union(['script', 'exe']).default('script').description('宿主模式:script = 包内 PowerShell 脚本(默认),exe = 老的客户端 exe').volatile(),
38
+ scriptPath: z.string().default('').description('脚本宿主路径,留空 = 包内 host/ReminderHost.ps1').volatile(),
39
+ powershellPath: z.string().default('powershell.exe').description('调 PowerShell 用的可执行文件').volatile(),
40
+ clientDir: z.string().default('').description('exe 模式下的客户端目录,留空 = 包内 assets/').volatile(),
41
+ audioDir: z.string().default('').description('提示音目录,留空 = 包内 assets/提示音导入/').volatile(),
42
+ seconds: z.number().min(2).max(600).step(1).default(60).description('弹窗停留秒数(2–600)').volatile(),
43
+ position: z.union(['br', 'center', 'tr']).default('br').description('弹窗位置:br 右下、center 居中、tr 右上').volatile(),
44
+ sound: z.boolean().default(true).description('是否播放提示音').volatile(),
45
+ doneAudio: z.string().default('完成提醒语音.wav').description('done 档位的提示音文件名(wav / mp3,在提示音目录下)').volatile(),
46
+ decideAudio: z.string().default('需要你来决定.wav').description('decide 档位的提示音文件名(wav / mp3)').volatile(),
47
+ rawAudio: z.string().default('').description('raw 档位的提示音文件名(wav / mp3),留空 = 静音').volatile(),
48
+ accentDone: z.string().default('#2ECC71').description('done 档位卡片强调色(#RRGGBB)').volatile(),
49
+ accentDecide: z.string().default('#F5A623').description('decide 档位卡片强调色').volatile(),
50
+ accentRaw: z.string().default('#4C8DFF').description('raw 档位卡片强调色').volatile(),
51
+ cooldownMs: z.number().min(0).step(100).default(1500).description('同档位提醒的最小间隔(毫秒)').volatile(),
52
+ cardBackground: z.string().default('').description('卡片背景图路径(png / jpg),留空 = 纯色背景').volatile(),
53
+ cardIcon: z.string().default('').description('标题左侧的小图标路径(png / ico),留空 = 不显示').volatile(),
54
+ doneCardBackground: z.string().default('').description('done 档位单独用的背景图,留空 = 用上面的通用背景').volatile(),
55
+ decideCardBackground: z.string().default('').description('decide 档位单独用的背景图,留空 = 用通用背景').volatile(),
56
+ rawCardBackground: z.string().default('').description('raw 档位单独用的背景图,留空 = 用通用背景').volatile(),
57
+ doneCardIcon: z.string().default('').description('done 档位单独用的标题图标,留空 = 用通用图标').volatile(),
58
+ decideCardIcon: z.string().default('').description('decide 档位单独用的标题图标,留空 = 用通用图标').volatile(),
59
+ rawCardIcon: z.string().default('').description('raw 档位单独用的标题图标,留空 = 用通用图标').volatile(),
60
+ titleTemplate: z.string().default('{title}').description('标题模板,可用占位符 {title} {message} {kind} {time}').volatile(),
61
+ messageTemplate: z.string().default('{message}').description('正文模板,可用占位符 {title} {message} {kind} {time}').volatile(),
62
+ doneTitleTemplate: z.string().default('').description('done 档位单独的标题模板,留空 = 用上面的通用模板').volatile(),
63
+ doneMessageTemplate: z.string().default('').description('done 档位单独的正文模板,留空 = 用通用模板').volatile(),
64
+ decideTitleTemplate: z.string().default('').description('decide 档位单独的标题模板,留空 = 用通用模板').volatile(),
65
+ decideMessageTemplate: z.string().default('').description('decide 档位单独的正文模板,留空 = 用通用模板').volatile(),
66
+ rawTitleTemplate: z.string().default('').description('raw 档位单独的标题模板,留空 = 用通用模板').volatile(),
67
+ rawMessageTemplate: z.string().default('').description('raw 档位单独的正文模板,留空 = 用通用模板').volatile(),
61
68
  })
62
69
 
63
70
  const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)))
@@ -103,8 +110,31 @@ function clamp(value, min, max) {
103
110
  return Math.min(max, Math.max(min, value))
104
111
  }
105
112
 
113
+ // 标了 .volatile() 的字段在运行期是 { get(), [write]() } 包装(schemastery 的热更新句柄),
114
+ // 直接读会把字符串读成 "[object Object]",所以统一在这里解包。
115
+ function unwrapValue(value) {
116
+ if (value !== null && typeof value === 'object' && typeof value.get === 'function') {
117
+ try {
118
+ return value.get()
119
+ } catch {
120
+ return undefined
121
+ }
122
+ }
123
+ return value
124
+ }
125
+
126
+ function configValues(config) {
127
+ const out = {}
128
+ if (config !== null && typeof config === 'object') {
129
+ for (const key of Object.keys(config)) {
130
+ Object.defineProperty(out, key, { value: unwrapValue(config[key]), enumerable: true })
131
+ }
132
+ }
133
+ return out
134
+ }
135
+
106
136
  function settingsOf(config) {
107
- const c = config && typeof config === 'object' ? config : {}
137
+ const c = configValues(config)
108
138
  const position = str(c.position, 'br')
109
139
  const hostMode = str(c.hostMode, 'script').toLowerCase()
110
140
  return {
package/locale/en.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "meta": {
3
3
  "title": "Desktop reminder",
4
4
  "description": "Pop a floating reminder with voice when work is done or a decision is needed.",
5
- "detail": "Registers the notify_user tool, which pops a bottom-right reminder card with the matching voice — never stealing focus, auto-dismissing after N seconds. The card is drawn by host/ReminderHost.ps1 with the system PowerShell + WinForms at run time, so the package ships no exe and is not blocked by SmartScreen or antivirus. Duration, position, sounds, accent colours and the cooldown live in the plugin Config; hostMode=exe still points at the original client folder on older machines."
5
+ "detail": "docs/detail.en.md"
6
6
  }
7
7
  }
package/locale/zh.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "meta": {
3
3
  "title": "桌面提醒",
4
4
  "description": "工作收尾和需要你拍板时,弹出浮动提醒并播放语音。",
5
- "detail": "把「桌面提醒」包成插件:注册 notify_user 工具,模型在任务收尾(kind=done)或征求同意之前(kind=decide)调用它,右下角弹出提醒卡片并播放对应语音,不抢焦点、按秒自动关闭。卡片宿主是包内的 host/ReminderHost.ps1——用系统自带的 PowerShell + WinForms 在运行期绘制,仓库里没有任何 exe,下载安装不会被 SmartScreen / 杀软拦。停留秒数、位置、提示音、强调色、冷却间隔都在插件 Config 里改;老机器仍可用 hostMode=exe 指向原来的客户端目录。"
5
+ "detail": "docs/detail.zh.md"
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-reminder-notify",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "DSH 桌面提醒插件:把「完成/需要决定」提醒变成 notify_user 工具(浮动卡片 + 提示音,不抢焦点,纯 PowerShell 源码宿主,仓库零 exe)",
5
5
  "author": "Jiangshuaiye1203",
6
6
  "type": "module",
@@ -48,8 +48,8 @@
48
48
  },
49
49
  "versions": [
50
50
  {
51
- "version": "0.7.0",
52
- "publishTimestamp": 1795081200,
51
+ "version": "0.8.0",
52
+ "publishTimestamp": 1795082055,
53
53
  "source": {
54
54
  "type": "npm"
55
55
  },