dsh-tokenlens 1.7.3 → 1.7.4
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 +9 -0
- package/client.js +5 -45
- package/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
**版本记录约定**:同一发布日只保留一个章节,标题取当日**最后一个**已发布版本号;当日多次发布的改动合并到该章节,并在标题下注明当日实际发布过的版本号(npm 上仍可安装这些独立版本)。若当日已有发布,后续小改动不再单独增加版本号,而是并入下一篇日志。这样日志按天规整、不出现同日多个小版本。
|
|
6
6
|
|
|
7
|
+
## 1.7.4 — 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)
|
|
10
|
+
|
|
11
|
+
- **fix(ui): 供应商额度行只保留「加购」金额**——`剩余 $67.04` 与 `本月额度 $70.00` 都移除,v1.7.3 加的「模型等效额度」也一并去掉。这三个数放在一起互相矛盾(100 − 67.04 ≠ 实际消费),而本月百分比已在「本月」窗口行里表述,重复且易误读。现在该行只显示 `加购 $0.00`
|
|
12
|
+
- 清理随之无用的 5 个 i18n 文案键(`creditsRemaining` / `creditsGranted` / `creditsModelAllowance*`)
|
|
13
|
+
- wire 数据不变:`credits.remaining` / `granted` / `allowanceUsd` 仍然上报,仅界面不再展示(Agent 工具 `tokenlens_usage` 的读数不受影响)
|
|
14
|
+
- 测试:370(改写额度行断言为「只留加购、其余不得出现」)
|
|
15
|
+
|
|
7
16
|
## 1.7.3 — 2026-11-06
|
|
8
17
|
|
|
9
18
|
(当日已发布版本: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…',
|
|
@@ -4365,49 +4354,20 @@ window.__ModuleLoader__.load({
|
|
|
4365
4354
|
)
|
|
4366
4355
|
}
|
|
4367
4356
|
|
|
4368
|
-
/** The Command Code credits line (
|
|
4357
|
+
/** The Command Code credits line (v1.7.4: the purchased amount only). */
|
|
4369
4358
|
function buildCreditsLine(snapshot, t) {
|
|
4370
4359
|
const credits = snapshot.credits
|
|
4371
4360
|
if (credits === null) return null
|
|
4372
4361
|
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
|
-
}
|
|
4362
|
+
// v1.7.4: 「剩余」 and 「本月额度」 were dropped on request — the remaining
|
|
4363
|
+
// credits already appear nowhere else useful, and the granted/allowance
|
|
4364
|
+
// pair invited confusion with the monthly percentage (which the provider
|
|
4365
|
+
// measures against its own pool). Only the purchased amount is kept.
|
|
4381
4366
|
if (credits.purchased !== null) {
|
|
4382
4367
|
parts.push(
|
|
4383
4368
|
h('span', { key: 'purchased' }, t('creditsPurchased', { amount: formatMoney(credits.purchased, 'USD') })),
|
|
4384
4369
|
)
|
|
4385
4370
|
}
|
|
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
4371
|
if (parts.length === 0) return null
|
|
4412
4372
|
return h('div', { key: 'credits', className: 'dsh-tokenlens-credits' }, parts)
|
|
4413
4373
|
}
|
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.4'
|
|
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.4",
|
|
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",
|