@laoyuehanni/dsh-token-usage 0.4.12 → 0.4.13
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/README.md +2 -0
- package/README.zh.md +2 -0
- package/lib/client/QuotaButton.d.ts +3 -1
- package/lib/client/QuotaButton.d.ts.map +1 -1
- package/lib/client/QuotaButton.js +23 -9
- package/lib/client/QuotaButton.js.map +1 -1
- package/lib/client/RequestPool.d.ts.map +1 -1
- package/lib/client/RequestPool.js +70 -15
- package/lib/client/RequestPool.js.map +1 -1
- package/lib/client/StatCard.d.ts +8 -10
- package/lib/client/StatCard.d.ts.map +1 -1
- package/lib/client/StatCard.js +10 -13
- package/lib/client/StatCard.js.map +1 -1
- package/lib/client/UsageView.js +2 -2
- package/lib/client/UsageView.js.map +1 -1
- package/lib/client/locales.d.ts +7 -2
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +14 -4
- package/lib/client/locales.js.map +1 -1
- package/lib/client/quota-format.d.ts +55 -1
- package/lib/client/quota-format.d.ts.map +1 -1
- package/lib/client/quota-format.js +99 -0
- package/lib/client/quota-format.js.map +1 -1
- package/lib/client.js +207 -93
- package/lib/client.js.map +1 -1
- package/lib/quota/adapters/magpie.d.ts.map +1 -1
- package/lib/quota/adapters/magpie.js +25 -0
- package/lib/quota/adapters/magpie.js.map +1 -1
- package/lib/request-observe.d.ts +16 -1
- package/lib/request-observe.d.ts.map +1 -1
- package/lib/request-observe.js +82 -1
- package/lib/request-observe.js.map +1 -1
- package/lib/session-request-details.d.ts +2 -1
- package/lib/session-request-details.d.ts.map +1 -1
- package/lib/session-request-details.js +6 -0
- package/lib/session-request-details.js.map +1 -1
- package/lib/wire.d.ts +32 -0
- package/lib/wire.d.ts.map +1 -1
- package/lib/wire.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -2678,6 +2678,84 @@ window.__ModuleLoader__.load({
|
|
|
2678
2678
|
return pick;
|
|
2679
2679
|
}
|
|
2680
2680
|
/**
|
|
2681
|
+
* Pool the windows of a payload: windows that NAME the same quota POOL
|
|
2682
|
+
* and spend the same tier (an `other` window pools only with its own
|
|
2683
|
+
* name) collapse into one level — their budgets are interchangeable
|
|
2684
|
+
* (a gateway's several keys of one vendor family), so the pool's mean
|
|
2685
|
+
* remaining share is the level the traffic actually feels.
|
|
2686
|
+
*
|
|
2687
|
+
* Two boundaries keep the collapse honest:
|
|
2688
|
+
*
|
|
2689
|
+
* - A window WITHOUT a pool stands alone. Single-source payloads name
|
|
2690
|
+
* no pool, and a lone window pools with nothing — the mean of one
|
|
2691
|
+
* window is that window.
|
|
2692
|
+
* - BALANCE windows never pool. Amounts are not shares: summing two
|
|
2693
|
+
* purses of different currencies (or averaging them) states nothing
|
|
2694
|
+
* true about either, so every balance keeps its own row.
|
|
2695
|
+
*
|
|
2696
|
+
* The order of first appearance is preserved, so the trigger still reads
|
|
2697
|
+
* the first (finest) level of the payload.
|
|
2698
|
+
*/
|
|
2699
|
+
function poolQuotaWindows(windows) {
|
|
2700
|
+
const groups = /* @__PURE__ */ new Map();
|
|
2701
|
+
windows.forEach((window, index) => {
|
|
2702
|
+
const key = window.pool === void 0 ? `solo:${String(index)}` : `${window.pool}|${window.tier}|${window.name ?? ""}`;
|
|
2703
|
+
const group = groups.get(key);
|
|
2704
|
+
if (group === void 0) groups.set(key, [window]);
|
|
2705
|
+
else group.push(window);
|
|
2706
|
+
});
|
|
2707
|
+
const pooled = [];
|
|
2708
|
+
for (const group of groups.values()) {
|
|
2709
|
+
const ratios = group.map((window) => quotaRemainingPercent(window)).filter((value) => value !== void 0);
|
|
2710
|
+
if (group.length === 1 || group[0]?.tier === "balance" || ratios.length === 0) {
|
|
2711
|
+
for (const window of group) {
|
|
2712
|
+
const remaining = quotaRemainingPercent(window);
|
|
2713
|
+
pooled.push({
|
|
2714
|
+
...window,
|
|
2715
|
+
peerCount: 1,
|
|
2716
|
+
exhaustedPeerCount: remaining !== void 0 && remaining < REMAIN_RED ? 1 : 0
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
continue;
|
|
2720
|
+
}
|
|
2721
|
+
const mean = ratios.reduce((sum, value) => sum + value, 0) / ratios.length;
|
|
2722
|
+
const exhausted = ratios.filter((value) => value < REMAIN_RED).length;
|
|
2723
|
+
const first = group[0];
|
|
2724
|
+
pooled.push({
|
|
2725
|
+
tier: first.tier,
|
|
2726
|
+
remainingPercent: mean,
|
|
2727
|
+
...first.name !== void 0 ? { name: first.name } : {},
|
|
2728
|
+
...first.pool !== void 0 ? { pool: first.pool } : {},
|
|
2729
|
+
peerCount: group.length,
|
|
2730
|
+
exhaustedPeerCount: exhausted
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
return pooled;
|
|
2734
|
+
}
|
|
2735
|
+
/**
|
|
2736
|
+
* The severity of a POOLED window — the traffic light of a pool, not of
|
|
2737
|
+
* a single meter:
|
|
2738
|
+
*
|
|
2739
|
+
* - red only when EVERY window of the pool is exhausted (the pool has
|
|
2740
|
+
* nothing left to route to);
|
|
2741
|
+
* - yellow when the pool is low (mean at or below the yellow line) or
|
|
2742
|
+
* when SOME window is exhausted while others still have room (one
|
|
2743
|
+
* account died, the pool still serves);
|
|
2744
|
+
* - green otherwise.
|
|
2745
|
+
*
|
|
2746
|
+
* A lone window keeps the plain per-window band, so single-source
|
|
2747
|
+
* providers read exactly as before.
|
|
2748
|
+
*/
|
|
2749
|
+
function quotaPoolSeverityOf(window) {
|
|
2750
|
+
if (window.peerCount <= 1) return quotaSeverityOf(window);
|
|
2751
|
+
const remaining = quotaRemainingPercent(window);
|
|
2752
|
+
if (remaining === void 0) return quotaSeverityOf(window);
|
|
2753
|
+
if (window.exhaustedPeerCount >= window.peerCount) return "exhausted";
|
|
2754
|
+
if (window.exhaustedPeerCount > 0) return "warn";
|
|
2755
|
+
if (remaining <= REMAIN_YELLOW) return "warn";
|
|
2756
|
+
return "ok";
|
|
2757
|
+
}
|
|
2758
|
+
/**
|
|
2681
2759
|
* Fill share of the trigger ring, 0–1. Ratio windows map the remaining
|
|
2682
2760
|
* percent; a funded balance without a total paints a full ring (the color
|
|
2683
2761
|
* stays neutral — amounts tint only at ≤ 0); empty / overdrawn / missing
|
|
@@ -2771,7 +2849,9 @@ window.__ModuleLoader__.load({
|
|
|
2771
2849
|
* Input-bar quota button (browser half): a 28×28 round trigger registered
|
|
2772
2850
|
* into the `conversation.input.right` slot (it renders left of the model
|
|
2773
2851
|
* chip — the host's fixed tool-row order). The glyph is a remaining-share
|
|
2774
|
-
* ring (ContextMeter family) colored by the finest window
|
|
2852
|
+
* ring (ContextMeter family) colored by the finest window's POOL level —
|
|
2853
|
+
* a gateway's several keys of one vendor share one budget, so the ring
|
|
2854
|
+
* reads that pool's mean share and its availability. Clicking opens a
|
|
2775
2855
|
* width-tiered popup (amount-only 200px / one progress bar 232px / two
|
|
2776
2856
|
* bars 320px) centered on the button with the current provider's quota
|
|
2777
2857
|
* windows: progress columns (5 小时 / 每周) for coding-plan providers, an
|
|
@@ -2929,15 +3009,19 @@ window.__ModuleLoader__.load({
|
|
|
2929
3009
|
measurePanelLeft
|
|
2930
3010
|
]);
|
|
2931
3011
|
if (!visible || payload === null) return null;
|
|
2932
|
-
const finest = finestQuotaWindow(payload.status === "ok" ? payload.windows : []);
|
|
2933
|
-
const severity = finest === void 0 ? "ok" :
|
|
3012
|
+
const finest = finestQuotaWindow(poolQuotaWindows(payload.status === "ok" ? payload.windows : []));
|
|
3013
|
+
const severity = finest === void 0 ? "ok" : quotaPoolSeverityOf(finest);
|
|
2934
3014
|
const triggerClass = [QuotaButton_module_css_default.trigger];
|
|
2935
3015
|
if (severity === "warn") triggerClass.push(QuotaButton_module_css_default["icon-warn"]);
|
|
2936
3016
|
else if (severity === "exhausted") triggerClass.push(QuotaButton_module_css_default["icon-exhausted"]);
|
|
2937
3017
|
else if (finest !== void 0 && quotaRemainingPercent(finest) !== void 0) triggerClass.push(QuotaButton_module_css_default["icon-ok"]);
|
|
2938
3018
|
const triggerClassName = triggerClass.join(" ").trim();
|
|
2939
3019
|
const figure = quotaTriggerFigure(finest);
|
|
2940
|
-
const triggerTip = figure === void 0 ? t("quota.trigger") : t("quota.
|
|
3020
|
+
const triggerTip = figure === void 0 ? t("quota.trigger") : finest !== void 0 && finest.peerCount > 1 ? t("quota.triggerSummaryPooled", {
|
|
3021
|
+
name: payload.providerName ?? payload.provider,
|
|
3022
|
+
figure,
|
|
3023
|
+
count: finest.peerCount
|
|
3024
|
+
}) : t("quota.triggerSummary", {
|
|
2941
3025
|
name: payload.providerName ?? payload.provider,
|
|
2942
3026
|
figure
|
|
2943
3027
|
});
|
|
@@ -4849,7 +4933,7 @@ window.__ModuleLoader__.load({
|
|
|
4849
4933
|
});
|
|
4850
4934
|
}
|
|
4851
4935
|
// \0dsh-css:/home/runner/work/dsh-token-usage/dsh-token-usage/src/client/StatCard.module.css.mjs
|
|
4852
|
-
const css$7 = "._9vrbFa_card{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:10px 12px;display:flex}._9vrbFa_cardLg{gap:4px;padding:12px 14px}._9vrbFa_cardLg ._9vrbFa_cardLabel{font-size:12px}._9vrbFa_cardLg ._9vrbFa_cardValue{font-size:20px;line-height:26px}._9vrbFa_cardSm{border-radius:7px;gap:3px;padding:8px 9px}._9vrbFa_cardSm ._9vrbFa_cardLabel{font-size:10px;line-height:14px}._9vrbFa_cardSm ._9vrbFa_cardValue{flex-wrap:nowrap;gap:4px;font-size:16px;line-height:22px}._9vrbFa_cardSm ._9vrbFa_cardLabelRow{gap:4px}._9vrbFa_cardSm ._9vrbFa_cardLabelRow ._9vrbFa_pillNeutral{padding-inline:4px;font-size:9px;line-height:12px}._9vrbFa_cardSm ._9vrbFa_failBare{font-size:10px}._9vrbFa_cardLabelRow{align-items:center;gap:6px;min-width:0;display:flex}._9vrbFa_cardLabelRow>._9vrbFa_cardLabel{flex:0 auto;min-width:0}._9vrbFa_cardLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}._9vrbFa_cardValue{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;font-size:18px;font-weight:600;display:flex}._9vrbFa_cardValueMain{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._9vrbFa_pillWrap{flex-shrink:0;display:inline-flex}._9vrbFa_pillWrap [role=tooltip]{white-space:pre;width:max-content;min-width:max-content;max-width:none;font-size:12px;font-weight:400;line-height:1.4}.
|
|
4936
|
+
const css$7 = "._9vrbFa_card{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:8px;flex-direction:column;gap:2px;min-width:0;padding:10px 12px;display:flex}._9vrbFa_cardLg{gap:4px;padding:12px 14px}._9vrbFa_cardLg ._9vrbFa_cardLabel{font-size:12px}._9vrbFa_cardLg ._9vrbFa_cardValue{font-size:20px;line-height:26px}._9vrbFa_cardSm{border-radius:7px;gap:3px;padding:8px 9px}._9vrbFa_cardSm ._9vrbFa_cardLabel{font-size:10px;line-height:14px}._9vrbFa_cardSm ._9vrbFa_cardValue{flex-wrap:nowrap;gap:4px;font-size:16px;line-height:22px}._9vrbFa_cardSm ._9vrbFa_cardLabelRow{gap:4px}._9vrbFa_cardSm ._9vrbFa_cardLabelRow ._9vrbFa_pillNeutral{padding-inline:4px;font-size:9px;line-height:12px}._9vrbFa_cardSm ._9vrbFa_failBare{font-size:10px}._9vrbFa_cardLabelRow{align-items:center;gap:6px;min-width:0;display:flex}._9vrbFa_cardLabelRow>._9vrbFa_cardLabel{flex:0 auto;min-width:0}._9vrbFa_cardLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}._9vrbFa_cardValue{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);flex-wrap:wrap;align-items:baseline;gap:4px 8px;min-width:0;font-size:18px;font-weight:600;display:flex}._9vrbFa_cardValueMain{white-space:nowrap;text-overflow:ellipsis;min-width:0;overflow:hidden}._9vrbFa_pillWrap{flex-shrink:0;display:inline-flex}._9vrbFa_pillWrap [role=tooltip]{white-space:pre;width:max-content;min-width:max-content;max-width:none;font-size:12px;font-weight:400;line-height:1.4}._9vrbFa_splitSep{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));padding:0 1px}._9vrbFa_splitFail{color:var(--dsw-alias-state-error-primary)}._9vrbFa_failWrap{display:inline}._9vrbFa_pill,._9vrbFa_pillNeutral{font-variant-numeric:tabular-nums;white-space:nowrap;border-radius:999px;flex-shrink:0;padding:1px 7px;font-size:12px;font-weight:400;line-height:1.4}._9vrbFa_pill{color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 12%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary) 28%, transparent)}._9vrbFa_pillNeutral{color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-secondary) 10%, transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-label-secondary) 26%, transparent);cursor:pointer;font-family:inherit}._9vrbFa_pillNeutral:hover{background:color-mix(in srgb, var(--dsw-alias-label-secondary) 16%, transparent)}._9vrbFa_cardLabelRow ._9vrbFa_pill,._9vrbFa_cardLabelRow ._9vrbFa_pillNeutral{padding:0 6px;font-size:10px;line-height:13px}._9vrbFa_cardLabelRow~._9vrbFa_cardValue{flex-wrap:nowrap;gap:6px}._9vrbFa_failBare{font-variant-numeric:tabular-nums;color:var(--dsw-alias-state-error-primary);white-space:nowrap;font-size:11px;font-weight:400}";
|
|
4853
4937
|
const tagId$7 = "@laoyuehanni/dsh-token-usage/StatCard.module.css";
|
|
4854
4938
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$7) + "]") === null) {
|
|
4855
4939
|
const tag = document.createElement("style");
|
|
@@ -4867,13 +4951,11 @@ window.__ModuleLoader__.load({
|
|
|
4867
4951
|
"cardValue": "_9vrbFa_cardValue",
|
|
4868
4952
|
"cardValueMain": "_9vrbFa_cardValueMain",
|
|
4869
4953
|
"failBare": "_9vrbFa_failBare",
|
|
4954
|
+
"failWrap": "_9vrbFa_failWrap",
|
|
4870
4955
|
"pill": "_9vrbFa_pill",
|
|
4871
4956
|
"pillNeutral": "_9vrbFa_pillNeutral",
|
|
4872
4957
|
"pillWrap": "_9vrbFa_pillWrap",
|
|
4873
|
-
"split": "_9vrbFa_split",
|
|
4874
4958
|
"splitFail": "_9vrbFa_splitFail",
|
|
4875
|
-
"splitFailHead": "_9vrbFa_splitFailHead",
|
|
4876
|
-
"splitOk": "_9vrbFa_splitOk",
|
|
4877
4959
|
"splitSep": "_9vrbFa_splitSep"
|
|
4878
4960
|
};
|
|
4879
4961
|
// src/client/StatCard.tsx
|
|
@@ -4980,69 +5062,40 @@ window.__ModuleLoader__.load({
|
|
|
4980
5062
|
})
|
|
4981
5063
|
});
|
|
4982
5064
|
}
|
|
4983
|
-
/**
|
|
4984
|
-
*
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
children: t("stat.ok")
|
|
4992
|
-
}),
|
|
4993
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4994
|
-
className: StatCard_module_css_default["splitSep"],
|
|
4995
|
-
"aria-hidden": true,
|
|
4996
|
-
children: "/"
|
|
4997
|
-
}),
|
|
4998
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4999
|
-
className: StatCard_module_css_default["splitFailHead"],
|
|
5000
|
-
children: t("stat.fail")
|
|
5001
|
-
})
|
|
5002
|
-
]
|
|
5003
|
-
});
|
|
5004
|
-
}
|
|
5005
|
-
/** One table cell: successful count, and when failures > 0 a slash on
|
|
5006
|
-
* the column midline plus the failure count in the error color.
|
|
5007
|
-
* Zero failures print only A (same left track, so the figure still
|
|
5008
|
-
* lines up with rows that have a B). Hovering B lists the per-code
|
|
5009
|
-
* breakdown. */
|
|
5065
|
+
/** One table cell: the successful count, and when failures > 0 the
|
|
5066
|
+
* failure count after a slash, in the error color and hoverable for the
|
|
5067
|
+
* per-code breakdown.
|
|
5068
|
+
*
|
|
5069
|
+
* The column is ONE plain column: the figures are plain inline text, so
|
|
5070
|
+
* the head above them inherits the same alignment and the two share one
|
|
5071
|
+
* edge — no tracks, no grid, no placeholder. Zero failures print only
|
|
5072
|
+
* the successful count (no slash, no `0`). */
|
|
5010
5073
|
function RequestsCell({ requests, failures, failuresByCode, t }) {
|
|
5011
5074
|
const ok = requests.toLocaleString();
|
|
5012
|
-
|
|
5013
|
-
className: StatCard_module_css_default["splitOk"],
|
|
5014
|
-
children: ok
|
|
5015
|
-
});
|
|
5016
|
-
if (failures === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5017
|
-
className: StatCard_module_css_default["split"],
|
|
5018
|
-
children: okFigure
|
|
5019
|
-
});
|
|
5075
|
+
if (failures === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: ok });
|
|
5020
5076
|
const fail = failures.toLocaleString();
|
|
5021
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
"aria-label": t("stat.failuresPill", { count: fail }),
|
|
5040
|
-
children: fail
|
|
5041
|
-
})
|
|
5077
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
5078
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: ok }),
|
|
5079
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5080
|
+
className: StatCard_module_css_default["splitSep"],
|
|
5081
|
+
"aria-hidden": true,
|
|
5082
|
+
children: "/"
|
|
5083
|
+
}),
|
|
5084
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5085
|
+
className: StatCard_module_css_default["failWrap"],
|
|
5086
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
5087
|
+
label: failuresTooltip(failuresByCode, t),
|
|
5088
|
+
side: "bottom",
|
|
5089
|
+
delayMs: 200,
|
|
5090
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5091
|
+
className: StatCard_module_css_default["splitFail"],
|
|
5092
|
+
tabIndex: 0,
|
|
5093
|
+
"aria-label": t("stat.failuresPill", { count: fail }),
|
|
5094
|
+
children: fail
|
|
5042
5095
|
})
|
|
5043
5096
|
})
|
|
5044
|
-
|
|
5045
|
-
});
|
|
5097
|
+
})
|
|
5098
|
+
] });
|
|
5046
5099
|
}
|
|
5047
5100
|
// src/client/trend-chart/axis.ts
|
|
5048
5101
|
/**
|
|
@@ -7207,7 +7260,7 @@ window.__ModuleLoader__.load({
|
|
|
7207
7260
|
});
|
|
7208
7261
|
}
|
|
7209
7262
|
// \0dsh-css:/home/runner/work/dsh-token-usage/dsh-token-usage/src/client/UsageView.module.css.mjs
|
|
7210
|
-
const css = ".PR9kTG_root{color:var(--dsw-alias-label-primary);box-sizing:border-box;width:100%;padding:12px calc(var(--dsh-composer-side-clearance,16px) + 16px);padding-bottom:calc(var(--dsh-composer-height,152px) + 16px);flex-direction:column;gap:12px;max-width:1400px;height:100%;min-height:0;margin:0 auto;display:flex;overflow-y:auto;container:PR9kTG_usage/inline-size}.PR9kTG_root>*{flex-shrink:0}.PR9kTG_head{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;display:flex}.PR9kTG_headRight{align-items:center;gap:10px;display:flex}.PR9kTG_back{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:6px;padding:3px 10px;font-size:12px}.PR9kTG_back:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2)}.PR9kTG_segmented{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:8px;align-items:stretch;gap:2px;padding:2px;display:inline-flex}.PR9kTG_segBtn{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));cursor:pointer;background:0 0;border:none;border-radius:6px;padding:4px 12px;font-size:12px;font-weight:500}.PR9kTG_segBtn:hover:not(.PR9kTG_segActive){color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent)}.PR9kTG_segBtn:focus-visible{outline:2px solid var(--dsw-alias-border-l2);outline-offset:1px}.PR9kTG_segActive{background:color-mix(in srgb, var(--dsw-alias-label-primary) 16%, transparent);color:var(--dsw-alias-label-primary);font-weight:600}.PR9kTG_muted{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.PR9kTG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:13px}.PR9kTG_empty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0 0;font-size:13px}.PR9kTG_button{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:6px;align-self:flex-start;padding:3px 10px;font-size:12px}.PR9kTG_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-secondary));margin:0;font-size:12px}.PR9kTG_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px}.PR9kTG_cards{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;display:grid}.PR9kTG_tokenStrip{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:18px;padding:6px 2px 0;font-size:12px;display:flex}.PR9kTG_tokenStrip b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums}.PR9kTG_mid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:start;gap:24px;display:grid}.PR9kTG_chartCol,.PR9kTG_modelCol,.PR9kTG_subagents{flex-direction:column;gap:6px;min-width:0;display:flex}.PR9kTG_subagentsHead,.PR9kTG_chartHead{align-items:center;gap:8px;display:flex}.PR9kTG_subtitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;font-weight:600}.PR9kTG_tableWrap{overflow-x:auto}.PR9kTG_table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;min-width:480px;font-size:12px}.PR9kTG_table th,.PR9kTG_table td{text-align:right;border-bottom:1px solid var(--dsw-alias-border-l1);white-space:nowrap;padding:4px 6px}.PR9kTG_table tbody tr{transition:background-color .12s}.PR9kTG_table tbody tr:hover{background-color:var(--dsw-interactive-bg-hover)}.PR9kTG_table th{border-bottom:1.5px solid var(--dsw-alias-border-l2);font-weight:600}.PR9kTG_costCol{font-weight:600}.PR9kTG_zeroDim{color:var(--dsw-alias-label-tertiary);opacity:.55}.PR9kTG_table th:first-child,.PR9kTG_table td:first-child,.PR9kTG_modelHead{text-align:left}.PR9kTG_modelCell{font-variant-numeric:normal;text-overflow:ellipsis;max-width:180px;overflow:hidden}.PR9kTG_modelIdentity{align-items:center;gap:4px;max-width:180px;display:inline-flex}.PR9kTG_modelName{text-overflow:ellipsis;min-width:0;overflow:hidden}.PR9kTG_childLink{color:var(--dsw-alias-link-primary,var(--dsw-alias-label-primary));cursor:pointer;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;max-width:220px;padding:0;font-size:12px;overflow:hidden}.PR9kTG_childLink:hover{text-decoration:underline}.PR9kTG_nestedBadge{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:6px;font-size:11px}.PR9kTG_poolSection{flex-direction:column;gap:6px;min-width:0;margin-top:4px;display:flex}.PR9kTG_poolHead{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:8px 12px;display:flex}.PR9kTG_poolContext{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px}.PR9kTG_poolEmpty{color:var(--dsw-alias-label-secondary);padding:12px 0;font-size:12px}.PR9kTG_latestPanel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:9px;min-width:0;padding:14px 16px}.PR9kTG_requestIdentity{flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0;display:flex}.PR9kTG_poolBadge{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:5px;flex:none;padding:1px 7px;font-size:11px}.PR9kTG_poolState{white-space:nowrap;font-size:11px}.PR9kTG_requestIdentity .PR9kTG_poolState{align-items:center;gap:5px;display:inline-flex}.PR9kTG_statusDot{background:currentColor;border-radius:50%;flex:none;width:5px;height:5px}.PR9kTG_latestPanel .PR9kTG_modelName{font-size:13px;font-weight:500}.PR9kTG_stateDone{color:var(--dsw-alias-state-success-primary,#16a34a)}.PR9kTG_stateFailed{color:var(--dsw-alias-state-error-primary,#dc2626)}.PR9kTG_statePending{color:light-dark(#b45309,#d9ac64)}.PR9kTG_stateStreaming{color:var(--dsw-alias-link-primary,var(--dsw-alias-label-primary))}.PR9kTG_modelInline{white-space:nowrap;align-items:center;gap:6px;min-width:0;max-width:100%;display:inline-flex}.PR9kTG_cacheLoss{color:light-dark(#b45309,#d9ac64);white-space:nowrap;background:light-dark(#fff1d8,#352b1d);border-radius:4px;flex:none;align-items:center;gap:4px;padding:2px 6px;font-size:11px;display:inline-flex}.PR9kTG_cacheLoss svg{flex:none;width:12px;height:12px}.PR9kTG_auxKind{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:4px;flex:none;padding:2px 5px;font-size:10px}.PR9kTG_requestMetrics{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;padding:13px 0;display:grid}.PR9kTG_metricValue{letter-spacing:-.25px;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:23px;font-weight:500}.PR9kTG_metricUnit{color:var(--dsw-alias-label-tertiary);letter-spacing:0;margin-left:4px;font-size:11px}.PR9kTG_metricLabel{color:var(--dsw-alias-label-tertiary);margin-top:2px;font-size:11px}.PR9kTG_requestFooter{border-top:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);flex-wrap:wrap;justify-content:space-between;gap:8px 18px;padding-top:8px;font-size:11px;display:flex}.PR9kTG_requestBuckets{flex-wrap:wrap;gap:8px 15px;display:flex}.PR9kTG_requestFooter b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:400}.PR9kTG_poolNotice{color:light-dark(#b45309,#d9ac64);margin:4px 0 0;font-size:11px}.PR9kTG_poolNoticeError{color:var(--dsw-alias-state-error-primary)}.PR9kTG_poolNoticeNeutral{color:var(--dsw-alias-label-tertiary)}.PR9kTG_poolTableWrap{overscroll-behavior:contain;max-height:196px;overflow:auto}.PR9kTG_poolTableWrap::-webkit-scrollbar{width:8px;height:8px}.PR9kTG_poolTableWrap::-webkit-scrollbar-track,.PR9kTG_poolTableWrap::-webkit-scrollbar-corner{background:0 0}.PR9kTG_poolTableWrap::-webkit-scrollbar-button{display:none}.PR9kTG_poolTableWrap::-webkit-scrollbar-thumb{background:0 0;border-radius:4px}.PR9kTG_poolTableWrap.PR9kTG_scrolling::-webkit-scrollbar-thumb{background:color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent)}.PR9kTG_poolTableWrap:focus-visible{outline:2px solid var(--dsw-alias-border-l2);outline-offset:2px}.PR9kTG_poolTable{table-layout:fixed;border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;font-size:11px}.PR9kTG_poolTable th,.PR9kTG_poolTable td{text-align:right;border-bottom:1px solid var(--dsw-alias-border-l1);white-space:nowrap;padding:8px 6px;overflow:hidden}.PR9kTG_poolTable th{z-index:1;background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary);border-bottom:1.5px solid var(--dsw-alias-border-l2);padding:6px;font-weight:400;position:sticky;top:0}.PR9kTG_poolTable th:nth-child(-n+4),.PR9kTG_poolTable td:nth-child(-n+4){text-align:left}.PR9kTG_poolOrigin,.PR9kTG_poolTime{color:var(--dsw-alias-label-secondary)}.PR9kTG_poolModel,.PR9kTG_poolModel .PR9kTG_modelInline{max-width:200px}.PR9kTG_poolModel .PR9kTG_modelName{text-overflow:ellipsis;min-width:0;overflow:hidden}.PR9kTG_poolModelHead{text-align:left}.PR9kTG_poolTable tbody tr:hover{background-color:var(--dsw-interactive-bg-hover)}@media (prefers-reduced-motion:no-preference){.PR9kTG_latestPanel{animation:.25s ease-out PR9kTG_pool-arrive}@keyframes PR9kTG_pool-arrive{0%{opacity:.4}to{opacity:1}}}@container PR9kTG_usage (width<=900px){.PR9kTG_requestMetrics{grid-template-columns:repeat(3,minmax(0,1fr))}.PR9kTG_poolTableWrap{max-height:230px}}@container PR9kTG_usage (width<=480px){.PR9kTG_poolTableWrap{max-height:240px}.PR9kTG_poolTable thead{display:none}.PR9kTG_poolTable,.PR9kTG_poolTable tbody{min-width:0;display:block}.PR9kTG_poolTable tbody tr{border-bottom:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 9px;padding:9px 0;display:grid}.PR9kTG_poolTable td{border-bottom:none;text-align:left!important;padding:0!important}.PR9kTG_poolTable td:nth-child(4){grid-column:1/-1}.PR9kTG_poolTable td:before{content:attr(data-label) \" \";color:var(--dsw-alias-label-tertiary)}.PR9kTG_poolModel,.PR9kTG_poolModel .PR9kTG_modelInline{max-width:100%}.PR9kTG_metricValue{font-size:21px}}@container PR9kTG_usage (width<=900px){.PR9kTG_cards{grid-template-columns:repeat(3,minmax(0,1fr))}.PR9kTG_mid{grid-template-columns:1fr}}@media (width<=600px){.PR9kTG_root{padding-left:12px;padding-right:12px}}";
|
|
7263
|
+
const css = ".PR9kTG_root{color:var(--dsw-alias-label-primary);box-sizing:border-box;width:100%;padding:12px calc(var(--dsh-composer-side-clearance,16px) + 16px);padding-bottom:calc(var(--dsh-composer-height,152px) + 16px);flex-direction:column;gap:12px;max-width:1400px;height:100%;min-height:0;margin:0 auto;display:flex;overflow-y:auto;container:PR9kTG_usage/inline-size}.PR9kTG_root>*{flex-shrink:0}.PR9kTG_head{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;display:flex}.PR9kTG_headRight{align-items:center;gap:10px;display:flex}.PR9kTG_back{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:6px;padding:3px 10px;font-size:12px}.PR9kTG_back:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2)}.PR9kTG_segmented{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:8px;align-items:stretch;gap:2px;padding:2px;display:inline-flex}.PR9kTG_segBtn{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));cursor:pointer;background:0 0;border:none;border-radius:6px;padding:4px 12px;font-size:12px;font-weight:500}.PR9kTG_segBtn:hover:not(.PR9kTG_segActive){color:var(--dsw-alias-label-secondary);background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent)}.PR9kTG_segBtn:focus-visible{outline:2px solid var(--dsw-alias-border-l2);outline-offset:1px}.PR9kTG_segActive{background:color-mix(in srgb, var(--dsw-alias-label-primary) 16%, transparent);color:var(--dsw-alias-label-primary);font-weight:600}.PR9kTG_muted{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px}.PR9kTG_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:13px}.PR9kTG_empty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0 0;font-size:13px}.PR9kTG_button{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border-radius:6px;align-self:flex-start;padding:3px 10px;font-size:12px}.PR9kTG_warning{color:var(--dsw-alias-state-warning-primary,var(--dsw-alias-label-secondary));margin:0;font-size:12px}.PR9kTG_note{color:var(--dsw-alias-label-tertiary);margin:0;font-size:11px}.PR9kTG_cards{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;display:grid}.PR9kTG_tokenStrip{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:18px;padding:6px 2px 0;font-size:12px;display:flex}.PR9kTG_tokenStrip b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums}.PR9kTG_mid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:start;gap:24px;display:grid}.PR9kTG_chartCol,.PR9kTG_modelCol,.PR9kTG_subagents{flex-direction:column;gap:6px;min-width:0;display:flex}.PR9kTG_subagentsHead,.PR9kTG_chartHead{align-items:center;gap:8px;display:flex}.PR9kTG_subtitle{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;font-weight:600}.PR9kTG_tableWrap{overflow-x:auto}.PR9kTG_table{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;min-width:480px;font-size:12px}.PR9kTG_table th,.PR9kTG_table td{text-align:right;border-bottom:1px solid var(--dsw-alias-border-l1);white-space:nowrap;padding:4px 6px}.PR9kTG_table tbody tr{transition:background-color .12s}.PR9kTG_table tbody tr:hover{background-color:var(--dsw-interactive-bg-hover)}.PR9kTG_table th{border-bottom:1.5px solid var(--dsw-alias-border-l2);font-weight:600}.PR9kTG_costCol{font-weight:600}.PR9kTG_zeroDim{color:var(--dsw-alias-label-tertiary);opacity:.55}.PR9kTG_table th:first-child,.PR9kTG_table td:first-child,.PR9kTG_modelHead{text-align:left}.PR9kTG_modelCell{font-variant-numeric:normal;text-overflow:ellipsis;max-width:180px;overflow:hidden}.PR9kTG_modelIdentity{align-items:center;gap:4px;max-width:180px;display:inline-flex}.PR9kTG_modelName{text-overflow:ellipsis;min-width:0;overflow:hidden}.PR9kTG_childLink{color:var(--dsw-alias-link-primary,var(--dsw-alias-label-primary));cursor:pointer;text-align:left;text-overflow:ellipsis;white-space:nowrap;background:0 0;border:none;max-width:220px;padding:0;font-size:12px;overflow:hidden}.PR9kTG_childLink:hover{text-decoration:underline}.PR9kTG_nestedBadge{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:6px;font-size:11px}.PR9kTG_poolSection{flex-direction:column;gap:6px;min-width:0;margin-top:4px;display:flex}.PR9kTG_poolHead{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:8px 12px;display:flex}.PR9kTG_poolContext{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px}.PR9kTG_poolEmpty{color:var(--dsw-alias-label-secondary);padding:12px 0;font-size:12px}.PR9kTG_latestPanel{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-fill-container,transparent);border-radius:9px;min-width:0;padding:14px 16px}.PR9kTG_requestIdentity{flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0;display:flex}.PR9kTG_poolBadge{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:5px;flex:none;padding:1px 7px;font-size:11px}.PR9kTG_poolState{white-space:nowrap;font-size:11px}.PR9kTG_requestIdentity .PR9kTG_poolState{align-items:center;gap:5px;display:inline-flex}.PR9kTG_statusDot{background:currentColor;border-radius:50%;flex:none;width:5px;height:5px}.PR9kTG_latestPanel .PR9kTG_modelName{font-size:13px;font-weight:500}.PR9kTG_stateDone{color:var(--dsw-alias-state-success-primary,#16a34a)}.PR9kTG_stateFailed{color:var(--dsw-alias-state-error-primary,#dc2626)}.PR9kTG_statePending{color:light-dark(#b45309,#d9ac64)}.PR9kTG_stateStreaming{color:var(--dsw-alias-link-primary,var(--dsw-alias-label-primary))}.PR9kTG_modelInline{white-space:nowrap;align-items:center;gap:6px;min-width:0;max-width:100%;display:inline-flex}.PR9kTG_cacheLoss{color:light-dark(#b45309,#d9ac64);white-space:nowrap;background:light-dark(#fff1d8,#352b1d);border-radius:4px;flex:none;align-items:center;gap:4px;padding:2px 6px;font-size:11px;display:inline-flex}.PR9kTG_cacheLoss svg{flex:none;width:12px;height:12px}.PR9kTG_auxKind{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:4px;flex:none;padding:2px 5px;font-size:10px}.PR9kTG_requestMetrics{grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;padding:13px 0;display:grid}.PR9kTG_metricValue{letter-spacing:-.25px;white-space:nowrap;font-variant-numeric:tabular-nums;font-size:23px;font-weight:500}.PR9kTG_metricUnit{color:var(--dsw-alias-label-tertiary);letter-spacing:0;margin-left:4px;font-size:11px}.PR9kTG_metricLabel{color:var(--dsw-alias-label-tertiary);margin-top:2px;font-size:11px}.PR9kTG_requestFooter{border-top:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);flex-wrap:nowrap;justify-content:space-between;align-items:baseline;gap:8px 18px;padding-top:8px;font-size:11px;display:flex}.PR9kTG_requestBuckets{flex-wrap:wrap;flex:none;gap:8px 15px;display:flex}.PR9kTG_requestNote{white-space:nowrap;text-overflow:ellipsis;color:light-dark(#b45309,#d9ac64);flex:0 auto;min-width:0;margin:0;font-size:11px;overflow:hidden}.PR9kTG_requestNoteError{color:var(--dsw-alias-state-error-primary)}.PR9kTG_requestNoteNeutral{color:var(--dsw-alias-label-tertiary)}.PR9kTG_requestFooter b{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-weight:400}.PR9kTG_poolNotice{color:light-dark(#b45309,#d9ac64);margin:4px 0 0;font-size:11px}.PR9kTG_poolTableWrap{overscroll-behavior:contain;max-height:196px;overflow:auto}.PR9kTG_poolTableWrap::-webkit-scrollbar{width:8px;height:8px}.PR9kTG_poolTableWrap::-webkit-scrollbar-track,.PR9kTG_poolTableWrap::-webkit-scrollbar-corner{background:0 0}.PR9kTG_poolTableWrap::-webkit-scrollbar-button{display:none}.PR9kTG_poolTableWrap::-webkit-scrollbar-thumb{background:0 0;border-radius:4px}.PR9kTG_poolTableWrap.PR9kTG_scrolling::-webkit-scrollbar-thumb{background:color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent)}.PR9kTG_poolTableWrap:focus-visible{outline:2px solid var(--dsw-alias-border-l2);outline-offset:2px}.PR9kTG_poolTable{table-layout:fixed;border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;font-size:11px}.PR9kTG_poolTable th,.PR9kTG_poolTable td{text-align:right;border-bottom:1px solid var(--dsw-alias-border-l1);white-space:nowrap;padding:8px 6px;overflow:hidden}.PR9kTG_poolTable th{z-index:1;background:var(--dsw-alias-bg-base,var(--dsw-alias-bg-layer-1));color:var(--dsw-alias-label-secondary);border-bottom:1.5px solid var(--dsw-alias-border-l2);padding:6px;font-weight:400;position:sticky;top:0}.PR9kTG_poolTable th:nth-child(-n+4),.PR9kTG_poolTable td:nth-child(-n+4){text-align:left}.PR9kTG_poolOrigin,.PR9kTG_poolTime{color:var(--dsw-alias-label-secondary)}.PR9kTG_poolModel,.PR9kTG_poolModel .PR9kTG_modelInline{max-width:200px}.PR9kTG_poolModel .PR9kTG_modelName{text-overflow:ellipsis;min-width:0;overflow:hidden}.PR9kTG_poolModelHead{text-align:left}.PR9kTG_poolTable tbody tr:hover{background-color:var(--dsw-interactive-bg-hover)}@media (prefers-reduced-motion:no-preference){.PR9kTG_latestPanel{animation:.25s ease-out PR9kTG_pool-arrive}@keyframes PR9kTG_pool-arrive{0%{opacity:.4}to{opacity:1}}}@container PR9kTG_usage (width<=900px){.PR9kTG_requestMetrics{grid-template-columns:repeat(3,minmax(0,1fr))}.PR9kTG_poolTableWrap{max-height:230px}}@container PR9kTG_usage (width<=480px){.PR9kTG_poolTableWrap{max-height:240px}.PR9kTG_poolTable thead{display:none}.PR9kTG_poolTable,.PR9kTG_poolTable tbody{min-width:0;display:block}.PR9kTG_poolTable tbody tr{border-bottom:1px solid var(--dsw-alias-border-l1);grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 9px;padding:9px 0;display:grid}.PR9kTG_poolTable td{border-bottom:none;text-align:left!important;padding:0!important}.PR9kTG_poolTable td:nth-child(4){grid-column:1/-1}.PR9kTG_poolTable td:before{content:attr(data-label) \" \";color:var(--dsw-alias-label-tertiary)}.PR9kTG_poolModel,.PR9kTG_poolModel .PR9kTG_modelInline{max-width:100%}.PR9kTG_metricValue{font-size:21px}}@container PR9kTG_usage (width<=900px){.PR9kTG_cards{grid-template-columns:repeat(3,minmax(0,1fr))}.PR9kTG_mid{grid-template-columns:1fr}}@media (width<=600px){.PR9kTG_root{padding-left:12px;padding-right:12px}}";
|
|
7211
7264
|
const tagId = "@laoyuehanni/dsh-token-usage/UsageView.module.css";
|
|
7212
7265
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
7213
7266
|
const tag = document.createElement("style");
|
|
@@ -7252,8 +7305,6 @@ window.__ModuleLoader__.load({
|
|
|
7252
7305
|
"poolModel": "PR9kTG_poolModel",
|
|
7253
7306
|
"poolModelHead": "PR9kTG_poolModelHead",
|
|
7254
7307
|
"poolNotice": "PR9kTG_poolNotice",
|
|
7255
|
-
"poolNoticeError": "PR9kTG_poolNoticeError",
|
|
7256
|
-
"poolNoticeNeutral": "PR9kTG_poolNoticeNeutral",
|
|
7257
7308
|
"poolOrigin": "PR9kTG_poolOrigin",
|
|
7258
7309
|
"poolSection": "PR9kTG_poolSection",
|
|
7259
7310
|
"poolState": "PR9kTG_poolState",
|
|
@@ -7264,6 +7315,9 @@ window.__ModuleLoader__.load({
|
|
|
7264
7315
|
"requestFooter": "PR9kTG_requestFooter",
|
|
7265
7316
|
"requestIdentity": "PR9kTG_requestIdentity",
|
|
7266
7317
|
"requestMetrics": "PR9kTG_requestMetrics",
|
|
7318
|
+
"requestNote": "PR9kTG_requestNote",
|
|
7319
|
+
"requestNoteError": "PR9kTG_requestNoteError",
|
|
7320
|
+
"requestNoteNeutral": "PR9kTG_requestNoteNeutral",
|
|
7267
7321
|
"root": "PR9kTG_root",
|
|
7268
7322
|
"scrolling": "PR9kTG_scrolling",
|
|
7269
7323
|
"segActive": "PR9kTG_segActive",
|
|
@@ -7448,16 +7502,9 @@ window.__ModuleLoader__.load({
|
|
|
7448
7502
|
children: suffix
|
|
7449
7503
|
})] });
|
|
7450
7504
|
}
|
|
7451
|
-
/**
|
|
7452
|
-
*
|
|
7453
|
-
function
|
|
7454
|
-
switch (detail.state) {
|
|
7455
|
-
case "waiting": return t("pool.note.waiting");
|
|
7456
|
-
case "streaming": return t("pool.note.streaming");
|
|
7457
|
-
case "cancelled": return t("pool.note.cancelled");
|
|
7458
|
-
case "interrupted": return t("pool.note.interrupted");
|
|
7459
|
-
case "failed": return t("pool.note.failed", { code: detail.failureCode ?? "" });
|
|
7460
|
-
}
|
|
7505
|
+
/** 已结算请求自身的诊断说明:辅助请求不重复解释(紧凑标记已经说明),
|
|
7506
|
+
* 缓存排除与计时/用量/定价的缺口各自说明自己。 */
|
|
7507
|
+
function diagnosticOf(detail, t) {
|
|
7461
7508
|
if (detail.kind === "aux") return "";
|
|
7462
7509
|
if (detail.pricingStatus === "unpriced") return t("pool.note.unpriced");
|
|
7463
7510
|
if (detail.inputTokens === void 0 || detail.outputTokens === void 0) return t("pool.note.noUsage");
|
|
@@ -7465,6 +7512,57 @@ window.__ModuleLoader__.load({
|
|
|
7465
7512
|
if (detail.cache.band === "excluded" || detail.cache.band === "unknown") return detail.cache.reason !== void 0 ? t(`pool.excluded.${detail.cache.reason}`) : "";
|
|
7466
7513
|
return "";
|
|
7467
7514
|
}
|
|
7515
|
+
/** The panel's notice: the conversation's state first (waiting for a tool
|
|
7516
|
+
* result / this turn is done / retrying after a failure), then the request's
|
|
7517
|
+
* own lifecycle, then the settled request's diagnostic. A lower-priority
|
|
7518
|
+
* fact never disappears — it moves into the tooltip instead, so both stay
|
|
7519
|
+
* reachable. */
|
|
7520
|
+
function noticeOf(detail, conversation, t) {
|
|
7521
|
+
const one = (text, tone) => ({
|
|
7522
|
+
text,
|
|
7523
|
+
full: text,
|
|
7524
|
+
tone
|
|
7525
|
+
});
|
|
7526
|
+
const own = (() => {
|
|
7527
|
+
switch (detail.state) {
|
|
7528
|
+
case "waiting": return one(t("pool.note.waiting"), "pending");
|
|
7529
|
+
case "streaming": return one(t("pool.note.streaming"), "pending");
|
|
7530
|
+
case "cancelled": return one(t("pool.note.cancelled"), "pending");
|
|
7531
|
+
case "interrupted": return one(t("pool.note.interrupted"), "pending");
|
|
7532
|
+
case "failed": return one(t("pool.note.failed", { code: detail.failureCode ?? "" }), "error");
|
|
7533
|
+
default: return;
|
|
7534
|
+
}
|
|
7535
|
+
})();
|
|
7536
|
+
const diagnostic = detail.state === "completed" ? diagnosticOf(detail, t) : "";
|
|
7537
|
+
const conversationNotice = (text, tone, rest) => ({
|
|
7538
|
+
text,
|
|
7539
|
+
full: [
|
|
7540
|
+
text,
|
|
7541
|
+
rest,
|
|
7542
|
+
own?.text ?? "",
|
|
7543
|
+
diagnostic
|
|
7544
|
+
].filter((part) => part !== "").join(" · "),
|
|
7545
|
+
tone
|
|
7546
|
+
});
|
|
7547
|
+
if (conversation?.state === "retrying") {
|
|
7548
|
+
const retry = conversation.retry;
|
|
7549
|
+
const count = String(retry?.count ?? 1);
|
|
7550
|
+
return conversationNotice(retry !== void 0 && retry.max > 0 ? t("pool.note.retrying", {
|
|
7551
|
+
count,
|
|
7552
|
+
max: String(retry.max)
|
|
7553
|
+
}) : t("pool.note.retryingAlways", { count }), "pending", retry === void 0 ? "" : t("pool.note.retryWait", {
|
|
7554
|
+
seconds: String(Math.max(1, Math.round(retry.delayMs / 1e3))),
|
|
7555
|
+
code: retry.code ?? "—"
|
|
7556
|
+
}));
|
|
7557
|
+
}
|
|
7558
|
+
if (conversation?.state === "awaiting-tool") return conversationNotice(t("pool.note.awaitingTool"), "pending", "");
|
|
7559
|
+
if (conversation?.state === "turn-complete") return conversationNotice(t("pool.note.turnComplete"), "neutral", "");
|
|
7560
|
+
if (own !== void 0) return diagnostic === "" ? own : {
|
|
7561
|
+
...own,
|
|
7562
|
+
full: `${own.full} · ${diagnostic}`
|
|
7563
|
+
};
|
|
7564
|
+
return diagnostic === "" ? void 0 : one(diagnostic, "neutral");
|
|
7565
|
+
}
|
|
7468
7566
|
/** Fixed-layout column floors in px, in table order (origin, state, time,
|
|
7469
7567
|
* model, cache hit, input, output, cache read, first token, latency, speed,
|
|
7470
7568
|
* cost): each is the smallest width that column's content ever needs, so
|
|
@@ -7613,7 +7711,8 @@ window.__ModuleLoader__.load({
|
|
|
7613
7711
|
const inFlight = latest.state === "waiting" || latest.state === "streaming";
|
|
7614
7712
|
const origin = latest.sessionId === focusId;
|
|
7615
7713
|
const time = latest.orderBasis === "record" ? latest.recordTime ?? latest.orderAt : latest.startedAt ?? latest.orderAt;
|
|
7616
|
-
const notice = noticeOf(latest, t);
|
|
7714
|
+
const notice = noticeOf(latest, details.conversation, t);
|
|
7715
|
+
const noteClass = `${UsageView_module_css_default["requestNote"]} ${notice?.tone === "error" ? UsageView_module_css_default["requestNoteError"] ?? "" : notice?.tone === "neutral" ? UsageView_module_css_default["requestNoteNeutral"] ?? "" : ""}`;
|
|
7617
7716
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7618
7717
|
className: UsageView_module_css_default["latestPanel"],
|
|
7619
7718
|
children: [
|
|
@@ -7723,14 +7822,19 @@ window.__ModuleLoader__.load({
|
|
|
7723
7822
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("b", { children: tokenTextOf(latest.cacheWriteTokens) })
|
|
7724
7823
|
] })
|
|
7725
7824
|
]
|
|
7726
|
-
}),
|
|
7825
|
+
}), notice !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
7826
|
+
label: notice.full,
|
|
7827
|
+
side: "top",
|
|
7828
|
+
delayMs: 100,
|
|
7829
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7830
|
+
className: noteClass,
|
|
7831
|
+
tabIndex: 0,
|
|
7832
|
+
children: notice.text
|
|
7833
|
+
})
|
|
7834
|
+
}) : staleAt !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7727
7835
|
className: UsageView_module_css_default["poolContext"],
|
|
7728
|
-
children:
|
|
7729
|
-
})]
|
|
7730
|
-
}),
|
|
7731
|
-
notice !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7732
|
-
className: `${UsageView_module_css_default["poolNotice"]} ${latest.state === "failed" ? UsageView_module_css_default["poolNoticeError"] : latest.state === "completed" ? UsageView_module_css_default["poolNoticeNeutral"] : ""}`,
|
|
7733
|
-
children: notice
|
|
7836
|
+
children: t("pool.asOf", { time: formatTimeOfDay(staleAt) })
|
|
7837
|
+
}) : null]
|
|
7734
7838
|
})
|
|
7735
7839
|
]
|
|
7736
7840
|
});
|
|
@@ -8193,8 +8297,8 @@ window.__ModuleLoader__.load({
|
|
|
8193
8297
|
children: t("filter.model")
|
|
8194
8298
|
}),
|
|
8195
8299
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", {
|
|
8196
|
-
|
|
8197
|
-
children:
|
|
8300
|
+
title: t("stat.successFail"),
|
|
8301
|
+
children: t("stat.requestColumn")
|
|
8198
8302
|
}),
|
|
8199
8303
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("stat.input") }),
|
|
8200
8304
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("th", { children: t("stat.output") }),
|
|
@@ -8433,9 +8537,8 @@ window.__ModuleLoader__.load({
|
|
|
8433
8537
|
"calendar.weekday.5": "六",
|
|
8434
8538
|
"calendar.weekday.6": "日",
|
|
8435
8539
|
"stat.requests": "请求数",
|
|
8540
|
+
"stat.requestColumn": "请求",
|
|
8436
8541
|
"stat.successFail": "成功/失败",
|
|
8437
|
-
"stat.ok": "成功",
|
|
8438
|
-
"stat.fail": "失败",
|
|
8439
8542
|
"stat.failuresPill": "失败 {count}",
|
|
8440
8543
|
"fail.RATE_LIMIT": "限流",
|
|
8441
8544
|
"fail.SERVER": "服务异常",
|
|
@@ -8673,6 +8776,11 @@ window.__ModuleLoader__.load({
|
|
|
8673
8776
|
"pool.excluded.invalid-data": "缓存计数缺失或矛盾,无法计算命中率",
|
|
8674
8777
|
"pool.note.waiting": "首 token 尚未到达;暂不计算输出速度",
|
|
8675
8778
|
"pool.note.streaming": "生成中 · 服务商未提供实时 token 计数,速度待结束后结算",
|
|
8779
|
+
"pool.note.awaitingTool": "等待tool结果",
|
|
8780
|
+
"pool.note.turnComplete": "本轮对话已完成",
|
|
8781
|
+
"pool.note.retrying": "请求失败,正在重试({count}/{max})",
|
|
8782
|
+
"pool.note.retryingAlways": "请求失败,正在重试(第 {count} 次)",
|
|
8783
|
+
"pool.note.retryWait": "{seconds} 秒后重试 · 失败码 {code}",
|
|
8676
8784
|
"pool.note.cancelled": "请求被取消 · 已交付的部分用量按记录展示,不估算缺失数据",
|
|
8677
8785
|
"pool.note.interrupted": "连接中断 · 无法确认请求的结束状态",
|
|
8678
8786
|
"pool.note.unpriced": "模型未定价 · 保留 token、缓存与性能,费用显示 —",
|
|
@@ -8694,6 +8802,7 @@ window.__ModuleLoader__.load({
|
|
|
8694
8802
|
"panel.unpricedNote": "仅计 token",
|
|
8695
8803
|
"quota.trigger": "供应商配额",
|
|
8696
8804
|
"quota.triggerSummary": "{name} · {figure}",
|
|
8805
|
+
"quota.triggerSummaryPooled": "{name} · {figure}({count} 个额度均值)",
|
|
8697
8806
|
"quota.panel": "供应商配额面板",
|
|
8698
8807
|
"quota.tier.fiveHour": "5 小时",
|
|
8699
8808
|
"quota.tier.weekly": "每周",
|
|
@@ -8784,9 +8893,8 @@ window.__ModuleLoader__.load({
|
|
|
8784
8893
|
"calendar.weekday.5": "Sa",
|
|
8785
8894
|
"calendar.weekday.6": "Su",
|
|
8786
8895
|
"stat.requests": "Requests",
|
|
8896
|
+
"stat.requestColumn": "Requests",
|
|
8787
8897
|
"stat.successFail": "OK/Fail",
|
|
8788
|
-
"stat.ok": "OK",
|
|
8789
|
-
"stat.fail": "Fail",
|
|
8790
8898
|
"stat.failuresPill": "Failed {count}",
|
|
8791
8899
|
"fail.RATE_LIMIT": "Rate limited",
|
|
8792
8900
|
"fail.SERVER": "Server error",
|
|
@@ -9024,6 +9132,11 @@ window.__ModuleLoader__.load({
|
|
|
9024
9132
|
"pool.excluded.invalid-data": "Cache counts missing or contradictory; no hit rate computed",
|
|
9025
9133
|
"pool.note.waiting": "First token not arrived; output speed not computed",
|
|
9026
9134
|
"pool.note.streaming": "Generating · the provider reports no live token counts; speed settles after completion",
|
|
9135
|
+
"pool.note.awaitingTool": "Waiting for tool result",
|
|
9136
|
+
"pool.note.turnComplete": "This turn is complete",
|
|
9137
|
+
"pool.note.retrying": "Request failed, retrying ({count}/{max})",
|
|
9138
|
+
"pool.note.retryingAlways": "Request failed, retrying (attempt {count})",
|
|
9139
|
+
"pool.note.retryWait": "next attempt in {seconds}s · failure {code}",
|
|
9027
9140
|
"pool.note.cancelled": "Cancelled · delivered partial usage shown as recorded, nothing estimated",
|
|
9028
9141
|
"pool.note.interrupted": "Connection lost · the request's final state cannot be confirmed",
|
|
9029
9142
|
"pool.note.unpriced": "Model unpriced · tokens, cache and timing kept, cost shows —",
|
|
@@ -9045,6 +9158,7 @@ window.__ModuleLoader__.load({
|
|
|
9045
9158
|
"panel.unpricedNote": "tokens only",
|
|
9046
9159
|
"quota.trigger": "Provider quota",
|
|
9047
9160
|
"quota.triggerSummary": "{name} · {figure}",
|
|
9161
|
+
"quota.triggerSummaryPooled": "{name} · {figure} (mean of {count} quota meters)",
|
|
9048
9162
|
"quota.panel": "Provider quota panel",
|
|
9049
9163
|
"quota.tier.fiveHour": "5-hour",
|
|
9050
9164
|
"quota.tier.weekly": "Weekly",
|