dsh-token-receipt 1.0.0 → 1.1.0
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/CHANGELOG.md +17 -18
- package/README.ja.md +92 -0
- package/README.md +54 -72
- package/README.zh.md +57 -68
- package/THIRD_PARTY_NOTICES.md +12 -20
- package/client.js +624 -254
- package/index.js +114 -34
- package/locale/en.json +2 -2
- package/locale/ja.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +9 -9
- package/pricing.js +63 -46
- package/RELEASING.md +0 -31
- package/assets/paper-texture.svg +0 -10
- package/assets/plastic-noise.svg +0 -10
- package/docs/FONTS.md +0 -11
- package/docs/PRICING.md +0 -94
- package/docs/screenshots/dark.png +0 -0
- package/docs/screenshots/light.png +0 -0
- /package/{docs → assets/detail}/DETAIL.ja.md +0 -0
- /package/{docs → assets/detail}/DETAIL.md +0 -0
- /package/{docs → assets/detail}/DETAIL.zh.md +0 -0
- /package/{docs → assets/detail}/preview.svg +0 -0
- /package/{docs/licenses → licenses}/Inter-OFL.txt +0 -0
- /package/{docs/licenses → licenses}/JetBrainsMono-OFL.txt +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to this project are documented
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 1.1.0
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Estimate model costs from the public models.dev catalogue, with a one-hour cache.
|
|
9
|
-
- Preserve provider/model identity and price input, cache reads, cache writes, and output separately.
|
|
10
|
-
- Use the DeepSeek Flash official reference rate and peak policy for WorkBuddy's deepseek-v4.1-flash route.
|
|
11
|
-
- Add model line amounts, cost breakdown, estimated total, and USD/CNY/JPY selection to the receipt.
|
|
12
|
-
- Default currency follows the interface language, with an explicit automatic mode and manual overrides.
|
|
13
|
-
- Convert JPY using a dated reference rate (2026-11-13: 1 USD = 160 JPY); preserve fractional-yen precision for small estimates.
|
|
14
|
-
- Mark missing prices, partial subtotals, stale prices, and the WorkBuddy reference-rate override.
|
|
15
|
-
- Keep the DSH whale logo and include monetary amounts and pricing notes in PNG/print output.
|
|
7
|
+
Released on 2026-11-17.
|
|
16
8
|
|
|
17
|
-
|
|
9
|
+
- Replace the `Print / PDF` action with `Copy image` to copy a 3x PNG receipt directly to the clipboard for instant pasting and sharing alongside `Save PNG`.
|
|
10
|
+
- Add `30 days`, `90 days`, and `All` (`days30`, `days90`, `all`) receipt periods with `TR-30D-`, `TR-90D-`, and `TR-ALL-` bill numbers and real matched-session date spans.
|
|
11
|
+
- Replay the stepped receipt-printer paper-feed animation automatically whenever switching periods or navigating dates.
|
|
12
|
+
- Harden pricing catalog refresh cancellation/timeouts, session LRU caching, and Node 22/24 test runner compatibility.
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- Print
|
|
24
|
-
-
|
|
14
|
+
## 1.0.0
|
|
15
|
+
|
|
16
|
+
Released on 2026-11-14.
|
|
17
|
+
|
|
18
|
+
- Print daily, weekly, and monthly token usage receipts with quick date navigation.
|
|
19
|
+
- Render a stepped receipt-printer feed animation with a torn paper edge, barcode, and `prefers-reduced-motion` support.
|
|
20
|
+
- Estimate model and token-category costs from the public [models.dev](https://models.dev) catalog across input, output, cache read, and cache write tokens, including built-in gateway route mappings and peak-hour adjustments.
|
|
21
|
+
- Match the default currency to the interface language, with manual switching between `USD`, `CNY`, and `JPY` and status notes for unpriced, partial, or cached rates.
|
|
22
|
+
- Export receipts as 3x high-resolution PNG images or print and save to PDF through the system print dialog.
|
|
23
|
+
- Support English, Simplified Chinese, and Japanese interfaces across light and dark themes.
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="icon.svg" width="64" height="64" alt="トークン明細" />
|
|
3
|
+
<h1>トークン明細</h1>
|
|
4
|
+
<p>DeepSeek Harness の日・週・月・直近30日・直近90日・全期間のトークン使用量と推定モデル料金を、手触りのあるレシートとして印刷し、画像のコピーや PNG 保存ができます。</p>
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-token-receipt"><img src="https://img.shields.io/npm/v/dsh-token-receipt.svg" alt="npm version" /></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /></a>
|
|
8
|
+
<a href="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml"><img src="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.3-4c8bf5.svg" alt="DSH >=0.2.2-rc.3" />
|
|
10
|
+
</p>
|
|
11
|
+
<p>
|
|
12
|
+
<a href="README.md">English</a> · <a href="README.zh.md">简体中文</a> · <strong>日本語</strong>
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
| ダーク · 日次明細 | ライト · 月次明細 |
|
|
17
|
+
| :---: | :---: |
|
|
18
|
+
|  |  |
|
|
19
|
+
|
|
20
|
+
## 主な機能
|
|
21
|
+
|
|
22
|
+
トークン明細は、DeepSeek Harness のローカル使用記録をレシート形式で集計・出力するプラグインです。
|
|
23
|
+
|
|
24
|
+
- **期間の切り替え。** **日**・**週**・**月**・**直近30日**・**直近90日**・**全期間** の明細を切り替えられ、日・週・月ではパネル内で過去の日付や今日へ移動できます。期間を切り替えるたびに紙送りアニメーションが再生されます。
|
|
25
|
+
- **モデル別の推定料金。** [models.dev](https://models.dev) の公開レートに基づき、入力・出力・キャッシュ読込・キャッシュ書込ごとの内訳を表示します。
|
|
26
|
+
- **複数通貨への対応。** 表示言語に応じた自動選択のほか、`USD`・`CNY`・`JPY` を手動で切り替えられます。
|
|
27
|
+
- **レシートプリンター演出。** 期間の切り替えに合わせてステップ紙送り、切り口、バーコードを再生し、OS の視差効果を減らす設定にも自動で追従します。
|
|
28
|
+
- **高解像度エクスポートと共有。** **画像をコピー** で 3 倍解像度の PNG をクリップボードへ直接コピーしてすぐ貼り付け・共有できるほか、**PNG を保存** で画像ファイルとしてダウンロードできます。
|
|
29
|
+
- **多言語とテーマ対応。** 日本語・English・简体中文のインターフェースと、ライト・ダーク両テーマに対応しています。
|
|
30
|
+
|
|
31
|
+
> [!NOTE]
|
|
32
|
+
> 表示される金額は [models.dev](https://models.dev) の公開カタログレートから算出した参考推定値であり、プロバイダーからの実際の請求額ではありません。セッションとトークン使用量のデータはすべて端末内に保持され、オンライン通信は公開料金レートの取得にのみ使用されます。
|
|
33
|
+
|
|
34
|
+
## インストール
|
|
35
|
+
|
|
36
|
+
### npm からインストール
|
|
37
|
+
|
|
38
|
+
DeepSeek Harness で **Plugins** を開き、**Add plugin** をクリックして以下を入力します。
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
dsh-token-receipt
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
または `plugin_manager` ツールでインストールします。
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"action": "install_bundle",
|
|
49
|
+
"target": "dsh-token-receipt"
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### ローカルリポジトリからインストール
|
|
54
|
+
|
|
55
|
+
ローカルのチェックアウト先の絶対パスを `plugin_manager` に指定します。
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"action": "install_bundle",
|
|
60
|
+
"target": "/absolute/path/to/dsh-token-receipt"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
DeepSeek Harness に `restart-required` と表示された場合は、アプリを一度再起動してください。
|
|
65
|
+
|
|
66
|
+
## 使い方
|
|
67
|
+
|
|
68
|
+
DeepSeek Harness の言語設定で **日本語** を選択すると、日本語インターフェースに切り替わります。
|
|
69
|
+
|
|
70
|
+
1. 左サイドバーから **トークン明細** を開きます。
|
|
71
|
+
2. **日**・**週**・**月**・**直近30日**・**直近90日**・**全期間** から期間を選びます(日・週・月では日付コントロールで過去の日付や今日へ移動できます)。期間を切り替えると紙送りアニメーションが再生されます。
|
|
72
|
+
3. **通貨** メニューから `USD`・`CNY`・`JPY` または **言語に合わせる** を選びます。
|
|
73
|
+
4. **画像をコピー** で 3 倍解像度の PNG をクリップボードに直接コピーしてそのまま貼り付け・共有でき、**PNG を保存** で画像をダウンロードできます。**印刷を再生** をクリックすると紙送りアニメーションをもう一度再生できます。
|
|
74
|
+
|
|
75
|
+
## 動作環境と開発
|
|
76
|
+
|
|
77
|
+
必要な実行環境は以下の通りです。
|
|
78
|
+
|
|
79
|
+
- DeepSeek Harness `>=0.2.2-rc.3 <0.3.0`
|
|
80
|
+
- Node.js `^22.19.0 || >=24.0.0`
|
|
81
|
+
|
|
82
|
+
ローカル環境で構文チェックとテストを実行するには、以下のコマンドを使用します。
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run check && npm test
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## ライセンス
|
|
89
|
+
|
|
90
|
+
[MIT License](LICENSE) のもとで公開されています。
|
|
91
|
+
|
|
92
|
+
レシートプリンターのインタラクションは [dqnamo の Receipt Printer](https://www.dqnamo.com/experiments/receipt-printer) に着想を得ており、料金解決ロジックの一部は [dsh-context](https://github.com/bowenliang123/dsh-context) をもとに改変しています。Apache-2.0 および SIL Open Font License 1.1 のライセンス表記については [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) を参照してください。
|
package/README.md
CHANGED
|
@@ -1,108 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="icon.svg" width="64" height="64" alt="Token Receipt" />
|
|
3
|
+
<h1>Token Receipt</h1>
|
|
4
|
+
<p>Print daily, weekly, monthly, 30-day, 90-day, and all-time DeepSeek Harness token usage and estimated model costs as a tactile receipt, then copy the image or save a PNG.</p>
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-token-receipt"><img src="https://img.shields.io/npm/v/dsh-token-receipt.svg" alt="npm version" /></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /></a>
|
|
8
|
+
<a href="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml"><img src="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.3-4c8bf5.svg" alt="DSH >=0.2.2-rc.3" />
|
|
10
|
+
</p>
|
|
11
|
+
<p>
|
|
12
|
+
<strong>English</strong> · <a href="README.zh.md">简体中文</a> · <a href="README.ja.md">日本語</a>
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
| Dark · Daily | Light · Monthly |
|
|
17
|
+
| :---: | :---: |
|
|
18
|
+
|  |  |
|
|
14
19
|
|
|
15
20
|
## Features
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
- **Local usage** — session data stays on your machine. Only the public price catalogue is fetched online; no usage or session text is uploaded.
|
|
26
|
-
- **Light and dark themes**, Chinese, English and Japanese, and reduced-motion support. Select **日本語** in DSH's language settings to use the Japanese interface.
|
|
22
|
+
Token Receipt turns local DeepSeek Harness usage records into a printable receipt:
|
|
23
|
+
|
|
24
|
+
- **Period navigation.** Switch between **Day**, **Week**, **Month**, **30 days**, **90 days**, and **All** views, step across dates for Day, Week, and Month without leaving the panel, and replay the paper-feed print animation automatically on every period change.
|
|
25
|
+
- **Estimated model costs.** Break down spending per model across input, output, cache read, and cache write tokens using public [models.dev](https://models.dev) rates.
|
|
26
|
+
- **Multi-currency display.** Match the default currency to your interface language, or switch manually between `USD`, `CNY`, and `JPY`.
|
|
27
|
+
- **Tactile receipt feed.** Watch a stepped paper-feed animation with a torn paper edge and a barcode whenever you print or switch periods, with automatic `prefers-reduced-motion` support.
|
|
28
|
+
- **High-DPI export and sharing.** Click **Copy image** to copy a 3x PNG directly to your clipboard for instant pasting and sharing, or **Save PNG** to download a local image.
|
|
29
|
+
- **Multilingual themes.** Use the interface in English, Simplified Chinese, or Japanese across light and dark themes.
|
|
27
30
|
|
|
28
|
-
!
|
|
31
|
+
> [!NOTE]
|
|
32
|
+
> Displayed costs are reference estimates calculated from public [models.dev](https://models.dev) catalog rates, not provider invoices. All session and token usage data stays local on your device, and only public price rates are fetched online.
|
|
29
33
|
|
|
30
|
-
##
|
|
34
|
+
## Installation
|
|
31
35
|
|
|
32
|
-
###
|
|
36
|
+
### Install from npm
|
|
33
37
|
|
|
34
|
-
Open **Plugins
|
|
38
|
+
Open **Plugins** in DeepSeek Harness, click **Add plugin**, and enter:
|
|
35
39
|
|
|
36
40
|
```text
|
|
37
41
|
dsh-token-receipt
|
|
38
42
|
```
|
|
39
43
|
|
|
40
|
-
Or
|
|
44
|
+
Or install with the `plugin_manager` tool:
|
|
41
45
|
|
|
42
46
|
```json
|
|
43
47
|
{
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
"action": "install_bundle",
|
|
49
|
+
"target": "dsh-token-receipt"
|
|
46
50
|
}
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
|
|
50
|
-
If DSH reports `restart-required`, restart the app once.
|
|
53
|
+
### Install from a local checkout
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
Pass the local repository path to `plugin_manager`:
|
|
53
56
|
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"action": "install_bundle",
|
|
60
|
+
"target": "/absolute/path/to/dsh-token-receipt"
|
|
61
|
+
}
|
|
57
62
|
```
|
|
58
63
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
1. Open **Token 账单 / Token receipt** in the left sidebar.
|
|
62
|
-
2. Pick **日 / 周 / 月** (day / week / month), or use the date picker.
|
|
63
|
-
3. The first visit plays the printer animation; use **重播打印 / Replay print**
|
|
64
|
-
to replay it.
|
|
65
|
-
4. Use **保存 PNG / Save PNG** to download a high-resolution receipt image.
|
|
66
|
-
5. Use **打印 / PDF / Print / PDF** for the system print dialog.
|
|
67
|
-
|
|
68
|
-

|
|
64
|
+
If DeepSeek Harness reports `restart-required`, restart the app once to activate the plugin.
|
|
69
65
|
|
|
70
|
-
##
|
|
66
|
+
## Usage
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
1. Open **Token receipt** from the left sidebar.
|
|
69
|
+
2. Select **Day**, **Week**, **Month**, **30 days**, **90 days**, or **All** (use the date controls on Day, Week, and Month to step across dates or return to today). Switching periods plays the paper-feed print animation automatically.
|
|
70
|
+
3. Choose `USD`, `CNY`, `JPY`, or **Follow language** in the **Currency** menu.
|
|
71
|
+
4. Click **Copy image** to copy a 3x PNG directly to your clipboard for instant pasting and sharing, **Save PNG** to download the receipt image, or **Replay print** to run the paper-feed animation again.
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
## Compatibility and development
|
|
78
74
|
|
|
79
|
-
|
|
75
|
+
Token Receipt requires the following runtime versions:
|
|
80
76
|
|
|
81
77
|
- DeepSeek Harness `>=0.2.2-rc.3 <0.3.0`
|
|
82
78
|
- Node.js `^22.19.0 || >=24.0.0`
|
|
83
79
|
|
|
84
|
-
|
|
85
|
-
(`client.js`), plus locale resources, a detail illustration, and an icon.
|
|
86
|
-
|
|
87
|
-
## Development
|
|
80
|
+
Run syntax checks and the test suite from a local checkout:
|
|
88
81
|
|
|
89
82
|
```bash
|
|
90
|
-
npm run check
|
|
91
|
-
npm test
|
|
92
|
-
npm pack --dry-run
|
|
83
|
+
npm run check && npm test
|
|
93
84
|
```
|
|
94
85
|
|
|
95
|
-
The plugin has no runtime npm dependencies. Fonts are embedded in the client
|
|
96
|
-
bundle: Inter and JetBrains Mono, both under the SIL Open Font License 1.1.
|
|
97
|
-
See [docs/FONTS.md](docs/FONTS.md).
|
|
98
|
-
|
|
99
|
-
## Credits
|
|
100
|
-
|
|
101
|
-
The receipt-printer interaction is inspired by
|
|
102
|
-
[dqnamo's Receipt Printer experiment](https://www.dqnamo.com/experiments/receipt-printer).
|
|
103
|
-
This repository is an independent implementation; the bundled textures are
|
|
104
|
-
original procedural SVGs. Pricing resolution is adapted from [dsh-context](https://github.com/bowenliang123/dsh-context) under Apache-2.0; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
105
|
-
|
|
106
86
|
## License
|
|
107
87
|
|
|
108
|
-
|
|
88
|
+
Licensed under the [MIT License](LICENSE).
|
|
89
|
+
|
|
90
|
+
Receipt printer interaction inspired by [dqnamo's Receipt Printer](https://www.dqnamo.com/experiments/receipt-printer), with pricing resolution adapted from [dsh-context](https://github.com/bowenliang123/dsh-context). See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for Apache-2.0 and SIL Open Font License 1.1 notices.
|
package/README.zh.md
CHANGED
|
@@ -1,101 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="icon.svg" width="64" height="64" alt="Token 账单" />
|
|
3
|
+
<h1>Token 账单</h1>
|
|
4
|
+
<p>将 DeepSeek Harness 日、周、月、近 30 天、近 90 天与全部周期的 Token 用量及预估模型费用打印成一张有质感的小票,支持复制图片与保存 PNG。</p>
|
|
5
|
+
<p>
|
|
6
|
+
<a href="https://www.npmjs.com/package/dsh-token-receipt"><img src="https://img.shields.io/npm/v/dsh-token-receipt.svg" alt="npm version" /></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /></a>
|
|
8
|
+
<a href="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml"><img src="https://github.com/maxlee/dsh-token-receipt/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.3-4c8bf5.svg" alt="DSH >=0.2.2-rc.3" />
|
|
10
|
+
</p>
|
|
11
|
+
<p>
|
|
12
|
+
<a href="README.md">English</a> · <strong>简体中文</strong> · <a href="README.ja.md">日本語</a>
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
| 深色 · 每日账单 | 浅色 · 每月账单 |
|
|
17
|
+
| :---: | :---: |
|
|
18
|
+
|  |  |
|
|
19
|
+
|
|
20
|
+
## 功能特性
|
|
21
|
+
|
|
22
|
+
Token 账单将本地 DeepSeek Harness 用量记录整理为可打印的小票:
|
|
23
|
+
|
|
24
|
+
- **周期切换。** 查看 **日**、**周**、**月**、**近 30 天**、**近 90 天** 与 **全部** 账单;在日、周、月视图下可在同一面板内翻阅历史日期或回到今天,切换周期时自动播放送纸打印动画。
|
|
25
|
+
- **预估模型费用。** 基于 [models.dev](https://models.dev) 公开价格,按模型及输入、输出、缓存读取、缓存写入分别展示费用明细。
|
|
26
|
+
- **多币种显示。** 默认币种自动跟随界面语言,也可随时手动切换 `USD`、`CNY` 与 `JPY`。
|
|
27
|
+
- **小票打印动效。** 呈现阶梯送纸、纸张撕边与条形码细节,每次切换周期都会自动播放,并自动适配系统的减弱动态效果设置。
|
|
28
|
+
- **高清导出与分享。** 点击 **复制图片** 可将 3 倍分辨率 PNG 直接复制到剪贴板以便即刻粘贴分享,也可点击 **保存 PNG** 下载本地图片。
|
|
29
|
+
- **多语言与明暗主题。** 支持简体中文、English、日本語界面,适配浅色与深色主题。
|
|
30
|
+
|
|
31
|
+
> [!NOTE]
|
|
32
|
+
> 小票金额基于 [models.dev](https://models.dev) 公开目录价格计算,仅作参考估算,不等同于供应商实付账单。所有会话与 Token 用量数据均保留在本地设备,联网仅用于读取公开价格目录。
|
|
25
33
|
|
|
26
34
|
## 安装
|
|
27
35
|
|
|
28
|
-
### 从 npm
|
|
36
|
+
### 从 npm 安装
|
|
29
37
|
|
|
30
|
-
在 DeepSeek Harness 中打开 **Plugins
|
|
38
|
+
在 DeepSeek Harness 中打开 **Plugins**,点击 **Add plugin**,输入:
|
|
31
39
|
|
|
32
40
|
```text
|
|
33
41
|
dsh-token-receipt
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
也可以使用
|
|
44
|
+
也可以使用 `plugin_manager` 工具安装:
|
|
37
45
|
|
|
38
46
|
```json
|
|
39
47
|
{
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
"action": "install_bundle",
|
|
49
|
+
"target": "dsh-token-receipt"
|
|
42
50
|
}
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
重启一次应用即可。
|
|
53
|
+
### 从本地仓库安装
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
将本地仓库绝对路径传入 `plugin_manager`:
|
|
49
56
|
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"action": "install_bundle",
|
|
60
|
+
"target": "/absolute/path/to/dsh-token-receipt"
|
|
61
|
+
}
|
|
53
62
|
```
|
|
54
63
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
1. 左侧栏打开「Token 账单」。
|
|
58
|
-
2. 选择 **日 / 周 / 月**,或点日期选择器跳到某一天。
|
|
59
|
-
3. 第一次打开会自动播放一次打印动画;点「重播打印」可再次播放。
|
|
60
|
-
4. 「保存 PNG」会把高分辨率小票下载到本地。
|
|
61
|
-
5. 「打印 / PDF」会打开系统打印对话框。
|
|
64
|
+
如果 DeepSeek Harness 提示 `restart-required`,重启一次应用即可启用插件。
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
## 数据与隐私
|
|
66
|
+
## 使用
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
1. 在左侧边栏打开 **Token 账单**。
|
|
69
|
+
2. 选择 **日**、**周**、**月**、**近 30 天**、**近 90 天** 或 **全部**(在日、周、月视图下可通过日期控件翻阅历史日期或回到今天);切换周期时会自动播放送纸打印动画。
|
|
70
|
+
3. 在 **币种** 菜单中选择 `USD`、`CNY`、`JPY` 或 **跟随语言**。
|
|
71
|
+
4. 点击 **复制图片** 将 3 倍分辨率 PNG 小票直接复制到剪贴板以便粘贴分享,点击 **保存 PNG** 下载本地图片,或点击 **重播打印** 再次播放送纸动画。
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
## 兼容性与开发
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
运行环境要求:
|
|
75
76
|
|
|
76
77
|
- DeepSeek Harness `>=0.2.2-rc.3 <0.3.0`
|
|
77
78
|
- Node.js `^22.19.0 || >=24.0.0`
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
在本地仓库中运行语法检查与单元测试:
|
|
80
81
|
|
|
81
82
|
```bash
|
|
82
|
-
npm run check
|
|
83
|
-
npm test
|
|
84
|
-
npm pack --dry-run
|
|
83
|
+
npm run check && npm test
|
|
85
84
|
```
|
|
86
85
|
|
|
87
|
-
插件没有运行时 npm 依赖。字体以 base64 内嵌在客户端 bundle 中:
|
|
88
|
-
Inter 与 JetBrains Mono,均为 SIL Open Font License 1.1,详见
|
|
89
|
-
[docs/FONTS.md](docs/FONTS.md)。
|
|
90
|
-
|
|
91
|
-
## 致谢
|
|
92
|
-
|
|
93
|
-
小票打印机的交互参考了
|
|
94
|
-
[dqnamo Receipt Printer](https://www.dqnamo.com/experiments/receipt-printer);
|
|
95
|
-
内置纹理由程序化 SVG 生成。价格匹配参考
|
|
96
|
-
[dsh-context](https://github.com/bowenliang123/dsh-context),保留 Apache-2.0 授权,
|
|
97
|
-
详见 [第三方说明](THIRD_PARTY_NOTICES.md)。
|
|
98
|
-
|
|
99
86
|
## 许可证
|
|
100
87
|
|
|
101
|
-
|
|
88
|
+
基于 [MIT License](LICENSE) 开源。
|
|
89
|
+
|
|
90
|
+
小票打印机交互灵感来自 [dqnamo 的 Receipt Printer](https://www.dqnamo.com/experiments/receipt-printer),价格解析部分改编自 [dsh-context](https://github.com/bowenliang123/dsh-context)。Apache-2.0 与 SIL Open Font License 1.1 相关声明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## dsh-context
|
|
4
4
|
|
|
5
|
-
Parts of `pricing.js` are adapted from
|
|
6
|
-
[dsh-context](https://github.com/bowenliang123/dsh-context), commit
|
|
7
|
-
`d81325ec6bab9dae9bf83e7a866ac74119504e18`:
|
|
5
|
+
Parts of `pricing.js` are adapted from [dsh-context](https://github.com/bowenliang123/dsh-context) at commit `d81325ec6bab9dae9bf83e7a866ac74119504e18`:
|
|
8
6
|
|
|
9
7
|
- `src/shared/pricing.ts`
|
|
10
8
|
- `src/shared/priceIdentity.ts`
|
|
@@ -12,25 +10,19 @@ Parts of `pricing.js` are adapted from the following files in
|
|
|
12
10
|
|
|
13
11
|
Copyright 2025 bowenliang123.
|
|
14
12
|
|
|
15
|
-
These portions are licensed under the Apache License, Version 2.0.
|
|
16
|
-
copy of the upstream license, including its copyright notice, is provided in
|
|
17
|
-
[`licenses/dsh-context-LICENSE.txt`](licenses/dsh-context-LICENSE.txt).
|
|
18
|
-
The upstream repository did not contain a separate NOTICE file at that commit.
|
|
13
|
+
These portions are licensed under the Apache License, Version 2.0. See [`licenses/dsh-context-LICENSE.txt`](licenses/dsh-context-LICENSE.txt) for the full upstream license text and copyright notice. The upstream repository did not include a separate `NOTICE` file at that commit.
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
resolver was converted to a self-contained JavaScript module; Token Receipt
|
|
22
|
-
adds an activation-scoped price catalog, an explicit user-requested WorkBuddy
|
|
23
|
-
Flash reference-price override, per-message peak/off-peak pricing, and USD
|
|
24
|
-
amount breakdowns. The override is marked `user-override` in API responses.
|
|
15
|
+
`pricing.js` converts the TypeScript resolver into a standalone JavaScript module and adds an activation-scoped price catalog, built-in route mappings for compatible gateways, time-of-day peak and off-peak pricing, and USD cost breakdowns.
|
|
25
16
|
|
|
26
|
-
The rest of Token Receipt remains under the
|
|
27
|
-
|
|
17
|
+
The rest of Token Receipt remains under the MIT License in [`LICENSE`](LICENSE). These notices do not alter the license of the upstream portions.
|
|
18
|
+
|
|
19
|
+
## Embedded fonts
|
|
20
|
+
|
|
21
|
+
`client.js` embeds two open-source typefaces under the SIL Open Font License, Version 1.1:
|
|
22
|
+
|
|
23
|
+
- **[Inter](https://github.com/rsms/inter).** Copyright 2016 The Inter Project Authors. Licensed under the SIL Open Font License 1.1. Full license text in [`licenses/Inter-OFL.txt`](licenses/Inter-OFL.txt).
|
|
24
|
+
- **[JetBrains Mono](https://github.com/JetBrains/JetBrainsMono).** Copyright 2020 The JetBrains Mono Project Authors. Licensed under the SIL Open Font License 1.1. Full license text in [`licenses/JetBrainsMono-OFL.txt`](licenses/JetBrainsMono-OFL.txt).
|
|
28
25
|
|
|
29
26
|
## Model price data
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
[models.dev](https://models.dev/api.json). The model directory and its data
|
|
33
|
-
sources are maintained by [models.dev](https://github.com/anomalyco/models.dev).
|
|
34
|
-
The plugin does not bundle a copied model catalogue. Rates are reference
|
|
35
|
-
estimates and may differ from invoices, subscription entitlements, and
|
|
36
|
-
provider-specific pricing conditions.
|
|
28
|
+
Token Receipt fetches reference model rates at runtime from [models.dev](https://models.dev/api.json), maintained at [`anomalyco/models.dev`](https://github.com/anomalyco/models.dev). This package does not bundle a copied model catalog. Displayed amounts are reference estimates and may differ from provider invoices, subscription plans, or custom pricing terms.
|