@invergent/agent-chat-react 2.19.0 → 2.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7,13 +7,14 @@ var auto = require('chart.js/auto');
7
7
  var nextThemes = require('next-themes');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
  var button = require('@invergent/ui-sdk/button');
10
+ var dropdownMenu = require('@invergent/ui-sdk/dropdown-menu');
11
+ var tabStrip = require('@invergent/ui-sdk/tab-strip');
12
+ var toggle = require('@invergent/ui-sdk/toggle');
10
13
  var confirmDialog = require('@invergent/ui-sdk/confirm-dialog');
11
14
  var dialog = require('@invergent/ui-sdk/dialog');
12
15
  var lucideReact = require('lucide-react');
13
16
  var useStickToBottom = require('use-stick-to-bottom');
14
- var classVarianceAuthority = require('class-variance-authority');
15
- var radixUi = require('radix-ui');
16
- require('@invergent/ui-sdk/separator');
17
+ var buttonGroup = require('@invergent/ui-sdk/button-group');
17
18
  var tooltip = require('@invergent/ui-sdk/tooltip');
18
19
  var cjk = require('@streamdown/cjk');
19
20
  var code = require('@streamdown/code');
@@ -23,27 +24,44 @@ var streamdown = require('streamdown');
23
24
  var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
24
25
  var collapsible = require('@invergent/ui-sdk/collapsible');
25
26
  var thinkingOrbs = require('thinking-orbs');
27
+ var timeline = require('@invergent/ui-sdk/timeline');
28
+ var collapsibleHeader = require('@invergent/ui-sdk/collapsible-header');
26
29
  var scrollArea = require('@invergent/ui-sdk/scroll-area');
27
30
  require('@invergent/ui-sdk/select');
28
31
  var shiki = require('shiki');
29
32
  var tabs = require('@invergent/ui-sdk/tabs');
30
- var badge = require('@invergent/ui-sdk/badge');
33
+ var chip = require('@invergent/ui-sdk/chip');
34
+ var textLink = require('@invergent/ui-sdk/text-link');
31
35
  var diff = require('diff');
32
36
  var AnsiImport = require('ansi-to-react');
33
37
  var textarea = require('@invergent/ui-sdk/textarea');
38
+ var choiceCard = require('@invergent/ui-sdk/choice-card');
34
39
  var input = require('@invergent/ui-sdk/input');
35
- var cmdk = require('cmdk');
40
+ var command = require('@invergent/ui-sdk/command');
41
+ require('@invergent/ui-sdk/hover-card');
36
42
  var inputGroup = require('@invergent/ui-sdk/input-group');
37
- var dropdownMenu = require('@invergent/ui-sdk/dropdown-menu');
38
43
  var spinner = require('@invergent/ui-sdk/spinner');
39
44
  var nanoid = require('nanoid');
40
45
  var brandBeam = require('@invergent/ui-sdk/brand-beam');
46
+ var progressBar = require('@invergent/ui-sdk/progress-bar');
41
47
  require('tokenlens');
48
+ var item = require('@invergent/ui-sdk/item');
42
49
  var popover = require('@invergent/ui-sdk/popover');
50
+ var responsivePanel = require('@invergent/ui-sdk/responsive-panel');
51
+ var cmdk = require('cmdk');
43
52
  var skeleton = require('@invergent/ui-sdk/skeleton');
53
+ var listRow = require('@invergent/ui-sdk/list-row');
54
+ var alert = require('@invergent/ui-sdk/alert');
44
55
  var checkbox = require('@invergent/ui-sdk/checkbox');
45
56
  var label = require('@invergent/ui-sdk/label');
57
+ var segmentedControl = require('@invergent/ui-sdk/segmented-control');
58
+ var rabbitMark = require('@invergent/ui-sdk/rabbit-mark');
59
+ var toggleGroup = require('@invergent/ui-sdk/toggle-group');
60
+ var emptyState = require('@invergent/ui-sdk/empty-state');
61
+ var sectionLabel = require('@invergent/ui-sdk/section-label');
62
+ var controlStyles = require('@invergent/ui-sdk/control-styles');
46
63
  var dateFns = require('date-fns');
64
+ var badge = require('@invergent/ui-sdk/badge');
47
65
  var card = require('@invergent/ui-sdk/card');
48
66
 
49
67
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -354,7 +372,6 @@ function BrowserShell({
354
372
  const [frame, setFrame] = react.useState(null);
355
373
  const [tabs, setTabs] = react.useState([]);
356
374
  const [nav, setNav] = react.useState({ url: "", title: "" });
357
- const [menuOpen, setMenuOpen] = react.useState(false);
358
375
  const [address, setAddress] = react.useState("");
359
376
  const editingRef = react.useRef(false);
360
377
  react.useEffect(() => {
@@ -509,15 +526,13 @@ function BrowserShell({
509
526
  }
510
527
  ),
511
528
  (onToggleControl || hasControl) && /* @__PURE__ */ jsxRuntime.jsx(
512
- button.Button,
529
+ toggle.Toggle,
513
530
  {
514
- type: "button",
515
- variant: hasControl ? "default" : "ghost",
516
531
  size: "icon-xs",
517
532
  "data-testid": "browser-shell-control",
518
533
  "aria-label": hasControl ? "Return control" : "Take control",
519
- "aria-pressed": hasControl,
520
- onClick: onToggleControl,
534
+ pressed: hasControl,
535
+ onPressedChange: () => onToggleControl?.(),
521
536
  children: /* @__PURE__ */ jsxRuntime.jsx(Pointer, {})
522
537
  }
523
538
  ),
@@ -566,93 +581,30 @@ function BrowserShell({
566
581
  ]
567
582
  }
568
583
  ),
569
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
570
- /* @__PURE__ */ jsxRuntime.jsx(
571
- button.Button,
572
- {
573
- type: "button",
574
- variant: "ghost",
575
- size: "icon-xs",
576
- "aria-label": "More",
577
- onClick: () => setMenuOpen((open) => !open),
578
- children: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {})
579
- }
580
- ),
581
- menuOpen && /* @__PURE__ */ jsxRuntime.jsxs(
582
- "div",
583
- {
584
- "data-testid": "browser-shell-menu",
585
- className: "absolute right-0 top-8 z-10 min-w-36 rounded-md border border-line bg-card py-1 text-xs shadow-md",
586
- children: [
587
- onMaximize && /* @__PURE__ */ jsxRuntime.jsx(
588
- "button",
589
- {
590
- type: "button",
591
- className: "block w-full px-3 py-1.5 text-left hover:bg-secondary",
592
- onClick: () => {
593
- setMenuOpen(false);
594
- onMaximize();
595
- },
596
- children: "Maximize"
597
- }
598
- ),
599
- onClose && /* @__PURE__ */ jsxRuntime.jsx(
600
- "button",
601
- {
602
- type: "button",
603
- className: "block w-full px-3 py-1.5 text-left hover:bg-secondary",
604
- onClick: () => {
605
- setMenuOpen(false);
606
- onClose();
607
- },
608
- children: "Close browser"
609
- }
610
- )
611
- ]
612
- }
613
- )
584
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { children: [
585
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(button.Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": "More", children: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis, {}) }) }),
586
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { "data-testid": "browser-shell-menu", align: "end", children: [
587
+ onMaximize && /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onSelect: onMaximize, children: "Maximize" }),
588
+ onClose && /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuItem, { onSelect: onClose, children: "Close browser" })
589
+ ] })
614
590
  ] })
615
591
  ] }),
616
592
  showTabs && /* @__PURE__ */ jsxRuntime.jsx(
617
- "div",
593
+ tabStrip.TabStrip,
618
594
  {
619
595
  "data-testid": "browser-shell-tabs",
620
- className: "flex min-h-[34px] items-center gap-0.5 border-b border-line bg-card px-1.5",
621
- children: tabs.map((tab) => (
622
- // A div, not a button: the close control nests inside, and a
623
- // button inside a button is invalid markup.
624
- /* @__PURE__ */ jsxRuntime.jsxs(
625
- "div",
626
- {
627
- role: "tab",
628
- tabIndex: 0,
629
- "aria-selected": tab.active,
630
- "data-testid": "browser-shell-tab",
631
- onClick: () => send({ t: "switch_tab", id: tab.id }),
632
- onKeyDown: (event) => {
633
- if (event.key === "Enter") send({ t: "switch_tab", id: tab.id });
634
- },
635
- className: `flex h-6 max-w-33 cursor-pointer items-center gap-1 truncate rounded px-2 text-[11px] ${tab.active ? "bg-secondary text-foreground" : "text-muted-foreground hover:text-foreground"}`,
636
- children: [
637
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.title || tab.url }),
638
- hasControl && /* @__PURE__ */ jsxRuntime.jsx(
639
- "button",
640
- {
641
- type: "button",
642
- "data-testid": "browser-shell-tab-close",
643
- "aria-label": `Close ${tab.title || tab.url}`,
644
- onClick: (event) => {
645
- event.stopPropagation();
646
- command({ t: "close_tab", id: tab.id });
647
- },
648
- className: "flex size-3.5 shrink-0 items-center justify-center rounded-sm text-muted-foreground hover:bg-secondary hover:text-foreground",
649
- children: /* @__PURE__ */ jsxRuntime.jsx(XSmall, {})
650
- }
651
- )
652
- ]
653
- },
654
- tab.id
655
- )
596
+ className: "min-h-[34px] border-b border-line bg-card px-1.5",
597
+ children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
598
+ tabStrip.TabStripTab,
599
+ {
600
+ active: tab.active,
601
+ "data-testid": "browser-shell-tab",
602
+ onSelect: () => send({ t: "switch_tab", id: tab.id }),
603
+ onClose: hasControl ? () => command({ t: "close_tab", id: tab.id }) : void 0,
604
+ closeLabel: `Close ${tab.title || tab.url}`,
605
+ children: tab.title || tab.url
606
+ },
607
+ tab.id
656
608
  ))
657
609
  }
658
610
  ),
@@ -732,10 +684,6 @@ var Pointer = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { ...svg, children: [
732
684
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12.586 12.586 19 19" }),
733
685
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z" })
734
686
  ] });
735
- var XSmall = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { ...svg, width: 10, height: 10, className: "size-2.5", children: [
736
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
737
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
738
- ] });
739
687
  var Ellipsis = () => /* @__PURE__ */ jsxRuntime.jsxs("svg", { ...svg, children: [
740
688
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1" }),
741
689
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "19", cy: "12", r: "1" }),
@@ -1051,39 +999,6 @@ var ConversationScrollButton = ({
1051
999
  );
1052
1000
  };
1053
1001
 
1054
- // src/components/ui/button-group.tsx
1055
- init_utils();
1056
- var buttonGroupVariants = classVarianceAuthority.cva(
1057
- "group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 *:data-[slot=input]:px-4 has-[>[data-variant=outline]]:*:data-[slot=input-group]:border-border has-[>[data-variant=outline]]:*:data-[slot=input-group]:px-2.5 has-[>[data-variant=outline]]:*:data-[slot=select-trigger]:border-border has-[>[data-variant=outline]]:*:[[role=combobox]]:px-2.5 has-[>[data-variant=outline]]:[&>[data-slot=input-group]:has(:focus-visible)]:border-ring has-[>[data-variant=outline]]:[&>[data-slot=select-trigger]:focus-visible]:border-ring has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-none [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-variant=outline]]:[&>input]:border-border has-[>[data-variant=outline]]:[&>input:focus-visible]:border-ring",
1058
- {
1059
- variants: {
1060
- orientation: {
1061
- horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-none!",
1062
- vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-none!"
1063
- }
1064
- },
1065
- defaultVariants: {
1066
- orientation: "horizontal"
1067
- }
1068
- }
1069
- );
1070
- function ButtonGroup({
1071
- className,
1072
- orientation,
1073
- ...props
1074
- }) {
1075
- return /* @__PURE__ */ jsxRuntime.jsx(
1076
- "div",
1077
- {
1078
- role: "group",
1079
- "data-slot": "button-group",
1080
- "data-orientation": orientation,
1081
- className: cn(buttonGroupVariants({ orientation }), className),
1082
- ...props
1083
- }
1084
- );
1085
- }
1086
-
1087
1002
  // src/components/ai-elements/message.tsx
1088
1003
  init_utils();
1089
1004
  var streamdownRehypePlugins = Object.entries(streamdown.defaultRehypePlugins).map(([name, plugin]) => {
@@ -1402,131 +1317,6 @@ Reasoning.displayName = "Reasoning";
1402
1317
  ReasoningTrigger.displayName = "ReasoningTrigger";
1403
1318
  ReasoningContent.displayName = "ReasoningContent";
1404
1319
 
1405
- // src/components/reui/timeline.tsx
1406
- init_utils();
1407
- var TimelineContext = react.createContext(
1408
- void 0
1409
- );
1410
- var useTimeline = () => {
1411
- const context = react.useContext(TimelineContext);
1412
- if (!context) {
1413
- throw new Error("useTimeline must be used within a Timeline");
1414
- }
1415
- return context;
1416
- };
1417
- function Timeline({
1418
- defaultValue = 1,
1419
- value,
1420
- onValueChange,
1421
- orientation = "vertical",
1422
- className,
1423
- children,
1424
- ...props
1425
- }) {
1426
- const [activeStep, setInternalStep] = react.useState(defaultValue);
1427
- const setActiveStep = react.useCallback(
1428
- (step) => {
1429
- if (value === void 0) {
1430
- setInternalStep(step);
1431
- }
1432
- onValueChange?.(step);
1433
- },
1434
- [value, onValueChange]
1435
- );
1436
- const currentStep = value ?? activeStep;
1437
- return /* @__PURE__ */ jsxRuntime.jsx(
1438
- TimelineContext.Provider,
1439
- {
1440
- value: { activeStep: currentStep, setActiveStep },
1441
- children: /* @__PURE__ */ jsxRuntime.jsx(
1442
- "div",
1443
- {
1444
- className: cn(
1445
- "group/timeline flex flex-col",
1446
- className
1447
- ),
1448
- "data-orientation": orientation,
1449
- "data-slot": "timeline",
1450
- ...props,
1451
- children
1452
- }
1453
- )
1454
- }
1455
- );
1456
- }
1457
- function TimelineContent({
1458
- className,
1459
- ...props
1460
- }) {
1461
- return /* @__PURE__ */ jsxRuntime.jsx(
1462
- "div",
1463
- {
1464
- className: cn("text-foreground text-sm min-w-0 overflow-hidden", className),
1465
- "data-slot": "timeline-content",
1466
- ...props
1467
- }
1468
- );
1469
- }
1470
- function TimelineHeader({
1471
- className,
1472
- ...props
1473
- }) {
1474
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(className), "data-slot": "timeline-header", ...props });
1475
- }
1476
- function TimelineIndicator({
1477
- asChild = false,
1478
- className,
1479
- children,
1480
- ...props
1481
- }) {
1482
- const Comp = asChild ? radixUi.Slot.Root : "div";
1483
- return /* @__PURE__ */ jsxRuntime.jsx(
1484
- Comp,
1485
- {
1486
- "aria-hidden": "true",
1487
- className: cn(
1488
- "border-primary/20 group-data-completed/timeline-item:border-primary absolute size-4 rounded-full border-2 top-1.25 -left-6 -translate-x-1/2",
1489
- className
1490
- ),
1491
- "data-slot": "timeline-indicator",
1492
- ...props,
1493
- children
1494
- }
1495
- );
1496
- }
1497
- function TimelineItem({ step, className, ...props }) {
1498
- const { activeStep } = useTimeline();
1499
- return /* @__PURE__ */ jsxRuntime.jsx(
1500
- "div",
1501
- {
1502
- className: cn(
1503
- "group/timeline-item has-[+[data-completed]]:**:data-[slot=timeline-separator]:bg-primary relative flex flex-col gap-0.5 ms-8 not-last:pb-6",
1504
- className
1505
- ),
1506
- "data-completed": step <= activeStep || void 0,
1507
- "data-slot": "timeline-item",
1508
- ...props
1509
- }
1510
- );
1511
- }
1512
- function TimelineSeparator({
1513
- className,
1514
- ...props
1515
- }) {
1516
- return /* @__PURE__ */ jsxRuntime.jsx(
1517
- "div",
1518
- {
1519
- "aria-hidden": "true",
1520
- className: cn(
1521
- "bg-primary/10 absolute self-start group-last/timeline-item:hidden -left-6 h-[calc(100%-1rem-0.25rem)] w-0.5 -translate-x-1/2 translate-y-4.5",
1522
- className
1523
- ),
1524
- "data-slot": "timeline-separator",
1525
- ...props
1526
- }
1527
- );
1528
- }
1529
-
1530
1320
  // src/runtime/orb-state.ts
1531
1321
  var ORB_STATE_LABELS = {
1532
1322
  working: "Working on it...",
@@ -1847,10 +1637,11 @@ function toolErrorSummary(result, max = 180) {
1847
1637
  function CopyButton({ text }) {
1848
1638
  const [copied, setCopied] = react.useState(false);
1849
1639
  return /* @__PURE__ */ jsxRuntime.jsx(
1850
- "button",
1640
+ button.Button,
1851
1641
  {
1852
- type: "button",
1853
- className: "shrink-0 p-0.5 rounded opacity-0 group-hover/in:opacity-100 transition-opacity text-muted-foreground hover:text-foreground",
1642
+ variant: "ghost",
1643
+ size: "icon-xs",
1644
+ className: "opacity-0 text-muted-foreground hover:text-foreground group-hover/in:opacity-100 focus-visible:opacity-100",
1854
1645
  onClick: (e) => {
1855
1646
  e.stopPropagation();
1856
1647
  void navigator.clipboard.writeText(text).then(() => {
@@ -1912,18 +1703,7 @@ function TerminalCollapsible({ command, output, isRunning, hasError }) {
1912
1703
  onOpenChange: setIsOpen,
1913
1704
  className: "not-prose w-full",
1914
1705
  children: [
1915
- /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleTrigger, { className: "group/trigger flex w-fit items-center gap-2 text-sm transition-colors", children: [
1916
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-left", children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { as: "span", duration: 1, children: "Running command..." }) : hasError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-destructive", children: "Command failed" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: "Command" }) }),
1917
- /* @__PURE__ */ jsxRuntime.jsx(
1918
- lucideReact.ChevronDownIcon,
1919
- {
1920
- className: cn(
1921
- "size-4 shrink-0 transition-transform",
1922
- isOpen ? "rotate-180" : "rotate-0"
1923
- )
1924
- }
1925
- )
1926
- ] }),
1706
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { className: "-ml-2 w-fit max-w-full", children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { as: "span", duration: 1, children: "Running command..." }) : hasError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-destructive", children: "Command failed" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: "Command" }) }),
1927
1707
  /* @__PURE__ */ jsxRuntime.jsx(
1928
1708
  collapsible.CollapsibleContent,
1929
1709
  {
@@ -2050,28 +1830,13 @@ var QueueList = ({
2050
1830
  children,
2051
1831
  className,
2052
1832
  ...props
2053
- }) => /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea, { className: cn("mt-2 -mb-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-40 pr-4", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children }) }) });
1833
+ }) => /* @__PURE__ */ jsxRuntime.jsx(scrollArea.ScrollArea, { className, ...props, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-40 pr-4", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children }) }) });
2054
1834
  var QueueSection = ({
2055
1835
  className,
2056
1836
  defaultOpen = true,
2057
1837
  ...props
2058
1838
  }) => /* @__PURE__ */ jsxRuntime.jsx(collapsible.Collapsible, { className: cn(className), defaultOpen, ...props });
2059
- var QueueSectionTrigger = ({
2060
- children,
2061
- className,
2062
- ...props
2063
- }) => /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2064
- "button",
2065
- {
2066
- className: cn(
2067
- "group flex w-full items-center justify-between rounded-md bg-muted/40 px-3 py-2 text-left font-medium text-muted-foreground text-sm transition-colors hover:bg-muted",
2068
- className
2069
- ),
2070
- type: "button",
2071
- ...props,
2072
- children
2073
- }
2074
- ) });
1839
+ var QueueSectionTrigger = (props) => /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", ...props });
2075
1840
  var QueueSectionLabel = ({
2076
1841
  count,
2077
1842
  label,
@@ -2079,7 +1844,6 @@ var QueueSectionLabel = ({
2079
1844
  className,
2080
1845
  ...props
2081
1846
  }) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("flex items-center gap-2", className), ...props, children: [
2082
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4 transition-transform group-data-[state=closed]:-rotate-90" }),
2083
1847
  icon,
2084
1848
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2085
1849
  count,
@@ -2090,12 +1854,18 @@ var QueueSectionLabel = ({
2090
1854
  var QueueSectionContent = ({
2091
1855
  className,
2092
1856
  ...props
2093
- }) => /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { className: cn(className), ...props });
1857
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
1858
+ collapsible.CollapsibleContent,
1859
+ {
1860
+ className: cn("border-t border-foreground/[0.08] p-1.5", className),
1861
+ ...props
1862
+ }
1863
+ );
2094
1864
  var Queue = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2095
1865
  "div",
2096
1866
  {
2097
1867
  className: cn(
2098
- "flex flex-col gap-2 rounded-xl border border-border bg-background px-3 pt-2 pb-2 shadow-xs",
1868
+ "flex flex-col overflow-hidden rounded-[10px] border border-foreground/[0.08] bg-background",
2099
1869
  className
2100
1870
  ),
2101
1871
  ...props
@@ -2439,7 +2209,7 @@ var CodeBlockCopyButton = ({
2439
2209
  // src/components/ai-elements/sandbox.tsx
2440
2210
  init_utils();
2441
2211
  var statusLabels = {
2442
- "approval-requested": "Awaiting Approval",
2212
+ "approval-requested": "Awaiting approval",
2443
2213
  "approval-responded": "Responded",
2444
2214
  "input-available": "Running",
2445
2215
  "input-streaming": "Pending",
@@ -2447,16 +2217,25 @@ var statusLabels = {
2447
2217
  "output-denied": "Denied",
2448
2218
  "output-error": "Error"
2449
2219
  };
2220
+ var statusTones = {
2221
+ "approval-requested": "warn",
2222
+ "approval-responded": "info",
2223
+ "input-available": "muted",
2224
+ "input-streaming": "muted",
2225
+ "output-available": "ok",
2226
+ "output-denied": "warn",
2227
+ "output-error": "bad"
2228
+ };
2450
2229
  var statusIcons = {
2451
- "approval-requested": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-4 text-yellow-600" }),
2452
- "approval-responded": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-4 text-blue-600" }),
2453
- "input-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-4 animate-pulse" }),
2454
- "input-streaming": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "size-4" }),
2455
- "output-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-4 text-green-600" }),
2456
- "output-denied": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-4 text-orange-600" }),
2457
- "output-error": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-4 text-red-600" })
2230
+ "approval-requested": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3" }),
2231
+ "approval-responded": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-3" }),
2232
+ "input-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3 animate-pulse" }),
2233
+ "input-streaming": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "size-3" }),
2234
+ "output-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-3" }),
2235
+ "output-denied": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-3" }),
2236
+ "output-error": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-3" })
2458
2237
  };
2459
- var getStatusBadge = (status) => /* @__PURE__ */ jsxRuntime.jsxs(badge.Badge, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
2238
+ var getStatusBadge = (status) => /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: statusTones[status], children: [
2460
2239
  statusIcons[status],
2461
2240
  statusLabels[status]
2462
2241
  ] });
@@ -2464,7 +2243,7 @@ var Sandbox = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2464
2243
  collapsible.Collapsible,
2465
2244
  {
2466
2245
  className: cn(
2467
- "not-prose group mb-4 w-full overflow-hidden rounded-md border border-foreground/20",
2246
+ "not-prose mb-4 w-full overflow-hidden rounded-[10px] border border-foreground/[0.08]",
2468
2247
  className
2469
2248
  ),
2470
2249
  defaultOpen: true,
@@ -2476,22 +2255,17 @@ var SandboxHeader = ({
2476
2255
  title,
2477
2256
  state,
2478
2257
  ...props
2479
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
2480
- collapsible.CollapsibleTrigger,
2258
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
2259
+ collapsibleHeader.CollapsibleHeader,
2481
2260
  {
2482
- className: cn(
2483
- "flex w-full items-center justify-between gap-4 p-3",
2484
- className
2485
- ),
2261
+ variant: "section",
2262
+ icon: lucideReact.Code,
2263
+ className,
2486
2264
  ...props,
2487
- children: [
2488
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
2489
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Code, { className: "size-4 text-muted-foreground" }),
2490
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-sm", children: title }),
2491
- getStatusBadge(state)
2492
- ] }),
2493
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })
2494
- ]
2265
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
2266
+ title,
2267
+ getStatusBadge(state)
2268
+ ] })
2495
2269
  }
2496
2270
  );
2497
2271
  var SandboxContent = ({
@@ -2515,7 +2289,7 @@ var SandboxTabsBar = ({
2515
2289
  "div",
2516
2290
  {
2517
2291
  className: cn(
2518
- "flex w-full items-center border-border border-t border-b",
2292
+ "flex w-full items-center border-foreground/[0.08] border-t border-b px-2 py-1.5",
2519
2293
  className
2520
2294
  ),
2521
2295
  ...props
@@ -2524,26 +2298,11 @@ var SandboxTabsBar = ({
2524
2298
  var SandboxTabsList = ({
2525
2299
  className,
2526
2300
  ...props
2527
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2528
- tabs.TabsList,
2529
- {
2530
- className: cn("h-auto rounded-none border-0 bg-transparent p-0", className),
2531
- ...props
2532
- }
2533
- );
2301
+ }) => /* @__PURE__ */ jsxRuntime.jsx(tabs.TabsList, { variant: "line", className, ...props });
2534
2302
  var SandboxTabsTrigger = ({
2535
2303
  className,
2536
2304
  ...props
2537
- }) => /* @__PURE__ */ jsxRuntime.jsx(
2538
- tabs.TabsTrigger,
2539
- {
2540
- className: cn(
2541
- "rounded-none border-0 border-transparent border-b-2 px-4 py-2 font-medium text-muted-foreground text-sm transition-colors data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:shadow-none",
2542
- className
2543
- ),
2544
- ...props
2545
- }
2546
- );
2305
+ }) => /* @__PURE__ */ jsxRuntime.jsx(tabs.TabsTrigger, { className, ...props });
2547
2306
  var SandboxTabContent = ({
2548
2307
  className,
2549
2308
  ...props
@@ -3003,11 +2762,12 @@ function CollapsedBlock({
3003
2762
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-sm leading-5 bg-muted/30 border-y border-border/30", children: [
3004
2763
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-10 shrink-0" }),
3005
2764
  /* @__PURE__ */ jsxRuntime.jsxs(
3006
- "button",
2765
+ button.Button,
3007
2766
  {
3008
- type: "button",
2767
+ variant: "ghost",
2768
+ size: "xs",
3009
2769
  onClick: onExpand,
3010
- className: "flex-1 text-left px-3 py-0.5 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors cursor-pointer",
2770
+ className: "flex-1 justify-start rounded-none font-normal text-muted-foreground hover:text-foreground",
3011
2771
  children: [
3012
2772
  "\u2195 ",
3013
2773
  count,
@@ -3149,15 +2909,7 @@ function FileNameWithTooltip({
3149
2909
  const display = displayPath(filePath);
3150
2910
  const name = fileName(filePath);
3151
2911
  return /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
3152
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: onFileSelect ? /* @__PURE__ */ jsxRuntime.jsx(
3153
- "button",
3154
- {
3155
- type: "button",
3156
- onClick: () => onFileSelect(filePath),
3157
- className: "text-primary hover:underline truncate text-left cursor-pointer underline",
3158
- children: name
3159
- }
3160
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground truncate", children: name }) }),
2912
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: onFileSelect ? /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { size: "inline", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onFileSelect(filePath), className: "truncate text-left", children: name }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground truncate", children: name }) }),
3161
2913
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { side: "top", children: display })
3162
2914
  ] });
3163
2915
  }
@@ -3581,17 +3333,14 @@ function truncateCommand(cmd, max = 80) {
3581
3333
  }
3582
3334
  function StatusBadge({ status, exitCode }) {
3583
3335
  if (status === "running") {
3584
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-emerald-600 dark:text-emerald-400", children: [
3336
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "ok", children: [
3585
3337
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleDotIcon, { className: "size-3 animate-pulse" }),
3586
3338
  "running"
3587
3339
  ] });
3588
3340
  }
3589
3341
  if (status === "exited") {
3590
3342
  const ok = exitCode === 0;
3591
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
3592
- "inline-flex items-center gap-1 text-xs font-medium",
3593
- ok ? "text-muted-foreground" : "text-red-500 dark:text-red-400"
3594
- ), children: [
3343
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: ok ? "muted" : "bad", children: [
3595
3344
  ok ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { className: "size-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleXIcon, { className: "size-3" }),
3596
3345
  "exited(",
3597
3346
  exitCode ?? "?",
@@ -3599,24 +3348,24 @@ function StatusBadge({ status, exitCode }) {
3599
3348
  ] });
3600
3349
  }
3601
3350
  if (status === "killed") {
3602
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-orange-500 dark:text-orange-400", children: [
3351
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "bad", children: [
3603
3352
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SkullIcon, { className: "size-3" }),
3604
3353
  "killed"
3605
3354
  ] });
3606
3355
  }
3607
3356
  if (status === "timeout") {
3608
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-amber-500 dark:text-amber-400", children: [
3357
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "warn", children: [
3609
3358
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3" }),
3610
3359
  "timeout"
3611
3360
  ] });
3612
3361
  }
3613
3362
  if (status === "interrupted") {
3614
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-amber-500 dark:text-amber-400", children: [
3363
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "warn", children: [
3615
3364
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleXIcon, { className: "size-3" }),
3616
3365
  "interrupted"
3617
3366
  ] });
3618
3367
  }
3619
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-muted-foreground", children: status });
3368
+ return /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { children: status });
3620
3369
  }
3621
3370
  function ProcessListView({ processes }) {
3622
3371
  if (processes.length === 0) {
@@ -3891,36 +3640,16 @@ function ExpertToolBlock({ tc }) {
3891
3640
  const question = args.question ?? args.prompt ?? "";
3892
3641
  const result = parseExpertResult(tc.result);
3893
3642
  const failed = Boolean(result?.error);
3894
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
3895
- /* @__PURE__ */ jsxRuntime.jsxs(
3896
- "button",
3897
- {
3898
- type: "button",
3899
- onClick: () => setExpanded(!expanded),
3900
- className: cn(
3901
- "flex w-fit max-w-full items-center gap-1.5 rounded-md px-0 py-0.5",
3902
- "text-sm text-muted-foreground hover:text-foreground transition-colors"
3903
- ),
3904
- children: [
3905
- /* @__PURE__ */ jsxRuntime.jsx(
3906
- lucideReact.ChevronRightIcon,
3907
- {
3908
- className: cn(
3909
- "size-3 shrink-0 transition-transform duration-150",
3910
- expanded && "rotate-90"
3911
- )
3912
- }
3913
- ),
3914
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: "Consulted expert" }),
3915
- expertName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
3916
- "\xB7 ",
3917
- expertName
3918
- ] }),
3919
- failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500", children: "\xB7 failed" })
3920
- ]
3921
- }
3922
- ),
3923
- expanded && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-6 mt-0.5 space-y-1.5 text-sm", children: [
3643
+ return /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { open: expanded, onOpenChange: setExpanded, className: "space-y-1", children: [
3644
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { className: "-ml-2 w-fit max-w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [
3645
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium text-foreground", children: "Consulted expert" }),
3646
+ expertName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate text-muted-foreground", children: [
3647
+ "\xB7 ",
3648
+ expertName
3649
+ ] }),
3650
+ failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-red-500", children: "\xB7 failed" })
3651
+ ] }) }),
3652
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "ml-6 mt-0.5 space-y-1.5 text-sm", children: [
3924
3653
  question && /* @__PURE__ */ jsxRuntime.jsx(ExpertDetail, { label: "Question", content: question }),
3925
3654
  result?.summary && /* @__PURE__ */ jsxRuntime.jsx(
3926
3655
  ExpertDetail,
@@ -4281,25 +4010,20 @@ function QuickReply({
4281
4010
  disabled,
4282
4011
  onSelect
4283
4012
  }) {
4284
- return /* @__PURE__ */ jsxRuntime.jsxs(
4285
- "button",
4286
- {
4287
- type: "button",
4288
- disabled,
4289
- onClick: onSelect,
4290
- className: cn(
4291
- "border border-border bg-background text-left text-foreground transition-colors",
4292
- "hover:border-foreground/30 hover:bg-muted",
4293
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
4294
- "disabled:cursor-not-allowed disabled:opacity-50",
4295
- stacked ? "rounded-md px-3 py-2" : "rounded-full px-3.5 py-1.5 text-sm"
4296
- ),
4297
- children: [
4298
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("block", stacked && "text-sm"), children: choice.label }),
4299
- stacked && choice.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: choice.description })
4300
- ]
4301
- }
4302
- );
4013
+ if (stacked) {
4014
+ return /* @__PURE__ */ jsxRuntime.jsx(
4015
+ choiceCard.ChoiceCard,
4016
+ {
4017
+ size: "sm",
4018
+ selected: false,
4019
+ title: choice.label,
4020
+ description: choice.description,
4021
+ disabled,
4022
+ onClick: onSelect
4023
+ }
4024
+ );
4025
+ }
4026
+ return /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", size: "sm", disabled, onClick: onSelect, children: choice.label });
4303
4027
  }
4304
4028
  function BatchAsk({
4305
4029
  tc,
@@ -4415,70 +4139,64 @@ function BatchAsk({
4415
4139
  role: "group",
4416
4140
  "aria-label": "Questions for the user",
4417
4141
  children: [
4418
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 pt-2", children: [
4419
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 overflow-x-auto text-sm", children: questions.map((_, i) => {
4420
- const isActive = i === active;
4421
- const answered = answers[i] !== null;
4422
- return /* @__PURE__ */ jsxRuntime.jsxs(
4423
- "button",
4424
- {
4425
- type: "button",
4426
- onClick: () => setActive(i),
4427
- className: cn(
4428
- "relative pb-2 transition-colors whitespace-nowrap",
4429
- isActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4430
- ),
4431
- children: [
4432
- /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4433
- "Question ",
4434
- i + 1
4435
- ] }),
4436
- answered && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] text-emerald-500", children: "\u25CF" }),
4437
- isActive && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-x-0 bottom-0 h-px bg-foreground" })
4438
- ]
4439
- },
4440
- i
4441
- );
4442
- }) }),
4443
- /* @__PURE__ */ jsxRuntime.jsx(
4444
- button.Button,
4445
- {
4446
- type: "button",
4447
- variant: "ghost",
4448
- size: "icon-xs",
4449
- onClick: handleCancel,
4450
- className: "ml-2",
4451
- "aria-label": "Cancel clarification and stop chat",
4452
- title: "Esc \u2014 cancel and stop the chat",
4453
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" })
4454
- }
4455
- )
4456
- ] }),
4457
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-3", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: current.prompt }) }),
4458
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 px-1 pb-2", children: [
4459
- (current.choices ?? []).map((choice, i) => /* @__PURE__ */ jsxRuntime.jsx(
4460
- ChoiceRow,
4461
- {
4462
- choice,
4463
- selected: currentSel.index === i,
4464
- onSelect: () => selectChoice(i)
4465
- },
4466
- i
4467
- )),
4468
- (current.allow_other ?? true) && /* @__PURE__ */ jsxRuntime.jsx(
4469
- OtherRow,
4470
- {
4471
- selected: currentSel.index >= OTHER_INDEX_OFFSET,
4472
- value: currentSel.other,
4473
- onSelect: () => updateSelection({ index: OTHER_INDEX_OFFSET }),
4474
- onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v }),
4475
- onCommit: () => {
4476
- if (allAnswered) void handleSubmit();
4477
- else advance();
4478
- }
4479
- }
4480
- )
4481
- ] }),
4142
+ /* @__PURE__ */ jsxRuntime.jsxs(
4143
+ tabs.Tabs,
4144
+ {
4145
+ value: String(active),
4146
+ onValueChange: (value) => setActive(Number(value)),
4147
+ className: "gap-0",
4148
+ children: [
4149
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2", children: [
4150
+ /* @__PURE__ */ jsxRuntime.jsx(tabs.TabsList, { variant: "line", className: "no-scrollbar max-w-full overflow-x-auto", children: questions.map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(tabs.TabsTrigger, { value: String(i), children: [
4151
+ "Question ",
4152
+ i + 1,
4153
+ answers[i] !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-emerald-500", children: "\u25CF" })
4154
+ ] }, i)) }),
4155
+ /* @__PURE__ */ jsxRuntime.jsx(
4156
+ button.Button,
4157
+ {
4158
+ type: "button",
4159
+ variant: "ghost",
4160
+ size: "icon-xs",
4161
+ onClick: handleCancel,
4162
+ "aria-label": "Cancel clarification and stop chat",
4163
+ title: "Esc \u2014 cancel and stop the chat",
4164
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" })
4165
+ }
4166
+ )
4167
+ ] }),
4168
+ /* @__PURE__ */ jsxRuntime.jsxs(tabs.TabsContent, { value: String(active), children: [
4169
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-3", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: current.prompt }) }),
4170
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-col gap-1.5 px-3 pb-3", children: [
4171
+ (current.choices ?? []).map((choice, i) => /* @__PURE__ */ jsxRuntime.jsx(
4172
+ choiceCard.ChoiceCard,
4173
+ {
4174
+ size: "sm",
4175
+ selected: currentSel.index === i,
4176
+ title: choice.label,
4177
+ description: choice.description,
4178
+ onClick: () => selectChoice(i)
4179
+ },
4180
+ i
4181
+ )),
4182
+ (current.allow_other ?? true) && /* @__PURE__ */ jsxRuntime.jsx(
4183
+ OtherRow,
4184
+ {
4185
+ selected: currentSel.index >= OTHER_INDEX_OFFSET,
4186
+ value: currentSel.other,
4187
+ onSelect: () => updateSelection({ index: OTHER_INDEX_OFFSET }),
4188
+ onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v }),
4189
+ onCommit: () => {
4190
+ if (allAnswered) void handleSubmit();
4191
+ else advance();
4192
+ }
4193
+ }
4194
+ )
4195
+ ] })
4196
+ ] })
4197
+ ]
4198
+ }
4199
+ ),
4482
4200
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-3 py-2", children: [
4483
4201
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 text-xs text-muted-foreground", children: [
4484
4202
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mr-2 tabular-nums", children: [
@@ -4505,30 +4223,6 @@ function BatchAsk({
4505
4223
  }
4506
4224
  );
4507
4225
  }
4508
- function ChoiceRow({
4509
- choice,
4510
- selected,
4511
- onSelect
4512
- }) {
4513
- return /* @__PURE__ */ jsxRuntime.jsxs(
4514
- "button",
4515
- {
4516
- type: "button",
4517
- onClick: onSelect,
4518
- className: cn(
4519
- "flex w-full items-start gap-3 rounded px-2 py-1.5 text-left transition-colors",
4520
- selected ? "bg-muted" : "hover:bg-muted/40"
4521
- ),
4522
- children: [
4523
- /* @__PURE__ */ jsxRuntime.jsx(Radio, { selected }),
4524
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
4525
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-foreground", children: choice.label }),
4526
- choice.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: choice.description })
4527
- ] })
4528
- ]
4529
- }
4530
- );
4531
- }
4532
4226
  function OtherRow({
4533
4227
  selected,
4534
4228
  value,
@@ -4540,55 +4234,33 @@ function OtherRow({
4540
4234
  "div",
4541
4235
  {
4542
4236
  className: cn(
4543
- "flex items-start gap-3 rounded px-2 py-1.5 transition-colors",
4544
- selected ? "bg-muted" : "hover:bg-muted/40"
4237
+ choiceCard.choiceCardVariants({ size: "sm", selected }),
4238
+ "cursor-pointer flex-col gap-1.5 sm:gap-1.5"
4545
4239
  ),
4240
+ onClick: onSelect,
4546
4241
  children: [
4242
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[14px] font-medium text-foreground sm:text-[13px]", children: "Other" }),
4547
4243
  /* @__PURE__ */ jsxRuntime.jsx(
4548
- "button",
4244
+ input.Input,
4549
4245
  {
4550
- type: "button",
4551
- onClick: onSelect,
4552
- className: "flex shrink-0 items-center pt-0.5",
4553
- "aria-label": "Choose Other",
4554
- children: /* @__PURE__ */ jsxRuntime.jsx(Radio, { selected })
4246
+ "aria-label": "Other answer",
4247
+ placeholder: "Type your answer\u2026",
4248
+ value,
4249
+ onFocus: onSelect,
4250
+ onChange: (e) => onChange(e.target.value),
4251
+ onKeyDown: (e) => {
4252
+ if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && value.trim()) {
4253
+ e.preventDefault();
4254
+ onCommit();
4255
+ }
4256
+ },
4257
+ className: "h-8 text-[13px]"
4555
4258
  }
4556
- ),
4557
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
4558
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-foreground", children: "Other" }),
4559
- /* @__PURE__ */ jsxRuntime.jsx(
4560
- input.Input,
4561
- {
4562
- placeholder: "Type your answer\u2026",
4563
- value,
4564
- onFocus: onSelect,
4565
- onChange: (e) => onChange(e.target.value),
4566
- onKeyDown: (e) => {
4567
- if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && value.trim()) {
4568
- e.preventDefault();
4569
- onCommit();
4570
- }
4571
- },
4572
- className: "mt-0.5 h-7 px-0 text-xs"
4573
- }
4574
- )
4575
- ] })
4259
+ )
4576
4260
  ]
4577
4261
  }
4578
4262
  );
4579
4263
  }
4580
- function Radio({ selected }) {
4581
- return /* @__PURE__ */ jsxRuntime.jsx(
4582
- "span",
4583
- {
4584
- "aria-hidden": true,
4585
- className: cn(
4586
- "mt-[3px] size-3.5 shrink-0 rounded-full border",
4587
- selected ? "border-foreground bg-foreground" : "border-muted-foreground/60 bg-transparent"
4588
- )
4589
- }
4590
- );
4591
- }
4592
4264
  function BatchAskLocked({
4593
4265
  tc,
4594
4266
  questions,
@@ -4705,28 +4377,17 @@ function MemoryToolBlock({ tc }) {
4705
4377
  const targetLabel = TARGET_LABEL[target] ?? target;
4706
4378
  const failed = result?.success === false || !!result?.error;
4707
4379
  return /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { open: isOpen, onOpenChange: setIsOpen, className: "not-prose w-full", children: [
4708
- /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleTrigger, { className: "group/trigger flex w-fit items-center gap-2 text-sm transition-colors", children: [
4709
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-left", children: [
4710
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: verb }),
4380
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { className: "-ml-2 w-fit max-w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4381
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: verb }),
4382
+ " ",
4383
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
4384
+ prep,
4711
4385
  " ",
4712
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
4713
- prep,
4714
- " ",
4715
- targetLabel
4716
- ] }),
4717
- result?.usage && !failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60 ml-1.5 text-xs", children: result.usage }),
4718
- failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1.5", children: "\xB7 failed" })
4386
+ targetLabel
4719
4387
  ] }),
4720
- /* @__PURE__ */ jsxRuntime.jsx(
4721
- lucideReact.ChevronDownIcon,
4722
- {
4723
- className: cn(
4724
- "size-4 shrink-0 transition-transform",
4725
- isOpen ? "rotate-180" : "rotate-0"
4726
- )
4727
- }
4728
- )
4729
- ] }),
4388
+ result?.usage && !failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60 ml-1.5 text-xs", children: result.usage }),
4389
+ failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1.5", children: "\xB7 failed" })
4390
+ ] }) }),
4730
4391
  /* @__PURE__ */ jsxRuntime.jsx(
4731
4392
  collapsible.CollapsibleContent,
4732
4393
  {
@@ -4831,9 +4492,6 @@ function CoordinatorToolBlock({ tc }) {
4831
4492
  ] })
4832
4493
  ] });
4833
4494
  }
4834
-
4835
- // src/components/chat/tools/default-tool.tsx
4836
- init_utils();
4837
4495
  var TOOL_LABELS = {
4838
4496
  kb_list_pages: "Knowledge Base",
4839
4497
  kb_read_page: "Read KB Page",
@@ -4868,35 +4526,14 @@ function StatusIcon({ tc }) {
4868
4526
  return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2Icon, { className: "size-3.5 text-emerald-500" });
4869
4527
  }
4870
4528
  function DefaultToolBlock({ tc }) {
4871
- const [expanded, setExpanded] = react.useState(false);
4872
4529
  const summary = toolSummary(tc);
4873
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border/60 bg-muted/20 overflow-hidden", children: [
4874
- /* @__PURE__ */ jsxRuntime.jsxs(
4875
- "button",
4876
- {
4877
- type: "button",
4878
- onClick: () => setExpanded(!expanded),
4879
- className: cn(
4880
- "flex w-full items-center gap-2 px-3 py-2",
4881
- "text-sm hover:bg-muted/40 transition-colors cursor-pointer"
4882
- ),
4883
- children: [
4884
- /* @__PURE__ */ jsxRuntime.jsx(StatusIcon, { tc }),
4885
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: toolLabel(tc.toolName) }),
4886
- summary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/70 truncate text-xs flex-1 text-left", children: summary }),
4887
- /* @__PURE__ */ jsxRuntime.jsx(
4888
- lucideReact.ChevronRightIcon,
4889
- {
4890
- className: cn(
4891
- "size-3.5 shrink-0 text-muted-foreground/50 transition-transform duration-150 ml-auto",
4892
- expanded && "rotate-90"
4893
- )
4894
- }
4895
- )
4896
- ]
4897
- }
4898
- ),
4899
- expanded && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-border/40 px-3 py-2 space-y-2", children: [
4530
+ return /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { className: "overflow-hidden rounded-[10px] border border-foreground/[0.08]", children: [
4531
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
4532
+ /* @__PURE__ */ jsxRuntime.jsx(StatusIcon, { tc }),
4533
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: toolLabel(tc.toolName) }),
4534
+ summary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-xs font-normal text-muted-foreground/70", children: summary })
4535
+ ] }) }),
4536
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "space-y-2 border-t border-foreground/[0.08] px-3 py-2", children: [
4900
4537
  /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto rounded-md bg-muted/50 px-3 py-2 text-xs text-muted-foreground font-mono whitespace-pre-wrap break-all", children: formatArgs(tc.args) }),
4901
4538
  tc.result && /* @__PURE__ */ jsxRuntime.jsxs("pre", { className: "overflow-x-auto rounded-md bg-muted/50 px-3 py-2 text-xs font-mono whitespace-pre-wrap break-all max-h-48 overflow-y-auto", children: [
4902
4539
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-emerald-600 dark:text-emerald-400 font-semibold", children: "Result" }),
@@ -4968,18 +4605,7 @@ function CodeRunToolBlock({
4968
4605
  onOpenChange: setIsOpen,
4969
4606
  className: "not-prose w-full",
4970
4607
  children: [
4971
- /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleTrigger, { className: "group/trigger flex w-fit items-center gap-2 text-sm transition-colors", children: [
4972
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-left", children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { as: "span", duration: 1, children: `Running ${label}...` }) : hasError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-destructive", children: `${label} failed` }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: `Ran ${label}` }) }),
4973
- /* @__PURE__ */ jsxRuntime.jsx(
4974
- lucideReact.ChevronDownIcon,
4975
- {
4976
- className: cn(
4977
- "size-4 shrink-0 transition-transform",
4978
- isOpen ? "rotate-180" : "rotate-0"
4979
- )
4980
- }
4981
- )
4982
- ] }),
4608
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { className: "-ml-2 w-fit max-w-full", children: isRunning ? /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { as: "span", duration: 1, children: `Running ${label}...` }) : hasError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-destructive", children: `${label} failed` }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: `Ran ${label}` }) }),
4983
4609
  /* @__PURE__ */ jsxRuntime.jsx(
4984
4610
  collapsible.CollapsibleContent,
4985
4611
  {
@@ -5659,90 +5285,7 @@ function renderInlineMarkdown(text) {
5659
5285
  });
5660
5286
  }
5661
5287
 
5662
- // src/components/ui/command.tsx
5663
- init_utils();
5664
- function Command({
5665
- className,
5666
- ...props
5667
- }) {
5668
- return /* @__PURE__ */ jsxRuntime.jsx(
5669
- cmdk.Command,
5670
- {
5671
- "data-slot": "command",
5672
- className: cn(
5673
- "flex size-full flex-col overflow-hidden bg-popover text-popover-foreground",
5674
- className
5675
- ),
5676
- ...props
5677
- }
5678
- );
5679
- }
5680
- function CommandList({
5681
- className,
5682
- ...props
5683
- }) {
5684
- return /* @__PURE__ */ jsxRuntime.jsx(
5685
- cmdk.Command.List,
5686
- {
5687
- "data-slot": "command-list",
5688
- className: cn(
5689
- "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
5690
- className
5691
- ),
5692
- ...props
5693
- }
5694
- );
5695
- }
5696
- function CommandEmpty({
5697
- className,
5698
- ...props
5699
- }) {
5700
- return /* @__PURE__ */ jsxRuntime.jsx(
5701
- cmdk.Command.Empty,
5702
- {
5703
- "data-slot": "command-empty",
5704
- className: cn("py-6 text-center text-sm", className),
5705
- ...props
5706
- }
5707
- );
5708
- }
5709
- function CommandGroup({
5710
- className,
5711
- ...props
5712
- }) {
5713
- return /* @__PURE__ */ jsxRuntime.jsx(
5714
- cmdk.Command.Group,
5715
- {
5716
- "data-slot": "command-group",
5717
- className: cn(
5718
- "overflow-hidden p-1.5 text-foreground **:[[cmdk-group-heading]]:mb-1 **:[[cmdk-group-heading]]:rounded-sm **:[[cmdk-group-heading]]:bg-orange-100 **:[[cmdk-group-heading]]:px-3 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-semibold **:[[cmdk-group-heading]]:tracking-wider **:[[cmdk-group-heading]]:text-foreground dark:**:[[cmdk-group-heading]]:bg-orange-400/40 dark:**:[[cmdk-group-heading]]:text-foreground/90",
5719
- className
5720
- ),
5721
- ...props
5722
- }
5723
- );
5724
- }
5725
- function CommandItem({
5726
- className,
5727
- children,
5728
- ...props
5729
- }) {
5730
- return /* @__PURE__ */ jsxRuntime.jsxs(
5731
- cmdk.Command.Item,
5732
- {
5733
- "data-slot": "command-item",
5734
- className: cn(
5735
- "group/command-item relative flex cursor-default items-center gap-2 rounded-none px-3 py-2 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[selected=true]:*:[svg]:text-foreground",
5736
- className
5737
- ),
5738
- ...props,
5739
- children: [
5740
- children,
5741
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })
5742
- ]
5743
- }
5744
- );
5745
- }
5288
+ // src/components/ai-elements/prompt-input.tsx
5746
5289
  init_utils();
5747
5290
  var convertBlobUrlToDataUrl = async (url) => {
5748
5291
  try {
@@ -6449,34 +5992,6 @@ function splitComposerFiles(files) {
6449
5992
  return { images, pending };
6450
5993
  }
6451
5994
 
6452
- // src/components/ui/progress.tsx
6453
- init_utils();
6454
- function Progress({
6455
- className,
6456
- value,
6457
- ...props
6458
- }) {
6459
- return /* @__PURE__ */ jsxRuntime.jsx(
6460
- radixUi.Progress.Root,
6461
- {
6462
- "data-slot": "progress",
6463
- className: cn(
6464
- "relative flex h-0.5 w-full items-center overflow-x-hidden rounded-none bg-muted",
6465
- className
6466
- ),
6467
- ...props,
6468
- children: /* @__PURE__ */ jsxRuntime.jsx(
6469
- radixUi.Progress.Indicator,
6470
- {
6471
- "data-slot": "progress-indicator",
6472
- className: "size-full flex-1 bg-primary transition-all",
6473
- style: { transform: `translateX(-${100 - (value || 0)}%)` }
6474
- }
6475
- )
6476
- }
6477
- );
6478
- }
6479
-
6480
5995
  // src/components/ai-elements/context.tsx
6481
5996
  init_utils();
6482
5997
  var PERCENT_MAX = 100;
@@ -6593,20 +6108,9 @@ var ContextContentHeader = ({
6593
6108
  ] })
6594
6109
  ] }),
6595
6110
  /* @__PURE__ */ jsxRuntime.jsx(
6596
- Progress,
6111
+ progressBar.ProgressBar,
6597
6112
  {
6598
- className: cn(
6599
- // The primitive only clips its x-axis, which leaves the fill's
6600
- // square end poking out of the pill at both ends.
6601
- "h-1 overflow-hidden rounded-full bg-muted",
6602
- // Amber, not `bg-primary`: primary is the host app's colour, and
6603
- // the two hosts disagree — the agent web app is amber, Studio is
6604
- // near-black — so the same bar came out black beside a Send
6605
- // button the composer hardcodes amber. This is the composer's
6606
- // own accent, so it reads the same wherever it is embedded.
6607
- "[&>[data-slot=progress-indicator]]:bg-amber-500",
6608
- nearlyFull && "[&>[data-slot=progress-indicator]]:bg-destructive"
6609
- ),
6113
+ color: nearlyFull ? "var(--destructive)" : "var(--color-amber-500)",
6610
6114
  value: usedPercent * PERCENT_MAX
6611
6115
  }
6612
6116
  )
@@ -6620,236 +6124,38 @@ var ContextContentBody = ({
6620
6124
 
6621
6125
  // src/components/chat/chat-composer.tsx
6622
6126
  init_utils();
6623
-
6624
- // src/components/ui/item.tsx
6625
- init_utils();
6626
- var itemVariants = classVarianceAuthority.cva(
6627
- "group/item flex w-full flex-wrap items-center rounded-none border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted",
6628
- {
6629
- variants: {
6630
- variant: {
6631
- default: "border-transparent",
6632
- outline: "border-border",
6633
- muted: "border-transparent bg-muted/50"
6634
- },
6635
- size: {
6636
- default: "gap-3.5 px-4 py-3.5",
6637
- sm: "gap-3.5 px-3.5 py-3",
6638
- xs: "gap-2.5 px-3 py-2.5 in-data-[slot=dropdown-menu-content]:p-0"
6639
- }
6640
- },
6641
- defaultVariants: {
6642
- variant: "default",
6643
- size: "default"
6644
- }
6645
- }
6646
- );
6647
- function Item({
6648
- className,
6649
- variant = "default",
6650
- size: size2 = "default",
6651
- asChild = false,
6652
- ...props
6653
- }) {
6654
- const Comp = asChild ? radixUi.Slot.Root : "div";
6655
- return /* @__PURE__ */ jsxRuntime.jsx(
6656
- Comp,
6657
- {
6658
- "data-slot": "item",
6659
- "data-variant": variant,
6660
- "data-size": size2,
6661
- className: cn(itemVariants({ variant, size: size2, className })),
6662
- ...props
6663
- }
6664
- );
6665
- }
6666
- var itemMediaVariants = classVarianceAuthority.cva(
6667
- "flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none",
6668
- {
6669
- variants: {
6670
- variant: {
6671
- default: "bg-transparent",
6672
- icon: "[&_svg:not([class*='size-'])]:size-4",
6673
- image: "size-10 overflow-hidden rounded-none group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 group-data-[size=xs]/item:rounded-none [&_img]:size-full [&_img]:object-cover"
6674
- }
6675
- },
6676
- defaultVariants: {
6677
- variant: "default"
6678
- }
6679
- }
6680
- );
6681
- function ItemMedia({
6682
- className,
6683
- variant = "default",
6684
- ...props
6127
+ var SEARCH_PLACEHOLDER = {
6128
+ commands: "Search commands\u2026",
6129
+ skills: "Search skills\u2026",
6130
+ scheduled: "Search scheduled tasks\u2026",
6131
+ all: "Type a command or search\u2026"
6132
+ };
6133
+ var NAV_HINT = "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc dismiss";
6134
+ var SEARCH_HINT = {
6135
+ commands: NAV_HINT,
6136
+ skills: "Esc dismiss",
6137
+ scheduled: NAV_HINT,
6138
+ all: NAV_HINT
6139
+ };
6140
+ var NAME_COLUMNS = "grid-cols-[120px_minmax(0,1fr)] sm:grid-cols-[200px_minmax(0,1fr)]";
6141
+ var ROW_CLASS = `grid ${NAME_COLUMNS} min-h-11 items-center gap-4 rounded-[10px] px-3 py-1.5 data-[selected=true]:bg-accent [&_svg]:hidden`;
6142
+ function ComposerCommandMenu({
6143
+ menuMode,
6144
+ searchQuery,
6145
+ onSearchChange,
6146
+ skillsLoading,
6147
+ builtinCommands,
6148
+ adapterCommands,
6149
+ scheduledExamples,
6150
+ onCommandSelect,
6151
+ onEscapeDismiss
6685
6152
  }) {
6153
+ const controlledSearch = menuMode === "commands" || menuMode === "all";
6154
+ const showCommands = menuMode === "commands" || menuMode === "all";
6155
+ const showSkills = menuMode === "skills" || menuMode === "all";
6156
+ const skillsUnattached = menuMode === "skills" && !skillsLoading && adapterCommands.length === 0;
6686
6157
  return /* @__PURE__ */ jsxRuntime.jsx(
6687
- "div",
6688
- {
6689
- "data-slot": "item-media",
6690
- "data-variant": variant,
6691
- className: cn(itemMediaVariants({ variant, className })),
6692
- ...props
6693
- }
6694
- );
6695
- }
6696
- function ItemContent({ className, ...props }) {
6697
- return /* @__PURE__ */ jsxRuntime.jsx(
6698
- "div",
6699
- {
6700
- "data-slot": "item-content",
6701
- className: cn(
6702
- "flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0.5 [&+[data-slot=item-content]]:flex-none",
6703
- className
6704
- ),
6705
- ...props
6706
- }
6707
- );
6708
- }
6709
- function ItemTitle({ className, ...props }) {
6710
- return /* @__PURE__ */ jsxRuntime.jsx(
6711
- "div",
6712
- {
6713
- "data-slot": "item-title",
6714
- className: cn(
6715
- "line-clamp-1 flex w-fit items-center gap-2 text-xs leading-snug font-semibold uppercase underline-offset-4",
6716
- className
6717
- ),
6718
- ...props
6719
- }
6720
- );
6721
- }
6722
- function ItemDescription({ className, ...props }) {
6723
- return /* @__PURE__ */ jsxRuntime.jsx(
6724
- "p",
6725
- {
6726
- "data-slot": "item-description",
6727
- className: cn(
6728
- "line-clamp-2 text-left text-sm leading-relaxed font-normal text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
6729
- className
6730
- ),
6731
- ...props
6732
- }
6733
- );
6734
- }
6735
- function ItemActions({ className, ...props }) {
6736
- return /* @__PURE__ */ jsxRuntime.jsx(
6737
- "div",
6738
- {
6739
- "data-slot": "item-actions",
6740
- className: cn("flex items-center gap-2", className),
6741
- ...props
6742
- }
6743
- );
6744
- }
6745
- var MOBILE_QUERY = "(max-width: 767px)";
6746
- function subscribe(onChange) {
6747
- const mql = window.matchMedia(MOBILE_QUERY);
6748
- mql.addEventListener("change", onChange);
6749
- return () => mql.removeEventListener("change", onChange);
6750
- }
6751
- function useIsMobile() {
6752
- return react.useSyncExternalStore(
6753
- subscribe,
6754
- () => window.matchMedia(MOBILE_QUERY).matches,
6755
- // No viewport when server-rendered; assume desktop, as the SDK does.
6756
- () => false
6757
- );
6758
- }
6759
-
6760
- // src/components/ui/responsive-panel.tsx
6761
- init_utils();
6762
- function ResponsivePanel({
6763
- open,
6764
- onOpenChange,
6765
- trigger,
6766
- title,
6767
- children,
6768
- align = "start",
6769
- popoverClassName
6770
- }) {
6771
- const isMobile = useIsMobile();
6772
- if (!isMobile) {
6773
- return /* @__PURE__ */ jsxRuntime.jsxs(popover.Popover, { open, onOpenChange, children: [
6774
- /* @__PURE__ */ jsxRuntime.jsx(popover.PopoverTrigger, { asChild: true, children: trigger }),
6775
- /* @__PURE__ */ jsxRuntime.jsx(
6776
- popover.PopoverContent,
6777
- {
6778
- side: "top",
6779
- align,
6780
- className: cn("w-64 overflow-hidden rounded-xl p-1", popoverClassName),
6781
- children
6782
- }
6783
- )
6784
- ] });
6785
- }
6786
- return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Root, { open, onOpenChange, children: [
6787
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { asChild: true, children: trigger }),
6788
- /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Portal, { children: [
6789
- /* @__PURE__ */ jsxRuntime.jsx(
6790
- radixUi.Dialog.Overlay,
6791
- {
6792
- "data-slot": "responsive-panel-overlay",
6793
- className: "fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
6794
- }
6795
- ),
6796
- /* @__PURE__ */ jsxRuntime.jsxs(
6797
- radixUi.Dialog.Content,
6798
- {
6799
- "data-slot": "responsive-panel-sheet",
6800
- "aria-describedby": void 0,
6801
- className: cn(
6802
- "fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg",
6803
- "data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom"
6804
- ),
6805
- children: [
6806
- /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Title, { className: "sr-only", children: title }),
6807
- /* @__PURE__ */ jsxRuntime.jsx(
6808
- "div",
6809
- {
6810
- "aria-hidden": "true",
6811
- className: "mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30"
6812
- }
6813
- ),
6814
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1", children })
6815
- ]
6816
- }
6817
- )
6818
- ] })
6819
- ] });
6820
- }
6821
- var SEARCH_PLACEHOLDER = {
6822
- commands: "Search commands\u2026",
6823
- skills: "Search skills\u2026",
6824
- scheduled: "Search scheduled tasks\u2026",
6825
- all: "Type a command or search\u2026"
6826
- };
6827
- var NAV_HINT = "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc dismiss";
6828
- var SEARCH_HINT = {
6829
- commands: NAV_HINT,
6830
- skills: "Esc dismiss",
6831
- scheduled: NAV_HINT,
6832
- all: NAV_HINT
6833
- };
6834
- var NAME_COLUMNS = "grid-cols-[120px_minmax(0,1fr)] sm:grid-cols-[200px_minmax(0,1fr)]";
6835
- var ROW_CLASS = `grid ${NAME_COLUMNS} min-h-11 items-center gap-4 rounded-[10px] px-3 py-1.5 data-[selected=true]:bg-accent [&_svg]:hidden`;
6836
- function ComposerCommandMenu({
6837
- menuMode,
6838
- searchQuery,
6839
- onSearchChange,
6840
- skillsLoading,
6841
- builtinCommands,
6842
- adapterCommands,
6843
- scheduledExamples,
6844
- onCommandSelect,
6845
- onEscapeDismiss
6846
- }) {
6847
- const controlledSearch = menuMode === "commands" || menuMode === "all";
6848
- const showCommands = menuMode === "commands" || menuMode === "all";
6849
- const showSkills = menuMode === "skills" || menuMode === "all";
6850
- const skillsUnattached = menuMode === "skills" && !skillsLoading && adapterCommands.length === 0;
6851
- return /* @__PURE__ */ jsxRuntime.jsx(
6852
- popover.PopoverContent,
6158
+ popover.PopoverContent,
6853
6159
  {
6854
6160
  side: "top",
6855
6161
  align: "start",
@@ -6865,7 +6171,7 @@ function ComposerCommandMenu({
6865
6171
  onEscapeKeyDown: () => {
6866
6172
  onEscapeDismiss();
6867
6173
  },
6868
- children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
6174
+ children: /* @__PURE__ */ jsxRuntime.jsxs(command.Command, { children: [
6869
6175
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-14 items-center gap-3 border-b border-border px-4.5", children: [
6870
6176
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4.5 shrink-0 text-muted-foreground" }),
6871
6177
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -6882,8 +6188,8 @@ function ComposerCommandMenu({
6882
6188
  skillsUnattached ? /* @__PURE__ */ jsxRuntime.jsx(SkillsEmptyState, {}) : (
6883
6189
  // A fixed height, not content height: the popup must not jump as
6884
6190
  // the search narrows the list.
6885
- /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { className: "h-66 max-h-none px-2.5 py-2", children: [
6886
- !(skillsLoading && showSkills) && /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: menuMode === "skills" ? "No skills match your search." : menuMode === "scheduled" ? "No scheduled tasks found." : "No commands found." }),
6191
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { className: "h-66 max-h-none px-2.5 py-2", children: [
6192
+ !(skillsLoading && showSkills) && /* @__PURE__ */ jsxRuntime.jsx(command.CommandEmpty, { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: menuMode === "skills" ? "No skills match your search." : menuMode === "scheduled" ? "No scheduled tasks found." : "No commands found." }),
6887
6193
  showSkills && skillsLoading && adapterCommands.length === 0 && [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
6888
6194
  "div",
6889
6195
  {
@@ -6935,7 +6241,7 @@ function MenuRow({
6935
6241
  onSelect
6936
6242
  }) {
6937
6243
  return /* @__PURE__ */ jsxRuntime.jsxs(
6938
- CommandItem,
6244
+ command.CommandItem,
6939
6245
  {
6940
6246
  value: cmd.value,
6941
6247
  keywords: keywords ?? [cmd.description],
@@ -7234,19 +6540,19 @@ function AttachmentPreviewStrip() {
7234
6540
  const sizeLabel = formatBytes2(file.file?.size);
7235
6541
  const Icon = iconForMime2(file.mediaType);
7236
6542
  return /* @__PURE__ */ jsxRuntime.jsxs(
7237
- Item,
6543
+ item.Item,
7238
6544
  {
7239
6545
  variant: "outline",
7240
6546
  size: "xs",
7241
6547
  className: "group w-auto max-w-[18rem] rounded-md",
7242
6548
  title: file.filename,
7243
6549
  children: [
7244
- /* @__PURE__ */ jsxRuntime.jsx(ItemMedia, { variant: isImage ? "image" : "icon", children: isImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: file.url, alt: file.filename }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }),
7245
- /* @__PURE__ */ jsxRuntime.jsxs(ItemContent, { className: "min-w-0", children: [
7246
- /* @__PURE__ */ jsxRuntime.jsx(ItemTitle, { className: "block w-full truncate normal-case font-medium text-foreground", children: file.filename }),
7247
- sizeLabel && /* @__PURE__ */ jsxRuntime.jsx(ItemDescription, { className: "text-xs", children: sizeLabel })
6550
+ /* @__PURE__ */ jsxRuntime.jsx(item.ItemMedia, { variant: isImage ? "image" : "icon", children: isImage ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: file.url, alt: file.filename }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, {}) }),
6551
+ /* @__PURE__ */ jsxRuntime.jsxs(item.ItemContent, { className: "min-w-0", children: [
6552
+ /* @__PURE__ */ jsxRuntime.jsx(item.ItemTitle, { className: "block w-full truncate normal-case font-medium text-foreground", children: file.filename }),
6553
+ sizeLabel && /* @__PURE__ */ jsxRuntime.jsx(item.ItemDescription, { className: "text-xs", children: sizeLabel })
7248
6554
  ] }),
7249
- /* @__PURE__ */ jsxRuntime.jsx(ItemActions, { children: /* @__PURE__ */ jsxRuntime.jsx(
6555
+ /* @__PURE__ */ jsxRuntime.jsx(item.ItemActions, { children: /* @__PURE__ */ jsxRuntime.jsx(
7250
6556
  "button",
7251
6557
  {
7252
6558
  type: "button",
@@ -7620,7 +6926,7 @@ function ChatComposerInner({
7620
6926
  /* @__PURE__ */ jsxRuntime.jsxs(PromptInputFooter, { className: "gap-1.5 px-3 pt-2 pb-3", children: [
7621
6927
  /* @__PURE__ */ jsxRuntime.jsxs(PromptInputTools, { className: "gap-1.5", children: [
7622
6928
  showToolsPanel && /* @__PURE__ */ jsxRuntime.jsx(
7623
- ResponsivePanel,
6929
+ responsivePanel.ResponsivePanel,
7624
6930
  {
7625
6931
  open: addMenuOpen,
7626
6932
  onOpenChange: (open) => {
@@ -7639,10 +6945,10 @@ function ChatComposerInner({
7639
6945
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "size-4.5" })
7640
6946
  }
7641
6947
  ),
7642
- children: /* @__PURE__ */ jsxRuntime.jsx(Command, { children: /* @__PURE__ */ jsxRuntime.jsxs(CommandList, { className: "max-md:max-h-none", children: [
7643
- canAttach && /* @__PURE__ */ jsxRuntime.jsxs(CommandGroup, { heading: "Attach", children: [
6948
+ children: /* @__PURE__ */ jsxRuntime.jsx(command.Command, { children: /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { className: "max-md:max-h-none", children: [
6949
+ canAttach && /* @__PURE__ */ jsxRuntime.jsxs(command.CommandGroup, { heading: "Attach", children: [
7644
6950
  /* @__PURE__ */ jsxRuntime.jsxs(
7645
- CommandItem,
6951
+ command.CommandItem,
7646
6952
  {
7647
6953
  onSelect: () => {
7648
6954
  setAddMenuOpen(false);
@@ -7655,23 +6961,23 @@ function ChatComposerInner({
7655
6961
  ]
7656
6962
  }
7657
6963
  ),
7658
- /* @__PURE__ */ jsxRuntime.jsxs(CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
6964
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
7659
6965
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CloudIcon, { className: "size-4 shrink-0 text-sky-500" }),
7660
6966
  "Add from OneDrive"
7661
6967
  ] }),
7662
- /* @__PURE__ */ jsxRuntime.jsxs(CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
6968
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
7663
6969
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HardDriveIcon, { className: "size-4 shrink-0 text-emerald-500" }),
7664
6970
  "Add from Google Drive"
7665
6971
  ] })
7666
6972
  ] }),
7667
- canPickProfile && /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { heading: "Browser profile", children: browserProfileLocked ? (
6973
+ canPickProfile && /* @__PURE__ */ jsxRuntime.jsx(command.CommandGroup, { heading: "Browser profile", children: browserProfileLocked ? (
7668
6974
  // A profile is bound at session creation and cannot
7669
6975
  // change mid-session. In a menu there is nothing to
7670
6976
  // hover, so the reason is stated outright rather
7671
6977
  // than hidden in a tooltip as it was on the button.
7672
6978
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7673
6979
  /* @__PURE__ */ jsxRuntime.jsxs(
7674
- CommandItem,
6980
+ command.CommandItem,
7675
6981
  {
7676
6982
  disabled: true,
7677
6983
  "data-checked": !!browserProfileId || void 0,
@@ -7691,7 +6997,7 @@ function ChatComposerInner({
7691
6997
  { id: null, name: "No profile" },
7692
6998
  ...browserProfiles ?? []
7693
6999
  ].map((p) => /* @__PURE__ */ jsxRuntime.jsxs(
7694
- CommandItem,
7000
+ command.CommandItem,
7695
7001
  {
7696
7002
  onSelect: () => {
7697
7003
  setAddMenuOpen(false);
@@ -7761,7 +7067,7 @@ function ChatComposerInner({
7761
7067
  outputTokenDetails: void 0
7762
7068
  },
7763
7069
  children: /* @__PURE__ */ jsxRuntime.jsxs(
7764
- ResponsivePanel,
7070
+ responsivePanel.ResponsivePanel,
7765
7071
  {
7766
7072
  open: contextOpen,
7767
7073
  onOpenChange: setContextOpen,
@@ -7933,9 +7239,6 @@ function Logo({ row }) {
7933
7239
  }
7934
7240
  );
7935
7241
  }
7936
-
7937
- // src/components/research/research-sources-panel.tsx
7938
- init_utils();
7939
7242
  function ResearchSourcesPanel({
7940
7243
  sources
7941
7244
  }) {
@@ -7955,50 +7258,36 @@ function ResearchSourcesPanel({
7955
7258
  }, []);
7956
7259
  if (sources.length === 0) return null;
7957
7260
  return /* @__PURE__ */ jsxRuntime.jsxs(
7958
- "div",
7261
+ collapsible.Collapsible,
7959
7262
  {
7960
7263
  ref: rootRef,
7961
- className: "rounded-md border border-line bg-card",
7264
+ open: expanded,
7265
+ onOpenChange: setExpanded,
7266
+ className: "rounded-[10px] border border-foreground/[0.08] bg-card",
7962
7267
  children: [
7963
- /* @__PURE__ */ jsxRuntime.jsxs(
7964
- "button",
7965
- {
7966
- type: "button",
7967
- onClick: () => setExpanded((prev) => !prev),
7968
- "aria-expanded": expanded,
7969
- className: "flex w-full items-center gap-1.5 px-2 py-1.5 text-left hover:bg-muted/40",
7970
- children: [
7971
- /* @__PURE__ */ jsxRuntime.jsx(
7972
- lucideReact.ChevronRightIcon,
7973
- {
7974
- className: cn(
7975
- "size-3 shrink-0 text-muted-foreground transition-transform duration-150",
7976
- expanded && "rotate-90"
7977
- )
7978
- }
7979
- ),
7980
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold uppercase tracking-widest text-muted-foreground", children: [
7981
- "Sources \xB7 ",
7982
- sources.length
7983
- ] })
7984
- ]
7985
- }
7986
- ),
7987
- expanded && /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "max-h-35 overflow-y-auto border-t border-line py-1", children: sources.map((s) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
7988
- "a",
7268
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { variant: "section", size: "sm", children: [
7269
+ "Sources \xB7 ",
7270
+ sources.length
7271
+ ] }),
7272
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "max-h-35 overflow-y-auto border-t border-foreground/[0.08] p-1", children: sources.map((s) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
7273
+ listRow.ListRow,
7989
7274
  {
7990
- id: `source-${s.sourceId}`,
7991
- href: s.url,
7992
- target: "_blank",
7993
- rel: "noreferrer",
7994
- className: "group flex items-baseline gap-2 px-2 py-1 hover:bg-muted/60",
7995
- children: [
7996
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[10px] font-semibold text-primary tabular-nums", children: s.sourceId }),
7997
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-foreground group-hover:underline", children: s.title || s.url }),
7998
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto shrink-0 truncate text-[10px] text-muted-foreground max-w-[40%]", children: hostname2(s.url) })
7999
- ]
7275
+ asChild: true,
7276
+ size: "sm",
7277
+ label: s.title || s.url,
7278
+ meta: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block max-w-40 truncate", children: hostname2(s.url) }),
7279
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7280
+ "a",
7281
+ {
7282
+ id: `source-${s.sourceId}`,
7283
+ href: s.url,
7284
+ target: "_blank",
7285
+ rel: "noreferrer",
7286
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[12px] font-medium text-amber-500 tabular-nums", children: s.sourceId })
7287
+ }
7288
+ )
8000
7289
  }
8001
- ) }, s.sourceId)) })
7290
+ ) }, s.sourceId)) }) })
8002
7291
  ]
8003
7292
  }
8004
7293
  );
@@ -8524,24 +7813,26 @@ function ArtifactHtml({
8524
7813
  ),
8525
7814
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8526
7815
  spec.caption ? /* @__PURE__ */ jsxRuntime.jsx("span", { children: spec.caption }) : /* @__PURE__ */ jsxRuntime.jsx("span", {}),
8527
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 ", children: [
7816
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
8528
7817
  /* @__PURE__ */ jsxRuntime.jsx(
8529
- "button",
7818
+ button.Button,
8530
7819
  {
8531
- type: "button",
7820
+ variant: "ghost",
7821
+ size: "icon-xs",
8532
7822
  onClick: () => setZoom((z) => clamp4(z - ZOOM_STEP)),
8533
7823
  disabled: zoom <= MIN_ZOOM,
8534
- className: "hover:text-foreground disabled:opacity-40 cursor-pointer",
7824
+ className: "text-muted-foreground hover:text-foreground",
8535
7825
  "aria-label": "zoom out",
8536
- children: "\u2212"
7826
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, {})
8537
7827
  }
8538
7828
  ),
8539
7829
  /* @__PURE__ */ jsxRuntime.jsxs(
8540
- "button",
7830
+ button.Button,
8541
7831
  {
8542
- type: "button",
7832
+ variant: "ghost",
7833
+ size: "xs",
8543
7834
  onClick: () => setZoom(1),
8544
- className: "tabular-nums hover:text-foreground",
7835
+ className: "font-normal tabular-nums text-muted-foreground hover:text-foreground",
8545
7836
  "aria-label": "reset zoom",
8546
7837
  children: [
8547
7838
  Math.round(zoom * 100),
@@ -8550,25 +7841,27 @@ function ArtifactHtml({
8550
7841
  }
8551
7842
  ),
8552
7843
  /* @__PURE__ */ jsxRuntime.jsx(
8553
- "button",
7844
+ button.Button,
8554
7845
  {
8555
- type: "button",
7846
+ variant: "ghost",
7847
+ size: "icon-xs",
8556
7848
  onClick: () => setZoom((z) => clamp4(z + ZOOM_STEP)),
8557
7849
  disabled: zoom >= MAX_ZOOM,
8558
- className: "hover:text-foreground disabled:opacity-40",
7850
+ className: "text-muted-foreground hover:text-foreground",
8559
7851
  "aria-label": "zoom in",
8560
- children: "+"
7852
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, {})
8561
7853
  }
8562
7854
  ),
8563
7855
  !fill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8564
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "|" }),
7856
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "h-4 w-px bg-border" }),
8565
7857
  /* @__PURE__ */ jsxRuntime.jsx(
8566
- "button",
7858
+ button.Button,
8567
7859
  {
8568
- type: "button",
7860
+ variant: "ghost",
7861
+ size: "xs",
8569
7862
  onClick: () => setExpanded((v) => !v),
8570
- className: "hover:text-foreground",
8571
- children: expanded ? "collapse" : "expand"
7863
+ className: "font-normal text-muted-foreground hover:text-foreground",
7864
+ children: expanded ? "Collapse" : "Expand"
8572
7865
  }
8573
7866
  )
8574
7867
  ] })
@@ -8960,61 +8253,50 @@ var ErrorMessage = react.memo(function ErrorMessage2({
8960
8253
  setRetryPending(false);
8961
8254
  }
8962
8255
  };
8963
- return /* @__PURE__ */ jsxRuntime.jsxs(
8964
- "div",
8965
- {
8966
- role: "alert",
8967
- className: cn(
8968
- "flex w-full gap-3 rounded-none border-l-4 border-destructive bg-destructive/5 p-4",
8969
- className
8970
- ),
8971
- children: [
8972
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "mt-0.5 size-4 shrink-0 text-destructive" }),
8973
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
8974
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-destructive", children: errorInfo.title }),
8975
- errorInfo.detail && /* @__PURE__ */ jsxRuntime.jsxs(
8976
- "button",
8977
- {
8978
- type: "button",
8979
- onClick: () => setDetailOpen((open) => !open),
8980
- className: "flex items-center gap-1 self-start text-xs text-muted-foreground hover:text-foreground",
8981
- "aria-expanded": detailOpen,
8982
- children: [
8983
- detailOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-3" }),
8984
- detailOpen ? "Hide details" : "Show details"
8985
- ]
8986
- }
8987
- ),
8988
- detailOpen && errorInfo.detail && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "overflow-x-auto rounded-none border border-destructive/20 bg-background p-2 font-mono text-xs whitespace-pre-wrap wrap-break-word text-muted-foreground", children: errorInfo.detail }),
8989
- (showRetry || onDismiss) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 pt-1", children: [
8990
- showRetry && /* @__PURE__ */ jsxRuntime.jsxs(
8991
- button.Button,
8992
- {
8993
- size: "xs",
8994
- variant: "secondary",
8995
- onClick: handleRetry,
8996
- disabled: retryPending,
8997
- children: [
8998
- /* @__PURE__ */ jsxRuntime.jsx(
8999
- lucideReact.RefreshCw,
9000
- {
9001
- className: cn("size-3", retryPending && "animate-spin")
9002
- }
9003
- ),
9004
- retryPending ? "Retrying\u2026" : "Retry"
9005
- ]
9006
- }
9007
- ),
9008
- onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "xs", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
9009
- ] }),
9010
- retryError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-1 text-xs text-destructive", role: "status", children: [
9011
- "Retry failed: ",
9012
- retryError
9013
- ] })
9014
- ] })
9015
- ]
9016
- }
9017
- );
8256
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "destructive", className: cn("gap-y-2", className), children: [
8257
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}),
8258
+ /* @__PURE__ */ jsxRuntime.jsx(alert.AlertTitle, { children: errorInfo.title }),
8259
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertDescription, { className: "flex min-w-0 flex-col items-start gap-2", children: [
8260
+ errorInfo.detail && /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { variant: "muted", size: "sm", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8261
+ "button",
8262
+ {
8263
+ type: "button",
8264
+ onClick: () => setDetailOpen((open) => !open),
8265
+ "aria-expanded": detailOpen,
8266
+ children: [
8267
+ detailOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {}),
8268
+ detailOpen ? "Hide details" : "Show details"
8269
+ ]
8270
+ }
8271
+ ) }),
8272
+ detailOpen && errorInfo.detail && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "w-full overflow-x-auto rounded-[6px] border border-destructive/20 bg-background p-2 font-mono text-xs whitespace-pre-wrap wrap-break-word text-muted-foreground", children: errorInfo.detail }),
8273
+ (showRetry || onDismiss) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 pt-1", children: [
8274
+ showRetry && /* @__PURE__ */ jsxRuntime.jsxs(
8275
+ button.Button,
8276
+ {
8277
+ size: "xs",
8278
+ variant: "secondary",
8279
+ onClick: handleRetry,
8280
+ disabled: retryPending,
8281
+ children: [
8282
+ /* @__PURE__ */ jsxRuntime.jsx(
8283
+ lucideReact.RefreshCw,
8284
+ {
8285
+ className: cn("size-3", retryPending && "animate-spin")
8286
+ }
8287
+ ),
8288
+ retryPending ? "Retrying\u2026" : "Retry"
8289
+ ]
8290
+ }
8291
+ ),
8292
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "xs", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
8293
+ ] }),
8294
+ retryError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-1 text-xs text-destructive", role: "status", children: [
8295
+ "Retry failed: ",
8296
+ retryError
8297
+ ] })
8298
+ ] })
8299
+ ] });
9018
8300
  });
9019
8301
  function parseRequestedTokens(detail) {
9020
8302
  const m = detail.match(/["']?requested["']?\s*[:=]\s*(\d+)/);
@@ -9027,34 +8309,24 @@ var InsufficientCreditsCard = react.memo(function InsufficientCreditsCard2({
9027
8309
  }) {
9028
8310
  const { onOpenBilling } = useAgentChatAdapterContext();
9029
8311
  const requested = parseRequestedTokens(detail);
9030
- return /* @__PURE__ */ jsxRuntime.jsxs(
9031
- "div",
9032
- {
9033
- role: "alert",
9034
- className: cn(
9035
- "flex w-full gap-3 rounded-md border border-amber-500/30 bg-amber-500/5 p-4",
9036
- className
9037
- ),
9038
- children: [
9039
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "mt-0.5 size-5 shrink-0 text-amber-600 dark:text-amber-400" }),
9040
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
9041
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-foreground", children: "You're out of credits" }),
9042
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-muted-foreground", children: [
9043
- "This run was blocked by the token-credit limit",
9044
- requested ? ` (it needed ~${requested.toLocaleString()} tokens)` : "",
9045
- ". Buy additional credits or upgrade your plan to keep your agents running."
9046
- ] }),
9047
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 pt-1", children: [
9048
- onOpenBilling && /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", onClick: onOpenBilling, children: [
9049
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "size-4" }),
9050
- "Go to Billing"
9051
- ] }),
9052
- onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "sm", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
9053
- ] })
9054
- ] })
9055
- ]
9056
- }
9057
- );
8312
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "warning", className: cn("gap-y-2", className), children: [
8313
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, {}),
8314
+ /* @__PURE__ */ jsxRuntime.jsx(alert.AlertTitle, { children: "You're out of credits" }),
8315
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertDescription, { className: "flex flex-col items-start gap-2", children: [
8316
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
8317
+ "This run was blocked by the token-credit limit",
8318
+ requested ? ` (it needed ~${requested.toLocaleString()} tokens)` : "",
8319
+ ". Buy additional credits or upgrade your plan to keep your agents running."
8320
+ ] }),
8321
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 pt-1", children: [
8322
+ onOpenBilling && /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", onClick: onOpenBilling, children: [
8323
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "size-4" }),
8324
+ "Go to Billing"
8325
+ ] }),
8326
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "sm", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
8327
+ ] })
8328
+ ] })
8329
+ ] });
9058
8330
  });
9059
8331
  init_utils();
9060
8332
  var DOCUMENT = { icon: lucideReact.FileTextIcon, kind: "Document" };
@@ -9364,15 +8636,7 @@ function WorkerCard({ worker }) {
9364
8636
  return (
9365
8637
  // A long name is cut, its mark never.
9366
8638
  /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex min-w-0 max-w-full", title: file.label, children: [
9367
- file.kind === "file" && onFileSelect ? /* @__PURE__ */ jsxRuntime.jsx(
9368
- "button",
9369
- {
9370
- type: "button",
9371
- className: "min-w-0 truncate underline",
9372
- onClick: () => onFileSelect(file.ref),
9373
- children: /* @__PURE__ */ jsxRuntime.jsx("bdi", { children: file.label })
9374
- }
9375
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: /* @__PURE__ */ jsxRuntime.jsx("bdi", { children: file.label }) }),
8639
+ file.kind === "file" && onFileSelect ? /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { variant: "muted", size: "inline", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "min-w-0 truncate", onClick: () => onFileSelect(file.ref), children: /* @__PURE__ */ jsxRuntime.jsx("bdi", { children: file.label }) }) }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: /* @__PURE__ */ jsxRuntime.jsx("bdi", { children: file.label }) }),
9376
8640
  mark && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-mark": landing, className: "shrink-0 whitespace-pre text-muted-foreground", children: ` \xB7 ${mark}` })
9377
8641
  ] }, `${file.kind}:${file.ref}`)
9378
8642
  );
@@ -9867,17 +9131,17 @@ function TimelineEntryItem({
9867
9131
  const hideArtifactFailure = rawStatus === "error" && entry.tc.toolName === "create_artifact";
9868
9132
  const indicatorStatus = hideArtifactFailure ? "running" : rawStatus;
9869
9133
  const failureSummary = rawStatus === "error" && !hideArtifactFailure ? toolErrorSummary(entry.tc.result) : "";
9870
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9871
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9872
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9134
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9135
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9136
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9873
9137
  /* @__PURE__ */ jsxRuntime.jsx(
9874
- TimelineIndicator,
9138
+ timeline.TimelineIndicator,
9875
9139
  {
9876
9140
  className: cn("size-2 border-none", statusColorClass(indicatorStatus))
9877
9141
  }
9878
9142
  )
9879
9143
  ] }),
9880
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: entry.tc.cancelled ? /* @__PURE__ */ jsxRuntime.jsx(CancelledToolRow, { tc: entry.tc }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
9144
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: entry.tc.cancelled ? /* @__PURE__ */ jsxRuntime.jsx(CancelledToolRow, { tc: entry.tc }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
9881
9145
  /* @__PURE__ */ jsxRuntime.jsx(
9882
9146
  ToolCallBlock,
9883
9147
  {
@@ -9893,24 +9157,24 @@ function TimelineEntryItem({
9893
9157
  ] });
9894
9158
  }
9895
9159
  if (entry.kind === "browser_activity") {
9896
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9897
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9898
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9899
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-amber-500" })
9160
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9161
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9162
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9163
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-amber-500" })
9900
9164
  ] }),
9901
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(BrowserActivityGroup, { calls: entry.calls }) })
9165
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(BrowserActivityGroup, { calls: entry.calls }) })
9902
9166
  ] });
9903
9167
  }
9904
9168
  if (entry.kind === "web_search_group") {
9905
9169
  const allComplete = entry.calls.every((tc) => tc.status === "complete");
9906
9170
  const anyRunning = entry.calls.some((tc) => tc.status === "running");
9907
9171
  const indicatorClass = anyRunning ? "bg-emerald-500 animate-pulse" : allComplete ? "bg-emerald-500" : "bg-red-500";
9908
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9909
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9910
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9911
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: cn("size-2 border-none", indicatorClass) })
9172
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9173
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9174
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9175
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: cn("size-2 border-none", indicatorClass) })
9912
9176
  ] }),
9913
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(WebSearchGroupBlock, { tcs: entry.calls }) })
9177
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(WebSearchGroupBlock, { tcs: entry.calls }) })
9914
9178
  ] });
9915
9179
  }
9916
9180
  if (entry.kind === "text") {
@@ -9920,11 +9184,11 @@ function TimelineEntryItem({
9920
9184
  return /* @__PURE__ */ jsxRuntime.jsx(NarrationEntry, { entry, step });
9921
9185
  }
9922
9186
  if (entry.kind === "browser_marker") {
9923
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9924
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9925
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9187
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9188
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9189
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9926
9190
  /* @__PURE__ */ jsxRuntime.jsx(
9927
- TimelineIndicator,
9191
+ timeline.TimelineIndicator,
9928
9192
  {
9929
9193
  className: cn(
9930
9194
  "size-2 border-none",
@@ -9933,7 +9197,7 @@ function TimelineEntryItem({
9933
9197
  }
9934
9198
  )
9935
9199
  ] }),
9936
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9200
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9937
9201
  "div",
9938
9202
  {
9939
9203
  className: cn(
@@ -9950,21 +9214,21 @@ function TimelineEntryItem({
9950
9214
  ] });
9951
9215
  }
9952
9216
  if (entry.kind === "thread_card") {
9953
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9954
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9955
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9956
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
9217
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9218
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9219
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9220
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
9957
9221
  ] }),
9958
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ThreadCards, { message: entry.message }) })
9222
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ThreadCards, { message: entry.message }) })
9959
9223
  ] });
9960
9224
  }
9961
9225
  if (entry.kind === "skill_invoked") {
9962
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9963
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9964
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9965
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-emerald-500" })
9226
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9227
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9228
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9229
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-emerald-500" })
9966
9230
  ] }),
9967
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 py-1 text-sm ", children: [
9231
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 py-1 text-sm ", children: [
9968
9232
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: "Skill" }),
9969
9233
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground/60 truncate", children: entry.skill }),
9970
9234
  entry.stagedAt && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground/60/70 ", children: [
@@ -9975,12 +9239,12 @@ function TimelineEntryItem({
9975
9239
  ] });
9976
9240
  }
9977
9241
  if (entry.kind === "artifact") {
9978
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9979
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9980
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9981
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-sky-500" })
9242
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9243
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9244
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9245
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-sky-500" })
9982
9246
  ] }),
9983
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: sessionId ? /* @__PURE__ */ jsxRuntime.jsx(
9247
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: sessionId ? /* @__PURE__ */ jsxRuntime.jsx(
9984
9248
  ArtifactBlock,
9985
9249
  {
9986
9250
  sessionId: entry.originatingSessionId ?? sessionId,
@@ -9992,12 +9256,12 @@ function TimelineEntryItem({
9992
9256
  ) : null })
9993
9257
  ] });
9994
9258
  }
9995
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
9996
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
9997
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9998
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-primary" })
9259
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9260
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9261
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9262
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-primary" })
9999
9263
  ] }),
10000
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
9264
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
10001
9265
  ] });
10002
9266
  }
10003
9267
  function ReasoningEntry({
@@ -10005,12 +9269,12 @@ function ReasoningEntry({
10005
9269
  step
10006
9270
  }) {
10007
9271
  const reasoning = useSmoothStream(entry.reasoning, entry.isStreaming);
10008
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
10009
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
10010
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
10011
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2" })
9272
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9273
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9274
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9275
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2" })
10012
9276
  ] }),
10013
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(Reasoning, { isStreaming: entry.isStreaming, children: [
9277
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(Reasoning, { isStreaming: entry.isStreaming, children: [
10014
9278
  /* @__PURE__ */ jsxRuntime.jsx(ReasoningTrigger, {}),
10015
9279
  /* @__PURE__ */ jsxRuntime.jsx(ReasoningContent, { children: reasoning })
10016
9280
  ] }) })
@@ -10024,12 +9288,12 @@ function NarrationEntry({
10024
9288
  const { action, inferredNarration } = stripAndParseNextAction(text);
10025
9289
  const line = action ? action.body.trim().toLowerCase() === "done" ? null : action.body : inferredNarration;
10026
9290
  if (!line) return null;
10027
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
10028
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
10029
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
10030
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
9291
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9292
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9293
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9294
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
10031
9295
  ] }),
10032
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: renderInlineMarkdown(line) }) })
9296
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: renderInlineMarkdown(line) }) })
10033
9297
  ] });
10034
9298
  }
10035
9299
  function TextEntry({
@@ -10038,12 +9302,12 @@ function TextEntry({
10038
9302
  }) {
10039
9303
  const content = useSmoothStream(entry.content, entry.isStreaming);
10040
9304
  const { cleaned } = stripAndParseNextAction(content);
10041
- return /* @__PURE__ */ jsxRuntime.jsxs(TimelineItem, { step, children: [
10042
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineHeader, { children: [
10043
- /* @__PURE__ */ jsxRuntime.jsx(TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
10044
- /* @__PURE__ */ jsxRuntime.jsx(TimelineIndicator, { className: "size-2 border-none bg-foreground/40" })
9305
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9306
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9307
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9308
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/40" })
10045
9309
  ] }),
10046
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineContent, { children: [
9310
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineContent, { children: [
10047
9311
  /* @__PURE__ */ jsxRuntime.jsx(LoopResultAffordance, { message: entry.msg }),
10048
9312
  /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: cleaned }),
10049
9313
  entry.isFinalTurnText && entry.msg.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: entry.msg })
@@ -10223,7 +9487,7 @@ function useElapsedSeconds(since) {
10223
9487
  function formatElapsed(seconds) {
10224
9488
  return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
10225
9489
  }
10226
- function CommandGroup2({ commands, live }) {
9490
+ function CommandGroup3({ commands, live }) {
10227
9491
  const [chosen, setChosen] = react.useState(null);
10228
9492
  const open = chosen ?? live !== void 0;
10229
9493
  const elapsed = useElapsedSeconds(live ? (commands[0]?.message ?? live).createdAt : void 0);
@@ -10311,7 +9575,7 @@ function IterationGroup({
10311
9575
  return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-0.5 text-sm text-muted-foreground", children: reasoningTokenLabel(message, false) });
10312
9576
  }
10313
9577
  const commands = iterationCommands(message);
10314
- return commands.length === 1 ? /* @__PURE__ */ jsxRuntime.jsx(CommandRow, { label: commands[0].label, calls: commands[0].calls }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup2, { commands });
9578
+ return commands.length === 1 ? /* @__PURE__ */ jsxRuntime.jsx(CommandRow, { label: commands[0].label, calls: commands[0].calls }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands });
10315
9579
  }
10316
9580
  function deriveFileArtifactsFromMessages(messages) {
10317
9581
  const terminalCommands = [];
@@ -10386,10 +9650,10 @@ function SimpleAssistantGroup({
10386
9650
  const endRun = (live) => {
10387
9651
  const key = (run[0]?.message ?? live)?.id;
10388
9652
  if (live && (run.length > 0 || liveCommands(live).length > 0)) {
10389
- rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup2, { commands: run, live }, key));
9653
+ rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands: run, live }, key));
10390
9654
  } else {
10391
9655
  if (run.length > 1) {
10392
- rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup2, { commands: run }, key));
9656
+ rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands: run }, key));
10393
9657
  } else if (run.length === 1) {
10394
9658
  rows.push(
10395
9659
  /* @__PURE__ */ jsxRuntime.jsx(CommandRow, { label: run[0].label, calls: run[0].calls }, run[0].key)
@@ -10521,7 +9785,7 @@ function AssistantGroup({
10521
9785
  const tail = messages[messages.length - 1];
10522
9786
  const showErrorInfo = tail && tail.role === "assistant" && tail.status === "error" && !!tail.errorInfo;
10523
9787
  return /* @__PURE__ */ jsxRuntime.jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsxRuntime.jsxs(MessageContent, { children: [
10524
- /* @__PURE__ */ jsxRuntime.jsx(Timeline, { defaultValue: 999, className: "gap-0", children: entries.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsx(
9788
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.Timeline, { defaultValue: 999, className: "gap-0", children: entries.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsx(
10525
9789
  TimelineEntryItem,
10526
9790
  {
10527
9791
  entry,
@@ -10536,34 +9800,30 @@ function AssistantGroup({
10536
9800
  }
10537
9801
  function RetryBanner({ indicator }) {
10538
9802
  const [open, setOpen] = react.useState(false);
10539
- return /* @__PURE__ */ jsxRuntime.jsxs(
10540
- "div",
10541
- {
10542
- role: "status",
10543
- className: "flex flex-col gap-1 border-l-2 border-amber-500 bg-amber-500/5 px-3 py-2 text-xs",
10544
- children: [
10545
- /* @__PURE__ */ jsxRuntime.jsxs(
10546
- "button",
10547
- {
10548
- type: "button",
10549
- onClick: () => setOpen((prev) => !prev),
10550
- className: "flex items-center gap-2 text-left text-amber-600 hover:text-amber-700",
10551
- "aria-expanded": open,
10552
- children: [
10553
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3 shrink-0" }),
10554
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate font-medium", children: indicator.title }),
10555
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-foreground/60", children: [
10556
- "attempt ",
10557
- indicator.attempt
10558
- ] }),
10559
- indicator.detail && (open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "size-3" }))
10560
- ]
10561
- }
10562
- ),
10563
- open && indicator.detail && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 overflow-x-auto rounded-none bg-background p-2 font-mono text-[11px] whitespace-pre-wrap wrap-break-word text-foreground/60", children: indicator.detail })
10564
- ]
10565
- }
10566
- );
9803
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "warning", role: "status", children: [
9804
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}),
9805
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertTitle, { className: "flex min-w-0 items-center gap-2 font-medium", children: [
9806
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: indicator.title }),
9807
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "shrink-0 text-[11.5px] font-normal opacity-70", children: [
9808
+ "attempt ",
9809
+ indicator.attempt
9810
+ ] })
9811
+ ] }),
9812
+ indicator.detail && /* @__PURE__ */ jsxRuntime.jsx(alert.AlertAction, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9813
+ button.Button,
9814
+ {
9815
+ variant: "ghost",
9816
+ size: "xs",
9817
+ onClick: () => setOpen((prev) => !prev),
9818
+ "aria-expanded": open,
9819
+ children: [
9820
+ open ? "Hide details" : "Details",
9821
+ open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
9822
+ ]
9823
+ }
9824
+ ) }),
9825
+ open && indicator.detail && /* @__PURE__ */ jsxRuntime.jsx(alert.AlertDescription, { children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 overflow-x-auto rounded-[6px] bg-background p-2 font-mono text-[11px] whitespace-pre-wrap wrap-break-word text-foreground/60", children: indicator.detail }) })
9826
+ ] });
10567
9827
  }
10568
9828
  function WorkingOnItIndicator({ activity }) {
10569
9829
  return /* @__PURE__ */ jsxRuntime.jsx(Message, { from: "assistant", children: /* @__PURE__ */ jsxRuntime.jsx(MessageContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: activity.state, label: activity.label }) }) });
@@ -13842,26 +13102,6 @@ function mapSelected(doc, edit) {
13842
13102
  objects: doc.objects.map((o) => o.selected ? edit(o) : o)
13843
13103
  };
13844
13104
  }
13845
- var RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
13846
- var RABBIT_MARK_BOX = {
13847
- x: 14.4021,
13848
- y: 11.93,
13849
- h: 109.058
13850
- };
13851
- function RabbitMark({ className }) {
13852
- return /* @__PURE__ */ jsxRuntime.jsx(
13853
- "svg",
13854
- {
13855
- className,
13856
- viewBox: "14.4021 11.93 95.1813 109.058",
13857
- fill: "currentColor",
13858
- "aria-hidden": "true",
13859
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: RABBIT_MARK_PATH })
13860
- }
13861
- );
13862
- }
13863
-
13864
- // src/components/whiteboard/render.ts
13865
13105
  var TEXT_GLYPH_ADVANCE = 0.6;
13866
13106
  var AGENT_COLOR = "#2563eb";
13867
13107
  var TEXT_COLOR = "#111827";
@@ -14074,7 +13314,7 @@ function paintArtifactFrame(ctx, obj) {
14074
13314
  var rabbit;
14075
13315
  function rabbitPath() {
14076
13316
  if (rabbit === void 0) {
14077
- rabbit = typeof Path2D === "undefined" ? null : new Path2D(RABBIT_MARK_PATH);
13317
+ rabbit = typeof Path2D === "undefined" ? null : new Path2D(rabbitMark.RABBIT_MARK_PATH);
14078
13318
  }
14079
13319
  return rabbit;
14080
13320
  }
@@ -14089,11 +13329,11 @@ function paintSlot(ctx, obj) {
14089
13329
  const glyph = Math.max(12, Math.min(obj.h * 0.5, obj.w * 0.3, 40));
14090
13330
  const mark = rabbitPath();
14091
13331
  if (mark) {
14092
- const scale = glyph / RABBIT_MARK_BOX.h;
13332
+ const scale = glyph / rabbitMark.RABBIT_MARK_BOX.h;
14093
13333
  ctx.save();
14094
13334
  ctx.translate(
14095
- obj.x + glyph * 0.3 - RABBIT_MARK_BOX.x * scale,
14096
- obj.y + (obj.h - glyph) / 2 - RABBIT_MARK_BOX.y * scale
13335
+ obj.x + glyph * 0.3 - rabbitMark.RABBIT_MARK_BOX.x * scale,
13336
+ obj.y + (obj.h - glyph) / 2 - rabbitMark.RABBIT_MARK_BOX.y * scale
14097
13337
  );
14098
13338
  ctx.scale(scale, scale);
14099
13339
  ctx.fillStyle = "rgba(180, 83, 9, 0.9)";
@@ -15341,9 +14581,6 @@ async function latestBoardSession(adapter, agentId) {
15341
14581
  return null;
15342
14582
  }
15343
14583
  }
15344
-
15345
- // src/components/whiteboard/tool-rail.tsx
15346
- init_utils();
15347
14584
  var INK_COLORS = [
15348
14585
  "#111827",
15349
14586
  "#2563eb",
@@ -15358,7 +14595,7 @@ var TOOLS = [
15358
14595
  { id: "text", label: "Text", Icon: lucideReact.Type },
15359
14596
  // Where the agent should answer: click to place an answer box, or
15360
14597
  // drag one. The id stays "slot" -- that is what the object is.
15361
- { id: "slot", label: "Answer box", Icon: RabbitMark },
14598
+ { id: "slot", label: "Answer box", Icon: rabbitMark.RabbitMark },
15362
14599
  { id: "select", label: "Select", Icon: lucideReact.MousePointer2 },
15363
14600
  { id: "pan", label: "Pan", Icon: lucideReact.Hand }
15364
14601
  ];
@@ -15379,66 +14616,66 @@ function ToolRail({
15379
14616
  return /* @__PURE__ */ jsxRuntime.jsxs(
15380
14617
  "div",
15381
14618
  {
15382
- className: "flex flex-col gap-1 rounded-lg border bg-background p-1",
14619
+ className: "flex flex-col items-center gap-1 rounded-lg border bg-background p-1",
15383
14620
  role: "toolbar",
15384
14621
  "aria-label": "Whiteboard tools",
15385
14622
  "aria-orientation": "vertical",
15386
14623
  children: [
15387
- TOOLS.map(({ id, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(
15388
- button.Button,
14624
+ /* @__PURE__ */ jsxRuntime.jsx(
14625
+ toggleGroup.ToggleGroup,
15389
14626
  {
15390
- type: "button",
15391
- size: "icon",
15392
- variant: tool === id ? "default" : "ghost",
15393
- "aria-label": label,
15394
- "aria-pressed": tool === id,
14627
+ type: "single",
14628
+ orientation: "vertical",
14629
+ "aria-label": "Tool",
14630
+ value: tool,
14631
+ onValueChange: (next) => {
14632
+ if (next) onToolChange(next);
14633
+ },
15395
14634
  disabled,
15396
- onClick: () => onToolChange(id),
15397
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" })
15398
- },
15399
- id
15400
- )),
15401
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
15402
- INK_COLORS.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
15403
- "button",
14635
+ children: TOOLS.map(({ id, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: id, "aria-label": label, size: "icon", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }) }, id))
14636
+ }
14637
+ ),
14638
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
14639
+ /* @__PURE__ */ jsxRuntime.jsx(
14640
+ toggleGroup.ToggleGroup,
15404
14641
  {
15405
- type: "button",
15406
- "aria-label": `Colour ${c}`,
15407
- "aria-pressed": color === c,
14642
+ type: "single",
14643
+ variant: "outline",
14644
+ size: "sm",
14645
+ orientation: "vertical",
14646
+ "aria-label": "Colour",
14647
+ value: color,
14648
+ onValueChange: (next) => {
14649
+ if (next) onColorChange(next);
14650
+ },
15408
14651
  disabled,
15409
- onClick: () => onColorChange(c),
15410
- className: cn(
15411
- "mx-auto size-5 rounded-full border-2",
15412
- color === c ? "border-foreground" : "border-transparent"
15413
- ),
15414
- style: { backgroundColor: c }
15415
- },
15416
- c
15417
- )),
15418
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
15419
- INK_WIDTHS.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
15420
- "button",
14652
+ children: INK_COLORS.map((c) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: c, "aria-label": `Colour ${c}`, size: "icon-xs", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-5 rounded-full", style: { backgroundColor: c } }) }, c))
14653
+ }
14654
+ ),
14655
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
14656
+ /* @__PURE__ */ jsxRuntime.jsx(
14657
+ toggleGroup.ToggleGroup,
15421
14658
  {
15422
- type: "button",
15423
- "aria-label": `Width ${w}`,
15424
- "aria-pressed": width === w,
14659
+ type: "single",
14660
+ variant: "outline",
14661
+ size: "sm",
14662
+ orientation: "vertical",
14663
+ "aria-label": "Width",
14664
+ value: String(width),
14665
+ onValueChange: (next) => {
14666
+ if (next) onWidthChange(Number(next));
14667
+ },
15425
14668
  disabled,
15426
- onClick: () => onWidthChange(w),
15427
- className: cn(
15428
- "mx-auto flex size-6 items-center justify-center rounded",
15429
- width === w ? "bg-accent" : ""
15430
- ),
15431
- children: /* @__PURE__ */ jsxRuntime.jsx(
14669
+ children: INK_WIDTHS.map((w) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: String(w), "aria-label": `Width ${w}`, size: "icon-xs", children: /* @__PURE__ */ jsxRuntime.jsx(
15432
14670
  "span",
15433
14671
  {
15434
14672
  className: "rounded-full bg-foreground",
15435
14673
  style: { width: w + 2, height: w + 2 }
15436
14674
  }
15437
- )
15438
- },
15439
- w
15440
- )),
15441
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
14675
+ ) }, w))
14676
+ }
14677
+ ),
14678
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
15442
14679
  /* @__PURE__ */ jsxRuntime.jsx(
15443
14680
  button.Button,
15444
14681
  {
@@ -15492,6 +14729,13 @@ var VIEW_MODE_LABELS = {
15492
14729
  expert: "Advanced",
15493
14730
  whiteboard: "Whiteboard"
15494
14731
  };
14732
+ var VIEW_MODE_SEGMENTS2 = ["simple", "expert", "whiteboard"].map(
14733
+ (mode) => ({
14734
+ value: mode,
14735
+ label: VIEW_MODE_LABELS[mode],
14736
+ ariaLabel: `${VIEW_MODE_LABELS[mode]} view`
14737
+ })
14738
+ );
15495
14739
  function AgentWhiteboard(props) {
15496
14740
  const runtime = useAgentChatRuntime({
15497
14741
  adapter: props.adapter,
@@ -16317,7 +15561,7 @@ function WhiteboardSurface({
16317
15561
  }
16318
15562
  ),
16319
15563
  /* @__PURE__ */ jsxRuntime.jsxs(tooltip.TooltipProvider, { children: [
16320
- /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { "aria-label": "Actions", children: USER_ACTIONS.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
15564
+ /* @__PURE__ */ jsxRuntime.jsx(buttonGroup.ButtonGroup, { "aria-label": "Actions", children: USER_ACTIONS.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
16321
15565
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16322
15566
  button.Button,
16323
15567
  {
@@ -16362,21 +15606,15 @@ function WhiteboardSurface({
16362
15606
  children: "New board"
16363
15607
  }
16364
15608
  ) : null,
16365
- viewMode && onViewModeChange && hasAnswer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center rounded-full border p-0.5", children: ["simple", "expert", "whiteboard"].map((mode) => /* @__PURE__ */ jsxRuntime.jsx(
16366
- "button",
15609
+ viewMode && onViewModeChange && hasAnswer ? /* @__PURE__ */ jsxRuntime.jsx(
15610
+ segmentedControl.SegmentedControl,
16367
15611
  {
16368
- type: "button",
16369
- "aria-label": `${VIEW_MODE_LABELS[mode]} view`,
16370
- "aria-pressed": viewMode === mode,
16371
- className: cn(
16372
- "rounded-full px-3 py-1 text-xs",
16373
- viewMode === mode ? "bg-background font-medium shadow-sm" : "text-muted-foreground"
16374
- ),
16375
- onClick: () => onViewModeChange(mode),
16376
- children: VIEW_MODE_LABELS[mode]
16377
- },
16378
- mode
16379
- )) }) : null
15612
+ "aria-label": "View",
15613
+ segments: VIEW_MODE_SEGMENTS2,
15614
+ value: viewMode,
15615
+ onChange: onViewModeChange
15616
+ }
15617
+ ) : null
16380
15618
  ] })
16381
15619
  ] });
16382
15620
  }
@@ -16542,6 +15780,7 @@ function OfficeEditorPane({ adapter, sessionId, path, view, officeEvent, onClose
16542
15780
  const placeholderId = `office-editor-${react.useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
16543
15781
  const [error, setError] = react.useState(null);
16544
15782
  const [loading, setLoading] = react.useState(true);
15783
+ const [mentionTrouble, setMentionTrouble] = react.useState(null);
16545
15784
  const [openedAfter] = react.useState(() => officeEvent?.eventId ?? 0);
16546
15785
  const notice = officeEvent && officeEvent.eventId > openedAfter ? officeEvent : null;
16547
15786
  const [reopenedFor, setReopenedFor] = react.useState(0);
@@ -16558,6 +15797,7 @@ function OfficeEditorPane({ adapter, sessionId, path, view, officeEvent, onClose
16558
15797
  let editor = null;
16559
15798
  setError(null);
16560
15799
  setLoading(true);
15800
+ setMentionTrouble(null);
16561
15801
  void (async () => {
16562
15802
  try {
16563
15803
  if (!adapter.getWorkspaceEditorConfig) throw new Error("Preview not available. Download the file to open it.");
@@ -16565,7 +15805,31 @@ function OfficeEditorPane({ adapter, sessionId, path, view, officeEvent, onClose
16565
15805
  await loadDocsApi(opened.document_server_url);
16566
15806
  if (cancelled) return;
16567
15807
  if (!window.DocsAPI) throw new Error("The document editor could not be loaded.");
16568
- editor = new window.DocsAPI.DocEditor(placeholderId, opened.config);
15808
+ const users = opened.mentionable_users ?? [];
15809
+ const notify = adapter.notifyWorkspaceEditorMention?.bind(adapter);
15810
+ const events = users.length && notify ? {
15811
+ onRequestUsers: (event) => {
15812
+ const c = event.data?.c;
15813
+ editor?.setUsers({ c, users: c === "mention" || c === "info" ? users : [] });
15814
+ },
15815
+ onRequestSendNotify: (event) => {
15816
+ const mention = event.data ?? {};
15817
+ const emails = mention.emails ?? [];
15818
+ const named2 = new Set(emails.map((email) => email.toLowerCase()));
15819
+ if (!users.some((user) => named2.has(user.email.toLowerCase()))) return;
15820
+ setMentionTrouble(null);
15821
+ void notify({
15822
+ sessionId,
15823
+ path,
15824
+ emails,
15825
+ message: mention.message ?? "",
15826
+ commentId: String(mention.actionLink?.action?.data ?? mention.actionId ?? "")
15827
+ }).catch((sendError) => {
15828
+ if (!cancelled) setMentionTrouble(`The agent was not told about your comment: ${sendError.message}`);
15829
+ });
15830
+ }
15831
+ } : null;
15832
+ editor = new window.DocsAPI.DocEditor(placeholderId, events ? { ...opened.config, events } : opened.config);
16569
15833
  } catch (openError) {
16570
15834
  if (!cancelled) setError(openError.message);
16571
15835
  } finally {
@@ -16617,6 +15881,7 @@ function OfficeEditorPane({ adapter, sessionId, path, view, officeEvent, onClose
16617
15881
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
16618
15882
  ] }),
16619
15883
  notice && saveNotice(notice) && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "status", className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: saveNotice(notice) }),
15884
+ mentionTrouble && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "status", className: "border-b border-line px-3 py-2 text-xs text-muted-foreground", children: mentionTrouble }),
16620
15885
  loading && !error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 text-sm text-muted-foreground", children: [
16621
15886
  "Opening ",
16622
15887
  fileName2,
@@ -16767,46 +16032,37 @@ function FileTreeFolder({
16767
16032
  onSelect?.(path);
16768
16033
  }, [onSelect, path]);
16769
16034
  return /* @__PURE__ */ jsxRuntime.jsx(collapsible.Collapsible, { onOpenChange: handleOpenChange, open: isExpanded, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("", className), role: "treeitem", tabIndex: 0, ...props, children: [
16770
- /* @__PURE__ */ jsxRuntime.jsxs(
16771
- "div",
16772
- {
16773
- className: cn(
16774
- "flex h-9 w-full items-center gap-2 rounded-lg px-2 text-left transition-colors hover:bg-accent",
16775
- isSelected && "bg-accent"
16776
- ),
16777
- children: [
16778
- /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16779
- "button",
16035
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: listRow.listRowVariants({ size: "sm", active: isSelected }), children: [
16036
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16037
+ "button",
16038
+ {
16039
+ className: "flex shrink-0 cursor-pointer items-center border-none bg-transparent p-0",
16040
+ type: "button",
16041
+ "aria-label": isExpanded ? `Collapse ${name}` : `Expand ${name}`,
16042
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16043
+ lucideReact.ChevronRightIcon,
16780
16044
  {
16781
- className: "flex shrink-0 cursor-pointer items-center border-none bg-transparent p-0",
16782
- type: "button",
16783
- "aria-label": isExpanded ? `Collapse ${name}` : `Expand ${name}`,
16784
- children: /* @__PURE__ */ jsxRuntime.jsx(
16785
- lucideReact.ChevronRightIcon,
16786
- {
16787
- className: cn(
16788
- "size-4 shrink-0 text-muted-foreground transition-transform",
16789
- isExpanded && "rotate-90"
16790
- )
16791
- }
16045
+ className: cn(
16046
+ "size-4 shrink-0 text-muted-foreground transition-transform",
16047
+ isExpanded && "rotate-90"
16792
16048
  )
16793
16049
  }
16794
- ) }),
16795
- /* @__PURE__ */ jsxRuntime.jsxs(
16796
- "button",
16797
- {
16798
- className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",
16799
- onClick: handleSelect,
16800
- type: "button",
16801
- children: [
16802
- /* @__PURE__ */ jsxRuntime.jsx(FileTreeIcon, { children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpenIcon, { className: "size-4.5 text-muted-foreground", strokeWidth: 1.8 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderIcon, { className: "size-4.5 text-muted-foreground", strokeWidth: 1.8 }) }),
16803
- /* @__PURE__ */ jsxRuntime.jsx(FileTreeName, { children: name })
16804
- ]
16805
- }
16806
16050
  )
16807
- ]
16808
- }
16809
- ),
16051
+ }
16052
+ ) }),
16053
+ /* @__PURE__ */ jsxRuntime.jsxs(
16054
+ "button",
16055
+ {
16056
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",
16057
+ onClick: handleSelect,
16058
+ type: "button",
16059
+ children: [
16060
+ /* @__PURE__ */ jsxRuntime.jsx(FileTreeIcon, { children: isExpanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpenIcon, { className: "size-4.5 text-muted-foreground", strokeWidth: 1.8 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderIcon, { className: "size-4.5 text-muted-foreground", strokeWidth: 1.8 }) }),
16061
+ /* @__PURE__ */ jsxRuntime.jsx(FileTreeName, { children: name })
16062
+ ]
16063
+ }
16064
+ )
16065
+ ] }),
16810
16066
  /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-5", children }) })
16811
16067
  ] }) });
16812
16068
  }
@@ -16835,8 +16091,8 @@ function FileTreeFile({
16835
16091
  "div",
16836
16092
  {
16837
16093
  className: cn(
16838
- "group flex h-9 cursor-pointer items-center gap-2 rounded-lg px-2 transition-colors hover:bg-accent",
16839
- isSelected && "bg-accent",
16094
+ listRow.listRowVariants({ size: "sm", active: isSelected }),
16095
+ "group cursor-pointer",
16840
16096
  className
16841
16097
  ),
16842
16098
  onClick: handleClick,
@@ -16873,14 +16129,14 @@ function forgetChatFiles() {
16873
16129
  chats.clear();
16874
16130
  changed();
16875
16131
  }
16876
- function subscribe2(listener) {
16132
+ function subscribe(listener) {
16877
16133
  listeners.add(listener);
16878
16134
  return () => {
16879
16135
  listeners.delete(listener);
16880
16136
  };
16881
16137
  }
16882
16138
  function useChatFiles(chat) {
16883
- return react.useSyncExternalStore(subscribe2, () => chat === null ? NONE : chats.get(chat) ?? NONE);
16139
+ return react.useSyncExternalStore(subscribe, () => chat === null ? NONE : chats.get(chat) ?? NONE);
16884
16140
  }
16885
16141
  var SKELETON_WIDTHS2 = [75, 60, 90, 65, 80, 70, 85, 55];
16886
16142
  var NO_ENTRIES = [];
@@ -16959,22 +16215,32 @@ function RenderEntries({
16959
16215
  entry.size != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 shrink-0 text-xs text-muted-foreground/60", children: formatFileSize(entry.size) }),
16960
16216
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-1 flex shrink-0 items-center gap-0 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100", children: [
16961
16217
  /* @__PURE__ */ jsxRuntime.jsx(
16962
- "a",
16218
+ button.Button,
16963
16219
  {
16964
- href: downloadUrlFor(entry.path),
16965
- download: fileName2,
16966
- className: "rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
16967
- onClick: (event) => event.stopPropagation(),
16968
- title: "Download",
16969
- "aria-label": `Download ${fileName2}`,
16970
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DownloadIcon, { className: "size-5" })
16220
+ asChild: true,
16221
+ variant: "ghost",
16222
+ size: "icon-xs",
16223
+ className: "text-muted-foreground hover:text-foreground",
16224
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16225
+ "a",
16226
+ {
16227
+ href: downloadUrlFor(entry.path),
16228
+ download: fileName2,
16229
+ onClick: (event) => event.stopPropagation(),
16230
+ title: "Download",
16231
+ "aria-label": `Download ${fileName2}`,
16232
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DownloadIcon, { className: "size-5" })
16233
+ }
16234
+ )
16971
16235
  }
16972
16236
  ),
16973
16237
  /* @__PURE__ */ jsxRuntime.jsx(
16974
- "button",
16238
+ button.Button,
16975
16239
  {
16976
16240
  type: "button",
16977
- className: "rounded p-0.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
16241
+ variant: "ghost",
16242
+ size: "icon-xs",
16243
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
16978
16244
  onClick: (event) => {
16979
16245
  event.stopPropagation();
16980
16246
  onDelete(entry.path);
@@ -17188,7 +16454,7 @@ function WorkspacePanel({
17188
16454
  type: "button",
17189
16455
  variant: "ghost",
17190
16456
  size: "icon-sm",
17191
- className: "rounded-xl text-foreground/80 md:size-11",
16457
+ className: "text-foreground/80 md:size-11",
17192
16458
  onClick: () => fileInputRef.current?.click(),
17193
16459
  disabled: disabled || !sessionId || uploading,
17194
16460
  "aria-label": "Upload files",
@@ -17204,7 +16470,7 @@ function WorkspacePanel({
17204
16470
  type: "button",
17205
16471
  variant: "ghost",
17206
16472
  size: "icon-sm",
17207
- className: "rounded-xl text-foreground/80 md:size-11",
16473
+ className: "text-foreground/80 md:size-11",
17208
16474
  onClick: () => void fetchTree(),
17209
16475
  disabled: !sessionId || loading,
17210
16476
  "aria-label": "Refresh workspace",
@@ -17252,24 +16518,28 @@ function WorkspacePanel({
17252
16518
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
17253
16519
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
17254
16520
  ] }),
17255
- !loading && !error && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-8 text-center text-sm text-faint", children: [
17256
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No workspace files" }),
17257
- /* @__PURE__ */ jsxRuntime.jsxs(
17258
- button.Button,
17259
- {
17260
- type: "button",
17261
- variant: "outline",
17262
- size: "sm",
17263
- className: "mt-3 gap-1.5",
17264
- onClick: () => fileInputRef.current?.click(),
17265
- disabled: disabled || !sessionId,
17266
- children: [
17267
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-3.5" }),
17268
- "Upload files"
17269
- ]
17270
- }
17271
- )
17272
- ] }),
16521
+ !loading && !error && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
16522
+ emptyState.EmptyState,
16523
+ {
16524
+ className: "px-4 py-8",
16525
+ logoClassName: "size-9",
16526
+ title: "No workspace files",
16527
+ action: /* @__PURE__ */ jsxRuntime.jsxs(
16528
+ button.Button,
16529
+ {
16530
+ type: "button",
16531
+ variant: "outline",
16532
+ size: "sm",
16533
+ onClick: () => fileInputRef.current?.click(),
16534
+ disabled: disabled || !sessionId,
16535
+ children: [
16536
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-3.5" }),
16537
+ "Upload files"
16538
+ ]
16539
+ }
16540
+ )
16541
+ }
16542
+ ),
17273
16543
  entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
17274
16544
  FileTree,
17275
16545
  {
@@ -17292,7 +16562,7 @@ function WorkspacePanel({
17292
16562
  )
17293
16563
  ] }) }),
17294
16564
  /* @__PURE__ */ jsxRuntime.jsx(
17295
- ConfirmDialog2,
16565
+ confirmDialog.ConfirmDialog,
17296
16566
  {
17297
16567
  open: deleteTarget !== null,
17298
16568
  title: "Delete file?",
@@ -17312,46 +16582,6 @@ function WorkspacePanel({
17312
16582
  )
17313
16583
  );
17314
16584
  }
17315
- function ConfirmDialog2({
17316
- open,
17317
- title,
17318
- description,
17319
- confirmLabel,
17320
- loading,
17321
- onConfirm,
17322
- onCancel
17323
- }) {
17324
- return /* @__PURE__ */ jsxRuntime.jsx(
17325
- dialog.Dialog,
17326
- {
17327
- open,
17328
- onOpenChange: (nextOpen) => {
17329
- if (!nextOpen && !loading) onCancel();
17330
- },
17331
- children: /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogContent, { className: "sm:max-w-md", children: [
17332
- /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { children: [
17333
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: title }),
17334
- /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: description })
17335
- ] }),
17336
- /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogFooter, { children: [
17337
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", disabled: loading, onClick: onCancel, children: "Cancel" }),
17338
- /* @__PURE__ */ jsxRuntime.jsxs(
17339
- button.Button,
17340
- {
17341
- variant: "destructive",
17342
- disabled: loading,
17343
- onClick: onConfirm,
17344
- children: [
17345
- loading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "mr-1.5 size-3.5 animate-spin" }),
17346
- confirmLabel
17347
- ]
17348
- }
17349
- )
17350
- ] })
17351
- ] })
17352
- }
17353
- );
17354
- }
17355
16585
 
17356
16586
  // src/agent-chat.tsx
17357
16587
  init_utils();
@@ -17395,12 +16625,7 @@ function readOnlyReasonForSession(session) {
17395
16625
  }
17396
16626
  return { readOnly: false };
17397
16627
  }
17398
- var RIGHT_STACK_STYLE = {
17399
- // Both the column's width and the chat panel's right offset read this, so
17400
- // one value keeps them complementary. 50%: the browser shell renders a real
17401
- // page, and page layouts are unusable in a 440px strip.
17402
- ["--right-stack-w"]: "50%"
17403
- };
16628
+ var RIGHT_STACK_STYLE = { ["--right-stack-w"]: "75%" };
17404
16629
  var MOBILE_PANE_LABELS = {
17405
16630
  chat: "Chat",
17406
16631
  browser: "Browser",
@@ -17613,21 +16838,19 @@ function AgentChat({
17613
16838
  "div",
17614
16839
  {
17615
16840
  "data-testid": "mobile-pane-toggle",
17616
- className: "md:hidden flex shrink-0 border-b border-line bg-card",
17617
- children: mobilePanes.map((pane) => /* @__PURE__ */ jsxRuntime.jsx(
17618
- "button",
16841
+ className: "md:hidden flex shrink-0 justify-center border-b border-line bg-card px-3 py-2",
16842
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16843
+ segmentedControl.SegmentedControl,
17619
16844
  {
17620
- type: "button",
17621
- onClick: () => setMobileView(pane),
17622
- "aria-pressed": activeMobilePane === pane,
17623
- className: cn(
17624
- "flex-1 min-h-11 px-4 py-3 text-sm font-medium border-b-2 -mb-px transition-colors",
17625
- activeMobilePane === pane ? "border-primary text-foreground" : "border-transparent text-subtle hover:text-foreground"
17626
- ),
17627
- children: MOBILE_PANE_LABELS[pane]
17628
- },
17629
- pane
17630
- ))
16845
+ "aria-label": "Show",
16846
+ segments: mobilePanes.map((pane) => ({
16847
+ value: pane,
16848
+ label: MOBILE_PANE_LABELS[pane]
16849
+ })),
16850
+ value: activeMobilePane,
16851
+ onChange: setMobileView
16852
+ }
16853
+ )
17631
16854
  }
17632
16855
  ),
17633
16856
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -18064,35 +17287,26 @@ function IntegrationsPage({ agentId, adapter, onBack }) {
18064
17287
  }
18065
17288
  };
18066
17289
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex w-full max-w-3xl flex-col gap-6 p-6", children: [
18067
- /* @__PURE__ */ jsxRuntime.jsxs(
18068
- "button",
18069
- {
18070
- type: "button",
18071
- onClick: onBack,
18072
- className: "-mx-2 inline-flex min-h-11 w-fit items-center gap-1.5 rounded-lg px-2 text-sm text-muted-foreground pointer-fine:mx-0 pointer-fine:min-h-0 pointer-fine:px-0 pointer-fine:hover:text-foreground",
18073
- children: [
18074
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "h-4 w-4" }),
18075
- "Back"
18076
- ]
18077
- }
18078
- ),
17290
+ /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { asChild: true, variant: "muted", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, children: [
17291
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "size-4" }),
17292
+ "Back"
17293
+ ] }) }),
18079
17294
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18080
17295
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Integrations" }),
18081
17296
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Connect third-party services to enhance your agent's capabilities" })
18082
17297
  ] }),
18083
17298
  /* @__PURE__ */ jsxRuntime.jsx(
18084
- "input",
17299
+ input.Input,
18085
17300
  {
18086
17301
  type: "search",
18087
17302
  value: query,
18088
17303
  onChange: (e) => setQuery(e.target.value),
18089
- placeholder: "Search integrations...",
18090
- className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm"
17304
+ placeholder: "Search integrations..."
18091
17305
  }
18092
17306
  ),
18093
17307
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", className: "text-xs text-red-500", children: error }),
18094
17308
  grouped.map(([category, items]) => /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-2", children: [
18095
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold uppercase tracking-wide text-muted-foreground/70", children: category }),
17309
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: category, role: "heading", "aria-level": 2, className: "pl-0" }),
18096
17310
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: items.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
18097
17311
  ToolkitRow,
18098
17312
  {
@@ -18115,53 +17329,76 @@ function ToolkitRow({
18115
17329
  const [open, setOpen] = react.useState(false);
18116
17330
  const [broken, setBroken] = react.useState(false);
18117
17331
  const name = row.name ?? titleCase(row.toolkit);
18118
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-border p-3", children: [
18119
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
18120
- /* @__PURE__ */ jsxRuntime.jsxs(
18121
- "button",
18122
- {
18123
- type: "button",
18124
- "aria-label": open ? "Collapse" : "Expand",
18125
- "aria-expanded": open,
18126
- onClick: () => setOpen((v) => !v),
18127
- className: "flex min-w-0 flex-1 items-center gap-2 text-left",
18128
- children: [
18129
- open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground/60" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground/60" }),
18130
- broken || !row.logo ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-5 w-5 items-center justify-center rounded bg-muted text-sm font-semibold uppercase", children: name.charAt(0) }) : /* @__PURE__ */ jsxRuntime.jsx(
18131
- "img",
17332
+ return (
17333
+ // A boxed disclosure: the header names the toolkit and opens its
17334
+ // description; Connect sits beside it, outside the trigger, since a
17335
+ // button cannot hold another.
17336
+ /* @__PURE__ */ jsxRuntime.jsxs(
17337
+ collapsible.Collapsible,
17338
+ {
17339
+ open,
17340
+ onOpenChange: setOpen,
17341
+ className: "rounded-[10px] border border-foreground/[0.08]",
17342
+ children: [
17343
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pr-3", children: [
17344
+ /* @__PURE__ */ jsxRuntime.jsx(
17345
+ collapsibleHeader.CollapsibleHeader,
18132
17346
  {
18133
- src: row.logo,
18134
- alt: name,
18135
- className: "h-5 w-5 rounded object-contain",
18136
- onError: () => setBroken(true)
17347
+ variant: "section",
17348
+ "aria-label": open ? "Collapse" : "Expand",
17349
+ className: "min-w-0 flex-1",
17350
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
17351
+ broken || !row.logo ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex size-5 shrink-0 items-center justify-center rounded bg-muted text-sm font-semibold uppercase", children: name.charAt(0) }) : /* @__PURE__ */ jsxRuntime.jsx(
17352
+ "img",
17353
+ {
17354
+ src: row.logo,
17355
+ alt: name,
17356
+ className: "size-5 shrink-0 rounded object-contain",
17357
+ onError: () => setBroken(true)
17358
+ }
17359
+ ),
17360
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: name })
17361
+ ] })
18137
17362
  }
18138
17363
  ),
18139
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate font-medium text-foreground", children: name })
18140
- ]
18141
- }
18142
- ),
18143
- /* @__PURE__ */ jsxRuntime.jsx(
18144
- button.Button,
18145
- {
18146
- type: "button",
18147
- variant: "outline",
18148
- size: "xs",
18149
- disabled: busy,
18150
- onClick: row.connected ? onDisconnect : onConnect,
18151
- className: "ml-auto min-w-[6rem]",
18152
- children: busy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
18153
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "h-3.5 w-3.5 animate-spin" }),
18154
- row.connected ? "Disconnecting" : "Connecting"
18155
- ] }) : row.connected ? "Disconnect" : "Connect"
18156
- }
18157
- )
18158
- ] }),
18159
- open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 pl-7 text-sm text-muted-foreground", children: [
18160
- row.description && /* @__PURE__ */ jsxRuntime.jsx("p", { children: row.description }),
18161
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 inline-block rounded bg-primary/10 px-1.5 py-0.5 text-sm font-semibold text-primary", children: row.auth_mode === "api_key" ? "API Key" : "OAuth" })
18162
- ] })
18163
- ] });
17364
+ /* @__PURE__ */ jsxRuntime.jsx(
17365
+ button.Button,
17366
+ {
17367
+ type: "button",
17368
+ variant: "outline",
17369
+ size: "xs",
17370
+ disabled: busy,
17371
+ onClick: row.connected ? onDisconnect : onConnect,
17372
+ className: "min-w-[6rem]",
17373
+ children: busy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17374
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "size-3.5 animate-spin" }),
17375
+ row.connected ? "Disconnecting" : "Connecting"
17376
+ ] }) : row.connected ? "Disconnect" : "Connect"
17377
+ }
17378
+ )
17379
+ ] }),
17380
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "border-t border-foreground/[0.08] px-3 py-2.5 text-[13px] text-muted-foreground", children: [
17381
+ row.description && /* @__PURE__ */ jsxRuntime.jsx("p", { children: row.description }),
17382
+ /* @__PURE__ */ jsxRuntime.jsx(
17383
+ chip.TagPill,
17384
+ {
17385
+ label: row.auth_mode === "api_key" ? "API key" : "OAuth",
17386
+ className: "mt-1.5"
17387
+ }
17388
+ )
17389
+ ] })
17390
+ ]
17391
+ }
17392
+ )
17393
+ );
18164
17394
  }
17395
+
17396
+ // src/components/connections/coding-agents-panel.tsx
17397
+ init_utils();
17398
+ var MODES = [
17399
+ { value: "oauth", label: "Subscription" },
17400
+ { value: "api_key", label: "API key" }
17401
+ ];
18165
17402
  var PROVIDERS = [
18166
17403
  {
18167
17404
  key: "claude",
@@ -18210,18 +17447,10 @@ function CodingAgentsPanel({ agentId, adapter, onBack }) {
18210
17447
  }, [connections]);
18211
17448
  if (!supported) return null;
18212
17449
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto flex w-full max-w-3xl flex-col gap-6 p-6", children: [
18213
- onBack && /* @__PURE__ */ jsxRuntime.jsxs(
18214
- "button",
18215
- {
18216
- type: "button",
18217
- onClick: onBack,
18218
- className: "-mx-2 inline-flex min-h-11 w-fit items-center gap-1.5 rounded-lg px-2 text-sm text-muted-foreground pointer-fine:mx-0 pointer-fine:min-h-0 pointer-fine:px-0 pointer-fine:hover:text-foreground",
18219
- children: [
18220
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "h-4 w-4" }),
18221
- "Back"
18222
- ]
18223
- }
18224
- ),
17450
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { asChild: true, variant: "muted", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, children: [
17451
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "size-4" }),
17452
+ "Back"
17453
+ ] }) }),
18225
17454
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18226
17455
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Coding agents" }),
18227
17456
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Connect your Claude or ChatGPT plan so the agent can run `/code` on your behalf without separate API billing." })
@@ -18300,40 +17529,21 @@ function ProviderCard({
18300
17529
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-3 rounded-lg border border-border p-4", children: [
18301
17530
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
18302
17531
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold text-foreground", children: meta.name }),
18303
- /* @__PURE__ */ jsxRuntime.jsx(
18304
- "span",
18305
- {
18306
- className: `inline-flex items-center rounded px-1.5 py-0.5 text-xs font-semibold ${connected ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground"}`,
18307
- children: connected ? `Connected${connection?.auth_mode === "api_key" ? " (API key)" : ""}` : "Not connected"
18308
- }
18309
- )
18310
- ] }),
18311
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-1 text-xs", children: [
18312
- /* @__PURE__ */ jsxRuntime.jsx(
18313
- "button",
18314
- {
18315
- type: "button",
18316
- onClick: () => {
18317
- setMode("oauth");
18318
- setError(null);
18319
- },
18320
- className: `rounded-md border px-2 py-1 ${mode === "oauth" ? "border-primary bg-primary/10 text-primary" : "border-border text-muted-foreground hover:bg-accent"}`,
18321
- children: "Subscription"
18322
- }
18323
- ),
18324
- /* @__PURE__ */ jsxRuntime.jsx(
18325
- "button",
18326
- {
18327
- type: "button",
18328
- onClick: () => {
18329
- setMode("api_key");
18330
- setError(null);
18331
- },
18332
- className: `rounded-md border px-2 py-1 ${mode === "api_key" ? "border-primary bg-primary/10 text-primary" : "border-border text-muted-foreground hover:bg-accent"}`,
18333
- children: "API key"
18334
- }
18335
- )
17532
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: connected ? "ok" : "muted", children: connected ? `Connected${connection?.auth_mode === "api_key" ? " (API key)" : ""}` : "Not connected" })
18336
17533
  ] }),
17534
+ /* @__PURE__ */ jsxRuntime.jsx(
17535
+ segmentedControl.SegmentedControl,
17536
+ {
17537
+ "aria-label": "Credential type",
17538
+ segments: MODES,
17539
+ value: mode,
17540
+ onChange: (next) => {
17541
+ setMode(next);
17542
+ setError(null);
17543
+ },
17544
+ className: "self-start"
17545
+ }
17546
+ ),
18337
17547
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: instructions }),
18338
17548
  /* @__PURE__ */ jsxRuntime.jsx(
18339
17549
  "textarea",
@@ -18345,7 +17555,7 @@ function ProviderCard({
18345
17555
  autoComplete: "off",
18346
17556
  rows: mode === "oauth" && meta.provider === "openai" ? 4 : 2,
18347
17557
  "aria-label": `${meta.name} credential`,
18348
- className: "w-full resize-y rounded-md border border-border bg-background px-3 py-2 font-mono text-xs [-webkit-text-security:disc]"
17558
+ className: cn(controlStyles.CONTROL_FIELD, "resize-y font-mono [-webkit-text-security:disc]")
18349
17559
  }
18350
17560
  ),
18351
17561
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", className: "text-xs text-red-500", children: error }),
@@ -18473,21 +17683,27 @@ function kindIcon(kind) {
18473
17683
  }
18474
17684
  var VIEWS = {
18475
17685
  active: {
17686
+ label: "Active",
18476
17687
  statuses: ["pending"],
18477
17688
  kinds: ["input_required", "action_required", "governance_gate"],
18478
17689
  empty: "Nothing needs you right now"
18479
17690
  },
18480
17691
  updates: {
17692
+ label: "Updates",
18481
17693
  statuses: ["pending"],
18482
17694
  kinds: ["task_complete", "progress_checkin"],
18483
17695
  empty: "No news from your agent"
18484
17696
  },
18485
17697
  history: {
17698
+ label: "History",
18486
17699
  statuses: ["acknowledged", "responded", "expired"],
18487
17700
  empty: "No history yet"
18488
17701
  }
18489
17702
  };
18490
- var VIEW_NAMES = Object.keys(VIEWS);
17703
+ var VIEW_OPTIONS = Object.keys(VIEWS).map((id) => ({
17704
+ id,
17705
+ label: VIEWS[id].label
17706
+ }));
18491
17707
  function belongsToView(item, view) {
18492
17708
  const kinds = VIEWS[view].kinds;
18493
17709
  return VIEWS[view].statuses.includes(item.status) && (kinds === void 0 || kinds.includes(item.kind));
@@ -18511,7 +17727,6 @@ function InboxBody({ body, muted }) {
18511
17727
  }
18512
17728
  );
18513
17729
  }
18514
- var FIELD_CLASS = "h-9 w-full border border-line bg-background px-2 text-sm text-foreground outline-none focus:border-primary disabled:opacity-50";
18515
17730
  function errorMessage(error, fallback) {
18516
17731
  return error instanceof Error && error.message ? error.message : fallback;
18517
17732
  }
@@ -18571,7 +17786,7 @@ function QuestionInput({
18571
17786
  "select",
18572
17787
  {
18573
17788
  "aria-label": prompt,
18574
- className: FIELD_CLASS,
17789
+ className: controlStyles.CONTROL_FIELD,
18575
17790
  disabled,
18576
17791
  value: useOther ? OTHER_OPTION : pickedIndex >= 0 ? String(pickedIndex) : "",
18577
17792
  onChange: (event) => {
@@ -18584,9 +17799,17 @@ function QuestionInput({
18584
17799
  if (choice) onPickChoice(choice.label);
18585
17800
  },
18586
17801
  children: [
18587
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: "Select" }),
18588
- choices.map((choice, index) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(index), children: choice.label }, choice.label)),
18589
- allowOther && /* @__PURE__ */ jsxRuntime.jsx("option", { value: OTHER_OPTION, children: "Other" })
17802
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, className: controlStyles.CONTROL_OPTION, children: "Select" }),
17803
+ choices.map((choice, index) => /* @__PURE__ */ jsxRuntime.jsx(
17804
+ "option",
17805
+ {
17806
+ value: String(index),
17807
+ className: controlStyles.CONTROL_OPTION,
17808
+ children: choice.label
17809
+ },
17810
+ choice.label
17811
+ )),
17812
+ allowOther && /* @__PURE__ */ jsxRuntime.jsx("option", { value: OTHER_OPTION, className: controlStyles.CONTROL_OPTION, children: "Other" })
18590
17813
  ]
18591
17814
  }
18592
17815
  ),
@@ -18594,7 +17817,7 @@ function QuestionInput({
18594
17817
  "input",
18595
17818
  {
18596
17819
  "aria-label": `${prompt} (other)`,
18597
- className: FIELD_CLASS,
17820
+ className: controlStyles.CONTROL_FIELD,
18598
17821
  placeholder: "Type your answer\u2026",
18599
17822
  disabled,
18600
17823
  value: typed,
@@ -18607,7 +17830,7 @@ function QuestionInput({
18607
17830
  "input",
18608
17831
  {
18609
17832
  "aria-label": prompt,
18610
- className: FIELD_CLASS,
17833
+ className: controlStyles.CONTROL_FIELD,
18611
17834
  disabled,
18612
17835
  value: typed,
18613
17836
  onChange: (event) => onType(event.target.value)
@@ -18972,18 +18195,10 @@ function InboxDetail({
18972
18195
  }) {
18973
18196
  const Icon = kindIcon(item.kind);
18974
18197
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "min-w-0 flex-1 overflow-y-auto p-4 md:p-6", children: [
18975
- onBack && /* @__PURE__ */ jsxRuntime.jsxs(
18976
- "button",
18977
- {
18978
- type: "button",
18979
- onClick: onBack,
18980
- className: "-ml-2 mb-2 inline-flex min-h-11 items-center gap-1.5 px-2 text-sm font-medium text-muted-foreground md:hidden",
18981
- children: [
18982
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, { className: "size-4" }),
18983
- "Inbox"
18984
- ]
18985
- }
18986
- ),
18198
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { variant: "muted", asChild: true, className: "mb-2 md:hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, children: [
18199
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, {}),
18200
+ "Inbox"
18201
+ ] }) }),
18987
18202
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-5 flex min-w-0 items-start gap-3", children: [
18988
18203
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 flex size-8 shrink-0 items-center justify-center border border-line text-muted-foreground", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }) }),
18989
18204
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
@@ -19173,54 +18388,43 @@ function InboxPanel({
19173
18388
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InboxIcon, { className: "size-4 text-muted-foreground" }),
19174
18389
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "font-semibold", children: title })
19175
18390
  ] }),
19176
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 border-b border-line px-2 py-2", children: VIEW_NAMES.map((value) => /* @__PURE__ */ jsxRuntime.jsx(
19177
- "button",
18391
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-line px-2 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
18392
+ toggleGroup.ViewSwitch,
19178
18393
  {
19179
- type: "button",
19180
- onClick: () => selectView(value),
19181
- className: cn(
19182
- "px-2 py-1 text-xs capitalize transition-colors",
19183
- view === value ? "bg-line font-medium text-foreground" : "text-muted-foreground hover:text-foreground"
19184
- ),
19185
- children: value
19186
- },
19187
- value
19188
- )) }),
18394
+ label: "Inbox view",
18395
+ views: VIEW_OPTIONS,
18396
+ value: view,
18397
+ onChange: selectView
18398
+ }
18399
+ ) }),
19189
18400
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
19190
18401
  error && items.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 px-4 py-3", children: [
19191
18402
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: error }),
19192
18403
  /* @__PURE__ */ jsxRuntime.jsx(button.Button, { type: "button", size: "sm", onClick: () => void load(null), children: "Try again" })
19193
18404
  ] }),
19194
- items.length === 0 && !error && !loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-8 text-sm text-muted-foreground", children: VIEWS[view].empty }),
19195
- items.map((item) => {
19196
- const Icon = kindIcon(item.kind);
19197
- const selected = item.id === selectedItemId;
19198
- return /* @__PURE__ */ jsxRuntime.jsxs(
19199
- "button",
19200
- {
19201
- type: "button",
19202
- "aria-label": `Open inbox item ${item.title}`,
19203
- className: cn(
19204
- "flex w-full min-w-0 gap-3 border-l-2 px-3 py-3 text-left transition-colors hover:bg-input",
19205
- selected ? "border-l-primary bg-line text-foreground" : "border-l-transparent text-subtle",
19206
- !item.readAt && "font-medium text-foreground"
19207
- ),
19208
- onClick: () => void selectItem(item.id),
19209
- children: [
19210
- /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }),
19211
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
19212
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center justify-between gap-2", children: [
19213
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs uppercase tracking-wide text-muted-foreground", children: kindLabel(item.kind) }),
19214
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: formatRelative(item.createdAt) })
19215
- ] }),
19216
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 block truncate text-sm", children: item.title }),
19217
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 block text-xs text-muted-foreground", children: statusLabel(item.status) })
19218
- ] })
19219
- ]
19220
- },
19221
- item.id
19222
- );
19223
- }),
18405
+ items.length === 0 && !error && !loading && /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "px-4 py-10", title: VIEWS[view].empty }),
18406
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
18407
+ listRow.ListRow,
18408
+ {
18409
+ size: "lg",
18410
+ icon: kindIcon(item.kind),
18411
+ label: item.title,
18412
+ description: `${kindLabel(item.kind)} \xB7 ${statusLabel(item.status)}`,
18413
+ meta: formatRelative(item.createdAt),
18414
+ isActive: item.id === selectedItemId,
18415
+ badge: !item.readAt && /* @__PURE__ */ jsxRuntime.jsx(
18416
+ "span",
18417
+ {
18418
+ "aria-label": "Unread",
18419
+ title: "Unread",
18420
+ className: "size-[7px] shrink-0 rounded-full bg-amber-500"
18421
+ }
18422
+ ),
18423
+ "aria-label": `Open inbox item ${item.title}`,
18424
+ onClick: () => void selectItem(item.id)
18425
+ },
18426
+ item.id
18427
+ )),
19224
18428
  nextCursor && /* @__PURE__ */ jsxRuntime.jsx(
19225
18429
  button.Button,
19226
18430
  {
@@ -19298,12 +18502,12 @@ function useInboxUnreadCount(adapter) {
19298
18502
  }, [listInbox, openInboxStream, refetch]);
19299
18503
  return { unreadCount, hasLoaded, error };
19300
18504
  }
19301
- var CATEGORY_BADGE_CLASS = {
19302
- spawn: "border-primary/30 bg-primary/10 text-primary",
19303
- output: "border-foreground/20 bg-foreground/5 text-foreground/80",
19304
- done: "border-emerald-500/30 bg-emerald-500/10 text-emerald-600",
19305
- verdict: "border-amber-500/30 bg-amber-500/10 text-amber-600",
19306
- system: "border-border bg-muted text-muted-foreground"
18505
+ var CATEGORY_TONE = {
18506
+ spawn: "warn",
18507
+ output: "muted",
18508
+ done: "ok",
18509
+ verdict: "warn",
18510
+ system: "muted"
19307
18511
  };
19308
18512
  function MissionActivityTab({ feed }) {
19309
18513
  const [filter, setFilter] = react.useState("all");
@@ -19313,15 +18517,15 @@ function MissionActivityTab({ feed }) {
19313
18517
  return newestFirst.filter((e) => missionEventCategory(e.type) === filter);
19314
18518
  }, [feed.events, filter]);
19315
18519
  if (feed.events.length === 0) {
19316
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-8 text-center text-sm text-muted-foreground/60", children: "No mission activity yet." });
18520
+ return /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "py-8", title: "No mission activity yet" });
19317
18521
  }
19318
18522
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
19319
18523
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap items-center gap-1.5", children: ["all", ...MISSION_EVENT_CATEGORIES].map((cat) => /* @__PURE__ */ jsxRuntime.jsx(
19320
- "button",
18524
+ toggle.FilterPill,
19321
18525
  {
19322
- type: "button",
18526
+ on: filter === cat,
19323
18527
  onClick: () => setFilter(cat),
19324
- className: `rounded-full border px-2.5 py-0.5 font-mono text-[10px] uppercase tracking-wide transition-colors ${filter === cat ? "border-foreground bg-foreground text-background" : "border-border/60 bg-background text-muted-foreground hover:bg-muted/40"}`,
18528
+ className: "capitalize",
19325
18529
  children: cat
19326
18530
  },
19327
18531
  cat
@@ -19339,28 +18543,18 @@ function ActivityRow({
19339
18543
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-20 shrink-0 font-mono text-[10px] text-muted-foreground/60", children: formatMissionTimestamp(event.createdAt) }),
19340
18544
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
19341
18545
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center", children: [
19342
- /* @__PURE__ */ jsxRuntime.jsx(
19343
- "span",
19344
- {
19345
- className: `shrink-0 rounded border px-1.5 font-mono uppercase ${CATEGORY_BADGE_CLASS[category]}`,
19346
- children: category
19347
- }
19348
- ),
18546
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: CATEGORY_TONE[category], className: "capitalize", children: category }),
19349
18547
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "shrink-0 text-xs text-foreground font-mono", children: missionEventActorLabel(event, feed.sessions) }),
19350
- taskId ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground/70", children: taskId.slice(0, 8) }) : null
18548
+ taskId ? /* @__PURE__ */ jsxRuntime.jsx(chip.TagPill, { label: taskId.slice(0, 8), className: "font-mono" }) : null
19351
18549
  ] }),
19352
18550
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "min-w-0 flex-1 truncate text-foreground/80", children: renderInlineMarkdown(missionEventSummary(event)) }) })
19353
18551
  ] })
19354
18552
  ] });
19355
18553
  }
19356
- function verdictToneClass(result) {
19357
- if (result === "satisfied") {
19358
- return "border-emerald-500/30 bg-emerald-500/5 text-emerald-700 dark:text-emerald-400";
19359
- }
19360
- if (result === "failed" || result === "blocked") {
19361
- return "border-destructive/30 bg-destructive/5 text-destructive";
19362
- }
19363
- return "border-amber-500/30 bg-amber-500/5 text-amber-700 dark:text-amber-400";
18554
+ function missionVerdictTone(result) {
18555
+ if (result === "satisfied") return "ok";
18556
+ if (result === "failed" || result === "blocked") return "bad";
18557
+ return "warn";
19364
18558
  }
19365
18559
  function MissionMetadataTab({ mission }) {
19366
18560
  const rows = [
@@ -19411,7 +18605,7 @@ function MissionMetadataTab({ mission }) {
19411
18605
  mission.lastEvaluationResult ? /* @__PURE__ */ jsxRuntime.jsxs(
19412
18606
  "section",
19413
18607
  {
19414
- className: `space-y-2 rounded-md border p-4 ${verdictToneClass(mission.lastEvaluationResult)}`,
18608
+ className: `space-y-2 rounded-[10px] p-4 ${chip.TONE[missionVerdictTone(mission.lastEvaluationResult)]}`,
19415
18609
  children: [
19416
18610
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-mono text-[10px] uppercase tracking-widest", children: [
19417
18611
  "Last verdict \u2014 ",
@@ -19424,7 +18618,7 @@ function MissionMetadataTab({ mission }) {
19424
18618
  }
19425
18619
  ) : null,
19426
18620
  /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
19427
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: "Identifiers" }),
18621
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Identifiers", className: "mb-2 pl-0" }),
19428
18622
  /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 text-xs", children: rows.map((r) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
19429
18623
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground/70", children: r.label }),
19430
18624
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "break-all text-foreground/90", children: r.value })
@@ -19444,22 +18638,12 @@ function compareNodes(a, b) {
19444
18638
  }
19445
18639
  return pa.length - pb.length;
19446
18640
  }
19447
- function statusToneClass(status) {
19448
- switch (status) {
19449
- case "merged":
19450
- return "border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400";
19451
- case "done":
19452
- return "border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-400";
19453
- case "running":
19454
- return "border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-400";
19455
- case "failed":
19456
- return "border-destructive/30 bg-destructive/10 text-destructive";
19457
- case "pruned":
19458
- return "border-border bg-muted/40 text-muted-foreground/70 line-through";
19459
- default:
19460
- return "border-border bg-muted/30 text-muted-foreground/80";
19461
- }
19462
- }
18641
+ var IDEA_STATUS_TONE = {
18642
+ merged: "ok",
18643
+ done: "info",
18644
+ running: "warn",
18645
+ failed: "bad"
18646
+ };
19463
18647
  function fmtScore(n) {
19464
18648
  if (n === null || n === void 0) return "\u2014";
19465
18649
  return n.toFixed(3).replace(/\.?0+$/, "") || "0";
@@ -19555,9 +18739,10 @@ function IdeaRow({
19555
18739
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
19556
18740
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "shrink-0 text-[11px] text-muted-foreground/60", children: node.nodeKey }),
19557
18741
  /* @__PURE__ */ jsxRuntime.jsx(
19558
- "span",
18742
+ chip.TonePill,
19559
18743
  {
19560
- className: `shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider ${statusToneClass(node.status)}`,
18744
+ tone: IDEA_STATUS_TONE[node.status] ?? "muted",
18745
+ className: node.status === "pruned" ? "capitalize line-through" : "capitalize",
19561
18746
  children: node.status
19562
18747
  }
19563
18748
  ),
@@ -19590,13 +18775,14 @@ function MissionResearchTab({ research }) {
19590
18775
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
19591
18776
  /* @__PURE__ */ jsxRuntime.jsx(RunHeader, { run }),
19592
18777
  /* @__PURE__ */ jsxRuntime.jsxs("section", { children: [
19593
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: [
19594
- "Idea Tree \xB7 ",
19595
- sorted.length,
19596
- " node",
19597
- sorted.length === 1 ? "" : "s"
19598
- ] }),
19599
- sorted.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/60", children: "No hypotheses yet." }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "rounded-md border", children: sorted.map((n) => /* @__PURE__ */ jsxRuntime.jsx(
18778
+ /* @__PURE__ */ jsxRuntime.jsx(
18779
+ sectionLabel.SectionLabel,
18780
+ {
18781
+ label: `Idea tree \xB7 ${sorted.length} node${sorted.length === 1 ? "" : "s"}`,
18782
+ className: "mb-2 pl-0"
18783
+ }
18784
+ ),
18785
+ sorted.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "py-8", title: "No hypotheses yet" }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "rounded-md border", children: sorted.map((n) => /* @__PURE__ */ jsxRuntime.jsx(
19600
18786
  IdeaRow,
19601
18787
  {
19602
18788
  node: n,
@@ -19608,27 +18794,30 @@ function MissionResearchTab({ research }) {
19608
18794
  ] })
19609
18795
  ] });
19610
18796
  }
19611
- var TASK_STATUS_BADGE_CLASS = {
19612
- running: "border-primary/30 bg-primary/10 text-primary",
19613
- blocked: "border-amber-500/30 bg-amber-500/10 text-amber-600",
19614
- done: "border-emerald-500/30 bg-emerald-500/10 text-emerald-600",
19615
- failed: "border-destructive/30 bg-destructive/10 text-destructive",
19616
- cancelled: "border-border bg-muted text-muted-foreground"
18797
+ var TASK_STATUS_TONE = {
18798
+ running: "warn",
18799
+ blocked: "warn",
18800
+ done: "ok",
18801
+ failed: "bad",
18802
+ active: "warn",
18803
+ completed: "ok"
19617
18804
  };
19618
- function statusBadgeClass(status) {
19619
- return TASK_STATUS_BADGE_CLASS[status] ?? "border-foreground/20 bg-foreground/5 text-foreground/70";
18805
+ function missionTaskStatusTone(status) {
18806
+ return TASK_STATUS_TONE[status] ?? "muted";
19620
18807
  }
19621
18808
  function TaskChip({
19622
18809
  task,
19623
18810
  onSelect
19624
18811
  }) {
19625
18812
  return /* @__PURE__ */ jsxRuntime.jsxs(
19626
- "button",
18813
+ button.Button,
19627
18814
  {
19628
18815
  type: "button",
18816
+ variant: "outline",
18817
+ size: "xs",
19629
18818
  "data-task-chip": true,
19630
18819
  onClick: () => onSelect(task.id),
19631
- className: "inline-flex max-w-full items-center gap-1.5 rounded-full border border-border/60 bg-background px-2.5 py-1 text-xs hover:bg-muted/40",
18820
+ className: "max-w-full",
19632
18821
  children: [
19633
18822
  /* @__PURE__ */ jsxRuntime.jsx(
19634
18823
  "span",
@@ -19636,8 +18825,8 @@ function TaskChip({
19636
18825
  className: `size-1.5 shrink-0 rounded-full ${missionTaskStatusDotClass(task.status)}`
19637
18826
  }
19638
18827
  ),
19639
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-foreground/85", children: missionTaskTitle(task.goal, 40) }),
19640
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[9px] text-muted-foreground/60", children: task.id.slice(0, 8) })
18828
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: missionTaskTitle(task.goal, 40) }),
18829
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] text-muted-foreground", children: task.id.slice(0, 8) })
19641
18830
  ]
19642
18831
  }
19643
18832
  );
@@ -19650,27 +18839,22 @@ function TaskRailRow({
19650
18839
  const preview = stripMissionControlMarkup(
19651
18840
  task.status === "done" && task.result ? task.result : task.goal
19652
18841
  );
19653
- return /* @__PURE__ */ jsxRuntime.jsxs(
19654
- "button",
18842
+ return /* @__PURE__ */ jsxRuntime.jsx(
18843
+ listRow.ListRow,
19655
18844
  {
19656
- type: "button",
18845
+ asChild: true,
18846
+ size: "sm",
18847
+ isActive: selected,
18848
+ label: task.goal,
18849
+ description: [task.agentDefName, preview].filter(Boolean).join(" \xB7 "),
19657
18850
  onClick: () => onSelect(task.id),
19658
- className: `w-full rounded-md border px-3 py-2 text-left text-sm transition-colors ${selected ? "border-primary/40 bg-primary/5" : "border-transparent hover:bg-muted/40"}`,
19659
- children: [
19660
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
19661
- /* @__PURE__ */ jsxRuntime.jsx(
19662
- "span",
19663
- {
19664
- className: `size-2 shrink-0 rounded-full ${missionTaskStatusDotClass(task.status)}`
19665
- }
19666
- ),
19667
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground/90", children: task.goal })
19668
- ] }),
19669
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-1 flex flex-col gap-2 pl-4", children: [
19670
- task.agentDefName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs font-mono text-muted-foreground", children: task.agentDefName }) : null,
19671
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "line-clamp-2 min-w-0 flex-1 text-xs text-muted-foreground/70", children: preview })
19672
- ] })
19673
- ]
18851
+ className: "cursor-pointer",
18852
+ children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(
18853
+ "span",
18854
+ {
18855
+ className: `size-2 shrink-0 rounded-full ${missionTaskStatusDotClass(task.status)}`
18856
+ }
18857
+ ) })
19674
18858
  }
19675
18859
  );
19676
18860
  }
@@ -19699,17 +18883,12 @@ function MissionTasksTab({
19699
18883
  return outputs.length > 0 ? outputs[outputs.length - 1] : null;
19700
18884
  }, [selected, taskEvents]);
19701
18885
  if (tasks.length === 0) {
19702
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-8 text-center text-sm text-muted-foreground/60", children: "No tasks spawned yet." });
18886
+ return /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "py-8", title: "No tasks spawned yet" });
19703
18887
  }
19704
18888
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 gap-4", children: [
19705
18889
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-72 shrink-0 space-y-4 overflow-y-auto pr-1", children: groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
19706
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-1 px-1 font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: [
19707
- group.label,
19708
- " (",
19709
- group.tasks.length,
19710
- ")"
19711
- ] }),
19712
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: group.tasks.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
18890
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: `${group.label} (${group.tasks.length})` }),
18891
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: group.tasks.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
19713
18892
  TaskRailRow,
19714
18893
  {
19715
18894
  task: t,
@@ -19762,14 +18941,7 @@ function TaskDetail({
19762
18941
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] text-muted-foreground/60", children: task.id.slice(0, 8) })
19763
18942
  ] }),
19764
18943
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2 text-xs", children: [
19765
- /* @__PURE__ */ jsxRuntime.jsx(
19766
- badge.Badge,
19767
- {
19768
- variant: "destructive",
19769
- className: `font-mono text-sm uppercase tracking-wide ${statusBadgeClass(task.status)}`,
19770
- children: task.status
19771
- }
19772
- ),
18944
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTaskStatusTone(task.status), className: "capitalize", children: task.status }),
19773
18945
  task.agentDefName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: task.agentDefName }) : null,
19774
18946
  task.attemptCount > 1 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
19775
18947
  "attempts ",
@@ -19785,30 +18957,26 @@ function TaskDetail({
19785
18957
  ] }),
19786
18958
  /* @__PURE__ */ jsxRuntime.jsx(OutcomeCard, { outcome }),
19787
18959
  parents.length > 0 || children.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
19788
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: "Dependencies" }),
18960
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Dependencies", className: "pl-0" }),
19789
18961
  parents.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
19790
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[10px] uppercase text-muted-foreground/50", children: "Depends on" }),
18962
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[12px] text-subtle", children: "Depends on" }),
19791
18963
  parents.map((p) => /* @__PURE__ */ jsxRuntime.jsx(TaskChip, { task: p, onSelect }, p.id))
19792
18964
  ] }) : null,
19793
18965
  children.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [
19794
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[10px] uppercase text-muted-foreground/50", children: "Blocks" }),
18966
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[12px] text-subtle", children: "Blocks" }),
19795
18967
  children.map((c) => /* @__PURE__ */ jsxRuntime.jsx(TaskChip, { task: c, onSelect }, c.id))
19796
18968
  ] }) : null
19797
18969
  ] }) : null,
19798
18970
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
19799
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-1 font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: "Brief" }),
18971
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Brief", className: "mb-1 pl-0" }),
19800
18972
  /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { className: "text-sm leading-relaxed text-foreground/90", children: task.goal })
19801
18973
  ] }),
19802
- task.resultMetadata ? /* @__PURE__ */ jsxRuntime.jsxs("details", { children: [
19803
- /* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer font-mono text-[10px] uppercase tracking-widest text-muted-foreground/70", children: "Result metadata" }),
19804
- /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-1 max-h-64 overflow-auto whitespace-pre-wrap rounded bg-muted/30 px-2 py-1.5 text-[11px] text-foreground/90", children: JSON.stringify(task.resultMetadata, null, 2) })
18974
+ task.resultMetadata ? /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { className: "rounded-[10px] border border-foreground/[0.08]", children: [
18975
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", size: "sm", children: "Result metadata" }),
18976
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "max-h-64 overflow-auto whitespace-pre-wrap border-t border-foreground/[0.08] px-3 py-2 text-[11px] text-foreground/90", children: JSON.stringify(task.resultMetadata, null, 2) }) })
19805
18977
  ] }) : null,
19806
18978
  eventsSupported && taskEvents.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
19807
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 font-mono font-semibold uppercase text-muted-foreground", children: [
19808
- "History (",
19809
- taskEvents.length,
19810
- ")"
19811
- ] }),
18979
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: `History (${taskEvents.length})`, className: "mb-2 pl-0" }),
19812
18980
  /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "space-y-3", children: taskEvents.map((e) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-3 text-xs", children: [
19813
18981
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-16 shrink-0 font-mono text-[10px] text-muted-foreground/60", children: formatMissionTimestamp(e.createdAt) }),
19814
18982
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "", children: [
@@ -19931,11 +19099,6 @@ function OutcomeCard({ outcome }) {
19931
19099
  }
19932
19100
  );
19933
19101
  }
19934
- var MISSION_WORKER_KIND_BADGE_CLASS = {
19935
- task: "border-primary/40 bg-primary/10 text-primary uppercase tracking-wide text-[10px]",
19936
- worker: "border-foreground/30 bg-foreground/5 text-foreground/80 uppercase tracking-wide text-[10px]",
19937
- delegation: "border-foreground/20 bg-foreground/[0.03] text-foreground/60 uppercase tracking-wide text-[10px]"
19938
- };
19939
19102
  var MISSION_WORKER_KIND_TOOLTIP = {
19940
19103
  task: "Durable Task row created by spawn_task. Retried by the dispatcher; survives across coordinator wakes.",
19941
19104
  worker: "Async one-shot session spawned by spawn_worker. Durable session, no retry/DAG.",
@@ -19947,7 +19110,13 @@ function MissionWorkersTab({
19947
19110
  onOpenTranscript
19948
19111
  }) {
19949
19112
  if (workers.length === 0) {
19950
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-8 text-center text-sm text-muted-foreground/60", children: "No workers attached to this mission right now." });
19113
+ return /* @__PURE__ */ jsxRuntime.jsx(
19114
+ emptyState.EmptyState,
19115
+ {
19116
+ className: "py-8",
19117
+ title: "No workers attached to this mission right now"
19118
+ }
19119
+ );
19951
19120
  }
19952
19121
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: workers.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
19953
19122
  WorkerCard2,
@@ -19977,18 +19146,11 @@ function WorkerCard2({
19977
19146
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
19978
19147
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: worker.agentDefName ?? "worker" }),
19979
19148
  /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
19980
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
19981
- badge.Badge,
19982
- {
19983
- variant: "outline",
19984
- className: `mt-1 ${MISSION_WORKER_KIND_BADGE_CLASS[worker.kind]}`,
19985
- children: worker.kind
19986
- }
19987
- ) }),
19149
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(chip.Chip, { size: "sm", className: "mt-1 capitalize", children: worker.kind }) }),
19988
19150
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { className: "max-w-xs", children: MISSION_WORKER_KIND_TOOLTIP[worker.kind] })
19989
19151
  ] })
19990
19152
  ] }),
19991
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70", children: statusLabel2 })
19153
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTaskStatusTone(statusLabel2), className: "capitalize", children: statusLabel2 })
19992
19154
  ] }),
19993
19155
  counts ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-6", children: [
19994
19156
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -20013,13 +19175,13 @@ function WorkerCard2({
20013
19175
  ] }),
20014
19176
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-xs text-foreground/80", children: deriveMissionWorkerActivityLabel(worker) }),
20015
19177
  /* @__PURE__ */ jsxRuntime.jsx(
20016
- "a",
19178
+ textLink.TextLink,
20017
19179
  {
19180
+ size: "sm",
20018
19181
  href: worker.transcriptUrl,
20019
19182
  target: "_blank",
20020
19183
  rel: "noreferrer",
20021
19184
  onClick: onTranscriptClick,
20022
- className: "inline-block text-xs text-primary hover:underline",
20023
19185
  children: "View session"
20024
19186
  }
20025
19187
  )
@@ -20090,8 +19252,15 @@ function useMissionEvents(input) {
20090
19252
  var DEFAULT_POLL_INTERVAL_MS = 5e3;
20091
19253
  function CountBadge({ n }) {
20092
19254
  if (n === 0) return null;
20093
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 rounded bg-muted px-1 py-px text-[9px] text-muted-foreground/70", children: n });
20094
- }
19255
+ return /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "secondary", children: n });
19256
+ }
19257
+ var MISSION_STATUS_TONE = {
19258
+ active: "warn",
19259
+ paused: "warn",
19260
+ satisfied: "ok",
19261
+ failed: "bad",
19262
+ cancelled: "bad"
19263
+ };
20095
19264
  var INITIAL_STATE = {
20096
19265
  mission: null,
20097
19266
  tasks: [],
@@ -20251,7 +19420,6 @@ function MissionDashboard({
20251
19420
  setBusy(false);
20252
19421
  }
20253
19422
  };
20254
- const statusTone = mission.status === "satisfied" ? "border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400" : mission.status === "failed" || mission.status === "cancelled" ? "border-destructive/40 bg-destructive/10 text-destructive" : mission.status === "paused" ? "border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-400" : "border-primary/40 bg-primary/10 text-primary";
20255
19423
  const isActive = ACTIVE_MISSION_STATUSES.has(mission.status);
20256
19424
  const iterationPct = mission.maxIterations > 0 ? Math.min(100, mission.iteration / mission.maxIterations * 100) : 0;
20257
19425
  return /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full flex-1 flex-col overflow-hidden bg-muted/30", children: [
@@ -20259,9 +19427,10 @@ function MissionDashboard({
20259
19427
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
20260
19428
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
20261
19429
  /* @__PURE__ */ jsxRuntime.jsx(
20262
- "span",
19430
+ chip.TonePill,
20263
19431
  {
20264
- className: `rounded-md border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider ${statusTone}`,
19432
+ tone: MISSION_STATUS_TONE[mission.status] ?? "muted",
19433
+ className: "capitalize",
20265
19434
  children: mission.status
20266
19435
  }
20267
19436
  ),
@@ -20273,9 +19442,9 @@ function MissionDashboard({
20273
19442
  ] }),
20274
19443
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] uppercase tracking-wider text-muted-foreground/60", children: "iterations" })
20275
19444
  ] }),
20276
- mission.lastEvaluationResult ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[11px] text-muted-foreground/70", children: [
20277
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-70", children: "last verdict" }),
20278
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wider text-primary", children: mission.lastEvaluationResult })
19445
+ mission.lastEvaluationResult ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[12px] text-muted-foreground", children: [
19446
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Last verdict" }),
19447
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionVerdictTone(mission.lastEvaluationResult), children: mission.lastEvaluationResult })
20279
19448
  ] }) : null
20280
19449
  ] }),
20281
19450
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: [
@@ -20337,10 +19506,10 @@ function MissionDashboard({
20337
19506
  ] })
20338
19507
  ] }),
20339
19508
  /* @__PURE__ */ jsxRuntime.jsx(
20340
- Progress,
19509
+ progressBar.ProgressBar,
20341
19510
  {
20342
19511
  value: iterationPct,
20343
- className: `h-1 ${isActive ? "" : "opacity-40"}`
19512
+ className: isActive ? void 0 : "opacity-40"
20344
19513
  }
20345
19514
  ),
20346
19515
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
@@ -20418,11 +19587,10 @@ function MissionDashboard({
20418
19587
  ] }),
20419
19588
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
20420
19589
  /* @__PURE__ */ jsxRuntime.jsx(
20421
- "input",
19590
+ checkbox.Checkbox,
20422
19591
  {
20423
- type: "checkbox",
20424
19592
  checked: cancelCascade,
20425
- onChange: (e) => setCancelCascade(e.target.checked)
19593
+ onCheckedChange: (checked) => setCancelCascade(checked === true)
20426
19594
  }
20427
19595
  ),
20428
19596
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
@@ -20463,9 +19631,6 @@ function MissionDashboard({
20463
19631
  )
20464
19632
  ] }) });
20465
19633
  }
20466
-
20467
- // src/components/missions/missions-panel.tsx
20468
- init_utils();
20469
19634
  var DEFAULT_POLL_INTERVAL_MS2 = 3e4;
20470
19635
  function fingerprint(items) {
20471
19636
  return items.map(
@@ -20480,6 +19645,12 @@ function sortMissions(items) {
20480
19645
  return (a.updatedAt ?? "") > (b.updatedAt ?? "") ? -1 : 1;
20481
19646
  });
20482
19647
  }
19648
+ function missionTone(status) {
19649
+ if (status === "active") return "ok";
19650
+ if (status === "paused" || status === "blocked") return "warn";
19651
+ if (status === "failed" || status === "max_iterations_reached") return "bad";
19652
+ return "muted";
19653
+ }
20483
19654
  function MissionRow({
20484
19655
  mission,
20485
19656
  onOpen,
@@ -20510,81 +19681,79 @@ function MissionRow({
20510
19681
  e.preventDefault();
20511
19682
  openMission();
20512
19683
  };
20513
- return /* @__PURE__ */ jsxRuntime.jsxs(
20514
- "div",
19684
+ return /* @__PURE__ */ jsxRuntime.jsx(
19685
+ listRow.ListRow,
20515
19686
  {
20516
- className: cn(
20517
- "group flex min-w-0 items-start gap-2 border-l-2 border-l-transparent px-3 py-2 text-sm transition-colors cursor-pointer hover:border-l-primary hover:bg-input",
20518
- "min-h-11 md:min-h-0"
20519
- ),
20520
- onClick: openMission,
20521
- onKeyDown: handleRowKeyDown,
20522
- role: "button",
20523
- tabIndex: 0,
20524
- "aria-label": `Open mission ${description}`,
20525
- title: "Open mission dashboard",
20526
- children: [
20527
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 flex size-5 shrink-0 items-center justify-center text-faint", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TargetIcon, { className: "size-3.5" }) }),
20528
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-start gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
20529
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-foreground", children: description }),
20530
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
20531
- badge.Badge,
20532
- {
20533
- variant: isActive ? "default" : "secondary",
20534
- className: "shrink-0",
20535
- children: mission.status
20536
- }
20537
- ) }),
20538
- meta.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 space-y-0.5 text-xs text-faint", children: meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate", children: line }, line)) })
20539
- ] }) }) }),
20540
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
20541
- isActive && canMutate.pause && /* @__PURE__ */ jsxRuntime.jsx(
20542
- "button",
20543
- {
20544
- type: "button",
20545
- className: "rounded p-2 md:p-1 text-faint opacity-100 md:opacity-70 transition-all hover:bg-line hover:text-foreground disabled:pointer-events-none disabled:opacity-40 md:group-hover:opacity-100",
20546
- onClick: (e) => {
20547
- stopActionClick(e);
20548
- onPause(mission.id);
20549
- },
20550
- "aria-label": "Pause mission",
20551
- title: "Pause mission",
20552
- disabled: busy,
20553
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, { className: "size-3.5" })
20554
- }
20555
- ),
20556
- isPaused && canMutate.resume && /* @__PURE__ */ jsxRuntime.jsx(
20557
- "button",
20558
- {
20559
- type: "button",
20560
- className: "rounded p-2 md:p-1 text-faint opacity-100 md:opacity-70 transition-all hover:bg-line hover:text-foreground disabled:pointer-events-none disabled:opacity-40 md:group-hover:opacity-100",
20561
- onClick: (e) => {
20562
- stopActionClick(e);
20563
- onResume(mission.id);
20564
- },
20565
- "aria-label": "Resume mission",
20566
- title: "Resume mission",
20567
- disabled: busy,
20568
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5" })
20569
- }
20570
- ),
20571
- (isActive || isPaused) && canMutate.cancel && /* @__PURE__ */ jsxRuntime.jsx(
20572
- "button",
20573
- {
20574
- type: "button",
20575
- className: "rounded p-2 md:p-1 text-faint opacity-100 md:opacity-70 transition-all hover:bg-destructive/10 hover:text-destructive disabled:pointer-events-none disabled:opacity-40 md:group-hover:opacity-100",
20576
- onClick: (e) => {
20577
- stopActionClick(e);
20578
- onCancel(mission.id);
20579
- },
20580
- "aria-label": "Cancel mission",
20581
- title: "Cancel mission",
20582
- disabled: busy,
20583
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ban, { className: "size-3.5" })
20584
- }
20585
- )
20586
- ] })
20587
- ]
19687
+ asChild: true,
19688
+ size: "sm",
19689
+ icon: lucideReact.TargetIcon,
19690
+ label: description,
19691
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19692
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 flex", children: /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTone(mission.status), children: mission.status }) }),
19693
+ meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block truncate", children: line }, line))
19694
+ ] }),
19695
+ className: "cursor-pointer items-start",
19696
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19697
+ isActive && canMutate.pause && /* @__PURE__ */ jsxRuntime.jsx(
19698
+ button.Button,
19699
+ {
19700
+ variant: "ghost",
19701
+ size: "icon-xs",
19702
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
19703
+ onClick: (e) => {
19704
+ stopActionClick(e);
19705
+ onPause(mission.id);
19706
+ },
19707
+ "aria-label": "Pause mission",
19708
+ title: "Pause mission",
19709
+ disabled: busy,
19710
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, { className: "size-3.5" })
19711
+ }
19712
+ ),
19713
+ isPaused && canMutate.resume && /* @__PURE__ */ jsxRuntime.jsx(
19714
+ button.Button,
19715
+ {
19716
+ variant: "ghost",
19717
+ size: "icon-xs",
19718
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
19719
+ onClick: (e) => {
19720
+ stopActionClick(e);
19721
+ onResume(mission.id);
19722
+ },
19723
+ "aria-label": "Resume mission",
19724
+ title: "Resume mission",
19725
+ disabled: busy,
19726
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5" })
19727
+ }
19728
+ ),
19729
+ (isActive || isPaused) && canMutate.cancel && /* @__PURE__ */ jsxRuntime.jsx(
19730
+ button.Button,
19731
+ {
19732
+ variant: "ghost",
19733
+ size: "icon-xs",
19734
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive md:opacity-70 md:group-hover/list-row:opacity-100",
19735
+ onClick: (e) => {
19736
+ stopActionClick(e);
19737
+ onCancel(mission.id);
19738
+ },
19739
+ "aria-label": "Cancel mission",
19740
+ title: "Cancel mission",
19741
+ disabled: busy,
19742
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ban, { className: "size-3.5" })
19743
+ }
19744
+ )
19745
+ ] }),
19746
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19747
+ "div",
19748
+ {
19749
+ onClick: openMission,
19750
+ onKeyDown: handleRowKeyDown,
19751
+ role: "button",
19752
+ tabIndex: 0,
19753
+ "aria-label": `Open mission ${description}`,
19754
+ title: "Open mission dashboard"
19755
+ }
19756
+ )
20588
19757
  }
20589
19758
  );
20590
19759
  }
@@ -20604,7 +19773,6 @@ function MissionsPanel({
20604
19773
  const [error, setError] = react.useState(null);
20605
19774
  const [hasEverLoaded, setHasEverLoaded] = react.useState(false);
20606
19775
  const [busyMissionId, setBusyMissionId] = react.useState(null);
20607
- const [collapsed, setCollapsed] = react.useState(false);
20608
19776
  const mounted = react.useRef(true);
20609
19777
  const requestId = react.useRef(0);
20610
19778
  const lastFingerprint = react.useRef("");
@@ -20722,44 +19890,31 @@ function MissionsPanel({
20722
19890
  );
20723
19891
  if (!hasEverLoaded) return null;
20724
19892
  if (!adapter.listMissions) return null;
20725
- const showBody = hideHeader || !collapsed;
20726
19893
  const canMutate = {
20727
19894
  pause: Boolean(adapter.pauseMission),
20728
19895
  resume: Boolean(adapter.resumeMission),
20729
19896
  cancel: Boolean(adapter.cancelMission)
20730
19897
  };
20731
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "min-w-0 border-t border-line", children: [
20732
- !hideHeader && /* @__PURE__ */ jsxRuntime.jsxs(
20733
- "button",
20734
- {
20735
- type: "button",
20736
- className: "flex w-full items-center gap-1.5 px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-foreground transition-colors hover:bg-input",
20737
- onClick: () => setCollapsed((c) => !c),
20738
- "aria-expanded": !collapsed,
20739
- children: [
20740
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TargetIcon, { className: "size-3.5" }),
20741
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title }),
20742
- activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-auto", children: activeCount }),
20743
- collapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3.5 shrink-0 text-faint" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-3.5 shrink-0 text-faint" })
20744
- ]
20745
- }
20746
- ),
20747
- showBody && error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-destructive", children: error }),
20748
- showBody && !error && items.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-faint", children: "No missions" }),
20749
- showBody && !error && items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pb-2", hideHeader && "pt-1"), children: items.map((mission) => /* @__PURE__ */ jsxRuntime.jsx(
20750
- MissionRow,
20751
- {
20752
- mission,
20753
- busy: busyMissionId === mission.id,
20754
- canMutate,
20755
- onOpen: handleOpen,
20756
- onPause: handlePause,
20757
- onResume: handleResume,
20758
- onCancel: handleCancel
20759
- },
20760
- mission.id
20761
- )) })
20762
- ] });
19898
+ const body = error ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-xs text-destructive", children: error }) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-xs text-faint", children: "No missions" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: items.map((mission) => /* @__PURE__ */ jsxRuntime.jsx(
19899
+ MissionRow,
19900
+ {
19901
+ mission,
19902
+ busy: busyMissionId === mission.id,
19903
+ canMutate,
19904
+ onOpen: handleOpen,
19905
+ onPause: handlePause,
19906
+ onResume: handleResume,
19907
+ onCancel: handleCancel
19908
+ },
19909
+ mission.id
19910
+ )) });
19911
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "min-w-0 border-t border-line p-1", children: hideHeader ? body : /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { defaultOpen: true, children: [
19912
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { icon: lucideReact.TargetIcon, children: [
19913
+ title,
19914
+ activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: activeCount })
19915
+ ] }),
19916
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: body })
19917
+ ] }) });
20763
19918
  }
20764
19919
  var CITATION_RE = /\[(S\d+(?:\s*,\s*S\d+)*)\]/g;
20765
19920
  function splitCitations(text) {
@@ -20792,17 +19947,15 @@ function CitationText({
20792
19947
  return /* @__PURE__ */ jsxRuntime.jsx("span", { children: seg.value }, i);
20793
19948
  }
20794
19949
  const src = byId.get(seg.value);
20795
- return /* @__PURE__ */ jsxRuntime.jsx(
19950
+ return /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { asChild: true, className: "mx-0.5 cursor-pointer hover:bg-foreground/[0.12]", children: /* @__PURE__ */ jsxRuntime.jsx(
20796
19951
  "button",
20797
19952
  {
20798
19953
  type: "button",
20799
19954
  title: src ? `${src.title} \u2014 ${src.url}` : seg.value,
20800
19955
  onClick: () => onCitationClick?.(seg.value),
20801
- className: "mx-0.5 inline-flex items-center rounded-sm bg-muted px-1 text-[10px] font-semibold text-primary hover:bg-primary/10",
20802
19956
  children: seg.value
20803
- },
20804
- i
20805
- );
19957
+ }
19958
+ ) }, i);
20806
19959
  }) });
20807
19960
  }
20808
19961
 
@@ -20845,6 +19998,11 @@ function scheduleDisplay(item) {
20845
19998
  if (item.kind === "dynamic_loop") return null;
20846
19999
  return item.scheduleDisplay;
20847
20000
  }
20001
+ function statusTone(status) {
20002
+ if (status === "paused") return "warn";
20003
+ if (status === "failed") return "bad";
20004
+ return "muted";
20005
+ }
20848
20006
  function sortScheduledWork(items) {
20849
20007
  return [...items].sort((a, b) => {
20850
20008
  if (a.status === "active" && b.status !== "active") return -1;
@@ -20891,73 +20049,74 @@ function ScheduledWorkRow({
20891
20049
  const stopActionClick = (e) => {
20892
20050
  e.stopPropagation();
20893
20051
  };
20894
- return /* @__PURE__ */ jsxRuntime.jsxs(
20895
- "div",
20052
+ return /* @__PURE__ */ jsxRuntime.jsx(
20053
+ listRow.ListRow,
20896
20054
  {
20897
- className: cn(
20898
- "group flex min-w-0 items-start gap-2 border-l-2 border-l-transparent px-3 py-2 text-sm transition-colors hover:border-l-primary hover:bg-input",
20899
- "min-h-11 md:min-h-0",
20900
- lastSessionId && "cursor-pointer"
20901
- ),
20902
- onClick: openLastRun,
20903
- onKeyDown: handleRowKeyDown,
20904
- role: lastSessionId ? "button" : void 0,
20905
- tabIndex: lastSessionId ? 0 : void 0,
20906
- "aria-label": lastSessionId ? `Open last run for ${title}` : void 0,
20907
- title: lastSessionId ? "Open last run" : void 0,
20908
- children: [
20909
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 flex size-5 shrink-0 items-center justify-center text-faint", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarClockIcon, { className: "size-3.5" }) }),
20910
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
20911
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [
20912
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
20913
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-foreground", children: title }),
20914
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "secondary", className: "shrink-0", children: formatKind(item.kind) }) }),
20915
- meta.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 space-y-0.5 text-xs text-faint", children: meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate", children: line }, line)) })
20916
- ] }),
20917
- statusText && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "destructive", className: "shrink-0", children: statusText })
20918
- ] }),
20919
- item.lastError && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 line-clamp-2 text-xs text-destructive", children: item.lastError })
20055
+ asChild: true,
20056
+ size: "sm",
20057
+ icon: lucideReact.CalendarClockIcon,
20058
+ label: title,
20059
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20060
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mt-0.5 flex gap-1", children: [
20061
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { children: formatKind(item.kind) }),
20062
+ statusText && /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: statusTone(statusText), children: statusText })
20920
20063
  ] }),
20921
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
20922
- showRunNow && /* @__PURE__ */ jsxRuntime.jsx(
20923
- "button",
20924
- {
20925
- type: "button",
20926
- className: "rounded p-2 md:p-1 text-faint opacity-100 md:opacity-70 transition-all hover:bg-line hover:text-foreground disabled:pointer-events-none disabled:opacity-40 md:group-hover:opacity-100",
20927
- onClick: (e) => {
20928
- stopActionClick(e);
20929
- onRunNow(item.id);
20930
- },
20931
- "aria-label": "Run schedule now",
20932
- title: "Run schedule now",
20933
- disabled,
20934
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarClockIcon, { className: "size-3.5" })
20935
- }
20936
- ),
20937
- canCancel && isActive && /* @__PURE__ */ jsxRuntime.jsx(
20938
- "button",
20939
- {
20940
- type: "button",
20941
- className: "rounded p-2 md:p-1 text-faint opacity-100 md:opacity-70 transition-all hover:bg-destructive/10 hover:text-destructive disabled:pointer-events-none disabled:opacity-40 md:group-hover:opacity-100",
20942
- onClick: (e) => {
20943
- stopActionClick(e);
20944
- onCancel(item.id);
20945
- },
20946
- "aria-label": "Cancel schedule",
20947
- title: "Cancel schedule",
20948
- disabled,
20949
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "size-3.5" })
20950
- }
20951
- )
20952
- ] })
20953
- ]
20064
+ meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block truncate", children: line }, line)),
20065
+ item.lastError && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 line-clamp-2 whitespace-normal text-destructive", children: item.lastError })
20066
+ ] }),
20067
+ className: cn("items-start", lastSessionId && "cursor-pointer"),
20068
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20069
+ showRunNow && /* @__PURE__ */ jsxRuntime.jsx(
20070
+ button.Button,
20071
+ {
20072
+ variant: "ghost",
20073
+ size: "icon-xs",
20074
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
20075
+ onClick: (e) => {
20076
+ stopActionClick(e);
20077
+ onRunNow(item.id);
20078
+ },
20079
+ "aria-label": "Run schedule now",
20080
+ title: "Run schedule now",
20081
+ disabled,
20082
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarClockIcon, { className: "size-3.5" })
20083
+ }
20084
+ ),
20085
+ canCancel && isActive && /* @__PURE__ */ jsxRuntime.jsx(
20086
+ button.Button,
20087
+ {
20088
+ variant: "ghost",
20089
+ size: "icon-xs",
20090
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive md:opacity-70 md:group-hover/list-row:opacity-100",
20091
+ onClick: (e) => {
20092
+ stopActionClick(e);
20093
+ onCancel(item.id);
20094
+ },
20095
+ "aria-label": "Cancel schedule",
20096
+ title: "Cancel schedule",
20097
+ disabled,
20098
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "size-3.5" })
20099
+ }
20100
+ )
20101
+ ] }),
20102
+ children: /* @__PURE__ */ jsxRuntime.jsx(
20103
+ "div",
20104
+ {
20105
+ onClick: openLastRun,
20106
+ onKeyDown: handleRowKeyDown,
20107
+ role: lastSessionId ? "button" : void 0,
20108
+ tabIndex: lastSessionId ? 0 : void 0,
20109
+ "aria-label": lastSessionId ? `Open last run for ${title}` : void 0,
20110
+ title: lastSessionId ? "Open last run" : void 0
20111
+ }
20112
+ )
20954
20113
  }
20955
20114
  );
20956
20115
  }
20957
20116
  function ScheduledWorkPanel({
20958
20117
  adapter,
20959
20118
  agentId,
20960
- title = "Scheduled Work",
20119
+ title = "Scheduled work",
20961
20120
  limit = DEFAULT_LIMIT2,
20962
20121
  status = "active",
20963
20122
  hideHeader = false,
@@ -20970,7 +20129,6 @@ function ScheduledWorkPanel({
20970
20129
  const [error, setError] = react.useState(null);
20971
20130
  const [hasEverLoaded, setHasEverLoaded] = react.useState(false);
20972
20131
  const [actionScheduleId, setActionScheduleId] = react.useState(null);
20973
- const [collapsed, setCollapsed] = react.useState(false);
20974
20132
  const mounted = react.useRef(true);
20975
20133
  const requestId = react.useRef(0);
20976
20134
  const lastFingerprint = react.useRef("");
@@ -21076,39 +20234,26 @@ function ScheduledWorkPanel({
21076
20234
  );
21077
20235
  if (!hasEverLoaded) return null;
21078
20236
  if (!adapter.listScheduledWork) return null;
21079
- const showBody = hideHeader || !collapsed;
21080
- return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "min-w-0 border-t border-line", children: [
21081
- !hideHeader && /* @__PURE__ */ jsxRuntime.jsxs(
21082
- "button",
21083
- {
21084
- type: "button",
21085
- className: "flex w-full items-center gap-1.5 px-3 py-2 text-left text-xs font-semibold uppercase tracking-wide text-foreground transition-colors hover:bg-input",
21086
- onClick: () => setCollapsed((current) => !current),
21087
- "aria-expanded": !collapsed,
21088
- children: [
21089
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarClockIcon, { className: "size-3.5" }),
21090
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title }),
21091
- activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-auto", children: activeCount }),
21092
- collapsed ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3.5 shrink-0 text-faint" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-3.5 shrink-0 text-faint" })
21093
- ]
21094
- }
21095
- ),
21096
- showBody && error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-destructive", children: error }),
21097
- showBody && !error && items.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-faint", children: "No scheduled work" }),
21098
- showBody && !error && items.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("pb-2", hideHeader && "pt-1"), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
21099
- ScheduledWorkRow,
21100
- {
21101
- item,
21102
- canRunNow: Boolean(adapter.runScheduledWorkNow),
21103
- canCancel: Boolean(adapter.cancelScheduledWork),
21104
- actionScheduleId,
21105
- onOpenLastRun: handleOpenLastRun,
21106
- onRunNow: handleRunNow,
21107
- onCancel: handleCancel
21108
- },
21109
- item.id
21110
- )) })
21111
- ] });
20237
+ const body = error ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-xs text-destructive", children: error }) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1.5 text-xs text-faint", children: "No scheduled work" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
20238
+ ScheduledWorkRow,
20239
+ {
20240
+ item,
20241
+ canRunNow: Boolean(adapter.runScheduledWorkNow),
20242
+ canCancel: Boolean(adapter.cancelScheduledWork),
20243
+ actionScheduleId,
20244
+ onOpenLastRun: handleOpenLastRun,
20245
+ onRunNow: handleRunNow,
20246
+ onCancel: handleCancel
20247
+ },
20248
+ item.id
20249
+ )) });
20250
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "min-w-0 border-t border-line p-1", children: hideHeader ? body : /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { defaultOpen: true, children: [
20251
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { icon: lucideReact.CalendarClockIcon, children: [
20252
+ title,
20253
+ activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: activeCount })
20254
+ ] }),
20255
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: body })
20256
+ ] }) });
21112
20257
  }
21113
20258
  init_utils();
21114
20259
  var POLL_INTERVAL_ACTIVE_MS = 4e3;
@@ -21213,15 +20358,6 @@ function fallbackSessionTitle(entry) {
21213
20358
  if (entry.runKind === "scheduled") return "Scheduled run";
21214
20359
  return "New session";
21215
20360
  }
21216
- function rowStateClass(isActive, isInActiveGroup) {
21217
- if (isActive) {
21218
- return "bg-faint/30 dark:bg-[#1e2840] text-foreground border-l-primary";
21219
- }
21220
- if (isInActiveGroup) {
21221
- return "bg-line/70 dark:bg-line/60 text-foreground/80 hover:bg-input hover:text-foreground border-l-transparent";
21222
- }
21223
- return "bg-transparent text-foreground/80 hover:bg-input hover:text-foreground border-l-transparent";
21224
- }
21225
20361
  function TreeNodeRow({
21226
20362
  entry,
21227
20363
  depth,
@@ -21248,77 +20384,85 @@ function TreeNodeRow({
21248
20384
  if (hasChildren) setExpanded(isInActiveGroup);
21249
20385
  }, [isInActiveGroup, hasChildren]);
21250
20386
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21251
- /* @__PURE__ */ jsxRuntime.jsxs(
21252
- "div",
20387
+ /* @__PURE__ */ jsxRuntime.jsx(
20388
+ listRow.ListRow,
21253
20389
  {
21254
- role: "button",
21255
- tabIndex: 0,
21256
- onClick: () => onSelect(entry.id),
21257
- onKeyDown: (e) => {
21258
- if (e.key === "Enter" || e.key === " ") onSelect(entry.id);
21259
- },
20390
+ asChild: true,
20391
+ size: "sm",
20392
+ label: title,
20393
+ description: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [
20394
+ entry.computer && // A chat on a folder of the user's computer, in every list of chats, the browser's too.
20395
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-testid": "session-computer", title: `On ${entry.computer}`, className: "inline-flex min-w-0 max-w-[50%] items-center gap-1", children: [
20396
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LaptopIcon, { className: "w-3 h-3 shrink-0", "aria-hidden": "true" }),
20397
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: entry.computer })
20398
+ ] }),
20399
+ entry.computer && subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xB7" }),
20400
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: subtitle })
20401
+ ] }),
20402
+ isActive,
21260
20403
  className: cn(
21261
- "group flex items-center gap-2 w-full py-2 pr-2 text-left cursor-pointer transition-colors border-l-2",
21262
- "min-h-11 md:min-h-0",
21263
- rowStateClass(isActive, isInActiveGroup)
20404
+ "cursor-pointer",
20405
+ !isActive && isInActiveGroup && "bg-foreground/[0.03]"
21264
20406
  ),
21265
20407
  style: { paddingLeft: `${depth * 12 + 12}px` },
21266
- children: [
21267
- hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
21268
- "button",
21269
- {
21270
- type: "button",
21271
- className: "p-2 md:p-0.5 rounded hover:bg-line shrink-0",
21272
- onClick: (e) => {
21273
- e.stopPropagation();
21274
- setExpanded(!expanded);
21275
- },
21276
- "aria-label": expanded ? "Collapse" : "Expand",
21277
- "aria-expanded": expanded,
21278
- children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "w-3.5 h-3.5" })
21279
- }
21280
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-4 h-4 shrink-0" }),
21281
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
21282
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm truncate", children: title }),
21283
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs text-faint min-w-0", children: [
21284
- entry.computer && // A chat on a folder of the user's computer, in every list of chats, the browser's too.
21285
- /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-testid": "session-computer", title: `On ${entry.computer}`, className: "inline-flex min-w-0 max-w-[50%] items-center gap-1", children: [
21286
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LaptopIcon, { className: "w-3 h-3 shrink-0", "aria-hidden": "true" }),
21287
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: entry.computer })
21288
- ] }),
21289
- entry.computer && subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xB7" }),
21290
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: subtitle })
21291
- ] })
21292
- ] }),
20408
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21293
20409
  isRunning && canStop && isChildSession && /* @__PURE__ */ jsxRuntime.jsx(
21294
- "button",
20410
+ button.Button,
21295
20411
  {
21296
- type: "button",
21297
- className: "p-2 md:p-1 rounded opacity-100 md:opacity-0 md:group-hover:opacity-100 hover:bg-destructive/10 hover:text-destructive transition-all",
20412
+ variant: "ghost",
20413
+ size: "icon-xs",
20414
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive md:opacity-0 md:group-hover/list-row:opacity-100 md:focus-visible:opacity-100",
21298
20415
  onClick: (e) => {
21299
20416
  e.stopPropagation();
21300
20417
  onStop(entry.id);
21301
20418
  },
21302
20419
  "aria-label": "Stop child session",
21303
20420
  title: "Stop child session",
21304
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareIcon, { className: "w-3 h-3", fill: "currentColor" })
20421
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareIcon, { fill: "currentColor" })
21305
20422
  }
21306
20423
  ),
21307
20424
  canDelete && /* @__PURE__ */ jsxRuntime.jsx(
21308
- "button",
20425
+ button.Button,
21309
20426
  {
21310
- type: "button",
21311
- className: "p-2 md:p-1 rounded opacity-60 md:opacity-50 md:group-hover:opacity-100 md:focus-visible:opacity-100 hover:bg-destructive/10 hover:text-destructive transition-all",
20427
+ variant: "ghost",
20428
+ size: "icon-xs",
20429
+ className: "text-muted-foreground opacity-60 hover:bg-destructive/10 hover:text-destructive md:opacity-50 md:group-hover/list-row:opacity-100 md:focus-visible:opacity-100",
21312
20430
  onClick: (e) => {
21313
20431
  e.stopPropagation();
21314
20432
  onDelete(entry.id);
21315
20433
  },
21316
20434
  "aria-label": "Delete session",
21317
20435
  title: "Delete session",
21318
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3 h-3" })
20436
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, {})
21319
20437
  }
21320
20438
  )
21321
- ]
20439
+ ] }),
20440
+ children: /* @__PURE__ */ jsxRuntime.jsx(
20441
+ "div",
20442
+ {
20443
+ role: "button",
20444
+ tabIndex: 0,
20445
+ onClick: () => onSelect(entry.id),
20446
+ onKeyDown: (e) => {
20447
+ if (e.key === "Enter" || e.key === " ") onSelect(entry.id);
20448
+ },
20449
+ children: hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
20450
+ button.Button,
20451
+ {
20452
+ variant: "ghost",
20453
+ size: "icon-xs",
20454
+ className: "size-5",
20455
+ onClick: (e) => {
20456
+ e.stopPropagation();
20457
+ setExpanded(!expanded);
20458
+ },
20459
+ "aria-label": expanded ? "Collapse" : "Expand",
20460
+ "aria-expanded": expanded,
20461
+ children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3.5" })
20462
+ }
20463
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-5 shrink-0" })
20464
+ }
20465
+ )
21322
20466
  }
21323
20467
  ),
21324
20468
  hasChildren && expanded && entry.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -21516,11 +20660,15 @@ function SessionTreePanel({
21516
20660
  const topLevel = hideRoot ? roots.flatMap((r) => r.children) : roots;
21517
20661
  if (topLevel.length === 0) return null;
21518
20662
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21519
- !hideHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-t border-line flex items-center gap-1.5 px-3 py-2 text-xs font-semibold uppercase tracking-wide", children: [
21520
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersIcon, { className: "w-3.5 h-3.5" }),
21521
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
21522
- runningCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "h-4 px-1.5 text-[10px] ml-auto", children: runningCount })
21523
- ] }),
20663
+ !hideHeader && /* @__PURE__ */ jsxRuntime.jsx(
20664
+ sectionLabel.SectionLabel,
20665
+ {
20666
+ label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20667
+ title,
20668
+ runningCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: runningCount })
20669
+ ] })
20670
+ }
20671
+ ),
21524
20672
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-destructive", children: error }),
21525
20673
  !error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1 pb-2", children: topLevel.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(
21526
20674
  TreeNodeRow,