@songsid/agend 2.4.0-beta.15 → 2.4.0-beta.16

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 (158) hide show
  1. package/dist/accounts-profiles.d.ts +1 -1
  2. package/dist/accounts-view.d.ts +3 -0
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/auth-api.js +4 -0
  5. package/dist/auth-api.js.map +1 -1
  6. package/dist/backend/claude-code.d.ts +6 -1
  7. package/dist/backend/claude-code.js +63 -8
  8. package/dist/backend/claude-code.js.map +1 -1
  9. package/dist/backend/kiro.js +6 -1
  10. package/dist/backend/kiro.js.map +1 -1
  11. package/dist/backend/types.d.ts +2 -0
  12. package/dist/backend/types.js.map +1 -1
  13. package/dist/backend-command.d.ts +4 -2
  14. package/dist/backend-command.js +3 -0
  15. package/dist/backend-command.js.map +1 -1
  16. package/dist/browser-backend-signins.d.ts +1 -0
  17. package/dist/browser-backend-signins.js +3 -1
  18. package/dist/browser-backend-signins.js.map +1 -1
  19. package/dist/build-provenance.json +1 -1
  20. package/dist/classic-channel-manager.d.ts +1 -0
  21. package/dist/classic-channel-manager.js +4 -1
  22. package/dist/classic-channel-manager.js.map +1 -1
  23. package/dist/claude-credential-change.d.ts +22 -0
  24. package/dist/claude-credential-change.js +47 -0
  25. package/dist/claude-credential-change.js.map +1 -0
  26. package/dist/claude-credential-launch.d.ts +62 -0
  27. package/dist/claude-credential-launch.js +304 -0
  28. package/dist/claude-credential-launch.js.map +1 -0
  29. package/dist/claude-credential-runner.d.ts +1 -0
  30. package/dist/claude-credential-runner.js +56 -0
  31. package/dist/claude-credential-runner.js.map +1 -0
  32. package/dist/claude-credential-vault.d.ts +51 -0
  33. package/dist/claude-credential-vault.js +252 -0
  34. package/dist/claude-credential-vault.js.map +1 -0
  35. package/dist/claude-setup-token-transport.d.ts +9 -0
  36. package/dist/claude-setup-token-transport.js +82 -0
  37. package/dist/claude-setup-token-transport.js.map +1 -0
  38. package/dist/claude-setup-token.d.ts +51 -0
  39. package/dist/claude-setup-token.js +83 -0
  40. package/dist/claude-setup-token.js.map +1 -0
  41. package/dist/cli-audited.js +7 -6
  42. package/dist/cli-audited.js.map +1 -1
  43. package/dist/command-report.d.ts +11 -0
  44. package/dist/command-report.js +2 -0
  45. package/dist/command-report.js.map +1 -0
  46. package/dist/config-validator.js +9 -0
  47. package/dist/config-validator.js.map +1 -1
  48. package/dist/config.js +4 -2
  49. package/dist/config.js.map +1 -1
  50. package/dist/daemon.d.ts +5 -0
  51. package/dist/daemon.js +59 -3
  52. package/dist/daemon.js.map +1 -1
  53. package/dist/fleet-level-config.d.ts +1 -1
  54. package/dist/fleet-level-config.js +1 -0
  55. package/dist/fleet-level-config.js.map +1 -1
  56. package/dist/fleet-manager.d.ts +39 -2
  57. package/dist/fleet-manager.js +383 -19
  58. package/dist/fleet-manager.js.map +1 -1
  59. package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -1
  60. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +18 -5
  61. package/dist/host-monitoring-config.d.ts +14 -0
  62. package/dist/host-monitoring-config.js +31 -0
  63. package/dist/host-monitoring-config.js.map +1 -0
  64. package/dist/hub/group-policy/resources.d.ts +1 -1
  65. package/dist/instance-config-impact.js +1 -1
  66. package/dist/instance-config-impact.js.map +1 -1
  67. package/dist/instructions.js +1 -0
  68. package/dist/instructions.js.map +1 -1
  69. package/dist/locale.d.ts +2 -0
  70. package/dist/locale.js +13 -1
  71. package/dist/locale.js.map +1 -1
  72. package/dist/office-share-page.js +1 -1
  73. package/dist/office-share-page.js.map +1 -1
  74. package/dist/profile-signins.d.ts +1 -0
  75. package/dist/profile-signins.js +3 -1
  76. package/dist/profile-signins.js.map +1 -1
  77. package/dist/public-web-gateway.js +2 -0
  78. package/dist/public-web-gateway.js.map +1 -1
  79. package/dist/public-web-link.d.ts +21 -2
  80. package/dist/public-web-link.js +22 -2
  81. package/dist/public-web-link.js.map +1 -1
  82. package/dist/settings-api.d.ts +12 -0
  83. package/dist/settings-api.js +146 -7
  84. package/dist/settings-api.js.map +1 -1
  85. package/dist/settings-change.js +2 -0
  86. package/dist/settings-change.js.map +1 -1
  87. package/dist/settings-effect.js +13 -1
  88. package/dist/settings-effect.js.map +1 -1
  89. package/dist/topic-commands.d.ts +7 -1
  90. package/dist/topic-commands.js +98 -88
  91. package/dist/topic-commands.js.map +1 -1
  92. package/dist/types.d.ts +2 -0
  93. package/dist/ui/accounts-view.js +12 -6
  94. package/dist/ui/backend-signin.js +3 -1
  95. package/dist/ui/chat-commands.js +2 -0
  96. package/dist/ui/chat-popout-transport.js +49 -19
  97. package/dist/ui/chat-popout.js +15 -1
  98. package/dist/ui/chat-store.js +1 -1
  99. package/dist/ui/claude-credentials.js +112 -0
  100. package/dist/ui/claude-setup-token.js +36 -0
  101. package/dist/ui/contact-auth-client.js +7 -2
  102. package/dist/ui/contact-auth-strings.js +45 -14
  103. package/dist/ui/contact-authorizations.js +47 -26
  104. package/dist/ui/contact-needs.js +4 -4
  105. package/dist/ui/fleet-canvas.js +3 -2
  106. package/dist/ui/fleet-office-card.js +414 -41
  107. package/dist/ui/fleet-office-dialogue.js +3 -3
  108. package/dist/ui/fleet-office-pack.d.ts +67 -1
  109. package/dist/ui/fleet-office-pack.js +412 -18
  110. package/dist/ui/fleet-office-play.js +262 -3
  111. package/dist/ui/fleet-office-skin.js +67 -20
  112. package/dist/ui/fleet-office-zones.js +19 -1
  113. package/dist/ui/fleet-office.js +393 -47
  114. package/dist/ui/office-share-page.js +5 -1
  115. package/dist/ui/panel-chat.js +47 -3
  116. package/dist/ui/panel-fleet.js +1 -1
  117. package/dist/ui/panel-settings.js +2 -1
  118. package/dist/ui/preview-popout.js +134 -0
  119. package/dist/ui/reply-file-preview.js +1 -1
  120. package/dist/ui/settings-host-monitoring.js +51 -0
  121. package/dist/ui/settings-shared.js +3 -2
  122. package/dist/ui/shared/app.css +211 -27
  123. package/dist/ui/shared/app.js +7 -1
  124. package/dist/ui/shared/chat-strings.js +8 -2
  125. package/dist/ui/shared/info-tip.js +64 -0
  126. package/dist/ui/shared/office-dialogue.css +12 -0
  127. package/dist/ui/shared/preview-panel.js +44 -18
  128. package/dist/ui/shared/preview-popout.css +11 -0
  129. package/dist/ui/shared/theme.js +11 -1
  130. package/dist/ui/shared/usage-dialog.js +9 -34
  131. package/dist/ui/shared/view-strings.js +2 -0
  132. package/dist/usage/i18n-keys.d.ts +1 -1
  133. package/dist/usage/i18n-keys.js +1 -1
  134. package/dist/usage/i18n-keys.js.map +1 -1
  135. package/dist/usage/providers.d.ts +1 -0
  136. package/dist/usage/providers.js +14 -1
  137. package/dist/usage/providers.js.map +1 -1
  138. package/dist/usage/usage-api.js +5 -2
  139. package/dist/usage/usage-api.js.map +1 -1
  140. package/dist/web-api.d.ts +4 -1
  141. package/dist/web-api.js +29 -9
  142. package/dist/web-api.js.map +1 -1
  143. package/dist/web-claude-credentials.d.ts +31 -0
  144. package/dist/web-claude-credentials.js +138 -0
  145. package/dist/web-claude-credentials.js.map +1 -0
  146. package/dist/web-commands.d.ts +5 -2
  147. package/dist/web-commands.js +4 -2
  148. package/dist/web-commands.js.map +1 -1
  149. package/dist/web-office-skins.d.ts +7 -2
  150. package/dist/web-office-skins.js +42 -16
  151. package/dist/web-office-skins.js.map +1 -1
  152. package/dist/web-session.d.ts +20 -1
  153. package/dist/web-session.js +27 -0
  154. package/dist/web-session.js.map +1 -1
  155. package/dist/web-terminal.d.ts +4 -0
  156. package/dist/web-terminal.js +16 -1
  157. package/dist/web-terminal.js.map +1 -1
  158. package/package.json +1 -1
@@ -14,6 +14,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
14
14
  import { t } from "/assets/app-i18n.js";
15
15
  import { Icon } from "/assets/ui-icons.js";
16
16
  import { Skeleton } from "/assets/ui-states.js";
17
+ import { Dialog } from "/assets/ui-dialog.js";
17
18
  import "/assets/chat-render.js";
18
19
  import "/assets/preview.js";
19
20
  import { loadHtmlAttachment } from "/assets/html-attachment.js";
@@ -24,6 +25,31 @@ import { pagesOf, pageIdOf } from "./preview-pages.js";
24
25
  import { drawMarkdown, TEXT_CARD_MAX } from "/assets/chat-thread.js";
25
26
  import "/assets/chat-md-strings.js"; // M-2448: the Markdown panel's own words (an older cached chat-strings.js lacks them)
26
27
 
28
+ /** Secondary phone controls use the app's focus-trapped options sheet, keeping the toolbar one row. */
29
+ function PreviewToolbar({ owner, versions, views, width, reload, run, fullscreen, actions }) {
30
+ const query = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
31
+ const [narrow, setNarrow] = useState(() => !!globalThis.matchMedia?.(query).matches);
32
+ const [more, setMore] = useState(false);
33
+ useEffect(() => {
34
+ const media = globalThis.matchMedia?.(query);
35
+ const changed = () => { setNarrow(!!media?.matches); setMore(false); };
36
+ media?.addEventListener?.("change", changed);
37
+ return () => media?.removeEventListener?.("change", changed);
38
+ }, []);
39
+ useEffect(() => { setMore(false); }, [owner]);
40
+ return html`<div class="pv-panel-bar">
41
+ ${narrow ? html`${views}${run}${fullscreen}
42
+ <button type="button" class="icon-btn pv-toolbar-more" title=${t("chat.pvMenu")} aria-label=${t("chat.pvMenu")}
43
+ aria-haspopup="dialog" aria-expanded=${more ? "true" : "false"} onClick=${() => setMore(true)}><${Icon} name="more" size=${18} /></button>
44
+ ${more ? html`<div class="pv-toolbar-dialog" onKeyDown=${e => e.stopPropagation()}>
45
+ <${Dialog} title=${t("chat.pvMenu")} onClose=${() => setMore(false)}>
46
+ ${versions}${width ? html`<label class="field"><span>${t("chat.pvWidth")}</span>${width}</label>` : null}
47
+ ${reload}${actions}
48
+ </${Dialog}>
49
+ </div>` : null}` : html`${versions}${views}<span class="grow"></span>${width}${reload}${run}${fullscreen}${actions}`}
50
+ </div>`;
51
+ }
52
+
27
53
  export { htmlTitle };
28
54
 
29
55
  const R = () => globalThis.AgendChatRender;
@@ -38,6 +64,7 @@ const P = () => globalThis.AgendPreview;
38
64
  let state = { open: null, run: 0 };
39
65
  let runs = 0, version = 0, claims = 0;
40
66
  const subs = new Set();
67
+ export const previewHostReady = name => hosts.has(name);
41
68
  const hosts = new Map(); // instance → mounted host token; an older cleanup cannot close its successor
42
69
 
43
70
  function set(next) { state = next; version++; for (const fn of [...subs]) { try { fn(state); } catch { /* one listener's error stops no other */ } } }
@@ -181,7 +208,7 @@ const timeOf = (ts) => (ts ? chatTime(ts, { yesterday: (hm) => t("chat.yesterday
181
208
  * reveal(msgKey) (the thread shows that message), download(code).
182
209
  */
183
210
  /** allow(commit): this device's opt-in through the chat's one path (setPreviewOptIn: the confirm, then commit(setOptIn)) → the choice. */
184
- export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, download, allow }) {
211
+ export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, download, allow, popout }) {
185
212
  const [st, setSt] = useState(state);
186
213
  const [view, setView] = useState("preview");
187
214
  const [run, setRun] = useState({ state: "idle", reason: "" });
@@ -470,31 +497,30 @@ export function PreviewPanel({ name, split, msgs, subscribe, keyOf, reveal, down
470
497
  <button type="button" class="pv-source" title=${source} onClick=${() => { if (window.matchMedia && window.matchMedia("(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)").matches) closePanel(); reveal(open.msgKey); }}>${source}</button></div>
471
498
  ${pages.length > 1 ? html`<button type="button" class=${`btn btn-sm pv-pages-toggle${listing ? " on" : ""}`} aria-pressed=${listing ? "true" : "false"} title=${t("chat.pvPagesTitle")}
472
499
  onClick=${() => setListing(v => !v)}><${Icon} name="file" size=${14} />${t("chat.pvPagesCount", pages.length)}</button>` : null}
500
+ ${typeof popout === "function" ? html`<button type="button" class="icon-btn pv-panel-popout" aria-label=${t("chat.pvPopout")} title=${t("chat.pvPopout")} onClick=${() => popout(open)}><${Icon} name="external" size=${18} /></button>` : null}
473
501
  <button type="button" class="icon-btn only-wide pv-panel-close" title=${t("chat.pvClose")} aria-label=${t("chat.pvClose")} onClick=${closePanel}><${Icon} name="close" size=${18} /></button>
474
502
  </div>
475
- <div class="pv-panel-bar">
476
- ${vers.list.length > 1 && vers.index >= 0 ? html`<div class="pv-ver" role="group" aria-label=${t("chat.pvVersions")}>
503
+ <${PreviewToolbar} owner=${open.key}
504
+ versions=${html`${vers.list.length > 1 && vers.index >= 0 ? html`<div class="pv-ver" role="group" aria-label=${t("chat.pvVersions")}>
477
505
  <button type="button" class="icon-btn pv-ver-prev" title=${t("chat.pvVerPrev")} aria-label=${t("chat.pvVerPrev")} disabled=${vers.index === 0} onClick=${() => step(-1)}><${Icon} name="prev" size=${16} /></button>
478
506
  <span class="pv-ver-at" aria-live="polite" title=${t("chat.pvVerLong", vers.index + 1, vers.list.length)} aria-label=${t("chat.pvVerLong", vers.index + 1, vers.list.length)}>${t("chat.pvVer", vers.index + 1, vers.list.length)}</span>
479
507
  <button type="button" class="icon-btn pv-ver-next" title=${t("chat.pvVerNext")} aria-label=${t("chat.pvVerNext")} disabled=${vers.index === vers.list.length - 1} onClick=${() => step(1)}><${Icon} name="next" size=${16} /></button>
480
- </div>` : null}
481
- <div class="seg-inline" role="group" aria-label=${t("chat.pvPanel")}>
508
+ </div>` : null}`}
509
+ views=${html`<div class="seg-inline" role="group" aria-label=${t("chat.pvPanel")}>
482
510
  <button type="button" class=${`btn btn-sm${shown === "preview" ? " on" : ""}`} aria-pressed=${shown === "preview" ? "true" : "false"} title=${t("chat.pvPage")} onClick=${() => pickView("preview")}><${Icon} name="eye" size=${14} /><span class="lbl">${t("chat.pvPage")}</span></button>
483
511
  <button type="button" class=${`btn btn-sm${shown === "code" ? " on" : ""}`} aria-pressed=${shown === "code" ? "true" : "false"} title=${t("chat.pvCode")} onClick=${() => pickView("code")}><${Icon} name="code" size=${14} /><span class="lbl">${t("chat.pvCode")}</span></button>
484
512
  ${prev ? html`<button type="button" class=${`btn btn-sm pv-changes${shown === "changes" ? " on" : ""}`} aria-pressed=${shown === "changes" ? "true" : "false"} title=${t("chat.pvChanges")} onClick=${() => pickView("changes")}><${Icon} name="diff" size=${14} /><span class="lbl">${t("chat.pvChanges")}</span></button>` : null}
485
- </div>
486
- <span class="grow"></span>
487
- ${shown === "preview" ? html`<select class="pv-width" aria-label=${t("chat.pvWidth")} title=${t("chat.pvWidth")} value=${device} onChange=${(e) => setDevice(e.currentTarget.value)}>
488
- <option value="full">${t("chat.pvWidthFull")}</option><option value="tablet">${t("chat.pvWidthTablet")}</option><option value="phone">${t("chat.pvWidthPhone")}</option></select>` : null}
489
- ${going ? html`<button type="button" class="btn btn-sm pv-panel-reload" title=${t("chat.pvReload")} onClick=${() => { stop(); start(true); }}><${Icon} name="restart" size=${14} /><span class="lbl">${t("chat.pvReload")}</span></button>
490
- <button type="button" class="btn btn-sm pv-panel-stop" title=${t("chat.pvStop")} onClick=${stop}><${Icon} name="stop" size=${14} /><span class="lbl">${t("chat.pvStop")}</span></button>`
513
+ </div>`}
514
+ width=${html`${shown === "preview" ? html`<select class="pv-width" aria-label=${t("chat.pvWidth")} title=${t("chat.pvWidth")} value=${device} onChange=${(e) => setDevice(e.currentTarget.value)}>
515
+ <option value="full">${t("chat.pvWidthFull")}</option><option value="tablet">${t("chat.pvWidthTablet")}</option><option value="phone">${t("chat.pvWidthPhone")}</option></select>` : null}`}
516
+ reload=${html`${going ? html`<button type="button" class="btn btn-sm pv-panel-reload" title=${t("chat.pvReload")} onClick=${() => { stop(); start(true); }}><${Icon} name="restart" size=${14} /><span class="lbl">${t("chat.pvReload")}</span></button>` : null}`}
517
+ run=${html`${going ? html`<button type="button" class="btn btn-sm pv-panel-stop" title=${t("chat.pvStop")} onClick=${stop}><${Icon} name="stop" size=${14} /><span class="lbl">${t("chat.pvStop")}</span></button>`
491
518
  : run.state === "large" ? html`<button type="button" class="btn btn-sm btn-primary pv-panel-anyway" title=${t("chat.pvAnyway")} disabled=${!a.ok} onClick=${() => start(true)}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvAnyway")}</span></button>`
492
- : html`<button type="button" class="btn btn-sm btn-primary pv-panel-run" title=${t("chat.pvPreview")} disabled=${!a.ok} onClick=${() => start()}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvPreview")}</span></button>`}
493
- <button type="button" class=${`btn btn-sm only-wide pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
494
- onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button>
495
- <${PanelActions} open=${open} name=${name} run=${run} view=${view} />
496
- <button type="button" class="btn btn-sm pv-panel-dl" title=${t("chat.pvDownload")} onClick=${() => download(open.code, fileName)}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></button>
497
- </div>
519
+ : html`<button type="button" class="btn btn-sm btn-primary pv-panel-run" title=${t("chat.pvPreview")} disabled=${!a.ok} onClick=${() => start()}><${Icon} name="play" size=${14} /><span class="lbl">${t("chat.pvPreview")}</span></button>`}`}
520
+ fullscreen=${html`<button type="button" class=${`icon-btn pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
521
+ onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button>`}
522
+ actions=${html`<${PanelActions} open=${open} name=${name} run=${run} view=${view} />
523
+ <button type="button" class="btn btn-sm pv-panel-dl" title=${t("chat.pvDownload")} onClick=${() => download(open.code, fileName)}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></button>`} />
498
524
  ${newer && newer.key !== open.key ? html`<div class="pv-newer" role="status"><span>${t("chat.pvNewer", timeOf(newer.ts))}</span>
499
525
  <button type="button" class="btn btn-sm pv-newer-show" onClick=${showNewer}>${t("chat.pvNewerShow")}</button>${newerNote ? newerNote.loading
500
526
  ? html`<${Skeleton} variant="inline" lines=${1} label=${t("chat.pvLoading")} />` : html`<span class="pv-newer-note">${newerNote}</span>` : null}</div>` : null}
@@ -533,7 +559,7 @@ function MarkdownPanel({ open, name, md, view, setView, plain, body, panel, fs,
533
559
  <button type="button" class=${`btn btn-sm${view === "source" ? " on" : ""}`} aria-pressed=${view === "source" ? "true" : "false"} title=${t("chat.pvMdSource")} onClick=${() => setView("source")}><${Icon} name="code" size=${14} /><span class="lbl">${t("chat.pvMdSource")}</span></button>
534
560
  </div>
535
561
  <span class="grow"></span>
536
- <button type="button" class=${`btn btn-sm only-wide pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
562
+ <button type="button" class=${`icon-btn pv-panel-fs${fs ? " on" : ""}`} aria-pressed=${fs ? "true" : "false"} title=${t(fs ? "chat.pvFsExit" : "chat.pvFs")} aria-label=${t(fs ? "chat.pvFsExit" : "chat.pvFs")}
537
563
  onClick=${() => (fs ? leaveFs() : enterFs())}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${14} /></button>
538
564
  ${open.att ? html`<a class="btn btn-sm pv-panel-dl" href=${`/ui/file/${open.att.id}`} download=${open.att.name} title=${t("chat.pvDownload")}><${Icon} name="download" size=${14} /><span class="lbl">${t("chat.pvDownload")}</span></a>` : null}
539
565
  </div>
@@ -0,0 +1,11 @@
1
+ /* Presentation only: the already-mounted chat keeps its store, live stream and preview owner. */
2
+ [data-preview-window="1"] .p-chat > .panel-head,
3
+ [data-preview-window="1"] .p-chat > .chat-card,
4
+ [data-preview-window="1"] .p-chat > .aw-chat_header,
5
+ [data-preview-window="1"] .p-chat .chat-split > .chat-main,
6
+ [data-preview-window="1"] .p-chat .pv-divider { display: none; }
7
+ [data-preview-window="1"] .p-chat .chat-split { width: 100%; min-width: 0; }
8
+ [data-preview-window="1"] .p-chat .pv-panel:not(.pv-fs) { flex: 1; width: 100%; max-width: none; min-width: 0; position: relative; inset: auto; }
9
+ @media (max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px) {
10
+ .pv-panel-popout { min-width: var(--tap); min-height: var(--tap); }
11
+ }
@@ -140,7 +140,17 @@
140
140
  window.addEventListener("pageshow", schedule);
141
141
  // Page palettes are applied to the shell; routes replace headers. Coalesce paints and
142
142
  // ignore content attributes so updating this meta element cannot trigger itself.
143
- new MutationObserver(schedule).observe(document.documentElement, {
143
+ // M-3455: the split view's grid (.ws-geometry) changes only its size and drag state on these attributes — never a colour.
144
+ // A divider drag writes them every frame; re-reading the header colours then forced a layout and style walk per frame.
145
+ function relevant(records) {
146
+ if (!records || !records.length) return true;
147
+ for (var i = 0; i < records.length; i++) {
148
+ var r = records[i];
149
+ if (r.type !== "attributes" || !r.target.classList || !r.target.classList.contains("ws-geometry")) return true;
150
+ }
151
+ return false;
152
+ }
153
+ new MutationObserver(function (records) { if (relevant(records)) schedule(); }).observe(document.documentElement, {
144
154
  subtree: true, childList: true, attributes: true, attributeFilter: ["class", "style", "data-theme", "data-palette", "data-agent"],
145
155
  });
146
156
  })();
@@ -10,6 +10,7 @@ import { readStream } from "./read-stream.js";
10
10
  import { Dialog } from "./ui-dialog.js";
11
11
  import { ErrorState, Skeleton } from "./ui-states.js";
12
12
  import { Icon } from "./ui-icons.js";
13
+ import { InfoTip } from "./info-tip.js";
13
14
  import "./view-strings.js";
14
15
  import { CompactMeter, level, resetClock, resetText, tn, usageClock, usageDuration, usageText, windowTag } from "./usage-meter.js";
15
16
  // What this file exported before the meter moved out of it (#3321), for what imports it from here.
@@ -203,43 +204,17 @@ function rowNote(p) {
203
204
  }
204
205
  /**
205
206
  * M-3248 (the user): a login no agent uses said 「此帳號目前沒有 Agent」 as a line of text beside its name. It is a quiet ⓘ
206
- * there now (the muted text colour, never a warning's), its words on a hover, a focus or a tap, in the settings pages' tip
207
- * bubble (.s-tipbody). The bubble is fixed to the window, so the group's rounded clip (.u-cgroup, overflow: hidden) never
208
- * cuts it, and is only in the page while shown. In a compact row (itself a button that opens the login's card) the mark
209
- * is not a second button: an image named by the words — the row reads "wii, No agents on this profile" — and a tap on it
210
- * shows them without opening the row. In the full card it is a button, reached with Tab.
207
+ * there now (the muted text colour, never a warning's). In the full card it is the shared info icon (info-tip.js: its words
208
+ * on a hover, a focus or a tap, in a bubble fixed to the window, so the group's rounded clip never cuts it). In a compact
209
+ * row (itself a button that opens the login's card) the mark is only drawn and its words are part of the row's name — the
210
+ * row reads "wii, No agents on this profile" — and a tap opens the card, where the ⓘ is (M-3443: no hover-only mark).
211
211
  */
212
212
  function NoAgentsMark({ inRow = false }) {
213
213
  const words = tn("usage.no_agents");
214
- const [at, setAt] = useState(null);
215
- const [pinned, setPinned] = useState(false);
216
- const mark = useRef(null), bubble = useRef(null);
217
- const show = () => {
218
- const r = mark.current && mark.current.getBoundingClientRect ? mark.current.getBoundingClientRect() : null;
219
- const w = window.innerWidth || 0, hgt = window.innerHeight || 0;
220
- if (!r || !w) { setAt({ x: 8, y: 8, above: false }); return; }
221
- const above = r.bottom + 72 > hgt;
222
- // Pushed sideways to stay inside the window (a custom property: the page allows no style attribute).
223
- setAt({ x: Math.round(Math.max(8, Math.min(r.left - 8, w - Math.min(260, w - 16) - 8))), y: Math.round(above ? hgt - r.top + 6 : r.bottom + 6), above });
224
- };
225
- const hide = () => { setAt(null); setPinned(false); };
226
- useLayoutEffect(() => {
227
- const b = bubble.current;
228
- if (b && b.style && at) { b.style.setProperty("--tip-x", `${at.x}px`); b.style.setProperty("--tip-y", `${at.y}px`); }
229
- }, [at]);
230
- useEffect(() => {
231
- if (!at) return undefined;
232
- const esc = (e) => { if (e.key === "Escape") { e.stopPropagation(); hide(); } };
233
- const away = (e) => { if (mark.current && !mark.current.contains(e.target)) hide(); };
234
- document.addEventListener("keydown", esc, true); document.addEventListener("click", away); window.addEventListener("scroll", hide, true);
235
- return () => { document.removeEventListener("keydown", esc, true); document.removeEventListener("click", away); window.removeEventListener("scroll", hide, true); };
236
- }, [!!at]);
237
- const tap = (e) => { e.stopPropagation(); e.preventDefault(); if (pinned) hide(); else { show(); setPinned(true); } };
238
- const leave = () => { if (!pinned) hide(); };
239
- const tip = at ? html`<span ref=${bubble} class=${`s-tipbody u-na-tip${at.above ? " above" : ""}`} aria-hidden="true">${words}</span>` : null;
240
- return inRow
241
- ? html`<span ref=${mark} class="u-na" role="img" aria-label=${words} onMouseEnter=${show} onMouseLeave=${leave} onClick=${tap}><${Icon} name="info" size=${14} />${tip}</span>`
242
- : html`<button ref=${mark} type="button" class="u-na" aria-label=${words} onMouseEnter=${show} onMouseLeave=${leave} onFocus=${show} onBlur=${hide} onClick=${tap}><${Icon} name="info" size=${14} />${tip}</button>`;
214
+ // M-3443: the full card's ⓘ is the shared info icon (a button: hover, focus, tap). A compact row is itself a button that
215
+ // opens that card, so there it is no second control: the words are in the row's name (read with it), the mark only drawn.
216
+ if (inRow) return html`<span class="u-na" aria-hidden="true"><${Icon} name="info" size=${14} /></span><span class="sr-only">${words}</span>`;
217
+ return html`<${InfoTip} text=${words} label=${words} cls="u-na-tip" />`;
243
218
  }
244
219
  /**
245
220
  * A login in three short lines, under its provider's name (the user's pick, 2026-10-22): its name and plan; then its
@@ -149,6 +149,7 @@ register("view", {
149
149
  "usage.hint.grok_no_login": "auth.json has no usable login. Run `grok login`.",
150
150
  "usage.hint.login_kiro": "Log in with the Kiro CLI (`kiro-cli`).",
151
151
  "usage.hint.kiro_signed_out": "Signed out — run `kiro-cli` to log in.",
152
+ "usage.hint.claude_managed_source": "Saved credentials have no subscription meters. Manage this connection in Settings → AI accounts & keys → Accounts.",
152
153
  "usage.hint.claude_profile_signed_out": "Not connected — connect it in Settings → AI accounts & keys → Accounts.",
153
154
  "usage.hint.claude_profile_signed_out_chat": "Not connected — connect it in Settings → AI accounts & keys → Accounts, or with `{0}`.",
154
155
  "usage.hint.token_refreshing": "Token refreshing — try again in a moment.",
@@ -434,6 +435,7 @@ register("view", {
434
435
  "usage.hint.grok_no_login": "auth.json 沒有可用的登入資料。請執行 `grok login`。",
435
436
  "usage.hint.login_kiro": "請使用 Kiro CLI(`kiro-cli`)登入。",
436
437
  "usage.hint.kiro_signed_out": "目前已登出;請執行 `kiro-cli` 登入。",
438
+ "usage.hint.claude_managed_source": "保存的憑證不提供訂閱額度表。請到設定 →「AI 帳號與金鑰」→「帳號」管理連接。",
437
439
  "usage.hint.claude_profile_signed_out": "尚未連接;請到設定 →「AI 帳號與金鑰」→「帳號」連接 AI 帳號。",
438
440
  "usage.hint.claude_profile_signed_out_chat": "尚未連接;請到設定 →「AI 帳號與金鑰」→「帳號」連接 AI 帳號,或用 `{0}` 連接。",
439
441
  "usage.hint.token_refreshing": "Token 更新中 — 請稍候再試。",
@@ -3,5 +3,5 @@
3
3
  * Keep this list explicit: the parity test rejects a key missing from either
4
4
  * locale surface before a mixed-language release can ship.
5
5
  */
6
- export declare const USAGE_I18N_KEYS: readonly ["usage.title", "usage.title_plain", "usage.empty_active", "usage.not_logged_in", "usage.default_login", "usage.no_agents", "usage.error_fallback", "usage.no_data", "usage.reset.in", "usage.reset.soon", "usage.duration.days_hours", "usage.duration.hours_minutes", "usage.duration.minutes", "usage.metric.session", "usage.metric.weekly", "usage.metric.monthly", "usage.metric.days_window", "usage.metric.named", "usage.metric.named_session", "usage.metric.named_weekly", "usage.metric.named_monthly", "usage.metric.named_days", "usage.metric.extra_usage", "usage.metric.rate_limit_resets", "usage.ticket_expiry", "usage.metric.credits", "usage.metric.weekly_limit", "usage.metric.pay_as_you_go", "usage.metric.bonus_credits", "usage.metric.overage_charges", "usage.metric.pay_per_use", "usage.unit.available", "usage.unit.credits", "usage.metric.usage_monthly", "usage.note.used_limit_unit", "usage.note.bonus_codes", "usage.value.disabled", "usage.value.cap", "usage.value.unlimited", "usage.hint.q_developer_monthly_limit", "usage.note.binding", "usage.note.binding_severity", "usage.note.busiest_model", "usage.note.busiest_models", "usage.metric.agy_claude_others", "usage.metric.agy_claude_others_session", "usage.metric.agy_claude_others_weekly", "usage.hint.statusline_now", "usage.hint.statusline_minutes", "usage.hint.claude_api_key", "usage.hint.login_claude", "usage.hint.login_agy", "usage.hint.no_quota", "usage.hint.login_codex", "usage.hint.codex_no_oauth", "usage.hint.login_grok", "usage.hint.grok_no_login", "usage.hint.login_kiro", "usage.hint.kiro_signed_out", "usage.hint.claude_profile_signed_out", "usage.hint.claude_profile_signed_out_chat", "usage.hint.token_refreshing", "usage.hint.subscription_no_credit", "usage.hint.no_quota_account", "usage.error.unreachable", "usage.error.token_rejected", "usage.error.rate_limited", "usage.error.rate_limited_transient", "usage.stale_rate_limited", "usage.stale.expired", "usage.stale.transient", "usage.stale.error", "usage.metric.reset_since", "usage.error.http", "usage.error.billing_http", "usage.error.invalid_response", "usage.error.invalid_billing_response", "usage.error.invalid_kiro_response", "usage.error.claude_token_expired", "usage.error.codex_token_expired", "usage.error.grok_expired", "usage.error.grok_response_changed", "usage.error.agy_cap", "usage.error.agy_no_refresh", "usage.error.agy_token_expired", "usage.error.agy_login_expired", "usage.error.agy_refresh_empty", "usage.error.grok_auth_readonly", "usage.error.grok_no_refresh", "usage.error.grok_refresh_unreachable", "usage.error.grok_invalid_refresh", "usage.error.grok_persist", "usage.capacity.line", "usage.capacity.line_tokens", "usage.capacity.not_enough", "usage.capacity.only_agend", "usage.capacity.mixed", "usage.capacity.best_fit_api", "usage.capacity.best_fit_output", "usage.capacity.best_fit_all"];
6
+ export declare const USAGE_I18N_KEYS: readonly ["usage.title", "usage.title_plain", "usage.empty_active", "usage.not_logged_in", "usage.default_login", "usage.no_agents", "usage.error_fallback", "usage.no_data", "usage.reset.in", "usage.reset.soon", "usage.duration.days_hours", "usage.duration.hours_minutes", "usage.duration.minutes", "usage.metric.session", "usage.metric.weekly", "usage.metric.monthly", "usage.metric.days_window", "usage.metric.named", "usage.metric.named_session", "usage.metric.named_weekly", "usage.metric.named_monthly", "usage.metric.named_days", "usage.metric.extra_usage", "usage.metric.rate_limit_resets", "usage.ticket_expiry", "usage.metric.credits", "usage.metric.weekly_limit", "usage.metric.pay_as_you_go", "usage.metric.bonus_credits", "usage.metric.overage_charges", "usage.metric.pay_per_use", "usage.unit.available", "usage.unit.credits", "usage.metric.usage_monthly", "usage.note.used_limit_unit", "usage.note.bonus_codes", "usage.value.disabled", "usage.value.cap", "usage.value.unlimited", "usage.hint.q_developer_monthly_limit", "usage.note.binding", "usage.note.binding_severity", "usage.note.busiest_model", "usage.note.busiest_models", "usage.metric.agy_claude_others", "usage.metric.agy_claude_others_session", "usage.metric.agy_claude_others_weekly", "usage.hint.statusline_now", "usage.hint.statusline_minutes", "usage.hint.claude_api_key", "usage.hint.login_claude", "usage.hint.login_agy", "usage.hint.no_quota", "usage.hint.login_codex", "usage.hint.codex_no_oauth", "usage.hint.login_grok", "usage.hint.grok_no_login", "usage.hint.login_kiro", "usage.hint.kiro_signed_out", "usage.hint.claude_managed_source", "usage.hint.claude_profile_signed_out", "usage.hint.claude_profile_signed_out_chat", "usage.hint.token_refreshing", "usage.hint.subscription_no_credit", "usage.hint.no_quota_account", "usage.error.unreachable", "usage.error.token_rejected", "usage.error.rate_limited", "usage.error.rate_limited_transient", "usage.stale_rate_limited", "usage.stale.expired", "usage.stale.transient", "usage.stale.error", "usage.metric.reset_since", "usage.error.http", "usage.error.billing_http", "usage.error.invalid_response", "usage.error.invalid_billing_response", "usage.error.invalid_kiro_response", "usage.error.claude_token_expired", "usage.error.codex_token_expired", "usage.error.grok_expired", "usage.error.grok_response_changed", "usage.error.agy_cap", "usage.error.agy_no_refresh", "usage.error.agy_token_expired", "usage.error.agy_login_expired", "usage.error.agy_refresh_empty", "usage.error.grok_auth_readonly", "usage.error.grok_no_refresh", "usage.error.grok_refresh_unreachable", "usage.error.grok_invalid_refresh", "usage.error.grok_persist", "usage.capacity.line", "usage.capacity.line_tokens", "usage.capacity.not_enough", "usage.capacity.only_agend", "usage.capacity.mixed", "usage.capacity.best_fit_api", "usage.capacity.best_fit_output", "usage.capacity.best_fit_all"];
7
7
  export type UsageI18nKey = typeof USAGE_I18N_KEYS[number];
@@ -20,7 +20,7 @@ export const USAGE_I18N_KEYS = [
20
20
  "usage.hint.statusline_now", "usage.hint.statusline_minutes", "usage.hint.claude_api_key",
21
21
  "usage.hint.login_claude", "usage.hint.login_agy", "usage.hint.no_quota",
22
22
  "usage.hint.login_codex", "usage.hint.codex_no_oauth", "usage.hint.login_grok",
23
- "usage.hint.grok_no_login", "usage.hint.login_kiro", "usage.hint.kiro_signed_out", "usage.hint.claude_profile_signed_out", "usage.hint.claude_profile_signed_out_chat",
23
+ "usage.hint.grok_no_login", "usage.hint.login_kiro", "usage.hint.kiro_signed_out", "usage.hint.claude_managed_source", "usage.hint.claude_profile_signed_out", "usage.hint.claude_profile_signed_out_chat",
24
24
  "usage.hint.token_refreshing", "usage.hint.subscription_no_credit", "usage.hint.no_quota_account",
25
25
  "usage.error.unreachable", "usage.error.token_rejected", "usage.error.rate_limited", "usage.error.rate_limited_transient", "usage.stale_rate_limited",
26
26
  "usage.stale.expired", "usage.stale.transient", "usage.stale.error", "usage.metric.reset_since",
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-keys.js","sourceRoot":"","sources":["../../src/usage/i18n-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB;IACzH,sBAAsB,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB;IAC7E,2BAA2B,EAAE,8BAA8B,EAAE,wBAAwB;IACrF,sBAAsB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,0BAA0B;IACjG,oBAAoB,EAAE,4BAA4B,EAAE,2BAA2B;IAC/E,4BAA4B,EAAE,yBAAyB,EAAE,0BAA0B;IACnF,gCAAgC,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B;IAC5G,4BAA4B,EAAE,4BAA4B,EAAE,8BAA8B;IAC1F,0BAA0B,EAAE,sBAAsB,EAAE,oBAAoB;IACxE,4BAA4B,EAAE,4BAA4B,EAAE,wBAAwB;IACpF,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,sCAAsC,EAAE,oBAAoB;IAChI,6BAA6B,EAAE,0BAA0B,EAAE,2BAA2B;IACtF,gCAAgC,EAAE,wCAAwC,EAAE,uCAAuC;IACnH,2BAA2B,EAAE,+BAA+B,EAAE,2BAA2B;IACzF,yBAAyB,EAAE,sBAAsB,EAAE,qBAAqB;IACxE,wBAAwB,EAAE,2BAA2B,EAAE,uBAAuB;IAC9E,0BAA0B,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,sCAAsC,EAAE,2CAA2C;IACtK,6BAA6B,EAAE,mCAAmC,EAAE,6BAA6B;IACjG,yBAAyB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,0BAA0B;IACrJ,qBAAqB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,0BAA0B;IAC/F,kBAAkB,EAAE,0BAA0B,EAAE,8BAA8B;IAC9E,sCAAsC,EAAE,mCAAmC;IAC3E,kCAAkC,EAAE,iCAAiC;IACrE,0BAA0B,EAAE,mCAAmC,EAAE,qBAAqB;IACtF,4BAA4B,EAAE,+BAA+B,EAAE,+BAA+B;IAC9F,+BAA+B,EAAE,gCAAgC,EAAE,6BAA6B;IAChG,sCAAsC,EAAE,kCAAkC,EAAE,0BAA0B;IACtG,4CAA4C;IAC5C,qBAAqB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,sBAAsB;IACrI,6BAA6B,EAAE,gCAAgC,EAAE,6BAA6B;CACtF,CAAC"}
1
+ {"version":3,"file":"i18n-keys.js","sourceRoot":"","sources":["../../src/usage/i18n-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,iBAAiB;IACzH,sBAAsB,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB;IAC7E,2BAA2B,EAAE,8BAA8B,EAAE,wBAAwB;IACrF,sBAAsB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,0BAA0B;IACjG,oBAAoB,EAAE,4BAA4B,EAAE,2BAA2B;IAC/E,4BAA4B,EAAE,yBAAyB,EAAE,0BAA0B;IACnF,gCAAgC,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B;IAC5G,4BAA4B,EAAE,4BAA4B,EAAE,8BAA8B;IAC1F,0BAA0B,EAAE,sBAAsB,EAAE,oBAAoB;IACxE,4BAA4B,EAAE,4BAA4B,EAAE,wBAAwB;IACpF,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,sCAAsC,EAAE,oBAAoB;IAChI,6BAA6B,EAAE,0BAA0B,EAAE,2BAA2B;IACtF,gCAAgC,EAAE,wCAAwC,EAAE,uCAAuC;IACnH,2BAA2B,EAAE,+BAA+B,EAAE,2BAA2B;IACzF,yBAAyB,EAAE,sBAAsB,EAAE,qBAAqB;IACxE,wBAAwB,EAAE,2BAA2B,EAAE,uBAAuB;IAC9E,0BAA0B,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,kCAAkC,EAAE,sCAAsC,EAAE,2CAA2C;IAC1M,6BAA6B,EAAE,mCAAmC,EAAE,6BAA6B;IACjG,yBAAyB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,0BAA0B;IACrJ,qBAAqB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,0BAA0B;IAC/F,kBAAkB,EAAE,0BAA0B,EAAE,8BAA8B;IAC9E,sCAAsC,EAAE,mCAAmC;IAC3E,kCAAkC,EAAE,iCAAiC;IACrE,0BAA0B,EAAE,mCAAmC,EAAE,qBAAqB;IACtF,4BAA4B,EAAE,+BAA+B,EAAE,+BAA+B;IAC9F,+BAA+B,EAAE,gCAAgC,EAAE,6BAA6B;IAChG,sCAAsC,EAAE,kCAAkC,EAAE,0BAA0B;IACtG,4CAA4C;IAC5C,qBAAqB,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,sBAAsB;IACrI,6BAA6B,EAAE,gCAAgC,EAAE,6BAA6B;CACtF,CAAC"}
@@ -187,6 +187,7 @@ export interface ClaudeUsageScope {
187
187
  * with the line that signs it in, and never shows the shared account's numbers. Without it: the shared login as
188
188
  * always; beside profiles (`besideProfiles`), its statusline fallback leaves the profiles' instances out.
189
189
  */
190
+ export declare function redactManagedClaudeUsage(provider: ProviderUsage): ProviderUsage;
190
191
  export declare function fetchClaudeUsage(storeHome?: string, scope?: ClaudeUsageScope): Promise<Omit<ProviderUsage, "id" | "name">>;
191
192
  /**
192
193
  * The agy CLI version AgEnD names itself as, in agy's own User-Agent (`antigravity/cli/<version> (aidev_client; …)`, as
@@ -1,3 +1,4 @@
1
+ import { claudeSubscriptionSuppressed, readClaudeCredentialSelection } from "../claude-credential-launch.js";
1
2
  /**
2
3
  * AI subscription usage providers — read the credentials the CLI backends
3
4
  * already saved on this machine and fetch live plan usage from each vendor's
@@ -346,7 +347,19 @@ export async function getClaudeOAuthToken(storeHome) {
346
347
  * with the line that signs it in, and never shows the shared account's numbers. Without it: the shared login as
347
348
  * always; beside profiles (`besideProfiles`), its statusline fallback leaves the profiles' instances out.
348
349
  */
350
+ export function redactManagedClaudeUsage(provider) {
351
+ if (provider.id !== "claude" && !provider.id.startsWith("claude:"))
352
+ return provider;
353
+ const profile = provider.profile ?? (provider.id.startsWith("claude:") ? provider.id.slice(7) : null);
354
+ if (!claudeSubscriptionSuppressed(getAgendHome(), profile))
355
+ return provider;
356
+ return { id: provider.id, name: provider.name, ...(provider.profile ? { profile: provider.profile } : {}), ...(provider.defaultLogin ? { defaultLogin: true } : {}), status: "ok", hint: "Saved credentials have no subscription meters. Manage this connection in Settings → AI accounts & keys → Accounts.", hintI18n: i18n("usage.hint.claude_managed_source"), metrics: [] };
357
+ }
349
358
  export async function fetchClaudeUsage(storeHome, scope = {}) {
359
+ const profile = scope.profile ?? null;
360
+ if (claudeSubscriptionSuppressed(getAgendHome(), profile))
361
+ return redactManagedClaudeUsage({ id: "claude" + (profile ? ":" + profile : ""), name: "Claude", ...(profile ? { profile } : {}), status: "ok", metrics: [] });
362
+ const explicitSubscription = readClaudeCredentialSelection(getAgendHome(), profile)?.source === "subscription";
350
363
  const profileHome = storeHome !== undefined ? resolve(storeHome) : null;
351
364
  const file = profileHome !== null
352
365
  ? await readClaudeProfileLogin(profileHome)
@@ -360,7 +373,7 @@ export async function fetchClaudeUsage(storeHome, scope = {}) {
360
373
  const statusline = profileHome !== null
361
374
  ? (envTokenReachesClaude() ? null : readStatuslineRateLimits(undefined, undefined, (path) => path !== null && isWithin(path, join(profileHome, "projects"))))
362
375
  : readStatuslineRateLimits(undefined, undefined, scope.besideProfiles ? (path) => path === null || !isWithin(path, profilesRoot) : undefined);
363
- const auth = profileHome !== null ? resolveClaudeAuth(file, {}, () => null) : resolveClaudeAuth(file);
376
+ const auth = profileHome !== null ? resolveClaudeAuth(file, {}, () => null) : explicitSubscription ? resolveClaudeAuth(file, {}) : resolveClaudeAuth(file);
364
377
  if (auth === null) {
365
378
  // No token anywhere — but the CLI itself is logged in somehow (including an
366
379
  // API key, which the usage endpoint rejects outright), and it wrote its