@ashlr/hub 3.7.0 → 3.9.0

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 (155) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/dist/build-identity.json +2 -2
  3. package/dist/cli/resource-profile.js +95 -21
  4. package/dist/cli/resource-profile.js.map +1 -1
  5. package/dist/core/policy/local-only.d.ts +142 -2
  6. package/dist/core/policy/local-only.js +204 -15
  7. package/dist/core/policy/local-only.js.map +1 -1
  8. package/dist/core/resources/native-profile.d.ts +56 -0
  9. package/dist/core/resources/native-profile.js +368 -6
  10. package/dist/core/resources/native-profile.js.map +1 -1
  11. package/dist/core/run/budget.d.ts +22 -8
  12. package/dist/core/run/budget.js +80 -12
  13. package/dist/core/run/budget.js.map +1 -1
  14. package/dist/core/run/model-catalog.js +8 -1
  15. package/dist/core/run/model-catalog.js.map +1 -1
  16. package/dist/core/run/sandboxed-engine.js +3 -3
  17. package/dist/core/run/sandboxed-engine.js.map +1 -1
  18. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  19. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +69 -10
  20. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +68 -9
  21. package/dist/core/verse/adapters/claude.d.ts +49 -2
  22. package/dist/core/verse/adapters/claude.js +317 -56
  23. package/dist/core/verse/adapters/claude.js.map +1 -1
  24. package/dist/core/verse/adapters/codex.d.ts +81 -5
  25. package/dist/core/verse/adapters/codex.js +409 -47
  26. package/dist/core/verse/adapters/codex.js.map +1 -1
  27. package/dist/core/verse/adapters/grok.d.ts +13 -1
  28. package/dist/core/verse/adapters/grok.js +28 -2
  29. package/dist/core/verse/adapters/grok.js.map +1 -1
  30. package/dist/core/verse/adapters/index.d.ts +32 -0
  31. package/dist/core/verse/adapters/index.js +2 -0
  32. package/dist/core/verse/adapters/index.js.map +1 -1
  33. package/dist/core/verse/codex-rollout.d.ts +284 -0
  34. package/dist/core/verse/codex-rollout.js +786 -0
  35. package/dist/core/verse/codex-rollout.js.map +1 -0
  36. package/dist/core/verse/context-fit.d.ts +63 -0
  37. package/dist/core/verse/context-fit.js +355 -0
  38. package/dist/core/verse/context-fit.js.map +1 -0
  39. package/dist/core/verse/context-math.d.ts +215 -0
  40. package/dist/core/verse/context-math.js +365 -0
  41. package/dist/core/verse/context-math.js.map +1 -0
  42. package/dist/core/verse/local-models.d.ts +137 -1
  43. package/dist/core/verse/local-models.js +209 -5
  44. package/dist/core/verse/local-models.js.map +1 -1
  45. package/dist/core/verse/model-windows.d.ts +217 -0
  46. package/dist/core/verse/model-windows.js +616 -0
  47. package/dist/core/verse/model-windows.js.map +1 -0
  48. package/dist/core/verse/preferences.d.ts +123 -0
  49. package/dist/core/verse/preferences.js +403 -0
  50. package/dist/core/verse/preferences.js.map +1 -0
  51. package/dist/core/verse/project-memory.d.ts +112 -0
  52. package/dist/core/verse/project-memory.js +295 -0
  53. package/dist/core/verse/project-memory.js.map +1 -0
  54. package/dist/core/verse/seats.d.ts +106 -4
  55. package/dist/core/verse/seats.js +291 -89
  56. package/dist/core/verse/seats.js.map +1 -1
  57. package/dist/core/verse/session-engine.d.ts +117 -2
  58. package/dist/core/verse/session-engine.js +763 -65
  59. package/dist/core/verse/session-engine.js.map +1 -1
  60. package/dist/core/verse/session-handoff.d.ts +94 -0
  61. package/dist/core/verse/session-handoff.js +551 -0
  62. package/dist/core/verse/session-handoff.js.map +1 -0
  63. package/dist/core/verse/session-search.d.ts +63 -0
  64. package/dist/core/verse/session-search.js +213 -0
  65. package/dist/core/verse/session-search.js.map +1 -0
  66. package/dist/core/verse/session-store.d.ts +16 -2
  67. package/dist/core/verse/session-store.js +80 -6
  68. package/dist/core/verse/session-store.js.map +1 -1
  69. package/dist/core/verse/types.d.ts +333 -1
  70. package/dist/core/verse/types.js +54 -2
  71. package/dist/core/verse/types.js.map +1 -1
  72. package/dist/core/verse/verse-api.d.ts +40 -5
  73. package/dist/core/verse/verse-api.js +724 -25
  74. package/dist/core/verse/verse-api.js.map +1 -1
  75. package/dist/core/web/api.d.ts +14 -4
  76. package/dist/core/web/api.js +26 -11
  77. package/dist/core/web/api.js.map +1 -1
  78. package/dist/core/web/public/next/assets/{App-vtaHB9mp.js → App-XURmiAAp.js} +5 -5
  79. package/dist/core/web/public/next/assets/{App-vtaHB9mp.js.map → App-XURmiAAp.js.map} +1 -1
  80. package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js → ApprovalsSection-BriUzoZc.js} +2 -2
  81. package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js.map → ApprovalsSection-BriUzoZc.js.map} +1 -1
  82. package/dist/core/web/public/next/assets/AutonomySection-C4GBsQVc.js +2 -0
  83. package/dist/core/web/public/next/assets/{AutonomySection-DoqmsCjw.js.map → AutonomySection-C4GBsQVc.js.map} +1 -1
  84. package/dist/core/web/public/next/assets/ChatSection-BpOBOUvg.css +1 -0
  85. package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js +84 -0
  86. package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js.map +1 -0
  87. package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js +2 -0
  88. package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js.map +1 -0
  89. package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js → Dialog-BxdIfmFH.js} +2 -2
  90. package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js.map → Dialog-BxdIfmFH.js.map} +1 -1
  91. package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js → DiffViewer-DmeRWuc4.js} +2 -2
  92. package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js.map → DiffViewer-DmeRWuc4.js.map} +1 -1
  93. package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js → McpSection-q34T7Tho.js} +2 -2
  94. package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js.map → McpSection-q34T7Tho.js.map} +1 -1
  95. package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js → MutationTokenDialog-CFAkwOEt.js} +2 -2
  96. package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js.map → MutationTokenDialog-CFAkwOEt.js.map} +1 -1
  97. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js → ResourcePoolConsoleApp-DHc8GFOY.js} +4 -4
  98. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js.map → ResourcePoolConsoleApp-DHc8GFOY.js.map} +1 -1
  99. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js → RouteErrorBoundary-ZL9F4qUn.js} +2 -2
  100. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js.map → RouteErrorBoundary-ZL9F4qUn.js.map} +1 -1
  101. package/dist/core/web/public/next/assets/{Meter-CLcr-4wS.css → Segmented-8cf0Fypn.css} +1 -1
  102. package/dist/core/web/public/next/assets/{Meter--h3MmZS-.js → Segmented-DbRjVye3.js} +2 -2
  103. package/dist/core/web/public/next/assets/Segmented-DbRjVye3.js.map +1 -0
  104. package/dist/core/web/public/next/assets/SettingsSection-nJGGGYqv.js +2 -0
  105. package/dist/core/web/public/next/assets/{SettingsSection-BwrpQlpP.js.map → SettingsSection-nJGGGYqv.js.map} +1 -1
  106. package/dist/core/web/public/next/assets/UniverseConsoleApp-6GJydgo4.js +2 -0
  107. package/dist/core/web/public/next/assets/{UniverseConsoleApp-_FSohAdN.js.map → UniverseConsoleApp-6GJydgo4.js.map} +1 -1
  108. package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js → UniverseView-DLDtNYL8.js} +2 -2
  109. package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js.map → UniverseView-DLDtNYL8.js.map} +1 -1
  110. package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js +2 -0
  111. package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js.map +1 -0
  112. package/dist/core/web/public/next/assets/VerseConsoleApp-DsdKQoTH.css +1 -0
  113. package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js +3 -0
  114. package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js.map +1 -0
  115. package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js → charts-CVooqJWN.js} +2 -2
  116. package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js.map → charts-CVooqJWN.js.map} +1 -1
  117. package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js +2 -0
  118. package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js.map +1 -0
  119. package/dist/core/web/public/next/assets/global-eaY9GyX3.js +2 -0
  120. package/dist/core/web/public/next/assets/global-eaY9GyX3.js.map +1 -0
  121. package/dist/core/web/public/next/assets/{icons-D9vlf85u.js → icons-vex8rclC.js} +2 -2
  122. package/dist/core/web/public/next/assets/{icons-D9vlf85u.js.map → icons-vex8rclC.js.map} +1 -1
  123. package/dist/core/web/public/next/assets/{index-CZamKRUg.js → index-D2Eik-zt.js} +3 -3
  124. package/dist/core/web/public/next/assets/{index-CZamKRUg.js.map → index-D2Eik-zt.js.map} +1 -1
  125. package/dist/core/web/public/next/assets/{queries-B8eBnFox.js → queries-bAYU0VNy.js} +2 -2
  126. package/dist/core/web/public/next/assets/{queries-B8eBnFox.js.map → queries-bAYU0VNy.js.map} +1 -1
  127. package/dist/core/web/public/next/assets/use-guarded-action-C7QrP7Yp.js +2 -0
  128. package/dist/core/web/public/next/assets/{use-guarded-action-bzrVVAYq.js.map → use-guarded-action-C7QrP7Yp.js.map} +1 -1
  129. package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js +2 -0
  130. package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js.map +1 -0
  131. package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js → workspace-model-CHol5RVp.js} +2 -2
  132. package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js.map → workspace-model-CHol5RVp.js.map} +1 -1
  133. package/dist/core/web/public/next/index.html +1 -1
  134. package/dist/release-dependency-inventory.json +1 -1
  135. package/docs/README.md +1 -0
  136. package/package.json +1 -1
  137. package/dist/core/web/public/next/assets/AutonomySection-DoqmsCjw.js +0 -2
  138. package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +0 -1
  139. package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js +0 -80
  140. package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js.map +0 -1
  141. package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js +0 -2
  142. package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js.map +0 -1
  143. package/dist/core/web/public/next/assets/Meter--h3MmZS-.js.map +0 -1
  144. package/dist/core/web/public/next/assets/SettingsSection-BwrpQlpP.js +0 -2
  145. package/dist/core/web/public/next/assets/UniverseConsoleApp-_FSohAdN.js +0 -2
  146. package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js +0 -2
  147. package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js.map +0 -1
  148. package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +0 -1
  149. package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js +0 -3
  150. package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js.map +0 -1
  151. package/dist/core/web/public/next/assets/global-D6bTxIRn.js +0 -2
  152. package/dist/core/web/public/next/assets/global-D6bTxIRn.js.map +0 -1
  153. package/dist/core/web/public/next/assets/use-guarded-action-bzrVVAYq.js +0 -2
  154. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +0 -2
  155. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./index-CZamKRUg.js";import{G as r,I as i,W as a,j as o,u as s}from"./global-D6bTxIRn.js";import{t as c}from"./Dialog-CPM9JxBc.js";var l=class extends Error{constructor(){super(`No mutation token held for this session yet.`),this.name=`MissingMutationTokenError`}};async function u(e,t){let n=o();if(!n)throw new l;let r=await s(e,t,n);return i(),r}async function d(){await u(`/api/fleet/pause`,{}),a(`dashboard-snapshot`),a(`control-snapshot`),a(`fleet`),a(`fleet-activity`)}async function f(){await u(`/api/fleet/resume`,{}),a(`dashboard-snapshot`),a(`control-snapshot`),a(`fleet`),a(`fleet-activity`)}async function p(e){await u(`/api/inbox/${encodeURIComponent(e)}/approve`,{}),a(`inbox`),a(`dashboard-snapshot`),a(`proposal-detail-${e}`),r(`inbox-list:`)}async function m(e){await u(`/api/inbox/${encodeURIComponent(e)}/reject`,{}),a(`inbox`),a(`dashboard-snapshot`),a(`proposal-detail-${e}`),r(`inbox-list:`)}var h=n(e(),1),g={body:`_body_15hsz_1`,error:`_error_15hsz_8`,actions:`_actions_15hsz_17`,cancel:`_cancel_15hsz_23`,confirm:`_confirm_15hsz_33`,destructive:`_destructive_15hsz_48`},_=t();function v({open:e,onClose:t,title:n,body:r,confirmLabel:i,destructive:a,onConfirm:o,busy:s,error:l}){let u=(0,h.useId)(),d=(0,h.useRef)(null);return(0,_.jsxs)(c,{open:e,onClose:t,titleId:u,title:n,initialFocusRef:d,children:[(0,_.jsx)(`div`,{className:g.body,children:r}),l?(0,_.jsx)(`p`,{className:g.error,role:`alert`,children:l}):null,(0,_.jsxs)(`div`,{className:g.actions,children:[(0,_.jsx)(`button`,{type:`button`,className:g.cancel,onClick:t,disabled:s,children:`Cancel`}),(0,_.jsx)(`button`,{ref:d,type:`button`,className:a?g.destructive:g.confirm,onClick:o,disabled:s,children:s?`Working…`:i})]})]})}export{f as a,m as i,p as n,d as r,v as t};
2
- //# sourceMappingURL=ConfirmDialog-Dd2APQhB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmDialog-Dd2APQhB.js","names":[],"sources":["../../../../../../src/web-ui/data/mutations.ts","../../../../../../src/web-ui/routes/inbox/ConfirmDialog.module.css","../../../../../../src/web-ui/routes/inbox/ConfirmDialog.tsx"],"sourcesContent":["/**\n * data/mutations.ts — every mutating call the foundation ships with, each\n * wrapped so it (a) pulls the held mutation token from auth-store instead\n * of asking every call site to thread it through, (b) touches the hold on\n * success so a burst of approvals doesn't idle-expire mid-session, and\n * (c) invalidates whatever cache keys the mutation obviously affects so\n * views update without waiting for the next SSE tick.\n *\n * Routes mirror the mutating surface documented at the top of\n * src/core/web/api.ts. Every one of these 404s (not 401/403) when the\n * server was started without --allow-dispatch — apiPost already maps that\n * to DispatchDisabledError.\n */\nimport { apiPost } from './client.js';\nimport { getMutationToken, touchMutationHold } from './auth-store.js';\nimport { invalidate, invalidatePrefix } from './cache.js';\n\nclass MissingMutationTokenError extends Error {\n constructor() {\n super('No mutation token held for this session yet.');\n this.name = 'MissingMutationTokenError';\n }\n}\n\nasync function post<T>(path: string, body: unknown): Promise<T> {\n const token = getMutationToken();\n if (!token) throw new MissingMutationTokenError();\n const result = await apiPost<T>(path, body, token);\n touchMutationHold();\n return result;\n}\n\nexport async function pauseFleet(): Promise<void> {\n await post('/api/fleet/pause', {});\n invalidate('dashboard-snapshot');\n invalidate('control-snapshot');\n invalidate('fleet');\n invalidate('fleet-activity');\n}\n\nexport async function resumeFleet(): Promise<void> {\n await post('/api/fleet/resume', {});\n invalidate('dashboard-snapshot');\n invalidate('control-snapshot');\n invalidate('fleet');\n invalidate('fleet-activity');\n}\n\nexport async function approveProposal(id: string): Promise<void> {\n await post(`/api/inbox/${encodeURIComponent(id)}/approve`, {});\n invalidate('inbox');\n invalidate('dashboard-snapshot');\n invalidate(`proposal-detail-${id}`);\n invalidatePrefix('inbox-list:');\n}\n\nexport async function rejectProposal(id: string): Promise<void> {\n await post(`/api/inbox/${encodeURIComponent(id)}/reject`, {});\n invalidate('inbox');\n invalidate('dashboard-snapshot');\n invalidate(`proposal-detail-${id}`);\n invalidatePrefix('inbox-list:');\n}\n\nexport interface OpenTargetRequest {\n path: string;\n target: 'editor' | 'finder';\n}\n\nexport async function openTarget(req: OpenTargetRequest): Promise<void> {\n await post('/api/open', req);\n}\n",".body {\n font-size: var(--text-sm-size);\n color: var(--text-secondary);\n line-height: var(--text-sm-line);\n margin: var(--space-3) 0;\n}\n\n.error {\n padding: var(--space-2) var(--space-3);\n border-radius: var(--radius-sm);\n background: var(--status-danger-bg);\n color: var(--status-danger-fg);\n font-size: var(--text-xs-size);\n margin-bottom: var(--space-3);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: var(--space-2);\n}\n\n.cancel {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-sm);\n border: 1px solid var(--border-default);\n background: var(--bg-surface);\n color: var(--text-secondary);\n font-size: var(--text-sm-size);\n cursor: pointer;\n}\n\n.confirm {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-sm);\n border: 1px solid var(--accent-600);\n background: var(--accent-600);\n color: var(--text-on-accent);\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-medium);\n cursor: pointer;\n}\n.confirm:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.destructive {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-sm);\n border: 1px solid var(--status-danger-solid);\n background: var(--status-danger-solid);\n color: var(--text-on-accent);\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-medium);\n cursor: pointer;\n}\n.destructive:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n","/**\n * routes/inbox/ConfirmDialog.tsx — explicit confirmation for approve/reject\n * (single or batch). Approve is the single most irreversible action in the\n * product (operator-console brief non-negotiable): it must require explicit\n * confirmation and clearly state what will happen, never fire on a single\n * click. Built on the shared Dialog primitive so it gets the same focus\n * trap / Escape / backdrop-close behavior as MutationTokenDialog and the\n * command palette for free.\n */\nimport { useId, useRef, type ReactNode } from 'react';\nimport { Dialog } from '../../components/primitives/Dialog.js';\nimport styles from './ConfirmDialog.module.css';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onClose: () => void;\n title: string;\n body: ReactNode;\n confirmLabel: string;\n /**\n * Weight the confirm button as the dangerous one. The rule is IRREVERSIBLE,\n * not \"negative-sounding\": whichever branch the operator cannot undo gets\n * the weight. In Verse's approvals that is Approve — a `pr` pushes a branch\n * and opens a real pull request other people see immediately, a `patch`\n * writes to disk now — while Reject only discards a proposal that stays in\n * history. This doc used to say the opposite, which is how the red button\n * came to be the safe one.\n */\n destructive?: boolean;\n onConfirm: () => void;\n busy?: boolean;\n error?: string | null;\n}\n\nexport function ConfirmDialog({ open, onClose, title, body, confirmLabel, destructive, onConfirm, busy, error }: ConfirmDialogProps) {\n const titleId = useId();\n const confirmRef = useRef<HTMLButtonElement>(null);\n\n return (\n <Dialog open={open} onClose={onClose} titleId={titleId} title={title} initialFocusRef={confirmRef}>\n <div className={styles.body}>{body}</div>\n {error ? (\n <p className={styles.error} role=\"alert\">\n {error}\n </p>\n ) : null}\n <div className={styles.actions}>\n <button type=\"button\" className={styles.cancel} onClick={onClose} disabled={busy}>\n Cancel\n </button>\n <button\n ref={confirmRef}\n type=\"button\"\n className={destructive ? styles.destructive : styles.confirm}\n onClick={onConfirm}\n disabled={busy}\n >\n {busy ? 'Working…' : confirmLabel}\n </button>\n </div>\n </Dialog>\n );\n}\n"],"mappings":"oKAiBA,IAAM,EAAN,cAAwC,KAAM,CAC5C,aAAc,CACZ,MAAM,8CAA8C,EACpD,KAAK,KAAO,2BACd,CACF,EAEA,eAAe,EAAQ,EAAc,EAA2B,CAC9D,IAAM,EAAQ,EAAiB,EAC/B,GAAI,CAAC,EAAO,MAAM,IAAI,EACtB,IAAM,EAAS,MAAM,EAAW,EAAM,EAAM,CAAK,EAEjD,OADA,EAAkB,EACX,CACT,CAEA,eAAsB,GAA4B,CAChD,MAAM,EAAK,mBAAoB,CAAC,CAAC,EACjC,EAAW,oBAAoB,EAC/B,EAAW,kBAAkB,EAC7B,EAAW,OAAO,EAClB,EAAW,gBAAgB,CAC7B,CAEA,eAAsB,GAA6B,CACjD,MAAM,EAAK,oBAAqB,CAAC,CAAC,EAClC,EAAW,oBAAoB,EAC/B,EAAW,kBAAkB,EAC7B,EAAW,OAAO,EAClB,EAAW,gBAAgB,CAC7B,CAEA,eAAsB,EAAgB,EAA2B,CAC/D,MAAM,EAAK,cAAc,mBAAmB,CAAE,EAAE,UAAW,CAAC,CAAC,EAC7D,EAAW,OAAO,EAClB,EAAW,oBAAoB,EAC/B,EAAW,mBAAmB,GAAI,EAClC,EAAiB,aAAa,CAChC,CAEA,eAAsB,EAAe,EAA2B,CAC9D,MAAM,EAAK,cAAc,mBAAmB,CAAE,EAAE,SAAU,CAAC,CAAC,EAC5D,EAAW,OAAO,EAClB,EAAW,oBAAoB,EAC/B,EAAW,mBAAmB,GAAI,EAClC,EAAiB,aAAa,CAChC,4LE5BA,SAAgB,EAAc,CAAE,OAAM,UAAS,QAAO,OAAM,eAAc,cAAa,YAAW,OAAM,SAA6B,CACnI,IAAM,GAAA,EAAU,EAAA,MAAA,CAAM,EAChB,GAAA,EAAa,EAAA,OAAA,CAA0B,IAAI,EAEjD,OACE,EAAA,EAAA,KAAA,CAAC,EAAD,CAAc,OAAe,UAAkB,UAAgB,QAAO,gBAAiB,EAAvF,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAO,KAAO,SAAA,CAAU,CAAA,EACvC,GACC,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAW,EAAO,MAAO,KAAK,QAC9B,SAAA,CACA,CAAA,EACD,MACJ,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAO,QAAvB,SAAA,EACE,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,KAAK,SAAS,UAAW,EAAO,OAAQ,QAAS,EAAS,SAAU,EAAM,SAAA,QAE1E,CAAA,GACR,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,IAAK,EACL,KAAK,SACL,UAAW,EAAc,EAAO,YAAc,EAAO,QACrD,QAAS,EACT,SAAU,EAET,SAAA,EAAO,WAAa,CACf,CAAA,CACL,GACC,GAEZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Meter--h3MmZS-.js","names":[],"sources":["../../../../../../src/web-ui/components/primitives/Tooltip.module.css","../../../../../../src/web-ui/components/primitives/Tooltip.tsx","../../../../../../src/web-ui/components/primitives/Meter.module.css","../../../../../../src/web-ui/components/primitives/Meter.tsx"],"sourcesContent":["/* The trigger's stand-in in the tree: present in the DOM so the describedby\n relationship has somewhere to sit, but generating NO box, so a trigger in a\n flex or grid track keeps its own placement exactly as it had it. */\n.wrapper {\n display: contents;\n}\n\n/* Fixed, not absolute, and portalled to <body>: the bubble's coordinates come\n from the trigger's viewport rect, so no ancestor's overflow, transform or\n stacking context can clip it. That clipping is the exact failure of the\n native `title=` tooltip this replaces. */\n.bubble {\n position: fixed;\n /* Above every other layer in the scale, toasts included: a tooltip can\n describe a control inside a dialog, a sheet or the command palette, and\n a bubble drawn behind the thing it explains is the same bug as one that\n is clipped. There is no --z-tooltip token yet; this stays one step above\n the top of the scale rather than inventing a number. */\n z-index: calc(var(--z-toast) + 1);\n display: flex;\n align-items: center;\n gap: var(--space-2);\n max-width: 260px;\n padding: var(--space-1) var(--space-2);\n border: 1px solid var(--border-default);\n border-radius: var(--radius-xs);\n background: var(--bg-surface-raised);\n color: var(--text-primary);\n box-shadow: var(--shadow-menu);\n font-family: var(--font-ui);\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line);\n font-weight: var(--font-weight-regular);\n /* Was `nowrap`, which defeated the max-width above: a long tooltip ran off\n the viewport instead of wrapping inside 260px. */\n white-space: normal;\n text-wrap: pretty;\n /* It follows the pointer's target, it is never a pointer target itself —\n otherwise a bubble drawn under the cursor triggers its own mouseleave. */\n pointer-events: none;\n animation: tooltip-in var(--duration-fast) var(--ease-standard);\n}\n\n.label {\n min-width: 0;\n}\n\n/* The shortcut reads as a key, not as more sentence. */\n.shortcut {\n flex: none;\n padding: 0 4px;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-xs);\n background: var(--bg-code);\n color: var(--text-secondary);\n font-family: var(--font-mono);\n font-size: var(--text-2xs-size, 11px);\n line-height: 1.5;\n white-space: nowrap;\n}\n\n@keyframes tooltip-in {\n from {\n opacity: 0;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :root:not([data-motion=\"full\"]) .bubble {\n animation: none;\n }\n}\n\n:root[data-motion=\"reduce\"] .bubble {\n animation: none;\n}\n\n/* A disabled trigger emits no pointer events, so the wrapper has to become a\n real box to catch the hover. Only then — `display: contents` is the default\n precisely so the wrapper never disturbs the trigger's flex/grid placement. */\n.wrapper[data-disabled-trigger='true'] {\n display: inline-flex;\n}\n","/**\n * components/primitives/Tooltip.tsx — the label for an icon-only control and\n * the numbers behind a 2px meter line.\n *\n * Rules it enforces so a tooltip never becomes the only way to read the UI:\n * - it shows on HOVER *and* on keyboard FOCUS (a mouse-only tooltip is\n * invisible to keyboard operators);\n * - Escape dismisses it while the trigger keeps focus (WCAG 1.4.13);\n * - the trigger is wired with aria-describedby, so the content is\n * announced rather than merely drawn;\n * - it carries description, never the accessible NAME — icon buttons still\n * need their own aria-label.\n *\n * WHY IT RENDERS THROUGH A PORTAL. This used to be an absolutely-positioned\n * span inside a `position: relative` wrapper, which is correct right up until\n * the trigger lives inside something that clips — and the first real consumer,\n * the Verse rail, is exactly that: a 56px flex column inside a grid shell with\n * its own stacking context. A bubble anchored there is cut off at the rail's\n * edge, which is the failure the native `title=` tooltip already had. Rendering\n * into `document.body` at `position: fixed`, positioned from the trigger's\n * bounding rect, means NO ancestor can clip it: not `overflow: hidden`, not a\n * `transform`, not a lower `z-index` on a sibling pane.\n *\n * The Popover API (`popover=\"manual\"` + the top layer) would do the same job\n * without the portal, but it is not yet safe to depend on across the WebKit\n * version bundled with the Tauri shell, and it still needs manual positioning\n * without `anchor-name`. The portal is the boring, verifiable option.\n *\n * TWO PROP SPELLINGS, on purpose. `label` + `shortcut` is the shape icon\n * controls want, and is what new call sites should use. `content` predates it\n * and takes arbitrary nodes (the Meter's numbers, for one), so it stays as the\n * other half of a union rather than being renamed out from under its callers.\n * Exactly one of the two is required.\n */\nimport {\n cloneElement,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type FocusEvent as ReactFocusEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport styles from './Tooltip.module.css';\n\nexport type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Hovering across a rail of six icons must not strobe six bubbles, so the\n * POINTER waits. Focus does not: a keyboard operator has already committed to\n * the control, and a delay there just reads as lag.\n */\nconst OPEN_DELAY_MS = 160;\n/** Distance between the trigger's edge and the bubble. */\nconst GAP = 8;\n/** Smallest distance the bubble may sit from the viewport edge. */\nconst MARGIN = 8;\n\n/** The props Tooltip clones onto its trigger. */\ninterface TooltipTriggerProps {\n 'aria-describedby'?: string;\n /** Read, never set: a disabled trigger fires no pointer events, so the wrapper must take over. */\n disabled?: boolean;\n onMouseEnter?: (event: ReactMouseEvent<HTMLElement>) => void;\n onMouseLeave?: (event: ReactMouseEvent<HTMLElement>) => void;\n onFocus?: (event: ReactFocusEvent<HTMLElement>) => void;\n onBlur?: (event: ReactFocusEvent<HTMLElement>) => void;\n}\n\ninterface TooltipCommonProps {\n /** Rendered as a distinct keycap beside the label, e.g. `⌘2`. */\n shortcut?: string;\n placement?: TooltipPlacement;\n /** Skip the tooltip entirely without changing the tree (e.g. the label is already visible). */\n disabled?: boolean;\n className?: string;\n /** The trigger. Tooltip adds no layout box of its own around it. */\n children: ReactElement<TooltipTriggerProps>;\n}\n\nexport type TooltipProps = TooltipCommonProps &\n (\n | { label: string; content?: undefined }\n | { label?: undefined; content: ReactNode }\n );\n\ninterface Position {\n left: number;\n top: number;\n placement: TooltipPlacement;\n}\n\n/** Placement order: the caller's choice first, then its opposite, then the rest. */\nfunction candidates(preferred: TooltipPlacement): TooltipPlacement[] {\n const opposite: Record<TooltipPlacement, TooltipPlacement> = {\n top: 'bottom', bottom: 'top', left: 'right', right: 'left',\n };\n const rest = (['top', 'bottom', 'right', 'left'] as const).filter(\n (p) => p !== preferred && p !== opposite[preferred],\n );\n return [preferred, opposite[preferred], ...rest];\n}\n\nfunction place(placement: TooltipPlacement, trigger: DOMRect, w: number, h: number): { left: number; top: number } {\n switch (placement) {\n case 'top': return { left: trigger.left + trigger.width / 2 - w / 2, top: trigger.top - h - GAP };\n case 'bottom': return { left: trigger.left + trigger.width / 2 - w / 2, top: trigger.bottom + GAP };\n case 'left': return { left: trigger.left - w - GAP, top: trigger.top + trigger.height / 2 - h / 2 };\n case 'right': return { left: trigger.right + GAP, top: trigger.top + trigger.height / 2 - h / 2 };\n }\n}\n\n/**\n * First placement whose bubble fits the viewport wins; if none fits we keep\n * the preferred one and clamp, which is still readable — a bubble nudged\n * inward beats a bubble half off-screen.\n */\nfunction resolve(trigger: DOMRect, w: number, h: number, preferred: TooltipPlacement): Position {\n const vw = window.innerWidth || 0;\n const vh = window.innerHeight || 0;\n let fallback: Position | null = null;\n for (const placement of candidates(preferred)) {\n const { left, top } = place(placement, trigger, w, h);\n if (!fallback) fallback = { left, top, placement };\n const fits = left >= MARGIN && top >= MARGIN && left + w <= vw - MARGIN && top + h <= vh - MARGIN;\n if (fits) return { left, top, placement };\n }\n const chosen = fallback!;\n return {\n placement: chosen.placement,\n left: Math.max(MARGIN, Math.min(chosen.left, vw - w - MARGIN)),\n top: Math.max(MARGIN, Math.min(chosen.top, vh - h - MARGIN)),\n };\n}\n\nexport function Tooltip(props: TooltipProps) {\n const { label, content, shortcut, placement = 'top', disabled = false, className, children } = props;\n const [open, setOpen] = useState(false);\n const [position, setPosition] = useState<Position | null>(null);\n const id = useId();\n const triggerRef = useRef<HTMLElement | null>(null);\n const bubbleRef = useRef<HTMLDivElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const cancelTimer = useCallback(() => {\n if (timer.current !== null) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n }, []);\n\n const close = useCallback(() => {\n cancelTimer();\n setOpen(false);\n setPosition(null);\n }, [cancelTimer]);\n\n // Unmounting mid-delay must not fire setOpen on a dead component.\n useEffect(() => cancelTimer, [cancelTimer]);\n\n const reposition = useCallback(() => {\n const trigger = triggerRef.current;\n const bubble = bubbleRef.current;\n if (!trigger || !bubble) return;\n const rect = trigger.getBoundingClientRect();\n setPosition(resolve(rect, bubble.offsetWidth, bubble.offsetHeight, placement));\n }, [placement]);\n\n // Measure AFTER the bubble exists but BEFORE paint, so it is never seen at\n // its unpositioned origin first.\n useLayoutEffect(() => {\n if (!open) return;\n reposition();\n }, [open, reposition]);\n\n // Escape closes while the trigger keeps focus (WCAG 1.4.13). Held at the\n // document so it works wherever the keystroke lands, and a scroll or resize\n // under an open bubble re-anchors it rather than leaving it stranded.\n useEffect(() => {\n if (!open) return;\n function onKeyDown(event: globalThis.KeyboardEvent) {\n if (event.key === 'Escape') close();\n }\n document.addEventListener('keydown', onKeyDown);\n window.addEventListener('resize', reposition);\n // Capture: a scroll inside any ancestor moves the trigger too, and scroll\n // events from those do not bubble to window.\n window.addEventListener('scroll', reposition, true);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n window.removeEventListener('resize', reposition);\n window.removeEventListener('scroll', reposition, true);\n };\n }, [open, close, reposition]);\n\n const body = label ?? content;\n const empty = body === null || body === undefined || body === '';\n if (disabled || empty) return children;\n\n function openAfterDelay(element: HTMLElement) {\n triggerRef.current = element;\n cancelTimer();\n timer.current = setTimeout(() => {\n timer.current = null;\n setOpen(true);\n }, OPEN_DELAY_MS);\n }\n\n function openNow(element: HTMLElement) {\n triggerRef.current = element;\n cancelTimer();\n setOpen(true);\n }\n\n const triggerDisabled = children.props.disabled === true;\n const describedBy = open ? id : undefined;\n\n const trigger = cloneElement(children, {\n 'aria-describedby': describedBy,\n onMouseEnter: (event: ReactMouseEvent<HTMLElement>) => {\n children.props.onMouseEnter?.(event);\n openAfterDelay(event.currentTarget);\n },\n onMouseLeave: (event: ReactMouseEvent<HTMLElement>) => {\n children.props.onMouseLeave?.(event);\n close();\n },\n onFocus: (event: ReactFocusEvent<HTMLElement>) => {\n children.props.onFocus?.(event);\n openNow(event.currentTarget);\n },\n onBlur: (event: ReactFocusEvent<HTMLElement>) => {\n children.props.onBlur?.(event);\n close();\n },\n });\n\n return (\n <>\n {/*\n `display: contents` — the wrapper exists in the DOM but generates no\n box, so it cannot disturb the trigger's own flex/grid placement. It is\n here only to carry the describedby relationship at the trigger's parent\n as well as on the trigger itself; the behaviour all lives on the cloned\n child, which is what actually has a hover target.\n */}\n <span\n className={`${styles.wrapper} ${className ?? ''}`}\n aria-describedby={describedBy}\n /*\n A DISABLED trigger emits no pointer events at all, so handlers on the\n cloned child can never fire and its tooltip could never open — which\n is precisely the tooltip that matters, since it is the one explaining\n WHY the control is disabled. When the child is disabled the wrapper\n stops being `display: contents`, takes a box of its own, and carries\n the hover itself. Focus is not mirrored here: a disabled control is\n not focusable, so there is no focus to mirror.\n */\n data-disabled-trigger={triggerDisabled ? 'true' : undefined}\n onMouseOver={triggerDisabled ? (event) => openNow(event.currentTarget) : undefined}\n onMouseOut={triggerDisabled ? close : undefined}\n >\n {trigger}\n </span>\n {open\n ? createPortal(\n <div\n ref={bubbleRef}\n role=\"tooltip\"\n id={id}\n className={styles.bubble}\n data-placement={position?.placement ?? placement}\n style={{\n // Inline, though the stylesheet says it too: `left`/`top`\n // below are VIEWPORT coordinates, and they only mean that\n // under `fixed`. The two travel together or the bubble lands\n // somewhere arbitrary.\n position: 'fixed',\n left: position ? `${position.left}px` : '0px',\n top: position ? `${position.top}px` : '0px',\n // Hidden until measured, but still laid out — the measurement\n // needs a real offsetWidth, and `visibility` gives one where\n // `display: none` would not.\n visibility: position ? 'visible' : 'hidden',\n }}\n >\n <span className={styles.label}>{body}</span>\n {shortcut ? <kbd className={styles.shortcut}>{shortcut}</kbd> : null}\n </div>,\n document.body,\n )\n : null}\n </>\n );\n}\n",".wrap {\n display: flex;\n flex-direction: column;\n gap: var(--space-1);\n min-width: 0;\n}\n\n.lineWrap {\n width: 100%;\n}\n\n.head {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: var(--space-2);\n}\n\n.label {\n font-size: var(--text-xs-size);\n line-height: var(--text-xs-line);\n color: var(--text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value {\n flex: none;\n font-family: var(--font-display);\n font-variant-numeric: tabular-nums;\n font-size: var(--text-xs-size);\n letter-spacing: var(--tracking-display);\n color: var(--text-secondary);\n}\n\n.unknown {\n font-family: var(--font-ui);\n font-style: italic;\n color: var(--status-unknown-fg);\n}\n\n.track {\n width: 100%;\n overflow: hidden;\n background: var(--bg-active);\n}\n\n.bar {\n height: 4px;\n border-radius: var(--radius-full);\n}\n\n/* The 2px rule that sits under a header strip — square, full-bleed. */\n.line {\n height: 2px;\n border-radius: 0;\n background: var(--border-subtle);\n}\n\n.fill {\n height: 100%;\n transition: width var(--duration-base) var(--ease-standard);\n}\n\n.accent {\n background: var(--accent-500);\n}\n.neutral {\n background: var(--status-neutral-solid);\n}\n.running {\n background: var(--status-running-solid);\n}\n.warning {\n background: var(--status-warning-solid);\n}\n.danger {\n background: var(--status-danger-solid);\n}\n.engine {\n background: var(--status-neutral-solid);\n}\n","/**\n * components/primitives/Meter.tsx — occupancy against a limit: context\n * window, daily spend against the cap, a plan's usage window.\n *\n * Two forms, one component:\n * variant=\"line\" the 2px full-width rule the design language puts\n * directly under a header strip. No text of its own —\n * wrap it in <Tooltip> and put the numbers beside it.\n * variant=\"labelled\" a 4px bar with a label and a right-aligned\n * \"18k / 66k\" in the display face.\n *\n * Tone thresholds match the V1 context meter (amber >= 70%, danger >= 90%)\n * and are ALWAYS paired with the readable value, never color alone.\n * An unknown limit renders an honest empty track and the text \"unknown\" —\n * never a full bar, never zero (DESIGN.md §7).\n */\nimport type { ReactNode } from 'react';\nimport styles from './Meter.module.css';\n\nexport type MeterTone = 'accent' | 'neutral' | 'running' | 'warning' | 'danger' | 'engine';\n\nexport interface MeterProps {\n /** Current value. null = genuinely unknown. */\n value: number | null;\n /** Limit. null/0 = unknown limit; the meter says so instead of guessing. */\n max: number | null;\n variant?: 'line' | 'labelled';\n label?: ReactNode;\n /** Right-aligned readout. Defaults to `value / max` formatted compactly. */\n valueText?: ReactNode;\n /** Force a tone; by default it is derived from the percentage. */\n tone?: MeterTone;\n /** For tone=\"engine\": the CSS color to paint the fill (an --engine-* var). */\n engineColor?: string;\n /** Accessible name when no visible label is rendered (the line variant). */\n 'aria-label'?: string;\n className?: string;\n}\n\nfunction compact(n: number): string {\n if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n >= 10_000_000 ? 0 : 1)}m`;\n if (n >= 1_000) return `${(n / 1_000).toFixed(n >= 10_000 ? 0 : 1)}k`;\n return String(Math.round(n));\n}\n\nexport function toneForPercent(percent: number): MeterTone {\n if (percent >= 90) return 'danger';\n if (percent >= 70) return 'warning';\n return 'accent';\n}\n\nexport function Meter({\n value,\n max,\n variant = 'labelled',\n label,\n valueText,\n tone,\n engineColor,\n className,\n ...aria\n}: MeterProps) {\n const known = value !== null && Number.isFinite(value) && max !== null && Number.isFinite(max) && max > 0;\n const percent = known ? Math.min(100, Math.max(0, (value! / max!) * 100)) : 0;\n const resolvedTone = tone ?? (known ? toneForPercent(percent) : 'neutral');\n const readout = known ? (valueText ?? `${compact(value!)} / ${compact(max!)}`) : (valueText ?? 'unknown');\n\n const track = (\n <div\n className={`${styles.track} ${variant === 'line' ? styles.line : styles.bar}`}\n role=\"meter\"\n aria-valuenow={known ? Math.round(percent) : undefined}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuetext={known ? `${Math.round(percent)}%` : 'unknown'}\n {...aria}\n >\n <div\n className={`${styles.fill} ${styles[resolvedTone]}`}\n style={{\n width: `${percent}%`,\n ...(resolvedTone === 'engine' && engineColor ? { background: engineColor } : {}),\n }}\n />\n </div>\n );\n\n if (variant === 'line') return <div className={`${styles.lineWrap} ${className ?? ''}`}>{track}</div>;\n\n return (\n <div className={`${styles.wrap} ${className ?? ''}`}>\n {label || readout ? (\n <div className={styles.head}>\n {label ? <span className={styles.label}>{label}</span> : <span />}\n <span className={`${styles.value} ${known ? '' : styles.unknown}`}>{readout}</span>\n </div>\n ) : null}\n {track}\n </div>\n );\n}\n"],"mappings":"0OCyDM,EAAgB,IAEhB,EAAM,EAEN,EAAS,EAqCf,SAAS,EAAW,EAAiD,CACnE,IAAM,EAAuD,CAC3D,IAAK,SAAU,OAAQ,MAAO,KAAM,QAAS,MAAO,MACtD,EACM,EAAQ,CAAC,MAAO,SAAU,QAAS,MAAM,CAAC,CAAW,OACxD,GAAM,IAAM,GAAa,IAAM,EAAS,EAC3C,EACA,MAAO,CAAC,EAAW,EAAS,GAAY,GAAG,CAAI,CACjD,CAEA,SAAS,EAAM,EAA6B,EAAkB,EAAW,EAA0C,CACjH,OAAQ,EAAR,CACE,IAAK,MAAO,MAAO,CAAE,KAAM,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAAI,EAAG,IAAK,EAAQ,IAAM,EAAI,CAAI,EAChG,IAAK,SAAU,MAAO,CAAE,KAAM,EAAQ,KAAO,EAAQ,MAAQ,EAAI,EAAI,EAAG,IAAK,EAAQ,OAAS,CAAI,EAClG,IAAK,OAAQ,MAAO,CAAE,KAAM,EAAQ,KAAO,EAAI,EAAK,IAAK,EAAQ,IAAM,EAAQ,OAAS,EAAI,EAAI,CAAE,EAClG,IAAK,QAAS,MAAO,CAAE,KAAM,EAAQ,MAAQ,EAAK,IAAK,EAAQ,IAAM,EAAQ,OAAS,EAAI,EAAI,CAAE,CAClG,CACF,CAOA,SAAS,EAAQ,EAAkB,EAAW,EAAW,EAAuC,CAC9F,IAAM,EAAK,OAAO,YAAc,EAC1B,EAAK,OAAO,aAAe,EAC7B,EAA4B,KAChC,IAAK,IAAM,KAAa,EAAW,CAAS,EAAG,CAC7C,GAAM,CAAE,OAAM,OAAQ,EAAM,EAAW,EAAS,EAAG,CAAC,EAGpD,GAFA,AAAe,IAAW,CAAE,OAAM,MAAK,WAAU,EACpC,GAAQ,GAAU,GAAO,GAAU,EAAO,GAAK,EAAK,GAAU,EAAM,GAAK,EAAK,EACjF,MAAO,CAAE,OAAM,MAAK,WAAU,CAC1C,CACA,IAAM,EAAS,EACf,MAAO,CACL,UAAW,EAAO,UAClB,KAAM,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAO,KAAM,EAAK,EAAI,CAAM,CAAC,EAC7D,IAAK,KAAK,IAAI,EAAQ,KAAK,IAAI,EAAO,IAAK,EAAK,EAAI,CAAM,CAAC,CAC7D,CACF,CAEA,SAAgB,EAAQ,EAAqB,CAC3C,GAAM,CAAE,QAAO,UAAS,WAAU,YAAY,MAAO,WAAW,GAAO,YAAW,YAAa,EACzF,CAAC,EAAM,IAAA,EAAW,EAAA,SAAA,CAAS,EAAK,EAChC,CAAC,EAAU,IAAA,EAAe,EAAA,SAAA,CAA0B,IAAI,EACxD,GAAA,EAAK,EAAA,MAAA,CAAM,EACX,GAAA,EAAa,EAAA,OAAA,CAA2B,IAAI,EAC5C,GAAA,EAAY,EAAA,OAAA,CAA8B,IAAI,EAC9C,GAAA,EAAQ,EAAA,OAAA,CAA6C,IAAI,EAEzD,GAAA,EAAc,EAAA,YAAA,KAAkB,CAChC,EAAM,UAAY,OACpB,aAAa,EAAM,OAAO,EAC1B,EAAM,QAAU,KAEpB,EAAG,CAAC,CAAC,EAEC,GAAA,EAAQ,EAAA,YAAA,KAAkB,CAC9B,EAAY,EACZ,EAAQ,EAAK,EACb,EAAY,IAAI,CAClB,EAAG,CAAC,CAAW,CAAC,GAGhB,EAAA,EAAA,UAAA,KAAgB,EAAa,CAAC,CAAW,CAAC,EAE1C,IAAM,GAAA,EAAa,EAAA,YAAA,KAAkB,CACnC,IAAM,EAAU,EAAW,QACrB,EAAS,EAAU,QACzB,GAAI,CAAC,GAAW,CAAC,EAAQ,OACzB,IAAM,EAAO,EAAQ,sBAAsB,EAC3C,EAAY,EAAQ,EAAM,EAAO,YAAa,EAAO,aAAc,CAAS,CAAC,CAC/E,EAAG,CAAC,CAAS,CAAC,GAId,EAAA,EAAA,gBAAA,KAAsB,CACf,GACL,EAAW,CACb,EAAG,CAAC,EAAM,CAAU,CAAC,GAKrB,EAAA,EAAA,UAAA,KAAgB,CACd,GAAI,CAAC,EAAM,OACX,SAAS,EAAU,EAAiC,CAC9C,EAAM,MAAQ,UAAU,EAAM,CACpC,CAMA,OALA,SAAS,iBAAiB,UAAW,CAAS,EAC9C,OAAO,iBAAiB,SAAU,CAAU,EAG5C,OAAO,iBAAiB,SAAU,EAAY,EAAI,MACrC,CACX,SAAS,oBAAoB,UAAW,CAAS,EACjD,OAAO,oBAAoB,SAAU,CAAU,EAC/C,OAAO,oBAAoB,SAAU,EAAY,EAAI,CACvD,CACF,EAAG,CAAC,EAAM,EAAO,CAAU,CAAC,EAE5B,IAAM,EAAO,GAAS,EAEtB,GAAI,GADU,GAAS,MAA8B,IAAS,GACvC,OAAO,EAE9B,SAAS,EAAe,EAAsB,CAC5C,EAAW,QAAU,EACrB,EAAY,EACZ,EAAM,QAAU,eAAiB,CAC/B,EAAM,QAAU,KAChB,EAAQ,EAAI,CACd,EAAG,CAAa,CAClB,CAEA,SAAS,EAAQ,EAAsB,CACrC,EAAW,QAAU,EACrB,EAAY,EACZ,EAAQ,EAAI,CACd,CAEA,IAAM,EAAkB,EAAS,MAAM,WAAa,GAC9C,EAAc,EAAO,EAAK,IAAA,GAE1B,GAAA,EAAU,EAAA,aAAA,CAAa,EAAU,CACrC,mBAAoB,EACpB,aAAe,GAAwC,CACrD,EAAS,MAAM,eAAe,CAAK,EACnC,EAAe,EAAM,aAAa,CACpC,EACA,aAAe,GAAwC,CACrD,EAAS,MAAM,eAAe,CAAK,EACnC,EAAM,CACR,EACA,QAAU,GAAwC,CAChD,EAAS,MAAM,UAAU,CAAK,EAC9B,EAAQ,EAAM,aAAa,CAC7B,EACA,OAAS,GAAwC,CAC/C,EAAS,MAAM,SAAS,CAAK,EAC7B,EAAM,CACR,CACF,CAAC,EAED,OACE,EAAA,EAAA,KAAA,CAAA,EAAA,SAAA,CAAA,SAAA,EAQE,EAAA,EAAA,IAAA,CAAC,OAAD,CACE,UAAW,GAAG,EAAO,QAAQ,GAAG,GAAa,KAC7C,mBAAkB,EAUlB,wBAAuB,EAAkB,OAAS,IAAA,GAClD,YAAa,EAAmB,GAAU,EAAQ,EAAM,aAAa,EAAI,IAAA,GACzE,WAAY,EAAkB,EAAQ,IAAA,GAErC,SAAA,CACG,CAAA,EACL,GAAA,EACG,EAAA,aAAA,EACE,EAAA,EAAA,KAAA,CAAC,MAAD,CACE,IAAK,EACL,KAAK,UACD,KACJ,UAAW,EAAO,OAClB,iBAAgB,GAAU,WAAa,EACvC,MAAO,CAKL,SAAU,QACV,KAAM,EAAW,GAAG,EAAS,KAAK,IAAM,MACxC,IAAK,EAAW,GAAG,EAAS,IAAI,IAAM,MAItC,WAAY,EAAW,UAAY,QACrC,EAlBF,SAAA,EAoBE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAO,MAAQ,SAAA,CAAW,CAAA,EAC1C,GAAW,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAO,SAAW,SAAA,CAAc,CAAA,EAAI,IAC7D,CACL,CAAA,EAAA,SAAS,IACX,EACA,IACJ,CAAA,CAAA,CAEN,sZEpQA,SAAS,EAAQ,EAAmB,CAGlC,OAFI,GAAK,IAAkB,IAAI,EAAI,IAAA,CAAW,QAAQ,GAAK,IAAa,EAAI,CAAC,EAAE,GAC3E,GAAK,IAAc,IAAI,EAAI,IAAA,CAAO,QAAQ,GAAK,IAAS,EAAI,CAAC,EAAE,GAC5D,OAAO,KAAK,MAAM,CAAC,CAAC,CAC7B,CAEA,SAAgB,EAAe,EAA4B,CAGzD,OAFI,GAAW,GAAW,SACtB,GAAW,GAAW,UACnB,QACT,CAEA,SAAgB,EAAM,CACpB,QACA,MACA,UAAU,WACV,QACA,YACA,OACA,cACA,YACA,GAAG,GACU,CACb,IAAM,EAAQ,IAAU,MAAQ,OAAO,SAAS,CAAK,GAAK,IAAQ,MAAQ,OAAO,SAAS,CAAG,GAAK,EAAM,EAClG,EAAU,EAAQ,KAAK,IAAI,IAAK,KAAK,IAAI,EAAI,EAAS,EAAQ,GAAG,CAAC,EAAI,EACtE,EAAe,IAAS,EAAQ,EAAe,CAAO,EAAI,WAC1D,EAAU,EAAS,GAAa,GAAG,EAAQ,CAAM,EAAE,KAAK,EAAQ,CAAI,IAAQ,GAAa,UAEzF,GACJ,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,UAAW,GAAG,EAAO,MAAM,GAAG,IAAY,OAAS,EAAO,KAAO,EAAO,MACxE,KAAK,QACL,gBAAe,EAAQ,KAAK,MAAM,CAAO,EAAI,IAAA,GAC7C,gBAAe,EACf,gBAAe,IACf,iBAAgB,EAAQ,GAAG,KAAK,MAAM,CAAO,EAAE,GAAK,UACpD,GAAI,EAEJ,UAAA,EAAA,EAAA,IAAA,CAAC,MAAD,CACE,UAAW,GAAG,EAAO,KAAK,GAAG,EAAO,KACpC,MAAO,CACL,MAAO,GAAG,EAAQ,GAClB,GAAI,IAAiB,UAAY,EAAc,CAAE,WAAY,CAAY,EAAI,CAAC,CAChF,CACD,CAAA,CACE,CAAA,EAKP,OAFI,IAAY,QAAe,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,SAAS,GAAG,GAAa,KAAO,SAAA,CAAW,CAAA,GAGlG,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,GAAG,EAAO,KAAK,GAAG,GAAa,KAA/C,SAAA,CACG,GAAS,GACR,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAO,KAAvB,SAAA,CACG,GAAQ,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAO,MAAQ,SAAA,CAAY,CAAA,GAAI,EAAA,EAAA,IAAA,CAAC,OAAD,CAAO,CAAA,GAChE,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,GAAG,EAAO,MAAM,GAAG,EAAQ,GAAK,EAAO,UAAY,SAAA,CAAc,CAAA,CAC/E,CACH,CAAA,EAAA,KACH,CACE,GAET"}
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./index-CZamKRUg.js";import{C as r,O as i,S as a,T as o,_ as s,g as c,h as l,k as u,p as d,w as f}from"./global-D6bTxIRn.js";import{t as p}from"./Dialog-CPM9JxBc.js";import{r as m}from"./RouteErrorBoundary-Badio_uO.js";import{t as h}from"./Meter--h3MmZS-.js";import{f as g,h as _,l as v,m as y,p as ee,r as b,s as te,t as ne,y as x}from"./icons-D9vlf85u.js";import{B as S,H as C,I as w,L as T,R as E,S as D,V as O,x as k}from"./VerseConsoleApp-CsIQv9id.js";var A={section:`_section_3qpbp_5`,strip:`_strip_3qpbp_13`,stripTitle:`_stripTitle_3qpbp_25`,scroll:`_scroll_3qpbp_32`,column:`_column_3qpbp_38`,panel:`_panel_3qpbp_51`,panelHead:`_panelHead_3qpbp_56`,panelTitle:`_panelTitle_3qpbp_64`,panelBody:`_panelBody_3qpbp_74`,row:`_row_3qpbp_81`,rowStacked:`_rowStacked_3qpbp_90`,rowText:`_rowText_3qpbp_95`,rowLabel:`_rowLabel_3qpbp_99`,rowDescription:`_rowDescription_3qpbp_107`,rowControl:`_rowControl_3qpbp_114`,swatches:`_swatches_3qpbp_140`,swatch:`_swatch_3qpbp_140`,swatchCheck:`_swatchCheck_3qpbp_165`,sliderStack:`_sliderStack_3qpbp_173`,contrastWarning:`_contrastWarning_3qpbp_180`,preview:`_preview_3qpbp_197`,previewRow:`_previewRow_3qpbp_207`,previewHeading:`_previewHeading_3qpbp_214`,previewBody:`_previewBody_3qpbp_222`,previewNumerals:`_previewNumerals_3qpbp_228`,origin:`_origin_3qpbp_238`,note:`_note_3qpbp_242`,noteIcon:`_noteIcon_3qpbp_258`,code:`_code_3qpbp_249`,shortcuts:`_shortcuts_3qpbp_278`,shortcut:`_shortcut_3qpbp_278`,keys:`_keys_3qpbp_294`,key:`_key_3qpbp_294`,about:`_about_3qpbp_315`,aboutLine:`_aboutLine_3qpbp_321`,aboutName:`_aboutName_3qpbp_329`,link:`_link_3qpbp_338`},j=t();function M({title:e,action:t,children:n}){return(0,j.jsxs)(`section`,{className:A.panel,children:[(0,j.jsxs)(`div`,{className:A.panelHead,children:[(0,j.jsx)(`h3`,{className:A.panelTitle,children:e}),t]}),(0,j.jsx)(`div`,{className:A.panelBody,children:n})]})}function N({label:e,description:t,htmlFor:n,labelId:r,stacked:i=!1,children:a}){let o=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:A.rowLabel,id:r,children:e}),t?(0,j.jsx)(`span`,{className:A.rowDescription,children:t}):null]});return(0,j.jsxs)(`div`,{className:`${A.row} ${i?A.rowStacked:``}`,children:[(0,j.jsx)(`div`,{className:A.rowText,children:n?(0,j.jsx)(`label`,{htmlFor:n,className:A.rowText,children:o}):o}),(0,j.jsx)(`div`,{className:A.rowControl,children:a})]})}function P(e,t){return e?`Last completed ${new Date(e).toLocaleDateString()}.`:t?`Skipped. Nothing was missed — it is all reachable from the sections themselves.`:`Not seen yet.`}function F(){let{completedAt:e,dismissedAt:t,open:n}=k();return(0,j.jsx)(M,{title:`Onboarding`,children:(0,j.jsx)(N,{label:`Replay the first-run tour`,description:`Your connected seats, whether a local runtime is available, and what each of the three stop controls really halts. ${P(e,t)}`,children:(0,j.jsx)(C,{variant:`subtle`,size:`sm`,onClick:D,disabled:n,children:n?`Showing`:`Replay`})})})}var I=`3.7.0`,L=`Ashlr Verse`;function R(){return(0,j.jsx)(M,{title:`About`,children:(0,j.jsx)(`div`,{className:`${A.row} ${A.rowStacked}`,children:(0,j.jsxs)(`div`,{className:A.about,children:[(0,j.jsx)(`p`,{className:A.aboutName,children:L}),(0,j.jsxs)(`p`,{className:A.aboutLine,children:[(0,j.jsxs)(w,{mono:!0,children:[`v`,I]}),(0,j.jsx)(`span`,{children:`ashlr-hub — local-first command center for agentic engineers.`})]}),(0,j.jsx)(`p`,{className:A.aboutLine,children:`Every session, token and artifact stays on this machine. The console talks to one local server and no third-party service.`}),(0,j.jsx)(`p`,{className:A.aboutLine,children:(0,j.jsxs)(`a`,{className:A.link,href:`https://github.com/ashlrai/ashlr-hub`,target:`_blank`,rel:`noreferrer noopener`,children:[`Source and changelog`,(0,j.jsx)(v,{size:12})]})})]})})})}var z=n(e(),1),B=/^#([0-9a-f]{3,8})$/i,V=/^(rgba?|hsla?)\(([^)]*)\)$/i;function H(e,t,n){return Math.min(n,Math.max(t,e))}function U(e,t){let n=e.trim();return n.endsWith(`%`)?Number.parseFloat(n)/100*t:Number.parseFloat(n)}function W(e,t,n){let r=(e%360+360)%360,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(r/60%2-1)),o=n-i/2,s;return s=r<60?[i,a,0]:r<120?[a,i,0]:r<180?[0,i,a]:r<240?[0,a,i]:r<300?[a,0,i]:[i,0,a],{r:Math.round((s[0]+o)*255),g:Math.round((s[1]+o)*255),b:Math.round((s[2]+o)*255)}}function G(e){let t=[],n=0,r=``;for(let i of e){if(i===`(`?n+=1:i===`)`&&--n,i===`,`&&n===0){t.push(r),r=``;continue}r+=i}return t.push(r),t.map(e=>e.trim()).filter(e=>e.length>0)}function K(e){let t=e.trim(),n=/\s(\d*\.?\d+)%$/.exec(t);if(n)return{color:t.slice(0,n.index).trim(),pct:Number.parseFloat(n[1])};let r=/^(\d*\.?\d+)%\s/.exec(t);return r?{color:t.slice(r[0].length).trim(),pct:Number.parseFloat(r[1])}:{color:t,pct:null}}function q(e){let t=/^color-mix\((.*)\)$/is.exec(e.trim());if(!t)return null;let n=G(t[1]);if(n.length!==3||n[0].replace(/\s+/g,` `).trim()!==`in srgb`)return null;let r=K(n[1]),i=K(n[2]);if(!r||!i)return null;let a=J(r.color),o=J(i.color);if(!a||!o)return null;let s=r.pct,c=i.pct;s===null&&c===null?(s=50,c=50):s===null?s=100-c:c===null&&(c=100-s);let l=s+c;if(l<=0)return null;let u=s/l,d=c/l,f=a.a*u+o.a*d;if(f<=0)return{r:0,g:0,b:0,a:0};let p=e=>H(Math.round((a[e]*a.a*u+o[e]*o.a*d)/f),0,255);return{r:p(`r`),g:p(`g`),b:p(`b`),a:H(f,0,1)}}function J(e){let t=e.trim().toLowerCase();if(t===`transparent`)return{r:0,g:0,b:0,a:0};if(t.startsWith(`color-mix(`))return q(t);let n=B.exec(t);if(n){let e=n[1],t=e=>Number.parseInt(e.length===1?e+e:e,16);return e.length===3||e.length===4?{r:t(e[0]),g:t(e[1]),b:t(e[2]),a:e.length===4?t(e[3])/255:1}:e.length===6||e.length===8?{r:t(e.slice(0,2)),g:t(e.slice(2,4)),b:t(e.slice(4,6)),a:e.length===8?t(e.slice(6,8))/255:1}:null}let r=V.exec(t);if(!r)return null;let i=r[1],a=r[2].replace(/\//g,` `).split(/[\s,]+/).filter(Boolean);if(a.length<3)return null;let o=a.length>=4?H(U(a[3],1),0,1):1;if(i.startsWith(`rgb`))return{r:H(Math.round(U(a[0],255)),0,255),g:H(Math.round(U(a[1],255)),0,255),b:H(Math.round(U(a[2],255)),0,255),a:o};let s=Number.parseFloat(a[0]),c=H(U(a[1],1),0,1),l=H(U(a[2],1),0,1);return Number.isFinite(s)?{...W(s,c,l),a:o}:null}function Y(e,t){if(e.a>=1)return e;let n=e.a;return{r:Math.round(e.r*n+t.r*(1-n)),g:Math.round(e.g*n+t.g*(1-n)),b:Math.round(e.b*n+t.b*(1-n)),a:1}}function X(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Z(e,t,n=`#ffffff`){let r=J(t),i=J(e),a=J(n);if(!r||!i||!a)return null;let o=Y(r,a),s=X(Y(i,o)),c=X(o),[l,u]=s>=c?[s,c]:[c,s];return(l+.05)/(u+.05)}function Q(e,t,n,r=0){let i=W(e,H(t,0,100)/100,H(n+r,0,100)/100),a=e=>e.toString(16).padStart(2,`0`);return`#${a(i.r)}${a(i.g)}${a(i.b)}`}var re=`#ffffff`,ie=`#121214`,ae=[{value:`system`,label:`System`,icon:(0,j.jsx)(y,{})},{value:`light`,label:`Light`,icon:(0,j.jsx)(x,{})},{value:`dark`,label:`Dark`,icon:(0,j.jsx)(_,{})}],oe=[{value:`default`,label:`Default`},{value:`large`,label:`Large`},{value:`xlarge`,label:`Extra large`}],se=[{value:`comfortable`,label:`Comfortable`},{value:`compact`,label:`Compact`}],ce=[{value:`grotesk`,label:`Space Grotesk`},{value:`ui`,label:`UI sans`},{value:`mono`,label:`Mono`}],le=[{value:`sharp`,label:`Sharp`},{value:`default`,label:`Default`},{value:`soft`,label:`Soft`}];function ue(e,t){return`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(n=>`${Q(n,e,t)} ${n/360*100}%`).join(`, `)})`}function de(e,t,n){let r=Q(e,t,n,-8),i=Q(e,t,n,14),a=Z(r,re),o=Z(i,ie),s=[];return a!==null&&a<4.5&&s.push(`light`),o!==null&&o<4.5&&s.push(`dark`),{lightRatio:a,darkRatio:o,failing:s}}function fe({appearance:e,onChange:t,onReset:n}){let i=(0,z.useId)(),s=(0,z.useId)(),c=(0,z.useId)(),l=(0,z.useId)(),u=(0,z.useId)(),p=o(e),m=de(e.accentH,e.accentS,e.accentL);return(0,j.jsxs)(M,{title:`Appearance`,action:(0,j.jsx)(C,{variant:`ghost`,size:`sm`,onClick:n,disabled:f(e),title:`Restore the shipped theme, accent, display size, density, font, radius and motion`,children:`Reset to defaults`}),children:[(0,j.jsx)(N,{label:`Theme`,description:`System follows your OS appearance setting.`,children:(0,j.jsx)(S,{"aria-label":`Theme`,options:ae,value:e.theme,onChange:e=>t({theme:e})})}),(0,j.jsx)(N,{label:`Accent`,labelId:i,description:p?`${p.label} — used for links, focus rings and the one primary action per surface.`:`Custom hue — used for links, focus rings and the one primary action per surface.`,children:(0,j.jsx)(`div`,{className:A.swatches,role:`radiogroup`,"aria-labelledby":i,children:r.map(e=>{let n=p?.id===e.id;return(0,j.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":n,"aria-label":e.label,tabIndex:n||!p&&e.id===r[0].id?0:-1,className:A.swatch,style:{background:Q(e.h,e.s,e.l)},onClick:()=>t({accentH:e.h,accentS:e.s,accentL:e.l}),children:n?(0,j.jsx)(`span`,{className:A.swatchCheck,children:(0,j.jsx)(b,{size:12})}):null},e.id)})})}),(0,j.jsx)(N,{label:`Accent channels`,description:`Hue, saturation and lightness are written straight onto the root element — the whole app follows as you drag.`,stacked:!0,children:(0,j.jsxs)(`div`,{className:A.sliderStack,children:[(0,j.jsx)(E,{id:s,label:`Hue`,min:0,max:359,value:e.accentH,valueLabel:`${e.accentH}°`,valueText:`${e.accentH} degrees`,trackImage:ue(e.accentS,e.accentL),onChange:e=>t({accentH:Number(e.currentTarget.value)})}),(0,j.jsx)(E,{id:c,label:`Saturation`,min:0,max:100,value:e.accentS,valueLabel:`${e.accentS}%`,valueText:`${e.accentS} percent`,onChange:e=>t({accentS:Number(e.currentTarget.value)})}),(0,j.jsx)(E,{id:l,label:`Lightness`,min:a.min,max:a.max,value:e.accentL,valueLabel:`${e.accentL}%`,valueText:`${e.accentL} percent`,onChange:e=>t({accentL:Number(e.currentTarget.value)})}),m.failing.length>0?(0,j.jsxs)(`p`,{className:A.contrastWarning,role:`status`,children:[(0,j.jsx)(ne,{size:14}),(0,j.jsxs)(`span`,{children:[`This accent falls below 4.5:1 as link text in`,` `,m.failing.length===2?`both themes`:`${m.failing[0]} mode`,`. Raise or lower the lightness to keep it readable.`]})]}):null]})}),(0,j.jsx)(N,{label:`Display size`,description:`Scales text AND spacing together across the whole app, for a large display or a long session. Applies as you pick it.`,children:(0,j.jsx)(S,{"aria-label":`Display size`,options:oe,value:e.uiScale,onChange:e=>t({uiScale:e})})}),(0,j.jsx)(N,{label:`Density`,description:`Row height and control padding across every view. Independent of display size — a large, tightly packed interface is a valid choice.`,children:(0,j.jsx)(S,{"aria-label":`Density`,options:se,value:e.density,onChange:e=>t({density:e})})}),(0,j.jsx)(N,{label:`Display font`,description:`Titles, seat names, metrics and numerals. Body copy stays in the UI sans.`,children:(0,j.jsx)(S,{"aria-label":`Display font`,options:ce,value:e.displayFont,onChange:e=>t({displayFont:e})})}),(0,j.jsx)(N,{label:`Corner radius`,description:`Sharp reads like a terminal; soft reads like a consumer app.`,children:(0,j.jsx)(S,{"aria-label":`Corner radius`,options:le,value:e.radius,onChange:e=>t({radius:e})})}),(0,j.jsx)(N,{label:`Reduce motion`,htmlFor:u,description:`Collapses every transition to 1ms. Defaults to your system preference; turning it off here overrides that.`,children:(0,j.jsx)(T,{id:u,checked:e.reduceMotion,onChange:e=>t({reduceMotion:e}),"aria-label":`Reduce motion`})}),(0,j.jsx)(N,{label:`Preview`,description:`Live — these are the real primitives, not a picture of them.`,stacked:!0,children:(0,j.jsxs)(`div`,{className:A.preview,children:[(0,j.jsx)(`p`,{className:A.previewHeading,children:`Ashlr Verse`}),(0,j.jsxs)(`p`,{className:A.previewBody,children:[`Body copy stays in the UI sans at the reading measure; numerals like`,` `,(0,j.jsx)(`span`,{className:A.previewNumerals,children:`18,420 / 66,000`}),` use the display face.`]}),(0,j.jsxs)(`div`,{className:A.previewRow,children:[(0,j.jsx)(C,{variant:`primary`,size:`sm`,children:`Primary`}),(0,j.jsx)(C,{variant:`subtle`,size:`sm`,children:`Subtle`}),(0,j.jsx)(C,{variant:`ghost`,size:`sm`,children:`Ghost`}),(0,j.jsx)(C,{variant:`danger`,size:`sm`,children:`Destructive`})]}),(0,j.jsxs)(`div`,{className:A.previewRow,children:[(0,j.jsx)(d,{status:`running`}),(0,j.jsx)(w,{engine:`claude`,children:`Claude Max`}),(0,j.jsx)(w,{engine:`local`,mono:!0,children:`qwen3-coder`})]}),(0,j.jsx)(h,{value:18420,max:66e3,label:`Context`}),(0,j.jsx)(O,{"aria-label":`Preview field`,placeholder:`A field at the current density`,size:`sm`})]})})]})}function pe(e){if(e===null)return`locked`;let t=Math.max(0,Math.round((e-Date.now())/6e4));return t<=0?`expiring now`:`unlocked for ${t} more minute${t===1?``:`s`}`}function $(){let e=c(),t=s(),n=m(),[r,a]=(0,z.useState)(!1),o=(0,z.useRef)(null),l=typeof window>`u`?``:window.location.origin;async function f(){try{await navigator.clipboard.writeText(l),n.show(`Server address copied.`)}catch{n.show(`Could not reach the clipboard — select the field and copy manually.`,`danger`)}}async function h(){a(!1),await u(),n.show(`Disconnected. Paste the read token to reconnect.`)}return(0,j.jsxs)(M,{title:`Connection`,children:[(0,j.jsxs)(N,{label:`Server`,description:`This window talks to one local hub. Nothing leaves your machine.`,children:[(0,j.jsx)(`div`,{className:A.origin,children:(0,j.jsx)(O,{value:l,readOnly:!0,mono:!0,size:`sm`,"aria-label":`Server address`})}),(0,j.jsx)(C,{variant:`ghost`,size:`sm`,icon:(0,j.jsx)(te,{}),onClick:()=>void f(),children:`Copy`})]}),(0,j.jsx)(N,{label:`Read session`,description:`A 15-minute signed cookie, renewed silently while this tab stays open.`,children:(0,j.jsx)(d,{status:e===`authenticated`?`connected`:e===`checking`?`checking`:`disconnected`,tone:e===`authenticated`?`success`:e===`checking`?`running`:`danger`})}),(0,j.jsxs)(N,{label:`Mutation hold`,description:`Every action that changes something needs the mutation token. It is held in memory only, never stored, and clears when this tab closes.`,children:[(0,j.jsx)(d,{status:t.hasHold?pe(t.heldUntil):`locked`,tone:t.hasHold?`success`:`neutral`}),(0,j.jsx)(C,{variant:`subtle`,size:`sm`,icon:(0,j.jsx)(ee,{}),onClick:()=>{i(),n.show(`Mutation hold cleared.`)},disabled:!t.hasHold,children:`Lock now`})]}),(0,j.jsx)(N,{label:`Disconnect`,description:`Ends the read session in this browser and clears the mutation hold. Chats on the server are untouched.`,children:(0,j.jsx)(C,{variant:`danger`,size:`sm`,onClick:()=>a(!0),children:`Disconnect`})}),(0,j.jsx)(`div`,{className:A.row,children:(0,j.jsxs)(`p`,{className:A.note,children:[(0,j.jsx)(`span`,{className:A.noteIcon,children:(0,j.jsx)(g,{size:14})}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Where the tokens come from.`}),` Start the console with`,` `,(0,j.jsx)(`code`,{className:A.code,children:`ashlr verse`}),` — it prints a read token and a mutation token in that terminal, and opens this page. The desktop app injects both for you. Tokens are never displayed here, and the hub never writes them into a page, a log line or an API response. Lost them? Stop the server and start it again; it mints a fresh pair.`]})]})}),(0,j.jsx)(p,{open:r,onClose:()=>a(!1),titleId:`verse-settings-disconnect`,title:`Disconnect from this server?`,description:`You will need the read token again to get back in. Running sessions keep running on the server.`,initialFocusRef:o,children:(0,j.jsxs)(`div`,{className:A.previewRow,style:{justifyContent:`flex-end`},children:[(0,j.jsx)(C,{ref:o,variant:`subtle`,onClick:()=>a(!1),children:`Cancel`}),(0,j.jsx)(C,{variant:`danger`,onClick:()=>void h(),children:`Disconnect`})]})})]})}function me(){if(typeof navigator>`u`)return!0;let e=`${navigator.platform??``} ${navigator.userAgent??``}`;return/mac|iphone|ipad|ipod/i.test(e)}function he(e){return[{title:`Navigation`,items:[{keys:[e,`1`],action:`Chat`},{keys:[e,`2`],action:`Autonomy`},{keys:[e,`3`],action:`Approvals`},{keys:[e,`4`],action:`Usage`},{keys:[e,`5`],action:`Settings`},{keys:[e,`K`],action:`Quick switcher`},{keys:[e,`,`],action:`Settings`}]},{title:`Chat`,items:[{keys:[e,`N`],action:`New chat`},{keys:[`Enter`],action:`Send message`},{keys:[`Shift`,`Enter`],action:`New line`},{keys:[`Esc`],action:`Stop dictation / close overlay`}]}]}function ge(){let e=me()?`⌘`:`Ctrl`;return(0,j.jsx)(M,{title:`Keyboard`,children:(0,j.jsx)(`div`,{className:A.shortcuts,children:he(e).flatMap(e=>e.items.map(t=>(0,j.jsxs)(`div`,{className:A.shortcut,children:[(0,j.jsx)(`span`,{children:t.action}),(0,j.jsx)(`span`,{className:A.keys,children:t.keys.map(e=>(0,j.jsx)(`kbd`,{className:A.key,children:e},e))})]},`${e.title}-${t.action}-${t.keys.join(`+`)}`)))})})}function _e(){let{appearance:e,set:t,reset:n}=l();return(0,j.jsxs)(`div`,{className:A.section,children:[(0,j.jsx)(`header`,{className:A.strip,"data-app-region":`drag`,children:(0,j.jsx)(`h2`,{className:A.stripTitle,children:`Settings`})}),(0,j.jsx)(`div`,{className:A.scroll,children:(0,j.jsxs)(`div`,{className:A.column,children:[(0,j.jsx)(fe,{appearance:e,onChange:t,onReset:n}),(0,j.jsx)($,{}),(0,j.jsx)(ge,{}),(0,j.jsx)(F,{}),(0,j.jsx)(R,{})]})})]})}export{_e as SettingsSection};
2
- //# sourceMappingURL=SettingsSection-BwrpQlpP.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./index-CZamKRUg.js";import{K as r,P as i,U as a,g as o,k as s,l as c,n as l,t as u,v as d,x as f,y as p}from"./global-D6bTxIRn.js";import{n as m,t as h}from"./UniverseView-DqcXbed4.js";var g=n(e(),1),_=Object.freeze({"campaign-execution":Object.freeze([`campaign-call-threw`]),"campaign-verification":Object.freeze([`campaign-evidence-changed`]),"delivery-execution":Object.freeze([`delivery-call-threw`]),"delivery-verification":Object.freeze([`delivery-evidence-changed`,`delivery-receipt-unverified`]),"settlement-publication":Object.freeze([`settlement-write-failed`])});function v(e){return typeof e==`string`&&/^[a-z0-9][a-z0-9_-]{0,63}$/.test(e)}function y(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function b(e){return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString()===(e.length===20?e.replace(`Z`,`.000Z`):e)}function x(e){return typeof e==`string`&&/^[a-z0-9][a-z0-9_:-]{0,191}$/.test(e)}function S(e,t){let n=()=>Error(`Controller evidence could not be validated.`);if(!v(t)||!y(e)||e.schemaVersion!==1||e.controllerId!==t||typeof e.sourceState!=`string`||![`healthy`,`missing`,`degraded`].includes(e.sourceState)||typeof e.status!=`string`||![`completed`,`incomplete`,`cancelled`,`timed-out`,`unavailable`,`draining`,`drained`].includes(e.status)||!(e.createdAt===null||b(e.createdAt))||!(e.deadlineAt===null||b(e.deadlineAt))||!b(e.observedAt)||!Array.isArray(e.reasons)||e.reasons.length>128||!e.reasons.every(x)||!Array.isArray(e.outcomes)||e.outcomes.length>64)throw n();let r=new Set,i=e.outcomes.map(e=>{if(!y(e)||typeof e.campaignId!=`string`||!v(e.campaignId)||r.has(e.campaignId)||typeof e.state!=`string`||![`pending`,`in-flight`,`completed`,`held`].includes(e.state)||typeof e.attempted!=`boolean`||!x(e.reasonCode))throw n();return r.add(e.campaignId),{campaignId:e.campaignId,state:e.state,attempted:e.attempted,reasonCode:e.reasonCode}}),a;if(e.topology!==void 0){if(!Array.isArray(e.topology)||e.topology.length>64||e.topology.length!==i.length)throw n();let t=new Set;a=e.topology.map(e=>{if(!y(e)||!v(e.campaignId)||!r.has(e.campaignId)||t.has(e.campaignId))throw n();t.add(e.campaignId);let i=t=>{if(!Array.isArray(t)||t.length>63||!t.every(t=>v(t)&&r.has(t)&&t!==e.campaignId)||new Set(t).size!==t.length)throw n();return[...t]},a=i(e.dependsOn),o=i(e.prerequisites);if(a.some(e=>!o.includes(e)))throw n();return{campaignId:e.campaignId,dependsOn:a,prerequisites:o}});let o=new Map(a.map(e=>[e.campaignId,e])),s=new Set;for(;s.size<a.length;){let e=a.find(e=>!s.has(e.campaignId)&&e.prerequisites.every(e=>s.has(e)));if(!e)throw n();s.add(e.campaignId)}for(let e of a){let t=new Set,r=[...e.dependsOn];for(;r.length;){let e=r.pop();t.has(e)||(t.add(e),r.push(...o.get(e).dependsOn))}if(e.prerequisites.some(e=>!t.has(e)))throw n()}}let o,s;if(e.diagnostics!==void 0){if(!Array.isArray(e.diagnostics)||e.diagnostics.length>i.length)throw n();let t=new Set;s=e.diagnostics.map(e=>{if(!y(e)||!v(e.campaignId)||!r.has(e.campaignId)||t.has(e.campaignId)||i.find(t=>t.campaignId===e.campaignId)?.state===`pending`||typeof e.phase!=`string`||!Object.hasOwn(_,e.phase)||typeof e.code!=`string`||!b(e.at))throw n();let a=e.phase;if(!_[a].includes(e.code))throw n();return t.add(e.campaignId),{campaignId:e.campaignId,phase:a,code:e.code,at:e.at}})}if(e.control!==void 0){let t=e.control;if(!y(t)||typeof t.mode!=`string`||![`open`,`drain`].includes(t.mode)||!Number.isInteger(t.sequence)||t.sequence<1||t.sequence>511||!b(t.requestedAt)||!(t.acknowledgedAt===null||b(t.acknowledgedAt)))throw n();o={mode:t.mode,sequence:t.sequence,requestedAt:t.requestedAt,acknowledgedAt:t.acknowledgedAt}}if(o?.mode===`open`&&o.acknowledgedAt!==null||e.status===`draining`&&(o?.mode!==`drain`||o.acknowledgedAt!==null)||e.status===`drained`&&(o?.mode!==`drain`||o.acknowledgedAt===null))throw n();return{schemaVersion:1,controllerId:t,sourceState:e.sourceState,status:e.status,createdAt:e.createdAt,deadlineAt:e.deadlineAt,observedAt:e.observedAt,reasons:[...e.reasons],outcomes:i,...a?{topology:a}:{},...o?{control:o}:{},...s?{diagnostics:s}:{}}}async function C(e,t){if(!v(e))throw Error(`Enter a valid controller ID.`);return S(await c(`/api/universe/controller-status?controllerId=${encodeURIComponent(e)}`,t),e)}function w(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>(n===`all`||e.state===n)&&(e.campaignId.toLowerCase().includes(r)||e.reasonCode.toLowerCase().includes(r)))}function T(e,t,n){let r=Number.isFinite(n)?Math.max(0,Math.floor(n)):0;if(t===null)return e.slice(0,r);let i=[],a=[];for(let n of e)(n.from===t||n.to===t?i:a).push(n);return[...i,...a].slice(0,r)}var E={topology:`_topology_1rqbo_1`,header:`_header_1rqbo_2`,snapshot:`_snapshot_1rqbo_5`,counts:`_counts_1rqbo_6`,finder:`_finder_1rqbo_10`,finderControls:`_finderControls_1rqbo_11`,searchLabel:`_searchLabel_1rqbo_13`,utilityButton:`_utilityButton_1rqbo_16`,finderMeta:`_finderMeta_1rqbo_19`,results:`_results_1rqbo_22`,result:`_result_1rqbo_22`,resultName:`_resultName_1rqbo_27`,resultState:`_resultState_1rqbo_28`,resultReason:`_resultReason_1rqbo_32`,pagination:`_pagination_1rqbo_33`,noResults:`_noResults_1rqbo_35`,selectionNote:`_selectionNote_1rqbo_36`,workspace:`_workspace_1rqbo_37`,board:`_board_1rqbo_38`,canvas:`_canvas_1rqbo_39`,edges:`_edges_1rqbo_40`,edge:`_edge_1rqbo_40`,selectedEdge:`_selectedEdge_1rqbo_41`,column:`_column_1rqbo_43`,node:`_node_1rqbo_44`,nodeName:`_nodeName_1rqbo_47`,nodeState:`_nodeState_1rqbo_48`,detail:`_detail_1rqbo_52`,detailState:`_detailState_1rqbo_55`,facts:`_facts_1rqbo_59`,relationships:`_relationships_1rqbo_63`,note:`_note_1rqbo_67`,legend:`_legend_1rqbo_67`,empty:`_empty_1rqbo_67`,notice:`_notice_1rqbo_69`,srOnly:`_srOnly_1rqbo_73`},D=t(),O=64,k=256,A=8,j={pending:`Pending`,"in-flight":`Unresolved intent`,completed:`Completed`,held:`Held`},M={pending:`No settled outcome is recorded. Pending does not mean ready to run.`,"in-flight":`A durable dispatch intent remains unresolved. This is not proof of a live worker.`,completed:`The controller recorded completion, including any required local delivery. This is not a production deployment claim.`,held:`Work remains held for the recorded reason. This view does not retry or release it.`};function N(e){let t=e.outcomes.slice(0,O),n=new Map(e.topology?.map(e=>[e.campaignId,e])),r=new Set(t.map(e=>e.campaignId)),i=new Map;if(e.topology)for(let e=0;e<t.length;e++)for(let e of t){let t=n.get(e.campaignId);i.has(e.campaignId)||!t||t.dependsOn.some(e=>!i.has(e))||i.set(e.campaignId,t.dependsOn.length?Math.max(...t.dependsOn.map(e=>i.get(e)))+1:0)}let a=[...new Set(i.values())].sort((e,t)=>e-t).map(e=>({label:`Dependency layer ${e+1}`,nodes:t.filter(t=>i.get(t.campaignId)===e)})),o=t.filter(e=>!i.has(e.campaignId));o.length&&a.push({label:e.topology?`Layer unavailable`:`Recorded campaigns`,nodes:o});let s=new Map;return a.forEach((e,t)=>e.nodes.forEach((e,n)=>s.set(e.campaignId,{x:24+t*244,y:56+n*108}))),{nodes:t,topology:n,columns:a,positions:s,edges:t.flatMap(e=>(n.get(e.campaignId)?.dependsOn??[]).filter(e=>r.has(e)).map(t=>({from:t,to:e.campaignId}))),width:Math.max(256,a.length*244+8),height:64+Math.max(1,...a.map(e=>e.nodes.length))*108}}function P({data:e}){let t=(0,g.useMemo)(()=>N(e),[e]),[n,r]=(0,g.useState)(t.nodes[0]?.campaignId??null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(`all`),[c,l]=(0,g.useState)(0),u=(0,g.useRef)(null),d=(0,g.useRef)(new Map),f=t.nodes.find(e=>e.campaignId===n),p=(0,g.useMemo)(()=>w(t.nodes,i,o),[t.nodes,i,o]),m=i.trim().length>0||o!==`all`,h=Math.max(1,Math.ceil(p.length/A)),_=Math.min(c,h-1),v=p.slice(_*A,(_+1)*A),y=f&&m&&!p.some(e=>e.campaignId===f.campaignId),b=(0,g.useMemo)(()=>T(t.edges,f?.campaignId??null,k),[t.edges,f?.campaignId]),x=(0,g.useId)(),S=`${x}-detail`,C=f?t.topology.get(f.campaignId):void 0,P=C?.prerequisites.filter(e=>!C.dependsOn.includes(e))??[],F=new Map(e.outcomes.map(e=>[e.campaignId,e])),I=t=>e.outcomes.filter(e=>e.state===t).length;function L(e,n=!1){let r=u.current,i=t.positions.get(e);if(!r||!i)return;let a=Math.max(0,i.x+96-r.clientWidth/2),o=Math.max(0,i.y+40-r.clientHeight/2);typeof r.scrollTo==`function`?r.scrollTo({left:a,top:o,behavior:`auto`}):(r.scrollLeft=a,r.scrollTop=o),n&&d.current.get(e)?.focus({preventScroll:!0})}function R(e){r(e),L(e)}function z(e,n){return e.length?(0,D.jsx)(`ul`,{className:E.relationships,children:e.map(e=>(0,D.jsxs)(`li`,{children:[t.positions.has(e)?(0,D.jsx)(`button`,{type:`button`,onClick:()=>R(e),children:e}):(0,D.jsx)(`span`,{children:e}),(0,D.jsx)(`span`,{children:F.has(e)?j[F.get(e).state]:`Outcome unavailable`})]},e))}):(0,D.jsx)(`p`,{className:E.note,children:n})}return(0,D.jsxs)(`section`,{className:E.topology,"aria-label":`Controller mission topology`,children:[(0,D.jsxs)(`header`,{className:E.header,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{children:`Mission topology`}),(0,D.jsx)(`p`,{children:`Follow the declared work graph. Select a campaign to inspect its recorded state and prerequisites.`})]}),(0,D.jsx)(`span`,{className:E.snapshot,children:`Recorded snapshot`})]}),(0,D.jsxs)(`dl`,{className:E.counts,"aria-label":`Recorded campaign counts`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Campaigns`}),(0,D.jsx)(`dd`,{children:e.outcomes.length})]}),[`completed`,`in-flight`,`held`,`pending`].map(e=>(0,D.jsxs)(`div`,{"data-state":e,children:[(0,D.jsx)(`dt`,{children:j[e]}),(0,D.jsx)(`dd`,{children:I(e)})]},e))]}),e.topology?null:(0,D.jsx)(`p`,{className:E.notice,children:`Dependency information is unavailable in this observation. Campaign placement does not imply independence or readiness.`}),e.outcomes.length>O?(0,D.jsxs)(`p`,{className:E.notice,children:[`Showing the first `,O,` of `,e.outcomes.length,` campaigns. Counts include all recorded outcomes; relationships outside this diagram remain in the selected campaign detail.`]}):null,t.nodes.length?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`section`,{className:E.finder,"aria-label":`Campaign navigator`,children:[(0,D.jsxs)(`div`,{className:E.finderControls,children:[(0,D.jsxs)(`label`,{className:E.searchLabel,htmlFor:`${x}-search`,children:[`Search campaigns`,(0,D.jsx)(`input`,{id:`${x}-search`,type:`search`,value:i,maxLength:192,placeholder:`Campaign ID or recorded reason`,"aria-describedby":`${x}-finder-hint`,onChange:e=>{a(e.target.value),l(0)}})]}),(0,D.jsxs)(`label`,{htmlFor:`${x}-state`,children:[`Recorded state`,(0,D.jsxs)(`select`,{id:`${x}-state`,value:o,onChange:e=>{s(e.target.value),l(0)},children:[(0,D.jsx)(`option`,{value:`all`,children:`All recorded states`}),[`pending`,`in-flight`,`completed`,`held`].map(e=>(0,D.jsx)(`option`,{value:e,children:j[e]},e))]})]}),(0,D.jsx)(`button`,{type:`button`,className:E.utilityButton,disabled:!f,onClick:()=>{f&&L(f.campaignId,!0)},children:`Locate selected`}),m?(0,D.jsx)(`button`,{type:`button`,className:E.utilityButton,onClick:()=>{a(``),s(`all`),l(0)},children:`Reset filters`}):null]}),(0,D.jsxs)(`div`,{className:E.finderMeta,children:[(0,D.jsxs)(`p`,{id:`${x}-finder-hint`,children:[`Search covers the `,t.nodes.length,` diagram campaigns. Filters narrow this index, not the graph or its dependency layers.`]}),(0,D.jsx)(`span`,{"aria-live":`polite`,"aria-atomic":`true`,children:m?`${p.length} matching campaign${p.length===1?``:`s`}`:`${t.nodes.length} campaigns in diagram`})]}),m?(0,D.jsxs)(D.Fragment,{children:[p.length?(0,D.jsx)(`ul`,{className:E.results,"aria-label":`Matching campaigns`,children:v.map(e=>(0,D.jsx)(`li`,{children:(0,D.jsxs)(`button`,{type:`button`,className:E.result,"aria-label":`Select campaign ${e.campaignId}`,"aria-describedby":`${x}-result-state-${e.campaignId} ${x}-result-reason-${e.campaignId}`,"aria-pressed":f?.campaignId===e.campaignId,"aria-controls":S,onClick:()=>R(e.campaignId),children:[(0,D.jsx)(`span`,{className:E.resultName,children:e.campaignId}),(0,D.jsx)(`span`,{id:`${x}-result-state-${e.campaignId}`,className:E.resultState,"data-state":e.state,children:j[e.state]}),(0,D.jsx)(`span`,{id:`${x}-result-reason-${e.campaignId}`,className:E.resultReason,children:e.reasonCode})]})},e.campaignId))}):(0,D.jsx)(`p`,{className:E.noResults,children:`No diagram campaigns match. Try another campaign ID or recorded reason, or reset filters.`}),h>1?(0,D.jsxs)(`nav`,{className:E.pagination,"aria-label":`Campaign result pages`,children:[(0,D.jsxs)(`span`,{children:[`Page `,_+1,` of `,h]}),(0,D.jsx)(`button`,{type:`button`,className:E.utilityButton,disabled:_===0,onClick:()=>l(_-1),children:`Previous results`}),(0,D.jsx)(`button`,{type:`button`,className:E.utilityButton,disabled:_+1===h,onClick:()=>l(_+1),children:`Next results`})]}):null]}):null]}),(0,D.jsxs)(`div`,{className:E.workspace,children:[(0,D.jsx)(`div`,{ref:u,className:E.board,role:`region`,"aria-label":`Campaign dependency diagram`,tabIndex:0,children:(0,D.jsxs)(`div`,{className:E.canvas,style:{width:t.width,height:t.height},children:[(0,D.jsx)(`svg`,{width:t.width,height:t.height,className:E.edges,"aria-hidden":`true`,children:b.map(e=>{let n=t.positions.get(e.from),r=t.positions.get(e.to),i=n.x+192,a=r.x,o=(i+a)/2;return(0,D.jsx)(`path`,{className:f&&(e.from===f.campaignId||e.to===f.campaignId)?E.selectedEdge:E.edge,d:`M ${i} ${n.y+40} C ${o} ${n.y+40}, ${o} ${r.y+40}, ${a} ${r.y+40}`},`${e.from}-${e.to}`)})}),t.columns.map((e,t)=>(0,D.jsx)(`span`,{className:E.column,style:{left:24+t*244},children:e.label},e.label)),t.nodes.map((e,n)=>{let r=t.positions.get(e.campaignId),i=t.topology.get(e.campaignId);return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`button`,{type:`button`,className:E.node,"data-state":e.state,style:{left:r.x,top:r.y},ref:t=>{t?d.current.set(e.campaignId,t):d.current.delete(e.campaignId)},"aria-label":`Inspect campaign ${e.campaignId}: ${j[e.state]}`,"aria-pressed":f?.campaignId===e.campaignId,"aria-controls":S,"aria-describedby":`${x}-relations-${n}`,onClick:()=>R(e.campaignId),children:[(0,D.jsx)(`span`,{className:E.nodeName,children:e.campaignId}),(0,D.jsx)(`span`,{className:E.nodeState,children:j[e.state]})]}),(0,D.jsx)(`span`,{id:`${x}-relations-${n}`,className:E.srOnly,children:i?`Direct dependencies: ${i.dependsOn.join(`, `)||`none declared`}. Additional inherited delivery prerequisites: ${i.prerequisites.filter(e=>!i.dependsOn.includes(e)).join(`, `)||`none recorded`}.`:`Dependency information unavailable.`})]},e.campaignId)})]})}),(0,D.jsx)(`section`,{id:S,className:E.detail,"aria-label":`Selected campaign detail`,children:f?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:E.detailState,"data-state":f.state,children:j[f.state]}),(0,D.jsx)(`h4`,{children:f.campaignId}),y?(0,D.jsx)(`p`,{className:E.selectionNote,children:`The selected campaign is outside the current filters. Its recorded detail remains available.`}):null,(0,D.jsx)(`p`,{children:M[f.state]}),(0,D.jsxs)(`dl`,{className:E.facts,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Recorded reason`}),(0,D.jsx)(`dd`,{children:f.reasonCode})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Campaign-call intent`}),(0,D.jsx)(`dd`,{children:f.attempted?`Recorded`:`Not recorded`})]})]}),(0,D.jsx)(`p`,{className:E.note,children:`A call intent is not proof of worker execution, model requests or successful evaluation.`}),(0,D.jsx)(`h5`,{children:`Direct dependencies`}),C?z(C.dependsOn,`None declared for this campaign.`):(0,D.jsx)(`p`,{className:E.note,children:`Dependency information unavailable.`}),(0,D.jsx)(`h5`,{children:`Additional inherited delivery prerequisites`}),C?z(P,`None recorded beyond the direct dependencies.`):(0,D.jsx)(`p`,{className:E.note,children:`Delivery prerequisite information unavailable.`}),(0,D.jsx)(`p`,{className:E.note,children:`Inherited prerequisites are ancestor delivery gates, not additional declared dependency edges. A state badge alone does not verify the delivery receipt.`})]}):(0,D.jsx)(`p`,{className:E.note,children:n?`Selected campaign ${n} is no longer present in this diagram. No substitute has been selected. Choose another campaign to inspect its evidence.`:`Select a campaign to inspect its recorded evidence.`})})]}),(0,D.jsx)(`p`,{className:E.legend,children:`Lines show declared dependencies, from earlier to later layers. Layer placement does not change declared priority or establish execution readiness.`}),t.edges.length>k?(0,D.jsxs)(`p`,{className:E.note,children:[`Showing `,k,` of `,t.edges.length,` visible dependency lines. Every campaign’s complete relationships remain available in its detail and accessible description.`]}):null]}):(0,D.jsx)(`p`,{className:E.empty,children:`No campaign outcomes are available in this observation. Inspect a registered controller with recorded campaigns to see its mission topology.`})]})}function F({data:e}){return(0,D.jsx)(P,{data:e},e.controllerId)}var I=e=>e==null?`Not recorded`:String(e),L=e=>[...new Set(e)].sort().join(`, `)||`None recorded`,R={pending:`Pending`,held:`Held`,completed:`Completed`,"in-flight":`Unresolved intent`};function z(e,t){let n={clockWarning:!1,changes:[],changedCampaigns:0};if(!e)return{...n,kind:`baseline`,notice:`First accepted observation. Refresh this controller explicitly to compare recorded evidence.`};if(e.controllerId!==t.controllerId||e.createdAt!==t.createdAt)return{...n,kind:`incomparable`,notice:`Controller identity or registration timestamp changed. Registration continuity is not established; these observations are not compared.`};let r=[],i=(e,t,n,i,a)=>{n!==i&&r.push({key:e,label:t,before:n,after:i,...a?{campaignId:a}:{}})},a=[];(e.sourceState!==`healthy`||t.sourceState!==`healthy`)&&a.push(`One or both observations contain missing or degraded evidence. Absence from an observation does not establish deletion, completion or execution.`),t.createdAt===null&&a.push(`The registration timestamp is not recorded. Registration continuity is not established.`),e.deadlineAt!==t.deadlineAt&&a.push(`The recorded deadline changed. This difference does not establish registration continuity or renew execution authority.`),i(`controller:status`,`Recorded controller status`,e.status,t.status),i(`controller:health`,`Evidence health`,e.sourceState,t.sourceState),i(`controller:deadline`,`Recorded deadline`,I(e.deadlineAt),I(t.deadlineAt)),i(`controller:reasons`,`Evidence reasons`,L(e.reasons),L(t.reasons));for(let[n,r]of[[`mode`,`Admission mode`],[`sequence`,`Admission sequence`],[`requestedAt`,`Admission requested at`],[`acknowledgedAt`,`Admission acknowledged at`]])i(`control:${n}`,r,I(e.control?.[n]),I(t.control?.[n]));let o=new Map(e.outcomes.map(e=>[e.campaignId,e])),s=new Map(t.outcomes.map(e=>[e.campaignId,e])),c=[...s.keys(),...[...o.keys()].filter(e=>!s.has(e))];for(let e of c){let t=o.get(e),n=s.get(e);if(!t||!n){i(`campaign:${e}:presence`,`Campaign presence`,t?`Present`:`Not observed`,n?`Present`:`Not observed`,e);continue}i(`campaign:${e}:state`,`Recorded state`,R[t.state],R[n.state],e),i(`campaign:${e}:reason`,`Recorded reason`,t.reasonCode,n.reasonCode,e),i(`campaign:${e}:attempted`,`Campaign-call intent`,t.attempted?`Recorded`:`Not recorded`,n.attempted?`Recorded`:`Not recorded`,e)}if(i(`controller:campaign-order`,`Recorded campaign order`,e.outcomes.map(e=>e.campaignId).join(`, `)||`None recorded`,t.outcomes.map(e=>e.campaignId).join(`, `)||`None recorded`),i(`controller:topology`,`Dependency evidence`,e.topology?`Available`:`Unavailable`,t.topology?`Available`:`Unavailable`),e.topology&&t.topology){let n=new Map(e.topology.map(e=>[e.campaignId,e]));for(let e of t.topology){let t=n.get(e.campaignId);t&&(i(`campaign:${e.campaignId}:dependencies`,`Direct dependencies`,L(t.dependsOn),L(e.dependsOn),e.campaignId),i(`campaign:${e.campaignId}:prerequisites`,`Effective prerequisites`,L(t.prerequisites),L(e.prerequisites),e.campaignId))}}return{kind:`compared`,notice:a.join(` `)||null,clockWarning:Date.parse(t.observedAt)<=Date.parse(e.observedAt),changes:r,changedCampaigns:new Set(r.flatMap(e=>e.campaignId?[e.campaignId]:[])).size}}var B={changes:`_changes_qcw1f_1`,header:`_header_qcw1f_2`,labels:`_labels_qcw1f_4`,historical:`_historical_qcw1f_6`,description:`_description_qcw1f_7`,note:`_note_qcw1f_7`,footnote:`_footnote_qcw1f_7`,times:`_times_qcw1f_9`,warning:`_warning_qcw1f_12`,baseline:`_baseline_qcw1f_13`,counts:`_counts_qcw1f_14`,disclosure:`_disclosure_qcw1f_18`,rows:`_rows_qcw1f_22`,row:`_row_qcw1f_22`,field:`_field_qcw1f_24`,values:`_values_qcw1f_27`};function V({previous:e,current:t,historical:n,loading:r}){let i=(0,g.useMemo)(()=>z(e,t),[e,t]);return(0,D.jsxs)(`section`,{className:B.changes,"aria-label":`Changes between observations`,children:[(0,D.jsxs)(`header`,{className:B.header,children:[(0,D.jsx)(`h3`,{children:`Changes between observations`}),(0,D.jsxs)(`div`,{className:B.labels,children:[r?(0,D.jsx)(`span`,{children:`Refresh in progress`}):null,n?(0,D.jsx)(`span`,{className:B.historical,children:`Historical observations`}):null]})]}),(0,D.jsx)(`p`,{className:B.description,children:`Compare the last two accepted responses in this session. This is not an event log or a live activity view.`}),(0,D.jsxs)(`dl`,{className:B.times,"aria-label":`Compared observation times`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Previous observation`}),(0,D.jsx)(`dd`,{children:e?(0,D.jsx)(`time`,{dateTime:e.observedAt,children:e.observedAt}):`Not yet observed`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Displayed observation`}),(0,D.jsx)(`dd`,{children:(0,D.jsx)(`time`,{dateTime:t.observedAt,children:t.observedAt})})]})]}),r?(0,D.jsx)(`p`,{className:B.note,children:`The accepted observations below remain unchanged while the refresh is pending.`}):null,n?(0,D.jsx)(`p`,{className:B.warning,children:`The latest refresh failed. This comparison uses retained observations, not current evidence.`}):null,i.notice?(0,D.jsx)(`p`,{className:i.kind===`baseline`?B.note:B.warning,children:i.notice}):null,i.clockWarning?(0,D.jsx)(`p`,{className:B.warning,children:`Observation timestamps are equal or move backward. Before and after follow response order, not a verified event timeline.`}):null,i.kind===`baseline`?(0,D.jsx)(`p`,{className:B.baseline,children:`Refresh this controller to compare two observations.`}):i.kind===`incomparable`?(0,D.jsx)(`p`,{className:B.baseline,children:`These observations cannot be compared as one controller registration.`}):i.changes.length===0?(0,D.jsx)(`p`,{className:B.baseline,children:`No compared evidence fields changed. Observation times are excluded; this does not prove that no work occurred.`}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`dl`,{className:B.counts,"aria-label":`Observation change counts`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Changed fields`}),(0,D.jsx)(`dd`,{children:i.changes.length})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Campaigns with displayed changes`}),(0,D.jsx)(`dd`,{children:i.changedCampaigns})]})]}),(0,D.jsxs)(`details`,{className:B.disclosure,children:[(0,D.jsxs)(`summary`,{children:[`Review `,i.changes.length,` changed field`,i.changes.length===1?``:`s`]}),(0,D.jsx)(`ul`,{className:B.rows,"aria-label":`Changed observation fields`,children:i.changes.map(e=>(0,D.jsxs)(`li`,{className:B.row,children:[(0,D.jsxs)(`div`,{className:B.field,children:[(0,D.jsx)(`h4`,{children:e.label}),e.campaignId?(0,D.jsx)(`span`,{children:e.campaignId}):null]}),(0,D.jsxs)(`dl`,{className:B.values,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Before`}),(0,D.jsx)(`dd`,{children:e.before})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`After`}),(0,D.jsx)(`dd`,{children:e.after})]})]})]},e.key))})]})]}),(0,D.jsx)(`p`,{className:B.footnote,children:`Differences describe returned evidence only. They do not establish worker execution, delivery verification or a production deployment.`})]})}var H={inspector:`_inspector_123iu_1`,header:`_header_123iu_2`,note:`_note_123iu_4`,empty:`_empty_123iu_4`,field:`_field_123iu_4`,control:`_control_123iu_4`,readOnly:`_readOnly_123iu_5`,form:`_form_123iu_6`,identity:`_identity_123iu_15`,warning:`_warning_123iu_18`,facts:`_facts_123iu_19`,sequence:`_sequence_123iu_24`,tableWrap:`_tableWrap_123iu_27`,reasons:`_reasons_123iu_32`};function U({value:e}){return e?(0,D.jsx)(`time`,{dateTime:e,children:e.replace(`T`,` `).replace(`Z`,` UTC`)}):(0,D.jsx)(D.Fragment,{children:`Not recorded`})}var W={"campaign-execution":`Campaign execution`,"campaign-verification":`Campaign verification`,"delivery-execution":`Local branch delivery`,"delivery-verification":`Delivery confirmation`,"settlement-publication":`Controller acknowledgement`};function G(){let[e,t]=(0,g.useState)(``),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)({current:null,previous:null}),o=i.current,[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(null),[d,f]=(0,g.useState)(!1),p=(0,g.useRef)({sequence:0,abort:null});(0,g.useEffect)(()=>()=>{p.current.sequence+=1,p.current.abort?.abort()},[]);async function m(e){if(!v(e)){f(!0);return}f(!1),p.current.abort?.abort();let t=++p.current.sequence,n=new AbortController;p.current.abort=n,r(e),a(t=>t.current?.controllerId===e?t:{current:null,previous:null}),c(!0),u(null);try{let r=await C(e,n.signal);t===p.current.sequence&&a(t=>({current:r,previous:t.current?.controllerId===e?t.current:null}))}catch{t===p.current.sequence&&u(`Observation failed or returned invalid evidence. Check your connection and refresh this controller.`)}finally{t===p.current.sequence&&c(!1)}}return(0,D.jsxs)(`section`,{className:H.inspector,"aria-labelledby":`controller-inspector-title`,children:[(0,D.jsxs)(`header`,{className:H.header,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h2`,{id:`controller-inspector-title`,children:`Controller inspector`}),(0,D.jsx)(`p`,{children:`Read the recorded progress of a named portfolio controller.`})]}),(0,D.jsx)(`span`,{className:H.readOnly,children:`Read-only`})]}),(0,D.jsxs)(`form`,{className:H.form,onSubmit:t=>{t.preventDefault(),m(e)},children:[(0,D.jsxs)(`div`,{className:H.field,children:[(0,D.jsx)(`label`,{htmlFor:`controller-id`,children:`Controller ID`}),(0,D.jsx)(`input`,{id:`controller-id`,value:e,onChange:e=>{t(e.target.value),f(!1)},maxLength:64,autoComplete:`off`,autoCapitalize:`none`,spellCheck:!1,"aria-invalid":d,"aria-describedby":`controller-id-help`}),(0,D.jsx)(`p`,{id:`controller-id-help`,children:`Use the ID from your controller manifest: lowercase letters, numbers, hyphens or underscores.`})]}),(0,D.jsx)(`button`,{type:`submit`,children:`Inspect controller`}),n?(0,D.jsx)(`button`,{type:`button`,disabled:s,onClick:()=>{m(n)},children:`Refresh controller`}):null]}),d?(0,D.jsx)(`p`,{role:`alert`,className:H.warning,children:`Enter 1–64 characters, starting with a lowercase letter or number.`}):null,n?(0,D.jsxs)(`div`,{"aria-busy":s,children:[(0,D.jsxs)(`h3`,{className:H.identity,children:[`Evidence for `,(0,D.jsx)(`code`,{children:n})]}),e===n?null:(0,D.jsxs)(`p`,{className:H.note,children:[`The form has changed. Evidence below still belongs to `,n,`; submit to inspect another ID.`]}),(0,D.jsx)(`p`,{role:`status`,className:H.note,children:s?`Reading ${n}…${o?` Previous observation remains below.`:``}`:l&&o?`Historical observation — refresh failed. This is not current evidence.`:o?`Recorded snapshot. Refresh explicitly to check for changes; this is not a live process view.`:`No verified observation is available.`}),l?(0,D.jsx)(`p`,{role:`alert`,className:H.warning,children:l}):null,o?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`dl`,{className:H.facts,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Evidence health`}),(0,D.jsx)(`dd`,{children:o.sourceState})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Recorded status`}),(0,D.jsx)(`dd`,{children:o.status})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Observed at`}),(0,D.jsx)(`dd`,{children:(0,D.jsx)(U,{value:o.observedAt})})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Created at`}),(0,D.jsx)(`dd`,{children:(0,D.jsx)(U,{value:o.createdAt})})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`dt`,{children:`Original deadline`}),(0,D.jsx)(`dd`,{children:(0,D.jsx)(U,{value:o.deadlineAt})})]})]}),(0,D.jsx)(V,{previous:i.previous,current:o,historical:!!l,loading:s}),o.sourceState===`missing`?(0,D.jsx)(`p`,{className:H.warning,children:`No controller registration was found in this store. Check the ID and selected Universe store.`}):null,o.sourceState===`degraded`?(0,D.jsx)(`p`,{className:H.warning,children:`Evidence could not be fully verified. This observation does not repair locks, reconcile work or prove a controller is running.`}):null,o.control?(0,D.jsxs)(`section`,{className:H.control,"aria-label":`Recorded admission control`,children:[(0,D.jsx)(`h4`,{children:o.control.mode===`open`?`Admission reopened`:o.control.acknowledgedAt?`Drain acknowledged`:`Drain awaiting acknowledgement`}),(0,D.jsxs)(`ol`,{className:H.sequence,children:[(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`strong`,{children:o.control.mode===`open`?`Resume recorded`:`Drain recorded`}),(0,D.jsxs)(`span`,{children:[`Sequence `,o.control.sequence]}),(0,D.jsx)(U,{value:o.control.requestedAt})]}),(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`strong`,{children:o.control.mode===`open`?`Resume did not start work`:o.control.acknowledgedAt?`Acknowledgement recorded`:`Acknowledgement not recorded`}),o.control.mode===`drain`?(0,D.jsx)(U,{value:o.control.acknowledgedAt}):(0,D.jsx)(`span`,{children:`Resume does not start work.`})]})]}),(0,D.jsx)(`p`,{children:o.control.mode===`drain`?`Drain blocks new dispatch intents; already-admitted work can continue. An unresolved intent prevents acknowledgement; absence of a visible worker proves neither completion nor failure.`:`Execution requires a separate run invocation. Admission state does not renew the original deadline or establish a running controller.`})]}):(0,D.jsx)(`p`,{className:H.note,children:`No admission-control record. This does not establish process liveness.`}),(0,D.jsx)(F,{data:o},o.controllerId),o.outcomes.length?(0,D.jsx)(`div`,{className:H.tableWrap,role:`region`,"aria-label":`Recorded campaign outcomes`,tabIndex:0,children:(0,D.jsxs)(`table`,{children:[(0,D.jsx)(`caption`,{children:`Recorded campaign outcomes`}),(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{scope:`col`,children:`Campaign`}),(0,D.jsx)(`th`,{scope:`col`,children:`State`}),(0,D.jsx)(`th`,{scope:`col`,children:`Campaign attempted`}),(0,D.jsx)(`th`,{scope:`col`,children:`Reason`})]})}),(0,D.jsx)(`tbody`,{children:o.outcomes.map(e=>(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{scope:`row`,children:e.campaignId}),(0,D.jsx)(`td`,{children:e.state}),(0,D.jsx)(`td`,{children:e.attempted?`Yes`:`No`}),(0,D.jsx)(`td`,{children:e.reasonCode})]},e.campaignId))})]})}):(0,D.jsx)(`p`,{className:H.note,children:`No campaign outcomes available in this observation.`}),(0,D.jsx)(`p`,{className:H.note,children:`“In-flight” means an unresolved durable intent, not proof of a live worker. Campaign attempted records a call intent, not proof of worker execution or successful evaluation. A dispatch-not-started outcome remains held and does not authorize a retry.`}),o.diagnostics?.length?(0,D.jsxs)(`section`,{"aria-label":`Recorded handoff diagnostics`,children:[(0,D.jsx)(`h4`,{children:`Recorded handoff diagnostics`}),(0,D.jsx)(`p`,{className:H.note,children:`These are historical failure records, not live errors. Check the campaign outcome above for its current recorded state. A diagnostic never authorizes retrying a worker or publishing a branch.`}),(0,D.jsx)(`div`,{className:H.tableWrap,role:`region`,"aria-label":`Handoff diagnostic details`,tabIndex:0,children:(0,D.jsxs)(`table`,{children:[(0,D.jsx)(`caption`,{children:`Where the handoff stopped`}),(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{scope:`col`,children:`Campaign`}),(0,D.jsx)(`th`,{scope:`col`,children:`Stage`}),(0,D.jsx)(`th`,{scope:`col`,children:`Failure code`}),(0,D.jsx)(`th`,{scope:`col`,children:`Recorded at`})]})}),(0,D.jsx)(`tbody`,{children:o.diagnostics.map(e=>(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{scope:`row`,children:e.campaignId}),(0,D.jsx)(`td`,{children:W[e.phase]}),(0,D.jsx)(`td`,{children:e.code}),(0,D.jsx)(`td`,{children:(0,D.jsx)(U,{value:e.at})})]},e.campaignId))})]})}),(0,D.jsx)(`p`,{className:H.note,children:`Inspect the pinned campaign and delivery receipts before recovery. Completed outcomes can retain an earlier diagnostic; raw error text and private intent digests are omitted here.`})]}):null,o.reasons.length?(0,D.jsxs)(`details`,{className:H.reasons,children:[(0,D.jsxs)(`summary`,{children:[`Evidence reasons (`,o.reasons.length,`)`]}),(0,D.jsx)(`ul`,{children:o.reasons.map((e,t)=>(0,D.jsx)(`li`,{children:e},`${e}-${t}`))})]}):null]}):null]}):(0,D.jsx)(`p`,{className:H.empty,children:`Enter an ID to inspect this store. Nothing is queried until you submit.`})]})}var K={shell:`_shell_8ebyv_1`,scopeBar:`_scopeBar_8ebyv_2`,scope:`_scope_8ebyv_2`,brand:`_brand_8ebyv_4`,brandMark:`_brandMark_8ebyv_6`,workspace:`_workspace_8ebyv_7`,badge:`_badge_8ebyv_8`,store:`_store_8ebyv_9`,root:`_root_8ebyv_12`,actions:`_actions_8ebyv_13`,notice:`_notice_8ebyv_14`,main:`_main_8ebyv_16`,explanation:`_explanation_8ebyv_17`,checking:`_checking_8ebyv_20`},q={key:`universe-console-scope`,async fetch(){let e=await c(`/api/universe/console`);if(e?.schemaVersion!==1||e.mode!==`universe`||e.readOnly!==!0||typeof e.root!=`string`||!/^(?:\/|[a-zA-Z]:[\\/]|\\\\)/.test(e.root)||[...e.root].some(e=>e.charCodeAt(0)<32||e.charCodeAt(0)>=127&&e.charCodeAt(0)<=159))throw Error(`The server did not establish an explicit read-only Universe scope.`);return e}};function J(){let e=d(q),t=p(q),n=f();return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(l,{}),(0,D.jsxs)(`div`,{className:K.shell,children:[(0,D.jsxs)(`header`,{className:K.scopeBar,children:[(0,D.jsxs)(`div`,{className:K.scope,children:[(0,D.jsxs)(`div`,{className:K.brand,children:[(0,D.jsx)(`svg`,{className:K.brandMark,viewBox:`0 0 32 32`,"aria-hidden":`true`,focusable:`false`,children:(0,D.jsx)(`path`,{d:`m5 11 11-6 11 6-11 6Z M5 16l11 6 11-6 M5 21l11 6 11-6`})}),(0,D.jsx)(`strong`,{children:`Ashlrverse`}),(0,D.jsx)(`span`,{className:K.workspace,children:`Experiments`})]}),(0,D.jsx)(`span`,{className:K.badge,children:`Read-only observation`}),e.data?(0,D.jsxs)(`details`,{className:K.store,children:[(0,D.jsx)(`summary`,{children:`Universe store`}),(0,D.jsx)(`code`,{"aria-label":`Universe store`,className:K.root,children:e.data.root})]}):null]}),(0,D.jsxs)(`div`,{className:K.actions,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:n.cycle,children:[`Theme: `,n.theme]}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>{s()},children:`Disconnect`})]})]}),(0,D.jsx)(`main`,{id:`main-content`,tabIndex:-1,className:K.main,children:e.status===`error`?(0,D.jsxs)(`section`,{role:`alert`,className:K.notice,children:[(0,D.jsx)(`h1`,{children:`Console scope unavailable`}),(0,D.jsxs)(`p`,{children:[e.error?.message,` No project data is shown until the scope can be checked.`]}),(0,D.jsx)(`button`,{type:`button`,onClick:t,children:`Retry scope check`})]}):e.data?(0,D.jsxs)(m.Provider,{value:e.data.root,children:[(0,D.jsx)(`p`,{className:K.explanation,children:`This console observes the selected Universe store. Run campaigns from your terminal; opening this page does not start work.`}),(0,D.jsx)(G,{},e.data.root),(0,D.jsx)(h,{})]}):(0,D.jsx)(`p`,{role:`status`,children:`Checking the selected Universe store…`})})]})]})}function Y(){let e=o();return(0,g.useEffect)(()=>{if(e!==`checking`)return;let t=!1;return r(q.key,q.fetch).then(()=>{t||i(a(q.key).status===`success`)}),()=>{t=!0}},[e]),e===`checking`?(0,D.jsx)(`p`,{className:K.checking,role:`status`,children:`Checking for an existing console session…`}):e===`unauthenticated`?(0,D.jsx)(u,{heading:`Connect to Ashlrverse`,command:`ashlr universe console --root /absolute/universe-store`}):(0,D.jsx)(J,{})}export{Y as UniverseConsoleApp};
2
- //# sourceMappingURL=UniverseConsoleApp-_FSohAdN.js.map
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./index-CZamKRUg.js";import{b as r,i,p as a,r as o,s,v as c,y as l}from"./global-D6bTxIRn.js";import{i as u}from"./RouteErrorBoundary-Badio_uO.js";import{r as ee}from"./queries-B8eBnFox.js";import{a as d,c as f,d as p,f as m,i as h,l as g,n as _,o as v,r as y,s as b,t as x,u as S}from"./charts-CTZJ-JrH.js";import{A as te,C as ne,D as C,E as re,O as ie,T as w,g as ae,k as oe,w as se}from"./VerseConsoleApp-CsIQv9id.js";import{f as ce}from"./format-BNYWGJat.js";import{f as le}from"./fleet-model-ClBbQ0Uj.js";import{t as T}from"./verse-model-CvtK6vP6.js";var E=n(e(),1),D={claude:`var(--engine-claude, #c96442)`,codex:`var(--engine-codex, #10a37f)`,grok:`var(--engine-grok, #6b7280)`,local:`var(--engine-local, #7c5cff)`},O={claude:`Claude publishes no local utilization signal, so there is no window percentage to read. Ashlr deliberately never throttles this seat on a guess.`,grok:`Grok is absent from the per-engine usage snapshot, so this fallback roster has no window data for it. Its real state comes from the per-account probe.`},k=`The only figure available is derived from the dispatch ledger against a configured cap, not from the subscription itself. It is shown under Dispatch limits.`,A=`Local models have no subscription and no quota window — only whether the runtime is up.`,ue={"account-observation":`from this account’s observed windows`,"subscription-tracker":`from the subscription tracker`};function j(e){return{sourceState:`unknown`,complete:!1,reason:e}}function M(e){return e>=90?`danger`:e>=80?`warn`:`ok`}function N(e){return Number.isFinite(e)?Math.max(0,Math.min(100,e)):0}function P(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function F(e,t,n){return{kind:`measured`,source:e,scope:t,windows:n}}function I(e){return{kind:`unknown`,reason:O[e]??`No subscription window reading is reported for this engine.`}}function de(e){let{engine:t,seat:n,subscription:r,frontier:i,engineSeatCount:a=1}=e;if(t===`local`)return{kind:`not-applicable`,reason:A};let o=(n?.health.windows??[]).filter(e=>typeof e.usedPercent==`number`&&Number.isFinite(e.usedPercent));if(o.length>0)return F(`account-observation`,`account`,o.map(e=>{let t=N(e.usedPercent),n=e.resetsAt?Date.parse(e.resetsAt):NaN;return{id:e.id,label:e.id,usedPct:t,resetsAt:Number.isNaN(n)?null:Math.round(n/1e3),tone:M(t)}}));if(r&&r.hasData&&r.windows.length>0)return F(`subscription-tracker`,a>1?`engine`:`account`,r.windows.map((e,t)=>{let n=N(e.usedPercent);return{id:`${e.label}-${t}`,label:e.label,usedPct:n,resetsAt:P(e.resetsAt),tone:M(n)}}));if(r&&!r.hasData)return I(t);if(i&&i.subscriptionWindow.state!==`unknown`){if(i.limit===void 0){let e=N(i.subscriptionWindow.usedPct);return F(`subscription-tracker`,a>1?`engine`:`account`,[{id:i.subscriptionWindow.windowLabel??`window`,label:i.subscriptionWindow.windowLabel??`window`,usedPct:e,resetsAt:P(i.subscriptionWindow.resetsAt),tone:M(e)}])}return{kind:`unknown`,reason:k}}return I(t)}function fe(e){if(!e)return null;let t=(e.byProvider??[]).map(e=>({provider:e.provider,tier:e.tier,tokens:e.tokens,costUsd:e.costUsd,sharePct:e.sharePct})),n=(e,n)=>t.filter(t=>t.tier===e).reduce((e,t)=>e+(t[n]||0),0);return{window:e.window,totalTokens:e.totalTokens,totalCostUsd:e.totalCostUsd,localSavingsUsd:e.localSavingsUsd,localTokens:n(`local`,`tokens`),cloudTokens:n(`cloud`,`tokens`),localCostUsd:n(`local`,`costUsd`),cloudCostUsd:n(`cloud`,`costUsd`),byProvider:[...t].sort((e,t)=>t.tokens-e.tokens),empty:t.length===0&&e.totalTokens===0}}function pe(e,t){let n=[],r=new Set;for(let t of e??[]){let e=`${t.backend}:${t.window}`;r.add(e);let i=t.max>0?N(t.used/t.max*100):null;n.push({id:e,backend:t.backend,window:t.window,max:t.max,used:t.used,standing:t.standing,usedPct:i,configuredOnly:!1})}for(let e of t??[]){let t=`${e.engine}:${e.window}`;r.has(t)||(r.add(t),n.push({id:t,backend:e.engine,window:e.window,max:e.max,used:null,standing:`unknown`,usedPct:null,configuredOnly:!0}))}return n.sort((e,t)=>e.backend.localeCompare(t.backend)||e.window.localeCompare(t.window))}var me=`No per-day series is available: the sources this view reads carry aggregate spend only, not a dated history.`;function he(e){if(!e)return{available:!1,reason:me};if(e.sourceQuality?.sourceState!==`healthy`)return{available:!1,reason:`No per-day series: the daemon ledger is ${e.sourceQuality?.sourceState??`unavailable`}${e.sourceQuality?.reason?` (${e.sourceQuality.reason})`:``}.`};let t=e.ticks;if(!t||t.length===0)return{available:!1,reason:me};let n=new Map;for(let e of t){let t=Date.parse(e.ts);if(Number.isNaN(t))continue;let r=new Date(t).toISOString().slice(0,10);n.set(r,(n.get(r)??0)+(Number.isFinite(e.spentUsd)?e.spentUsd:0))}if(n.size<2)return{available:!1,reason:`No per-day series: only ${n.size} day${n.size===1?``:`s`} of daemon ticks is retained, which is not a trend.`};let r=[...n.keys()].sort(),i=r[0],a=r[r.length-1],o=[];for(let e=Date.parse(`${i}T00:00:00Z`);e<=Date.parse(`${a}T00:00:00Z`);e+=864e5){let t=new Date(e).toISOString().slice(0,10);o.push({day:t,usd:n.has(t)?n.get(t):null})}return{available:!0,days:o,tickCount:t.length,caveat:`From the last ${t.length} recorded daemon ticks. The tick ledger is capped and records the autonomous loop only — interactive chat turns are not in it, and a gap is a day with no retained tick, not a measured zero.`}}var ge={available:!1,reason:null,dailyBudgetUsd:null,subscriptionMaxPercent:null,todaySpentUsd:null,todaySpentDate:null,foundryLimits:[]};function L(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:null}function R(e,t){if(!e)return null;for(let n of t){let t=e[n];if(typeof t==`number`&&Number.isFinite(t))return t}return null}function _e(e,t=null){let n=L(e);if(!n)return{...ge,reason:t};let r=L(n.caps)??n,i=L(n.daemon),a=L(n.spend),o=[],s=r.foundryLimits;if(Array.isArray(s))for(let e of s){let t=L(e);if(!t)continue;let n=typeof t.engine==`string`?t.engine:null,r=R(t,[`max`]);n!==null&&r!==null&&o.push({engine:n,window:typeof t.window==`string`?t.window:`1d`,max:r})}return{available:!0,reason:t,dailyBudgetUsd:R(r,[`dailyBudgetUsd`]),subscriptionMaxPercent:R(r,[`subscriptionMaxPercent`]),todaySpentUsd:a?R(a,[`todayUsd`]):R(n,[`todaySpentUsd`,`todaySpendUsd`,`spendTodayUsd`])??R(i,[`todaySpentUsd`]),todaySpentDate:a&&typeof a.todayDate==`string`?a.todayDate:null,foundryLimits:o}}function ve(e){return{...ge,reason:e}}var z={section:`_section_1aa17_11`,header:`_header_1aa17_20`,headerTitle:`_headerTitle_1aa17_33`,headerMeta:`_headerMeta_1aa17_41`,ghostButton:`_ghostButton_1aa17_50`,scroll:`_scroll_1aa17_67`,panel:`_panel_1aa17_75`,panelHead:`_panelHead_1aa17_83`,panelTitle:`_panelTitle_1aa17_95`,panelNote:`_panelNote_1aa17_104`,muted:`_muted_1aa17_111`,noteList:`_noteList_1aa17_124`,num:`_num_1aa17_135`,tiles:`_tiles_1aa17_142`,cards:`_cards_1aa17_150`,card:`_card_1aa17_150`,cardHead:`_cardHead_1aa17_177`,cardLabel:`_cardLabel_1aa17_185`,cardMeta:`_cardMeta_1aa17_196`,cardFigures:`_cardFigures_1aa17_206`,figure:`_figure_1aa17_215`,figureLabel:`_figureLabel_1aa17_222`,figureValue:`_figureValue_1aa17_230`,windows:`_windows_1aa17_239`,windowHead:`_windowHead_1aa17_246`,windowPct:`_windowPct_1aa17_256`,windowReset:`_windowReset_1aa17_262`,track:`_track_1aa17_275`,fill:`_fill_1aa17_283`,unknownRule:`_unknownRule_1aa17_311`,signalRow:`_signalRow_1aa17_318`,reason:`_reason_1aa17_325`,sourceLine:`_sourceLine_1aa17_333`,split:`_split_1aa17_348`,splitRow:`_splitRow_1aa17_355`,splitBar:`_splitBar_1aa17_364`,splitFill:`_splitFill_1aa17_371`,limitList:`_limitList_1aa17_377`,limitRow:`_limitRow_1aa17_382`,limitName:`_limitName_1aa17_395`,limitWindow:`_limitWindow_1aa17_404`,limitValue:`_limitValue_1aa17_409`,verdictDetail:`_verdictDetail_1aa17_425`,bindingLabel:`_bindingLabel_1aa17_433`,windowBlock:`_windowBlock_1aa17_443`,windowBlockLead:`_windowBlockLead_1aa17_452`,windowFlag:`_windowFlag_1aa17_465`,creditsRow:`_creditsRow_1aa17_473`,actionBlock:`_actionBlock_1aa17_488`,command:`_command_1aa17_494`,commandInline:`_commandInline_1aa17_495`,negative:`_negative_1aa17_510`,segmented:`_segmented_1aa17_516`,segment:`_segment_1aa17_516`,charts:`_charts_1aa17_558`,tableScroll:`_tableScroll_1aa17_570`,stateBlock:`_stateBlock_1aa17_578`,stateTitle:`_stateTitle_1aa17_586`,stateBody:`_stateBody_1aa17_595`,stateActions:`_stateActions_1aa17_601`,skeletonGrid:`_skeletonGrid_1aa17_605`,capacity:`_capacity_1aa17_660`,capacityHeadline:`_capacityHeadline_1aa17_665`,chips:`_chips_1aa17_680`,chip:`_chip_1aa17_680`,chipLabel:`_chipLabel_1aa17_727`,chipState:`_chipState_1aa17_737`,chipPct:`_chipPct_1aa17_757`,capacityFacts:`_capacityFacts_1aa17_763`,capacityFact:`_capacityFact_1aa17_763`,capacityMuted:`_capacityMuted_1aa17_777`,proseResets:`_proseResets_1aa17_783`,visuallyHidden:`_visuallyHidden_1aa17_787`,cardTrigger:`_cardTrigger_1aa17_807`,cardChevron:`_cardChevron_1aa17_823`,detail:`_detail_1aa17_848`,detailHead:`_detailHead_1aa17_856`,detailTitle:`_detailTitle_1aa17_863`,detailGrid:`_detailGrid_1aa17_871`,detailColumn:`_detailColumn_1aa17_878`,evidenceList:`_evidenceList_1aa17_882`,evidenceRow:`_evidenceRow_1aa17_889`,evidenceValue:`_evidenceValue_1aa17_896`,figureTile:`_figureTile_1aa17_907`,figureBig:`_figureBig_1aa17_918`,figureCaption:`_figureCaption_1aa17_926`,panelActions:`_panelActions_1aa17_934`,placement:`_placement_1aa17_947`,placementBar:`_placementBar_1aa17_954`,placementGpu:`_placementGpu_1aa17_964`,placementCpu:`_placementCpu_1aa17_965`,placementText:`_placementText_1aa17_971`,staleNotice:`_staleNotice_1aa17_984`,staleFlag:`_staleFlag_1aa17_998`},B=t();function V({view:e,ariaPrefix:t,prominent:n=!1}){let r=`${t} ${e.label}`;if(e.limitReached)return(0,B.jsxs)(`div`,{className:n?z.windowBlockLead:z.windowBlock,children:[(0,B.jsxs)(`div`,{className:z.windowHead,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(`span`,{className:z.windowFlag,children:`limit reached`})]}),(0,B.jsx)(`div`,{className:z.track,"data-tone":`danger`,role:`img`,"aria-label":`${r}: the provider flagged this window as rate-limited, so no percentage is shown`,children:(0,B.jsx)(`div`,{className:z.fill,style:{width:`100%`}})}),e.resetText?(0,B.jsx)(`p`,{className:z.windowReset,children:e.resetText}):null]});if(e.usedPct===null)return(0,B.jsxs)(`div`,{className:n?z.windowBlockLead:z.windowBlock,children:[(0,B.jsxs)(`div`,{className:z.windowHead,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsx)(u,{quality:j(`No percentage was reported for this window.`),label:r,children:null})]}),(0,B.jsx)(`hr`,{className:z.unknownRule,"aria-hidden":`true`})]});let i=Math.round(e.usedPct);return(0,B.jsxs)(`div`,{className:n?z.windowBlockLead:z.windowBlock,children:[(0,B.jsxs)(`div`,{className:z.windowHead,children:[(0,B.jsx)(`span`,{children:e.label}),(0,B.jsxs)(`span`,{className:z.windowPct,children:[i,`%`]})]}),(0,B.jsx)(`div`,{className:z.track,"data-tone":e.tone,role:`meter`,"aria-label":`${r} used`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,"aria-valuetext":`${i}% used${e.resetText?`, ${e.resetText}`:``}`,children:(0,B.jsx)(`div`,{className:z.fill,style:{width:`${i}%`}})}),e.resetText?(0,B.jsx)(`p`,{className:z.windowReset,children:e.resetText}):null]})}var ye={available:`success`,credits:`success`,tight:`warning`,exhausted:`danger`,"signed-out":`warning`,"probe-unsupported":`warning`,unknown:`unknown`};function be({credits:e}){if(!e)return null;let t=e.unlimited?`unlimited`:e.balance===null?null:e.balanceValue===null?e.balance:e.balanceValue.toLocaleString(`en-US`,{maximumFractionDigits:2});return(0,B.jsxs)(`div`,{className:z.creditsRow,children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Credits`}),(0,B.jsx)(`span`,{className:z.num,title:e.balance??void 0,children:t??`not reported`}),(0,B.jsx)(`p`,{className:z.reason,children:`Credits are a separate pool from the window above — a fully used window does not stop a spendable balance from being spent. The provider gives a bare number, not a currency, so it is shown as reported.`})]})}function xe({card:e,onOpen:t,expanded:n=!1,triggerId:r,detailId:i}){let o={"--engine-color":e.color},s=e.verdict.state===`signed-out`,c=t!==void 0&&e.hasDetail,l=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.cardLabel,children:e.label}),(0,B.jsx)(a,{status:e.verdict.state,tone:ye[e.verdict.state],children:e.verdict.headline})]});return(0,B.jsxs)(`article`,{className:z.card,style:o,"aria-label":`${e.label} usage`,"data-selected":n?`true`:void 0,children:[c?(0,B.jsxs)(`button`,{type:`button`,id:r,className:`${z.cardHead} ${z.cardTrigger}`,"aria-expanded":n,...i?{"aria-controls":i}:{},onClick:()=>t(e.id),children:[l,(0,B.jsx)(`span`,{className:z.cardChevron,"aria-hidden":`true`,children:n?`−`:`+`})]}):(0,B.jsx)(`div`,{className:z.cardHead,children:l}),(0,B.jsxs)(`div`,{className:z.cardMeta,children:[(0,B.jsx)(`span`,{children:T[e.engine]}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{children:e.plan?`${e.plan} plan`:`plan not reported`})]}),(0,B.jsx)(`p`,{className:z.verdictDetail,children:e.verdict.detail}),e.verdict.code?(0,B.jsxs)(`p`,{className:z.sourceLine,children:[`Probe reason `,(0,B.jsx)(`code`,{className:z.commandInline,children:e.verdict.code})]}):null,e.binding?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.bindingLabel,children:`Binding constraint`}),(0,B.jsx)(V,{view:e.binding,ariaPrefix:e.label,prominent:!0})]}):null,e.others.length>0?(0,B.jsx)(`div`,{className:z.windows,children:e.others.map(t=>(0,B.jsx)(V,{view:t,ariaPrefix:e.label},t.id))}):null,(0,B.jsx)(be,{credits:e.credits}),s?(0,B.jsx)(`div`,{className:z.actionBlock,children:e.reconnectCommand?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Reconnect`}),(0,B.jsx)(`code`,{className:z.command,children:e.reconnectCommand})]}):(0,B.jsxs)(`p`,{className:z.reason,children:[`Sign this account back in through its own provider CLI under its pinned profile. Ashlr does not print that invocation here, because the pinned-profile launcher path is never allowed onto a surface. `,(0,B.jsx)(`code`,{className:z.commandInline,children:`ashlr resources`}),` `,`shows the connection state once it is back.`]})}):null,e.sourceNote?(0,B.jsx)(`p`,{className:z.sourceLine,children:e.sourceNote}):null]})}var Se={available:`success`,credits:`success`,tight:`warning`,exhausted:`danger`,"signed-out":`warning`,"probe-unsupported":`warning`,unknown:`unknown`},Ce=`No per-account history is retained by any source this view reads: the accounts route is a point-in-time snapshot and the usage series carries no per-account breakdown. A trend is not drawn from one reading.`;function H(e,t){return e===null?`The source behind this card reports no health verdict at all.`:e===`unknown`?t===`claude`?`Health reads unknown, which is how this provider always reads — the probe has no health channel for it. It is not a fault.`:`Health reads unknown: the monitor took no verdict on this account.`:`Monitor health: ${e}.`}function U({label:e,children:t}){return(0,B.jsxs)(`div`,{className:z.evidenceRow,children:[(0,B.jsx)(`dt`,{className:z.figureLabel,children:e}),(0,B.jsx)(`dd`,{className:z.evidenceValue,children:t})]})}function we({card:e,onClose:t,headingId:n}){let{evidence:r}=e,i=e.credits,o=(0,E.useRef)(null);return(0,E.useEffect)(()=>{o.current?.focus()},[e.id]),(0,B.jsxs)(`section`,{className:z.detail,"aria-labelledby":n,children:[(0,B.jsxs)(`div`,{className:z.detailHead,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{id:n,ref:o,tabIndex:-1,className:z.detailTitle,children:e.label}),(0,B.jsxs)(`div`,{className:z.cardMeta,children:[(0,B.jsx)(`span`,{children:T[e.engine]}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{children:e.plan?`${e.plan} plan`:`plan not reported`}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(a,{status:e.verdict.state,tone:Se[e.verdict.state],children:e.verdict.headline})]})]}),(0,B.jsx)(`button`,{type:`button`,className:z.ghostButton,onClick:t,children:`Close`})]}),(0,B.jsx)(`p`,{className:z.verdictDetail,children:e.verdict.detail}),(0,B.jsxs)(`div`,{className:z.detailGrid,children:[(0,B.jsxs)(`div`,{className:z.detailColumn,children:[(0,B.jsxs)(`span`,{className:z.figureLabel,children:[`All windows (`,e.allWindows.length,`)`]}),e.allWindows.length===0?(0,B.jsx)(`p`,{className:z.reason,children:`This account reported no windows at all. That is an absent reading, not a set of windows at zero.`}):(0,B.jsx)(`div`,{className:z.windows,children:e.allWindows.map((t,n)=>(0,B.jsx)(V,{view:t,ariaPrefix:e.label,prominent:n===0},t.id))}),e.allWindows.some(e=>!e.measured)?(0,B.jsx)(`p`,{className:z.reason,children:`At least one window above carries a provider FLAG rather than a measurement, so no percentage is printed for it. A flagged limit and a measured 100% are different facts.`}):null]}),(0,B.jsxs)(`div`,{className:z.detailColumn,children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Probe evidence`}),(0,B.jsxs)(`dl`,{className:z.evidenceList,children:[(0,B.jsx)(U,{label:`Connection`,children:r.state}),(0,B.jsx)(U,{label:`Authentication`,children:r.authentication}),(0,B.jsx)(U,{label:`Health`,children:H(r.health,e.engine)}),(0,B.jsx)(U,{label:`Observed`,children:r.observedAt===null?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`no observation timestamp was reported`}):(0,B.jsx)(`span`,{className:z.num,children:new Date(r.observedAt).toLocaleString()})}),(0,B.jsx)(U,{label:`Probe reason`,children:r.reasonCode===null?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`none reported`}):(0,B.jsx)(`code`,{className:z.commandInline,children:r.reasonCode})}),r.unsupported?(0,B.jsxs)(U,{label:`Version pin`,children:[(0,B.jsx)(`code`,{className:z.commandInline,children:r.unsupported.code}),r.unsupported.pinnedVersion?(0,B.jsxs)(B.Fragment,{children:[` `,`pinned to `,(0,B.jsx)(`span`,{className:z.num,children:r.unsupported.pinnedVersion}),`. A one-line constant bump, not an outage.`]}):null]}):null]}),i?(0,B.jsxs)(`div`,{className:z.creditsRow,children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Credits`}),(0,B.jsx)(`span`,{className:z.num,title:i.balance??void 0,children:i.unlimited?`unlimited`:i.balanceValue===null?i.balance??`not reported`:i.balanceValue.toLocaleString(`en-US`,{maximumFractionDigits:2})}),(0,B.jsx)(`p`,{className:z.reason,children:`A separate pool from every window above. The provider gives a bare number, not a currency, so it is shown as reported.`})]}):null,r.notes.length>0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Provider notes`}),(0,B.jsx)(`ul`,{className:z.noteList,children:r.notes.map(e=>(0,B.jsx)(`li`,{className:z.capacityMuted,children:e},e))})]}):null]})]}),(0,B.jsx)(`p`,{className:z.sourceLine,children:Ce})]})}var W={available:`ready`,credits:`ready`,tight:`tight`,exhausted:`blocked`,"signed-out":`blocked`,"probe-unsupported":`blocked`,unknown:`unread`};function G(e,t,n){return e===1?t:n}function K(e){let{ready:t,tight:n,blocked:r,unread:i,total:a,local:o}=e;if(a===0)return`No seats are reported at all. This is an empty roster, not a set of seats at zero.`;let s=o===null?``:o.reachable&&o.residentCount>0?` ${o.residentCount} local ${G(o.residentCount,`model is`,`models are`)} resident and answer with no load delay.`:o.reachable&&o.agenticCount>0?` No local model is resident, but ${o.agenticCount} installed ${G(o.agenticCount,`one can`,`ones can`)} drive a session after a load.`:o.reachable?` No local model is resident.`:` The local runtime did not answer, so local capacity is unknown.`,c=i===0?``:` ${i} ${G(i,`seat has`,`seats have`)} no reading at all — unread, not exhausted.`;return t>0?`${t} of ${a} ${G(a,`seat is`,`seats are`)} usable right now.${c}${s}`:n>0?`No seat is clear: ${n} ${G(n,`is`,`are`)} running tight and ${r} ${G(r,`is`,`are`)} blocked.${c}${s}`:r>0?`No cloud seat reports headroom — ${r} blocked.${c}${s}`:`No seat reported a usable window.${c}${s}`}function Te(e){let t=e.binding;return{id:e.id,label:e.label,kind:`account`,color:e.color,cls:W[e.verdict.state],headline:e.verdict.headline,usedPct:t&&t.measured&&!t.limitReached?t.usedPct:null,measured:t!==null&&t.measured&&!t.limitReached}}function Ee(e){return{id:`local`,label:`Local`,kind:`local`,color:e.color,cls:W[e.verdict.state],headline:e.verdict.headline,usedPct:e.usedPct,measured:e.usedPct!==null}}function De(e,t){let n=[],r=[],i=new Set;for(let a of e)for(let e of a.windows){if(e.resetsAt!==null){let r=Date.parse(e.resetsAt);if(!Number.isNaN(r)){let i=r-t;n.push({seatLabel:a.label,windowLabel:e.label,atMs:r,inMs:i,overdue:i<=0});continue}}if(e.resetText!==null){let t=`${a.label}|${e.label}|${e.resetText}`;if(i.has(t))continue;i.add(t),r.push({seatLabel:a.label,windowLabel:e.label,text:e.resetText})}}return{instants:n,prose:r}}function Oe(e){let t=e.filter(e=>!e.overdue);return t.length>0?t.reduce((e,t)=>t.inMs<e.inMs?t:e):e.length===0?null:e.reduce((e,t)=>t.atMs>e.atMs?t:e)}function ke(e,t){let n=e.filter(e=>e.atMs>t);return n.length>0?n.reduce((e,t)=>t.atMs<e.atMs?t:e):e.length===0?null:e.reduce((e,t)=>t.atMs>e.atMs?t:e)}function Ae(e,t){if(e===null&&t===null)return null;let n=e?.residentBytes??t?.residentBytes??null,r=e?.memoryBudgetBytes??t?.memoryBudgetBytes??null;return{reachable:t?.reachable??e?.verdict.state!==`unknown`,residentCount:e?.residentCount??t?.rows.filter(e=>e.resident).length??0,installedCount:e?.installedCount??t?.rows.length??0,agenticCount:t?.agenticCount??0,unknownToolCount:t?.unknownToolCount??0,residentBytes:n,memoryBudgetBytes:r,headroomBytes:n!==null&&r!==null?Math.max(0,r-n):null,freeMemoryBytes:t?.freeMemoryBytes??null,usedPct:e?.usedPct??t?.memoryUsedPct??null}}function je(e){let t=e.nowMs??Date.now(),n=e.cards.map(Te);e.localCard&&n.push(Ee(e.localCard));let r=e=>n.filter(t=>t.cls===e).length,i=r(`ready`),a=r(`tight`),o=r(`blocked`),s=r(`unread`),{instants:c,prose:l}=De(e.cards.map(e=>({label:e.label,windows:e.allWindows})),t),u=Ae(e.localCard,e.localView);return{seats:n,ready:i,tight:a,blocked:o,unread:s,total:n.length,resets:c,nextReset:Oe(c),proseResets:l,local:u,headline:K({ready:i,tight:a,blocked:o,unread:s,total:n.length,local:u}),noCapacity:n.length>0&&i===0&&a===0&&s<n.length}}function Me(e){if(!Number.isFinite(e))return`—`;if(e<=0)return`overdue`;let t=Math.floor(e/1e3),n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);return n>0?`${n}d ${r}h`:r>0?`${r}h ${i}m`:i>0?`${i}m`:`${t}s`}function Ne(e){return e===null?`unknown`:e.includes(`tools`)?`supported`:`unsupported`}function Pe(e,t){return e===null?t!==null&&t.length===0?`unknown`:Ne(t):e?`supported`:`unsupported`}function Fe(e,t){let n=e.expiresAt?Date.parse(e.expiresAt):NaN,r=e.gpuPercent??(e.sizeBytes!==null&&e.sizeBytes>0&&e.sizeVramBytes!==null?Math.max(0,Math.min(100,e.sizeVramBytes/e.sizeBytes*100)):null);return{name:e.name,runtime:e.runtime,resident:e.loaded,placement:e.placement,memoryPct:e.loaded?e.memoryPercent:null,family:e.family,sizeBytes:e.sizeBytes,sizeVramBytes:e.sizeVramBytes,gpuPct:r,expiresInMs:e.loaded&&!Number.isNaN(n)?n-t:null,expiresAtMs:e.loaded&&!Number.isNaN(n)?n:null,parameterSize:e.parameterSize,quantization:e.quantization,nativeContext:e.nativeContext,configuredContext:e.configuredContext,contextTruncated:e.nativeContext!==null&&e.configuredContext!==null&&e.configuredContext<e.nativeContext,tools:Pe(e.supportsTools,e.capabilities)}}function Ie(e){let t=e.filter(e=>e.stale);if(t.length===0)return{stale:!1,staleForMs:null,runtimes:[]};let n=t.map(e=>e.staleForMs).filter(e=>e!==null);return{stale:!0,staleForMs:n.length===0?null:Math.max(...n),runtimes:t.map(e=>e.runtime)}}function Le(e){if(e===null||!Number.isFinite(e)||e<0)return`an unreported interval`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return r===0?`${n}m`:`${n}m ${r}s`}function Re(e,t=Date.now()){if(!e)return null;let n=e.models.map(e=>Fe(e,t)).sort((e,t)=>Number(t.resident)-Number(e.resident)||e.name.localeCompare(t.name)),r=n.filter(e=>e.resident),i=r.some(e=>e.sizeBytes===null)?null:r.reduce((e,t)=>e+(t.sizeBytes??0),0),a=e.memoryBudgetBytes;return{reachable:e.reachable,reason:e.reason,rows:n,residentBytes:i,memoryBudgetBytes:a,memoryUsedPct:i!==null&&a!==null&&a>0?Math.max(0,Math.min(100,i/a*100)):null,freeMemoryBytes:e.freeMemoryBytes,runtimes:e.runtimes,notes:e.notes,agenticCount:n.filter(e=>e.tools===`supported`).length,nonAgenticCount:n.filter(e=>e.tools===`unsupported`).length,unknownToolCount:n.filter(e=>e.tools===`unknown`).length}}function q(e){if(e===null||!Number.isFinite(e))return`—`;let t=e/1024**3;if(t>=10)return`${t.toFixed(0)} GB`;if(t>=1)return`${t.toFixed(1)} GB`;let n=e/1024**2;return`${Math.round(n)} MB`}function ze(e){if(e===null||!Number.isFinite(e))return`—`;if(e<=0)return`expired`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${i}s`:`${i}s`}function J(e){return e===null||!Number.isFinite(e)?`—`:e>=1024?`${Math.round(e/1024)}k`:String(e)}var Be={ready:`usable`,tight:`tight`,blocked:`blocked`,unread:`no reading`};function Ve(e,t=3e4){let[n,r]=(0,E.useState)(()=>Date.now());return(0,E.useEffect)(()=>{if(!e)return;let n=setInterval(()=>r(Date.now()),t);return()=>clearInterval(n)},[e,t]),n}function He({seat:e,selected:t,onSelect:n}){let r={"--engine-color":e.color},i=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.chipLabel,children:e.label}),(0,B.jsx)(`span`,{className:z.chipState,children:Be[e.cls]}),e.usedPct===null?null:(0,B.jsxs)(`span`,{className:z.chipPct,children:[Math.round(e.usedPct),`%`]})]});return n===null?(0,B.jsx)(`span`,{className:z.chip,style:r,"data-capacity":e.cls,children:i}):(0,B.jsx)(`button`,{type:`button`,className:z.chip,style:r,"data-capacity":e.cls,"aria-pressed":t,onClick:()=>n(e.id),children:i})}function Ue({overview:e,selectedId:t,onSelectSeat:n}){let r=Ve(e.resets.length>0),i=(0,E.useMemo)(()=>ke(e.resets,r),[e.resets,r]),a=i===null?0:i.atMs-r,o=a<=0,s=e.local;return(0,B.jsxs)(`section`,{className:z.capacity,"aria-labelledby":`verse-capacity-heading`,children:[(0,B.jsx)(`h3`,{id:`verse-capacity-heading`,className:z.visuallyHidden,children:`Capacity right now`}),(0,B.jsx)(`p`,{className:z.capacityHeadline,"data-empty":e.noCapacity?`true`:void 0,children:e.headline}),e.seats.length>0?(0,B.jsx)(`div`,{className:z.chips,role:`list`,"aria-label":`Seat capacity`,children:e.seats.map(e=>(0,B.jsx)(`span`,{role:`listitem`,children:(0,B.jsx)(He,{seat:e,selected:t===e.id,onSelect:e.kind===`account`?n:null})},e.id))}):null,(0,B.jsxs)(`dl`,{className:z.capacityFacts,children:[(0,B.jsxs)(`div`,{className:z.capacityFact,children:[(0,B.jsx)(`dt`,{className:z.figureLabel,children:`Nearest reset`}),(0,B.jsx)(`dd`,{children:i===null?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`No seat reported a dated reset. That is an absent timestamp, not "never".`}):o?(0,B.jsxs)(`span`,{className:z.capacityMuted,children:[(0,B.jsx)(`span`,{className:z.num,children:i.seatLabel}),` · `,i.windowLabel,` was due to reset at `,new Date(i.atMs).toLocaleString(),` — this reading predates the rollover.`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.num,children:Me(a)}),` `,(0,B.jsxs)(`span`,{className:z.capacityMuted,children:[`· `,i.seatLabel,` `,i.windowLabel,`, at`,` `,new Date(i.atMs).toLocaleString()]})]})})]}),(0,B.jsxs)(`div`,{className:z.capacityFact,children:[(0,B.jsx)(`dt`,{className:z.figureLabel,children:`Local headroom`}),(0,B.jsx)(`dd`,{children:s===null?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`No local source answered.`}):s.reachable?s.headroomBytes===null?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`Either the resident total or the machine budget was not reported, so headroom cannot be computed.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.num,children:q(s.headroomBytes)}),` `,(0,B.jsxs)(`span`,{className:z.capacityMuted,children:[`free of `,q(s.memoryBudgetBytes),` · `,s.residentCount,` resident,`,` `,s.installedCount,` installed`]})]}):(0,B.jsx)(`span`,{className:z.capacityMuted,children:`The local runtime did not answer this probe, so headroom is unknown — not zero, and not full.`})})]}),(0,B.jsxs)(`div`,{className:z.capacityFact,children:[(0,B.jsx)(`dt`,{className:z.figureLabel,children:`Agentic locally`}),(0,B.jsx)(`dd`,{children:s===null||!s.reachable?(0,B.jsx)(`span`,{className:z.capacityMuted,children:`unknown`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`span`,{className:z.num,children:s.agenticCount}),` `,(0,B.jsxs)(`span`,{className:z.capacityMuted,children:[`of `,s.installedCount,` installed models can drive a session`,s.unknownToolCount>0?`; ${s.unknownToolCount} did not report a capability list`:``]})]})})]})]}),e.proseResets.length>0?(0,B.jsxs)(`div`,{className:z.proseResets,children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:`Resets reported as text`}),(0,B.jsx)(`ul`,{className:z.noteList,children:e.proseResets.map(e=>(0,B.jsxs)(`li`,{className:z.capacityMuted,children:[e.seatLabel,` · `,e.windowLabel,` — `,e.text]},`${e.seatLabel}-${e.windowLabel}-${e.text}`))}),(0,B.jsx)(`p`,{className:z.capacityMuted,children:`These providers publish a sentence rather than a timestamp, so it is shown exactly as given and never turned into a countdown.`})]}):null]})}function We(e){switch(e){case`ok`:return`success`;case`warn`:return`warning`;case`over`:return`danger`;case`unlimited`:return`neutral`;default:return`unknown`}}function Ge({rows:e,capsNote:t}){return(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-limits`,children:[(0,B.jsxs)(`div`,{className:z.panelHead,children:[(0,B.jsx)(`h3`,{id:`verse-usage-limits`,className:z.panelTitle,children:`Dispatch limits`}),(0,B.jsx)(`p`,{className:z.panelNote,children:`Calls recorded in the dispatch ledger against each configured foundry cap. This is not subscription utilization.`})]}),t?(0,B.jsx)(`p`,{className:z.muted,children:t}):null,e.length===0?(0,B.jsx)(`p`,{className:z.muted,children:`No foundry limits are configured, so dispatches are uncapped on this machine. Nothing here is being throttled.`}):(0,B.jsx)(`div`,{className:z.limitList,children:e.map(e=>(0,B.jsxs)(`div`,{className:z.limitRow,children:[(0,B.jsxs)(`span`,{className:z.limitName,children:[e.backend,(0,B.jsxs)(`span`,{className:z.limitWindow,children:[`per `,e.window]}),(0,B.jsx)(a,{status:e.standing,tone:We(e.standing),children:e.standing===`unknown`?`no reading`:e.standing})]}),e.usedPct===null?(0,B.jsx)(`hr`,{className:z.unknownRule,"aria-hidden":`true`}):(0,B.jsx)(`div`,{className:z.track,"data-tone":e.usedPct>=100?`danger`:e.usedPct>=80?`warn`:`ok`,role:`meter`,"aria-label":`${e.backend} dispatches against its ${e.window} cap`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(e.usedPct),children:(0,B.jsx)(`div`,{className:z.fill,style:{width:`${Math.round(e.usedPct)}%`}})}),(0,B.jsx)(`span`,{className:z.limitValue,children:e.used===null?`configured ${y(e.max)}`:`${y(e.used)} / ${y(e.max)}`})]},e.id))})]})}var Ke=`Cost is ESTIMATED from a static price table in this repo, not billed. It will not match a provider invoice.`,qe=`Codex reports cacheRead and cacheWrite as a hardcoded 0 upstream, so any window containing Codex traffic understates cache activity — its cache economics are not comparable to Claude’s.`,Je=`A flat heuristic of $3 per 1M local tokens, not a quote and not a measured price.`,Ye=`Fewer than two days in this window carry a rollup row, which is not a trend.`,Xe=`The daily rollup carries no per-engine or local/cloud columns, and the only tier split available is a single aggregate with no dates on it. Apportioning the daily totals by that aggregate’s ratio would invent a shape nobody measured, so no per-day split is drawn — the aggregate below is the real figure.`;function Ze(e){return Date.parse(`${e}T00:00:00Z`)}function Qe(e,t){return e.reduce((e,n)=>e+(t(n)===null?0:1),0)}function Y(e,t){return e.map(e=>({x:Ze(e.day),y:t(e)}))}function $e(e){return e.reduce((e,t)=>({tokensIn:e.tokensIn+t.tokensIn,tokensOut:e.tokensOut+t.tokensOut,estCostUsd:e.estCostUsd+t.estCostUsd,sessions:e.sessions+t.sessions,dayCount:e.dayCount+1}),{tokensIn:0,tokensOut:0,estCostUsd:0,sessions:0,dayCount:0})}function et(e){return e?e.days.length<2?{available:!1,reason:Ye}:{available:!0,days:e.days,series:[{id:`tokensIn`,label:`Tokens in`,points:Y(e.days,e=>e.tokensIn)},{id:`tokensOut`,label:`Tokens out`,points:Y(e.days,e=>e.tokensOut)}]}:{available:!1,reason:`No usage series has been loaded.`}}function tt(e){return e?e.days.length<2?{available:!1,reason:Ye}:{available:!0,days:e.days,series:[{id:`estCostUsd`,label:`Estimated spend`,points:Y(e.days,e=>e.estCostUsd)}]}:{available:!1,reason:`No usage series has been loaded.`}}function nt(e){if(!e)return{available:!1,reason:`No usage series has been loaded.`};let t=Qe(e.days,e=>e.cacheHitRate);return t===0?{available:!1,reason:`No day in this window reported a cache hit rate, so there is nothing to plot. This is an absent signal, not a 0% hit rate.`}:t<2?{available:!1,reason:`Only ${t} day in this window reported a cache hit rate, which is not a trend.`}:{available:!0,days:e.days,series:[{id:`cacheHitRate`,label:`Cache hit rate`,points:Y(e.days,e=>e.cacheHitRate)}]}}function rt(e){return e?Qe(e.days,e=>e.cacheRead)+Qe(e.days,e=>e.cacheWrite)===0?{available:!1,reason:`No day in this window reported cache read or write tokens, so there is nothing to plot. This is an absent signal, not zero cache activity.`}:e.days.length<2?{available:!1,reason:Ye}:{available:!0,days:e.days,series:[{id:`cacheRead`,label:`Cache read`,points:Y(e.days,e=>e.cacheRead)},{id:`cacheWrite`,label:`Cache write`,points:Y(e.days,e=>e.cacheWrite)}]}:{available:!1,reason:`No usage series has been loaded.`}}function it(e){if(e.length===0)return{tokensInPerDay:null,tokensOutPerDay:null,estCostUsdPerDay:null,peakCostDay:null};let t=$e(e),n=e.reduce((e,t)=>t.estCostUsd>e.estCostUsd?t:e);return{tokensInPerDay:t.tokensIn/e.length,tokensOutPerDay:t.tokensOut/e.length,estCostUsdPerDay:t.estCostUsd/e.length,peakCostDay:{day:n.day,usd:n.estCostUsd}}}function X(e,t){if(!(!e||e.days.length<2))return e.days.map(t)}var Z={"7d":`Last 7 days`,"30d":`Last 30 days`},at=S(0),ot=S(1),st=[{key:`provider`,label:`Provider`,render:e=>e.provider},{key:`tier`,label:`Tier`,render:e=>e.tier},{key:`tokens`,label:`Tokens`,numeric:!0,render:e=>y(e.tokens)},{key:`cost`,label:`Cost`,numeric:!0,render:e=>b(e.costUsd)},{key:`share`,label:`Share`,numeric:!0,render:e=>`${Math.round(e.sharePct)}%`}];function ct({label:e,tokens:t,total:n,color:r}){let i=n>0?Math.round(t/n*100):0;return(0,B.jsxs)(`div`,{className:z.splitRow,children:[(0,B.jsx)(`span`,{children:e}),(0,B.jsx)(`div`,{className:z.splitBar,role:`meter`,"aria-label":`${e} share of tokens`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":i,children:(0,B.jsx)(`div`,{className:z.splitFill,style:{width:`${i}%`,"--split-color":r}})}),(0,B.jsxs)(`span`,{className:z.num,children:[y(t),` · `,i,`%`]})]})}function lt({split:e,savingsNote:t}){let n=e.localTokens+e.cloudTokens,r=e.byProvider.map(e=>({label:e.provider,value:e.tokens}));return(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-split`,children:[(0,B.jsx)(`div`,{className:z.panelHead,children:(0,B.jsxs)(`h3`,{id:`verse-usage-split`,className:z.panelTitle,children:[`Local vs cloud · `,e.window]})}),(0,B.jsxs)(`div`,{className:z.tiles,children:[(0,B.jsx)(_,{label:`Not spent (ran locally)`,value:(0,B.jsx)(`span`,{className:z.num,children:b(e.localSavingsUsd)}),caption:`Estimated cloud list price of the ${e.window} local tokens. ${t??`A heuristic, not a quote.`}`}),(0,B.jsx)(_,{label:`Estimated cloud spend · ${e.window}`,value:(0,B.jsx)(`span`,{className:z.num,children:b(e.cloudCostUsd)}),caption:Ke}),(0,B.jsx)(_,{label:`Tokens · ${e.window}`,value:(0,B.jsx)(`span`,{className:z.num,children:y(e.totalTokens)}),caption:`Local and cloud combined`})]}),e.empty?(0,B.jsx)(`p`,{className:z.muted,style:{marginTop:`var(--space-4)`},children:`No provider activity recorded in this window.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:z.split,style:{marginTop:`var(--space-4)`},children:[(0,B.jsx)(ct,{label:`Local`,tokens:e.localTokens,total:n,color:at}),(0,B.jsx)(ct,{label:`Cloud`,tokens:e.cloudTokens,total:n,color:ot})]}),(0,B.jsx)(p,{items:[{label:`Local`,color:at,kind:`swatch`},{label:`Cloud`,color:ot,kind:`swatch`}]}),(0,B.jsx)(m,{title:`Tokens by provider`,description:`Share of the ${e.window} window`,empty:r.length===0,emptyMessage:`No provider rows in this window.`,table:(0,B.jsx)(x,{caption:`Tokens and cost by provider`,columns:st,rows:e.byProvider,rowKey:e=>e.provider}),children:(0,B.jsx)(f,{data:r,orientation:`horizontal`,height:Math.max(120,r.length*34),formatValue:e=>y(e),ariaLabel:`Tokens by provider over the ${e.window} window`})})]})]})}var ut={available:`success`,credits:`success`,tight:`warning`,exhausted:`danger`,"signed-out":`warning`,"probe-unsupported":`warning`,unknown:`unknown`},dt=S(0),ft=S(5);function pt(e,t=5e3){let[n,r]=(0,E.useState)(()=>Date.now());return(0,E.useEffect)(()=>{if(!e)return;let n=setInterval(()=>r(Date.now()),t);return()=>clearInterval(n)},[e,t]),n}function mt({row:e}){let t=e.resident?e.expiresAtMs:null,n=pt(t!==null);return t===null?`—`:ze(t-n)}function ht({row:e}){return e.tools===`unknown`?(0,B.jsx)(u,{quality:j(`The runtime did not report a capability list for this model.`),label:`${e.name} tool support`,children:null}):e.tools===`supported`?(0,B.jsx)(a,{status:`agentic`,tone:`success`,children:`tools`}):(0,B.jsx)(a,{status:`no-tools`,tone:`danger`,children:`no tools`})}function gt({row:e}){if(e.sizeBytes===null)return(0,B.jsx)(`span`,{children:`—`});let t=e.resident?`Resident size reported by the runtime.`:`On-disk size; this model is not resident, so it is using no memory.`;return(0,B.jsxs)(`span`,{title:t,children:[q(e.sizeBytes),e.resident&&e.memoryPct!==null?` · ${Math.round(e.memoryPct)}% of machine`:``]})}function _t({row:e}){if(!e.resident)return(0,B.jsx)(`span`,{className:z.capacityMuted,children:`not resident`});if(e.gpuPct===null)return(0,B.jsx)(u,{quality:j(`The runtime reported no VRAM split for this resident model.`),label:`${e.name} placement`,children:null});let t=Math.round(e.gpuPct);return(0,B.jsxs)(`span`,{className:z.placement,children:[(0,B.jsxs)(`span`,{className:z.placementBar,role:`img`,"aria-label":`${e.name}: ${t}% of resident bytes on GPU, ${100-t}% on CPU`,children:[(0,B.jsx)(`span`,{className:z.placementGpu,style:{width:`${t}%`,"--split-color":dt}}),(0,B.jsx)(`span`,{className:z.placementCpu,style:{width:`${100-t}%`,"--split-color":ft}})]}),(0,B.jsx)(`span`,{className:z.placementText,children:e.placement===`unknown`?`${t}% GPU`:`${e.placement} · ${t}% GPU`})]})}function vt({row:e}){return e.nativeContext===null&&e.configuredContext===null?(0,B.jsx)(`span`,{children:`—`}):e.contextTruncated?(0,B.jsx)(`span`,{title:`Native context is ${J(e.nativeContext)}; Ashlr runs this seat at ${J(e.configuredContext)}.`,children:`${J(e.configuredContext)} of ${J(e.nativeContext)}`}):(0,B.jsx)(`span`,{children:J(e.nativeContext??e.configuredContext)})}var yt=[{key:`name`,label:`Model`,render:e=>e.name},{key:`state`,label:`State`,render:e=>e.resident?(0,B.jsx)(a,{status:`resident`,tone:`success`,children:`resident`}):(0,B.jsx)(a,{status:`installed`,tone:`neutral`,children:`installed`})},{key:`tools`,label:`Agentic`,render:e=>(0,B.jsx)(ht,{row:e})},{key:`size`,label:`Size`,numeric:!0,render:e=>(0,B.jsx)(gt,{row:e})},{key:`placement`,label:`Placement`,render:e=>(0,B.jsx)(_t,{row:e})},{key:`params`,label:`Params`,numeric:!0,render:e=>e.parameterSize??`—`},{key:`quant`,label:`Quant`,render:e=>e.quantization??`—`},{key:`context`,label:`Context`,numeric:!0,render:e=>(0,B.jsx)(vt,{row:e})},{key:`keepalive`,label:`Keep-alive`,numeric:!0,render:e=>(0,B.jsx)(mt,{row:e})}];function bt({staleness:e}){return e.stale?(0,B.jsxs)(`p`,{className:z.staleNotice,role:`status`,children:[(0,B.jsx)(`span`,{className:z.staleFlag,children:`last known-good`}),` Every local figure below is the last known-good reading from `,Le(e.staleForMs),` ago`,e.runtimes.length>0?` (${e.runtimes.join(`, `)})`:``,`, not a fresh probe: the runtime did not answer in time and the server kept the previous report rather than erasing it.`]}):null}function xt({card:e,staleness:t}){let n={"--engine-color":e.color},r=e.usedPct===null?null:Math.round(e.usedPct);return(0,B.jsxs)(`article`,{className:z.card,style:n,"aria-label":`Local usage`,children:[(0,B.jsxs)(`div`,{className:z.cardHead,children:[(0,B.jsx)(`span`,{className:z.cardLabel,children:`Local`}),(0,B.jsx)(a,{status:e.verdict.state,tone:ut[e.verdict.state],children:e.verdict.headline})]}),(0,B.jsxs)(`div`,{className:z.cardMeta,children:[(0,B.jsx)(`span`,{children:`Ollama`}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,B.jsx)(`span`,{children:`no subscription, no quota, no bill`})]}),t?.stale?(0,B.jsx)(bt,{staleness:t}):null,(0,B.jsx)(`p`,{className:z.verdictDetail,children:e.verdict.detail}),e.verdict.code?(0,B.jsxs)(`p`,{className:z.sourceLine,children:[`Probe reason `,(0,B.jsx)(`code`,{className:z.commandInline,children:e.verdict.code})]}):null,(0,B.jsx)(`span`,{className:z.bindingLabel,children:`Memory budget`}),r===null?(0,B.jsxs)(`div`,{className:z.windowBlockLead,children:[(0,B.jsxs)(`div`,{className:z.windowHead,children:[(0,B.jsx)(`span`,{children:`Resident against machine memory`}),(0,B.jsx)(u,{quality:j(`Either the resident size or the machine memory budget was not reported, so no share can be computed.`),label:`local memory budget`,children:null})]}),(0,B.jsx)(`hr`,{className:z.unknownRule,"aria-hidden":`true`})]}):(0,B.jsxs)(`div`,{className:z.windowBlockLead,children:[(0,B.jsxs)(`div`,{className:z.windowHead,children:[(0,B.jsx)(`span`,{children:`Resident against machine memory`}),(0,B.jsxs)(`span`,{className:z.windowPct,children:[r,`%`]})]}),(0,B.jsx)(`div`,{className:z.track,"data-tone":e.tone,role:`meter`,"aria-label":`Local resident models against machine memory budget`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":r,"aria-valuetext":`${q(e.residentBytes)} of ${q(e.memoryBudgetBytes)} resident`,children:(0,B.jsx)(`div`,{className:z.fill,style:{width:`${r}%`}})}),(0,B.jsxs)(`p`,{className:z.windowReset,children:[q(e.residentBytes),` of `,q(e.memoryBudgetBytes)]})]}),(0,B.jsxs)(`p`,{className:z.sourceLine,children:[e.residentCount,` resident · `,e.installedCount,` installed`]})]})}function St({serving:e}){if(e===void 0)return(0,B.jsx)(`p`,{className:z.sourceLine,children:`Residency is not concurrency. How many local agents can run at once is decided by the serving runtime, not by these models — a resident model can still be served to one agent at a time. The serving runtime and its real slot count are in Autonomy.`});let t=le(e);return(0,B.jsxs)(`p`,{className:z.sourceLine,children:[(0,B.jsxs)(`strong`,{children:[t.headline,`.`]}),` `,t.detail]})}function Ct({view:e,serving:t}){let[n,r]=(0,E.useState)(!1),i=(0,E.useMemo)(()=>Ie(e?.runtimes??[]),[e]),a=(0,E.useMemo)(()=>n?(e?.rows??[]).filter(e=>e.tools!==`unsupported`):e?.rows??[],[e,n]),o=(0,E.useMemo)(()=>a.filter(e=>e.resident&&e.sizeBytes!==null),[a]);return(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-local`,children:[(0,B.jsxs)(`div`,{className:z.panelHead,children:[(0,B.jsx)(`h3`,{id:`verse-usage-local`,className:z.panelTitle,children:`Local availability`}),(0,B.jsx)(`p`,{className:z.panelNote,children:`Resident models answer immediately. A model without tool support cannot drive an agentic session at all, however much memory is free.`})]}),(0,B.jsx)(St,{serving:t}),(0,B.jsx)(bt,{staleness:i}),e===null?(0,B.jsx)(`p`,{className:z.muted,children:`No local-model source answered, so neither resident nor installed models can be listed. This is a missing source, not an empty machine.`}):e.reachable?e.rows.length===0?(0,B.jsx)(`p`,{className:z.muted,children:`The local runtime answered and reports no installed models. Pull one to give Ashlr a local seat.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:z.tiles,children:[(0,B.jsx)(Q,{label:`Resident now`,value:String(e.rows.filter(e=>e.resident).length),caption:e.residentBytes===null?`At least one resident model reported no size, so the total is withheld rather than understated.`:`${q(e.residentBytes)} in memory`}),(0,B.jsx)(Q,{label:`Installed`,value:String(e.rows.length),caption:`On disk; the first turn on one of these pays a load`}),(0,B.jsx)(Q,{label:`Can drive a session`,value:String(e.agenticCount),caption:e.unknownToolCount>0?`${e.nonAgenticCount} cannot; ${e.unknownToolCount} did not report a capability list`:`${e.nonAgenticCount} cannot drive one`}),(0,B.jsx)(Q,{label:`Machine memory`,value:e.memoryBudgetBytes===null?`unknown`:q(e.memoryBudgetBytes),caption:e.freeMemoryBytes===null?`The machine reported no free-memory figure.`:`${q(e.freeMemoryBytes)} reported free by the OS`})]}),(0,B.jsxs)(`div`,{className:z.panelActions,children:[(0,B.jsx)(`button`,{type:`button`,className:z.segment,"aria-pressed":n,onClick:()=>r(e=>!e),children:`Hide models that cannot drive a session`}),e.nonAgenticCount>0?(0,B.jsxs)(`span`,{className:z.capacityMuted,children:[e.nonAgenticCount,` of `,e.rows.length,` installed models cannot drive an agentic session.`]}):null]}),(0,B.jsx)(`div`,{className:z.tableScroll,children:(0,B.jsx)(x,{caption:`Local models: residency, tool support, size, placement, parameters, quantization, context and keep-alive`,columns:yt,rows:a,rowKey:e=>`${e.runtime??`runtime`}:${e.name}`})}),(0,B.jsx)(`div`,{className:z.charts,children:(0,B.jsx)(m,{title:`Resident memory by model`,description:`What is actually in memory right now`,caveat:`Only models the runtime reports as resident WITH a size appear here. An installed model occupies no memory and is not a bar at zero.`,empty:o.length===0,emptyMessage:`Nothing is resident, so there is no memory in use to chart. That is an idle machine, not a zero reading.`,table:(0,B.jsx)(x,{caption:`Resident size per model`,columns:[{key:`name`,label:`Model`,render:e=>e.name},{key:`size`,label:`Resident`,numeric:!0,render:e=>q(e.sizeBytes)}],rows:o,rowKey:e=>e.name}),children:(0,B.jsx)(f,{data:o.map(e=>({label:e.name,value:e.sizeBytes})),orientation:`horizontal`,height:Math.max(120,o.length*34),formatValue:e=>q(e),ariaLabel:`Resident memory by local model`})})}),e.runtimes.length>0?(0,B.jsx)(`ul`,{className:z.noteList,children:e.runtimes.map(e=>(0,B.jsxs)(`li`,{className:z.capacityMuted,children:[e.runtime,`:`,` `,e.reachable?`${e.modelCount} model${e.modelCount===1?``:`s`} reported`:`did not answer`,e.stale?` · retained reading, ${Le(e.staleForMs)} old`:``,e.reason?` · `:``,e.reason?(0,B.jsx)(`code`,{className:z.commandInline,children:e.reason}):null]},e.runtime))}):null,e.notes.length>0?(0,B.jsx)(`ul`,{className:z.noteList,children:e.notes.map(e=>(0,B.jsx)(`li`,{className:z.capacityMuted,children:e},e))}):null,(0,B.jsxs)(`p`,{className:z.sourceLine,children:[`Sizes and the GPU share come from the runtime's own resident report; a model with no reported VRAM split shows no placement bar rather than being drawn as fully on GPU.`,` `,y(e.rows.length),` models installed.`]})]}):(0,B.jsxs)(`p`,{className:z.muted,children:[`No local runtime answered this probe, so nothing about local models can be read. That is an unanswered probe, not a report that no models are installed.`,e.reason?(0,B.jsxs)(B.Fragment,{children:[` `,`Probe reason `,(0,B.jsx)(`code`,{className:z.commandInline,children:e.reason}),`.`]}):null]})]})}function Q({label:e,value:t,caption:n}){return(0,B.jsxs)(`div`,{className:z.figureTile,children:[(0,B.jsx)(`span`,{className:z.figureLabel,children:e}),(0,B.jsx)(`span`,{className:z.figureBig,children:t}),(0,B.jsx)(`span`,{className:z.figureCaption,children:n})]})}var wt=[`7d`,`30d`],Tt=[{key:`day`,label:`Day`,render:e=>h(e.day)},{key:`in`,label:`Tokens in`,numeric:!0,render:e=>y(e.tokensIn)},{key:`out`,label:`Tokens out`,numeric:!0,render:e=>y(e.tokensOut)},{key:`sessions`,label:`Sessions`,numeric:!0,render:e=>y(e.sessions)}],Et=[{key:`day`,label:`Day`,render:e=>h(e.day)},{key:`cost`,label:`Estimated spend`,numeric:!0,render:e=>b(e.estCostUsd)}],Dt=[{key:`day`,label:`Day`,render:e=>h(e.day)},{key:`read`,label:`Cache read`,numeric:!0,render:e=>e.cacheRead===null?`not reported`:y(e.cacheRead)},{key:`write`,label:`Cache write`,numeric:!0,render:e=>e.cacheWrite===null?`not reported`:y(e.cacheWrite)}],Ot=[{key:`day`,label:`Day`,render:e=>h(e.day)},{key:`rate`,label:`Cache hit rate`,numeric:!0,render:e=>e.cacheHitRate===null?`not reported`:d(e.cacheHitRate)},{key:`read`,label:`Cache read`,numeric:!0,render:e=>e.cacheRead===null?`not reported`:y(e.cacheRead)}];function kt({series:e,window:t,onWindowChange:n,unavailableReason:r,loading:i}){let a=e?$e(e.days):null,o=e?it(e.days):null,s=et(e),c=tt(e),l=nt(e),u=rt(e);return(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-series`,children:[(0,B.jsxs)(`div`,{className:z.panelHead,children:[(0,B.jsx)(`h3`,{id:`verse-usage-series`,className:z.panelTitle,children:`Token output and spend`}),(0,B.jsx)(`div`,{className:z.segmented,role:`group`,"aria-label":`Series window`,children:wt.map(e=>(0,B.jsx)(`button`,{type:`button`,className:z.segment,"aria-pressed":e===t,onClick:()=>n(e),children:e},e))})]}),r?(0,B.jsxs)(`p`,{className:z.muted,children:[r,` No token or spend series can be drawn, and none is invented in its place.`]}):i&&e===null?(0,B.jsxs)(`p`,{className:z.muted,"aria-busy":`true`,children:[`Loading the `,Z[t].toLowerCase(),` rollup…`]}):e===null||e.days.length===0?(0,B.jsxs)(`p`,{className:z.muted,children:[`The rollup for `,Z[t].toLowerCase(),` came back with no days in it. That is an empty window, not a zero.`]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:z.tiles,children:[(0,B.jsx)(_,{label:`Tokens in · ${t}`,value:(0,B.jsx)(`span`,{className:z.num,children:y(a?.tokensIn??0)}),caption:`Across ${a?.dayCount??0} recorded days`,trend:X(e,e=>e.tokensIn),trendLabel:`Tokens in per day`}),(0,B.jsx)(_,{label:`Tokens out · ${t}`,value:(0,B.jsx)(`span`,{className:z.num,children:y(a?.tokensOut??0)}),caption:`What the models actually produced`,trend:X(e,e=>e.tokensOut),trendLabel:`Tokens out per day`}),(0,B.jsx)(_,{label:`Estimated spend · ${t}`,value:(0,B.jsx)(`span`,{className:z.num,children:b(a?.estCostUsd??0)}),caption:`Estimated from a static price table — not billed`,trend:X(e,e=>e.estCostUsd),trendLabel:`Estimated spend per day`}),(0,B.jsx)(_,{label:`Sessions · ${t}`,value:(0,B.jsx)(`span`,{className:z.num,children:y(a?.sessions??0)}),caption:`Rollup rows, not billed calls`,trend:X(e,e=>e.sessions),trendLabel:`Sessions per day`}),(0,B.jsx)(_,{label:`Estimated spend per active day`,value:(0,B.jsx)(`span`,{className:z.num,children:o?.estCostUsdPerDay===null||o===null?`unknown`:b(o.estCostUsdPerDay)}),caption:`Across the ${a?.dayCount??0} days that carry a rollup row — not the ${t} calendar span`}),(0,B.jsx)(_,{label:`Heaviest day`,value:(0,B.jsx)(`span`,{className:z.num,children:o?.peakCostDay?b(o.peakCostDay.usd):`unknown`}),caption:o?.peakCostDay?`${h(o.peakCostDay.day)} — estimated, not billed`:`No day in this window carries a cost row.`})]}),(0,B.jsxs)(`div`,{className:z.charts,children:[(0,B.jsx)(m,{title:`Tokens per day`,description:Z[t],empty:!s.available,emptyMessage:s.available?``:s.reason,table:(0,B.jsx)(x,{caption:`Tokens in and out per day`,columns:Tt,rows:e.days,rowKey:e=>e.day}),children:s.available?(0,B.jsx)(g,{series:s.series,formatX:e=>v(e),formatY:e=>y(e),ariaLabel:`Tokens in and out per day over ${Z[t].toLowerCase()}`}):null}),(0,B.jsx)(m,{title:`Estimated spend per day`,description:Z[t],caveat:Ke,empty:!c.available,emptyMessage:c.available?``:c.reason,table:(0,B.jsx)(x,{caption:`Estimated spend per day`,columns:Et,rows:e.days,rowKey:e=>e.day}),children:c.available?(0,B.jsx)(g,{series:c.series,area:!0,formatX:e=>v(e),formatY:e=>b(e),ariaLabel:`Estimated spend per day over ${Z[t].toLowerCase()}`}):null}),(0,B.jsx)(m,{title:`Cache hit rate`,description:Z[t],caveat:qe,empty:!l.available,emptyMessage:l.available?``:l.reason,table:l.available?(0,B.jsx)(x,{caption:`Cache hit rate per day`,columns:Ot,rows:e.days,rowKey:e=>e.day}):void 0,children:l.available?(0,B.jsx)(g,{series:l.series,formatX:e=>v(e),formatY:e=>d(e),ariaLabel:`Cache hit rate per day over ${Z[t].toLowerCase()}`}):null}),(0,B.jsx)(m,{title:`Cache read and write tokens`,description:Z[t],caveat:qe,empty:!u.available,emptyMessage:u.available?``:u.reason,table:u.available?(0,B.jsx)(x,{caption:`Cache read and write tokens per day`,columns:Dt,rows:e.days,rowKey:e=>e.day}):void 0,children:u.available?(0,B.jsx)(g,{series:u.series,formatX:e=>v(e),formatY:e=>y(e),ariaLabel:`Cache read and write tokens per day over ${Z[t].toLowerCase()}`}):null}),(0,B.jsx)(m,{title:`Local vs cloud per day`,description:Z[t],empty:!0,emptyMessage:Xe,children:null})]}),e.caveats.length>0?(0,B.jsx)(`ul`,{className:z.noteList,children:e.caveats.map(e=>(0,B.jsx)(`li`,{className:z.capacityMuted,children:e},e))}):null]})]})}var At=[{key:`day`,label:`Day`,render:e=>h(e.day)},{key:`usd`,label:`Spend`,numeric:!0,render:e=>e.usd===null?`no tick retained`:b(e.usd)}];function jt({series:e,todaySpentUsd:t,todaySpentDate:n,dailyBudgetUsd:r,showSeries:i=!0}){let a=n!==null&&!ce(n),o=a?null:t,s=a?`Nothing recorded today — the last ledger day is ${n}`:r===null?`Configured daily budget unavailable`:r===0?`Daily budget is 0 — the loop is stopped`:`of a ${b(r)} daily budget`;return(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-spend`,children:[(0,B.jsx)(`div`,{className:z.panelHead,children:(0,B.jsx)(`h3`,{id:`verse-usage-spend`,className:z.panelTitle,children:`Spend`})}),(0,B.jsx)(`div`,{className:z.tiles,children:(0,B.jsx)(_,{label:`Spend today`,value:(0,B.jsx)(`span`,{className:z.num,children:o===null?`unknown`:b(o)}),caption:s})}),i?(0,B.jsx)(`div`,{style:{marginTop:`var(--space-4)`},children:e.available?(0,B.jsx)(m,{title:`Spend per day`,description:`Autonomous loop, from the daemon tick ledger`,caveat:e.caveat,table:(0,B.jsx)(x,{caption:`Spend per day from the daemon tick ledger`,columns:At,rows:e.days,rowKey:e=>e.day}),children:(0,B.jsx)(g,{series:[{id:`spend`,label:`Spend`,points:e.days.map(e=>({x:Date.parse(`${e.day}T00:00:00Z`),y:e.usd}))}],area:!0,formatX:e=>v(e),formatY:e=>b(e),ariaLabel:`Autonomous loop spend per day`})}):(0,B.jsx)(m,{title:`Spend per day`,empty:!0,emptyMessage:e.reason,children:null})}):(0,B.jsx)(`p`,{className:z.sourceLine,children:`Per-day spend is charted above from the full usage rollup. The daemon tick ledger is not drawn again here.`})]})}var Mt={five_hour:`Session · rolling 5h`,seven_day:`Week · all models`,seven_day_sonnet:`Week · Sonnet`,seven_day_opus:`Week · Opus`,seven_day_fable:`Week · Fable`,codex:`Week · Codex`,primary:`Primary window`,secondary:`Secondary window`};function Nt(e){if(e.label)return e.label;let t=Mt[e.id];if(t)return t;let n=/^seven_day_(.+)$/.exec(e.id);return n?`Week · ${n[1]}`:e.id}function Pt(e){let t=e.resetDescription??e.resetsAt;return{id:e.id,label:Nt(e),usedPct:e.limitReached?null:e.usedPercent,tone:e.limitReached?`danger`:e.usedPercent===null?`ok`:M(e.usedPercent),resetText:t,resetsAt:e.resetsAt,limitReached:e.limitReached,measured:e.measured}}function Ft(e){let t=e.windows,n=t.find(e=>e.limitReached);if(n)return n;let r=t.filter(e=>e.usedPercent!==null),i=r.length===0?null:r.reduce((e,t)=>(t.usedPercent??0)>(e.usedPercent??0)?t:e),a=e.binding;if(a){let e=t.find(e=>e.id===a.id)??null;if(e&&(a.limitReached||e.limitReached||i===null||(a.usedPercent??-1)>=(i.usedPercent??-1)))return e}return i}var It={"connection-monitor-stopped":"Native polling stopped after a metadata sample could not confirm its process cleanup, so these readings are frozen and no new ones are being taken. Restarting `ashlr verse` begins a new collection generation.","collector-unavailable":`This server is not collecting native metadata, so nothing here is a live reading.`,"collector-not-running":`No account collector is running in this server, so these cards fall back to whatever shared evidence exists.`,"collector-owned":"Another collector (`ashlr resource-console`) owns the exclusive metadata lease, so Verse is reading its shared evidence rather than probing.","collector-start-failed":`The metadata collectors could not be started in this server, so no probe has run.`,"connection-polling-paused":`Native polling is paused because no client has asked for account data recently; it resumes on the next request.`,"connection-not-checked":`No probe has run for this account yet in this server.`,"connection-probe-unavailable":`The probe for this account did not return a usable result, so there is no measurement to show.`,"accounts-pool-unavailable":`This accounts root has no readable pool or bindings, so there is nothing to probe.`,"accounts-collection-not-configured":`Native account collection is not configured for this accounts root.`,"usage-version-unsupported":`The usage probe is pinned to a specific provider build and failed closed on the installed one. That is a version pin, not an outage.`,"usage-account-changed":`The account behind this profile changed between two reads, so the reading was discarded rather than attributed to the wrong account.`,"probe-account-unavailable":`The pinned profile answered but carries no usable account identity — it is not authenticated.`,"probe-account-unsupported":`The pinned profile is authenticated by a method this probe does not accept, so no reading was taken.`,"probe-account-changed":`The account behind this pinned profile changed mid-probe, so the reading was discarded.`,"probe-account-hint-mismatch":`The pinned profile is signed in as a different account than this seat expects.`,"probe-native-unavailable":`The provider CLI for this pinned profile could not be run, so no reading was taken.`,"probe-native-exit-failed":`The provider CLI for this pinned profile exited without a usable result.`,"probe-provider-error":`The provider CLI returned an error instead of account metadata.`,"probe-protocol-unsupported":`The installed provider CLI does not speak the metadata protocol this probe requires.`,"probe-quota-invalid":`The provider returned a quota shape this probe does not recognise, so nothing was accepted as a reading.`,"probe-timed-out":`The metadata probe for this account timed out before it returned anything.`};function Lt(e,t){return e===null?t:It[e]??t}var Rt={available:0,credits:1,tight:2,exhausted:3,"signed-out":4,"probe-unsupported":5,unknown:6},zt=80,Bt=100;function Vt(e){return e?e.unlimited?!0:e.hasCredits?e.balanceValue!==null&&e.balanceValue>0:!1:!1}function Ht(e){return e.unlimited?`credits are unlimited on this plan`:`a credit balance of ${e.balance??`an unreported amount`} is still spendable`}function Ut(e,t){if(e.authentication===`signed-out`||e.state===`signed-out`)return{state:`signed-out`,headline:`Signed out`,detail:Lt(e.reason,`The probe reached this account’s pinned profile but it is not authenticated, so there is nothing to measure.`),code:e.reason};if(e.unsupported)return{state:`probe-unsupported`,headline:`Probe version-pinned`,detail:`The usage probe failed closed with ${e.unsupported.code}${e.unsupported.pinnedVersion?`; it is pinned to ${e.unsupported.pinnedVersion}`:``}. This is a version pin, not an outage — no window can be read until the pin is bumped.`,code:e.unsupported.code};let n=Vt(e.credits);if(t===null||t.usedPercent===null&&!t.limitReached)return n&&e.credits?{state:`credits`,headline:`Usable on credits`,detail:`No window reading reached this surface, but ${Ht(e.credits)}.`,code:e.reason}:{state:`unknown`,headline:`No reading`,detail:Lt(e.reason,`No window percentage reached this surface for this account, so nothing here is a measurement.`),code:e.reason};let r=t.usedPercent,i=t.limitReached||r!==null&&r>=Bt,a=Nt(t);return i?n&&e.credits?{state:`credits`,headline:`Usable on credits`,detail:`${a} is ${t.limitReached?`reported as limit reached`:`fully used`}, but ${Ht(e.credits)} — credits are independent of the window, so this account is not blocked.`,code:null}:{state:`exhausted`,headline:t.limitReached?`Limit reached`:`Window exhausted`,detail:t.limitReached?`The provider flagged ${a} as rate-limited. That flag is a denial, not a measurement, so no percentage is shown.`:`${a} is at ${Math.round(r)}% — it is the binding constraint on this account.`,code:null}:r>=zt?{state:`tight`,headline:`Running tight`,detail:`${a} is the binding constraint at ${Math.round(r)}%.`,code:null}:{state:`available`,headline:`Usable now`,detail:`${a} is the binding constraint at ${Math.round(r)}%.`,code:null}}function Wt(e,t=null){let n=Ft(e),r=Ut(e,n),i=e.provider,a=e.windows.filter(e=>e.id!==n?.id).map(Pt),o=n?Pt(n):null,s={state:e.state,authentication:e.authentication,health:e.health,reasonCode:e.reason,observedAt:e.observedAt,notes:e.notes,unsupported:e.unsupported};return{id:e.id,label:e.label,engine:i,color:D[i],plan:e.planType,verdict:r,allWindows:o?[o,...a]:a,evidence:s,hasDetail:e.windows.length>0||e.notes.length>0||e.credits!==null||e.reason!==null,binding:o,others:a,credits:e.credits,reconnectCommand:e.reconnectCommand,observedAt:e.observedAt,rank:Rt[r.state],sourceNote:t}}function Gt(e){if(!e)return[];let t=new Set;for(let n of e.accounts)for(let e of n.notes)t.add(e);return[...t]}function Kt(e){return e?e.accounts.map(e=>Wt(e)).sort((e,t)=>e.rank-t.rank||e.label.localeCompare(t.label)):[]}function qt(e){if(!e)return null;let t=e.models.filter(e=>e.loaded),n=e.reachable?t.length===0?0:t.some(e=>e.sizeBytes===null)?null:t.reduce((e,t)=>e+(t.sizeBytes??0),0):null,r=e.memoryBudgetBytes,i=n!==null&&r!==null&&r>0?Math.max(0,Math.min(100,n/r*100)):null,a=e.reachable?t.length>0?{state:`available`,headline:`Resident now`,detail:`${t.length} model${t.length===1?``:`s`} already in memory — no load delay, no quota, no bill.`,code:null}:e.models.length>0?{state:`tight`,headline:`Installed, not loaded`,detail:`${e.models.length} model${e.models.length===1?` is`:`s are`} installed but nothing is resident, so the first turn pays a load.`,code:null}:{state:`unknown`,headline:`No models installed`,detail:`The runtime is reachable but reports no installed models.`,code:null}:{state:`unknown`,headline:`Runtime unreachable`,detail:`No local runtime answered, so neither resident nor installed models can be listed. This is an unanswered probe, not a report that the machine is empty.`,code:e.reason};return{residentCount:t.length,installedCount:e.models.length,residentBytes:n,memoryBudgetBytes:r,usedPct:i,tone:i===null?`ok`:M(i),verdict:a,color:D.local,rank:Rt[a.state]}}var Jt=`Per-account probes are unavailable on this server, so these cards are derived from the seat roster and the per-engine snapshots.`;function Yt(e){let{seat:t,control:n,frontier:r,engineSeatCount:i}=e;if(t.engine===`local`)return null;let a=n?.subscriptionUsage?.find(e=>String(e.engine)===t.engine),o=r?.engines.find(e=>String(e.engine)===t.engine),s=de({engine:t.engine,seat:t,subscription:a,frontier:o,engineSeatCount:i}),c=s.kind===`measured`?s.windows.map(e=>({id:e.id,label:e.label,usedPercent:e.usedPct,resetsAt:e.resetsAt===null?null:new Date(e.resetsAt*1e3).toISOString(),resetDescription:null,limitReached:!1,measured:!0})):[];return{account:{id:t.id,label:t.label,provider:t.engine,state:s.kind===`measured`?`observed`:`unavailable`,authentication:`unknown`,health:null,planType:a?.plan??null,observedAt:t.health.observedAt,windows:c,binding:null,credits:null,reason:s.kind===`measured`?null:s.reason,unsupported:null,reconnectCommand:null,notes:[]},sourceNote:s.kind===`measured`?`${ue[s.source]}${s.scope===`engine`?` · engine-wide, shared by every account on this engine`:``}`:null}}function Xt(e){let t=e.bootstrap?.seats??[],n=new Map;for(let e of t)n.set(e.engine,(n.get(e.engine)??0)+1);return t.map(t=>Yt({seat:t,control:e.control,frontier:e.frontier,engineSeatCount:n.get(t.engine)??1})).filter(e=>e!==null).map(e=>Wt(e.account,e.sourceNote)).sort((e,t)=>e.rank-t.rank||e.label.localeCompare(t.label))}function $(e){return e instanceof s&&e.status===401}function Zt({title:e,body:t,action:n}){return(0,B.jsxs)(`div`,{className:z.stateBlock,role:`status`,children:[(0,B.jsx)(`p`,{className:z.stateTitle,children:e}),(0,B.jsx)(`p`,{className:z.stateBody,children:t}),n?(0,B.jsx)(`div`,{className:z.stateActions,children:n}):null]})}var Qt=3e4,$t={gridColumn:`1 / -1`};function en(e,t){(0,E.useEffect)(()=>{let n=null,r=()=>{n!==null&&clearInterval(n),n=null},i=()=>{let i=typeof document>`u`||document.visibilityState===`visible`;i&&n===null?n=setInterval(e,t):i||r()};return i(),document.addEventListener(`visibilitychange`,i),()=>{document.removeEventListener(`visibilitychange`,i),r()}},[e,t])}function tn(){let[e,t]=(0,E.useState)(`7d`),[n,a]=(0,E.useState)(null),s=c(w),u=c(C),f=c(se(e)),p=c(ne),m=c(ee),h=c(re),g=c(ae),v=r(w),y=r(C),b=r(se(e)),x=r(ne),S=r(ee),ce=r(re),le=r(ae),T=l(w),D=l(C);en(T,Qt),en(D,Qt);let O=()=>{v(),y(),b(),x(),S(),ce(),le()},k=(0,E.useMemo)(()=>s.data?.available?ie(s.data.raw):null,[s.data]),A=(0,E.useMemo)(()=>u.data?.available?oe(u.data.raw):null,[u.data]),ue=(0,E.useMemo)(()=>f.data?.available?te(f.data.raw,e):null,[f.data,e]),j=(0,E.useMemo)(()=>h.data?h.data.available?_e(h.data.raw,h.data.reason):ve(h.data.reason??`Configured caps unavailable.`):ve(`Configured caps not loaded yet.`),[h.data]),M=k===null,N=(0,E.useMemo)(()=>k?Kt(k):Xt({bootstrap:g.data,control:m.data,frontier:p.data}),[k,g.data,m.data,p.data]),P=(0,E.useMemo)(()=>Re(A),[A]),F=(0,E.useMemo)(()=>qt(A),[A]),I=(0,E.useMemo)(()=>Gt(k),[k]),de=(0,E.useMemo)(()=>{let e=N.map(e=>({key:e.id,rank:e.rank,label:e.label,kind:`account`,card:e}));return F&&e.push({key:`local`,rank:F.rank,label:`Local`,kind:`local`,card:F}),e.sort((e,t)=>e.rank-t.rank||e.label.localeCompare(t.label))},[N,F]),me=(0,E.useMemo)(()=>je({cards:N,localCard:F,localView:P}),[N,F,P]),ge=(0,E.useMemo)(()=>Ie(P?.runtimes??[]),[P]),L=e=>{a(t=>t===e?null:e)},R=(0,E.useCallback)(()=>{let e=n;a(null),e!==null&&typeof document<`u`&&document.getElementById(`verse-account-trigger-${e}`)?.focus()},[n]),V=(0,E.useMemo)(()=>fe(m.data?.usage),[m.data]),ye=(0,E.useMemo)(()=>pe(m.data?.limits,j.foundryLimits),[m.data,j.foundryLimits]),be=(0,E.useMemo)(()=>he(m.data?.daemonObservation),[m.data]),Se=j.available?j.todaySpentUsd:m.data?.daemon.todaySpentUsd??null,Ce=j.available?j.todaySpentDate:null,H=$(s.error)||$(u.error)||$(f.error)||$(p.error)||$(m.error)||$(g.error),U=!H&&p.status===`error`&&m.status===`error`&&p.data===void 0&&m.data===void 0,W=!H&&!U&&s.data===void 0&&p.data===void 0&&m.data===void 0&&(s.status===`loading`||s.status===`idle`||p.status===`loading`||m.status===`loading`||p.status===`idle`||m.status===`idle`),G=s.status===`refreshing`||p.status===`refreshing`||m.status===`refreshing`,K=k?.sampledAt??p.data?.generatedAt??m.data?.ts??null;return(0,B.jsxs)(`section`,{className:z.section,"aria-label":`Usage`,children:[(0,B.jsxs)(`header`,{className:z.header,"data-app-region":`drag`,children:[(0,B.jsx)(`h2`,{className:z.headerTitle,children:`Usage`}),(0,B.jsxs)(`div`,{className:z.headerMeta,children:[K?(0,B.jsxs)(`span`,{children:[G?`refreshing · `:``,`as of `,new Date(K).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})]}):null,(0,B.jsx)(`button`,{type:`button`,className:z.ghostButton,onClick:O,children:`Refresh`})]})]}),(0,B.jsx)(`div`,{className:z.scroll,children:H?(0,B.jsx)(Zt,{title:`Read session expired`,body:`Usage data needs an authenticated read session. Unlock the console with the read token ashlr verse printed, then refresh.`,action:(0,B.jsx)(`button`,{type:`button`,className:z.ghostButton,onClick:O,children:`Try again`})}):U?(0,B.jsx)(Zt,{title:`Usage sources unreachable`,body:`Neither /api/usage nor /api/control answered. ${m.error?.message??p.error?.message??``}`.trim(),action:(0,B.jsx)(`button`,{type:`button`,className:z.ghostButton,onClick:O,children:`Retry`})}):W?(0,B.jsxs)(`div`,{"aria-busy":`true`,children:[(0,B.jsx)(i,{width:`30%`}),(0,B.jsx)(`div`,{className:z.skeletonGrid,style:{marginTop:`var(--space-4)`},children:(0,B.jsx)(o,{count:5})})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Ue,{overview:me,selectedId:n,onSelectSeat:L}),(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-accounts`,children:[(0,B.jsxs)(`div`,{className:z.panelHead,children:[(0,B.jsx)(`h3`,{id:`verse-usage-accounts`,className:z.panelTitle,children:`Accounts`}),(0,B.jsx)(`p`,{className:z.panelNote,children:`Ordered by what you can use right now. Each card leads with its binding constraint — the window with the highest used percent, because that is what blocks work.`})]}),M&&s.data&&!s.data.available?(0,B.jsxs)(`p`,{className:z.muted,children:[s.data.reason,` `,Jt]}):null,k?.collectorNote?(0,B.jsx)(`p`,{className:z.muted,children:k.collectorNote}):null,I.length>0?(0,B.jsx)(`ul`,{className:z.noteList,children:I.map(e=>(0,B.jsx)(`li`,{className:z.muted,children:e},e))}):null,N.length===0&&F===null?(0,B.jsx)(`p`,{className:z.muted,children:`No accounts and no local runtime were reported. Connect an account or start Ollama, then refresh — this is an empty roster, not a set of accounts at zero.`}):(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(`div`,{className:z.cards,children:de.map(e=>{if(e.kind!==`account`)return(0,B.jsx)(xt,{card:e.card,staleness:ge},e.key);let t=n===e.key;return(0,B.jsxs)(E.Fragment,{children:[(0,B.jsx)(xe,{card:e.card,onOpen:L,expanded:t,triggerId:`verse-account-trigger-${e.key}`,detailId:`verse-account-detail-${e.key}`}),t?(0,B.jsx)(`div`,{id:`verse-account-detail-${e.key}`,style:$t,children:(0,B.jsx)(we,{card:e.card,headingId:`verse-account-heading-${e.key}`,onClose:R})}):null]},e.key)})})})]}),(0,B.jsx)(Ct,{view:P}),(0,B.jsx)(kt,{series:ue,window:e,onWindowChange:t,unavailableReason:f.data&&!f.data.available?f.data.reason:null,loading:f.status===`loading`||f.status===`idle`}),V?(0,B.jsx)(lt,{split:V,savingsNote:Je}):(0,B.jsxs)(`section`,{className:z.panel,"aria-labelledby":`verse-usage-split-missing`,children:[(0,B.jsx)(`div`,{className:z.panelHead,children:(0,B.jsx)(`h3`,{id:`verse-usage-split-missing`,className:z.panelTitle,children:`Local vs cloud`})}),(0,B.jsx)(`div`,{className:z.tiles,children:(0,B.jsx)(_,{label:`Not spent (ran locally)`,value:(0,B.jsx)(`span`,{className:z.num,children:`unknown`}),caption:`/api/control did not answer, so the split is unavailable`})})]}),(0,B.jsx)(Ge,{rows:ye,capsNote:j.available?null:j.reason}),(0,B.jsx)(jt,{series:be,todaySpentUsd:Se,todaySpentDate:Ce,dailyBudgetUsd:j.dailyBudgetUsd,showSeries:ue===null}),j.available&&j.subscriptionMaxPercent!==null?(0,B.jsxs)(`p`,{className:z.muted,children:[`Subscription throttle threshold is`,` `,(0,B.jsx)(`span`,{className:z.num,children:d(j.subscriptionMaxPercent/100)}),`. It only applies to engines that publish a real window reading — no seat is ever throttled on a guess.`]}):null]})})]})}export{tn as UsageSection};
2
- //# sourceMappingURL=UsageSection-Bq6Daaby.js.map