dsh-client-ui-cpa-quota 0.7.2 → 0.7.3

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 (2) hide show
  1. package/lib/client.js +10 -0
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1478,6 +1478,16 @@ window.__ModuleLoader__.load({
1478
1478
  * records are dropped. */
1479
1479
  function pollUsageEvents(instance, base, entries) {
1480
1480
  const ledger = usageLedgerFor(base);
1481
+ // One-time migration: ledger events recorded by PRE-0.7.2 builds were
1482
+ // keyed by the auth-file NAME; re-key them to the rendered display
1483
+ // name so the in-use match covers history too. Idempotent.
1484
+ const nameByFile = new Map(entries.map((e) => [text(e.name), accountDisplayName(e)]));
1485
+ let migrated = false;
1486
+ for (const ev of ledger.ev) {
1487
+ const mapped = nameByFile.get(ev.a);
1488
+ if (mapped !== undefined && mapped !== ev.a) { ev.a = mapped; migrated = true; }
1489
+ }
1490
+ if (migrated) persistUsageLedger(base, ledger);
1481
1491
  const fpSet = new Set(ledger.fp);
1482
1492
  const nameByIndex = new Map(entries.map((e) => [String(e.auth_index ?? e.authIndex), accountDisplayName(e)]));
1483
1493
  return fetchJSON(`${instance.base}${USAGE_QUEUE_PATH}`, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-client-ui-cpa-quota",
3
3
  "description": "CliProxyAPI quota indicator: a native-styled ring left of the composer model name; hover shows per-account provider quotas, subscription plans, and status for Codex, Claude, Antigravity, Gemini CLI, Kimi, xAI/Grok, and other CPA auth providers. Targets the current dsh plugin contract (settings-namespace-keyed plugin cards).",
4
- "version": "0.7.2",
4
+ "version": "0.7.3",
5
5
  "author": "wkscc310",
6
6
  "repository": {
7
7
  "type": "git",