@laoyuehanni/dsh-token-usage 0.4.5 → 0.4.7

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 (98) hide show
  1. package/README.md +1 -1
  2. package/README.zh.md +1 -1
  3. package/docs/pricing.md +61 -4
  4. package/lib/client/CostPill.d.ts.map +1 -1
  5. package/lib/client/CostPill.js +18 -13
  6. package/lib/client/CostPill.js.map +1 -1
  7. package/lib/client/PricingAssociations.d.ts +38 -0
  8. package/lib/client/PricingAssociations.d.ts.map +1 -0
  9. package/lib/client/PricingAssociations.js +211 -0
  10. package/lib/client/PricingAssociations.js.map +1 -0
  11. package/lib/client/PricingOverviewDialog.d.ts +2 -13
  12. package/lib/client/PricingOverviewDialog.d.ts.map +1 -1
  13. package/lib/client/PricingOverviewDialog.js +12 -39
  14. package/lib/client/PricingOverviewDialog.js.map +1 -1
  15. package/lib/client/PricingStatus.d.ts +12 -0
  16. package/lib/client/PricingStatus.d.ts.map +1 -0
  17. package/lib/client/PricingStatus.js +13 -0
  18. package/lib/client/PricingStatus.js.map +1 -0
  19. package/lib/client/SessionTable.d.ts +3 -2
  20. package/lib/client/SessionTable.d.ts.map +1 -1
  21. package/lib/client/SessionTable.js +3 -2
  22. package/lib/client/SessionTable.js.map +1 -1
  23. package/lib/client/TokenUsageCard.d.ts.map +1 -1
  24. package/lib/client/TokenUsageCard.js +51 -3
  25. package/lib/client/TokenUsageCard.js.map +1 -1
  26. package/lib/client/TokenUsageSection.d.ts.map +1 -1
  27. package/lib/client/TokenUsageSection.js +45 -48
  28. package/lib/client/TokenUsageSection.js.map +1 -1
  29. package/lib/client/UsageView.d.ts.map +1 -1
  30. package/lib/client/UsageView.js +46 -42
  31. package/lib/client/UsageView.js.map +1 -1
  32. package/lib/client/locales.d.ts +57 -0
  33. package/lib/client/locales.d.ts.map +1 -1
  34. package/lib/client/locales.js +114 -0
  35. package/lib/client/locales.js.map +1 -1
  36. package/lib/client/pricing-associations.d.ts +13 -0
  37. package/lib/client/pricing-associations.d.ts.map +1 -0
  38. package/lib/client/pricing-associations.js +51 -0
  39. package/lib/client/pricing-associations.js.map +1 -0
  40. package/lib/client/pricing-search.d.ts +5 -0
  41. package/lib/client/pricing-search.d.ts.map +1 -0
  42. package/lib/client/pricing-search.js +27 -0
  43. package/lib/client/pricing-search.js.map +1 -0
  44. package/lib/client/use-cost-inflate.d.ts.map +1 -1
  45. package/lib/client/use-cost-inflate.js +6 -1
  46. package/lib/client/use-cost-inflate.js.map +1 -1
  47. package/lib/client.js +1986 -914
  48. package/lib/client.js.map +1 -1
  49. package/lib/index.d.ts.map +1 -1
  50. package/lib/index.js +63 -39
  51. package/lib/index.js.map +1 -1
  52. package/lib/migrate.d.ts +9 -7
  53. package/lib/migrate.d.ts.map +1 -1
  54. package/lib/migrate.js +43 -8
  55. package/lib/migrate.js.map +1 -1
  56. package/lib/model-resolution.d.ts +15 -0
  57. package/lib/model-resolution.d.ts.map +1 -0
  58. package/lib/model-resolution.js +124 -0
  59. package/lib/model-resolution.js.map +1 -0
  60. package/lib/pricing-association-service.d.ts +20 -0
  61. package/lib/pricing-association-service.d.ts.map +1 -0
  62. package/lib/pricing-association-service.js +104 -0
  63. package/lib/pricing-association-service.js.map +1 -0
  64. package/lib/pricing-associations-route.d.ts +6 -0
  65. package/lib/pricing-associations-route.d.ts.map +1 -0
  66. package/lib/pricing-associations-route.js +71 -0
  67. package/lib/pricing-associations-route.js.map +1 -0
  68. package/lib/pricing-associations.d.ts +42 -0
  69. package/lib/pricing-associations.d.ts.map +1 -0
  70. package/lib/pricing-associations.js +133 -0
  71. package/lib/pricing-associations.js.map +1 -0
  72. package/lib/pricing.d.ts +37 -32
  73. package/lib/pricing.d.ts.map +1 -1
  74. package/lib/pricing.js +197 -63
  75. package/lib/pricing.js.map +1 -1
  76. package/lib/record-cache.d.ts +5 -0
  77. package/lib/record-cache.d.ts.map +1 -1
  78. package/lib/record-cache.js +9 -1
  79. package/lib/record-cache.js.map +1 -1
  80. package/lib/rollup.d.ts +10 -5
  81. package/lib/rollup.d.ts.map +1 -1
  82. package/lib/rollup.js +7 -6
  83. package/lib/rollup.js.map +1 -1
  84. package/lib/stats-route.d.ts +4 -1
  85. package/lib/stats-route.d.ts.map +1 -1
  86. package/lib/stats-route.js +65 -21
  87. package/lib/stats-route.js.map +1 -1
  88. package/lib/stats.d.ts +22 -8
  89. package/lib/stats.d.ts.map +1 -1
  90. package/lib/stats.js +138 -41
  91. package/lib/stats.js.map +1 -1
  92. package/lib/wire.d.ts +70 -8
  93. package/lib/wire.d.ts.map +1 -1
  94. package/lib/wire.js +2 -0
  95. package/lib/wire.js.map +1 -1
  96. package/locale/en.json +3 -0
  97. package/locale/zh.json +6 -0
  98. package/package.json +44 -40
package/README.md CHANGED
@@ -35,7 +35,7 @@ Repo: <https://github.com/LaoYueHanNi/dsh-token-usage>
35
35
 
36
36
  ## Model pricing
37
37
 
38
- Costs are billed per record at its own timestamp, and a rates update re-prices the whole history instantly. The single source is a cloud mirror auto-synced on every startup — pricing corrections belong upstream in the [model-price-table](https://github.com/LaoYueHanNi/model-price-table) feed, so every user benefits at once. A hand-edited `pricing.json` is no longer read; if you maintain one it is silently ignored after upgrading (the file is left on disk). Upgrading from 0.4.1 or earlier to 0.4.2 triggers a one-time full rebuild of the usage rollup the first time the stats page is read — the larger the history, the longer it takes; this is expected. Broken mirrors degrade the affected models to unpriced without breaking the stats page. Default location: `~/.dsh/token-usage/`. Billing rule chain, cloud feed format, and self-hosted mirror URLs: [docs/pricing.md](./docs/pricing.md).
38
+ Costs are billed per record at its own timestamp. Identification or pricing-rule changes reselect historical rates from raw records on the next read. Models resolve through full original ID matching, provider-prefix ID matching, then upstream aliasPatterns (deprecated aliases are ignored), all ignoring case while preserving versions and model variants. Unknown or ambiguous names have no inferred price. The single source is a cloud mirror auto-synced on every startup — pricing corrections belong upstream in the [model-price-table](https://github.com/LaoYueHanNi/model-price-table) feed, so every user benefits at once. A hand-edited `pricing.json` is no longer read; if you maintain one it is silently ignored after upgrading (the file is left on disk). Upgrading from 0.4.1 or earlier to 0.4.2 triggers a one-time full rebuild of the usage rollup the first time the stats page is read — the larger the history, the longer it takes; this is expected. An invalid new feed keeps the previous valid mirror. If pricing is unavailable or history cannot be fully repriced, available usage remains visible while unreliable costs are hidden with a reason. Missing entries in a valid feed are warned separately. Unpriced names offer local search, full rule preview and explicit association to an existing cloud model ID. Folded rows retain original sources; Manage model associations also lists inactive or unused choices and supports revocation. Associations preserve upstream billing rules and reprice history. An upstream Issue entry opens a draft for you to complete; it never submits automatically. Default location: `~/.dsh/token-usage/`. Billing rule chain, cloud feed format, and self-hosted mirror URLs: [docs/pricing.md](./docs/pricing.md).
39
39
 
40
40
  ## Configuration
41
41
 
package/README.zh.md CHANGED
@@ -35,7 +35,7 @@
35
35
 
36
36
  ## 模型定价
37
37
 
38
- 每条记录按自身时间戳精确计费,价格更新后全部历史即时重算。定价仅来自启动自动同步的云端镜像——价格修订请去上游 [model-price-table](https://github.com/LaoYueHanNi/model-price-table) 仓库提 PR,全用户受益。手工编辑的 `pricing.json` 升级后不再被读取(文件保留在磁盘上,不会主动删除)。从 0.4.1 或更早版本升级到 0.4.2 后,首次打开统计页会触发一次历史汇总的全量重建——历史越大耗时越久,属一次性预期行为。镜像损坏只影响对应模型(按未定价处理),不影响统计页。默认目录:`~/.dsh/token-usage/`。计费规则链、云端 feed 格式与自建镜像地址:[docs/pricing.md](./docs/pricing.md)。
38
+ 每条记录按自身时间戳精确计费;名称或价格规则变化后,下次读取从原始记录重新选择历史费率。模型按「原名 ID → provider 去前缀 ID → 上游 aliasPatterns 正则(不再读取旧 aliases)」识别,全部忽略大小写,不混淆版本和模型变体;歧义或未命中不猜价格。定价仅来自启动自动同步的云端镜像——价格修订请去上游 [model-price-table](https://github.com/LaoYueHanNi/model-price-table) 仓库提 PR,全用户受益。手工编辑的 `pricing.json` 升级后不再被读取(文件保留在磁盘上,不会主动删除)。从 0.4.1 或更早版本升级到 0.4.2 后,首次打开统计页会触发一次历史汇总的全量重建——历史越大耗时越久,属一次性预期行为。新镜像校验失败保留旧有效镜像;无有效镜像或历史记录不足以完整重算时,保留可用用量、隐藏不可靠费用并显示原因。正常表的未定价模型单独告警。未定价名称可就地搜索已有模型、预览完整规则并明确保存关联;折叠行保留原始来源,管理入口可查看并撤销停用或未使用的关联。关联仅引用云端 ID,完整规则照常生效并重算历史。上游 Issue 入口只打开待补充的草稿,不自动提交。默认目录:`~/.dsh/token-usage/`。计费规则链、云端 feed 格式与自建镜像地址:[docs/pricing.md](./docs/pricing.md)。
39
39
 
40
40
  ## 配置
41
41
 
package/docs/pricing.md CHANGED
@@ -13,7 +13,57 @@ README 的深度延伸:计费规则链、价格文件格式、fork 维护者的
13
13
 
14
14
  - `dailySlots` 可用 `daysOfWeek` 把峰谷限制在 ISO 星期(`1`=周一 … `7`=周日;缺省=每天),按请求的本地日匹配——例如 DeepSeek V4 的周末峰时按峰谷价之外的价格计。
15
15
  - 档位匹配以上下文 token 量近似:本请求 `input + cacheRead + cacheWrite`。
16
- - 定价表更新价格后,全部历史按新价即时重算,无需重建数据。
16
+ - 定价上下文(识别算法、名称或价格规则)变化后,下次读取从原始记录重建冻结汇总并重新选规则;旧汇总缺指纹同样重建。首次读取可能较慢,请求数和 token 不变。源记录不完整时保留可用用量、隐藏无法可靠重算的费用。
17
+
18
+ ## 模型识别
19
+
20
+ 自动匹配分三阶段,全部忽略大小写,只有唯一命中才获得价格:
21
+
22
+ 1. 原始完整名称先匹配全表 `modelId`。
23
+ 2. 各 `/` 路径段均非空时取最后一段,再匹配 `modelId`。前导、尾随、连续 `/` 不生成候选;不修剪空白、不移除版本或 `flash` / `flashx` / `fast` / `mini` 等身份。
24
+ 3. 原名与去前缀候选执行 `aliasPatterns`,模型命中去重,跨模型命中报歧义。
25
+
26
+ `aliasPatterns` 缺省为 `[]`,使用上游无 flags、以 `^` / `$` 锚定的可移植语法(字面量、转义标点、分组、或分支及 `?`);插件加载时校验编译,固定添加 `i`,要求匹配覆盖整个输入,包括拒绝尾部换行。大小写不敏感符合上游约定,provider 前缀兼容仍是插件扩展。旧 `aliases` 字段被忽略,不自动转换成正则;只在旧字段中存在的名称需要上游补正则或保存本地关联。
27
+
28
+ 原名 ID 优先于去前缀 ID,两者优先于正则;任何阶段歧义均停止,不取第一条、不使用 contains。非法正则和忽略大小写后的重复 ID 使整份 feed 校验失败。无命中或歧义显示未定价及候选原因,费用显示 `—`,汇总只包含已识别模型;真实零单价仍已定价。不同 provider 的未识别完整名称保持独立,同一完整名称的大小写变体合并。设置页、会话页、筛选、详情和总览「已用」采用同一识别结果;原始用量记录不改写。
29
+
30
+ 自动识别、手动关联及其操作界面均已实现;未定价位置也可直接打开上游 Issue 请求草稿。
31
+
32
+ 定价总览搜索保留模型 ID 和家族的子串匹配;搜索完整别名时执行 `aliasPatterns`,不搜索正则源码中的片段。总览接口只返回 `aliasPatterns`,同步结果中的 `aliasPatterns` 为正则条数,不是匹配名称数量。
33
+
34
+ ## 本地名称关联
35
+
36
+ 在设置页、会话用量页或费用详情中,点击模型名称旁的橙色「未定价」标签,弹窗提供「关联现有模型」和「增加模型定价」;选择前者进入关联面板:
37
+
38
+ 1. 搜索框初始为空,不预填未定价模型 ID;只在本机定价表的模型 ID 中匹配输入关键词,忽略大小写与输入首尾空格,支持部分 ID。别名、家族及其他字段不参与匹配。空输入(含空格)不展示候选,唯一结果也不自动保存。
39
+ 2. 选择目标,必要时点击「查看定价」核验完整规则,确认模型身份后点击「绑定模型」。成功后自动关闭绑定弹窗。
40
+ 3. 页面沿用当前日期、模型与会话范围刷新。模型名旁的小问号悬停约 100ms 后显示「此模型含手动关联:[原始模型 ID]」,键盘聚焦也可显示;使用普通鼠标指针,多条来源完整列出。查看映射和撤销集中在定价表的「模型别名关联」中。
41
+
42
+ 在「定价表」弹窗标题旁点击「模型别名关联」,可查看当前数据目录的全部保存条目,不受用量或定价搜索筛选影响,空窗口也可打开。每条一行,左侧显示「来源 → 目标」,右侧只有「撤销关联」;不显示逐条状态提示或「查看/修改」入口。自动接管和目标失效不会删除原选择;撤销前会说明全部历史及后续用量的影响。更换映射可先撤销,再从未定价标签重新绑定。保存冲突会显示当前状态,需核对后明确重试;目录切换会清空旧选择并重读候选。操作失败不显示成功,保留搜索与选择。
43
+
44
+ 未定价操作弹窗的「增加模型定价」在新标签页打开 [model-price-table Issue 草稿](https://github.com/LaoYueHanNi/model-price-table/issues/new),关联绑定页不重复此入口。英文标题为 `Add model pricing: {modelId}`,正文提供可选价格参考(币种、四项 token 单价、上下文窗口)、可选官方定价 URL,并自动填充当前定价表版本。请按需补充后自行提交。链接不自动提交、不附带用量、会话内容、API key 或项目路径。
45
+
46
+ 关联仅把尚无唯一自动结果的原始完整名称指向已有云端 `modelId`,不保存价格。来源忽略大小写但不去前缀;`p/internal` 不影响 `q/internal` 或 `internal`。关联目标的时间规则、上下文档位、工作日峰谷和真实零单价都正常生效;保存、修改、撤销会重算全部可恢复的历史及后续用量,原始记录不变。
47
+
48
+ 关联保存在当前数据目录的 `pricing-associations.json`,与价格镜像分离:
49
+
50
+ ```json
51
+ {
52
+ "version": 1,
53
+ "revision": 1,
54
+ "associations": [
55
+ { "sourceModel": "provider/internal-name", "targetModelId": "glm-5.3-flash" }
56
+ ]
57
+ }
58
+ ```
59
+
60
+ 文件缺失是 revision 0 的空表;未知版本、非法字段、重复来源、不可读或损坏文件会保留原内容、禁用人工关联并拒绝写入,页面显示存储故障。自动识别继续可用。目标只接受真实 ID,不接受 alias 或另一条关联。
61
+
62
+ 本机接口 `/token-usage/pricing-associations` 的 GET 返回 `directoryToken`、`revision`、存储/定价状态、可选 `feedVersion` 和全部关联,可用 `?sourceModel=…` 附带单个名称解析;POST 保存需 JSON `{sourceModel,targetModelId,revision,directoryToken}`,DELETE 撤销需 `{sourceModel,revision,directoryToken}`。先读取状态,提交当前修订号和目录标识;409 冲突返回当前状态,不能自动重试覆盖其他修改。所有响应不缓存,写请求上限 64 KiB。
63
+
64
+ 每条关联状态为 `active`(生效)、`automatic-takeover`(自动接管,保留原选择及是否不同)、`target-missing`(目标失效)或 `pricing-unavailable`(无有效镜像)。自动结果优先,不能手动覆盖;自动再次失败时原有效选择会重新生效。目标改名不沿 alias 追踪,但仅改变 ID 大小写仍有效;撤销后可能由自动规则继续定价。
65
+
66
+ 关联文件随数据目录迁移。迁移时暂停写入,源/目标同名内容不同则在复制其他文件前拒绝迁移,保留两边;仅逐字节一致才能清理源文件。损坏文件也按原始字节保护。并发保护限本宿主进程,不提供跨进程文件锁。
17
67
 
18
68
  ## 价格来源:云端镜像
19
69
 
@@ -21,11 +71,11 @@ README 的深度延伸:计费规则链、价格文件格式、fork 维护者的
21
71
  |---|---|---|
22
72
  | `pricing.ccsa.json` | 启动自动拉取 | 云端 model-price-table(cc-switch-analyzer 同源)的本地镜像,每次重启 dsh 自动刷新,失败时沿用旧镜像 |
23
73
 
24
- 只有这一份来源:启动自动同步的云端镜像。文件损坏或非 RMB 时按未定价处理,不影响统计页;保存到磁盘上的旧版 `pricing.json` 升级后会被忽略(只是不再被读取,文件不被主动删除)。默认数据目录:`~/.dsh/token-usage/`(配置了 `path` 时以该目录为准)。
74
+ 只有这一份来源:启动自动同步的云端镜像。无有效镜像时明确显示定价表不可用及原因(未同步、无法读取、JSON 损坏或校验失败),隐藏费用但保留用量;新同步校验失败不会覆盖旧有效镜像。保存到磁盘上的旧版 `pricing.json` 升级后会被忽略(只是不再被读取,文件不被主动删除)。默认数据目录:`~/.dsh/token-usage/`(配置了 `path` 时以该目录为准)。
25
75
 
26
76
  ### 云端 feed 格式
27
77
 
28
- `currency` 须为 `RMB`;`modelId` 与 `aliases` 都会展开为可匹配的键;`timeRules` / `contextTiers` / `dailySlots` 全部参与计费:
78
+ `currency` 须为 `RMB`;仅 `modelId` 和可选 `aliasPatterns` 参与统一识别,旧 `aliases` 不参与;`timeRules` / `contextTiers` / `dailySlots` 全部参与计费:
29
79
 
30
80
  ```json
31
81
  {
@@ -35,7 +85,7 @@ README 的深度延伸:计费规则链、价格文件格式、fork 维护者的
35
85
  "usdExchangeRate": 7,
36
86
  "models": [
37
87
  { "modelId": "deepseek-chat", "inputCostPerMillion": 2, "outputCostPerMillion": 8,
38
- "cacheReadCostPerMillion": 0.5, "cacheCreationCostPerMillion": 1, "aliases": ["deepseek-v3"] }
88
+ "cacheReadCostPerMillion": 0.5, "cacheCreationCostPerMillion": 1, "aliasPatterns": ["^deepseek-v3$"] }
39
89
  ]
40
90
  }
41
91
  ```
@@ -53,6 +103,8 @@ README 的深度延伸:计费规则链、价格文件格式、fork 维护者的
53
103
 
54
104
  自己维护 model-price-table fork 时,用 `pricingUrlDomestic` / `pricingUrlOverseas` 指到你的地址。
55
105
 
106
+ 插件配置页的「定价区域」右侧提供「同步定价表」按钮,可立即重新拉取当前已保存区域的定价表,无需重启。有未保存修改时先保存或放弃;同步期间禁用重复点击,成功显示版本与模型数量并刷新同窗口已打开的用量和定价总览。网络或校验失败保留旧表并提示重试;同步中切换生效区域或数据目录时,旧请求不能覆盖新配置的镜像。
107
+
56
108
  ## 货币展示联动
57
109
 
58
110
  地区切换同时决定统计页的费用展示货币:
@@ -67,3 +119,8 @@ README 的深度延伸:计费规则链、价格文件格式、fork 维护者的
67
119
  - [峰谷 daysOfWeek 语义](./decisions/implemented/2026-08-29-daily-slots-days-of-week.md)
68
120
  - [上下文压缩请求计费](./decisions/implemented/2026-09-02-compaction-billing.md)
69
121
  - [废除手工 pricing.json 定价文件](./decisions/implemented/2026-09-05-abolish-manual-pricing-json.md)
122
+
123
+ - [正则别名统一识别](./decisions/implemented/2026-10-11-regex-only-model-aliases.md)
124
+ - [统一自动识别与历史重算](./decisions/implemented/2026-10-10-model-pricing-resolution.md)
125
+ - [手动关联后端与迁移保护](./decisions/implemented/2026-10-10-model-pricing-associations.md)
126
+ - [局部关联界面与上游草稿](./decisions/implemented/2026-10-10-model-pricing-association-ui.md)
@@ -1 +1 @@
1
- {"version":3,"file":"CostPill.d.ts","sourceRoot":"","sources":["../../src/client/CostPill.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAQjF,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAA;AAe9D;;yDAEyD;AACzD,eAAO,MAAM,sBAAsB,OAAQ,CAAA;AAM3C;;;yDAGyD;AACzD,MAAM,MAAM,aAAa,GACvB,YAAY,CAAC,4BAA4B,CAAC,GACxC,WAAW,CAAC,aAAa,CAAC,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAQ7E;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CA8NtG"}
1
+ {"version":3,"file":"CostPill.d.ts","sourceRoot":"","sources":["../../src/client/CostPill.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAQjF,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAA;AAmB9D;;yDAEyD;AACzD,eAAO,MAAM,sBAAsB,OAAQ,CAAA;AAM3C;;;yDAGyD;AACzD,MAAM,MAAM,aAAa,GACvB,YAAY,CAAC,4BAA4B,CAAC,GACxC,WAAW,CAAC,aAAa,CAAC,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAQ7E;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAmOtG"}
@@ -37,6 +37,9 @@ import { STATS_PATH, encodeStatsQuery } from "../wire.js";
37
37
  import { useAsyncResource, useDebouncedValue } from "./async-resource.js";
38
38
  import { totalTokens } from "./day.js";
39
39
  import { currencyViewOf, formatCost, formatTokens, hitRateDisplay } from "./format.js";
40
+ import { PricingStatus, costsAvailable } from "./PricingStatus.js";
41
+ import { ModelAssociationBadge, PricingAssociationProvider, UnpricedModelTag } from "./PricingAssociations.js";
42
+ import { usePricingAssociationRefresh } from "./pricing-associations.js";
40
43
  import { buildChildIndex, buildStatsFreshnessKey, subtreeIds } from "./session-stats.js";
41
44
  import { useColorSchemeMirror } from "./use-color-scheme.js";
42
45
  import { CostDeltaFlyLabel } from "./CostDeltaFlyLabel.js";
@@ -81,6 +84,8 @@ export function CostPill({ sessionId, useSessions, useProjection, t }) {
81
84
  const costRef = useRef(null);
82
85
  useColorSchemeMirror(rootRef);
83
86
  const [open, setOpen] = useState(false);
87
+ const [associationTick, setAssociationTick] = useState(0);
88
+ usePricingAssociationRefresh(() => setAssociationTick(tick => tick + 1));
84
89
  // Same membership as the Usage tab's "with subagents" scope: the active
85
90
  // session plus every origin=subagent descendant. An ordinary fork is not
86
91
  // a subagent and does not join the fold.
@@ -104,7 +109,7 @@ export function CostPill({ sessionId, useSessions, useProjection, t }) {
104
109
  const [idsPart] = debouncedKey.split('\n\t');
105
110
  const ids = (idsPart ?? '').split('\n').filter(id => id !== '');
106
111
  return fetchSummary(ids, 'chip', signal);
107
- }, [debouncedKey], { silentAfterFirst: true, retryToken: 0 });
112
+ }, [debouncedKey, associationTick], { silentAfterFirst: true, retryToken: 0 });
108
113
  const summary = treeRes.status === 'ready' ? treeRes.value : null;
109
114
  useEffect(() => {
110
115
  if (summary !== null)
@@ -127,12 +132,12 @@ export function CostPill({ sessionId, useSessions, useProjection, t }) {
127
132
  const [idsPart] = debouncedKey.split('\n\t');
128
133
  const ids = (idsPart ?? '').split('\n').filter(id => id !== '');
129
134
  return fetchSummary(ids, 'session', signal);
130
- }, [open, debouncedKey], { silentAfterFirst: true, retryToken: 0 });
135
+ }, [open, debouncedKey, associationTick], { silentAfterFirst: true, retryToken: 0 });
131
136
  const [selfRes] = useAsyncResource(signal => {
132
137
  if (!open || sessionId === '')
133
138
  return Promise.resolve(null);
134
139
  return fetchSummary([sessionId], 'chip', signal);
135
- }, [open, sessionId, debouncedKey], { silentAfterFirst: true, retryToken: 0 });
140
+ }, [open, sessionId, debouncedKey, associationTick], { silentAfterFirst: true, retryToken: 0 });
136
141
  // Session switches close the panel — the split it explains no longer holds.
137
142
  useEffect(() => {
138
143
  setOpen(false);
@@ -183,7 +188,7 @@ export function CostPill({ sessionId, useSessions, useProjection, t }) {
183
188
  if (summary === null || summary.total.requests === 0)
184
189
  return null;
185
190
  const view = currencyViewOf(summary);
186
- const costText = formatCost(summary.totalCost, view);
191
+ const costText = costsAvailable(summary.costState) ? formatCost(summary.totalCost, view) : '—';
187
192
  const tokensValue = formatTokens(totalTokens(summary.total));
188
193
  const hit = hitRateDisplay(summary.total);
189
194
  const ariaLabel = hasSubs
@@ -195,17 +200,17 @@ export function CostPill({ sessionId, useSessions, useProjection, t }) {
195
200
  const detail = detailRes.status === 'ready' ? detailRes.value : null;
196
201
  const split = selfSummary !== null ? splitUsage(summary, selfSummary) : null;
197
202
  const subCount = scopeIds.length - 1;
198
- return (_jsxs("span", { ref: rootRef, className: styles.root, children: [_jsxs("button", { type: "button", className: styles.pill, "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": `${ariaLabel},${t('panel.openHint')}`, onClick: () => { setOpen(!open); }, children: [_jsxs("svg", { className: styles.glyph, viewBox: "0 0 14 14", width: "14", height: "14", "aria-hidden": true, children: [_jsx("circle", { cx: "7", cy: "7", r: "5.5", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }), _jsx("path", { d: "M4.8 4.5 L7 7.2 L9.2 4.5 M7 7.2 V10 M5.2 8 H8.8 M5.2 9.4 H8.8", fill: "none", stroke: "currentColor", strokeWidth: "1.2" })] }), _jsx("span", { ref: costRef, className: styles.cost, children: costText }), _jsx("span", { className: styles.deltaLayer, "aria-hidden": "true", children: flies.map(fly => (_jsx(CostDeltaFlyLabel, { text: fly.text, vars: fly.vars }, fly.id))) })] }), open && (_jsxs("span", { className: styles.panel, role: "dialog", "aria-label": t('panel.title'), style: { left: panelLeft }, children: [_jsxs("span", { className: styles.panelHead, children: [_jsxs("span", { className: styles.panelTitle, children: [t('panel.title'), hasSubs && _jsx("span", { className: styles.scopeTag, children: t('pill.scopeTag') })] }), _jsx("span", { className: styles.panelTotal, children: costText })] }), _jsxs("span", { className: styles.usageLine, children: [_jsx("span", { children: t('panel.tokens', { value: tokensValue }) }), _jsx("span", { className: styles.dot, children: "\u00B7" }), _jsx("span", { children: t('panel.hitRate', { value: hit.text }) })] }), _jsxs("span", { className: styles.rows, children: [_jsxs("span", { className: styles.row, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.self') }), _jsx("span", { className: styles.rowValue, children: split === null
199
- ? _jsx("span", { className: styles.pending, children: "\u2026" })
200
- : _jsxs(_Fragment, { children: [formatCost(split.selfCost, view), _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.selfTokens) }) })] }) })] }), hasSubs && (_jsxs("span", { className: `${styles.row} ${styles.rowSub}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.subs', { count: subCount }) }), _jsx("span", { className: styles.rowValue, children: split === null
201
- ? _jsx("span", { className: styles.pending, children: "\u2026" })
202
- : _jsxs(_Fragment, { children: [formatCost(split.subsCost, view), _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.subsTokens) }) })] }) })] }))] }), _jsx("span", { className: styles.groupLabel, children: t('panel.byModel') }), _jsx("span", { className: styles.rows, children: detail === null
203
- ? (_jsx("span", { className: styles.row, children: _jsx("span", { className: styles.pending, children: "\u2026" }) }))
204
- : (_jsxs(_Fragment, { children: [detail.byModel.map(row => (_jsx(ModelRow, { row: row, view: view }, row.model))), detail.unpricedModels.length > 0 && (_jsxs("span", { className: `${styles.row} ${styles.unpriced}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.unpriced', { count: detail.unpricedModels.length }) }), _jsx("span", { className: styles.rowValue, children: t('panel.unpricedNote') })] }))] })) })] }))] }));
203
+ return (_jsx("div", { ref: rootRef, className: styles.root, children: _jsxs(PricingAssociationProvider, { resolutions: detail?.modelResolutions, feedVersion: summary.feedVersion, view: view, t: t, children: [_jsxs("button", { type: "button", className: styles.pill, "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": `${ariaLabel},${t('panel.openHint')}`, onClick: () => { setOpen(!open); }, children: [_jsxs("svg", { className: styles.glyph, viewBox: "0 0 14 14", width: "14", height: "14", "aria-hidden": true, children: [_jsx("circle", { cx: "7", cy: "7", r: "5.5", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }), _jsx("path", { d: "M4.8 4.5 L7 7.2 L9.2 4.5 M7 7.2 V10 M5.2 8 H8.8 M5.2 9.4 H8.8", fill: "none", stroke: "currentColor", strokeWidth: "1.2" })] }), _jsx("span", { ref: costRef, className: styles.cost, children: costText }), _jsx("span", { className: styles.deltaLayer, "aria-hidden": "true", children: flies.map(fly => (_jsx(CostDeltaFlyLabel, { text: fly.text, vars: fly.vars }, fly.id))) })] }), open && (_jsxs("div", { className: styles.panel, role: "dialog", "aria-label": t('panel.title'), style: { left: panelLeft }, children: [_jsxs("span", { className: styles.panelHead, children: [_jsxs("span", { className: styles.panelTitle, children: [t('panel.title'), hasSubs && _jsx("span", { className: styles.scopeTag, children: t('pill.scopeTag') })] }), _jsx("span", { className: styles.panelTotal, children: costText })] }), _jsxs("span", { className: styles.usageLine, children: [_jsx("span", { children: t('panel.tokens', { value: tokensValue }) }), _jsx("span", { className: styles.dot, children: "\u00B7" }), _jsx("span", { children: t('panel.hitRate', { value: hit.text }) })] }), _jsxs("div", { className: styles.rows, children: [_jsx(PricingStatus, { costState: summary.costState, pricingUnavailableReason: summary.pricingUnavailableReason, associationStorageError: summary.associationStorageError, t: t }), _jsxs("span", { className: styles.row, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.self') }), _jsx("span", { className: styles.rowValue, children: split === null
204
+ ? _jsx("span", { className: styles.pending, children: "\u2026" })
205
+ : _jsxs(_Fragment, { children: [costsAvailable(summary.costState) && costsAvailable(selfSummary?.costState) ? formatCost(split.selfCost, view) : '—', _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.selfTokens) }) })] }) })] }), hasSubs && (_jsxs("span", { className: `${styles.row} ${styles.rowSub}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.subs', { count: subCount }) }), _jsx("span", { className: styles.rowValue, children: split === null
206
+ ? _jsx("span", { className: styles.pending, children: "\u2026" })
207
+ : _jsxs(_Fragment, { children: [costsAvailable(summary.costState) && costsAvailable(selfSummary?.costState) ? formatCost(split.subsCost, view) : '—', _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.subsTokens) }) })] }) })] }))] }), _jsx("span", { className: styles.groupLabel, children: t('panel.byModel') }), _jsx("span", { className: styles.rows, children: detail === null
208
+ ? (_jsx("span", { className: styles.row, children: _jsx("span", { className: styles.pending, children: "\u2026" }) }))
209
+ : (_jsxs(_Fragment, { children: [detail.byModel.map(row => (_jsx(ModelRow, { row: row, view: view, t: t, unpriced: detail.unpricedModels.includes(row.model), available: costsAvailable(detail.costState) && !detail.unpricedModels.includes(row.model) }, row.model))), costsAvailable(detail.costState) && detail.unpricedModels.length > 0 && (_jsxs("span", { className: `${styles.row} ${styles.unpriced}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.unpriced', { count: detail.unpricedModels.length }) }), _jsx("span", { className: styles.rowValue, children: t('panel.unpricedNote') })] }))] })) })] }))] }) }));
205
210
  }
206
211
  /** One per-model breakdown row: model id + request count, billed cost, tokens. */
207
- function ModelRow({ row, view }) {
208
- return (_jsxs("span", { className: styles.row, children: [_jsxs("span", { className: styles.rowLabel, children: [row.model, _jsxs("span", { className: styles.requests, children: ["\u00D7 ", row.totals.requests] })] }), _jsxs("span", { className: styles.rowValue, children: [formatCost(row.cost, view), _jsx("span", { className: styles.tok, children: formatTokens(totalTokens(row.totals)) })] })] }));
212
+ function ModelRow({ row, view, available, unpriced, t }) {
213
+ return (_jsxs("span", { className: styles.row, children: [_jsxs("span", { className: styles.rowLabel, children: [row.model, unpriced && _jsx(UnpricedModelTag, { model: row.model, t: t }), _jsx(ModelAssociationBadge, { model: row.model, t: t }), _jsxs("span", { className: styles.requests, children: ["\u00D7 ", row.totals.requests] })] }), _jsxs("span", { className: styles.rowValue, children: [available ? formatCost(row.cost, view) : '—', _jsx("span", { className: styles.tok, children: formatTokens(totalTokens(row.totals)) })] })] }));
209
214
  }
210
215
  /** Defensive shape check: an older host build or a misrouted response
211
216
  * would otherwise paint the pill with garbage. */
@@ -1 +1 @@
1
- {"version":3,"file":"CostPill.js","sourceRoot":"","sources":["../../src/client/CostPill.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,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AA;IAC5C,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC/E,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots';
3
+ import type { ModelResolution } from '../wire.ts';
4
+ import type { CurrencyView } from './format.ts';
5
+ export declare function PricingAssociationProvider({ resolutions, feedVersion, view, t, children }: {
6
+ resolutions?: readonly ModelResolution[] | undefined;
7
+ feedVersion?: number | undefined;
8
+ view: CurrencyView;
9
+ t: TranslateNS<'token-usage'>;
10
+ children: ReactNode;
11
+ }): ReactNode;
12
+ /** Entry remains available even when the usage filter has no rows. */
13
+ export declare function PricingAssociationManagerButton({ t, onOpen }: {
14
+ t: TranslateNS<'token-usage'>;
15
+ onOpen?: () => void;
16
+ }): ReactNode;
17
+ export declare function PricingIssueLink({ resolution, version, t }: {
18
+ resolution: ModelResolution;
19
+ version?: number | undefined;
20
+ t: TranslateNS<'token-usage'>;
21
+ }): ReactNode;
22
+ export declare function UnpricedModelTag({ model, t }: {
23
+ model: string;
24
+ t: TranslateNS<'token-usage'>;
25
+ }): ReactNode;
26
+ /** Show original associated IDs on hover without expanding the statistics row. */
27
+ export declare function ModelAssociationBadge({ model, t }: {
28
+ model: string;
29
+ t: TranslateNS<'token-usage'>;
30
+ }): ReactNode;
31
+ export declare function PricingAssociationDialog({ initialSource, view, t, onClose, returnFocus }: {
32
+ initialSource: string | null;
33
+ view: CurrencyView;
34
+ t: TranslateNS<'token-usage'>;
35
+ onClose: () => void;
36
+ returnFocus?: HTMLElement | null;
37
+ }): ReactNode;
38
+ //# sourceMappingURL=PricingAssociations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PricingAssociations.d.ts","sourceRoot":"","sources":["../../src/client/PricingAssociations.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE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AAE,MAAM,CAAC;IAAC,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAA;CAAE,GAAG,SAAS,CAgB/G;AAkDD,wBAAgB,wBAAwB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE;IACzF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IACpG,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACjC,GAAG,SAAS,CAiJZ"}
@@ -0,0 +1,211 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useId, useRef, useState } from 'react';
3
+ import { Tooltip } from '@deepseek-ai/dsh-client-ui-primitives';
4
+ import { ASSOCIATIONS_PATH, PRICING_PATH } from "../wire.js";
5
+ import { modelKey } from "../model-resolution.js";
6
+ import { useAsyncResource } from "./async-resource.js";
7
+ import { currencyViewOf } from "./format.js";
8
+ import { PricingDialog } from "./PricingDialog.js";
9
+ import { AssociationRequestError, pricingAssociationsChanged, pricingIssueUrl } from "./pricing-associations.js";
10
+ import shared from './PricingDialog.module.css';
11
+ import styles from './PricingAssociations.module.css';
12
+ const AssociationUiContext = createContext(null);
13
+ export function PricingAssociationProvider({ resolutions = [], feedVersion, view, t, children }) {
14
+ const [source, setSource] = useState(undefined);
15
+ const [unpriced, setUnpriced] = useState(null);
16
+ const opener = useRef(null);
17
+ const rememberOpener = () => { opener.current = document.activeElement instanceof HTMLElement ? document.activeElement : null; };
18
+ return _jsxs(AssociationUiContext.Provider, { value: { open: name => { rememberOpener(); setSource(name ?? null); },
19
+ showUnpriced: resolution => { rememberOpener(); setUnpriced(resolution); }, resolutions,
20
+ ...(feedVersion !== undefined ? { feedVersion } : {}) }, children: [children, unpriced !== null && _jsx(UnpricedModelDialog, { resolution: unpriced, version: feedVersion, t: t, onClose: () => setUnpriced(null), onAssociate: () => { setUnpriced(null); setSource(unpriced.rawName); } }), source !== undefined && _jsx(PricingAssociationDialog, { initialSource: source, returnFocus: opener.current, view: view, t: t, onClose: () => setSource(undefined) })] });
21
+ }
22
+ /** Entry remains available even when the usage filter has no rows. */
23
+ export function PricingAssociationManagerButton({ t, onOpen }) {
24
+ const ui = useContext(AssociationUiContext);
25
+ const open = onOpen ?? (ui === null ? undefined : () => ui.open());
26
+ return open === undefined ? null : _jsx("button", { type: "button", "data-pricing-association-manager": true, className: styles.button, onClick: open, children: t('association.manage') });
27
+ }
28
+ export function PricingIssueLink({ resolution, version, t }) {
29
+ return _jsx("a", { className: styles.link, href: pricingIssueUrl(resolution, version), target: "_blank", rel: "noopener noreferrer", children: t('association.issue') });
30
+ }
31
+ export function UnpricedModelTag({ model, t }) {
32
+ const ui = useContext(AssociationUiContext);
33
+ const resolution = ui?.resolutions.find(row => modelKey(row.rawName) === modelKey(model))
34
+ ?? { rawName: model, status: 'unmatched', strippedPrefix: false, candidates: [] };
35
+ return _jsx("button", { type: "button", className: styles.unpricedTag, "aria-haspopup": "dialog", disabled: ui === null || model === '', onClick: () => ui?.showUnpriced(resolution), children: t('pricing.unpriced') });
36
+ }
37
+ function UnpricedModelDialog({ resolution, version, t, onClose, onAssociate }) {
38
+ const dialogRef = useRef(null);
39
+ const backdropPress = useRef(false);
40
+ const opener = useRef(document.activeElement instanceof HTMLElement ? document.activeElement : null);
41
+ useEffect(() => {
42
+ dialogRef.current?.showModal();
43
+ return () => { if (opener.current?.isConnected)
44
+ opener.current.focus(); };
45
+ }, []);
46
+ const automatic = resolution.automatic ?? resolution;
47
+ return _jsxs("dialog", { ref: dialogRef, className: `${shared.dialog} ${styles.unpricedDialog}`, "aria-label": t('association.unpricedTitle'), onClose: event => { if (event.target === dialogRef.current)
48
+ onClose(); }, onMouseDown: event => { backdropPress.current = event.target === dialogRef.current; }, onClick: event => { if (event.target === dialogRef.current && backdropPress.current)
49
+ dialogRef.current?.close(); }, onKeyDown: event => { if (event.key === 'Escape')
50
+ event.stopPropagation(); }, children: [_jsxs("div", { className: shared.dialogHead, children: [_jsx("h2", { className: shared.dialogTitle, children: t('association.unpricedTitle') }), _jsx("button", { type: "button", className: shared.dialogClose, "aria-label": t('association.close'), onClick: () => dialogRef.current?.close(), children: "\u2715" })] }), _jsx("p", { className: styles.name, children: resolution.rawName }), automatic.status === 'ambiguous' && _jsx("p", { className: styles.note, children: t('pricing.ambiguous', { models: automatic.candidates.join(', ') }) }), _jsxs("div", { className: styles.actions, children: [_jsx("button", { type: "button", className: styles.button, onClick: onAssociate, children: t('association.choose') }), _jsx(PricingIssueLink, { resolution: resolution, version: version, t: t })] })] });
51
+ }
52
+ /** Show original associated IDs on hover without expanding the statistics row. */
53
+ export function ModelAssociationBadge({ model, t }) {
54
+ const ui = useContext(AssociationUiContext);
55
+ if (ui === null || model === '')
56
+ return null;
57
+ const names = ui.resolutions.filter(row => modelKey(row.modelId ?? row.rawName) === modelKey(model));
58
+ const associated = names.filter(row => row.association !== undefined);
59
+ if (associated.length === 0)
60
+ return null;
61
+ const label = t('association.tooltip', { models: associated.map(row => row.rawName).join(', ') });
62
+ return _jsx("span", { className: styles.badgeWrap, children: _jsx(Tooltip, { label: label, side: "top", delayMs: 100, children: _jsx("span", { className: styles.badge, role: "img", "aria-label": label, tabIndex: 0, children: _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor" }), _jsx("path", { d: "M6.5 6a1.5 1.5 0 0 1 3 0c0 1-1.5 1-1.5 2.5", stroke: "currentColor", strokeLinecap: "round" }), _jsx("circle", { cx: "8", cy: "10.5", r: ".7", fill: "currentColor" })] }) }) }) });
63
+ }
64
+ function AssociationStatus({ row, t }) {
65
+ return _jsxs("p", { className: styles.note, children: [t(`association.state.${row.state}`), row.state === 'automatic-takeover' && _jsxs(_Fragment, { children: [' ', t('association.automaticTarget', { model: row.automaticModelId ?? '' }), row.targetDiffers && _jsxs(_Fragment, { children: [' ', t('association.targetDiffers', { model: row.targetModelId })] }), ' ', t('association.reactivate')] })] });
66
+ }
67
+ async function readJson(url, signal) {
68
+ const response = await fetch(url, { signal, cache: 'no-store' });
69
+ if (!response.ok)
70
+ throw new Error(`HTTP ${response.status}`);
71
+ return response.json();
72
+ }
73
+ function checkAssociations(value) {
74
+ if (value === null || typeof value !== 'object' || typeof value.directoryToken !== 'string'
75
+ || !['ready', 'unavailable'].includes(value.storageState) || !Array.isArray(value.associations)
76
+ || typeof value.pricingAvailable !== 'boolean' || typeof value.writesPaused !== 'boolean'
77
+ || (value.storageState === 'ready' && (!Number.isSafeInteger(value.revision) || value.revision < 0))
78
+ || value.associations.some(row => row === null || typeof row.sourceModel !== 'string' || typeof row.targetModelId !== 'string')) {
79
+ throw new Error('unexpected association response');
80
+ }
81
+ return value;
82
+ }
83
+ function checkPricing(value) {
84
+ if (value === null || typeof value !== 'object' || !Array.isArray(value.models)
85
+ || value.models.some(row => row === null || typeof row.modelId !== 'string'
86
+ || !Array.isArray(row.aliasPatterns) || !row.aliasPatterns.every((pattern) => typeof pattern === 'string') || row.rules?.base === undefined)) {
87
+ throw new Error('unexpected pricing response');
88
+ }
89
+ return value;
90
+ }
91
+ function requestMessage(error, t) {
92
+ if (!(error instanceof AssociationRequestError))
93
+ return t('association.writeFailed');
94
+ switch (error.code) {
95
+ case 'revision-conflict':
96
+ case 'directory-conflict': return t('association.conflict');
97
+ case 'migration-in-progress': return t('association.migrating');
98
+ case 'source-automatically-priced': return t('association.automaticOnly');
99
+ case 'target-unavailable': return t('association.targetUnavailable');
100
+ case 'pricing-unavailable': return t('pricing.unavailable');
101
+ case 'association-storage-unavailable': return t('pricing.associationStorageUnavailable');
102
+ default: return t('association.writeFailed');
103
+ }
104
+ }
105
+ export function PricingAssociationDialog({ initialSource, view, t, onClose, returnFocus }) {
106
+ const dialogRef = useRef(null);
107
+ const searchId = useId();
108
+ const backdropPress = useRef(false);
109
+ const mounted = useRef(true);
110
+ const writing = useRef(false);
111
+ const opener = useRef(returnFocus ?? (document.activeElement instanceof HTMLElement ? document.activeElement : null));
112
+ const source = initialSource;
113
+ const [query, setQuery] = useState('');
114
+ const [target, setTarget] = useState(null);
115
+ const [detail, setDetail] = useState(null);
116
+ const [pending, setPending] = useState(false);
117
+ const [error, setError] = useState(null);
118
+ const [notice, setNotice] = useState(null);
119
+ const [confirmRevoke, setConfirmRevoke] = useState(null);
120
+ const [override, setOverride] = useState(null);
121
+ const [state, retry] = useAsyncResource(async (signal) => {
122
+ const [associations, pricing] = await Promise.all([
123
+ readJson(ASSOCIATIONS_PATH + (source !== null ? `?sourceModel=${encodeURIComponent(source)}` : ''), signal).then(checkAssociations),
124
+ readJson(PRICING_PATH, signal).then(checkPricing).catch(() => null),
125
+ ]);
126
+ return { associations, pricing, source };
127
+ }, [source], { retryToken: 0 });
128
+ useEffect(() => {
129
+ const dialog = dialogRef.current;
130
+ dialog?.showModal();
131
+ const parent = dialog?.parentElement;
132
+ mounted.current = true;
133
+ return () => {
134
+ mounted.current = false;
135
+ if (opener.current?.isConnected)
136
+ opener.current.focus();
137
+ else
138
+ (parent?.querySelector('[data-pricing-association-manager]')
139
+ ?? parent?.querySelector('[data-pricing-overview-trigger]')
140
+ ?? parent?.querySelector('button'))?.focus();
141
+ };
142
+ }, []);
143
+ const ready = state.status === 'ready' && state.value.source === source;
144
+ const snapshot = override ?? (ready ? state.value.associations : null);
145
+ const models = ready ? state.value.pricing?.models ?? [] : [];
146
+ const candidateView = ready && state.value.pricing !== null ? currencyViewOf(state.value.pricing) : view;
147
+ const selected = models.find(model => modelKey(model.modelId) === modelKey(target ?? ''));
148
+ const currentChoice = snapshot?.associations.find(row => modelKey(row.sourceModel) === modelKey(source ?? ''));
149
+ const savedTarget = models.find(model => modelKey(model.modelId) === modelKey(currentChoice?.targetModelId ?? ''));
150
+ const automatic = snapshot?.resolution?.automatic ?? snapshot?.resolution;
151
+ const writable = ready && snapshot?.storageState === 'ready' && !snapshot.writesPaused && !pending;
152
+ const canSave = writable && snapshot?.pricingAvailable && ready && state.value.pricing !== null && state.value.pricing.costState !== 'pricing-unavailable'
153
+ && automatic !== undefined && automatic.status !== 'matched' && selected !== undefined && source !== null;
154
+ const searchModelId = modelKey(query.trim());
155
+ const candidates = searchModelId === '' ? [] : models.filter(model => modelKey(model.modelId).includes(searchModelId));
156
+ const reload = () => { setOverride(null); setError(null); retry(); };
157
+ const mutate = async (operation, name) => {
158
+ if (writing.current || snapshot === null || snapshot.revision === null)
159
+ return;
160
+ writing.current = true;
161
+ setPending(true);
162
+ setError(null);
163
+ setNotice(null);
164
+ try {
165
+ const response = await fetch(ASSOCIATIONS_PATH, { method: operation === 'save' ? 'POST' : 'DELETE', cache: 'no-store',
166
+ headers: { 'content-type': 'application/json' }, body: JSON.stringify({ sourceModel: name,
167
+ ...(operation === 'save' ? { targetModelId: selected?.modelId } : {}), revision: snapshot.revision, directoryToken: snapshot.directoryToken }) });
168
+ const result = await response.json();
169
+ if (!response.ok)
170
+ throw new AssociationRequestError(result.error ?? 'write-failed', result.current);
171
+ checkAssociations(result);
172
+ pricingAssociationsChanged();
173
+ if (!mounted.current)
174
+ return;
175
+ if (operation === 'save') {
176
+ dialogRef.current?.close();
177
+ return;
178
+ }
179
+ setOverride(result);
180
+ setConfirmRevoke(null);
181
+ setNotice(t('association.revoked'));
182
+ }
183
+ catch (failure) {
184
+ if (!mounted.current)
185
+ return;
186
+ if (failure instanceof AssociationRequestError && failure.current !== undefined) {
187
+ setOverride(failure.current);
188
+ if (failure.code === 'directory-conflict') {
189
+ setTarget(null);
190
+ setDetail(null);
191
+ setOverride(null);
192
+ retry();
193
+ pricingAssociationsChanged();
194
+ }
195
+ }
196
+ setError(requestMessage(failure, t));
197
+ }
198
+ finally {
199
+ writing.current = false;
200
+ if (mounted.current)
201
+ setPending(false);
202
+ }
203
+ };
204
+ const revokeButtons = (name) => _jsx(_Fragment, { children: confirmRevoke === name ? _jsxs("span", { className: `${styles.actions} ${styles.revokeConfirmation}`, children: [_jsx("span", { className: styles.note, children: t('association.revokeImpact') }), _jsx("button", { type: "button", className: styles.button, disabled: !writable, onClick: () => { void mutate('delete', name); }, children: t('association.confirmRevoke') }), _jsx("button", { type: "button", className: styles.button, disabled: pending, onClick: () => setConfirmRevoke(null), children: t('association.cancel') })] }) : _jsx("button", { type: "button", className: styles.button, disabled: !writable, onClick: () => setConfirmRevoke(name), children: t('association.revoke') }) });
205
+ return _jsxs("dialog", { ref: dialogRef, className: `${shared.dialog} ${styles.dialog}`, "aria-label": t('association.title'), onClose: event => { if (event.target === dialogRef.current)
206
+ onClose(); }, onCancel: event => { if (event.target === dialogRef.current && writing.current)
207
+ event.preventDefault(); }, onMouseDown: event => { backdropPress.current = event.target === dialogRef.current; }, onClick: event => { if (event.target === dialogRef.current && backdropPress.current && !writing.current)
208
+ dialogRef.current?.close(); }, onKeyDown: event => { if (event.key === 'Escape')
209
+ event.stopPropagation(); }, children: [_jsxs("div", { className: shared.dialogHead, children: [_jsx("h2", { className: shared.dialogTitle, children: t('association.title') }), _jsx("button", { type: "button", className: shared.dialogClose, "aria-label": t('association.close'), disabled: pending, onClick: () => dialogRef.current?.close(), children: "\u2715" })] }), state.status === 'loading' && _jsx("p", { children: t('loading') }), state.status === 'error' && _jsxs(_Fragment, { children: [_jsx("p", { role: "alert", children: t('association.loadFailed') }), _jsx("button", { type: "button", className: styles.button, onClick: reload, children: t('retry') })] }), source !== null && ready && state.value.pricing === null && _jsxs(_Fragment, { children: [_jsx("p", { role: "alert", children: t('association.candidatesUnavailable') }), _jsx("button", { type: "button", className: styles.button, disabled: pending, onClick: reload, children: t('retry') })] }), error !== null && _jsxs("p", { role: "alert", className: styles.error, children: [error, " ", _jsx("button", { type: "button", className: styles.button, disabled: pending, onClick: reload, children: t('association.refresh') })] }), notice !== null && _jsx("p", { role: "status", children: notice }), snapshot !== null && _jsxs(_Fragment, { children: [snapshot.storageState !== 'ready' && _jsx("p", { role: "alert", children: t('pricing.associationStorageUnavailable') }), snapshot.writesPaused && _jsx("p", { role: "status", children: t('association.migrating') }), !snapshot.pricingAvailable && _jsx("p", { role: "status", children: t('pricing.unavailable') }), source === null ? _jsxs(_Fragment, { children: [_jsx("p", { className: styles.note, children: t('association.allHint') }), snapshot.associations.length === 0 && _jsx("p", { className: styles.note, children: t('association.empty') }), snapshot.associations.map(row => _jsxs("section", { className: `${styles.entry} ${styles.mappingRow}`, children: [_jsxs("div", { className: styles.name, children: [row.sourceModel, " \u2192 ", row.resolvedTargetModelId ?? row.targetModelId] }), revokeButtons(row.sourceModel)] }, modelKey(row.sourceModel)))] }) : _jsxs(_Fragment, { children: [_jsx("p", { className: `${styles.name} ${styles.source}`, children: source }), automatic?.status === 'ambiguous' && _jsx("p", { children: t('pricing.ambiguous', { models: automatic.candidates.join(', ') }) }), currentChoice !== undefined && _jsxs("section", { className: styles.entry, children: [_jsxs("div", { className: styles.name, children: [source, " \u2192 ", currentChoice.resolvedTargetModelId ?? currentChoice.targetModelId] }), _jsx(AssociationStatus, { row: currentChoice, t: t }), savedTarget !== undefined && _jsx("button", { type: "button", className: styles.button, onClick: () => setDetail(savedTarget), children: t('association.preview') }), revokeButtons(source)] }), automatic?.status === 'matched' ? _jsxs("p", { children: [t('association.automaticOnly'), " ", automatic.modelId] }) : _jsxs(_Fragment, { children: [_jsx("label", { className: styles.label, htmlFor: searchId, children: t('association.search') }), _jsx("input", { id: searchId, className: styles.search, type: "search", placeholder: t('association.searchHint'), value: query, disabled: pending, onChange: event => { setQuery(event.target.value); setTarget(null); } }), candidates.length > 0 && _jsx("div", { className: styles.candidates, role: "group", "aria-label": t('association.candidates'), children: candidates.map(model => _jsxs("label", { className: styles.candidate, children: [_jsx("input", { type: "radio", name: searchId + '-target', checked: target !== null && modelKey(target) === modelKey(model.modelId), disabled: !writable || !snapshot.pricingAvailable, onChange: () => { setTarget(model.modelId); setNotice(null); } }), _jsx("span", { children: model.modelId }), _jsx("small", { children: model.family })] }, model.modelId)) }), query.trim() !== '' && candidates.length === 0 && _jsx("p", { className: styles.note, children: t('association.noResults') }), selected !== undefined && _jsxs("div", { className: styles.selection, children: [_jsx("span", { className: styles.name, children: t('association.target', { model: selected.modelId }) }), _jsx("button", { type: "button", className: styles.button, onClick: () => setDetail(selected), children: t('association.preview') })] }), _jsx("p", { className: styles.note, children: t('association.impact') }), _jsx("button", { type: "button", className: `${styles.button} ${styles.save}`, disabled: !canSave, onClick: () => { void mutate('save', source); }, children: t(pending ? 'association.saving' : 'association.save') })] })] })] }), detail !== null && _jsx(PricingDialog, { model: detail.modelId, rules: detail.rules, view: candidateView, t: t, onClose: () => setDetail(null) })] });
210
+ }
211
+ //# sourceMappingURL=PricingAssociations.js.map