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

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 +9 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -1479,7 +1479,7 @@ window.__ModuleLoader__.load({
1479
1479
  function pollUsageEvents(instance, base, entries) {
1480
1480
  const ledger = usageLedgerFor(base);
1481
1481
  const fpSet = new Set(ledger.fp);
1482
- const nameByIndex = new Map(entries.map((e) => [String(e.auth_index ?? e.authIndex), text(e.name)]));
1482
+ const nameByIndex = new Map(entries.map((e) => [String(e.auth_index ?? e.authIndex), accountDisplayName(e)]));
1483
1483
  return fetchJSON(`${instance.base}${USAGE_QUEUE_PATH}`, {
1484
1484
  headers: { Authorization: `Bearer ${instance.managementKey}` },
1485
1485
  }).then((records) => {
@@ -1633,12 +1633,19 @@ window.__ModuleLoader__.load({
1633
1633
  }
1634
1634
  //#endregion
1635
1635
 
1636
+ /** The display name for one auth-file entry — MUST stay in sync with
1637
+ * the ledger's name resolution (pollUsageEvents attributes queue
1638
+ * records to the same name the UI renders). */
1639
+ function accountDisplayName(entry) {
1640
+ return firstText(entry.label, entry.email, entry.account_email, entry.name, entry.id, firstText(entry.auth_index, entry.authIndex), "unknown");
1641
+ }
1642
+
1636
1643
  async function queryAccount(instance, entry) {
1637
1644
  const provider = normalizeProvider(firstText(entry.provider, entry.type));
1638
1645
  const authIndex = firstText(entry.auth_index, entry.authIndex);
1639
1646
  const planKey = authIndex === "" ? "" : `${baseKey(instance.baseURL)}\u0000${authIndex}`;
1640
1647
  const account = {
1641
- name: firstText(entry.label, entry.email, entry.account_email, entry.name, entry.id, authIndex, "unknown"),
1648
+ name: accountDisplayName(entry),
1642
1649
  provider,
1643
1650
  authIndex,
1644
1651
  modelList: null,
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.0",
4
+ "version": "0.7.2",
5
5
  "author": "wkscc310",
6
6
  "repository": {
7
7
  "type": "git",