dsh-notify-tray 0.1.5 → 0.1.7
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.md +12 -8
- package/README.zh-CN.md +12 -8
- package/lib/catalog.js +26 -3
- package/lib/client.js +62 -9
- package/lib/format.js +1 -1
- package/lib/host/context.js +89 -0
- package/lib/host/notify.js +89 -0
- package/lib/host/routes.js +155 -0
- package/lib/host/spend.js +159 -0
- package/lib/host/tray.js +120 -0
- package/lib/index.js +16 -423
- package/lib/ledger.js +15 -5
- package/lib/models-dev.json +2684 -0
- package/lib/notices.js +119 -0
- package/lib/pricing.js +121 -14
- package/lib/quota.js +46 -2
- package/lib/system.js +116 -10
- package/lib/tracker.js +7 -0
- package/lib/tray/linux.js +34 -7
- package/lib/voice.js +19 -1
- package/package.json +4 -2
package/lib/voice.js
CHANGED
|
@@ -29,6 +29,11 @@ const LINES = {
|
|
|
29
29
|
{ title: '🐳 要不要放行?', body: '『{s}』想执行一个操作,等你点头:{q}' },
|
|
30
30
|
{ title: '🐳 这个可以做吗?', body: '『{s}』在等你的批准:{q}' },
|
|
31
31
|
],
|
|
32
|
+
// Several tasks finished within a few seconds of the first one: one notice for all of them.
|
|
33
|
+
completedMany: [
|
|
34
|
+
{ title: '🐳 又搞定 {n} 个!', body: '{list}也都做完啦,一起来验收吧' },
|
|
35
|
+
{ title: '🐳 连着做完 {n} 个~', body: '{list}都收工了,本鲸今天状态超好' },
|
|
36
|
+
],
|
|
32
37
|
failed: [
|
|
33
38
|
{ title: '🐳 呜…翻车了', body: '『{s}』没做完:{q} 要不要再试一次?' },
|
|
34
39
|
{ title: '🐳 沉下去了一下下', body: '『{s}』出了点状况:{q} 鲸鱼在等你救援' },
|
|
@@ -36,12 +41,25 @@ const LINES = {
|
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
const FALLBACK = { title: '🐳 DeepSeek Harness', body: '『{s}』{q}' }
|
|
44
|
+
/** Session names a merged notice spells out before saying "等 n 个". */
|
|
45
|
+
const LIST_MAX = 3
|
|
46
|
+
|
|
47
|
+
function listOf(sessions, count) {
|
|
48
|
+
const names = sessions.slice(0, LIST_MAX).map(s => `『${s.title || '会话'}』`).join('')
|
|
49
|
+
return sessions.length > LIST_MAX ? `${names}等 ${count} 个任务` : names
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
/**
|
|
41
|
-
* @param {{type: string, seq?: number, title: string, body?: string}} event
|
|
53
|
+
* @param {{type: string, seq?: number, title: string, body?: string, count?: number, sessions?: {title: string}[]}} event
|
|
54
|
+
* `count` + `sessions`: a merged notice for several completions (lib/notices.js).
|
|
42
55
|
* @returns {{title: string, body: string}}
|
|
43
56
|
*/
|
|
44
57
|
export function speak(event) {
|
|
58
|
+
if (event.type === 'completed' && event.count > 1 && Array.isArray(event.sessions)) {
|
|
59
|
+
const variants = LINES.completedMany
|
|
60
|
+
const line = variants[Math.abs(event.seq ?? 0) % variants.length]
|
|
61
|
+
return { title: line.title.replace('{n}', event.count), body: line.body.replace('{list}', listOf(event.sessions, event.count)) }
|
|
62
|
+
}
|
|
45
63
|
const variants = LINES[event.type] ?? [FALLBACK]
|
|
46
64
|
const line = variants[Math.abs(event.seq ?? 0) % variants.length]
|
|
47
65
|
const session = event.title || '这个会话'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-notify-tray",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "DeepSeek Harness 通知 + 状态栏插件:任务完成、需要输入、需要选择时弹系统通知(macOS / Windows / Linux);macOS 与 Linux(含 UOS、Deepin、麒麟)状态栏常驻小图标,显示任务进度与花费。Windows 没有状态栏,只弹通知。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek",
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
"node": ">=20"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
|
-
"test": "node --test --test-force-exit test/*.test.js"
|
|
52
|
+
"test": "node --test --test-force-exit test/*.test.js",
|
|
53
|
+
"version": "node scripts/sync-readme-version.mjs && git add README.md README.zh-CN.md",
|
|
54
|
+
"update-prices": "node scripts/update-models-dev.mjs"
|
|
53
55
|
},
|
|
54
56
|
"dsh": {
|
|
55
57
|
"bundle": {
|