@laoyuehanni/dsh-token-usage 0.4.7 → 0.4.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.
Files changed (67) hide show
  1. package/README.md +6 -4
  2. package/README.zh.md +6 -4
  3. package/lib/aux-request.d.ts +66 -0
  4. package/lib/aux-request.d.ts.map +1 -0
  5. package/lib/aux-request.js +81 -0
  6. package/lib/aux-request.js.map +1 -0
  7. package/lib/client/QuotaButton.js +17 -5
  8. package/lib/client/QuotaButton.js.map +1 -1
  9. package/lib/client/TokenUsageSection.d.ts +26 -0
  10. package/lib/client/TokenUsageSection.d.ts.map +1 -1
  11. package/lib/client/TokenUsageSection.js +65 -12
  12. package/lib/client/TokenUsageSection.js.map +1 -1
  13. package/lib/client/locales.d.ts +12 -0
  14. package/lib/client/locales.d.ts.map +1 -1
  15. package/lib/client/locales.js +24 -0
  16. package/lib/client/locales.js.map +1 -1
  17. package/lib/client.js +173 -20
  18. package/lib/client.js.map +1 -1
  19. package/lib/index.d.ts +6 -0
  20. package/lib/index.d.ts.map +1 -1
  21. package/lib/index.js +115 -2
  22. package/lib/index.js.map +1 -1
  23. package/lib/quota/adapters/command-code.d.ts +33 -0
  24. package/lib/quota/adapters/command-code.d.ts.map +1 -0
  25. package/lib/quota/adapters/command-code.js +170 -0
  26. package/lib/quota/adapters/command-code.js.map +1 -0
  27. package/lib/quota/adapters/deepseek-account.d.ts +24 -0
  28. package/lib/quota/adapters/deepseek-account.d.ts.map +1 -0
  29. package/lib/quota/adapters/deepseek-account.js +91 -0
  30. package/lib/quota/adapters/deepseek-account.js.map +1 -0
  31. package/lib/quota/adapters/deepseek-balance.d.ts +7 -3
  32. package/lib/quota/adapters/deepseek-balance.d.ts.map +1 -1
  33. package/lib/quota/adapters/deepseek-balance.js +9 -3
  34. package/lib/quota/adapters/deepseek-balance.js.map +1 -1
  35. package/lib/quota/credentials.d.ts +3 -2
  36. package/lib/quota/credentials.d.ts.map +1 -1
  37. package/lib/quota/credentials.js +5 -3
  38. package/lib/quota/credentials.js.map +1 -1
  39. package/lib/quota/quota-service.d.ts +3 -0
  40. package/lib/quota/quota-service.d.ts.map +1 -1
  41. package/lib/quota/quota-service.js +2 -1
  42. package/lib/quota/quota-service.js.map +1 -1
  43. package/lib/quota/registry.d.ts.map +1 -1
  44. package/lib/quota/registry.js +6 -0
  45. package/lib/quota/registry.js.map +1 -1
  46. package/lib/quota/types.d.ts +23 -1
  47. package/lib/quota/types.d.ts.map +1 -1
  48. package/lib/quota/types.js.map +1 -1
  49. package/lib/rollup.d.ts +7 -1
  50. package/lib/rollup.d.ts.map +1 -1
  51. package/lib/rollup.js +20 -2
  52. package/lib/rollup.js.map +1 -1
  53. package/lib/stats-route.d.ts.map +1 -1
  54. package/lib/stats-route.js +5 -1
  55. package/lib/stats-route.js.map +1 -1
  56. package/lib/stats.d.ts +16 -8
  57. package/lib/stats.d.ts.map +1 -1
  58. package/lib/stats.js +137 -33
  59. package/lib/stats.js.map +1 -1
  60. package/lib/usage-record.d.ts +65 -6
  61. package/lib/usage-record.d.ts.map +1 -1
  62. package/lib/usage-record.js +67 -4
  63. package/lib/usage-record.js.map +1 -1
  64. package/lib/wire.d.ts +67 -3
  65. package/lib/wire.d.ts.map +1 -1
  66. package/lib/wire.js.map +1 -1
  67. package/package.json +1 -1
package/README.md CHANGED
@@ -23,8 +23,8 @@ Repo: <https://github.com/LaoYueHanNi/dsh-token-usage>
23
23
 
24
24
  ## Features
25
25
 
26
- - **Live recording**: every provider-billed model call is recorded as it happens — tokens, cost, model, session — context-compaction calls included.
27
- - **Web stats page**: filters (date range + model + `1d`/`7d`/`30d` shortcuts), summary cards, daily trend chart (hover a day for its total), per-model table. The table block toggles between **per-model / per-session**: the session table groups by working directory (switchable to a flat list), sorts by total tokens / cost / recent activity on header click, and **Ctrl+click** on a session row jumps straight to that session's usage tab.
26
+ - **Live recording**: every provider-billed model call is recorded as it happens — tokens, cost, model, session — conversation requests, context-compaction calls, and auxiliary system calls included: the Auto review authorization reviewer, session-title generation, and reasoning translation. Auxiliary calls bill into the totals and the per-model table, while the **Runtime overhead** tab in the detail switch splits them out by kind; they carry no session, so the per-session table stays conversation-only. That history cannot be backfilled — the host keeps no usage record of those calls, and recording starts with the first request after upgrading.
27
+ - **Web stats page**: filters (date range + model + `1d`/`7d`/`30d` shortcuts), summary cards, daily trend chart (hover a day for its total), per-model table. The table block toggles between **per-model / per-session / runtime overhead**: the session table groups by working directory (switchable to a flat list), sorts by total tokens / cost / recent activity on header click, and **Ctrl+click** on a session row jumps straight to that session's usage tab; the runtime-overhead tab breaks the auxiliary calls down by kind.
28
28
  - **Session usage tab**: the conversation pane gains a **Usage** view tab (beside Chat / Trajectory) with the active session's dashboard — six stat cards (successful requests with a failure pill, cost, cache hit rate, average time-to-first-token, generation throughput, total tokens), a 4-bucket token strip, an hourly trend chart, and a per-model table. A scope switch toggles **Session / With subagents**, and the subagent table drills into each child and back. Hovering the failure pill breaks failures down per class (rate limited, server error, context exceeded, …).
29
29
 
30
30
  ![Session Usage tab](docs/images/usage-tab.png)
@@ -61,7 +61,7 @@ plugins:
61
61
 
62
62
  ## Provider quota
63
63
 
64
- The input-bar button follows the currently selected provider and opens a panel with remaining quota (the same API key as inference):
64
+ The input-bar button follows the currently selected provider and opens a panel with remaining quota (API-key providers share the inference key; the DeepSeek account reads the signed-in balance):
65
65
 
66
66
  <img src="docs/images/zhipu-plan-usage.png" width="520" alt="Zhipu GLM quota panel">
67
67
 
@@ -73,7 +73,9 @@ The input-bar button follows the currently selected provider and opens a panel w
73
73
  | Kimi For Coding | 5-hour, weekly |
74
74
  | MiniMax Coding Plan (CN / international) | 5-hour, weekly |
75
75
  | OpenCode Go | 5-hour, weekly, monthly |
76
- | DeepSeek (official) | ¥ account balance |
76
+ | Command Code | 5-hour, weekly, monthly |
77
+ | DeepSeek (official API key) | ¥ account balance |
78
+ | DeepSeek account | topped-up balance, granted balance |
77
79
  | OpenRouter | $ remaining credits |
78
80
 
79
81
  Unsupported providers hide the button; a failed query can be retried from the panel. On by default; turn it off with `quota.enabled: false`. Not supported yet: Volcengine, ZenMux, Zhipu Team plan, Claude / Codex / Gemini / Grok official subscriptions, GitHub Copilot.
package/README.zh.md CHANGED
@@ -23,8 +23,8 @@
23
23
 
24
24
  ## 功能
25
25
 
26
- - **实时记录**:每一次 provider 计费调用发生即记录——token、费用、模型、会话,上下文压缩调用同样计入。
27
- - **Web 统计页**:过滤条(日期区间 + 模型下拉 + `1d`/`7d`/`30d` 快捷区间)、汇总卡片、按日趋势图(悬停查看当日总量)、按模型明细表。明细表可在**按模型 / 按会话**间切换:按会话表按工作区目录分组(可切为列表视图),总 token / 费用 / 最近活跃列可点击排序,**Ctrl+点击**会话行直达该会话的用量页。
26
+ - **实时记录**:每一次 provider 计费调用发生即记录——token、费用、模型、会话;主对话请求、上下文压缩调用与系统辅助调用(自动审查、会话标题生成、推理翻译)都计入。辅助调用计入总量和按模型表,同时在明细切换的**运行开销**页签按类别单独拆出;它们不归属任何会话,因此按会话表只统计对话请求。这部分历史无法回补——宿主不保存这些调用的用量记录,升级后的第一个请求才开始记录。
27
+ - **Web 统计页**:过滤条(日期区间 + 模型下拉 + `1d`/`7d`/`30d` 快捷区间)、汇总卡片、按日趋势图(悬停查看当日总量)、按模型明细表。明细表可在**按模型 / 按会话 / 运行开销**间切换:按会话表按工作区目录分组(可切为列表视图),总 token / 费用 / 最近活跃列可点击排序,**Ctrl+点击**会话行直达该会话的用量页;运行开销页签按类别列出自动审查、标题生成、推理翻译等辅助调用的次数、费用与 token。
28
28
  - **会话用量页签**:对话面板新增「用量」视图页签(与聊天 / 轨迹并列),展示当前会话的 dashboard —— 六张数值卡(成功请求数带失败胶囊、费用、缓存命中率、首 token 平均延迟、出字速度、总 token)+ 四项 token 明细条 + 按小时趋势图 + 按模型表。「本会话 / 含子会话」一键切换范围,子会话表逐行钻取并可逐级返回。悬停失败胶囊可看按失败类别的明细(限流 / 网络异常 / 上下文超限 等逐一计数)。
29
29
 
30
30
  ![会话用量页签](docs/images/usage-tab_zh.png)
@@ -61,7 +61,7 @@ plugins:
61
61
 
62
62
  ## 供应商配额
63
63
 
64
- 输入栏按钮跟随当前选中的供应商,点开即可查看套餐余量(与推理共用同一把 API Key):
64
+ 输入栏按钮跟随当前选中的供应商,点开即可查看套餐余量(API Key 供应商与推理共用同一把密钥;DeepSeek 账号读取登录态余额):
65
65
 
66
66
  <img src="docs/images/zhipu-plan-usage_zh.png" width="520" alt="智谱 GLM 配额面板">
67
67
 
@@ -73,7 +73,9 @@ plugins:
73
73
  | Kimi For Coding | 5 小时、每周 |
74
74
  | MiniMax Coding Plan(国内 / 国际) | 5 小时、每周 |
75
75
  | OpenCode Go | 5 小时、每周、每月 |
76
- | DeepSeek(官方) | ¥ 账户余额 |
76
+ | Command Code | 5 小时、每周、每月 |
77
+ | DeepSeek(官方 API Key) | ¥ 账户余额 |
78
+ | DeepSeek 账号 | 充值余额、赠金余额 |
77
79
  | OpenRouter | $ 剩余额度 |
78
80
 
79
81
  不支持的供应商不显示该按钮;查询失败可在面板内重试。默认开启,可用 `quota.enabled: false` 关闭。暂不支持:火山方舟、ZenMux、智谱团队版、Claude / Codex / Gemini / Grok 官方订阅、GitHub Copilot。
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Auxiliary (bypass) model requests of the token-usage plugin: classification
3
+ * and record projection for provider calls that are NOT part of a
4
+ * conversation turn — the Auto review authorization gate, session-title
5
+ * generation, and reasoning translation. Those calls are issued through
6
+ * `ctx.llm.stream()` by their owning host packages and never produce a
7
+ * session event, so the plugin records them on the `llm/stream` waterfall
8
+ * every streaming call passes through (see `LlmRuntime.stream`).
9
+ *
10
+ * Classification never relies on host exports that older DSH builds may not
11
+ * ship: the conversation loop always carries a `sessionId`, compaction and
12
+ * title requests carry their `purpose`, and the two remaining bypass callers
13
+ * (Auto review, translator) are recognized by their fixed system prompts.
14
+ * Anything else lands in the defensive `other` bucket rather than being
15
+ * dropped, so a future host feature still shows up in the runtime-overhead
16
+ * totals.
17
+ *
18
+ * @module token-usage/aux-request
19
+ */
20
+ import type { GenerateOptions, TokenUsage } from '@deepseek-ai/dsh-llm';
21
+ import { type AuxKind, type UsageRecord } from './usage-record.ts';
22
+ /**
23
+ * First word of the Auto review fixed policy (`dsh-experimental-auto-review`
24
+ * sends the REVIEW_POLICY text verbatim as the request's system prompt).
25
+ * The rest of that prompt is prose, so the marker stays the first token.
26
+ */
27
+ export declare const AUTO_REVIEW_PROMPT_PREFIX = "REVIEW_POLICY";
28
+ /**
29
+ * First words of the translator's system prompt
30
+ * (`dsh-experimental-translator` composes `Translate the following text …`).
31
+ */
32
+ export declare const TRANSLATION_PROMPT_PREFIX = "Translate the following text";
33
+ /**
34
+ * Classify one streaming request as an auxiliary (bypass) model call.
35
+ * @param options - the request observed at the `llm/stream` waterfall.
36
+ * @returns the auxiliary kind, or undefined when the request is already
37
+ * covered by a conversation event (agent loop) or the compaction summary
38
+ * (which logs its own `compaction/summary` event carrying usage).
39
+ */
40
+ export declare function classifyAuxRequest(options: GenerateOptions): AuxKind | undefined;
41
+ /** The facts one settled auxiliary stream contributes to its log row. */
42
+ export interface AuxRequestRecordInput {
43
+ /** Which bypass call produced the row. */
44
+ auxKind: AuxKind;
45
+ /** Unique `aux:<kind>:<startedAt>:<seq>` identity claimed by the log. */
46
+ requestId: string;
47
+ /** Stream-start wall time, epoch milliseconds. */
48
+ time: number;
49
+ /** Provider model id the bypass call routed to. */
50
+ model: string;
51
+ /** Provider-reported model id of the response body, when the adapter's
52
+ * replay envelope named one (see {@link responseModelOfReplay}); the
53
+ * routed `model` stays the billing identity either way. */
54
+ responseModel?: string;
55
+ /** Provider-reported usage, when the stream delivered a usage chunk. */
56
+ usage?: TokenUsage;
57
+ }
58
+ /**
59
+ * Build the log row for one settled auxiliary model request. The row carries
60
+ * `kind: 'aux'` and an empty `sessionId` — a bypass call has no conversation
61
+ * owner, so the per-session dimension must never attribute it to one.
62
+ * @param input - kind, identity, timing, route, and usage of the call.
63
+ * @returns the persistable record (usage omitted when unusable).
64
+ */
65
+ export declare function recordFromAuxRequest(input: AuxRequestRecordInput): UsageRecord;
66
+ //# sourceMappingURL=aux-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aux-request.d.ts","sourceRoot":"","sources":["../src/aux-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAgB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAEhF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,kBAAkB,CAAA;AAExD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,iCAAiC,CAAA;AAEvE;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,GAAG,SAAS,CAgBhF;AAED,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAA;IAChB,yEAAyE;IACzE,SAAS,EAAE,MAAM,CAAA;IACjB,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAA;IACb;;+DAE2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,wEAAwE;IACxE,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,GAAG,WAAW,CAY9E"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Auxiliary (bypass) model requests of the token-usage plugin: classification
3
+ * and record projection for provider calls that are NOT part of a
4
+ * conversation turn — the Auto review authorization gate, session-title
5
+ * generation, and reasoning translation. Those calls are issued through
6
+ * `ctx.llm.stream()` by their owning host packages and never produce a
7
+ * session event, so the plugin records them on the `llm/stream` waterfall
8
+ * every streaming call passes through (see `LlmRuntime.stream`).
9
+ *
10
+ * Classification never relies on host exports that older DSH builds may not
11
+ * ship: the conversation loop always carries a `sessionId`, compaction and
12
+ * title requests carry their `purpose`, and the two remaining bypass callers
13
+ * (Auto review, translator) are recognized by their fixed system prompts.
14
+ * Anything else lands in the defensive `other` bucket rather than being
15
+ * dropped, so a future host feature still shows up in the runtime-overhead
16
+ * totals.
17
+ *
18
+ * @module token-usage/aux-request
19
+ */
20
+ import { projectUsage } from "./usage-record.js";
21
+ /**
22
+ * First word of the Auto review fixed policy (`dsh-experimental-auto-review`
23
+ * sends the REVIEW_POLICY text verbatim as the request's system prompt).
24
+ * The rest of that prompt is prose, so the marker stays the first token.
25
+ */
26
+ export const AUTO_REVIEW_PROMPT_PREFIX = 'REVIEW_POLICY';
27
+ /**
28
+ * First words of the translator's system prompt
29
+ * (`dsh-experimental-translator` composes `Translate the following text …`).
30
+ */
31
+ export const TRANSLATION_PROMPT_PREFIX = 'Translate the following text';
32
+ /**
33
+ * Classify one streaming request as an auxiliary (bypass) model call.
34
+ * @param options - the request observed at the `llm/stream` waterfall.
35
+ * @returns the auxiliary kind, or undefined when the request is already
36
+ * covered by a conversation event (agent loop) or the compaction summary
37
+ * (which logs its own `compaction/summary` event carrying usage).
38
+ */
39
+ export function classifyAuxRequest(options) {
40
+ // Compaction summaries are already recorded from `compaction/summary`.
41
+ if (options.purpose === 'compaction')
42
+ return undefined;
43
+ // Title generation is a bypass call, but its purpose marker is explicit.
44
+ if (options.purpose === 'session-title')
45
+ return 'session-title';
46
+ // Every conversation-loop request is marked with the session it serves
47
+ // (dsh-agent-loop freezes `sessionId` into its request); the loop records
48
+ // the call through `assistant/message`. A hand-built request without a
49
+ // session is the bypass shape.
50
+ if (options.sessionId !== undefined)
51
+ return undefined;
52
+ const system = options.system;
53
+ if (typeof system === 'string') {
54
+ if (system.startsWith(AUTO_REVIEW_PROMPT_PREFIX))
55
+ return 'auto-review';
56
+ if (system.startsWith(TRANSLATION_PROMPT_PREFIX))
57
+ return 'translation';
58
+ }
59
+ return 'other';
60
+ }
61
+ /**
62
+ * Build the log row for one settled auxiliary model request. The row carries
63
+ * `kind: 'aux'` and an empty `sessionId` — a bypass call has no conversation
64
+ * owner, so the per-session dimension must never attribute it to one.
65
+ * @param input - kind, identity, timing, route, and usage of the call.
66
+ * @returns the persistable record (usage omitted when unusable).
67
+ */
68
+ export function recordFromAuxRequest(input) {
69
+ const usage = projectUsage(input.usage);
70
+ return {
71
+ requestId: input.requestId,
72
+ time: input.time,
73
+ sessionId: '',
74
+ model: input.model,
75
+ ...(input.responseModel !== undefined ? { responseModel: input.responseModel } : {}),
76
+ ...(usage !== undefined ? { usage } : {}),
77
+ kind: 'aux',
78
+ auxKind: input.auxKind,
79
+ };
80
+ }
81
+ //# sourceMappingURL=aux-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aux-request.js","sourceRoot":"","sources":["../src/aux-request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,YAAY,EAAkC,MAAM,mBAAmB,CAAA;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,eAAe,CAAA;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAA;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAwB;IACzD,uEAAuE;IACvE,IAAI,OAAO,CAAC,OAAO,KAAK,YAAY;QAAE,OAAO,SAAS,CAAA;IACtD,yEAAyE;IACzE,IAAI,OAAO,CAAC,OAAO,KAAK,eAAe;QAAE,OAAO,eAAe,CAAA;IAC/D,uEAAuE;IACvE,0EAA0E;IAC1E,uEAAuE;IACvE,+BAA+B;IAC/B,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IACrD,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,MAAM,CAAC,UAAU,CAAC,yBAAyB,CAAC;YAAE,OAAO,aAAa,CAAA;QACtE,IAAI,MAAM,CAAC,UAAU,CAAC,yBAAyB,CAAC;YAAE,OAAO,aAAa,CAAA;IACxE,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAoBD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAA4B;IAC/D,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACvC,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,GAAG,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpF,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAA;AACH,CAAC"}
@@ -263,7 +263,11 @@ function QuotaGlyph({ share }) {
263
263
  function QuotaColumn({ window, t }) {
264
264
  const remaining = quotaRemainingPercent(window);
265
265
  const severity = quotaSeverityOf(window);
266
- const label = t(TIER_LABEL_KEYS[window.tier]);
266
+ const label = window.balanceKind === 'recharge'
267
+ ? t('quota.tier.recharge')
268
+ : window.balanceKind === 'bonus'
269
+ ? t('quota.tier.bonus')
270
+ : t(TIER_LABEL_KEYS[window.tier]);
267
271
  // Balance windows lead with the amount (the figure the user manages
268
272
  // against); ratio windows with the remaining share. The `meta` suffix
269
273
  // carries the balance's total.
@@ -284,8 +288,9 @@ function QuotaColumn({ window, t }) {
284
288
  return (_jsxs("div", { className: styles.col, children: [_jsx("div", { className: styles.label, children: label }), _jsxs("div", { className: styles.value, children: [value, meta !== undefined ? _jsxs("span", { className: styles.meta, children: [" ", meta] }) : null] }), remaining !== undefined && (_jsx("div", { className: styles.bar, children: _jsx("div", { className: `${styles.fill} ${styles[severity]}`, style: { width: `${String(Math.round(remaining))}%` } }) })), aux !== undefined && (_jsxs("div", { className: styles.aux, children: [_jsx("span", { className: `${styles.dot} ${styles[severity]}` }), aux] }))] }));
285
289
  }
286
290
  /** The panel's width tier for one payload: what the windows PAINT decides —
287
- * a lone amount (no computable bar, the DeepSeek shape) reads at the
288
- * minimal plate, one bar (a weekly-only plan, or a balance with a spend
291
+ * a lone amount (no computable bar, the API-key DeepSeek shape) reads at
292
+ * the minimal plate, two amount purses (account recharge + bonus) the
293
+ * full plate, one bar (a weekly-only plan, or a balance with a spend
289
294
  * total like OpenRouter) the middle one, two or more bars the full plate.
290
295
  * Errors and payloads without windows read the full plate (their copy
291
296
  * runs long). */
@@ -293,8 +298,13 @@ function panelWidthOf(payload) {
293
298
  if (payload === null || payload.status !== 'ok')
294
299
  return PANEL_WIDTH_FULL;
295
300
  const bars = payload.windows.filter(window => quotaUsedPercent(window) !== undefined).length;
296
- if (bars === 0)
297
- return payload.windows.length > 0 ? PANEL_WIDTH_BALANCE : PANEL_WIDTH_FULL;
301
+ if (bars === 0) {
302
+ // One amount (the API-key DeepSeek shape) stays the minimal plate.
303
+ // Two purses (recharge + bonus) need the full plate so both labels fit.
304
+ if (payload.windows.length === 1)
305
+ return PANEL_WIDTH_BALANCE;
306
+ return PANEL_WIDTH_FULL;
307
+ }
298
308
  return bars === 1 ? PANEL_WIDTH_SINGLE : PANEL_WIDTH_FULL;
299
309
  }
300
310
  /** Friendly locale copy for one normalized query error. */
@@ -304,6 +314,8 @@ function errorText(error, t) {
304
314
  return t('quota.error.auth', { message: error.message });
305
315
  case 'no-credential':
306
316
  return t('quota.error.noCredential', { ref: error.message });
317
+ case 'signed-out':
318
+ return t('quota.error.signedOut');
307
319
  case 'http':
308
320
  return t('quota.error.http', { message: error.message });
309
321
  case 'network':
@@ -1 +1 @@
1
- {"version":3,"file":"QuotaButton.js","sourceRoot":"","sources":["../../src/client/QuotaButton.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAA;AAS/D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EACL,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,oBAAoB,EAC/F,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,gBAAgB,GACjG,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAE7C,0EAA0E;AAC1E,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAE3B;;;2CAG2C;AAC3C,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAC/B,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAC5B,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEhC,sEAAsE;AACtE,MAAM,eAAe,GAAiH;IACpI,SAAS,EAAE,qBAAqB;IAChC,MAAM,EAAE,mBAAmB;IAC3B,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,oBAAoB;CAC9B,CAAA;AA+BD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,cAAc,E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,CAAC,UAAU,GAAG,KAAK,EAAE;QAC/C,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;QACvC,MAAM;KACP,CAAC,CAAA;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACpE,MAAM,KAAK,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAC5C,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC/E,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -16,11 +16,37 @@
16
16
  import type { ReactNode } from 'react';
17
17
  import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
18
18
  import type { SettingsSectionOwnerProps } from '@deepseek-ai/dsh-client-ui-settings/client';
19
+ import type { AuxSummary, CostState } from '../wire.ts';
20
+ import type { CurrencyView } from './format.ts';
19
21
  /** Re-export so existing section tests and consumers keep importing
20
22
  * `StatCard` from this module (the file moved to `./StatCard.tsx`). */
21
23
  export { StatCard } from './StatCard.tsx';
22
24
  export { totalTokens } from './day.ts';
23
25
  export { formatTokens, formatHitRate } from './format.ts';
26
+ /**
27
+ * The runtime-overhead tab content: the auxiliary (bypass) model requests —
28
+ * Auto review, session-title generation, translation, and the defensive
29
+ * "other" bucket — split by kind. Those calls are provider-billed requests of
30
+ * a concrete model, so their usage is already folded into the totals above
31
+ * and into the by-model table; this content is a read-only breakdown of that
32
+ * share, never an additional total. Each kind row is a collapsed-by-default
33
+ * disclosure: its per-model detail lines appear only while the kind's toggle
34
+ * is activated. A summary without auxiliary requests
35
+ * renders its empty hint inside the tab, so the dimension switch keeps a
36
+ * stable set of tabs. The aux layer is read defensively: a host that predates
37
+ * the field sends no `aux` at all, and that shape renders the same empty hint.
38
+ * @param props - the aux layer of the summary (possibly absent on an older
39
+ * host payload), the cost state, the display currency view, and the locale
40
+ * translator.
41
+ * @returns the tab content: an empty hint, or the per-kind table (kinds
42
+ * collapsed, expanding to their per-model lines) with its total row.
43
+ */
44
+ export declare function AuxOverheadSection({ aux, costState, view, t }: {
45
+ aux: AuxSummary | undefined;
46
+ costState: CostState;
47
+ view: CurrencyView;
48
+ t: TranslateNS<'token-usage'>;
49
+ }): ReactNode;
24
50
  /**
25
51
  * Render the Token Usage section content column. The `t` seat arrives from
26
52
  * the registration's `locale:` declaration and follows the active locale.
@@ -1 +1 @@
1
- {"version":3,"file":"TokenUsageSection.d.ts","sourceRoot":"","sources":["../../src/client/TokenUsageSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAqB3F;uEACuE;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAIzC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAqHzD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,EAAE,yBAAyB,GAAG;IACtG,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;IAC7B,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IACvC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,GAAG;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACzE,GAAG,SAAS,CAmTZ"}
1
+ {"version":3,"file":"Token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CAAA;KAAE,CAAA;CACzE,GAAG,SAAS,CAkUZ"}
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
14
14
  *
15
15
  * @module token-usage/client/TokenUsageSection
16
16
  */
17
- import { useCallback, useEffect, useRef, useState } from 'react';
17
+ import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
18
18
  import { IconWarningOutlineRegular, Toast } from '@deepseek-ai/dsh-client-ui-primitives';
19
19
  import { STATS_PATH } from "../wire.js";
20
20
  import { useAsyncResource } from "./async-resource.js";
@@ -114,6 +114,52 @@ function FilterBar({ filters, models, onChange, onPricingTable, t }) {
114
114
  onChange({ ...filters, ...quickRange(days) });
115
115
  } }), _jsx(DateRangePicker, { from: filters.from, to: filters.to, onChange: next => onChange({ ...filters, ...next }), t: t }), _jsx(MenuSelect, { ariaLabel: t('filter.model'), grow: true, value: filters.model, options: [{ value: '', label: t('filter.allModels') }, ...models.map(model => ({ value: model, label: model }))], onChange: model => onChange({ ...filters, model }) }), _jsx("button", { type: "button", "data-pricing-overview-trigger": true, className: styles['pricingLink'], onClick: onPricingTable, children: t('pricing.table') })] }));
116
116
  }
117
+ /**
118
+ * The runtime-overhead tab content: the auxiliary (bypass) model requests —
119
+ * Auto review, session-title generation, translation, and the defensive
120
+ * "other" bucket — split by kind. Those calls are provider-billed requests of
121
+ * a concrete model, so their usage is already folded into the totals above
122
+ * and into the by-model table; this content is a read-only breakdown of that
123
+ * share, never an additional total. Each kind row is a collapsed-by-default
124
+ * disclosure: its per-model detail lines appear only while the kind's toggle
125
+ * is activated. A summary without auxiliary requests
126
+ * renders its empty hint inside the tab, so the dimension switch keeps a
127
+ * stable set of tabs. The aux layer is read defensively: a host that predates
128
+ * the field sends no `aux` at all, and that shape renders the same empty hint.
129
+ * @param props - the aux layer of the summary (possibly absent on an older
130
+ * host payload), the cost state, the display currency view, and the locale
131
+ * translator.
132
+ * @returns the tab content: an empty hint, or the per-kind table (kinds
133
+ * collapsed, expanding to their per-model lines) with its total row.
134
+ */
135
+ export function AuxOverheadSection({ aux, costState, view, t }) {
136
+ // Which kinds are expanded. Collapsed by default — the kind row itself
137
+ // carries the aggregate; the per-model lines are the drill-in. Each kind
138
+ // toggles independently; switching tabs unmounts the section, which is
139
+ // the natural reset.
140
+ const [expandedKinds, setExpandedKinds] = useState(() => new Set());
141
+ const toggleKind = useCallback((auxKind) => {
142
+ setExpandedKinds(previous => {
143
+ const next = new Set(previous);
144
+ if (next.has(auxKind))
145
+ next.delete(auxKind);
146
+ else
147
+ next.add(auxKind);
148
+ return next;
149
+ });
150
+ }, []);
151
+ if (aux === undefined || aux.total.requests === 0) {
152
+ return _jsx("p", { className: styles['muted'], children: t('aux.empty') });
153
+ }
154
+ // The numeric cells are shared by the per-kind rows and the total row so
155
+ // both keep the same column set; zero buckets dim exactly like the
156
+ // per-model table's cells.
157
+ const numericCells = (totals, cost) => (_jsxs(_Fragment, { children: [_jsx("td", { children: totals.requests.toLocaleString() }), _jsx("td", { className: styles['costCol'], children: costsAvailable(costState) ? formatCost(cost, view) : '—' }), _jsx("td", { children: formatTokens(totalTokens(totals)) }), _jsx("td", { className: totals.inputTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(totals.inputTokens) }), _jsx("td", { className: totals.outputTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(totals.outputTokens) }), _jsx("td", { className: totals.cacheReadTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(totals.cacheReadTokens) }), _jsx("td", { className: totals.cacheWriteTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(totals.cacheWriteTokens) })] }));
158
+ return (_jsx(_Fragment, { children: _jsx("div", { className: styles['tableWrap'], children: _jsxs("table", { className: styles['table'], "aria-label": t('aux.tab'), children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: styles['modelHead'], children: t('aux.kind') }), _jsx("th", { children: t('aux.requests') }), _jsx("th", { children: t('stat.cost') }), _jsx("th", { children: t('stat.totalTokens') }), _jsx("th", { children: t('stat.input') }), _jsx("th", { children: t('stat.output') }), _jsx("th", { children: t('stat.cacheRead') }), _jsx("th", { children: t('stat.cacheWrite') })] }) }), _jsxs("tbody", { children: [(aux.byKind ?? []).map(kindRow => {
159
+ const expanded = expandedKinds.has(kindRow.auxKind);
160
+ return (_jsxs(Fragment, { children: [_jsxs("tr", { children: [_jsx("td", { className: styles['modelCol'], children: _jsxs("button", { type: "button", className: styles['auxKindToggle'], "aria-expanded": expanded, onClick: () => toggleKind(kindRow.auxKind), children: [_jsx("span", { className: styles['auxChevron'], "aria-hidden": "true", children: "\u25B8" }), t(`aux.kind.${kindRow.auxKind}`)] }) }), numericCells(kindRow.totals, kindRow.cost)] }), expanded && (kindRow.byModel ?? []).map(modelRow => (_jsxs("tr", { children: [_jsx("td", { className: `${styles['modelCol']} ${styles['auxModelCell']}`, children: _jsx("span", { className: styles['modelCell'], children: _jsx("span", { className: styles['modelName'], children: modelRow.model }) }) }), numericCells(modelRow.totals, modelRow.cost)] }, `${kindRow.auxKind}:${modelRow.model}`)))] }, kindRow.auxKind));
161
+ }), _jsxs("tr", { children: [_jsx("td", { className: styles['modelCol'], children: t('aux.total') }), numericCells(aux.total, aux.cost)] })] })] }) }) }));
162
+ }
117
163
  /**
118
164
  * Render the Token Usage section content column. The `t` seat arrives from
119
165
  * the registration's `locale:` declaration and follows the active locale.
@@ -157,10 +203,10 @@ export function TokenUsageSection({ t, close, sessionListed, openSession }) {
157
203
  // Entering the page starts on today's window (the 1d quick range).
158
204
  const [filters, setFilters] = useState(() => ({ model: '', ...quickRange(1) }));
159
205
  // The detail-table block's mode: by model (default, the historical table,
160
- // byte-identical behavior) or by session. Pure presentation state — both
161
- // row sets arrive on the SAME summary response, so switching never
162
- // refetches (session-local, not persisted, the usage tab's scope-switch
163
- // tradeoff).
206
+ // byte-identical behavior), by session, or the runtime-overhead breakdown of
207
+ // the auxiliary (bypass) model requests. Pure presentation state — every row
208
+ // set arrives on the SAME summary response, so switching never refetches
209
+ // (session-local, not persisted, the usage tab's scope-switch tradeoff).
164
210
  const [detailMode, setDetailMode] = useState('model');
165
211
  const [models, setModels] = useState([]);
166
212
  // The model whose pricing dialog is open (null = none). Refetched
@@ -213,6 +259,11 @@ export function TokenUsageSection({ t, close, sessionListed, openSession }) {
213
259
  }
214
260
  const { total } = state.value;
215
261
  const view = currencyViewOf(state.value);
262
+ // The auxiliary (bypass) request count: the runtime-overhead tab is part of
263
+ // the detail switch whenever any dimension has rows, and the tab content
264
+ // renders its own empty hint when this stays 0 (or an older host payload
265
+ // carries no auxiliary layer at all).
266
+ const auxRequests = state.value.aux?.total.requests ?? 0;
216
267
  return (_jsx("div", { ref: rootRef, className: styles['section'], children: _jsxs(PricingAssociationProvider, { resolutions: state.value.modelResolutions, feedVersion: state.value.feedVersion, view: view, t: t, children: [pricingOverview, _jsx("h2", { className: styles['title'], children: t('nav.label') }), _jsx("p", { className: styles['muted'], children: t('dataDir', { path: state.value.dataDir }) }), _jsx(FilterBar, { filters: filters, models: models, onChange: setFilters, onPricingTable: () => {
217
268
  setUsedSnapshot(new Set(state.value.byModel.map(row => row.model)));
218
269
  setPricingTableOpen(true);
@@ -223,8 +274,8 @@ export function TokenUsageSection({ t, close, sessionListed, openSession }) {
223
274
  // from the filtered response alone. The pricing block follows the
224
275
  // filter selection, so an empty selection renders none of it.
225
276
  _jsx("p", { className: styles['empty'], children: t('empty') }))
226
- : (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles['cards'], children: [_jsx(RequestsStatCard, { requests: total.requests, failures: total.failures ?? 0, failuresByCode: total.failuresByCode, t: t }), _jsx(StatCard, { label: t('stat.cost'), value: costsAvailable(state.value.costState) ? formatCost(state.value.totalCost, view) : '—' }), _jsx(StatCard, { label: t('stat.totalTokens'), value: formatTokens(totalTokens(total)) }), _jsx(StatCard, { label: t('stat.hitRate'), value: _jsx(HitRateText, { totals: total }) })] }), _jsxs("div", { className: styles['cards'], children: [_jsx(StatCard, { label: t('stat.input'), value: formatTokens(total.inputTokens) }), _jsx(StatCard, { label: t('stat.output'), value: formatTokens(total.outputTokens) }), _jsx(StatCard, { label: t('stat.cacheRead'), value: formatTokens(total.cacheReadTokens) }), _jsx(StatCard, { label: t('stat.cacheWrite'), value: formatTokens(total.cacheWriteTokens) })] }), _jsx(PricingStatus, { costState: state.value.costState, pricingUnavailableReason: state.value.pricingUnavailableReason, associationStorageError: state.value.associationStorageError, t: t }), _jsx(TrendChart, { rows: state.value.byDay, t: t, ...filters.from !== '' ? { from: filters.from } : {}, ...filters.to !== '' ? { to: filters.to } : {}, ...filters.from !== '' && filters.from === filters.to ? { hours: state.value.byHour } : {} }), state.value.byModel.length > 0 || (state.value.sessionRows?.length ?? 0) > 0
227
- ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles['segmented'], role: "group", "aria-label": t('detail.switch.label'), children: [_jsx("button", { type: "button", className: detailMode === 'model' ? `${styles['segBtn']} ${styles['segActive']}` : styles['segBtn'], "aria-pressed": detailMode === 'model', onClick: () => setDetailMode('model'), children: t('byModel.title') }), _jsx("button", { type: "button", className: detailMode === 'session' ? `${styles['segBtn']} ${styles['segActive']}` : styles['segBtn'], "aria-pressed": detailMode === 'session', onClick: () => setDetailMode('session'), children: t('bySession.title') })] }), detailMode === 'model'
277
+ : (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles['cards'], children: [_jsx(RequestsStatCard, { requests: total.requests, failures: total.failures ?? 0, failuresByCode: total.failuresByCode, t: t }), _jsx(StatCard, { label: t('stat.cost'), value: costsAvailable(state.value.costState) ? formatCost(state.value.totalCost, view) : '—' }), _jsx(StatCard, { label: t('stat.totalTokens'), value: formatTokens(totalTokens(total)) }), _jsx(StatCard, { label: t('stat.hitRate'), value: _jsx(HitRateText, { totals: total }) })] }), _jsxs("div", { className: styles['cards'], children: [_jsx(StatCard, { label: t('stat.input'), value: formatTokens(total.inputTokens) }), _jsx(StatCard, { label: t('stat.output'), value: formatTokens(total.outputTokens) }), _jsx(StatCard, { label: t('stat.cacheRead'), value: formatTokens(total.cacheReadTokens) }), _jsx(StatCard, { label: t('stat.cacheWrite'), value: formatTokens(total.cacheWriteTokens) })] }), _jsx(PricingStatus, { costState: state.value.costState, pricingUnavailableReason: state.value.pricingUnavailableReason, associationStorageError: state.value.associationStorageError, t: t }), _jsx(TrendChart, { rows: state.value.byDay, t: t, ...filters.from !== '' ? { from: filters.from } : {}, ...filters.to !== '' ? { to: filters.to } : {}, ...filters.from !== '' && filters.from === filters.to ? { hours: state.value.byHour } : {} }), state.value.byModel.length > 0 || (state.value.sessionRows?.length ?? 0) > 0 || auxRequests > 0
278
+ ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles['segmented'], role: "group", "aria-label": t('detail.switch.label'), children: [_jsx("button", { type: "button", className: detailMode === 'model' ? `${styles['segBtn']} ${styles['segActive']}` : styles['segBtn'], "aria-pressed": detailMode === 'model', onClick: () => setDetailMode('model'), children: t('byModel.title') }), _jsx("button", { type: "button", className: detailMode === 'session' ? `${styles['segBtn']} ${styles['segActive']}` : styles['segBtn'], "aria-pressed": detailMode === 'session', onClick: () => setDetailMode('session'), children: t('bySession.title') }), _jsx("button", { type: "button", className: detailMode === 'aux' ? `${styles['segBtn']} ${styles['segActive']}` : styles['segBtn'], "aria-pressed": detailMode === 'aux', onClick: () => setDetailMode('aux'), children: t('aux.tab') })] }), detailMode === 'model'
228
279
  ? (_jsx("div", { className: styles['tableWrap'], children: _jsxs("table", { className: styles['table'], "aria-label": t('byModel.title'), children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { className: styles['modelHead'], children: t('filter.model') }), _jsx("th", { "aria-label": t('stat.successFail'), children: _jsx(RequestsSplitHead, { t: t }) }), _jsx("th", { children: t('stat.cost') }), _jsx("th", { children: t('stat.totalTokens') }), _jsx("th", { children: t('stat.input') }), _jsx("th", { children: t('stat.output') }), _jsx("th", { children: t('stat.cacheRead') }), _jsx("th", { children: t('stat.cacheWrite') }), _jsx("th", { children: t('stat.hitRate') })] }) }), _jsx("tbody", { children: state.value.byModel.map(row => {
229
280
  const rules = state.value.pricing[row.model];
230
281
  return (_jsxs("tr", { children: [_jsx("td", { className: styles['modelCol'], children: _jsxs("span", { className: styles['modelCell'], children: [rules !== undefined
@@ -238,11 +289,13 @@ export function TokenUsageSection({ t, close, sessionListed, openSession }) {
238
289
  _jsx("button", { type: "button", className: styles['modelName'], "aria-label": t('pricing.view', { model: row.model }), onClick: () => setDetailModel(row.model), children: row.model }))
239
290
  : (_jsxs(_Fragment, { children: [_jsx("span", { className: styles['modelName'], children: row.model }), _jsx(UnpricedModelTag, { model: row.model, t: t })] })), _jsx(ModelAssociationBadge, { model: row.model, t: t })] }) }), _jsx("td", { children: _jsx(RequestsCell, { requests: row.totals.requests, failures: row.totals.failures ?? 0, failuresByCode: row.totals.failuresByCode, t: t }) }), _jsx("td", { className: styles['costCol'], children: costsAvailable(state.value.costState) && rules !== undefined ? formatCost(row.cost, view) : '—' }), _jsx("td", { children: formatTokens(totalTokens(row.totals)) }), _jsx("td", { className: row.totals.inputTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(row.totals.inputTokens) }), _jsx("td", { className: row.totals.outputTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(row.totals.outputTokens) }), _jsx("td", { className: row.totals.cacheReadTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(row.totals.cacheReadTokens) }), _jsx("td", { className: row.totals.cacheWriteTokens === 0 ? styles['zeroDim'] : undefined, children: formatTokens(row.totals.cacheWriteTokens) }), _jsx("td", { children: _jsx(HitRateText, { totals: row.totals }) })] }, row.model));
240
291
  }) })] }) }))
241
- : ((state.value.sessionRows?.length ?? 0) > 0
242
- ? (_jsx(SessionTable, { rows: state.value.sessionRows ?? [], costState: state.value.costState, view: view, t: t, ...sessionListed !== undefined && openSession !== undefined
243
- ? { sessionListed, openSession: handleOpenSession }
244
- : {} }))
245
- : _jsx("p", { className: styles['muted'], children: t('chart.empty') }))] }))
292
+ : detailMode === 'session'
293
+ ? ((state.value.sessionRows?.length ?? 0) > 0
294
+ ? (_jsx(SessionTable, { rows: state.value.sessionRows ?? [], costState: state.value.costState, view: view, t: t, ...sessionListed !== undefined && openSession !== undefined
295
+ ? { sessionListed, openSession: handleOpenSession }
296
+ : {} }))
297
+ : _jsx("p", { className: styles['muted'], children: t('chart.empty') }))
298
+ : _jsx(AuxOverheadSection, { aux: state.value.aux, costState: state.value.costState, view: view, t: t })] }))
246
299
  : null, detailModel !== null && state.value.pricing[detailModel] !== undefined
247
300
  ? (_jsx(PricingDialog, { model: detailModel, rules: state.value.pricing[detailModel], view: view, onClose: () => setDetailModel(null), t: t }))
248
301
  : null] })), toastText !== null && (_jsx(Toast, { text: toastText, icon: _jsx(IconWarningOutlineRegular, {}), onDone: dismissToast }, toastSeq))] }) }));