dsh-tokenlens 1.7.3 → 1.7.5
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 +18 -0
- package/client.js +9 -54
- package/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
**版本记录约定**:同一发布日只保留一个章节,标题取当日**最后一个**已发布版本号;当日多次发布的改动合并到该章节,并在标题下注明当日实际发布过的版本号(npm 上仍可安装这些独立版本)。若当日已有发布,后续小改动不再单独增加版本号,而是并入下一篇日志。这样日志按天规整、不出现同日多个小版本。
|
|
6
6
|
|
|
7
|
+
## 1.7.5 — 2026-11-06
|
|
8
|
+
|
|
9
|
+
(当日已发布版本:v1.6.5 / v1.6.6 / v1.6.7 / v1.7.0 / v1.7.1 / v1.7.2 / v1.7.3 / v1.7.4 / v1.7.5)
|
|
10
|
+
|
|
11
|
+
- **fix(ui): Command Code 的 5 小时 / 本周 / 本月行不再显示消耗金额**——移除每行末尾的 `$0.27 / $14.00` 这类 `已用 / 上限` 美元数字。百分比本身已经表达了位置,而三处美元数字(窗口行、额度行、加购行)互相参照容易误读;卡片上只剩「加购」一处金额
|
|
12
|
+
- 每行保留:百分比、进度条、重置时间、`已消耗 Token · 预计可消耗 Token` 估算
|
|
13
|
+
- wire 数据不变(`windows[*].used` / `cap` / `unit` 仍上报),仅界面不再渲染;Agent 工具 `tokenlens_usage` 的读数不受影响
|
|
14
|
+
- 测试:370(断言三行都不再出现美元容量、`dsh-tokenlens-capacity-money` 数量为 0)
|
|
15
|
+
|
|
16
|
+
## 1.7.4 — 2026-11-06
|
|
17
|
+
|
|
18
|
+
(当日已发布版本:v1.6.5 / v1.6.6 / v1.6.7 / v1.7.0 / v1.7.1 / v1.7.2 / v1.7.3 / v1.7.4)
|
|
19
|
+
|
|
20
|
+
- **fix(ui): 供应商额度行只保留「加购」金额**——`剩余 $67.04` 与 `本月额度 $70.00` 都移除,v1.7.3 加的「模型等效额度」也一并去掉。这三个数放在一起互相矛盾(100 − 67.04 ≠ 实际消费),而本月百分比已在「本月」窗口行里表述,重复且易误读。现在该行只显示 `加购 $0.00`
|
|
21
|
+
- 清理随之无用的 5 个 i18n 文案键(`creditsRemaining` / `creditsGranted` / `creditsModelAllowance*`)
|
|
22
|
+
- wire 数据不变:`credits.remaining` / `granted` / `allowanceUsd` 仍然上报,仅界面不再展示(Agent 工具 `tokenlens_usage` 的读数不受影响)
|
|
23
|
+
- 测试:370(改写额度行断言为「只留加购、其余不得出现」)
|
|
24
|
+
|
|
7
25
|
## 1.7.3 — 2026-11-06
|
|
8
26
|
|
|
9
27
|
(当日已发布版本:v1.6.5 / v1.6.6 / v1.6.7 / v1.7.0 / v1.7.1 / v1.7.2 / v1.7.3)
|
package/client.js
CHANGED
|
@@ -197,11 +197,6 @@ window.__ModuleLoader__.load({
|
|
|
197
197
|
balanceToppedUp: '充值 {amount}',
|
|
198
198
|
balanceWallets: '钱包:{amounts}',
|
|
199
199
|
balanceBonus: '奖励:{amounts}',
|
|
200
|
-
creditsRemaining: '剩余 {amount}',
|
|
201
|
-
creditsGranted: '本月额度 {amount}',
|
|
202
|
-
creditsModelAllowance: '{model} 等效额度 {amount}',
|
|
203
|
-
creditsModelAllowanceModel: '当前模型',
|
|
204
|
-
creditsModelAllowanceHint: '控制台的每月百分比按额度池计算;等效额度是该模型折扣后能覆盖的消费额',
|
|
205
200
|
creditsPurchased: '加购 {amount}',
|
|
206
201
|
refresh: '刷新',
|
|
207
202
|
refreshing: '正在刷新…',
|
|
@@ -476,12 +471,6 @@ window.__ModuleLoader__.load({
|
|
|
476
471
|
balanceToppedUp: 'Topped up {amount}',
|
|
477
472
|
balanceWallets: 'Wallets: {amounts}',
|
|
478
473
|
balanceBonus: 'Bonus: {amounts}',
|
|
479
|
-
creditsRemaining: 'Remaining {amount}',
|
|
480
|
-
creditsGranted: 'Granted {amount}',
|
|
481
|
-
creditsModelAllowance: '{model} equivalent {amount}',
|
|
482
|
-
creditsModelAllowanceModel: 'current model',
|
|
483
|
-
creditsModelAllowanceHint:
|
|
484
|
-
'The console computes its monthly percentage from the credit pool; the equivalent allowance is what a discounted model can cover',
|
|
485
474
|
creditsPurchased: 'Purchased {amount}',
|
|
486
475
|
refresh: 'Refresh',
|
|
487
476
|
refreshing: 'Refreshing…',
|
|
@@ -4146,12 +4135,10 @@ window.__ModuleLoader__.load({
|
|
|
4146
4135
|
},
|
|
4147
4136
|
resetText === '' ? tokensText : ` · ${tokensText}`,
|
|
4148
4137
|
)
|
|
4149
|
-
//
|
|
4150
|
-
//
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
? `${formatMoney(window.used, window.unit)} / ${formatMoney(window.cap, window.unit)}`
|
|
4154
|
-
: null
|
|
4138
|
+
// v1.7.5: the provider-native money line ($used / $cap) is NOT rendered.
|
|
4139
|
+
// Command Code's 5-hour / weekly / monthly rows already state the percentage
|
|
4140
|
+
// and the local-token estimate, and the dollar figures only invited
|
|
4141
|
+
// comparison with the credits card. The only money left on the card is 加购.
|
|
4155
4142
|
const upstreamStatus =
|
|
4156
4143
|
window !== null &&
|
|
4157
4144
|
typeof window.status === 'string' &&
|
|
@@ -4193,9 +4180,6 @@ window.__ModuleLoader__.load({
|
|
|
4193
4180
|
resetText === '' ? null : h('span', { className: 'dsh-tokenlens-reset' }, resetText),
|
|
4194
4181
|
resetDate === null ? null : h('span', { className: 'dsh-tokenlens-reset-date', title: resetDate }, resetDate),
|
|
4195
4182
|
resetText === '' ? null : tokensSpan,
|
|
4196
|
-
capacityMoney === null
|
|
4197
|
-
? null
|
|
4198
|
-
: h('span', { className: 'dsh-tokenlens-capacity-money' }, capacityMoney),
|
|
4199
4183
|
upstreamStatus,
|
|
4200
4184
|
),
|
|
4201
4185
|
)
|
|
@@ -4365,49 +4349,20 @@ window.__ModuleLoader__.load({
|
|
|
4365
4349
|
)
|
|
4366
4350
|
}
|
|
4367
4351
|
|
|
4368
|
-
/** The Command Code credits line (
|
|
4352
|
+
/** The Command Code credits line (v1.7.4: the purchased amount only). */
|
|
4369
4353
|
function buildCreditsLine(snapshot, t) {
|
|
4370
4354
|
const credits = snapshot.credits
|
|
4371
4355
|
if (credits === null) return null
|
|
4372
4356
|
const parts = []
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
}
|
|
4378
|
-
if (credits.granted !== null) {
|
|
4379
|
-
parts.push(h('span', { key: 'granted' }, t('creditsGranted', { amount: formatMoney(credits.granted, 'USD') })))
|
|
4380
|
-
}
|
|
4357
|
+
// v1.7.4: 「剩余」 and 「本月额度」 were dropped on request — the remaining
|
|
4358
|
+
// credits already appear nowhere else useful, and the granted/allowance
|
|
4359
|
+
// pair invited confusion with the monthly percentage (which the provider
|
|
4360
|
+
// measures against its own pool). Only the purchased amount is kept.
|
|
4381
4361
|
if (credits.purchased !== null) {
|
|
4382
4362
|
parts.push(
|
|
4383
4363
|
h('span', { key: 'purchased' }, t('creditsPurchased', { amount: formatMoney(credits.purchased, 'USD') })),
|
|
4384
4364
|
)
|
|
4385
4365
|
}
|
|
4386
|
-
// v1.7.3: the console advertises a larger allowance for discounted models
|
|
4387
|
-
// (DeepSeek V4.1 Flash: $100 on a $70 pool) but still prints the monthly
|
|
4388
|
-
// percentage against the POOL. Say so instead of silently disagreeing.
|
|
4389
|
-
if (
|
|
4390
|
-
credits.allowanceUsd !== null &&
|
|
4391
|
-
credits.granted !== null &&
|
|
4392
|
-
Math.abs(credits.allowanceUsd - credits.granted) > 0.005
|
|
4393
|
-
) {
|
|
4394
|
-
const modelLabel = String(credits.allowanceModel ?? '').replace(/^[^/]+\//, '')
|
|
4395
|
-
parts.push(
|
|
4396
|
-
h(
|
|
4397
|
-
'span',
|
|
4398
|
-
{
|
|
4399
|
-
key: 'allowance',
|
|
4400
|
-
className: 'dsh-tokenlens-credits-allowance',
|
|
4401
|
-
'data-model-allowance': String(credits.allowanceUsd),
|
|
4402
|
-
title: t('creditsModelAllowanceHint'),
|
|
4403
|
-
},
|
|
4404
|
-
t('creditsModelAllowance', {
|
|
4405
|
-
model: modelLabel === '' ? t('creditsModelAllowanceModel') : modelLabel,
|
|
4406
|
-
amount: formatMoney(credits.allowanceUsd, 'USD'),
|
|
4407
|
-
}),
|
|
4408
|
-
),
|
|
4409
|
-
)
|
|
4410
|
-
}
|
|
4411
4366
|
if (parts.length === 0) return null
|
|
4412
4367
|
return h('div', { key: 'credits', className: 'dsh-tokenlens-credits' }, parts)
|
|
4413
4368
|
}
|
package/index.js
CHANGED
|
@@ -84,7 +84,7 @@ export const inject = []
|
|
|
84
84
|
export const PLUGIN_NAME = 'dsh-tokenlens'
|
|
85
85
|
|
|
86
86
|
/** Plugin version; mirrors package.json (kept here so diagnostics need no fs read). */
|
|
87
|
-
export const PLUGIN_VERSION = '1.7.
|
|
87
|
+
export const PLUGIN_VERSION = '1.7.5'
|
|
88
88
|
|
|
89
89
|
/** Documented defaults; every field of the raw row config is optional. */
|
|
90
90
|
const DEFAULTS = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-tokenlens",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "dsh-TokenLens (词元透镜) — provider-aware plan capacity plus local token statistics (today/7d/30d/all-time, by harness/provider/model/workspace) for DSH.",
|
|
6
6
|
"license": "MIT",
|