dsh-reminder-notify 0.0.0-stage → 0.2.2
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/LICENSE +21 -0
- package/README.md +53 -2
- package/assets//346/217/220/347/244/272/351/237/263/345/257/274/345/205/245//345/256/214/346/210/220/346/217/220/351/206/222/350/257/255/351/237/263.wav +0 -0
- package/assets//346/217/220/347/244/272/351/237/263/345/257/274/345/205/245//351/234/200/350/246/201/344/275/240/346/235/245/345/206/263/345/256/232.wav +0 -0
- package/cordis.patch.yml +47 -0
- package/docs/DETAIL.md +86 -0
- package/docs/INSTALL-ZIP.md +30 -0
- package/docs/PUBLISH.md +114 -0
- package/docs/PUSH-CHECKLIST.md +172 -0
- package/host/ReminderHost.ps1 +271 -0
- package/icon.svg +13 -0
- package/index.js +314 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +55 -4
- package/publish/index.json +61 -0
- package/scripts/build-index.mjs +153 -0
- package/scripts/npm-login-and-publish.ps1 +82 -0
- package/scripts/npm-login-tee.ps1 +35 -0
- package/scripts/npm-publish-interactive.ps1 +20 -0
- package/scripts/publish-npm-window.cmd +3 -0
- package/scripts/publish-npm.cmd +5 -0
- package/scripts/publish-npm.ps1 +76 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-reminder-notify 作者(把这一行换成你的名字)
|
|
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.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-reminder-notify
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 DeepSeek Harness 加一个 **`notify_user`** 工具:模型在任务收尾(`kind=done`)或征求同意之前(`kind=decide`)调用它,屏幕上就弹一张右下角卡片 + 播放对应语音,不抢焦点、按秒自动关闭。
|
|
4
|
+
|
|
5
|
+
**仓库里没有任何 exe**:卡片由包内的 `host/ReminderHost.ps1` 用系统自带的 PowerShell 5.1 + WinForms 在运行期编译绘制(`Add-Type` + 内联 C#),所以下载后不会被 SmartScreen / 杀软当成未知程序拦下来,也不需要代码签名证书。
|
|
6
|
+
|
|
7
|
+
## 装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
dsh plugin --profile desktop add link:<本目录绝对路径>
|
|
11
|
+
# 或在插件页用 install_bundle 指向本目录
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
装完新会话就有 `notify_user`。
|
|
15
|
+
|
|
16
|
+
## 用
|
|
17
|
+
|
|
18
|
+
| 场景 | 调用 |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| 活儿干完了 | `notify_user(kind="done")` |
|
|
21
|
+
| 要用户拍板 | `notify_user(kind="decide")` |
|
|
22
|
+
| 自定义 | `notify_user(kind="raw", title="…", message="…", seconds=20, sound=false)` |
|
|
23
|
+
|
|
24
|
+
返回值是 JSON(`pid`、`host`、`audio`、`hostMode`),失败也不抛异常。
|
|
25
|
+
|
|
26
|
+
## 资产
|
|
27
|
+
|
|
28
|
+
| 东西 | 位置 |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| 卡片宿主 | `host/ReminderHost.ps1`(纯文本,约 10 KB) |
|
|
31
|
+
| 提示音 | `assets/提示音导入/{完成提醒语音,需要你来决定}.wav` |
|
|
32
|
+
| 图标 | `icon.svg` |
|
|
33
|
+
|
|
34
|
+
整包只有音频是二进制,剩下的都是可读文本。
|
|
35
|
+
|
|
36
|
+
## 为什么不用 exe
|
|
37
|
+
|
|
38
|
+
旧方案是 `spawn('Harness完成提醒.exe', argv)`——弹出效果一样好,但分享给别人时:
|
|
39
|
+
未签名 exe 会被 SmartScreen 拦一次,杀软可能直接删掉它,用户还得先「仍要运行」。
|
|
40
|
+
|
|
41
|
+
现在宿主是脚本:仓库零二进制、可审计、可改样式;`hostMode: "exe"` 仍然保留,
|
|
42
|
+
给自己已经装了客户端的机器当兼容开关。
|
|
43
|
+
|
|
44
|
+
## 配置
|
|
45
|
+
|
|
46
|
+
都在插件 Config 里(`cordis.patch.yml` / 插件页):`seconds`(默认 60)、`position`(`br`/`center`/`tr`)、
|
|
47
|
+
`sound`、`doneAudio`/`decideAudio`、`accentDone`/`accentDecide`/`accentRaw`、`cooldownMs`(默认 1500)。
|
|
48
|
+
`hostMode` 切宿主实现,`scriptPath`/`powershellPath`/`audioDir` 一般不用动。
|
|
49
|
+
|
|
50
|
+
## 已知限制
|
|
51
|
+
|
|
52
|
+
- 仅 Windows(`os: ["win32"]`):卡片宿主是 WinForms。
|
|
53
|
+
- 每次弹卡片要起一个 PowerShell 进程,`Add-Type` 编译约 0.6 s 才出现(有轻微延迟,播放与动画照旧)。
|
|
54
|
+
- 卡片随 DSH 宿主进程存活;DSH 关掉时正在显示的卡片也会一起消失。
|
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# dsh-reminder-notify —— DSH bundle patch
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# 插件挂载声明:DSH 启动时按 bundle 层栈叠加各插件 patch,把本插件的 row
|
|
5
|
+
# 插入 profile 的配置树。row id 与包名同名,便于在插件页找到它。
|
|
6
|
+
#
|
|
7
|
+
# 安装(不需要手工改 profile 的 patch):
|
|
8
|
+
# dsh plugin --profile desktop add link:<本目录绝对路径>
|
|
9
|
+
# 或直接用 DSH 的 plugin_manager install_bundle target=<本目录绝对路径>。
|
|
10
|
+
#
|
|
11
|
+
# config 里的每一项都可以在插件页 / cordis.patch.yml 里改;这里给的是默认值。
|
|
12
|
+
# ============================================================================
|
|
13
|
+
|
|
14
|
+
- insert:
|
|
15
|
+
- id: dsh-reminder-notify
|
|
16
|
+
name: dsh-reminder-notify
|
|
17
|
+
config:
|
|
18
|
+
# 宿主模式:
|
|
19
|
+
# script(默认)= 包内 host/ReminderHost.ps1,用系统自带 PowerShell + WinForms
|
|
20
|
+
# 在运行期编译绘制,仓库里没有 exe,不会被 SmartScreen 拦。
|
|
21
|
+
# exe = 老的 Harness完成提醒.exe,只给已装客户端的机器留的兼容开关。
|
|
22
|
+
hostMode: script
|
|
23
|
+
# 脚本宿主路径;留空 = 包内 host/ReminderHost.ps1
|
|
24
|
+
scriptPath: ''
|
|
25
|
+
# 调 PowerShell 用的可执行文件,一般不用改
|
|
26
|
+
powershellPath: powershell.exe
|
|
27
|
+
# exe 模式下生效:空的 clientDir = 用包内 assets/;填绝对路径则用外部客户端目录
|
|
28
|
+
clientDir: ''
|
|
29
|
+
# 提示音目录;留空 = 包内 assets/提示音导入/
|
|
30
|
+
audioDir: ''
|
|
31
|
+
# 弹窗停留秒数(2–600)
|
|
32
|
+
seconds: 60
|
|
33
|
+
# 弹窗位置:br = 右下角(默认)、center = 居中、tr = 右上角
|
|
34
|
+
position: br
|
|
35
|
+
# 是否播放提示音;工具调用时传 sound:false 可以只弹窗不出声
|
|
36
|
+
sound: true
|
|
37
|
+
# 提示音文件名,在 audioDir 下解析
|
|
38
|
+
doneAudio: 完成提醒语音.wav
|
|
39
|
+
decideAudio: 需要你来决定.wav
|
|
40
|
+
# raw 档位的默认音频;留空 = 静音
|
|
41
|
+
rawAudio: ''
|
|
42
|
+
# 卡片左侧强调色(#RRGGBB)
|
|
43
|
+
accentDone: '#2ECC71'
|
|
44
|
+
accentDecide: '#F5A623'
|
|
45
|
+
accentRaw: '#4C8DFF'
|
|
46
|
+
# 同档位提醒的最小间隔(毫秒),防止模型在同一轮重复调用
|
|
47
|
+
cooldownMs: 1500
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# dsh-reminder-notify 细节说明
|
|
2
|
+
|
|
3
|
+
## 1. 一个提醒的生命周期
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
模型调用 notify_user(kind='done', message='…')
|
|
7
|
+
│
|
|
8
|
+
├─ 读 row config(hostMode / seconds / position / sound / *Audio / cooldownMs)
|
|
9
|
+
├─ 同档位冷却检查(cooldownMs,默认 1500ms)
|
|
10
|
+
├─ hostMode = 'script'(默认)
|
|
11
|
+
│ spawn(powershell.exe, ['-NoProfile','-NonInteractive','-ExecutionPolicy','Bypass',
|
|
12
|
+
│ '-WindowStyle','Hidden','-File', host/ReminderHost.ps1,
|
|
13
|
+
│ '-Title', t, '-Msg', m, '-Seconds', s, '-Pos', p, '-Accent', '2ECC71',
|
|
14
|
+
│ '-Audio', <绝对路径 wav> | '-NoSound'],
|
|
15
|
+
│ { cwd: <包根>, stdio: 'ignore', windowsHide: true })
|
|
16
|
+
├─ hostMode = 'exe'(兼容老客户端)
|
|
17
|
+
│ spawn(<clientDir>/Harness完成提醒.exe, ['--title', …], { cwd: clientDir, … })
|
|
18
|
+
├─ 等 spawn 事件 → unref()(弹窗不拖住本轮对话)
|
|
19
|
+
├─ 最多再等 900ms 看进程是否暴毙(earlyExit,仅用于自检)
|
|
20
|
+
└─ 返回 JSON 字符串(工具文本输出)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
卡片由 `host/ReminderHost.ps1` 负责:内联 C# 的 `ReminderWindow : Form`,
|
|
24
|
+
`WS_EX_NOACTIVATE` + `ShowWithoutActivation` 保证不抢焦点,`SetWindowPos(... NOACTIVATE)`
|
|
25
|
+
让它显示在顶层;圆角深色卡片、左侧强调色条、标题 11.5pt 粗体、正文 9.5pt 自动折行、
|
|
26
|
+
底部「N 秒后自动关闭 · 点一下关掉」、Opacity 淡入淡出、`SoundPlayer` 异步放音。
|
|
27
|
+
|
|
28
|
+
## 2. 为什么不走 shell,为什么不是 detached
|
|
29
|
+
|
|
30
|
+
原来的 `发送提醒.ps1` 里有一个 `Q()` 函数专门给参数加引号 —— 那是在和 shell 的引号规则打架。
|
|
31
|
+
插件的 `spawn(file, argv)` 是 Node 的**参数数组**形式,每个元素独立转义,
|
|
32
|
+
中文、空格、`&`、括号都不需要调用方操心。
|
|
33
|
+
|
|
34
|
+
两个实测踩到的坑,都写进了代码注释:
|
|
35
|
+
|
|
36
|
+
| 坑 | 现象 | 结论 |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `detached: true` | PowerShell 404ms 就以 0 退出,什么都不画,连日志都不写 | 脚本宿主**不能** detached;靠 `windowsHide + stdio:'ignore' + unref()` 达到同样效果 |
|
|
39
|
+
| `-Accent "#2ECC71"` | 无引号时 `#` 被 PowerShell 当注释,`-Accent` 没值 → 进程秒退 | 传 `2ECC71`,由脚本自己补 `#` |
|
|
40
|
+
| `"` 出现在正文里 | PowerShell 重新解析命令行时可能吞掉后面参数 | `psSafe()` 把 `"` 换成 `'`、换行折成空格 |
|
|
41
|
+
|
|
42
|
+
## 3. 失败策略:永远不把收尾动作变成阻塞
|
|
43
|
+
|
|
44
|
+
| 情况 | 返回 | 影响 |
|
|
45
|
+
| --- | --- | --- |
|
|
46
|
+
| 找不到脚本宿主 | `{ ok: false, error: 'host-script-not-found' }` | 工具正常返回,本轮继续 |
|
|
47
|
+
| 找不到 exe(hostMode=exe) | `{ ok: false, error: 'client-not-found' }` | 同上 |
|
|
48
|
+
| 音频文件缺失 | 静音弹窗,返回里带 `audioMissing` | 提醒照常出现 |
|
|
49
|
+
| spawn 抛错 | `{ ok: false, error: 'spawn-failed', detail }` | 同上 |
|
|
50
|
+
| 非 Windows | `{ ok: false, error: 'only-windows' }` | 同上 |
|
|
51
|
+
| 同档位冷却中 | `{ ok: true, skipped: 'cooldown' }` | 不重复弹窗 |
|
|
52
|
+
| 宿主秒退 | `{ ok: true, earlyExit: <code> }` | 提醒可能没显示,但工具不报错 |
|
|
53
|
+
|
|
54
|
+
`notify_user` 永远是「发出去就完事」的语义:它不会因为提醒失败而让任务收尾失败。
|
|
55
|
+
|
|
56
|
+
## 4. Config 口径
|
|
57
|
+
|
|
58
|
+
| 键 | 默认 | 说明 |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `hostMode` | `script` | `script` = 包内 PowerShell 宿主;`exe` = 老 exe 客户端 |
|
|
61
|
+
| `scriptPath` | `''` | 空 = 包内 `host/ReminderHost.ps1` |
|
|
62
|
+
| `powershellPath` | `powershell.exe` | 一般不用改 |
|
|
63
|
+
| `clientDir` | `''` | 仅 exe 模式:空 = 包内 `assets/`;填绝对路径用外部客户端目录 |
|
|
64
|
+
| `audioDir` | `''` | 空 = 包内 `assets/提示音导入/` |
|
|
65
|
+
| `seconds` | `60` | 卡片停留秒数,夹在 2–600 |
|
|
66
|
+
| `position` | `br` | `br` 右下 / `center` 居中 / `tr` 右上 |
|
|
67
|
+
| `sound` | `true` | 全局开关;工具调用时 `sound:false` 可单次静音 |
|
|
68
|
+
| `doneAudio` | `完成提醒语音.wav` | done 档音频文件名 |
|
|
69
|
+
| `decideAudio` | `需要你来决定.wav` | decide 档音频文件名 |
|
|
70
|
+
| `rawAudio` | `''` | raw 档音频;空 = 静音 |
|
|
71
|
+
| `accentDone` / `accentDecide` / `accentRaw` | `#2ECC71` / `#F5A623` / `#4C8DFF` | 卡片左侧强调色 |
|
|
72
|
+
| `cooldownMs` | `1500` | 同档位最小间隔,0 = 关闭冷却 |
|
|
73
|
+
|
|
74
|
+
工具参数(`seconds` / `sound`)优先于 Config;Config 优先于代码内默认值。
|
|
75
|
+
|
|
76
|
+
## 5. 与旧客户端共存
|
|
77
|
+
|
|
78
|
+
- 旧客户端目录**原样不动**:`发送提醒.ps1`、`配置.ini`、`需要你来决定.exe` 都还在,双击照样用。
|
|
79
|
+
- 插件自带两个 wav(约 830 KB),卡片宿主是纯脚本,所以整包可搬走,不依赖 `D:\a豆包制作工作`。
|
|
80
|
+
- 想共用同一份音频/换音色:`audioDir` 指到旧目录的 `提示音导入\` 即可。
|
|
81
|
+
- 老机器上仍想用 exe:`hostMode: 'exe'` + `clientDir` 指向客户端目录。
|
|
82
|
+
|
|
83
|
+
## 6. 卸载
|
|
84
|
+
|
|
85
|
+
插件页停用/删除 `dsh-reminder-notify` 即可;如果要连同旧脚本一起退休,
|
|
86
|
+
再把 AGENTS.md 里那两条「运行 发送提醒.ps1」改成「调用 `notify_user`」。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# 分发说明(不经过插件市场,直接发文件)
|
|
2
|
+
|
|
3
|
+
适用场景:暂时没有可用的插件索引(GitHub 打不开 / 还没上架),直接把插件发给别人装。
|
|
4
|
+
包内**没有任何 exe**,卡片由系统自带的 PowerShell 5.1 + WinForms 绘制,不需要签名、不会被 SmartScreen 拦。
|
|
5
|
+
|
|
6
|
+
## 对方要做的事(3 步)
|
|
7
|
+
|
|
8
|
+
1. 把 `dsh-reminder-notify-0.2.0.zip` 解压到任意目录,例如
|
|
9
|
+
`C:\Users\<用户名>\Downloads\dsh-reminder-notify`
|
|
10
|
+
2. 打开 DeepSeek Harness → **插件** 页 → 安装 → 粘贴**解压后那个文件夹的绝对路径**:
|
|
11
|
+
```
|
|
12
|
+
C:\Users\<用户名>\Downloads\dsh-reminder-notify
|
|
13
|
+
```
|
|
14
|
+
(或者命令行:`dsh plugin --profile desktop add "C:\Users\<用户名>\Downloads\dsh-reminder-notify"`)
|
|
15
|
+
3. 重启 `dsh web`,新会话里就会多出一个 `notify_user` 工具。
|
|
16
|
+
|
|
17
|
+
## 装好之后怎么用
|
|
18
|
+
|
|
19
|
+
对 Harness 说:
|
|
20
|
+
|
|
21
|
+
- 「做完的时候提醒我」→ 它会在收尾时调用 `notify_user(kind="done")`,右下角弹卡片 + 播一句语音;
|
|
22
|
+
- 「有结果需要我拍板就提醒我」→ `notify_user(kind="decide")`,换另一种音效和标题。
|
|
23
|
+
|
|
24
|
+
也可以在 AGENTS.md 里写一条长期规则,让它每轮收尾自动调用。
|
|
25
|
+
|
|
26
|
+
## 要求
|
|
27
|
+
|
|
28
|
+
- Windows 10/11,系统自带 PowerShell 5.1(不用另装);
|
|
29
|
+
- 只在第一次弹窗时慢约 0.6 秒(Add-Type 现场编译 C# 绘制代码),之后每次调用都很快;
|
|
30
|
+
- 想改停留秒数、位置、配色,改插件行的配置(`seconds` / `position` / `accentDone` 等),不用改代码。
|
package/docs/PUBLISH.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# 上架 / 分享:自建插件索引
|
|
2
|
+
|
|
3
|
+
DSH 的「插件市场 → 发现」页读的是**索引 URL**:一份 JSON(市场索引格式 1),列出插件与可安装版本。
|
|
4
|
+
索引本身不托管代码,只给出版本从哪儿装(`git` 仓库 + 固定提交,或 npm 包名)。
|
|
5
|
+
本目录的 `index.json` 由 `scripts/build-index.mjs` 生成,**不要手改**。
|
|
6
|
+
|
|
7
|
+
## 已发布状态(2026-11-18)
|
|
8
|
+
|
|
9
|
+
| 项目 | 值 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| 公开仓库 | https://github.com/Jiangshuaiye1203/dsh-reminder-notify |
|
|
12
|
+
| 索引地址(他人添加这个) | `https://jiangshuaiye1203.github.io/dsh-reminder-notify/publish/index.json` |
|
|
13
|
+
| 站点首页 | https://jiangshuaiye1203.github.io/dsh-reminder-notify/ |
|
|
14
|
+
| 当前版本 | 0.2.0,装源固定提交 `923cfe625fc737e1b39ba3cfc382061100a67e02` |
|
|
15
|
+
| Pages | Deploy from a branch,`main` / `(root)` |
|
|
16
|
+
|
|
17
|
+
发新版只需要:改代码 → 提交 → push → `node scripts/build-index.mjs --publish` → push。
|
|
18
|
+
|
|
19
|
+
## 0. 结构
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
/index.js package.json cordis.patch.yml host/ assets/ locale/ docs/
|
|
23
|
+
scripts/build-index.mjs # 生成索引
|
|
24
|
+
publish/index.json # 生成的索引(提交进仓库后,Pages 就能访问到它)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 1. 先把仓库公开(这一步别人才能装)
|
|
28
|
+
|
|
29
|
+
索引的 git 来源必须是**匿名可读**的 https 仓库,且提交要能 `git fetch` 到。
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
cd "C:/Users/Administrator/Documents/deepseek-harness/default-workspace/dsh-reminder-notify"
|
|
33
|
+
git remote add origin https://github.com/<你的账号>/dsh-reminder-notify.git
|
|
34
|
+
git push -u origin main
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- 仓库里要包含 `host/` 与 `assets/提示音导入/`(两个 wav,约 830 KB),否则装上也弹不出东西;仓库里**没有 exe**。
|
|
38
|
+
- 私有仓库不行:装插件的一方是 pnpm 直接 clone,不走你的登录态。
|
|
39
|
+
|
|
40
|
+
## 2. 生成索引
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
node scripts/build-index.mjs # 自动读 remote.origin.url 与 HEAD
|
|
44
|
+
node scripts/build-index.mjs --repo https://github.com/me/dsh-reminder-notify --commit <sha>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
产物 `publish/index.json` 里,每个版本是 `{ version, publishTimestamp, source: { type: 'git', url, commit }, engines }`,
|
|
48
|
+
插件市场据此拼出安装串 `git+<url>.git#<commit>`。`icon` 内联成 `data:` URL(≤32 KiB),不依赖外部图片。
|
|
49
|
+
|
|
50
|
+
## 3. 托管索引
|
|
51
|
+
|
|
52
|
+
最省事:GitHub Pages。
|
|
53
|
+
|
|
54
|
+
1. 仓库 Settings → Pages → Source 选 `Deploy from a branch`,分支 `main`,目录 `/ (root)`。
|
|
55
|
+
2. 等一会儿,索引地址就是:
|
|
56
|
+
`https://<你的账号>.github.io/dsh-reminder-notify/publish/index.json`
|
|
57
|
+
3. 浏览器打开这个地址,能看到 JSON 就对了(`content-type` 是 `application/json` 或 `text/plain` 都行)。
|
|
58
|
+
|
|
59
|
+
不想用 Pages 也行:gist 的 raw 链接、任意静态 https 空间都可以,只要**直链 + 无鉴权**。
|
|
60
|
+
|
|
61
|
+
## 4. 对方怎么装
|
|
62
|
+
|
|
63
|
+
在 DSH 里:插件页 →「插件源 / 添加索引 URL」→ 粘贴上面的索引地址 → 「发现」页会出现「桌面提醒」→ 安装。
|
|
64
|
+
等价命令行:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
dsh plugin --profile desktop add "git+https://github.com/<你的账号>/dsh-reminder-notify.git#<40位sha>"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 5. 发新版本
|
|
71
|
+
|
|
72
|
+
1. 改 `package.json` 的 `version`(如 `0.1.1`);
|
|
73
|
+
2. `git commit` + `git push`;
|
|
74
|
+
3. 重跑 `node scripts/build-index.mjs`,把 `publish/index.json` 也提交推送。
|
|
75
|
+
|
|
76
|
+
忘了第 3 步,索引里就还是旧提交,别人装到的也是旧代码。
|
|
77
|
+
|
|
78
|
+
## 6. 改走 npm 源(国内可装)
|
|
79
|
+
|
|
80
|
+
git 源要求安装方能直连 github.com,国内无代理基本装不上。索引格式 1 的版本节点还支持 `source: { "type": "npm" }`,
|
|
81
|
+
此时市场用 `pnpm add <包名>@<版本>` 安装,走 npm 源,国内镜像可用。
|
|
82
|
+
|
|
83
|
+
一次性的准备(只需要做一次):
|
|
84
|
+
|
|
85
|
+
1. 在 https://www.npmjs.com/signup 注册账号并验证邮箱;
|
|
86
|
+
2. 双击 `scripts/publish-npm.cmd`(内部会自动找 DSH 自带的 node + pnpm),按提示登录并发布
|
|
87
|
+
`dsh-reminder-notify@0.2.0`。密码由 npm 自己处理,脚本只负责串起登录和发布两步;
|
|
88
|
+
3. 确认 https://www.npmjs.com/package/dsh-reminder-notify 能打开。
|
|
89
|
+
|
|
90
|
+
发布成功后,把索引的装源改成 npm:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 没有 node 在 PATH 时,用 DSH 自带的 node:%USERPROFILE%\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe
|
|
94
|
+
node scripts/build-index.mjs --npm --publish
|
|
95
|
+
git push
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
产物的版本节点变成:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{ "version": "0.2.0", "publishTimestamp": 1795011057, "source": { "type": "npm" }, "engines": {} }
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
以后发新版:改版本号 → `publish-npm.cmd` 发布新版本 → `build-index.mjs --npm --publish` → push。
|
|
105
|
+
版本号一旦发布就不能覆盖,改代码要顺带抬版本。
|
|
106
|
+
|
|
107
|
+
> 想指定镜像(如 `https://registry.npmmirror.com`)可加 `--registry`;
|
|
108
|
+
> 不指定就由安装方用自己的 npm 源。发布本身必须发到 registry.npmjs.org。
|
|
109
|
+
|
|
110
|
+
## 7. 上架前值得知道的三件事
|
|
111
|
+
|
|
112
|
+
- **只有 Windows 能用**:插件 `os: ["win32"]`,卡片宿主是 PowerShell 5.1 + WinForms(系统自带)。
|
|
113
|
+
- **没有 exe,所以不触发 SmartScreen**:仓库里唯一的二进制是两个 wav,宿主 `host/ReminderHost.ps1` 是可直接审计的文本。代价是每次弹卡片要起一个 PowerShell 进程(`Add-Type` 编译约 0.6 s),以及这台机器必须允许 PowerShell 执行本地脚本——脚本用 `-ExecutionPolicy Bypass` 调起,不改系统策略。
|
|
114
|
+
- **音频版权**:两个 wav 是 TTS 合成,自己用没问题;公开分发前确认合成服务的商用条款。
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# 上架清单:建仓库 → 推送 → 提交索引 → 开 Pages
|
|
2
|
+
|
|
3
|
+
> 目标:让别人在 DSH 的「插件市场 → 发现」里看到「桌面提醒」,一键装上。
|
|
4
|
+
> 全程只需要 GitHub 网页 + 本地这几条命令,不需要 `gh` CLI,也不需要代码签名。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 0. 前置检查(1 分钟)
|
|
9
|
+
|
|
10
|
+
在 PowerShell 里:
|
|
11
|
+
|
|
12
|
+
```powershell
|
|
13
|
+
cd "C:\Users\Administrator\Documents\deepseek-harness\default-workspace\dsh-reminder-notify"
|
|
14
|
+
git log --oneline # 应该只有一条:桌面提醒插件 0.2.0:…
|
|
15
|
+
git status --short # 应该是空的
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`node` 用哪个?本机系统 `node` 可能没装,DSH 自带的这个一定在:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
$env:NODE = "C:\Users\Administrator\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin\node.exe"
|
|
22
|
+
& $env:NODE --version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
(下面命令里的 `node` 都换成 `& $env:NODE` 即可。)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 1. 在 GitHub 网页上建仓库
|
|
30
|
+
|
|
31
|
+
1. 打开 <https://github.com/new>;
|
|
32
|
+
2. Repository name 填 **`dsh-reminder-notify`**(要和本地目录同名,后面命令就不用改);
|
|
33
|
+
3. 选 **Public**(私有仓库别人 clone 不了,插件装不上);
|
|
34
|
+
4. **不要**勾 "Add a README file"、不要选 .gitignore、不要选 license(本地已经有了,勾了会冲突);
|
|
35
|
+
5. 点 **Create repository**。
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 2. 绑定 remote 并推第一次
|
|
40
|
+
|
|
41
|
+
把 `<你的账号>` 换成你的 GitHub 用户名:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
cd "C:\Users\Administrator\Documents\deepseek-harness\default-workspace\dsh-reminder-notify"
|
|
45
|
+
|
|
46
|
+
git remote add origin https://github.com/<你的账号>/dsh-reminder-notify.git
|
|
47
|
+
git push -u origin main
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- 第一次 push 会弹 GitHub 登录窗(浏览器授权),或者要求填 Personal Access Token。
|
|
51
|
+
- 如果 remote 已存在:`git remote set-url origin https://github.com/<你的账号>/dsh-reminder-notify.git`。
|
|
52
|
+
- 成功标志:仓库页面能看到 `host/`、`assets/`、`cordis.patch.yml`,**没有任何 .exe**。
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 3. 生成索引并提交(一条命令)
|
|
57
|
+
|
|
58
|
+
索引里写死了「仓库地址 + 提交号」,所以必须在 remote 配好之后再生成。
|
|
59
|
+
|
|
60
|
+
```powershell
|
|
61
|
+
cd "C:\Users\Administrator\Documents\deepseek-harness\default-workspace\dsh-reminder-notify"
|
|
62
|
+
node scripts/build-index.mjs --publish
|
|
63
|
+
git push
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`--publish` 会:
|
|
67
|
+
|
|
68
|
+
1. 写出 `publish/index.json`;
|
|
69
|
+
2. 只把这一个文件 `git add` + `commit`(不会顺手带走你别的改动);
|
|
70
|
+
3. 打印「下一步:git push」。
|
|
71
|
+
|
|
72
|
+
输出长这样:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
已写入 …\publish\index.json
|
|
76
|
+
插件 dsh-reminder-notify@0.2.0
|
|
77
|
+
仓库 https://github.com/<你的账号>/dsh-reminder-notify
|
|
78
|
+
提交 <40 位 sha>
|
|
79
|
+
[main xxxxxxx] 索引:dsh-reminder-notify@0.2.0(xxxxxxx)
|
|
80
|
+
已提交:publish/index.json
|
|
81
|
+
下一步:git push
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
> 想先看索引内容不提交:去掉 `--publish`,文件照样生成。
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 4. 开 GitHub Pages(索引的公开地址)
|
|
89
|
+
|
|
90
|
+
1. 仓库页 → **Settings** → 左侧 **Pages**;
|
|
91
|
+
2. Source 选 **Deploy from a branch**;
|
|
92
|
+
3. Branch 选 **`main`**,目录选 **`/ (root)`**,点 **Save**;
|
|
93
|
+
4. 等 30–60 秒,页面顶部会出现地址:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
https://<你的账号>.github.io/dsh-reminder-notify/
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 5. 自检(必须做,10 秒)
|
|
102
|
+
|
|
103
|
+
浏览器打开:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
https://<你的账号>.github.io/dsh-reminder-notify/publish/index.json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- 能看到一段 JSON、开头是 `"format": 1` → 成功;
|
|
110
|
+
- 404 → 等一会儿再刷;还 404 就回第 4 步确认分支是 `main`、目录是 `/ (root)`、文件在仓库的 `publish/` 下(不是根目录)。
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 6. 别人怎么装(发给对方的就是这一段)
|
|
115
|
+
|
|
116
|
+
**图形界面**:DSH → 插件页 →「插件源 / 添加索引 URL」→ 粘贴:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
https://<你的账号>.github.io/dsh-reminder-notify/publish/index.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
然后在「发现」页找到「桌面提醒」→ 安装。
|
|
123
|
+
|
|
124
|
+
**命令行等价**:
|
|
125
|
+
|
|
126
|
+
```powershell
|
|
127
|
+
dsh plugin --profile desktop add "git+https://github.com/<你的账号>/dsh-reminder-notify.git#<40 位 sha>"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
装完重启一次 `dsh web`,新会话里就有 `notify_user` 工具。
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 7. 以后发新版本(三步)
|
|
135
|
+
|
|
136
|
+
```powershell
|
|
137
|
+
# 1) 改 package.json 的 version,例如 0.2.1;改代码
|
|
138
|
+
git add -A
|
|
139
|
+
git commit -m "0.2.1:说明这次改了什么"
|
|
140
|
+
git push
|
|
141
|
+
|
|
142
|
+
# 2) 重新生成索引并提交(会记录新的提交号)
|
|
143
|
+
node scripts/build-index.mjs --publish
|
|
144
|
+
git push
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
忘了第 2 步,市场里就还是旧提交,别人装到的也是旧代码。
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 8. 常见岔子
|
|
152
|
+
|
|
153
|
+
| 症状 | 原因 / 处理 |
|
|
154
|
+
| --- | --- |
|
|
155
|
+
| `remote origin already exists` | 用 `git remote set-url origin <url>` 覆盖 |
|
|
156
|
+
| push 被拒 `non-fast-forward` | 建仓库时勾了 README,先 `git pull --rebase origin main` 再 push |
|
|
157
|
+
| 别人装的时候卡在 clone | 仓库是 Private,或地址写成了 SSH(必须是 `https://`) |
|
|
158
|
+
| Pages 打开是 404 | 分支/目录选错,或索引还没提交(第 3 步) |
|
|
159
|
+
| 装上但市场里显示旧版本 | 索引没重新生成/没 push(第 7 步) |
|
|
160
|
+
| 装完没有 `notify_user` | 没重启 `dsh web`;或 profile 不是 `desktop` |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 附:这份索引已经验过
|
|
165
|
+
|
|
166
|
+
生成出来的 `publish/index.json` 用 DSH 自带的插件市场解析器(`@deepseek-ai/dsh-plugin-market-index`)跑过:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
VALID: Private plugin source | plugins: dsh-reminder-notify (0.2.0)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
只要第 3 步的仓库地址是真的,装的时候就不会因为格式问题失败。
|