@ashlr/hub 3.5.1 → 3.8.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 (124) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +3 -0
  3. package/dist/build-identity.json +2 -2
  4. package/dist/cli/activation.d.ts +41 -0
  5. package/dist/cli/activation.js +485 -0
  6. package/dist/cli/activation.js.map +1 -0
  7. package/dist/core/daemon/cutoff-checkpoint-scheduler.js +7 -0
  8. package/dist/core/daemon/cutoff-checkpoint-scheduler.js.map +1 -1
  9. package/dist/core/daemon/loop.d.ts +19 -0
  10. package/dist/core/daemon/loop.js +235 -5
  11. package/dist/core/daemon/loop.js.map +1 -1
  12. package/dist/core/daemon/overnight-status.d.ts +152 -0
  13. package/dist/core/daemon/overnight-status.js +275 -0
  14. package/dist/core/daemon/overnight-status.js.map +1 -0
  15. package/dist/core/daemon/post-merge-halt.d.ts +212 -0
  16. package/dist/core/daemon/post-merge-halt.js +503 -0
  17. package/dist/core/daemon/post-merge-halt.js.map +1 -0
  18. package/dist/core/daemon/run-window.d.ts +218 -0
  19. package/dist/core/daemon/run-window.js +420 -0
  20. package/dist/core/daemon/run-window.js.map +1 -0
  21. package/dist/core/fleet/generated-repair-resolution.d.ts +36 -0
  22. package/dist/core/fleet/generated-repair-resolution.js +245 -0
  23. package/dist/core/fleet/generated-repair-resolution.js.map +1 -0
  24. package/dist/core/local-runtime/llama/port.d.ts +17 -0
  25. package/dist/core/local-runtime/llama/port.js +47 -0
  26. package/dist/core/local-runtime/llama/port.js.map +1 -0
  27. package/dist/core/local-runtime/llama/proxy-host.d.ts +54 -0
  28. package/dist/core/local-runtime/llama/proxy-host.js +159 -0
  29. package/dist/core/local-runtime/llama/proxy-host.js.map +1 -0
  30. package/dist/core/local-runtime/llama/proxy-process.d.ts +148 -0
  31. package/dist/core/local-runtime/llama/proxy-process.js +250 -0
  32. package/dist/core/local-runtime/llama/proxy-process.js.map +1 -0
  33. package/dist/core/local-runtime/llama/proxy-record.d.ts +40 -0
  34. package/dist/core/local-runtime/llama/proxy-record.js +133 -0
  35. package/dist/core/local-runtime/llama/proxy-record.js.map +1 -0
  36. package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +118 -0
  37. package/dist/core/local-runtime/llama/proxy-supervisor.js +511 -0
  38. package/dist/core/local-runtime/llama/proxy-supervisor.js.map +1 -0
  39. package/dist/core/policy/local-only.d.ts +142 -2
  40. package/dist/core/policy/local-only.js +204 -15
  41. package/dist/core/policy/local-only.js.map +1 -1
  42. package/dist/core/run/budget.d.ts +22 -8
  43. package/dist/core/run/budget.js +80 -12
  44. package/dist/core/run/budget.js.map +1 -1
  45. package/dist/core/run/sandboxed-engine.js +3 -3
  46. package/dist/core/run/sandboxed-engine.js.map +1 -1
  47. package/dist/core/universe/builtins/preparation/manifest.json +1 -1
  48. package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +61 -9
  49. package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +60 -8
  50. package/dist/core/verse/session-engine.d.ts +42 -1
  51. package/dist/core/verse/session-engine.js +79 -2
  52. package/dist/core/verse/session-engine.js.map +1 -1
  53. package/dist/core/web/public/next/assets/{App-BbVoUCIi.js → App-BsbJFA2j.js} +2 -2
  54. package/dist/core/web/public/next/assets/{App-BbVoUCIi.js.map → App-BsbJFA2j.js.map} +1 -1
  55. package/dist/core/web/public/next/assets/{ApprovalsSection-BW9iVjUa.js → ApprovalsSection-2CCSoBTJ.js} +2 -2
  56. package/dist/core/web/public/next/assets/{ApprovalsSection-BW9iVjUa.js.map → ApprovalsSection-2CCSoBTJ.js.map} +1 -1
  57. package/dist/core/web/public/next/assets/{AutonomySection-Cpk_oEhc.css → AutonomySection-CHjxJt2z.css} +1 -1
  58. package/dist/core/web/public/next/assets/AutonomySection-yeNNUPur.js +2 -0
  59. package/dist/core/web/public/next/assets/AutonomySection-yeNNUPur.js.map +1 -0
  60. package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +1 -0
  61. package/dist/core/web/public/next/assets/ChatSection-DwDDnCZQ.js +80 -0
  62. package/dist/core/web/public/next/assets/ChatSection-DwDDnCZQ.js.map +1 -0
  63. package/dist/core/web/public/next/assets/{ConfirmDialog-CXevY3Au.js → ConfirmDialog-C363ty_c.js} +2 -2
  64. package/dist/core/web/public/next/assets/{ConfirmDialog-CXevY3Au.js.map → ConfirmDialog-C363ty_c.js.map} +1 -1
  65. package/dist/core/web/public/next/assets/{Dialog-Bn0CgEGz.js → Dialog-nK15L1M0.js} +2 -2
  66. package/dist/core/web/public/next/assets/{Dialog-Bn0CgEGz.js.map → Dialog-nK15L1M0.js.map} +1 -1
  67. package/dist/core/web/public/next/assets/{DiffViewer-QKyisN2L.js → DiffViewer-D369eZe8.js} +2 -2
  68. package/dist/core/web/public/next/assets/{DiffViewer-QKyisN2L.js.map → DiffViewer-D369eZe8.js.map} +1 -1
  69. package/dist/core/web/public/next/assets/McpSection-D88QlDpG.css +1 -0
  70. package/dist/core/web/public/next/assets/McpSection-DVgiSYG1.js +2 -0
  71. package/dist/core/web/public/next/assets/McpSection-DVgiSYG1.js.map +1 -0
  72. package/dist/core/web/public/next/assets/Meter-CLcr-4wS.css +1 -0
  73. package/dist/core/web/public/next/assets/Meter-Cmo1pLbk.js +2 -0
  74. package/dist/core/web/public/next/assets/Meter-Cmo1pLbk.js.map +1 -0
  75. package/dist/core/web/public/next/assets/{MutationTokenDialog-DbSHPy3w.js → MutationTokenDialog-B9I4PAcp.js} +2 -2
  76. package/dist/core/web/public/next/assets/{MutationTokenDialog-DbSHPy3w.js.map → MutationTokenDialog-B9I4PAcp.js.map} +1 -1
  77. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-C-PCgCzo.js → ResourcePoolConsoleApp-z6tJj3s9.js} +2 -2
  78. package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-C-PCgCzo.js.map → ResourcePoolConsoleApp-z6tJj3s9.js.map} +1 -1
  79. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Dw8ZjmkS.js → RouteErrorBoundary-OSajL45F.js} +2 -2
  80. package/dist/core/web/public/next/assets/{RouteErrorBoundary-Dw8ZjmkS.js.map → RouteErrorBoundary-OSajL45F.js.map} +1 -1
  81. package/dist/core/web/public/next/assets/SettingsSection-B3YH2Npi.js +2 -0
  82. package/dist/core/web/public/next/assets/SettingsSection-B3YH2Npi.js.map +1 -0
  83. package/dist/core/web/public/next/assets/{UniverseConsoleApp-Bk5HipM0.js → UniverseConsoleApp-wEKIzl1M.js} +2 -2
  84. package/dist/core/web/public/next/assets/{UniverseConsoleApp-Bk5HipM0.js.map → UniverseConsoleApp-wEKIzl1M.js.map} +1 -1
  85. package/dist/core/web/public/next/assets/{UniverseView-D8k9q0ce.js → UniverseView-CQVpJqqI.js} +2 -2
  86. package/dist/core/web/public/next/assets/{UniverseView-D8k9q0ce.js.map → UniverseView-CQVpJqqI.js.map} +1 -1
  87. package/dist/core/web/public/next/assets/{UsageSection-B2E06ZH1.js → UsageSection-dToBThXe.js} +2 -2
  88. package/dist/core/web/public/next/assets/{UsageSection-B2E06ZH1.js.map → UsageSection-dToBThXe.js.map} +1 -1
  89. package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +1 -0
  90. package/dist/core/web/public/next/assets/VerseConsoleApp-DHU32JCQ.js +3 -0
  91. package/dist/core/web/public/next/assets/VerseConsoleApp-DHU32JCQ.js.map +1 -0
  92. package/dist/core/web/public/next/assets/{charts-DSUpczxG.js → charts-BopViIha.js} +2 -2
  93. package/dist/core/web/public/next/assets/{charts-DSUpczxG.js.map → charts-BopViIha.js.map} +1 -1
  94. package/dist/core/web/public/next/assets/global-DMWakEhP.js +2 -0
  95. package/dist/core/web/public/next/assets/global-DMWakEhP.js.map +1 -0
  96. package/dist/core/web/public/next/assets/global-z-JfD3ow.css +1 -0
  97. package/dist/core/web/public/next/assets/{icons-BxOX8-XB.js → icons-L06pQH6j.js} +2 -2
  98. package/dist/core/web/public/next/assets/{icons-BxOX8-XB.js.map → icons-L06pQH6j.js.map} +1 -1
  99. package/dist/core/web/public/next/assets/{index-BMRIET7F.js → index-CXgVQHek.js} +3 -3
  100. package/dist/core/web/public/next/assets/{index-BMRIET7F.js.map → index-CXgVQHek.js.map} +1 -1
  101. package/dist/core/web/public/next/assets/{queries-AxnVa02h.js → queries-D3sSlan1.js} +2 -2
  102. package/dist/core/web/public/next/assets/{queries-AxnVa02h.js.map → queries-D3sSlan1.js.map} +1 -1
  103. package/dist/core/web/public/next/assets/{use-guarded-action-BO6c94Wp.js → use-guarded-action-BxfJ9E-n.js} +2 -2
  104. package/dist/core/web/public/next/assets/{use-guarded-action-BO6c94Wp.js.map → use-guarded-action-BxfJ9E-n.js.map} +1 -1
  105. package/dist/core/web/public/next/assets/workspace-model-v0a1gl-C.js +2 -0
  106. package/dist/core/web/public/next/assets/workspace-model-v0a1gl-C.js.map +1 -0
  107. package/dist/core/web/public/next/index.html +1 -1
  108. package/dist/release-dependency-inventory.json +1 -1
  109. package/package.json +1 -1
  110. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js +0 -2
  111. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js.map +0 -1
  112. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js +0 -80
  113. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js.map +0 -1
  114. package/dist/core/web/public/next/assets/ChatSection-LQiAn6Eu.css +0 -1
  115. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js +0 -2
  116. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js.map +0 -1
  117. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js +0 -3
  118. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js.map +0 -1
  119. package/dist/core/web/public/next/assets/VerseConsoleApp-D2E3mU9a.css +0 -1
  120. package/dist/core/web/public/next/assets/global-C4jfYHrj.js +0 -2
  121. package/dist/core/web/public/next/assets/global-C4jfYHrj.js.map +0 -1
  122. package/dist/core/web/public/next/assets/global-D463gG1X.css +0 -1
  123. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js +0 -2
  124. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Meter-Cmo1pLbk.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,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S,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 +1,2 @@
1
- import{a as e,n as t,o as n}from"./index-BMRIET7F.js";import{_ as r}from"./global-C4jfYHrj.js";import{t as i}from"./Dialog-Bn0CgEGz.js";var a=n(e(),1),o={body:`_body_1kukj_1`,form:`_form_1kukj_8`,label:`_label_1kukj_14`,inputRow:`_inputRow_1kukj_19`,input:`_input_1kukj_19`,reveal:`_reveal_1kukj_40`,error:`_error_1kukj_51`,actions:`_actions_1kukj_56`,cancel:`_cancel_1kukj_63`,submit:`_submit_1kukj_72`},s=t(),c=/^[a-f0-9]{64}$/;function l({open:e,onClose:t,onUnlocked:n,reason:l,tokenLabel:u=`Mutation token`,tokenHelp:d=`the mutation token ashlr serve printed`}){let{setToken:f}=r(),[p,m]=(0,a.useState)(``),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),y=(0,a.useRef)(null),b=(0,a.useId)(),x=(0,a.useId)();function S(e){e.preventDefault();let r=p.trim();if(!c.test(r)){v(`Expected 64 hex characters — ${d}.`);return}f(r),m(``),v(null),t(),n?.()}return(0,s.jsxs)(i,{open:e,onClose:t,titleId:b,title:`Unlock actions`,initialFocusRef:y,children:[(0,s.jsxs)(`p`,{className:o.body,children:[l??`This action mutates the fleet and requires the dispatch token.`,` It is held in memory only, for this browser tab, and is cleared automatically after 20 minutes idle.`]}),(0,s.jsxs)(`form`,{onSubmit:S,className:o.form,noValidate:!0,children:[(0,s.jsx)(`label`,{htmlFor:x,className:o.label,children:u}),(0,s.jsxs)(`div`,{className:o.inputRow,children:[(0,s.jsx)(`input`,{ref:y,id:x,type:h?`text`:`password`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,className:o.input,value:p,onChange:e=>m(e.target.value),"aria-invalid":_?!0:void 0,placeholder:`64 hex characters`}),(0,s.jsx)(`button`,{type:`button`,className:o.reveal,onClick:()=>g(e=>!e),"aria-pressed":h,children:h?`Hide`:`Show`})]}),_?(0,s.jsx)(`p`,{className:o.error,role:`alert`,children:_}):null,(0,s.jsxs)(`div`,{className:o.actions,children:[(0,s.jsx)(`button`,{type:`button`,className:o.cancel,onClick:t,children:`Cancel`}),(0,s.jsx)(`button`,{type:`submit`,className:o.submit,disabled:p.trim().length===0,children:`Unlock`})]})]})]})}export{l as t};
2
- //# sourceMappingURL=MutationTokenDialog-DbSHPy3w.js.map
1
+ import{a as e,n as t,o as n}from"./index-CXgVQHek.js";import{_ as r}from"./global-DMWakEhP.js";import{t as i}from"./Dialog-nK15L1M0.js";var a=n(e(),1),o={body:`_body_1kukj_1`,form:`_form_1kukj_8`,label:`_label_1kukj_14`,inputRow:`_inputRow_1kukj_19`,input:`_input_1kukj_19`,reveal:`_reveal_1kukj_40`,error:`_error_1kukj_51`,actions:`_actions_1kukj_56`,cancel:`_cancel_1kukj_63`,submit:`_submit_1kukj_72`},s=t(),c=/^[a-f0-9]{64}$/;function l({open:e,onClose:t,onUnlocked:n,reason:l,tokenLabel:u=`Mutation token`,tokenHelp:d=`the mutation token ashlr serve printed`}){let{setToken:f}=r(),[p,m]=(0,a.useState)(``),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),y=(0,a.useRef)(null),b=(0,a.useId)(),x=(0,a.useId)();function S(e){e.preventDefault();let r=p.trim();if(!c.test(r)){v(`Expected 64 hex characters — ${d}.`);return}f(r),m(``),v(null),t(),n?.()}return(0,s.jsxs)(i,{open:e,onClose:t,titleId:b,title:`Unlock actions`,initialFocusRef:y,children:[(0,s.jsxs)(`p`,{className:o.body,children:[l??`This action mutates the fleet and requires the dispatch token.`,` It is held in memory only, for this browser tab, and is cleared automatically after 20 minutes idle.`]}),(0,s.jsxs)(`form`,{onSubmit:S,className:o.form,noValidate:!0,children:[(0,s.jsx)(`label`,{htmlFor:x,className:o.label,children:u}),(0,s.jsxs)(`div`,{className:o.inputRow,children:[(0,s.jsx)(`input`,{ref:y,id:x,type:h?`text`:`password`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,className:o.input,value:p,onChange:e=>m(e.target.value),"aria-invalid":_?!0:void 0,placeholder:`64 hex characters`}),(0,s.jsx)(`button`,{type:`button`,className:o.reveal,onClick:()=>g(e=>!e),"aria-pressed":h,children:h?`Hide`:`Show`})]}),_?(0,s.jsx)(`p`,{className:o.error,role:`alert`,children:_}):null,(0,s.jsxs)(`div`,{className:o.actions,children:[(0,s.jsx)(`button`,{type:`button`,className:o.cancel,onClick:t,children:`Cancel`}),(0,s.jsx)(`button`,{type:`submit`,className:o.submit,disabled:p.trim().length===0,children:`Unlock`})]})]})]})}export{l as t};
2
+ //# sourceMappingURL=MutationTokenDialog-B9I4PAcp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutationTokenDialog-DbSHPy3w.js","names":[],"sources":["../../../../../../src/web-ui/components/auth/MutationTokenDialog.module.css","../../../../../../src/web-ui/components/auth/MutationTokenDialog.tsx"],"sourcesContent":[".body {\n font-size: var(--text-sm-size);\n line-height: var(--text-sm-line);\n color: var(--text-secondary);\n margin-bottom: var(--space-4);\n}\n\n.form {\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n}\n\n.label {\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-medium);\n}\n\n.inputRow {\n display: flex;\n gap: var(--space-2);\n}\n\n.input {\n flex: 1;\n padding: var(--space-3);\n border-radius: var(--radius-md);\n border: 1px solid var(--border-default);\n background: var(--bg-input);\n font-family: var(--font-mono);\n font-size: var(--text-sm-size);\n min-width: 0;\n}\n\n.input:focus-visible {\n border-color: var(--border-focus);\n box-shadow: var(--shadow-focus-ring);\n}\n\n.reveal {\n padding: 0 var(--space-3);\n border-radius: var(--radius-md);\n border: 1px solid var(--border-default);\n font-size: var(--text-sm-size);\n color: var(--text-secondary);\n}\n.reveal:hover {\n background: var(--bg-hover);\n}\n\n.error {\n color: var(--status-danger-fg);\n font-size: var(--text-sm-size);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: var(--space-2);\n margin-top: var(--space-3);\n}\n\n.cancel {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-md);\n color: var(--text-secondary);\n}\n.cancel:hover {\n background: var(--bg-hover);\n}\n\n.submit {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-md);\n background: var(--accent-500);\n color: var(--text-on-accent);\n font-weight: var(--font-weight-medium);\n}\n.submit:hover:not(:disabled) {\n background: var(--accent-600);\n}\n.submit:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n","/**\n * components/auth/MutationTokenDialog.tsx — replaces window.prompt() for\n * the mutation token (foundation brief item 5, the \"biggest reason\n * operators abandon the UI for the CLI\" finding). A focus-managed dialog\n * instead of a blocking native prompt, and a session-scoped hold (see\n * auth-store.ts) so approving 12 proposals is one paste, not twelve.\n *\n * The token is NEVER written to localStorage/sessionStorage/cookies — only\n * held in an in-memory module variable in auth-store.ts, cleared on tab\n * close, idle timeout, or the explicit \"Lock\" action here.\n */\nimport { useId, useRef, useState, type FormEvent } from 'react';\nimport { Dialog } from '../primitives/Dialog.js';\nimport { useMutationHold } from '../../data/hooks.js';\nimport styles from './MutationTokenDialog.module.css';\n\nconst TOKEN_RE = /^[a-f0-9]{64}$/;\n\nexport interface MutationTokenDialogProps {\n open: boolean;\n onClose: () => void;\n onUnlocked?: () => void;\n /** Human context for why the token is being requested right now. */\n reason?: string;\n /** Scoped consoles can name their own startup token without changing the hold. */\n tokenLabel?: string;\n tokenHelp?: string;\n}\n\nexport function MutationTokenDialog({ open, onClose, onUnlocked, reason, tokenLabel = 'Mutation token',\n tokenHelp = 'the mutation token ashlr serve printed' }: MutationTokenDialogProps) {\n const { setToken } = useMutationHold();\n const [value, setValue] = useState('');\n const [reveal, setReveal] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const titleId = useId();\n const inputId = useId();\n\n function submit(e: FormEvent) {\n e.preventDefault();\n const trimmed = value.trim();\n if (!TOKEN_RE.test(trimmed)) {\n setError(`Expected 64 hex characters — ${tokenHelp}.`);\n return;\n }\n setToken(trimmed);\n setValue('');\n setError(null);\n onClose();\n onUnlocked?.();\n }\n\n return (\n <Dialog open={open} onClose={onClose} titleId={titleId} title=\"Unlock actions\" initialFocusRef={inputRef}>\n <p className={styles.body}>\n {reason ?? 'This action mutates the fleet and requires the dispatch token.'} It is held in\n memory only, for this browser tab, and is cleared automatically after 20 minutes idle.\n </p>\n <form onSubmit={submit} className={styles.form} noValidate>\n <label htmlFor={inputId} className={styles.label}>\n {tokenLabel}\n </label>\n <div className={styles.inputRow}>\n <input\n ref={inputRef}\n id={inputId}\n type={reveal ? 'text' : 'password'}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n className={styles.input}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n aria-invalid={error ? true : undefined}\n placeholder=\"64 hex characters\"\n />\n <button\n type=\"button\"\n className={styles.reveal}\n onClick={() => setReveal((r) => !r)}\n aria-pressed={reveal}\n >\n {reveal ? 'Hide' : 'Show'}\n </button>\n </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}>\n Cancel\n </button>\n <button type=\"submit\" className={styles.submit} disabled={value.trim().length === 0}>\n Unlock\n </button>\n </div>\n </form>\n </Dialog>\n );\n}\n"],"mappings":"2ZCgBM,EAAW,iBAajB,SAAgB,EAAoB,CAAE,OAAM,UAAS,aAAY,SAAQ,aAA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AAO,IAAA,GAC7B,YAAY,mBACb,CAAA,GACD,EAAA,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,UAAW,EAAO,OAClB,YAAe,EAAW,GAAM,CAAC,CAAC,EAClC,eAAc,EAEb,SAAA,EAAS,OAAS,MACb,CAAA,CACL,IACJ,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,SAAA,QAE1D,CAAA,GACR,EAAA,EAAA,IAAA,CAAC,SAAD,CAAQ,KAAK,SAAS,UAAW,EAAO,OAAQ,SAAU,EAAM,KAAK,CAAC,CAAC,SAAW,EAAG,SAAA,QAE7E,CAAA,CACL,GACD,CACA,CAAA,CAAA,GAEZ"}
1
+ {"version":3,"file":"MutationTokenDialog-B9I4PAcp.js","names":[],"sources":["../../../../../../src/web-ui/components/auth/MutationTokenDialog.module.css","../../../../../../src/web-ui/components/auth/MutationTokenDialog.tsx"],"sourcesContent":[".body {\n font-size: var(--text-sm-size);\n line-height: var(--text-sm-line);\n color: var(--text-secondary);\n margin-bottom: var(--space-4);\n}\n\n.form {\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n}\n\n.label {\n font-size: var(--text-sm-size);\n font-weight: var(--font-weight-medium);\n}\n\n.inputRow {\n display: flex;\n gap: var(--space-2);\n}\n\n.input {\n flex: 1;\n padding: var(--space-3);\n border-radius: var(--radius-md);\n border: 1px solid var(--border-default);\n background: var(--bg-input);\n font-family: var(--font-mono);\n font-size: var(--text-sm-size);\n min-width: 0;\n}\n\n.input:focus-visible {\n border-color: var(--border-focus);\n box-shadow: var(--shadow-focus-ring);\n}\n\n.reveal {\n padding: 0 var(--space-3);\n border-radius: var(--radius-md);\n border: 1px solid var(--border-default);\n font-size: var(--text-sm-size);\n color: var(--text-secondary);\n}\n.reveal:hover {\n background: var(--bg-hover);\n}\n\n.error {\n color: var(--status-danger-fg);\n font-size: var(--text-sm-size);\n}\n\n.actions {\n display: flex;\n justify-content: flex-end;\n gap: var(--space-2);\n margin-top: var(--space-3);\n}\n\n.cancel {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-md);\n color: var(--text-secondary);\n}\n.cancel:hover {\n background: var(--bg-hover);\n}\n\n.submit {\n padding: var(--space-2) var(--space-4);\n border-radius: var(--radius-md);\n background: var(--accent-500);\n color: var(--text-on-accent);\n font-weight: var(--font-weight-medium);\n}\n.submit:hover:not(:disabled) {\n background: var(--accent-600);\n}\n.submit:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n","/**\n * components/auth/MutationTokenDialog.tsx — replaces window.prompt() for\n * the mutation token (foundation brief item 5, the \"biggest reason\n * operators abandon the UI for the CLI\" finding). A focus-managed dialog\n * instead of a blocking native prompt, and a session-scoped hold (see\n * auth-store.ts) so approving 12 proposals is one paste, not twelve.\n *\n * The token is NEVER written to localStorage/sessionStorage/cookies — only\n * held in an in-memory module variable in auth-store.ts, cleared on tab\n * close, idle timeout, or the explicit \"Lock\" action here.\n */\nimport { useId, useRef, useState, type FormEvent } from 'react';\nimport { Dialog } from '../primitives/Dialog.js';\nimport { useMutationHold } from '../../data/hooks.js';\nimport styles from './MutationTokenDialog.module.css';\n\nconst TOKEN_RE = /^[a-f0-9]{64}$/;\n\nexport interface MutationTokenDialogProps {\n open: boolean;\n onClose: () => void;\n onUnlocked?: () => void;\n /** Human context for why the token is being requested right now. */\n reason?: string;\n /** Scoped consoles can name their own startup token without changing the hold. */\n tokenLabel?: string;\n tokenHelp?: string;\n}\n\nexport function MutationTokenDialog({ open, onClose, onUnlocked, reason, tokenLabel = 'Mutation token',\n tokenHelp = 'the mutation token ashlr serve printed' }: MutationTokenDialogProps) {\n const { setToken } = useMutationHold();\n const [value, setValue] = useState('');\n const [reveal, setReveal] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const titleId = useId();\n const inputId = useId();\n\n function submit(e: FormEvent) {\n e.preventDefault();\n const trimmed = value.trim();\n if (!TOKEN_RE.test(trimmed)) {\n setError(`Expected 64 hex characters — ${tokenHelp}.`);\n return;\n }\n setToken(trimmed);\n setValue('');\n setError(null);\n onClose();\n onUnlocked?.();\n }\n\n return (\n <Dialog open={open} onClose={onClose} titleId={titleId} title=\"Unlock actions\" initialFocusRef={inputRef}>\n <p className={styles.body}>\n {reason ?? 'This action mutates the fleet and requires the dispatch token.'} It is held in\n memory only, for this browser tab, and is cleared automatically after 20 minutes idle.\n </p>\n <form onSubmit={submit} className={styles.form} noValidate>\n <label htmlFor={inputId} className={styles.label}>\n {tokenLabel}\n </label>\n <div className={styles.inputRow}>\n <input\n ref={inputRef}\n id={inputId}\n type={reveal ? 'text' : 'password'}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n className={styles.input}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n aria-invalid={error ? true : undefined}\n placeholder=\"64 hex characters\"\n />\n <button\n type=\"button\"\n className={styles.reveal}\n onClick={() => setReveal((r) => !r)}\n aria-pressed={reveal}\n >\n {reveal ? 'Hide' : 'Show'}\n </button>\n </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}>\n Cancel\n </button>\n <button type=\"submit\" className={styles.submit} disabled={value.trim().length === 0}>\n Unlock\n </button>\n </div>\n </form>\n </Dialog>\n );\n}\n"],"mappings":"2ZCgBM,EAAW,iBAajB,SAAgB,EAAoB,CAAE,OAAM,UAAS,aAAY,SAAQ,aAAa,iBACpF,YAAY,0CAAsE,CAClF,GAAM,CAAE,YAAa,EAAgB,EAC/B,CAAC,EAAO,IAAA,EAAY,EAAA,SAAA,CAAS,EAAE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