dsh-notify-tray 0.1.7 → 0.1.8
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 +109 -0
- package/README.md +78 -150
- package/README.zh-CN.md +85 -129
- package/assets/mascot-peeking.png +0 -0
- package/assets/mascot-peeking.prompt.txt +6 -0
- package/lib/client.js +381 -49
- package/lib/host/routes.js +15 -0
- package/locale/en.json +2 -1
- package/locale/zh.json +2 -1
- package/package.json +9 -6
package/README.en.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Whale Notify Station · User guide
|
|
2
|
+
|
|
3
|
+
[简体中文](README.md) | **English**
|
|
4
|
+
|
|
5
|
+
Get notified when tasks finish, fail, or need your attention. On macOS / Linux, the status-bar whale also shows task progress, daily spend, and plan quota.
|
|
6
|
+
|
|
7
|
+
## Get started
|
|
8
|
+
|
|
9
|
+
1. Install and enable the plugin, then click **Whale Notify Station** (the whale icon) in DSH's **left sidebar**. The icon also works when the sidebar is collapsed.
|
|
10
|
+
2. Under notifications, choose which events should alert you and whether to play a sound.
|
|
11
|
+
3. On macOS / Linux, enable the status-bar whale. macOS also offers text, a count, or just the icon beside the whale.
|
|
12
|
+
4. Changes **save automatically**, about half a second after you stop editing. A **Settings saved** banner confirms success; there is no Save button.
|
|
13
|
+
|
|
14
|
+
Failed saves retain your changes and offer **Retry saving**. Correct invalid input before saving. Leaving this page does not discard queued changes.
|
|
15
|
+
|
|
16
|
+
The plugin detail page contains this user guide in Chinese by default, with a link to this English version. Notification, status-bar, spend, and plan settings all live in the sidebar page.
|
|
17
|
+
|
|
18
|
+
Existing settings and spend records are retained after an update. Restart DSH if the new entry is missing. If the sidebar has moved it into **More**, you can find and pin it there.
|
|
19
|
+
|
|
20
|
+
## Notifications
|
|
21
|
+
|
|
22
|
+
Five events are enabled by default: **completed, failed, approval needed, choice needed, and text input needed**. Clicking a notification sent by the DSH window opens its session.
|
|
23
|
+
|
|
24
|
+
- Notifications for the session you are currently viewing are suppressed by default. Turn off the focused-session suppression option under **Advanced** if you want them anyway.
|
|
25
|
+
- Each session keeps one notification. Answering a question or resolving an approval withdraws its attention notification, subject to platform support for the system channel.
|
|
26
|
+
- Tasks that finish within a few seconds of each other have their later completion notifications grouped.
|
|
27
|
+
- Manually stopping a task does not notify. Subagents do not notify separately.
|
|
28
|
+
|
|
29
|
+
The notification channel defaults to **Auto**: a DSH window with notification permission sends notifications; otherwise the host uses system notifications. Usually you can leave this unchanged.
|
|
30
|
+
|
|
31
|
+
## Status-bar whale
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
| Appearance | Meaning |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Resting | Idle |
|
|
38
|
+
| Bubbles | Tasks running |
|
|
39
|
+
| `!` | Waiting for approval, a choice, or text |
|
|
40
|
+
| `×` | A recent failure; held for 10 minutes by default |
|
|
41
|
+
|
|
42
|
+
Click the whale to see running tasks, pending actions, recent results, daily usage, and plan quota. Clicking a task opens its session.
|
|
43
|
+
|
|
44
|
+
| Platform | Features provided by this plugin |
|
|
45
|
+
|---|---|
|
|
46
|
+
| macOS | System notifications, menu-bar whale, progress text, and optional spend beside it |
|
|
47
|
+
| Linux (UOS / Deepin / Kylin / KDE and others) | System notifications and a system-tray whale with state colors |
|
|
48
|
+
| Windows | System notifications; this plugin does not provide a Windows tray icon or tray settings |
|
|
49
|
+
|
|
50
|
+
If you hide the whale from its menu, use **Show the status-bar icon again** in the sidebar settings page. No restart is needed. GNOME generally needs an AppIndicator extension to display the tray icon.
|
|
51
|
+
|
|
52
|
+
## Spend and plans
|
|
53
|
+
|
|
54
|
+
The spend and plan section shows daily spend, the current model, and its API prices.
|
|
55
|
+
|
|
56
|
+
- **Spend:** Auto prefers DeepSeek account balance changes, using estimates while billing catches up. Other providers use token usage and unit prices. These figures are estimates; the provider's bill is authoritative.
|
|
57
|
+
- **Prices:** Your prices take priority, followed by DSH's model catalog, built-in prices, or the bundled models.dev snapshot. Custom prices and the exchange rate are under **Advanced**.
|
|
58
|
+
- **Plans:** Choosing a provider and plan fills preset values. Expand the plan details to edit the name, price, period, balance, and quota.
|
|
59
|
+
- **Automatic quota:** Enter the credential reference name saved in DSH's Models page, or an environment-variable name, under **API key reference**. Clicking **Refresh** saves pending settings before querying quota. Enter the reference name, not the secret itself. Providers without a quota endpoint allow manual values or blank fields.
|
|
60
|
+
- **Query failures:** The page shows the reason and credential sources tried. Check the reference name, permissions, and selected provider before refreshing.
|
|
61
|
+
|
|
62
|
+
Plan presets and price snapshots may lag behind provider changes and can be overridden. A subscription's price and API token spend are shown separately.
|
|
63
|
+
|
|
64
|
+
## Troubleshooting
|
|
65
|
+
|
|
66
|
+
**No notifications?**
|
|
67
|
+
|
|
68
|
+
Confirm that the event type is enabled and the **Settings saved** banner appeared. Check system notification permissions for DeepSeek Harness and Do Not Disturb. In a browser, allow site notifications. The session you are viewing is suppressed by default.
|
|
69
|
+
|
|
70
|
+
**Clicking a notification does not open its session?**
|
|
71
|
+
|
|
72
|
+
Keep the channel on **Auto** and the DSH window running. The macOS system fallback using `osascript` cannot target a session; installing [terminal-notifier](https://github.com/julienXX/terminal-notifier) enables targeting and withdrawal. Windows system fallback notifications are subject to foreground-window restrictions; minimized windows can be restored.
|
|
73
|
+
|
|
74
|
+
**Why are there no whale icon settings on Windows?**
|
|
75
|
+
|
|
76
|
+
This plugin implements only notifications on Windows. Status-bar features are for macOS / Linux. The DSH sidebar settings entry appears on all three platforms.
|
|
77
|
+
|
|
78
|
+
**Spend or quota looks wrong?**
|
|
79
|
+
|
|
80
|
+
Check the current model's price source, display currency, exchange rate, and any manual remaining quota overriding automatic results. Automatic queries require a supported provider endpoint and a key with suitable permissions.
|
|
81
|
+
|
|
82
|
+
**Where are records stored?**
|
|
83
|
+
|
|
84
|
+
The spend ledger is at `~/.dsh/storages/dsh-notify-tray/ledger.json` by default and retains 31 days. A configured `DSH_HOME` replaces that directory. DSH manages settings in the current profile.
|
|
85
|
+
|
|
86
|
+
## Install and update
|
|
87
|
+
|
|
88
|
+
In DSH, open **Plugins → Add plugin** and enter `dsh-notify-tray`. To select a published version, enter `dsh-notify-tray@version`; check [npm](https://www.npmjs.com/package/dsh-notify-tray) for available releases.
|
|
89
|
+
|
|
90
|
+
### Online updates
|
|
91
|
+
|
|
92
|
+
The **Updates** card at the bottom of the sidebar settings page:
|
|
93
|
+
|
|
94
|
+
- Checks when you open the page, or when you click **Check for updates**.
|
|
95
|
+
- Offers **Update now** for a compatible, non-deprecated stable release. Clicking saves settings first, then asks DSH's native plugin manager to update.
|
|
96
|
+
- Never installs automatically. DSH handles compatibility checks and recovery on failure. The page distinguishes completion, a required restart, restoration, and an unconfirmed outcome.
|
|
97
|
+
- Explains why local-directory and Git installations cannot use this update path. Once a release is published to npm, switch to an npm installation through plugin management to enable online updates.
|
|
98
|
+
|
|
99
|
+
DSH's native plugin management update controls remain available. Restart DSH when requested.
|
|
100
|
+
|
|
101
|
+
To develop or try unpublished code, install a local checkout:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
dsh plugin --profile desktop add /absolute/path/to/dsh-notify-tray
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Web users should replace `desktop` with `web`. Restart the corresponding DSH instance after installation.
|
|
108
|
+
|
|
109
|
+
Report problems on [GitHub Issues](https://github.com/ROYLeXJ/dsh-notify-tray/issues), including DSH and plugin versions, the operating system, and reproduction steps.
|
package/README.md
CHANGED
|
@@ -1,181 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 小鲸鱼通知站 · 使用说明
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**简体中文** | [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
任务完成、失败或需要你处理时收到通知;在 macOS / Linux 状态栏查看任务进度、今日花费和套餐额度。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Status-bar whale** (macOS / Linux) — a small whale lives in your status bar and tells you what's going on through its posture. The drop-down menu lists running tasks, items waiting for you, today's usage and recently finished tasks; click any entry to open that session.
|
|
9
|
-
- **Settings page** — every option can be changed directly on the DSH **Plugins** page (only the options your OS can use are shown), including the API price of the model you're currently using and the plan you subscribe to (Kimi / GLM / OpenCode / MiMo / Gemini / Grok / Claude / GPT / MiniMax / DeepSeek or custom). Balance and remaining quota are fetched automatically where the provider exposes an API; anything else can be filled in by hand.
|
|
7
|
+
## 从这里开始
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
1. 安装并启用插件后,在 DSH **左侧栏点击「小鲸鱼通知站」**(鲸鱼图标)。侧栏收起时,点图标也能打开设置。
|
|
10
|
+
2. 在「提醒我」中选择需要的通知类型,按需开启提示音。
|
|
11
|
+
3. macOS / Linux 用户可以开启「显示小鲸鱼」;macOS 还可选择鲸鱼旁边显示文字、数字或只显示图标。
|
|
12
|
+
4. 修改后会**自动保存**,连续输入停止约半秒后提交。保存成功时会出现「设置已保存」小横幅,无需点击保存按钮。
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
保存失败会保留修改,并显示「重试保存」。输入无效时请先修正;离开设置页不会丢弃尚在排队的修改。
|
|
15
|
+
|
|
16
|
+
「插件 → 小鲸鱼通知站」详情页只显示这份使用说明。通知、状态栏、花费和套餐的设置统一放在左侧栏入口里。
|
|
17
|
+
|
|
18
|
+
从旧版更新后,原有设置和花费记录会继续使用,无需重新填写。若没看到新入口,先重启 DSH;如果侧栏把入口收进了「更多」,可在那里找到并固定它。
|
|
19
|
+
|
|
20
|
+
## 通知怎么用
|
|
21
|
+
|
|
22
|
+
默认开启五类通知:**做完了、翻车了、要我批准、要我选、要我写字**。点击 DSH 窗口发出的通知,会打开对应会话。
|
|
23
|
+
|
|
24
|
+
- 你正在查看的会话默认不弹通知;切到别的应用后会正常提醒。需要始终提醒时,在「高级设置」关闭「正看着这个会话时不弹」。
|
|
25
|
+
- 同一个会话只保留一条通知;问题回答或批准完成后,「需要你」的通知会收回(系统通道是否支持取决于平台)。
|
|
26
|
+
- 多个任务在几秒内接连完成时,后续完成通知会合并。
|
|
27
|
+
- 手动停止任务不发完成或失败通知;子智能体不单独提醒。
|
|
28
|
+
|
|
29
|
+
「高级设置 → 通知从哪里弹」默认为**自动**:有具备通知权限的 DSH 窗口时由窗口弹,否则使用系统通知。通常保持默认即可。
|
|
30
|
+
|
|
31
|
+
## 状态栏小鲸鱼
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
| 样子 | 含义 |
|
|
14
36
|
|---|---|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
37
|
+
| 安静待着 | 空闲 |
|
|
38
|
+
| 冒泡泡 | 有任务运行中 |
|
|
39
|
+
| 冒出 `!` | 等你批准、选择或输入 |
|
|
40
|
+
| 冒出 `×` | 刚有任务失败,默认保持 10 分钟 |
|
|
19
41
|
|
|
20
|
-
|
|
21
|
-
|---|---|---|---|
|
|
22
|
-
| macOS | Notification Center | Menu-bar icon following the menu-bar colour, with a label such as `Pending 1` / `Running 2` | All (show/hide, label style, today's spend in the label, failure hold time) |
|
|
23
|
-
| Linux (UOS / Deepin / Kylin / KDE …) | freedesktop notifications | System-tray icon, colour-coded (🔵 idle / running, 🟠 waiting for you, 🔴 just failed) | Show/hide, failure hold time |
|
|
24
|
-
| Windows | Toast notifications | None (Windows has no status bar) | None |
|
|
42
|
+
点击状态栏鲸鱼,菜单里可查看运行中的任务、待处理事项、最近结束的任务、今日用量和套餐额度。点击任务可打开对应会话。
|
|
25
43
|
|
|
26
|
-
|
|
44
|
+
| 系统 | 本插件提供的功能 |
|
|
45
|
+
|---|---|
|
|
46
|
+
| macOS | 系统通知、菜单栏鲸鱼、鲸鱼旁的进度文字与可选花费 |
|
|
47
|
+
| Linux(UOS / Deepin / 麒麟 / KDE 等) | 系统通知、系统托盘鲸鱼,以颜色区分状态 |
|
|
48
|
+
| Windows | 系统通知;本插件不提供 Windows 托盘图标,设置页也不显示托盘选项 |
|
|
27
49
|
|
|
28
|
-
|
|
50
|
+
若从鲸鱼菜单隐藏了图标,可在左侧栏设置页点击「重新显示状态栏图标」,无需重启。GNOME 通常需要 AppIndicator 扩展才能显示托盘图标。
|
|
29
51
|
|
|
30
|
-
|
|
31
|
-
> DSH installs plugins with pnpm, whose supply-chain policy (`minimumReleaseAge`) won't auto-install a release that is still inside its waiting period. With a bare `dsh-notify-tray` you may get an older version (e.g. 0.1.0). If an older version is already installed, remove it first, then install with the version number.
|
|
52
|
+
## 花费与套餐
|
|
32
53
|
|
|
33
|
-
|
|
34
|
-
Open DSH **Plugins → Add plugin**, type `dsh-notify-tray@0.1.7` (with the version number) into the input box and click **Install**.
|
|
54
|
+
设置页的「花费与套餐」可查看今日花费、当前模型和 API 单价。
|
|
35
55
|
|
|
36
|
-
|
|
56
|
+
- **花费**:默认优先使用 DeepSeek 账户余额变化;余额更新有延迟时先显示估算,其他平台按 Token 用量与单价估算。此数字用于参考,实际账单以服务商为准。
|
|
57
|
+
- **价格**:优先使用你填写的价格,其次使用 DSH 模型目录、插件内置价格或随插件发布的 models.dev 快照。自定义单价与汇率在「高级设置」里调整。
|
|
58
|
+
- **套餐**:选择平台和套餐后,会填入预设信息;可以展开「手动改套餐信息」修改名称、价格、周期、余额和额度。
|
|
59
|
+
- **自动查额度**:在「API Key 引用」填写 DSH「模型」页保存密钥时使用的名字,或环境变量名,点击「刷新」时会先保存当前设置,再查询额度。这里填的是引用名,不是密钥本身。没有额度接口的平台可手填,也可以留空。
|
|
60
|
+
- **查询失败**:页面会显示失败原因及尝试过的密钥来源。检查引用名、密钥权限和所选平台后再刷新。
|
|
37
61
|
|
|
38
|
-
|
|
39
|
-
# Desktop app (the dsh command bundled with the app); include the version to get the latest
|
|
40
|
-
dsh plugin --profile desktop add dsh-notify-tray@0.1.7
|
|
41
|
-
# Or the web / CLI profile
|
|
42
|
-
dsh plugin --profile web add dsh-notify-tray@0.1.7
|
|
43
|
-
```
|
|
62
|
+
套餐预设和价格快照可能落后于服务商调整,都可以手动覆盖。套餐订阅价格不等于 API Token 花费,两者分别显示。
|
|
44
63
|
|
|
45
|
-
|
|
64
|
+
## 常见问题
|
|
46
65
|
|
|
47
|
-
|
|
66
|
+
**没有收到通知?**
|
|
48
67
|
|
|
49
|
-
|
|
68
|
+
先确认对应通知类型已开启且出现「设置已保存」,再检查系统是否允许 DeepSeek Harness 通知、是否开启勿扰模式。浏览器使用 DSH 时,需要允许网站通知权限。默认查看当前会话时不会弹通知。
|
|
50
69
|
|
|
51
|
-
|
|
70
|
+
**点击通知没有跳到会话?**
|
|
52
71
|
|
|
53
|
-
|
|
54
|
-
>
|
|
55
|
-
> ```sh
|
|
56
|
-
> dsh plugin --profile desktop remove dsh-notify-tray
|
|
57
|
-
> dsh plugin --profile desktop add dsh-notify-tray@0.1.7
|
|
58
|
-
> ```
|
|
59
|
-
>
|
|
60
|
-
> Also, when the official npm registry is unreachable, DSH falls back to the npmmirror registry, which syncs a little later, so a just-published release may take a few minutes to appear there.
|
|
72
|
+
保持「通知从哪里弹」为「自动」,并让 DSH 窗口运行。macOS 的系统备用通知使用 `osascript` 时不能定位会话;安装 [terminal-notifier](https://github.com/julienXX/terminal-notifier) 后可支持跳转和撤回。Windows 系统备用通知受系统前台窗口限制,已最小化的窗口可恢复。
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
**为什么 Windows 没有鲸鱼图标设置?**
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
本插件在 Windows 上仅实现通知,状态栏功能仅用于 macOS / Linux;DSH 左侧栏的设置入口在三个平台都会显示。
|
|
65
77
|
|
|
66
|
-
|
|
78
|
+
**花费或额度不准确?**
|
|
67
79
|
|
|
68
|
-
|
|
69
|
-
- id: notify-tray
|
|
70
|
-
config:
|
|
71
|
-
channel: auto # auto | client | system | both | off
|
|
72
|
-
notifyInput: true
|
|
73
|
-
spendSource: auto # auto | balance | estimate
|
|
74
|
-
planProvider: kimi # provider of your plan, see the table below
|
|
75
|
-
planId: cn-pro # preset plan ID; leave empty for "manual"
|
|
76
|
-
planApiKeyEnv: KIMI_CODE_TOKEN
|
|
77
|
-
prices: # optional: price per million tokens, keyed by "provider/model", model ID or prefix
|
|
78
|
-
deepseek-flash: { input: 2, cacheRead: 0.04, output: 8 }
|
|
79
|
-
```
|
|
80
|
+
检查当前模型的价格来源、显示币种、汇率,以及是否填写了覆盖自动查询的手动剩余额度。自动查询只在服务商提供可用接口且密钥具备权限时有效。
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
| Option | Default | Description |
|
|
84
|
-
|---|---|---|
|
|
85
|
-
| `notifyCompleted` / `notifyFailed` / `notifyApproval` / `notifyChoice` / `notifyInput` | all on | Toggle each of the five notification kinds |
|
|
86
|
-
| `channel` | `auto` | `auto`: the DSH window shows the notification when one is open, otherwise the OS does |
|
|
87
|
-
| `suppressWhenFocused` | `true` | Don't notify while you're looking at that session (switch to another app and you will be) |
|
|
88
|
-
| `sound` | `true` | Play a sound with system notifications (macOS chime, Windows toast sound, Linux where the desktop supports it) |
|
|
89
|
-
| `tray` | `true` | Show the status-bar icon (macOS / Linux, takes effect as soon as you save; ignored on Windows). After **Hide status-bar icon** in the tray menu, **Show the status-bar icon again** on the settings page brings it back without restarting DSH |
|
|
90
|
-
| `titleStyle` | `text` | What to show next to the whale in the macOS menu bar: `text` (Pending 1 / Running 2), `count` (numbers only), `icon` (whale only) |
|
|
91
|
-
| `showSpendInTitle` | `false` | Append today's spend to the macOS menu-bar label |
|
|
92
|
-
| `errorHoldMinutes` | `10` | How many minutes the icon stays red / shows the `×` after a task fails (macOS / Linux) |
|
|
93
|
-
|
|
94
|
-
### Spend & pricing
|
|
95
|
-
|
|
96
|
-
| Option | Default | Description |
|
|
97
|
-
|---|---|---|
|
|
98
|
-
| `spendSource` | `auto` | Use the DeepSeek account balance when available, otherwise estimate from prices. In `auto`, while balance drops lag behind the DeepSeek models' estimate (the platform bills with a delay) the estimate is shown until the balance catches up; other providers' models are always added as an estimate |
|
|
99
|
-
| `currency` | `CNY` | Display currency |
|
|
100
|
-
| `balancePollMinutes` | `5` | How often (minutes) to refresh the DeepSeek account balance |
|
|
101
|
-
| `priceSource` | `auto` | Which price to estimate with: `auto` (price table → custom price → DSH's built-in model catalog → plugin's built-in prices → a bundled [models.dev](https://models.dev) snapshot), `catalog`, `custom` |
|
|
102
|
-
| `customInput` / `customCacheRead` / `customOutput` | empty | Custom price per million tokens; leave empty to disable |
|
|
103
|
-
| `customPriceCurrency` | `CNY` | Currency of the custom price |
|
|
104
|
-
| `exchangeRate` | `7.2` | 1 USD = ? CNY; catalog prices are in USD and converted when displaying CNY |
|
|
105
|
-
| `prices` | `{}` | Per-model price table, highest priority |
|
|
106
|
-
|
|
107
|
-
The **Current API price** section shows the model you're using (provider / model) and its catalog price. DSH's pi-ai adapter ships a model catalog (Claude, GPT, Gemini, Grok, Groq, Kimi, GLM, MiMo, MiniMax, OpenCode Go, DeepSeek, …); the plugin reads it directly and falls back to its built-in prices, then a [models.dev](https://models.dev) price snapshot bundled with each release, or your custom price when a model is missing. It is found automatically for the desktop app and for `dsh web` (global npm installs such as `~/.npm-global` or `%APPDATA%\npm` on Windows, pnpm, and nodes installed by nvm / fnm / volta; as a last resort the plugin asks `npm root -g`). If it isn't there at startup, the plugin looks again every 10 minutes. If the settings page still says it wasn't found, set the `DSH_NOTIFY_TRAY_PI_AI` environment variable to the DSH install directory (e.g. `~/.npm-global/lib/node_modules/@deepseek-ai/dsh`) and restart. A one-click **Copy catalog price into custom price** lets you tweak from the catalog value.
|
|
108
|
-
|
|
109
|
-
### Plans
|
|
110
|
-
|
|
111
|
-
| Option | Default | Description |
|
|
112
|
-
|---|---|---|
|
|
113
|
-
| `planProvider` | `none` | `none` / `custom` / `deepseek` / `kimi` / `glm` / `opencode` / `mimo` / `gemini` / `grok` / `claude` / `gpt` / `minimax` |
|
|
114
|
-
| `planId` | empty | Preset plan ID (pick it from the drop-down on the settings page; name, price, period, currency and quota description are filled in automatically) |
|
|
115
|
-
| `planName` / `planPrice` / `planPeriod` / `planCurrency` / `planQuota` | preset | Each can be overridden; leave empty to use the preset |
|
|
116
|
-
| `planBalance` | empty | Plan / prepaid balance (manual; leave empty when it can be fetched) |
|
|
117
|
-
| `planRemaining` | empty | Remaining quota, e.g. `68%` or `1200 requests` (a manual value takes precedence over the API) |
|
|
118
|
-
| `planResetAt` | empty | Next reset time (manual) |
|
|
119
|
-
| `planApiKeyEnv` | empty | API key reference used for quota lookups — an environment-variable name, the same one DSH's **Models** page uses when it saves a key. The plugin only reads it when querying quota |
|
|
120
|
-
| `planQuotaUrl` | preset | Quota endpoint; leave empty for the preset |
|
|
121
|
-
| `planAutoQuota` | `true` | Poll the endpoint automatically when there is one |
|
|
122
|
-
| `quotaPollMinutes` | `10` | Quota refresh interval (minutes) |
|
|
123
|
-
|
|
124
|
-
Built-in plan presets (prices are the list prices at the time of writing and may change — all editable):
|
|
125
|
-
|
|
126
|
-
| Provider | Presets | Fetched automatically |
|
|
127
|
-
|---|---|---|
|
|
128
|
-
| DeepSeek | Pay-as-you-go | Account balance `GET /user/balance` |
|
|
129
|
-
| Kimi | Membership Go / Plus / Pro / Max / Ultra (CN ¥49–1399, intl. $19–199), legacy Kimi Code, Moonshot pay-as-you-go | Kimi Code quota `GET api.kimi.com/coding/v1/usages` (needs the Kimi Code OAuth token, not a Moonshot API key); Moonshot balance |
|
|
130
|
-
| GLM | Coding Plan Lite / Pro / Max (CN ¥118 / 538 / 1078, Z.ai $18 / 80 / 168) | 5-hour and weekly credits `GET /api/monitor/usage/quota/limit` |
|
|
131
|
-
| OpenCode | Go $10, Go Plus $40, Zen pay-as-you-go | No public endpoint |
|
|
132
|
-
| MiMo | Token Plan Lite / Standard / Pro / Max (¥39 / 99 / 329 / 659) | No API-key endpoint (console cookie only) |
|
|
133
|
-
| Gemini | Google AI Plus / Pro / Ultra, API pay-as-you-go | None |
|
|
134
|
-
| Grok | SuperGrok Lite / Standard / Plus / Heavy, API pay-as-you-go | Key validation only (`GET /v1/api-key`), no balance |
|
|
135
|
-
| Claude | Pro / Max 5x / Max 20x / Team, API pay-as-you-go | No endpoint for regular keys |
|
|
136
|
-
| GPT | ChatGPT Go / Plus / Pro 5x / Pro 20x / Business, API pay-as-you-go | No endpoint for regular keys |
|
|
137
|
-
| MiniMax | M Plan Go / Explore / Build (CN ¥49 / 119 / 469, intl. $22 / 55 / 132), legacy Coding Plan | 5-hour window remaining `GET /v1/coding_plan/remains` |
|
|
138
|
-
|
|
139
|
-
Anything that can't be fetched can be typed in by hand; empty fields are simply hidden. On macOS / Linux the status-bar menu shows balance and plan on one row (**余额 ¥… · provider 剩 …**); its submenu lists the DeepSeek balance, plan name and price, remaining quota and reset time, a **Refresh quota** action and the usage page. The full details returned by the endpoint are on the settings page. The menu has one level of submenus, at most 6 rows each and 24 characters per row, so Windows / Linux trays no longer cut it off at the screen edge.
|
|
140
|
-
|
|
141
|
-
## Notes
|
|
142
|
-
|
|
143
|
-
- **When notifications fire** — a task that runs to completion counts as *completed*; an error, hitting the token limit or being blocked counts as *failed*; stopping a task yourself doesn't notify. For `ask_user_question`, questions with options and plan approvals count as *needs a choice*, questions without options as *needs input*; tool approvals count as *needs approval*. Only top-level sessions are tracked — sub-agents don't get their own notifications.
|
|
144
|
-
- **How spend is computed** — when signed in with a DeepSeek account, today's spend is accumulated from drops in the account balance (top-ups don't count as negative spend; the platform bills with a delay, so in `auto` the estimate stands in until the balance catches up). In parallel, it's estimated from each `provider/model` route's tokens × unit price (price sources described under `priceSource` above); the **Today** submenu breaks it down per model (top 3). The ledger lives in `~/.dsh/storages/dsh-notify-tray/ledger.json` and keeps 31 days.
|
|
145
|
-
- **DeepSeek off-peak prices** — DeepSeek's listed prices are peak prices (Beijing time, weekdays 9–12 and 14–18). Tokens used outside those hours are estimated at half price; prices you type yourself (price table or custom price) are used as they are.
|
|
146
|
-
- **Clicking a notification / the status-bar icon / "Open DeepSeek Harness" in the menu** — brings up the desktop app when there is one, otherwise (`dsh web`) opens the web UI in the browser. Browser notifications require granting notification permission first.
|
|
147
|
-
- With the default `channel: auto` and a DSH window open, notifications come from the window, and clicking one jumps to its session on every OS.
|
|
148
|
-
- **macOS system notifications** (`dsh web`, or `channel: system`) are sent with `osascript`, which can't tell DSH which session was clicked. Install [terminal-notifier](https://github.com/julienXX/terminal-notifier) (`brew install terminal-notifier`) and the plugin uses it automatically: clicking the notification opens the session, and an answered question's notification is taken back.
|
|
149
|
-
- **Windows toasts** can only launch the app, so the window that comes forward within a minute of a toast opens that toast's session. Windows won't let a background process pull a *visible* window that is behind another one to the front (see [#4](https://github.com/ROYLeXJ/dsh-notify-tray/issues/4)); a minimized window is restored.
|
|
150
|
-
|
|
151
|
-
## Development
|
|
82
|
+
**记录保存在什么地方?**
|
|
152
83
|
|
|
153
|
-
|
|
154
|
-
npm install
|
|
155
|
-
npm test # node --test
|
|
156
|
-
node scripts/demo.mjs # walk a demo-only whale through every state (macOS menu bar)
|
|
157
|
-
node scripts/demo.mjs --live # drive the real whale (DSH must be idle); restored afterwards
|
|
158
|
-
node scripts/demo.mjs --all # also show "needs approval" / "failed"
|
|
159
|
-
```
|
|
84
|
+
花费账本默认位于 `~/.dsh/storages/dsh-notify-tray/ledger.json`,保留 31 天;配置了 `DSH_HOME` 时使用该目录。设置由 DSH 的当前 profile 管理。
|
|
160
85
|
|
|
161
|
-
|
|
86
|
+
## 安装与更新
|
|
162
87
|
|
|
163
|
-
|
|
164
|
-
|---|---|
|
|
165
|
-
| `lib/index.js` | Host half: session tracking, spend ledger, plan / quota polling, tray driver, OS-notification fallback, `GET notify-tray/state` API |
|
|
166
|
-
| `lib/client.js` | Browser half: native notifications from the DSH window and the settings page |
|
|
167
|
-
| `lib/tray/` | Status-bar drivers (macOS helper via `assets/tray-darwin.js`, Linux StatusNotifierItem over D-Bus) |
|
|
168
|
-
| `lib/catalog.js` / `lib/pricing.js` / `lib/quota.js` | Plan presets, price resolution, provider quota endpoints |
|
|
169
|
-
| `lib/voice.js` / `lib/whale.js` | Notification copy in the whale's voice; icon rendering |
|
|
170
|
-
| `locale/` | Plugin title / description in `en` and `zh` |
|
|
171
|
-
| `reference/` | DSH type declarations and example bundles used while developing |
|
|
88
|
+
在 DSH「插件 → 添加插件」输入 `dsh-notify-tray` 安装。需要指定已发布版本时,输入 `dsh-notify-tray@版本号`,可在 [npm](https://www.npmjs.com/package/dsh-notify-tray) 查看已发布版本。
|
|
172
89
|
|
|
173
|
-
|
|
90
|
+
### 在线更新
|
|
174
91
|
|
|
175
|
-
|
|
92
|
+
侧栏设置页底部提供「版本更新」卡片:
|
|
176
93
|
|
|
177
|
-
-
|
|
94
|
+
- 打开设置页时自动检查,也可以点击「检查更新」。
|
|
95
|
+
- 发现兼容且未废弃的正式版时,显示新版本号和「立即更新」。点击后先保存设置,再交给 DSH 原生插件管理器更新。
|
|
96
|
+
- 安装不会自动开始;DSH 负责版本兼容性检查和失败时的恢复。页面会区分更新完成、需要重启、恢复旧版和结果尚未确认。
|
|
97
|
+
- 本地目录、Git 等非 npm 安装不支持这条在线更新流程,会显示原因。需等正式版发布到 npm 后,通过插件管理页改为 npm 安装。
|
|
98
|
+
|
|
99
|
+
也可以继续使用 DSH 插件管理页的原生更新功能。提示需要重启时,请重启 DSH。
|
|
100
|
+
|
|
101
|
+
开发或试用尚未发布的代码,可从本地仓库安装:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
dsh plugin --profile desktop add /absolute/path/to/dsh-notify-tray
|
|
105
|
+
```
|
|
178
106
|
|
|
179
|
-
|
|
107
|
+
Web 用户将 `desktop` 换成 `web`。安装后重启对应 DSH 实例。
|
|
180
108
|
|
|
181
|
-
|
|
109
|
+
遇到问题可在 [GitHub Issues](https://github.com/ROYLeXJ/dsh-notify-tray/issues) 提交,附上 DSH 版本、插件版本、系统和复现步骤。
|