dsh-token-dash 0.0.0-stage → 1.0.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/AGENTS.md ADDED
@@ -0,0 +1,72 @@
1
+ # dsh-token-dash 项目规则
2
+
3
+ > 面向 AI agent 与维护者。本仓库是 DSH 插件代码仓,与 `Context-Engineer` 文档仓分离;规则以本文件为准。
4
+
5
+ ## 构建与测试
6
+
7
+ - Node `>=20`;纯 ESM;首版零构建,源码直接发布。
8
+ - 宿主入口 `index.js`,客户端 `client.js`(手写 `window.__ModuleLoader__` bundle,id 必须等于包名)。
9
+ - 不提交 `lib/`;`prepublishOnly` 跑 `npm test`。
10
+
11
+ ```bash
12
+ npm test # L1:node --test
13
+ npm run e2e # L2 + L3:临时 DSH_HOME + Playwright
14
+ npm pack --dry-run
15
+ ```
16
+
17
+ ## 临时目录
18
+
19
+ - 统一使用仓库根 `.tmp/`,禁止在仓库根或 `src/` 下创建临时文件。
20
+ - 子目录固定:`.tmp/dsh-home`(隔离 DSH_HOME)、`.tmp/pack`(tgz)、`.tmp/e2e`(截图 / 日志 / summary)。
21
+ - 可用环境变量 `TOKEN_DASH_TMP` 覆盖;E2E 默认 teardown 清理,`--keep` 保留现场。
22
+ - 测试工具脚本放 `scripts/`,本地与 CI 复用,不写进 `tests/`。
23
+
24
+ ## Git 管理边界
25
+
26
+ ### 进入版本管理
27
+
28
+ | 类别 | 文件 |
29
+ |---|---|
30
+ | 包与配置 | `package.json`、`pnpm-lock.yaml`、`tsconfig.json`、`tsdown.config.ts`、`playwright.config.ts`、`cordis.patch.yml`、`.gitignore` |
31
+ | 源码 | `src/**` |
32
+ | 文案资源 | `locale/**`、`icon.svg` |
33
+ | 测试脚本 | `tests/unit/**`、`tests/e2e/**/*.spec.ts`、`tests/e2e/fixtures/**`(仅合成数据) |
34
+ | 工具脚本 | `scripts/**` |
35
+ | 工程与发布 | `.github/workflows/**`、`README.md`、`LICENSE`、`AGENTS.md`、`CHANGELOG.md` |
36
+ | 文档 | `docs/**`(如有) |
37
+
38
+ ### 不进入版本管理
39
+
40
+ | 类别 | 文件 |
41
+ |---|---|
42
+ | 依赖与产物 | `node_modules/`、`lib/`、`dist/`、`build/` |
43
+ | 临时目录 | `.tmp/`、`artifacts/`、`coverage/`、`playwright-report/`、`test-results/` |
44
+ | 打包产物 | `*.tgz`、`*.tar.gz` |
45
+ | 日志与缓存 | `*.log`、`.cache/` |
46
+ | 敏感信息 | `.env`、`.env.*`、`*.pem`、`*.key`、`.credentials*` |
47
+ | 系统与编辑器 | `.DS_Store`、`Thumbs.db`、`.vscode/` |
48
+
49
+ 规则:
50
+
51
+ 1. E2E **测试脚本与合成 fixture 必须入库**;截图、日志、报告、trace 一律忽略。
52
+ 2. 真实 `$DSH_HOME/sessions`、真实会话 JSONL、任何凭证**永不入库**。
53
+ 3. `pnpm-lock.yaml` 必须提交,保证可复现构建。
54
+ 4. 提交前至少跑 `pnpm test` 与 `pnpm pack:check`。
55
+
56
+ ## 发布
57
+
58
+ - AI 只准备到“可发布”,不执行 `npm publish`、不推 tag;发布由用户明确授权。
59
+ - npm 包只含 `lib` / `cordis.patch.yml` / `locale` / `README.md` / `LICENSE`。
60
+ - 发布流程见 `Context-Engineer/docs/checklist/active/dsh/token-dash-release-checklist.md`。
61
+
62
+ ## 安全
63
+
64
+ - 不读取 `~/.dsh/.credentials.yaml`;凭据只经宿主 `ctx.credentials.resolve(...)`。
65
+ - 余额查询仅限 DeepSeek / Kimi / GLM 官方接口;第三方显示“第三方不支持”且不请求。
66
+ - 密钥、cookie、token 不得出现在源码、日志、fixture 或提交信息中。
67
+
68
+ ## 变更纪律
69
+
70
+ - 先更新 plan / checklist,再改代码;改动范围以施工稿声明为准。
71
+ - 不顺手改边界外文件;需要越界时先更新文档并重新确认。
72
+ - 新增依赖前说明理由;运行时依赖保持最少(当前仅 `zod`)。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-token-dash authors
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.en.md ADDED
@@ -0,0 +1,169 @@
1
+ <h1 align="center">dsh-token-dash</h1>
2
+
3
+ <p align="center">
4
+ <a href="./README.md">简体中文</a> | English
5
+ </p>
6
+
7
+ <p align="center">
8
+ Track daily/monthly model spend and budget headroom right next to the DSH input box: paste an API Key and the plan is auto-detected (subscription or pay-as-you-go), set a monthly budget, and consumption is estimated locally in real time.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/spartawhy117/dsh-token-dash/releases">Latest release</a> ·
13
+ <a href="./CHANGELOG.md">Changelog</a> ·
14
+ <a href="https://github.com/spartawhy117/dsh-token-dash/issues">Feedback</a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <img src="https://img.shields.io/github/v/tag/spartawhy117/dsh-token-dash?label=version&sort=semver" alt="version" />
19
+ <img src="https://img.shields.io/github/downloads/spartawhy117/dsh-token-dash/total?label=downloads" alt="downloads" />
20
+ <img src="https://img.shields.io/github/license/spartawhy117/dsh-token-dash" alt="license" />
21
+ <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node" />
22
+ </p>
23
+
24
+ - **Providers**: DeepSeek (DS account / API key), GLM Coding (subscription), Kimi Coding (subscription), Kimi / OpenRouter / Qwen (pay-as-you-go; OpenRouter in USD, Qwen CNY domestic / USD international) — paste a key and the billing mode is detected automatically
25
+ - **Pages**: bottom bar Pill → floating dashboard → settings; click the pill to expand, click outside to collapse
26
+ - **Dashboard data**: per-provider monthly budget progress (used / total / percent), today's spend, account balance, subscription 5h/weekly windows with reset times, model costs grouped by currency, token usage with cache hit rate
27
+ - **Settings**: per-provider monthly budget (with currency), three refresh intervals, balance toggle, log viewing / export, check for updates
28
+ - **Data**: daily / monthly usage estimated locally (built-in price catalog + community price table), three-layer model attribution, read-only local sessions
29
+
30
+ ---
31
+
32
+ ## Install
33
+
34
+ Requires DSH `0.2.1` or newer. Three options:
35
+
36
+ ```bash
37
+ # Option 1: install from npm (recommended)
38
+ dsh plugin --profile desktop add dsh-token-dash
39
+
40
+ # Option 2: install straight from the GitHub repo (plain JS, no build step)
41
+ dsh plugin --profile desktop add github:spartawhy117/dsh-token-dash
42
+
43
+ # Option 3: download dsh-token-dash-x.y.z.tgz from Releases and install locally (offline)
44
+ dsh plugin --profile desktop add /path/to/dsh-token-dash-1.0.0.tgz
45
+ ```
46
+
47
+ Update: run `update` with the same name, or use the in-app updater (settings → check for updates). Remove: run `remove` with the same name; data stays in `$DSH_HOME/dsh-token-dash/`.
48
+
49
+ ---
50
+
51
+ ## Interface
52
+
53
+ ```text
54
+ P1 · Bottom bar pill (click to open the dashboard)
55
+ ┌──────────────────────────────────────────────────────────┐
56
+ │ [API] Budget 91.9% · Today ¥0.04 · Balance ¥87.66⌃ │
57
+ └──────────────────────────────────────────────────────────┘
58
+ ┌──────────────────────────────────────────────────────────┐
59
+ │ [Sub] 5h 42% · Week 18%⌃ │
60
+ └──────────────────────────────────────────────────────────┘
61
+
62
+ P2 · Floating dashboard (opens right above the pill; cards appear as API keys are detected)
63
+ ┌──────────────────────────────────────────────────────────┐
64
+ │ Token Dashboard Refresh Settings × │
65
+ │ Pay-as-you-go (3 detected) just now │
66
+ │ ┌──────────────────────────────────────────────────────┐ │
67
+ │ │ DeepSeek Budget ¥79.13/¥95.80 · 91.9% Today Bal. │ │
68
+ │ │ [=========================================-------] │ │
69
+ │ └──────────────────────────────────────────────────────┘ │
70
+ │ ┌──────────────────────────────────────────────────────┐ │
71
+ │ │ OpenRouter Budget $23.52/$62.00 · 38.0% Today Bal. │ │
72
+ │ │ [==================--------------------------------] │ │
73
+ │ └──────────────────────────────────────────────────────┘ │
74
+ │ Subscriptions (2 detected) │
75
+ │ ┌────────────────────────────┐ ┌────────────────────────┐ │
76
+ │ │ GLM Coding │ │ Kimi Coding │ │
77
+ │ │ 5h 42% Week 18% │ │ 5h 30% Week 12% │ │
78
+ │ │ Resets 14:05 │ │ Resets 15:20 │ │
79
+ │ └────────────────────────────┘ └────────────────────────┘ │
80
+ │ API cost breakdown / this month local estimates │
81
+ │ Model usage / this month total 1.31M │
82
+ └──────────────────────────────────────────────────────────┘
83
+
84
+ P3 · Settings
85
+ ┌──────────────────────────────────────────────────────────┐
86
+ │ ← Back Token Dashboard [Close] │
87
+ │ API billing (2 detected) │
88
+ │ DeepSeek Monthly budget [ 500.00 ] CNY │
89
+ │ OpenRouter Monthly budget [ 50.00 ] USD │
90
+ │ Subscriptions (2 detected) [Rescan] │
91
+ │ GLM Coding 5h 42% / Week 18% │
92
+ │ Kimi Coding 5h 30% / Week 12% │
93
+ │ Display │
94
+ │ Refresh interval [30s] [1 min] [5 min] │
95
+ │ Account balance [On] │
96
+ │ Logs │
97
+ │ View logs [Open log folder] [Export logs] │
98
+ │ Pricing & version │
99
+ │ Version 1.0.0 [Check update]│
100
+ └──────────────────────────────────────────────────────────┘
101
+
102
+ UI transitions
103
+ click pill / Enter
104
+ ┌──────────┐ ──────────────────→ ┌────────────┐
105
+ │ P1 idle │ │ P2 dashboard│
106
+ └──────────┘ ←────────────────── └────────────┘
107
+ ↑ click pill / click outside / [×]
108
+ │ │[Settings]
109
+ │ ▼
110
+ │ [← Back] / click outside ┌────────────┐
111
+ └──────────────────────────── │ P3 settings │
112
+ └────────────┘
113
+ ```
114
+
115
+ **P1 · Bottom bar pill** (home workspace row / activity row under the chat input)
116
+
117
+ <p align="center">
118
+ <img src="./doc/pic/pill-home.png" alt="Home pill" />
119
+ </p>
120
+
121
+ <p align="center">
122
+ <img src="./doc/pic/pill-session.png" alt="Session pill" />
123
+ </p>
124
+
125
+ **P2 · Floating dashboard**
126
+
127
+ <p align="center">
128
+ <img src="./doc/pic/panel-dashboard.png" alt="Dashboard" />
129
+ </p>
130
+
131
+ **P3 · Settings**
132
+
133
+ <p align="center">
134
+ <img src="./doc/pic/settings.png" alt="Settings" />
135
+ </p>
136
+
137
+ ---
138
+
139
+ ## Logs & privacy
140
+
141
+ When filing a bug, attach `~/.dsh/logs/dsh-token-dash/` (already redacted). Error log entries carry `errorKind` (http/timeout/network/parse) and `httpStatus`, which usually pinpoints the cause:
142
+
143
+ ```bash
144
+ npm run logs -- --tail 50 # tail recent logs
145
+ npm run logs -- --module slot,adapter.* # filter by module
146
+ ```
147
+
148
+ Reads only local session `usage` (title-generation overhead excluded); balances come from official endpoints only, with credentials resolved by the host and never written to disk; costs are local estimates — no billing requests are ever made.
149
+
150
+ ## Development
151
+
152
+ ```bash
153
+ npm test # unit tests
154
+ npm run e2e # end-to-end (temp DSH_HOME + web profile + Playwright)
155
+ npm run pack # build the release tarball into build/
156
+ ```
157
+
158
+ Releases: pushing a `v*` tag triggers the GitHub Release (tarball) and an npm staged publish automatically (goes live after a maintainer approves it on npmjs.com with 2FA); see [doc/release.md](./doc/release.md) for the full checklist.
159
+
160
+ ## Acknowledgements
161
+
162
+ Attribution and billing semantics learned from these community plugins:
163
+
164
+ - [dsh-cost-dashboard](https://github.com/mike-lee0120/dsh-cost-dashboard)
165
+ - [dsh-token-usage-lao](https://github.com/LaoYueHanNi/dsh-token-usage)
166
+ - [dsh-ui-usage-billing](https://github.com/kenz1117/dsh-ui-usage-billing)
167
+ - [dsh-spend](https://github.com/nonewind/dsh-spend)
168
+ - [dsh-stats-panel](https://github.com/zhang-jiazhi/dsh-stats-panel)
169
+ - [DshCockpit](https://github.com/Lxiayu/DshCockpit)
package/README.md CHANGED
@@ -1,3 +1,193 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">dsh-token-dash</h1>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center">
4
+ 简体中文 | <a href="./README.en.md">English</a>
5
+ </p>
6
+
7
+ <p align="center">
8
+ 在 DSH 输入框旁看清每日/每月模型消耗与预算余量:API Key 一填即自动识别订阅还是按量计费,月度预算可设、消耗实时估算。
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://github.com/spartawhy117/dsh-token-dash/releases">最新版本</a> ·
13
+ <a href="./CHANGELOG.md">更新日志</a> ·
14
+ <a href="https://github.com/spartawhy117/dsh-token-dash/issues">问题反馈</a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <img src="https://img.shields.io/github/v/tag/spartawhy117/dsh-token-dash?label=version&sort=semver" alt="version" />
19
+ <img src="https://img.shields.io/github/downloads/spartawhy117/dsh-token-dash/total?label=downloads" alt="downloads" />
20
+ <img src="https://img.shields.io/github/license/spartawhy117/dsh-token-dash" alt="license" />
21
+ <img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen" alt="node" />
22
+ </p>
23
+
24
+ - **厂商支持**:DeepSeek(DS 账号 / API Key)、GLM Coding(订阅)、Kimi Coding(订阅)、Kimi / OpenRouter / Qwen(按量,OpenRouter USD、Qwen 国内 CNY / 国际 USD)——填 Key 自动识别订阅或按量计费
25
+ - **页面**:底栏 Pill → 浮层看板 → 设置;Pill 点击展开、点击浮层外收起
26
+ - **看板数据**:各供应商月度预算进度(已用 / 总额 / 百分比)、今日消耗、账户余额、订阅 5h/周窗口与重置时间、按币种分组的模型费用、token 用量与缓存命中率
27
+ - **设置**:按供应商的月度预算(带币种)、刷新间隔三档、账户余额开关、日志查看 / 导出、检查更新
28
+ - **数据口径**:每日 / 每月用量本地估算(内置价格表 + 社区价格表),三层模型归属,只读本地会话
29
+
30
+ ---
31
+
32
+ ## 安装
33
+
34
+ Requires DSH `0.2.1` or newer,三种方式任选:
35
+
36
+ ```bash
37
+ # 方式一:npm 安装(推荐)
38
+ dsh plugin --profile desktop add dsh-token-dash
39
+
40
+ # 方式二:GitHub 仓库直装(纯 JS 无构建,源码即产物)
41
+ dsh plugin --profile desktop add github:spartawhy117/dsh-token-dash
42
+
43
+ # 方式三:从 Releases 下载 dsh-token-dash-x.y.z.tgz 后本地安装(离线场景)
44
+ dsh plugin --profile desktop add /path/to/dsh-token-dash-1.0.0.tgz
45
+ ```
46
+
47
+ 更新:`update` 同名命令(npm / github: 各自同名),或在插件设置页(P3 → 检查更新)内完成。卸载:`remove` 同名命令,数据保留在 `$DSH_HOME/dsh-token-dash/`。
48
+
49
+ ---
50
+
51
+ ## 界面
52
+
53
+ ```text
54
+ P1 · 底栏 Pill(点击展开看板)
55
+ ┌──────────────────────────────────────────────────────────┐
56
+ │ [API] 预算 91.9% · 今日 ¥0.04 · 余额 ¥87.66⌃ │
57
+ └──────────────────────────────────────────────────────────┘
58
+ ┌──────────────────────────────────────────────────────────┐
59
+ │ [订阅] 5h 42% · 周 18%⌃ │
60
+ └──────────────────────────────────────────────────────────┘
61
+
62
+ P2 · 浮层看板(pill 正上方弹出;卡片与行随 API Key 侦测动态显示)
63
+ ┌──────────────────────────────────────────────────────────┐
64
+ │ Token 看板 刷新 设置 关闭│
65
+ │ API 按量(已检测 3) 刚刚 │
66
+ │ ┌──────────────────────────────────────────────────────┐ │
67
+ │ │ DeepSeek 官方 预算 ¥79.13/¥95.80 · 91.9% 今日 余额 │ │
68
+ │ │ [=========================================-------] │ │
69
+ │ └──────────────────────────────────────────────────────┘ │
70
+ │ ┌──────────────────────────────────────────────────────┐ │
71
+ │ │ OpenRouter 预算 $23.52/$62.00 · 38.0% 今日 余额 │ │
72
+ │ │ [==================--------------------------------] │ │
73
+ │ └──────────────────────────────────────────────────────┘ │
74
+ │ ┌──────────────────────────────────────────────────────┐ │
75
+ │ │ Qwen(百炼) 预算 ¥0.02/¥0.25 · 8.0% 今日 余额 │ │
76
+ │ │ [====----------------------------------------------] │ │
77
+ │ └──────────────────────────────────────────────────────┘ │
78
+ │ 订阅套餐(已检测 2) │
79
+ │ ┌────────────────────────────┐ ┌────────────────────────┐ │
80
+ │ │ GLM Coding │ │ Kimi Coding │ │
81
+ │ │ 5h 42% 周 18% │ │ 5h 30% 周 12% │ │
82
+ │ │ 重置 14:05 │ │ 重置 15:20 │ │
83
+ │ └────────────────────────────┘ └────────────────────────┘ │
84
+ │ API 费用明细 / 本月 DSH 本机估算 │
85
+ │ CNY 合计 ¥4.96 │
86
+ │ DeepSeek 官方 / DeepSeek-V4.1-Flash 99.6% ¥4.94 │
87
+ │ Qwen / Qwen3.8-Max 0.4% ¥0.02 │
88
+ │ USD 合计 $0.12 │
89
+ │ OpenRouter / DeepSeek-V4.1-Flash 100.0% $0.12 │
90
+ │ 模型用量明细 / 本月 合计 1.31M│
91
+ │ 模型 请求 输入 命中 输出 │
92
+ │ DeepSeek 官方 / V4.1-Flash 48 0.11M 0.20M 0.02M│
93
+ │ OpenRouter / V4.1-Flash 12 0.02M 0.01M 0.01M│
94
+ │ Qwen / Qwen3.8-Max 24 0.05M 0.02M 0.01M│
95
+ │ GLM Coding / GLM-5.3 64 0.30M 0.60M 0.04M│
96
+ └──────────────────────────────────────────────────────────┘
97
+
98
+ P3 · 设置
99
+ ┌──────────────────────────────────────────────────────────┐
100
+ │ ← 返回 Token 看板 [关闭] │
101
+ │ API 计费(已检测 2) │
102
+ │ ┌──────────────────────────────────────────────────────┐ │
103
+ │ │ DeepSeek 官方 月度预算 [ 500.00 ] CNY │ │
104
+ │ │ OpenRouter 月度预算 [ 50.00 ] USD │ │
105
+ │ └──────────────────────────────────────────────────────┘ │
106
+ │ 订阅计费(已检测 2) [重新检测] │
107
+ │ ┌──────────────────────────────────────────────────────┐ │
108
+ │ │ GLM Coding 5h 42% / 周 18% │ │
109
+ │ │ Kimi Coding 5h 30% / 周 12% │ │
110
+ │ └──────────────────────────────────────────────────────┘ │
111
+ │ 显示 │
112
+ │ ┌──────────────────────────────────────────────────────┐ │
113
+ │ │ 刷新间隔 [30 秒] [ 1 分钟 ] [5 分钟] │ │
114
+ │ │ 账户余额 [开] │ │
115
+ │ └──────────────────────────────────────────────────────┘ │
116
+ │ 日志 │
117
+ │ ┌──────────────────────────────────────────────────────┐ │
118
+ │ │ 查看日志 [打开日志文件夹] [导出日志] │ │
119
+ │ └──────────────────────────────────────────────────────┘ │
120
+ │ 价格与版本 │
121
+ │ ┌──────────────────────────────────────────────────────┐ │
122
+ │ │ 版本 1.0.0 [检查更新] │ │
123
+ │ └──────────────────────────────────────────────────────┘ │
124
+ └──────────────────────────────────────────────────────────┘
125
+
126
+ UI 交互转移
127
+ 点击 Pill / Enter
128
+ ┌──────────┐ ──────────────────→ ┌──────────┐
129
+ │ P1 收起 │ │ P2 看板 │
130
+ └──────────┘ ←────────────────── └──────────┘
131
+ ↑ 点击 Pill / 点击浮层外 / 「关闭」
132
+ │ │「设置」
133
+ │ ▼
134
+ │ 「← 返回」/ 点击浮层外 ┌──────────┐
135
+ └───────────────────────── │ P3 设置 │
136
+ └──────────┘
137
+ ```
138
+
139
+ **P1 · 底栏 Pill**(首页工作区行 / 会话输入框下方活动行)
140
+
141
+ <p align="center">
142
+ <img src="./doc/pic/pill-home.png" alt="首页 Pill" />
143
+ </p>
144
+
145
+ <p align="center">
146
+ <img src="./doc/pic/pill-session.png" alt="会话 Pill" />
147
+ </p>
148
+
149
+ **P2 · 浮层看板**
150
+
151
+ <p align="center">
152
+ <img src="./doc/pic/panel-dashboard.png" alt="浮层看板" />
153
+ </p>
154
+
155
+ **P3 · 设置**
156
+
157
+ <p align="center">
158
+ <img src="./doc/pic/settings.png" alt="设置" />
159
+ </p>
160
+
161
+ ---
162
+
163
+ ## 日志与隐私
164
+
165
+ 报障时附上 `~/.dsh/logs/dsh-token-dash/`(已脱敏),错误日志带 `errorKind`(http/timeout/network/parse)与 `httpStatus`,可直接定位原因:
166
+
167
+ ```bash
168
+ npm run logs -- --tail 50 # 查看最近日志
169
+ npm run logs -- --module slot,adapter.* # 按模块过滤
170
+ ```
171
+
172
+ 只读本地会话 `usage`,不统计标题生成开销;余额仅访问官方接口,凭据经宿主解析不落盘;费用为本地估算,不发起计费请求。
173
+
174
+ ## 开发
175
+
176
+ ```bash
177
+ npm test # 单元测试
178
+ npm run e2e # 端到端(临时 DSH_HOME + web profile + Playwright)
179
+ npm run pack # 发布 tarball 生成到 build/
180
+ ```
181
+
182
+ 发版:推 `v*` tag 自动触发 GitHub Release(tarball)与 npm 暂存(staged publishing,网页 2FA 审批后上线);完整流程见 [doc/release.md](./doc/release.md)。
183
+
184
+ ## 致谢
185
+
186
+ 归属与计费语义参考了以下社区插件:
187
+
188
+ - [dsh-cost-dashboard](https://github.com/mike-lee0120/dsh-cost-dashboard)
189
+ - [dsh-token-usage-lao](https://github.com/LaoYueHanNi/dsh-token-usage)
190
+ - [dsh-ui-usage-billing](https://github.com/kenz1117/dsh-ui-usage-billing)
191
+ - [dsh-spend](https://github.com/nonewind/dsh-spend)
192
+ - [dsh-stats-panel](https://github.com/zhang-jiazhi/dsh-stats-panel)
193
+ - [DshCockpit](https://github.com/Lxiayu/DshCockpit)