dsh-codearts 1.2.8 → 1.2.9
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 +11 -0
- package/lib/bin.mjs +1 -1
- package/lib/client/index.js +176 -128
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
本文件记录本插件的重要改动。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
4
4
|
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
5
5
|
|
|
6
|
+
## [1.2.9] - 2026-11-06
|
|
7
|
+
|
|
8
|
+
### 变更
|
|
9
|
+
|
|
10
|
+
- **热力图的悬停提示统一成明细卡**:日历格子和逐小时格子原来只有浏览器原生
|
|
11
|
+
`title`(一个灰底小文字框),下面再挂一行同内容的小字;现在和「按账号 / 按模型」
|
|
12
|
+
的用量条共用同一张悬停卡 —— 标题、分隔线、输入 / 输出 / 思考 / 缓存 / 请求 /
|
|
13
|
+
命中率,数字精确到个位。卡片贴着指针画(格子只有 36px 宽,锚在格子上会横穿整张
|
|
14
|
+
卡片),靠近视口右/下边界时自动翻到另一侧。底部那行改成固定的操作提示,不再复述
|
|
15
|
+
明细。
|
|
16
|
+
|
|
6
17
|
## [1.2.8] - 2026-11-05
|
|
7
18
|
|
|
8
19
|
### 变更
|
package/lib/bin.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { R as isBenefitModel, V as CodeArtsAccountStore, W as codeartsAccountsPath, d as fetchCallerIdentity, n as codeartsUsagePath, r as discoverModels, t as CodeArtsUsageTracker } from "./usage-B2LNsUuR.mjs";
|
|
3
3
|
import { existsSync, statSync } from "node:fs";
|
|
4
4
|
//#region src/version.ts
|
|
5
|
-
const CODEARTS_VERSION = "1.2.
|
|
5
|
+
const CODEARTS_VERSION = "1.2.9";
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/bin.ts
|
|
8
8
|
/**
|
package/lib/client/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function subscribeSidebarPanelWanted(listener) {
|
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region \0dsh-css:/home/runner/work/dsh-codearts/dsh-codearts/src/client/CodeArtsPluginCard.module.css.mjs
|
|
65
|
-
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);max-width:720px}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex:none;gap:6px;display:flex}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{font-weight:700;box-shadow:inset 0 -2px}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}";
|
|
65
|
+
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);max-width:720px}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex:none;gap:6px;display:flex}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTip[data-float=true]{z-index:40;position:fixed;bottom:auto;right:auto}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{font-weight:700;box-shadow:inset 0 -2px}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}";
|
|
66
66
|
const tagId$1 = "dsh-codearts/CodeArtsPluginCard.module.css";
|
|
67
67
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
68
68
|
const tag = document.createElement("style");
|
|
@@ -72,92 +72,92 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
72
72
|
document.head.appendChild(tag);
|
|
73
73
|
}
|
|
74
74
|
var CodeArtsPluginCard_module_css_default = {
|
|
75
|
+
"statValue": "xoziZG_statValue",
|
|
76
|
+
"statSub": "xoziZG_statSub",
|
|
77
|
+
"check": "xoziZG_check",
|
|
78
|
+
"body": "xoziZG_body",
|
|
79
|
+
"barFill": "xoziZG_barFill",
|
|
80
|
+
"statCard": "xoziZG_statCard",
|
|
75
81
|
"heatWeekday": "xoziZG_heatWeekday",
|
|
76
|
-
"
|
|
82
|
+
"creditBlock": "xoziZG_creditBlock",
|
|
83
|
+
"accountCard": "xoziZG_accountCard",
|
|
84
|
+
"card": "xoziZG_card",
|
|
77
85
|
"sectionLabel": "xoziZG_sectionLabel",
|
|
78
|
-
"
|
|
79
|
-
"usageFill": "xoziZG_usageFill",
|
|
80
|
-
"creditLink": "xoziZG_creditLink",
|
|
81
|
-
"modelRequests": "xoziZG_modelRequests",
|
|
82
|
-
"hint": "xoziZG_hint",
|
|
83
|
-
"usageTipSep": "xoziZG_usageTipSep",
|
|
84
|
-
"usageTipRow": "xoziZG_usageTipRow",
|
|
85
|
-
"expiryLabel": "xoziZG_expiryLabel",
|
|
86
|
-
"area": "xoziZG_area",
|
|
87
|
-
"balanceUnit": "xoziZG_balanceUnit",
|
|
88
|
-
"sectionHead": "xoziZG_sectionHead",
|
|
89
|
-
"danger": "xoziZG_danger",
|
|
90
|
-
"modelFill": "xoziZG_modelFill",
|
|
91
|
-
"creditRow": "xoziZG_creditRow",
|
|
92
|
-
"choices": "xoziZG_choices",
|
|
93
|
-
"modelRow": "xoziZG_modelRow",
|
|
94
|
-
"creditHint": "xoziZG_creditHint",
|
|
86
|
+
"error": "xoziZG_error",
|
|
95
87
|
"desc": "xoziZG_desc",
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
100
|
-
"check": "xoziZG_check",
|
|
101
|
-
"fieldLabel": "xoziZG_fieldLabel",
|
|
102
|
-
"statusLine": "xoziZG_statusLine",
|
|
103
|
-
"skeletonRow": "xoziZG_skeletonRow",
|
|
104
|
-
"tabPanel": "xoziZG_tabPanel",
|
|
105
|
-
"accountInfo": "xoziZG_accountInfo",
|
|
106
|
-
"usageBar": "xoziZG_usageBar",
|
|
107
|
-
"heatHourCell": "xoziZG_heatHourCell",
|
|
108
|
-
"creditFooter": "xoziZG_creditFooter",
|
|
109
|
-
"statValue": "xoziZG_statValue",
|
|
88
|
+
"accountRowActions": "xoziZG_accountRowActions",
|
|
89
|
+
"modelRow": "xoziZG_modelRow",
|
|
90
|
+
"balanceUnit": "xoziZG_balanceUnit",
|
|
110
91
|
"balance": "xoziZG_balance",
|
|
92
|
+
"usageTipRow": "xoziZG_usageTipRow",
|
|
93
|
+
"bar": "xoziZG_bar",
|
|
94
|
+
"accountRow": "xoziZG_accountRow",
|
|
95
|
+
"heatHourCell": "xoziZG_heatHourCell",
|
|
96
|
+
"header": "xoziZG_header",
|
|
97
|
+
"meta": "xoziZG_meta",
|
|
111
98
|
"tabs": "xoziZG_tabs",
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"claimAllRow": "xoziZG_claimAllRow",
|
|
115
|
-
"creditRows": "xoziZG_creditRows",
|
|
116
|
-
"link": "xoziZG_link",
|
|
117
|
-
"accountNameRow": "xoziZG_accountNameRow",
|
|
99
|
+
"modelChart": "xoziZG_modelChart",
|
|
100
|
+
"usageTipName": "xoziZG_usageTipName",
|
|
118
101
|
"accountName": "xoziZG_accountName",
|
|
119
|
-
"
|
|
102
|
+
"heatCell": "xoziZG_heatCell",
|
|
103
|
+
"heatLegend": "xoziZG_heatLegend",
|
|
104
|
+
"section": "xoziZG_section",
|
|
105
|
+
"modelFill": "xoziZG_modelFill",
|
|
106
|
+
"accountNameRow": "xoziZG_accountNameRow",
|
|
107
|
+
"claimAllRow": "xoziZG_claimAllRow",
|
|
108
|
+
"creditLink": "xoziZG_creditLink",
|
|
120
109
|
"choiceRow": "xoziZG_choiceRow",
|
|
121
|
-
"
|
|
122
|
-
"modelTokens": "xoziZG_modelTokens",
|
|
123
|
-
"skeleton": "xoziZG_skeleton",
|
|
124
|
-
"statSub": "xoziZG_statSub",
|
|
125
|
-
"usageTipName": "xoziZG_usageTipName",
|
|
126
|
-
"heatAxis": "xoziZG_heatAxis",
|
|
127
|
-
"name": "xoziZG_name",
|
|
128
|
-
"card": "xoziZG_card",
|
|
129
|
-
"manualForm": "xoziZG_manualForm",
|
|
130
|
-
"accountCard": "xoziZG_accountCard",
|
|
110
|
+
"updated": "xoziZG_updated",
|
|
131
111
|
"statGrid": "xoziZG_statGrid",
|
|
132
|
-
"modelTrack": "xoziZG_modelTrack",
|
|
133
|
-
"accountRowActions": "xoziZG_accountRowActions",
|
|
134
|
-
"actions": "xoziZG_actions",
|
|
135
|
-
"trendTip": "xoziZG_trendTip",
|
|
136
112
|
"field": "xoziZG_field",
|
|
137
|
-
"
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"bar": "xoziZG_bar",
|
|
147
|
-
"section": "xoziZG_section",
|
|
148
|
-
"heatGrid": "xoziZG_heatGrid",
|
|
113
|
+
"creditRows": "xoziZG_creditRows",
|
|
114
|
+
"modelRequests": "xoziZG_modelRequests",
|
|
115
|
+
"manual": "xoziZG_manual",
|
|
116
|
+
"skeletonRow": "xoziZG_skeletonRow",
|
|
117
|
+
"expiryRow": "xoziZG_expiryRow",
|
|
118
|
+
"manualForm": "xoziZG_manualForm",
|
|
119
|
+
"name": "xoziZG_name",
|
|
120
|
+
"usageTip": "xoziZG_usageTip",
|
|
121
|
+
"avatar": "xoziZG_avatar",
|
|
149
122
|
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
123
|
+
"modelTokens": "xoziZG_modelTokens",
|
|
124
|
+
"expiryLabel": "xoziZG_expiryLabel",
|
|
150
125
|
"heatHours": "xoziZG_heatHours",
|
|
126
|
+
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
127
|
+
"heatGrid": "xoziZG_heatGrid",
|
|
128
|
+
"accountEntry": "xoziZG_accountEntry",
|
|
129
|
+
"modelName": "xoziZG_modelName",
|
|
130
|
+
"heatAxis": "xoziZG_heatAxis",
|
|
131
|
+
"fieldLabel": "xoziZG_fieldLabel",
|
|
132
|
+
"hint": "xoziZG_hint",
|
|
133
|
+
"creditRow": "xoziZG_creditRow",
|
|
134
|
+
"creditFooter": "xoziZG_creditFooter",
|
|
135
|
+
"creditHint": "xoziZG_creditHint",
|
|
151
136
|
"manualSummary": "xoziZG_manualSummary",
|
|
152
|
-
"
|
|
137
|
+
"skeleton": "xoziZG_skeleton",
|
|
138
|
+
"headText": "xoziZG_headText",
|
|
139
|
+
"usageTipSep": "xoziZG_usageTipSep",
|
|
140
|
+
"accountInfo": "xoziZG_accountInfo",
|
|
141
|
+
"link": "xoziZG_link",
|
|
153
142
|
"balanceMeta": "xoziZG_balanceMeta",
|
|
154
|
-
"
|
|
143
|
+
"danger": "xoziZG_danger",
|
|
144
|
+
"trendTip": "xoziZG_trendTip",
|
|
155
145
|
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
156
|
-
"
|
|
157
|
-
"
|
|
146
|
+
"count": "xoziZG_count",
|
|
147
|
+
"modelShare": "xoziZG_modelShare",
|
|
148
|
+
"statusLine": "xoziZG_statusLine",
|
|
149
|
+
"usageFill": "xoziZG_usageFill",
|
|
150
|
+
"usageBar": "xoziZG_usageBar",
|
|
151
|
+
"choices": "xoziZG_choices",
|
|
152
|
+
"balanceRow": "xoziZG_balanceRow",
|
|
153
|
+
"actions": "xoziZG_actions",
|
|
154
|
+
"modelTrack": "xoziZG_modelTrack",
|
|
155
|
+
"accountHint": "xoziZG_accountHint",
|
|
156
|
+
"tabPanel": "xoziZG_tabPanel",
|
|
158
157
|
"accountToolbar": "xoziZG_accountToolbar",
|
|
159
|
-
"
|
|
160
|
-
"
|
|
158
|
+
"sectionHead": "xoziZG_sectionHead",
|
|
159
|
+
"area": "xoziZG_area",
|
|
160
|
+
"statLabel": "xoziZG_statLabel"
|
|
161
161
|
};
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region src/client/CodeArtsPluginCard.tsx
|
|
@@ -444,6 +444,62 @@ function hitPercentOf(totals) {
|
|
|
444
444
|
return Math.min(100, Math.round(cached / totals.promptTokens * 100));
|
|
445
445
|
}
|
|
446
446
|
/**
|
|
447
|
+
* 悬停明细卡的正文:标题(账号 / 模型 / 日期 / 钟点)+ 输入 / 输出 / 思考 / 缓存 /
|
|
448
|
+
* 请求 / 命中率。用量条和热力图格子共用这一份,改文案或加字段只需动这里。
|
|
449
|
+
*/
|
|
450
|
+
function UsageTipBody({ label, totals, t }) {
|
|
451
|
+
const cached = totals.cachedTokens;
|
|
452
|
+
const pct = hitPercentOf(totals);
|
|
453
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
454
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
455
|
+
className: CodeArtsPluginCard_module_css_default.usageTipName,
|
|
456
|
+
children: label
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: CodeArtsPluginCard_module_css_default.usageTipSep }),
|
|
459
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
460
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
461
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipInput") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.promptTokens) })]
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
464
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
465
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipOutput") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.completionTokens) })]
|
|
466
|
+
}),
|
|
467
|
+
(totals.reasoningTokens ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
468
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
469
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipReasoning") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.reasoningTokens ?? 0) })]
|
|
470
|
+
}),
|
|
471
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
472
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
473
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipCached") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: cached === void 0 ? t("usageTipNoCache") : exactCount(cached) })]
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: CodeArtsPluginCard_module_css_default.usageTipSep }),
|
|
476
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
477
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
478
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipRequests") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageRequestCount", { n: formatCount(totals.requests) }) })]
|
|
479
|
+
}),
|
|
480
|
+
pct !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
481
|
+
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
482
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipHit") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [pct, "%"] })]
|
|
483
|
+
})
|
|
484
|
+
] });
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* 悬停卡贴着指针画:热力图格子只有 36px 宽,卡片锚在格子上会横穿整张卡片,
|
|
488
|
+
* 所以和 agent-acta 一样用 fixed + 指针坐标,靠近右下边界时翻到另一侧。
|
|
489
|
+
*/
|
|
490
|
+
function tipPointStyle(point) {
|
|
491
|
+
const width = 230;
|
|
492
|
+
const height = 190;
|
|
493
|
+
const viewWidth = typeof window === "undefined" ? 0 : window.innerWidth;
|
|
494
|
+
const viewHeight = typeof window === "undefined" ? 0 : window.innerHeight;
|
|
495
|
+
const left = viewWidth > 0 && point.x + 16 + width > viewWidth ? point.x - 16 - width : point.x + 16;
|
|
496
|
+
const top = viewHeight > 0 && point.y + 16 + height > viewHeight ? point.y - 16 - height : point.y + 16;
|
|
497
|
+
return {
|
|
498
|
+
left: Math.max(8, left),
|
|
499
|
+
top: Math.max(8, top)
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
447
503
|
* 横向条形列表:名称 / 条 / token / 占比 / 请求数。
|
|
448
504
|
*
|
|
449
505
|
* 条长按「占组内总量的比例」画(不是按最大值归一化),所以几条加起来就是全部。
|
|
@@ -463,8 +519,6 @@ function UsageBars({ rows, t }) {
|
|
|
463
519
|
const value = valueOf(row);
|
|
464
520
|
const share = sum > 0 ? value / sum * 100 : 0;
|
|
465
521
|
const totals = row.totals;
|
|
466
|
-
const cached = totals.cachedTokens;
|
|
467
|
-
const pct = hitPercentOf(totals);
|
|
468
522
|
const detail = [t("usageRequests", { n: formatCount(totals.requests) }), t("usageTokens", {
|
|
469
523
|
prompt: formatTokens$1(totals.promptTokens),
|
|
470
524
|
completion: formatTokens$1(totals.completionTokens)
|
|
@@ -498,41 +552,14 @@ function UsageBars({ rows, t }) {
|
|
|
498
552
|
className: CodeArtsPluginCard_module_css_default.modelRequests,
|
|
499
553
|
children: t("usageRequestCount", { n: formatCount(totals.requests) })
|
|
500
554
|
}),
|
|
501
|
-
hovered === row.id && /* @__PURE__ */ (0, react_jsx_runtime.
|
|
555
|
+
hovered === row.id && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
502
556
|
className: CodeArtsPluginCard_module_css_default.usageTip,
|
|
503
557
|
role: "tooltip",
|
|
504
|
-
children:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: CodeArtsPluginCard_module_css_default.usageTipSep }),
|
|
510
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
511
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
512
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipInput") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.promptTokens) })]
|
|
513
|
-
}),
|
|
514
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
515
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
516
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipOutput") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.completionTokens) })]
|
|
517
|
-
}),
|
|
518
|
-
(totals.reasoningTokens ?? 0) > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
519
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
520
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipReasoning") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: exactCount(totals.reasoningTokens ?? 0) })]
|
|
521
|
-
}),
|
|
522
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
523
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
524
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipCached") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: cached === void 0 ? t("usageTipNoCache") : exactCount(cached) })]
|
|
525
|
-
}),
|
|
526
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: CodeArtsPluginCard_module_css_default.usageTipSep }),
|
|
527
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
528
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
529
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipRequests") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageRequestCount", { n: formatCount(totals.requests) }) })]
|
|
530
|
-
}),
|
|
531
|
-
pct !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
532
|
-
className: CodeArtsPluginCard_module_css_default.usageTipRow,
|
|
533
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("usageTipHit") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [pct, "%"] })]
|
|
534
|
-
})
|
|
535
|
-
]
|
|
558
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageTipBody, {
|
|
559
|
+
label: row.label,
|
|
560
|
+
totals,
|
|
561
|
+
t
|
|
562
|
+
})
|
|
536
563
|
})
|
|
537
564
|
]
|
|
538
565
|
}, row.id);
|
|
@@ -562,6 +589,8 @@ function weekdayOf(date) {
|
|
|
562
589
|
*/
|
|
563
590
|
function UsageHeat({ days, t }) {
|
|
564
591
|
const [hovered, setHovered] = (0, react.useState)(null);
|
|
592
|
+
/** 指针离开格子就清掉,卡片跟着指针停在那一次进入的位置。 */
|
|
593
|
+
const [point, setPoint] = (0, react.useState)(null);
|
|
565
594
|
const last = days.at(-1);
|
|
566
595
|
const month = last?.date.slice(0, 7) ?? "";
|
|
567
596
|
const inMonth = days.filter((day) => day.date.startsWith(month));
|
|
@@ -614,9 +643,12 @@ function UsageHeat({ days, t }) {
|
|
|
614
643
|
className: CodeArtsPluginCard_module_css_default.heatCell,
|
|
615
644
|
"data-tone": tone,
|
|
616
645
|
"data-today": entry.date === last?.date ? "true" : void 0,
|
|
617
|
-
|
|
618
|
-
onMouseEnter: entry.totals === void 0 ? void 0 : () => {
|
|
646
|
+
onMouseEnter: entry.totals === void 0 ? void 0 : (event) => {
|
|
619
647
|
setHovered(entry.date);
|
|
648
|
+
setPoint({
|
|
649
|
+
x: event.clientX,
|
|
650
|
+
y: event.clientY
|
|
651
|
+
});
|
|
620
652
|
},
|
|
621
653
|
onMouseLeave: entry.totals === void 0 ? void 0 : () => {
|
|
622
654
|
setHovered(null);
|
|
@@ -626,9 +658,20 @@ function UsageHeat({ days, t }) {
|
|
|
626
658
|
})
|
|
627
659
|
]
|
|
628
660
|
}),
|
|
661
|
+
shown?.totals !== void 0 && point !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
662
|
+
className: CodeArtsPluginCard_module_css_default.usageTip,
|
|
663
|
+
"data-float": "true",
|
|
664
|
+
role: "tooltip",
|
|
665
|
+
style: tipPointStyle(point),
|
|
666
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageTipBody, {
|
|
667
|
+
label: shown.date,
|
|
668
|
+
totals: shown.totals,
|
|
669
|
+
t
|
|
670
|
+
})
|
|
671
|
+
}),
|
|
629
672
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
630
673
|
className: CodeArtsPluginCard_module_css_default.trendTip,
|
|
631
|
-
children:
|
|
674
|
+
children: t("usageTrendHint")
|
|
632
675
|
})
|
|
633
676
|
] });
|
|
634
677
|
}
|
|
@@ -639,6 +682,7 @@ function UsageHeat({ days, t }) {
|
|
|
639
682
|
*/
|
|
640
683
|
function UsageHours({ hours, t }) {
|
|
641
684
|
const [hovered, setHovered] = (0, react.useState)(null);
|
|
685
|
+
const [point, setPoint] = (0, react.useState)(null);
|
|
642
686
|
const max = hours.reduce((peak, hour) => Math.max(peak, hour.totals.totalTokens), 0);
|
|
643
687
|
const shown = hovered === null ? void 0 : hours.find((entry) => entry.hour === hovered);
|
|
644
688
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
@@ -647,9 +691,12 @@ function UsageHours({ hours, t }) {
|
|
|
647
691
|
children: hours.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
648
692
|
className: CodeArtsPluginCard_module_css_default.heatHourCell,
|
|
649
693
|
"data-tone": toneOf(entry.totals.totalTokens, max),
|
|
650
|
-
|
|
651
|
-
onMouseEnter: () => {
|
|
694
|
+
onMouseEnter: (event) => {
|
|
652
695
|
setHovered(entry.hour);
|
|
696
|
+
setPoint({
|
|
697
|
+
x: event.clientX,
|
|
698
|
+
y: event.clientY
|
|
699
|
+
});
|
|
653
700
|
},
|
|
654
701
|
onMouseLeave: () => {
|
|
655
702
|
setHovered(null);
|
|
@@ -663,22 +710,23 @@ function UsageHours({ hours, t }) {
|
|
|
663
710
|
children: entry.hour % 6 === 0 ? entry.hour : ""
|
|
664
711
|
}, entry.hour))
|
|
665
712
|
}),
|
|
713
|
+
shown !== void 0 && point !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
714
|
+
className: CodeArtsPluginCard_module_css_default.usageTip,
|
|
715
|
+
"data-float": "true",
|
|
716
|
+
role: "tooltip",
|
|
717
|
+
style: tipPointStyle(point),
|
|
718
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UsageTipBody, {
|
|
719
|
+
label: `${String(shown.hour).padStart(2, "0")}:00`,
|
|
720
|
+
totals: shown.totals,
|
|
721
|
+
t
|
|
722
|
+
})
|
|
723
|
+
}),
|
|
666
724
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
667
725
|
className: CodeArtsPluginCard_module_css_default.trendTip,
|
|
668
|
-
children:
|
|
726
|
+
children: t("usageTrendHint")
|
|
669
727
|
})
|
|
670
728
|
] });
|
|
671
729
|
}
|
|
672
|
-
/** 一格趋势的明细文案:输入 / 缓存 / 命中率 / 请求数(输出与思考在明细卡里看)。 */
|
|
673
|
-
function trendDetail(totals, t) {
|
|
674
|
-
const pct = hitPercentOf(totals);
|
|
675
|
-
return [
|
|
676
|
-
t("usageStatIn", { n: formatTokens$1(totals.promptTokens) }),
|
|
677
|
-
`${t("usageTipCached")} ${formatTokens$1(totals.cachedTokens ?? 0)}`,
|
|
678
|
-
`${t("usageTipHit")} ${pct === void 0 ? "—" : `${pct}%`}`,
|
|
679
|
-
t("usageRequestCount", { n: formatCount(totals.requests) })
|
|
680
|
-
].join(" · ");
|
|
681
|
-
}
|
|
682
730
|
/**
|
|
683
731
|
* 用量区块。
|
|
684
732
|
*
|
|
@@ -2363,14 +2411,14 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
2363
2411
|
document.head.appendChild(tag);
|
|
2364
2412
|
}
|
|
2365
2413
|
var CodeArtsPanel_module_css_default = {
|
|
2366
|
-
"
|
|
2367
|
-
"back": "Z66cgG_back",
|
|
2368
|
-
"backCaret": "Z66cgG_backCaret",
|
|
2369
|
-
"title": "Z66cgG_title",
|
|
2414
|
+
"head": "Z66cgG_head",
|
|
2370
2415
|
"desc": "Z66cgG_desc",
|
|
2416
|
+
"icon": "Z66cgG_icon",
|
|
2371
2417
|
"page": "Z66cgG_page",
|
|
2418
|
+
"backCaret": "Z66cgG_backCaret",
|
|
2372
2419
|
"body": "Z66cgG_body",
|
|
2373
|
-
"
|
|
2420
|
+
"back": "Z66cgG_back",
|
|
2421
|
+
"title": "Z66cgG_title"
|
|
2374
2422
|
};
|
|
2375
2423
|
//#endregion
|
|
2376
2424
|
//#region src/client/CodeArtsPanel.tsx
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-codearts",
|
|
3
3
|
"displayName": "DSH CodeArts Connect",
|
|
4
4
|
"description": "把华为云 CodeArts 接入 DeepSeek Harness —— 内置 OAuth2 登录(PKCE + DPoP),登录后即可在 DSH 对话窗口使用 CodeArts 的模型。",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.9",
|
|
6
6
|
"packageManager": "pnpm@11.24.0",
|
|
7
7
|
"author": "elegant01",
|
|
8
8
|
"keywords": [
|