dsh-plugin-session-notifier 0.1.2 → 0.1.3
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/README.en.md +20 -8
- package/README.md +21 -8
- package/client.js +16 -2
- package/package.json +3 -2
package/README.en.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-plugin-session-notifier)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
A DeepSeek Harness bundle. It raises a desktop notification and a short chime when a session finishes,
|
|
8
|
+
A DeepSeek Harness session notification bundle. It raises a desktop notification and a short chime when a session finishes,
|
|
9
9
|
fails, or stops to wait for your answer (a question or a tool approval). Nothing is missed while you
|
|
10
10
|
are in another window, watching a video, or playing a game.
|
|
11
11
|
|
|
@@ -21,7 +21,7 @@ The interface follows DSH's Chinese/English setting.
|
|
|
21
21
|
| The session fails | A low two-note chime and an error notification |
|
|
22
22
|
| The session you are looking at ends | Reminded after about 1 second, effectively immediate |
|
|
23
23
|
| Any other session ends | Waits out the 10/20/30 second merge window to avoid a burst |
|
|
24
|
-
|
|
|
24
|
+
| Any other session resumes inside the merge window | Merged into one reminder |
|
|
25
25
|
| You do not come back | Repeats every 30 seconds, at most 3 times, and stops as soon as the page is focused |
|
|
26
26
|
| Subagent sessions | Silent, so one task's internal fan-out never rings |
|
|
27
27
|
|
|
@@ -43,22 +43,33 @@ The panel says so as well.
|
|
|
43
43
|
|
|
44
44
|
## Install
|
|
45
45
|
|
|
46
|
-
**1.
|
|
46
|
+
**1. From the DSH interface**
|
|
47
|
+
|
|
48
|
+
1. Open the **Plugins** page in the sidebar
|
|
49
|
+
2. Choose **+ Add plugin** at the top right
|
|
50
|
+
3. Enter `dsh-plugin-session-notifier`, or name a version, for example `dsh-plugin-session-notifier@0.1.2`
|
|
51
|
+
4. Pick the China mainland registry mirror if you are there, it is much faster
|
|
52
|
+
5. Choose **Install**
|
|
53
|
+
|
|
54
|
+
**2. Ask the agent**
|
|
47
55
|
|
|
48
56
|
```
|
|
49
57
|
plugin_manager({ action: "install_bundle", target: "dsh-plugin-session-notifier" })
|
|
50
58
|
```
|
|
51
59
|
|
|
52
|
-
Omitting the version installs the
|
|
53
|
-
|
|
60
|
+
Omitting the version installs the newest release that has also cleared pnpm's release-age window.
|
|
61
|
+
|
|
62
|
+
**3. Local development**
|
|
54
63
|
|
|
55
|
-
|
|
64
|
+
```
|
|
65
|
+
plugin_manager({ action: "install_bundle", target: "/absolute/path/dsh-plugin-session-notifier" })
|
|
66
|
+
```
|
|
56
67
|
|
|
57
68
|
After installation the left sidebar shows the bell entry, and the `main` panel key is `session-notifier`.
|
|
58
69
|
Compatible DSH versions are declared by `engines.dsh` in `package.json`, currently `>=0.2.1-rc.3`.
|
|
59
70
|
|
|
60
|
-
Upgrading
|
|
61
|
-
|
|
71
|
+
Upgrading a plugin in DeepSeek Harness does not happen in place: uninstall the old version, then install the new one. If a new version is
|
|
72
|
+
reported as still inside pnpm's release-age window (24 hours by default), wait it out or name the version.
|
|
62
73
|
|
|
63
74
|
## Limits
|
|
64
75
|
|
|
@@ -93,6 +104,7 @@ upgrade in place.
|
|
|
93
104
|
| `client.js` | Browser half: the reminder engine and the settings panel |
|
|
94
105
|
| `cordis.patch.yml` | Inserts the plugin row |
|
|
95
106
|
| `locale/*.json` | Title and description the plugin manager displays |
|
|
107
|
+
| `scripts/sync-version.mjs` | Copies the release version into the panel footer |
|
|
96
108
|
| `test/*.mjs` | Engine scenarios plus static style and copy checks |
|
|
97
109
|
| `.github/workflows/` | `ci` runs the checks, `publish` uploads to npm |
|
|
98
110
|
|
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/dsh-plugin-session-notifier)
|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
DeepSeek Harness
|
|
9
|
-
|
|
8
|
+
DeepSeek Harness 会话通知插件。会话跑完、出错,或者停下来等你回答(提问 / 工具授权)时,
|
|
9
|
+
用桌面通知和提示音提醒你。切到别的窗口、全屏看视频或打游戏时也不会错过。
|
|
10
10
|
|
|
11
11
|
左侧栏有铃铛入口,点开是设置页,所有开关即时生效。界面跟随 DSH 的中英文设置切换。
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ DeepSeek Harness 插件。会话跑完、出错,或者停下来等你回答(
|
|
|
19
19
|
| 会话出错 | 低沉的两声提示音 + 错误通知 |
|
|
20
20
|
| 结束的是你正看着的会话 | 约 1 秒后提醒,几乎即时 |
|
|
21
21
|
| 结束的是其他会话 | 等 10 / 20 / 30 秒的合并窗口再提醒,避免连环响 |
|
|
22
|
-
|
|
|
22
|
+
| 结束的是其他会话,在合并窗口内又继续跑 | 合并成一次提醒 |
|
|
23
23
|
| 你没回来看 | 每 30 秒再提醒一次,最多 3 次,页面获得焦点后立即停止 |
|
|
24
24
|
| 子代理 | 不提醒,避免一个任务内部并行时连环响 |
|
|
25
25
|
|
|
@@ -40,21 +40,33 @@ DeepSeek Harness 插件。会话跑完、出错,或者停下来等你回答(
|
|
|
40
40
|
|
|
41
41
|
## 安装
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
**一、在 DSH 界面里安装**
|
|
44
|
+
|
|
45
|
+
1. 侧边栏打开「插件」页
|
|
46
|
+
2. 点右上角「+ 添加插件」
|
|
47
|
+
3. 输入框填 `dsh-plugin-session-notifier`,想装指定版本就在包名后加版本,例如 `dsh-plugin-session-notifier@0.1.2`
|
|
48
|
+
4. 安装源可选「中国大陆镜像源」,国内会快很多
|
|
49
|
+
5. 点「安装」
|
|
50
|
+
|
|
51
|
+
**二、让智能体安装**
|
|
44
52
|
|
|
45
53
|
```
|
|
46
54
|
plugin_manager({ action: "install_bundle", target: "dsh-plugin-session-notifier" })
|
|
47
55
|
```
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
不写版本号时,装的是最新的、并且已经过 pnpm 发布观察期的版本。
|
|
58
|
+
|
|
59
|
+
**三、本地开发**
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
```
|
|
62
|
+
plugin_manager({ action: "install_bundle", target: "/绝对路径/dsh-plugin-session-notifier" })
|
|
63
|
+
```
|
|
53
64
|
|
|
54
65
|
安装后左侧栏出现铃铛入口,`main` 面板 key 为 `session-notifier`。
|
|
55
66
|
兼容的 DSH 版本由 `package.json` 的 `engines.dsh` 声明,当前为 `>=0.2.1-rc.3`。
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
目前 DeepSeek Harness 的插件升级不能原地进行,需要先卸载旧版本,再安装新版本。如果提示某个新版本还处在 pnpm 的发布观察期内
|
|
69
|
+
(默认 24 小时),要么等它过去,要么直接指定版本号安装。
|
|
58
70
|
|
|
59
71
|
## 能力边界
|
|
60
72
|
|
|
@@ -84,6 +96,7 @@ plugin_manager({ action: "install_bundle", target: "dsh-plugin-session-notifier"
|
|
|
84
96
|
| `client.js` | 浏览器半侧,提醒引擎与设置面板 |
|
|
85
97
|
| `cordis.patch.yml` | 插入插件行 |
|
|
86
98
|
| `locale/*.json` | 插件管理器展示用的标题与描述 |
|
|
99
|
+
| `scripts/sync-version.mjs` | 发布时把版本号同步到面板底部 |
|
|
87
100
|
| `test/*.mjs` | 引擎场景、样式、文案的静态检查 |
|
|
88
101
|
| `.github/workflows/` | `ci` 跑检查,`publish` 发 npm |
|
|
89
102
|
|
package/client.js
CHANGED
|
@@ -28,6 +28,8 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
/** Monotonic per-page counter: two reminders in one millisecond still need distinct tags. */
|
|
29
29
|
let notificationSeq = 0;
|
|
30
30
|
const RECENT_LIMIT = 12;
|
|
31
|
+
/** Shown at the foot of the panel; scripts/sync-version.mjs keeps it in step with package.json. */
|
|
32
|
+
const PLUGIN_VERSION = '0.1.3';
|
|
31
33
|
/** Wait before reminding about the session the user is looking at. */
|
|
32
34
|
const VIEWING_MERGE_MS = 1000;
|
|
33
35
|
/** Two reminders landing together share one tone instead of stacking two. */
|
|
@@ -103,6 +105,7 @@ window.__ModuleLoader__.load({
|
|
|
103
105
|
'notify.test.title': '这是一条测试提醒',
|
|
104
106
|
'notify.test.body': '看到这条通知、听到提示音,就说明提醒已经生效。',
|
|
105
107
|
'session.unknown': '新会话',
|
|
108
|
+
'footer.version': '版本 {version}',
|
|
106
109
|
};
|
|
107
110
|
|
|
108
111
|
const en = {
|
|
@@ -174,6 +177,7 @@ window.__ModuleLoader__.load({
|
|
|
174
177
|
'notify.test.title': 'This is a test reminder',
|
|
175
178
|
'notify.test.body': 'If you can see this notification and hear the chime, reminders work.',
|
|
176
179
|
'session.unknown': 'New session',
|
|
180
|
+
'footer.version': 'Version {version}',
|
|
177
181
|
};
|
|
178
182
|
//#endregion
|
|
179
183
|
|
|
@@ -714,6 +718,9 @@ window.__ModuleLoader__.load({
|
|
|
714
718
|
});
|
|
715
719
|
if (!settings.repeat || attempt >= settings.repeatMax) return;
|
|
716
720
|
if (!pageIsAway()) return;
|
|
721
|
+
// A chain already armed for this session would keep its own timer, and its
|
|
722
|
+
// callback would delete this newer record.
|
|
723
|
+
cancelRepeat(sessionId);
|
|
717
724
|
const timer = window.setTimeout(() => {
|
|
718
725
|
state.repeats.delete(sessionId);
|
|
719
726
|
if (!pageIsAway()) return;
|
|
@@ -745,13 +752,17 @@ window.__ModuleLoader__.load({
|
|
|
745
752
|
*/
|
|
746
753
|
function scheduleEnd(sessionId, kind) {
|
|
747
754
|
const previous = state.pendingEnd.get(sessionId);
|
|
755
|
+
// A failed turn reports its error and then its idle edge, so an armed error
|
|
756
|
+
// outranks the finish that follows it. Otherwise every failure would be
|
|
757
|
+
// announced as an ordinary completion.
|
|
758
|
+
const effective = previous !== undefined && previous.kind === 'error' ? 'error' : kind;
|
|
748
759
|
if (previous !== undefined) window.clearTimeout(previous.timer);
|
|
749
760
|
const timer = window.setTimeout(() => {
|
|
750
761
|
state.pendingEnd.delete(sessionId);
|
|
751
762
|
if (!eligible(sessionId)) return;
|
|
752
|
-
deliver(
|
|
763
|
+
deliver(effective, sessionId, 1);
|
|
753
764
|
}, mergeWindowFor(sessionId));
|
|
754
|
-
state.pendingEnd.set(sessionId, { timer, kind });
|
|
765
|
+
state.pendingEnd.set(sessionId, { timer, kind: effective });
|
|
755
766
|
}
|
|
756
767
|
|
|
757
768
|
/**
|
|
@@ -1224,6 +1235,8 @@ window.__ModuleLoader__.load({
|
|
|
1224
1235
|
),
|
|
1225
1236
|
),
|
|
1226
1237
|
),
|
|
1238
|
+
|
|
1239
|
+
h('p', { className: 'sen-version' }, t('footer.version', { version: PLUGIN_VERSION })),
|
|
1227
1240
|
),
|
|
1228
1241
|
),
|
|
1229
1242
|
);
|
|
@@ -1314,6 +1327,7 @@ window.__ModuleLoader__.load({
|
|
|
1314
1327
|
'.sen-btn-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}',
|
|
1315
1328
|
'.sen-actions{display:flex;align-items:center;gap:8px;padding:16px 0;border-bottom:.5px solid var(--dsw-alias-border-l2)}',
|
|
1316
1329
|
'.sen-empty{margin:16px 0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-tertiary)}',
|
|
1330
|
+
'.sen-version{margin:8px 0 0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}',
|
|
1317
1331
|
'.sen-recent{list-style:none;margin:0;padding:0}',
|
|
1318
1332
|
'.sen-recent-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:.5px solid var(--dsw-alias-border-l2);font-size:13px;line-height:20px}',
|
|
1319
1333
|
'.sen-recent-name{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary)}',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-session-notifier",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Desktop notification and a short chime when a DeepSeek Harness session finishes or stops to wait for your answer.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"verify": "node test/verify-engine.mjs && node test/check-styles.mjs && node test/check-copy.mjs",
|
|
52
|
-
"prepublishOnly": "npm run verify"
|
|
52
|
+
"prepublishOnly": "npm run verify",
|
|
53
|
+
"version": "node scripts/sync-version.mjs && git add client.js"
|
|
53
54
|
},
|
|
54
55
|
"dsh": {
|
|
55
56
|
"bundle": {
|