@invergent/agent-chat-react 2.19.0 → 2.19.1

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,13 @@ 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 toggle = require('@invergent/ui-sdk/toggle');
10
12
  var confirmDialog = require('@invergent/ui-sdk/confirm-dialog');
11
13
  var dialog = require('@invergent/ui-sdk/dialog');
12
14
  var lucideReact = require('lucide-react');
13
15
  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');
16
+ var buttonGroup = require('@invergent/ui-sdk/button-group');
17
17
  var tooltip = require('@invergent/ui-sdk/tooltip');
18
18
  var cjk = require('@streamdown/cjk');
19
19
  var code = require('@streamdown/code');
@@ -23,27 +23,44 @@ var streamdown = require('streamdown');
23
23
  var reactUseControllableState = require('@radix-ui/react-use-controllable-state');
24
24
  var collapsible = require('@invergent/ui-sdk/collapsible');
25
25
  var thinkingOrbs = require('thinking-orbs');
26
+ var timeline = require('@invergent/ui-sdk/timeline');
27
+ var collapsibleHeader = require('@invergent/ui-sdk/collapsible-header');
26
28
  var scrollArea = require('@invergent/ui-sdk/scroll-area');
27
29
  require('@invergent/ui-sdk/select');
28
30
  var shiki = require('shiki');
29
31
  var tabs = require('@invergent/ui-sdk/tabs');
30
- var badge = require('@invergent/ui-sdk/badge');
32
+ var chip = require('@invergent/ui-sdk/chip');
33
+ var textLink = require('@invergent/ui-sdk/text-link');
31
34
  var diff = require('diff');
32
35
  var AnsiImport = require('ansi-to-react');
33
36
  var textarea = require('@invergent/ui-sdk/textarea');
37
+ var choiceCard = require('@invergent/ui-sdk/choice-card');
34
38
  var input = require('@invergent/ui-sdk/input');
35
- var cmdk = require('cmdk');
39
+ var command = require('@invergent/ui-sdk/command');
40
+ require('@invergent/ui-sdk/hover-card');
36
41
  var inputGroup = require('@invergent/ui-sdk/input-group');
37
- var dropdownMenu = require('@invergent/ui-sdk/dropdown-menu');
38
42
  var spinner = require('@invergent/ui-sdk/spinner');
39
43
  var nanoid = require('nanoid');
40
44
  var brandBeam = require('@invergent/ui-sdk/brand-beam');
45
+ var progressBar = require('@invergent/ui-sdk/progress-bar');
41
46
  require('tokenlens');
47
+ var item = require('@invergent/ui-sdk/item');
42
48
  var popover = require('@invergent/ui-sdk/popover');
49
+ var responsivePanel = require('@invergent/ui-sdk/responsive-panel');
50
+ var cmdk = require('cmdk');
43
51
  var skeleton = require('@invergent/ui-sdk/skeleton');
52
+ var listRow = require('@invergent/ui-sdk/list-row');
53
+ var alert = require('@invergent/ui-sdk/alert');
44
54
  var checkbox = require('@invergent/ui-sdk/checkbox');
45
55
  var label = require('@invergent/ui-sdk/label');
56
+ var segmentedControl = require('@invergent/ui-sdk/segmented-control');
57
+ var rabbitMark = require('@invergent/ui-sdk/rabbit-mark');
58
+ var toggleGroup = require('@invergent/ui-sdk/toggle-group');
59
+ var emptyState = require('@invergent/ui-sdk/empty-state');
60
+ var sectionLabel = require('@invergent/ui-sdk/section-label');
61
+ var controlStyles = require('@invergent/ui-sdk/control-styles');
46
62
  var dateFns = require('date-fns');
63
+ var badge = require('@invergent/ui-sdk/badge');
47
64
  var card = require('@invergent/ui-sdk/card');
48
65
 
49
66
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -354,7 +371,6 @@ function BrowserShell({
354
371
  const [frame, setFrame] = react.useState(null);
355
372
  const [tabs, setTabs] = react.useState([]);
356
373
  const [nav, setNav] = react.useState({ url: "", title: "" });
357
- const [menuOpen, setMenuOpen] = react.useState(false);
358
374
  const [address, setAddress] = react.useState("");
359
375
  const editingRef = react.useRef(false);
360
376
  react.useEffect(() => {
@@ -509,15 +525,14 @@ function BrowserShell({
509
525
  }
510
526
  ),
511
527
  (onToggleControl || hasControl) && /* @__PURE__ */ jsxRuntime.jsx(
512
- button.Button,
528
+ toggle.Toggle,
513
529
  {
514
- type: "button",
515
- variant: hasControl ? "default" : "ghost",
516
- size: "icon-xs",
530
+ size: "sm",
517
531
  "data-testid": "browser-shell-control",
518
532
  "aria-label": hasControl ? "Return control" : "Take control",
519
- "aria-pressed": hasControl,
520
- onClick: onToggleControl,
533
+ pressed: hasControl,
534
+ onPressedChange: () => onToggleControl?.(),
535
+ className: "size-7 min-h-11 min-w-11 px-0 pointer-fine:min-h-0 pointer-fine:min-w-0",
521
536
  children: /* @__PURE__ */ jsxRuntime.jsx(Pointer, {})
522
537
  }
523
538
  ),
@@ -566,51 +581,12 @@ 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(
@@ -1051,39 +1027,6 @@ var ConversationScrollButton = ({
1051
1027
  );
1052
1028
  };
1053
1029
 
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
1030
  // src/components/ai-elements/message.tsx
1088
1031
  init_utils();
1089
1032
  var streamdownRehypePlugins = Object.entries(streamdown.defaultRehypePlugins).map(([name, plugin]) => {
@@ -1402,131 +1345,6 @@ Reasoning.displayName = "Reasoning";
1402
1345
  ReasoningTrigger.displayName = "ReasoningTrigger";
1403
1346
  ReasoningContent.displayName = "ReasoningContent";
1404
1347
 
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
1348
  // src/runtime/orb-state.ts
1531
1349
  var ORB_STATE_LABELS = {
1532
1350
  working: "Working on it...",
@@ -1847,10 +1665,11 @@ function toolErrorSummary(result, max = 180) {
1847
1665
  function CopyButton({ text }) {
1848
1666
  const [copied, setCopied] = react.useState(false);
1849
1667
  return /* @__PURE__ */ jsxRuntime.jsx(
1850
- "button",
1668
+ button.Button,
1851
1669
  {
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",
1670
+ variant: "ghost",
1671
+ size: "icon-xs",
1672
+ className: "opacity-0 text-muted-foreground hover:text-foreground group-hover/in:opacity-100 focus-visible:opacity-100",
1854
1673
  onClick: (e) => {
1855
1674
  e.stopPropagation();
1856
1675
  void navigator.clipboard.writeText(text).then(() => {
@@ -1912,18 +1731,7 @@ function TerminalCollapsible({ command, output, isRunning, hasError }) {
1912
1731
  onOpenChange: setIsOpen,
1913
1732
  className: "not-prose w-full",
1914
1733
  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
- ] }),
1734
+ /* @__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
1735
  /* @__PURE__ */ jsxRuntime.jsx(
1928
1736
  collapsible.CollapsibleContent,
1929
1737
  {
@@ -2050,28 +1858,13 @@ var QueueList = ({
2050
1858
  children,
2051
1859
  className,
2052
1860
  ...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 }) }) });
1861
+ }) => /* @__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
1862
  var QueueSection = ({
2055
1863
  className,
2056
1864
  defaultOpen = true,
2057
1865
  ...props
2058
1866
  }) => /* @__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
- ) });
1867
+ var QueueSectionTrigger = (props) => /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", ...props });
2075
1868
  var QueueSectionLabel = ({
2076
1869
  count,
2077
1870
  label,
@@ -2079,7 +1872,6 @@ var QueueSectionLabel = ({
2079
1872
  className,
2080
1873
  ...props
2081
1874
  }) => /* @__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
1875
  icon,
2084
1876
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2085
1877
  count,
@@ -2090,12 +1882,18 @@ var QueueSectionLabel = ({
2090
1882
  var QueueSectionContent = ({
2091
1883
  className,
2092
1884
  ...props
2093
- }) => /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { className: cn(className), ...props });
1885
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
1886
+ collapsible.CollapsibleContent,
1887
+ {
1888
+ className: cn("border-t border-foreground/[0.08] p-1.5", className),
1889
+ ...props
1890
+ }
1891
+ );
2094
1892
  var Queue = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2095
1893
  "div",
2096
1894
  {
2097
1895
  className: cn(
2098
- "flex flex-col gap-2 rounded-xl border border-border bg-background px-3 pt-2 pb-2 shadow-xs",
1896
+ "flex flex-col overflow-hidden rounded-[10px] border border-foreground/[0.08] bg-background",
2099
1897
  className
2100
1898
  ),
2101
1899
  ...props
@@ -2439,7 +2237,7 @@ var CodeBlockCopyButton = ({
2439
2237
  // src/components/ai-elements/sandbox.tsx
2440
2238
  init_utils();
2441
2239
  var statusLabels = {
2442
- "approval-requested": "Awaiting Approval",
2240
+ "approval-requested": "Awaiting approval",
2443
2241
  "approval-responded": "Responded",
2444
2242
  "input-available": "Running",
2445
2243
  "input-streaming": "Pending",
@@ -2447,16 +2245,25 @@ var statusLabels = {
2447
2245
  "output-denied": "Denied",
2448
2246
  "output-error": "Error"
2449
2247
  };
2248
+ var statusTones = {
2249
+ "approval-requested": "warn",
2250
+ "approval-responded": "muted",
2251
+ "input-available": "muted",
2252
+ "input-streaming": "muted",
2253
+ "output-available": "ok",
2254
+ "output-denied": "warn",
2255
+ "output-error": "bad"
2256
+ };
2450
2257
  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" })
2258
+ "approval-requested": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3" }),
2259
+ "approval-responded": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-3" }),
2260
+ "input-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3 animate-pulse" }),
2261
+ "input-streaming": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleIcon, { className: "size-3" }),
2262
+ "output-available": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircleIcon, { className: "size-3" }),
2263
+ "output-denied": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-3" }),
2264
+ "output-error": /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircleIcon, { className: "size-3" })
2458
2265
  };
2459
- var getStatusBadge = (status) => /* @__PURE__ */ jsxRuntime.jsxs(badge.Badge, { className: "gap-1.5 rounded-full text-xs", variant: "secondary", children: [
2266
+ var getStatusBadge = (status) => /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: statusTones[status], children: [
2460
2267
  statusIcons[status],
2461
2268
  statusLabels[status]
2462
2269
  ] });
@@ -2464,7 +2271,7 @@ var Sandbox = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
2464
2271
  collapsible.Collapsible,
2465
2272
  {
2466
2273
  className: cn(
2467
- "not-prose group mb-4 w-full overflow-hidden rounded-md border border-foreground/20",
2274
+ "not-prose mb-4 w-full overflow-hidden rounded-[10px] border border-foreground/[0.08]",
2468
2275
  className
2469
2276
  ),
2470
2277
  defaultOpen: true,
@@ -2476,22 +2283,17 @@ var SandboxHeader = ({
2476
2283
  title,
2477
2284
  state,
2478
2285
  ...props
2479
- }) => /* @__PURE__ */ jsxRuntime.jsxs(
2480
- collapsible.CollapsibleTrigger,
2286
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
2287
+ collapsibleHeader.CollapsibleHeader,
2481
2288
  {
2482
- className: cn(
2483
- "flex w-full items-center justify-between gap-4 p-3",
2484
- className
2485
- ),
2289
+ variant: "section",
2290
+ icon: lucideReact.Code,
2291
+ className,
2486
2292
  ...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
- ]
2293
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
2294
+ title,
2295
+ getStatusBadge(state)
2296
+ ] })
2495
2297
  }
2496
2298
  );
2497
2299
  var SandboxContent = ({
@@ -2515,7 +2317,7 @@ var SandboxTabsBar = ({
2515
2317
  "div",
2516
2318
  {
2517
2319
  className: cn(
2518
- "flex w-full items-center border-border border-t border-b",
2320
+ "flex w-full items-center border-foreground/[0.08] border-t border-b px-2 py-1.5",
2519
2321
  className
2520
2322
  ),
2521
2323
  ...props
@@ -2524,26 +2326,11 @@ var SandboxTabsBar = ({
2524
2326
  var SandboxTabsList = ({
2525
2327
  className,
2526
2328
  ...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
- );
2329
+ }) => /* @__PURE__ */ jsxRuntime.jsx(tabs.TabsList, { variant: "line", className, ...props });
2534
2330
  var SandboxTabsTrigger = ({
2535
2331
  className,
2536
2332
  ...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
- );
2333
+ }) => /* @__PURE__ */ jsxRuntime.jsx(tabs.TabsTrigger, { className, ...props });
2547
2334
  var SandboxTabContent = ({
2548
2335
  className,
2549
2336
  ...props
@@ -3003,11 +2790,12 @@ function CollapsedBlock({
3003
2790
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex text-sm leading-5 bg-muted/30 border-y border-border/30", children: [
3004
2791
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-10 shrink-0" }),
3005
2792
  /* @__PURE__ */ jsxRuntime.jsxs(
3006
- "button",
2793
+ button.Button,
3007
2794
  {
3008
- type: "button",
2795
+ variant: "ghost",
2796
+ size: "xs",
3009
2797
  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",
2798
+ className: "flex-1 justify-start rounded-none font-normal text-muted-foreground hover:text-foreground",
3011
2799
  children: [
3012
2800
  "\u2195 ",
3013
2801
  count,
@@ -3149,15 +2937,7 @@ function FileNameWithTooltip({
3149
2937
  const display = displayPath(filePath);
3150
2938
  const name = fileName(filePath);
3151
2939
  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 }) }),
2940
+ /* @__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
2941
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { side: "top", children: display })
3162
2942
  ] });
3163
2943
  }
@@ -3581,17 +3361,14 @@ function truncateCommand(cmd, max = 80) {
3581
3361
  }
3582
3362
  function StatusBadge({ status, exitCode }) {
3583
3363
  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: [
3364
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "ok", children: [
3585
3365
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleDotIcon, { className: "size-3 animate-pulse" }),
3586
3366
  "running"
3587
3367
  ] });
3588
3368
  }
3589
3369
  if (status === "exited") {
3590
3370
  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: [
3371
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: ok ? "muted" : "bad", children: [
3595
3372
  ok ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { className: "size-3" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleXIcon, { className: "size-3" }),
3596
3373
  "exited(",
3597
3374
  exitCode ?? "?",
@@ -3599,24 +3376,24 @@ function StatusBadge({ status, exitCode }) {
3599
3376
  ] });
3600
3377
  }
3601
3378
  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: [
3379
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "bad", children: [
3603
3380
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SkullIcon, { className: "size-3" }),
3604
3381
  "killed"
3605
3382
  ] });
3606
3383
  }
3607
3384
  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: [
3385
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "warn", children: [
3609
3386
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ClockIcon, { className: "size-3" }),
3610
3387
  "timeout"
3611
3388
  ] });
3612
3389
  }
3613
3390
  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: [
3391
+ return /* @__PURE__ */ jsxRuntime.jsxs(chip.TonePill, { tone: "warn", children: [
3615
3392
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleXIcon, { className: "size-3" }),
3616
3393
  "interrupted"
3617
3394
  ] });
3618
3395
  }
3619
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-muted-foreground", children: status });
3396
+ return /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { children: status });
3620
3397
  }
3621
3398
  function ProcessListView({ processes }) {
3622
3399
  if (processes.length === 0) {
@@ -3891,36 +3668,16 @@ function ExpertToolBlock({ tc }) {
3891
3668
  const question = args.question ?? args.prompt ?? "";
3892
3669
  const result = parseExpertResult(tc.result);
3893
3670
  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: [
3671
+ return /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { open: expanded, onOpenChange: setExpanded, className: "space-y-1", children: [
3672
+ /* @__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: [
3673
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-medium text-foreground", children: "Consulted expert" }),
3674
+ expertName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate text-muted-foreground", children: [
3675
+ "\xB7 ",
3676
+ expertName
3677
+ ] }),
3678
+ failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-red-500", children: "\xB7 failed" })
3679
+ ] }) }),
3680
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "ml-6 mt-0.5 space-y-1.5 text-sm", children: [
3924
3681
  question && /* @__PURE__ */ jsxRuntime.jsx(ExpertDetail, { label: "Question", content: question }),
3925
3682
  result?.summary && /* @__PURE__ */ jsxRuntime.jsx(
3926
3683
  ExpertDetail,
@@ -4281,25 +4038,20 @@ function QuickReply({
4281
4038
  disabled,
4282
4039
  onSelect
4283
4040
  }) {
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
- );
4041
+ if (stacked) {
4042
+ return /* @__PURE__ */ jsxRuntime.jsx(
4043
+ choiceCard.ChoiceCard,
4044
+ {
4045
+ size: "sm",
4046
+ selected: false,
4047
+ title: choice.label,
4048
+ description: choice.description,
4049
+ disabled,
4050
+ onClick: onSelect
4051
+ }
4052
+ );
4053
+ }
4054
+ return /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", size: "sm", disabled, onClick: onSelect, children: choice.label });
4303
4055
  }
4304
4056
  function BatchAsk({
4305
4057
  tc,
@@ -4415,70 +4167,64 @@ function BatchAsk({
4415
4167
  role: "group",
4416
4168
  "aria-label": "Questions for the user",
4417
4169
  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
- ] }),
4170
+ /* @__PURE__ */ jsxRuntime.jsxs(
4171
+ tabs.Tabs,
4172
+ {
4173
+ value: String(active),
4174
+ onValueChange: (value) => setActive(Number(value)),
4175
+ className: "gap-0",
4176
+ children: [
4177
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2", children: [
4178
+ /* @__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: [
4179
+ "Question ",
4180
+ i + 1,
4181
+ answers[i] !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-emerald-500", children: "\u25CF" })
4182
+ ] }, i)) }),
4183
+ /* @__PURE__ */ jsxRuntime.jsx(
4184
+ button.Button,
4185
+ {
4186
+ type: "button",
4187
+ variant: "ghost",
4188
+ size: "icon-xs",
4189
+ onClick: handleCancel,
4190
+ "aria-label": "Cancel clarification and stop chat",
4191
+ title: "Esc \u2014 cancel and stop the chat",
4192
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-4" })
4193
+ }
4194
+ )
4195
+ ] }),
4196
+ /* @__PURE__ */ jsxRuntime.jsxs(tabs.TabsContent, { value: String(active), children: [
4197
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 pt-3", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: current.prompt }) }),
4198
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-col gap-1.5 px-3 pb-3", children: [
4199
+ (current.choices ?? []).map((choice, i) => /* @__PURE__ */ jsxRuntime.jsx(
4200
+ choiceCard.ChoiceCard,
4201
+ {
4202
+ size: "sm",
4203
+ selected: currentSel.index === i,
4204
+ title: choice.label,
4205
+ description: choice.description,
4206
+ onClick: () => selectChoice(i)
4207
+ },
4208
+ i
4209
+ )),
4210
+ (current.allow_other ?? true) && /* @__PURE__ */ jsxRuntime.jsx(
4211
+ OtherRow,
4212
+ {
4213
+ selected: currentSel.index >= OTHER_INDEX_OFFSET,
4214
+ value: currentSel.other,
4215
+ onSelect: () => updateSelection({ index: OTHER_INDEX_OFFSET }),
4216
+ onChange: (v) => updateSelection({ index: OTHER_INDEX_OFFSET, other: v }),
4217
+ onCommit: () => {
4218
+ if (allAnswered) void handleSubmit();
4219
+ else advance();
4220
+ }
4221
+ }
4222
+ )
4223
+ ] })
4224
+ ] })
4225
+ ]
4226
+ }
4227
+ ),
4482
4228
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-t border-border px-3 py-2", children: [
4483
4229
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 text-xs text-muted-foreground", children: [
4484
4230
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mr-2 tabular-nums", children: [
@@ -4505,30 +4251,6 @@ function BatchAsk({
4505
4251
  }
4506
4252
  );
4507
4253
  }
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
4254
  function OtherRow({
4533
4255
  selected,
4534
4256
  value,
@@ -4540,55 +4262,33 @@ function OtherRow({
4540
4262
  "div",
4541
4263
  {
4542
4264
  className: cn(
4543
- "flex items-start gap-3 rounded px-2 py-1.5 transition-colors",
4544
- selected ? "bg-muted" : "hover:bg-muted/40"
4265
+ choiceCard.choiceCardVariants({ size: "sm", selected }),
4266
+ "cursor-pointer flex-col gap-1.5 sm:gap-1.5"
4545
4267
  ),
4268
+ onClick: onSelect,
4546
4269
  children: [
4270
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[14px] font-medium text-foreground sm:text-[13px]", children: "Other" }),
4547
4271
  /* @__PURE__ */ jsxRuntime.jsx(
4548
- "button",
4272
+ input.Input,
4549
4273
  {
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 })
4274
+ "aria-label": "Other answer",
4275
+ placeholder: "Type your answer\u2026",
4276
+ value,
4277
+ onFocus: onSelect,
4278
+ onChange: (e) => onChange(e.target.value),
4279
+ onKeyDown: (e) => {
4280
+ if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && value.trim()) {
4281
+ e.preventDefault();
4282
+ onCommit();
4283
+ }
4284
+ },
4285
+ className: "h-8 text-[13px]"
4555
4286
  }
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
- ] })
4287
+ )
4576
4288
  ]
4577
4289
  }
4578
4290
  );
4579
4291
  }
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
4292
  function BatchAskLocked({
4593
4293
  tc,
4594
4294
  questions,
@@ -4705,28 +4405,17 @@ function MemoryToolBlock({ tc }) {
4705
4405
  const targetLabel = TARGET_LABEL[target] ?? target;
4706
4406
  const failed = result?.success === false || !!result?.error;
4707
4407
  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 }),
4408
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { className: "-ml-2 w-fit max-w-full", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
4409
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-foreground", children: verb }),
4410
+ " ",
4411
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
4412
+ prep,
4711
4413
  " ",
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" })
4414
+ targetLabel
4719
4415
  ] }),
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
- ] }),
4416
+ result?.usage && !failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/60 ml-1.5 text-xs", children: result.usage }),
4417
+ failed && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-500 ml-1.5", children: "\xB7 failed" })
4418
+ ] }) }),
4730
4419
  /* @__PURE__ */ jsxRuntime.jsx(
4731
4420
  collapsible.CollapsibleContent,
4732
4421
  {
@@ -4831,9 +4520,6 @@ function CoordinatorToolBlock({ tc }) {
4831
4520
  ] })
4832
4521
  ] });
4833
4522
  }
4834
-
4835
- // src/components/chat/tools/default-tool.tsx
4836
- init_utils();
4837
4523
  var TOOL_LABELS = {
4838
4524
  kb_list_pages: "Knowledge Base",
4839
4525
  kb_read_page: "Read KB Page",
@@ -4868,35 +4554,14 @@ function StatusIcon({ tc }) {
4868
4554
  return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2Icon, { className: "size-3.5 text-emerald-500" });
4869
4555
  }
4870
4556
  function DefaultToolBlock({ tc }) {
4871
- const [expanded, setExpanded] = react.useState(false);
4872
4557
  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: [
4558
+ return /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { className: "overflow-hidden rounded-[10px] border border-foreground/[0.08]", children: [
4559
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
4560
+ /* @__PURE__ */ jsxRuntime.jsx(StatusIcon, { tc }),
4561
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: toolLabel(tc.toolName) }),
4562
+ summary && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-xs font-normal text-muted-foreground/70", children: summary })
4563
+ ] }) }),
4564
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "space-y-2 border-t border-foreground/[0.08] px-3 py-2", children: [
4900
4565
  /* @__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
4566
  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
4567
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-emerald-600 dark:text-emerald-400 font-semibold", children: "Result" }),
@@ -4968,18 +4633,7 @@ function CodeRunToolBlock({
4968
4633
  onOpenChange: setIsOpen,
4969
4634
  className: "not-prose w-full",
4970
4635
  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
- ] }),
4636
+ /* @__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
4637
  /* @__PURE__ */ jsxRuntime.jsx(
4984
4638
  collapsible.CollapsibleContent,
4985
4639
  {
@@ -5659,90 +5313,7 @@ function renderInlineMarkdown(text) {
5659
5313
  });
5660
5314
  }
5661
5315
 
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
- }
5316
+ // src/components/ai-elements/prompt-input.tsx
5746
5317
  init_utils();
5747
5318
  var convertBlobUrlToDataUrl = async (url) => {
5748
5319
  try {
@@ -6449,34 +6020,6 @@ function splitComposerFiles(files) {
6449
6020
  return { images, pending };
6450
6021
  }
6451
6022
 
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
6023
  // src/components/ai-elements/context.tsx
6481
6024
  init_utils();
6482
6025
  var PERCENT_MAX = 100;
@@ -6593,20 +6136,9 @@ var ContextContentHeader = ({
6593
6136
  ] })
6594
6137
  ] }),
6595
6138
  /* @__PURE__ */ jsxRuntime.jsx(
6596
- Progress,
6139
+ progressBar.ProgressBar,
6597
6140
  {
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
- ),
6141
+ color: nearlyFull ? "var(--destructive)" : "var(--color-amber-500)",
6610
6142
  value: usedPercent * PERCENT_MAX
6611
6143
  }
6612
6144
  )
@@ -6620,236 +6152,38 @@ var ContextContentBody = ({
6620
6152
 
6621
6153
  // src/components/chat/chat-composer.tsx
6622
6154
  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
6155
+ var SEARCH_PLACEHOLDER = {
6156
+ commands: "Search commands\u2026",
6157
+ skills: "Search skills\u2026",
6158
+ scheduled: "Search scheduled tasks\u2026",
6159
+ all: "Type a command or search\u2026"
6160
+ };
6161
+ var NAV_HINT = "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc dismiss";
6162
+ var SEARCH_HINT = {
6163
+ commands: NAV_HINT,
6164
+ skills: "Esc dismiss",
6165
+ scheduled: NAV_HINT,
6166
+ all: NAV_HINT
6167
+ };
6168
+ var NAME_COLUMNS = "grid-cols-[120px_minmax(0,1fr)] sm:grid-cols-[200px_minmax(0,1fr)]";
6169
+ 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`;
6170
+ function ComposerCommandMenu({
6171
+ menuMode,
6172
+ searchQuery,
6173
+ onSearchChange,
6174
+ skillsLoading,
6175
+ builtinCommands,
6176
+ adapterCommands,
6177
+ scheduledExamples,
6178
+ onCommandSelect,
6179
+ onEscapeDismiss
6685
6180
  }) {
6181
+ const controlledSearch = menuMode === "commands" || menuMode === "all";
6182
+ const showCommands = menuMode === "commands" || menuMode === "all";
6183
+ const showSkills = menuMode === "skills" || menuMode === "all";
6184
+ const skillsUnattached = menuMode === "skills" && !skillsLoading && adapterCommands.length === 0;
6686
6185
  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,
6186
+ popover.PopoverContent,
6853
6187
  {
6854
6188
  side: "top",
6855
6189
  align: "start",
@@ -6865,7 +6199,7 @@ function ComposerCommandMenu({
6865
6199
  onEscapeKeyDown: () => {
6866
6200
  onEscapeDismiss();
6867
6201
  },
6868
- children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { children: [
6202
+ children: /* @__PURE__ */ jsxRuntime.jsxs(command.Command, { children: [
6869
6203
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-14 items-center gap-3 border-b border-border px-4.5", children: [
6870
6204
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4.5 shrink-0 text-muted-foreground" }),
6871
6205
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -6882,8 +6216,8 @@ function ComposerCommandMenu({
6882
6216
  skillsUnattached ? /* @__PURE__ */ jsxRuntime.jsx(SkillsEmptyState, {}) : (
6883
6217
  // A fixed height, not content height: the popup must not jump as
6884
6218
  // 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." }),
6219
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { className: "h-66 max-h-none px-2.5 py-2", children: [
6220
+ !(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
6221
  showSkills && skillsLoading && adapterCommands.length === 0 && [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsxs(
6888
6222
  "div",
6889
6223
  {
@@ -6935,7 +6269,7 @@ function MenuRow({
6935
6269
  onSelect
6936
6270
  }) {
6937
6271
  return /* @__PURE__ */ jsxRuntime.jsxs(
6938
- CommandItem,
6272
+ command.CommandItem,
6939
6273
  {
6940
6274
  value: cmd.value,
6941
6275
  keywords: keywords ?? [cmd.description],
@@ -7234,19 +6568,19 @@ function AttachmentPreviewStrip() {
7234
6568
  const sizeLabel = formatBytes2(file.file?.size);
7235
6569
  const Icon = iconForMime2(file.mediaType);
7236
6570
  return /* @__PURE__ */ jsxRuntime.jsxs(
7237
- Item,
6571
+ item.Item,
7238
6572
  {
7239
6573
  variant: "outline",
7240
6574
  size: "xs",
7241
6575
  className: "group w-auto max-w-[18rem] rounded-md",
7242
6576
  title: file.filename,
7243
6577
  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 })
6578
+ /* @__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, {}) }),
6579
+ /* @__PURE__ */ jsxRuntime.jsxs(item.ItemContent, { className: "min-w-0", children: [
6580
+ /* @__PURE__ */ jsxRuntime.jsx(item.ItemTitle, { className: "block w-full truncate normal-case font-medium text-foreground", children: file.filename }),
6581
+ sizeLabel && /* @__PURE__ */ jsxRuntime.jsx(item.ItemDescription, { className: "text-xs", children: sizeLabel })
7248
6582
  ] }),
7249
- /* @__PURE__ */ jsxRuntime.jsx(ItemActions, { children: /* @__PURE__ */ jsxRuntime.jsx(
6583
+ /* @__PURE__ */ jsxRuntime.jsx(item.ItemActions, { children: /* @__PURE__ */ jsxRuntime.jsx(
7250
6584
  "button",
7251
6585
  {
7252
6586
  type: "button",
@@ -7620,7 +6954,7 @@ function ChatComposerInner({
7620
6954
  /* @__PURE__ */ jsxRuntime.jsxs(PromptInputFooter, { className: "gap-1.5 px-3 pt-2 pb-3", children: [
7621
6955
  /* @__PURE__ */ jsxRuntime.jsxs(PromptInputTools, { className: "gap-1.5", children: [
7622
6956
  showToolsPanel && /* @__PURE__ */ jsxRuntime.jsx(
7623
- ResponsivePanel,
6957
+ responsivePanel.ResponsivePanel,
7624
6958
  {
7625
6959
  open: addMenuOpen,
7626
6960
  onOpenChange: (open) => {
@@ -7639,10 +6973,10 @@ function ChatComposerInner({
7639
6973
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, { className: "size-4.5" })
7640
6974
  }
7641
6975
  ),
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: [
6976
+ children: /* @__PURE__ */ jsxRuntime.jsx(command.Command, { children: /* @__PURE__ */ jsxRuntime.jsxs(command.CommandList, { className: "max-md:max-h-none", children: [
6977
+ canAttach && /* @__PURE__ */ jsxRuntime.jsxs(command.CommandGroup, { heading: "Attach", children: [
7644
6978
  /* @__PURE__ */ jsxRuntime.jsxs(
7645
- CommandItem,
6979
+ command.CommandItem,
7646
6980
  {
7647
6981
  onSelect: () => {
7648
6982
  setAddMenuOpen(false);
@@ -7655,23 +6989,23 @@ function ChatComposerInner({
7655
6989
  ]
7656
6990
  }
7657
6991
  ),
7658
- /* @__PURE__ */ jsxRuntime.jsxs(CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
6992
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
7659
6993
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CloudIcon, { className: "size-4 shrink-0 text-sky-500" }),
7660
6994
  "Add from OneDrive"
7661
6995
  ] }),
7662
- /* @__PURE__ */ jsxRuntime.jsxs(CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
6996
+ /* @__PURE__ */ jsxRuntime.jsxs(command.CommandItem, { disabled: true, className: TOOLS_ITEM_CLASS, children: [
7663
6997
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HardDriveIcon, { className: "size-4 shrink-0 text-emerald-500" }),
7664
6998
  "Add from Google Drive"
7665
6999
  ] })
7666
7000
  ] }),
7667
- canPickProfile && /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { heading: "Browser profile", children: browserProfileLocked ? (
7001
+ canPickProfile && /* @__PURE__ */ jsxRuntime.jsx(command.CommandGroup, { heading: "Browser profile", children: browserProfileLocked ? (
7668
7002
  // A profile is bound at session creation and cannot
7669
7003
  // change mid-session. In a menu there is nothing to
7670
7004
  // hover, so the reason is stated outright rather
7671
7005
  // than hidden in a tooltip as it was on the button.
7672
7006
  /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7673
7007
  /* @__PURE__ */ jsxRuntime.jsxs(
7674
- CommandItem,
7008
+ command.CommandItem,
7675
7009
  {
7676
7010
  disabled: true,
7677
7011
  "data-checked": !!browserProfileId || void 0,
@@ -7691,7 +7025,7 @@ function ChatComposerInner({
7691
7025
  { id: null, name: "No profile" },
7692
7026
  ...browserProfiles ?? []
7693
7027
  ].map((p) => /* @__PURE__ */ jsxRuntime.jsxs(
7694
- CommandItem,
7028
+ command.CommandItem,
7695
7029
  {
7696
7030
  onSelect: () => {
7697
7031
  setAddMenuOpen(false);
@@ -7761,7 +7095,7 @@ function ChatComposerInner({
7761
7095
  outputTokenDetails: void 0
7762
7096
  },
7763
7097
  children: /* @__PURE__ */ jsxRuntime.jsxs(
7764
- ResponsivePanel,
7098
+ responsivePanel.ResponsivePanel,
7765
7099
  {
7766
7100
  open: contextOpen,
7767
7101
  onOpenChange: setContextOpen,
@@ -7933,9 +7267,6 @@ function Logo({ row }) {
7933
7267
  }
7934
7268
  );
7935
7269
  }
7936
-
7937
- // src/components/research/research-sources-panel.tsx
7938
- init_utils();
7939
7270
  function ResearchSourcesPanel({
7940
7271
  sources
7941
7272
  }) {
@@ -7955,50 +7286,36 @@ function ResearchSourcesPanel({
7955
7286
  }, []);
7956
7287
  if (sources.length === 0) return null;
7957
7288
  return /* @__PURE__ */ jsxRuntime.jsxs(
7958
- "div",
7289
+ collapsible.Collapsible,
7959
7290
  {
7960
7291
  ref: rootRef,
7961
- className: "rounded-md border border-line bg-card",
7292
+ open: expanded,
7293
+ onOpenChange: setExpanded,
7294
+ className: "rounded-[10px] border border-foreground/[0.08] bg-card",
7962
7295
  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",
7296
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { variant: "section", children: [
7297
+ "Sources \xB7 ",
7298
+ sources.length
7299
+ ] }),
7300
+ /* @__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(
7301
+ listRow.ListRow,
7989
7302
  {
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
- ]
7303
+ asChild: true,
7304
+ size: "sm",
7305
+ label: s.title || s.url,
7306
+ meta: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block max-w-40 truncate", children: hostname2(s.url) }),
7307
+ children: /* @__PURE__ */ jsxRuntime.jsx(
7308
+ "a",
7309
+ {
7310
+ id: `source-${s.sourceId}`,
7311
+ href: s.url,
7312
+ target: "_blank",
7313
+ rel: "noreferrer",
7314
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[12px] font-medium text-amber-500 tabular-nums", children: s.sourceId })
7315
+ }
7316
+ )
8000
7317
  }
8001
- ) }, s.sourceId)) })
7318
+ ) }, s.sourceId)) }) })
8002
7319
  ]
8003
7320
  }
8004
7321
  );
@@ -8524,24 +7841,26 @@ function ArtifactHtml({
8524
7841
  ),
8525
7842
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
8526
7843
  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: [
7844
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
8528
7845
  /* @__PURE__ */ jsxRuntime.jsx(
8529
- "button",
7846
+ button.Button,
8530
7847
  {
8531
- type: "button",
7848
+ variant: "ghost",
7849
+ size: "icon-xs",
8532
7850
  onClick: () => setZoom((z) => clamp4(z - ZOOM_STEP)),
8533
7851
  disabled: zoom <= MIN_ZOOM,
8534
- className: "hover:text-foreground disabled:opacity-40 cursor-pointer",
7852
+ className: "text-muted-foreground hover:text-foreground",
8535
7853
  "aria-label": "zoom out",
8536
- children: "\u2212"
7854
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusIcon, {})
8537
7855
  }
8538
7856
  ),
8539
7857
  /* @__PURE__ */ jsxRuntime.jsxs(
8540
- "button",
7858
+ button.Button,
8541
7859
  {
8542
- type: "button",
7860
+ variant: "ghost",
7861
+ size: "xs",
8543
7862
  onClick: () => setZoom(1),
8544
- className: "tabular-nums hover:text-foreground",
7863
+ className: "font-normal tabular-nums text-muted-foreground hover:text-foreground",
8545
7864
  "aria-label": "reset zoom",
8546
7865
  children: [
8547
7866
  Math.round(zoom * 100),
@@ -8550,25 +7869,27 @@ function ArtifactHtml({
8550
7869
  }
8551
7870
  ),
8552
7871
  /* @__PURE__ */ jsxRuntime.jsx(
8553
- "button",
7872
+ button.Button,
8554
7873
  {
8555
- type: "button",
7874
+ variant: "ghost",
7875
+ size: "icon-xs",
8556
7876
  onClick: () => setZoom((z) => clamp4(z + ZOOM_STEP)),
8557
7877
  disabled: zoom >= MAX_ZOOM,
8558
- className: "hover:text-foreground disabled:opacity-40",
7878
+ className: "text-muted-foreground hover:text-foreground",
8559
7879
  "aria-label": "zoom in",
8560
- children: "+"
7880
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PlusIcon, {})
8561
7881
  }
8562
7882
  ),
8563
7883
  !fill && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
8564
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-border", children: "|" }),
7884
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "h-4 w-px bg-border" }),
8565
7885
  /* @__PURE__ */ jsxRuntime.jsx(
8566
- "button",
7886
+ button.Button,
8567
7887
  {
8568
- type: "button",
7888
+ variant: "ghost",
7889
+ size: "xs",
8569
7890
  onClick: () => setExpanded((v) => !v),
8570
- className: "hover:text-foreground",
8571
- children: expanded ? "collapse" : "expand"
7891
+ className: "font-normal text-muted-foreground hover:text-foreground",
7892
+ children: expanded ? "Collapse" : "Expand"
8572
7893
  }
8573
7894
  )
8574
7895
  ] })
@@ -8960,61 +8281,50 @@ var ErrorMessage = react.memo(function ErrorMessage2({
8960
8281
  setRetryPending(false);
8961
8282
  }
8962
8283
  };
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
- );
8284
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "destructive", className: cn("gap-y-2", className), children: [
8285
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}),
8286
+ /* @__PURE__ */ jsxRuntime.jsx(alert.AlertTitle, { children: errorInfo.title }),
8287
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertDescription, { className: "flex min-w-0 flex-col items-start gap-2", children: [
8288
+ errorInfo.detail && /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { variant: "muted", size: "sm", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
8289
+ "button",
8290
+ {
8291
+ type: "button",
8292
+ onClick: () => setDetailOpen((open) => !open),
8293
+ "aria-expanded": detailOpen,
8294
+ children: [
8295
+ detailOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {}),
8296
+ detailOpen ? "Hide details" : "Show details"
8297
+ ]
8298
+ }
8299
+ ) }),
8300
+ 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 }),
8301
+ (showRetry || onDismiss) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 pt-1", children: [
8302
+ showRetry && /* @__PURE__ */ jsxRuntime.jsxs(
8303
+ button.Button,
8304
+ {
8305
+ size: "xs",
8306
+ variant: "secondary",
8307
+ onClick: handleRetry,
8308
+ disabled: retryPending,
8309
+ children: [
8310
+ /* @__PURE__ */ jsxRuntime.jsx(
8311
+ lucideReact.RefreshCw,
8312
+ {
8313
+ className: cn("size-3", retryPending && "animate-spin")
8314
+ }
8315
+ ),
8316
+ retryPending ? "Retrying\u2026" : "Retry"
8317
+ ]
8318
+ }
8319
+ ),
8320
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "xs", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
8321
+ ] }),
8322
+ retryError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-1 text-xs text-destructive", role: "status", children: [
8323
+ "Retry failed: ",
8324
+ retryError
8325
+ ] })
8326
+ ] })
8327
+ ] });
9018
8328
  });
9019
8329
  function parseRequestedTokens(detail) {
9020
8330
  const m = detail.match(/["']?requested["']?\s*[:=]\s*(\d+)/);
@@ -9027,34 +8337,24 @@ var InsufficientCreditsCard = react.memo(function InsufficientCreditsCard2({
9027
8337
  }) {
9028
8338
  const { onOpenBilling } = useAgentChatAdapterContext();
9029
8339
  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
- );
8340
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "warning", className: cn("gap-y-2", className), children: [
8341
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, {}),
8342
+ /* @__PURE__ */ jsxRuntime.jsx(alert.AlertTitle, { children: "You're out of credits" }),
8343
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertDescription, { className: "flex flex-col items-start gap-2", children: [
8344
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { children: [
8345
+ "This run was blocked by the token-credit limit",
8346
+ requested ? ` (it needed ~${requested.toLocaleString()} tokens)` : "",
8347
+ ". Buy additional credits or upgrade your plan to keep your agents running."
8348
+ ] }),
8349
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 pt-1", children: [
8350
+ onOpenBilling && /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", onClick: onOpenBilling, children: [
8351
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "size-4" }),
8352
+ "Go to Billing"
8353
+ ] }),
8354
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "sm", variant: "ghost", onClick: onDismiss, children: "Dismiss" })
8355
+ ] })
8356
+ ] })
8357
+ ] });
9058
8358
  });
9059
8359
  init_utils();
9060
8360
  var DOCUMENT = { icon: lucideReact.FileTextIcon, kind: "Document" };
@@ -9364,15 +8664,7 @@ function WorkerCard({ worker }) {
9364
8664
  return (
9365
8665
  // A long name is cut, its mark never.
9366
8666
  /* @__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 }) }),
8667
+ 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
8668
  mark && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-mark": landing, className: "shrink-0 whitespace-pre text-muted-foreground", children: ` \xB7 ${mark}` })
9377
8669
  ] }, `${file.kind}:${file.ref}`)
9378
8670
  );
@@ -9867,17 +9159,17 @@ function TimelineEntryItem({
9867
9159
  const hideArtifactFailure = rawStatus === "error" && entry.tc.toolName === "create_artifact";
9868
9160
  const indicatorStatus = hideArtifactFailure ? "running" : rawStatus;
9869
9161
  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)" } }),
9162
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9163
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9164
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9873
9165
  /* @__PURE__ */ jsxRuntime.jsx(
9874
- TimelineIndicator,
9166
+ timeline.TimelineIndicator,
9875
9167
  {
9876
9168
  className: cn("size-2 border-none", statusColorClass(indicatorStatus))
9877
9169
  }
9878
9170
  )
9879
9171
  ] }),
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: [
9172
+ /* @__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
9173
  /* @__PURE__ */ jsxRuntime.jsx(
9882
9174
  ToolCallBlock,
9883
9175
  {
@@ -9893,24 +9185,24 @@ function TimelineEntryItem({
9893
9185
  ] });
9894
9186
  }
9895
9187
  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" })
9188
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9189
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9190
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9191
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-amber-500" })
9900
9192
  ] }),
9901
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(BrowserActivityGroup, { calls: entry.calls }) })
9193
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(BrowserActivityGroup, { calls: entry.calls }) })
9902
9194
  ] });
9903
9195
  }
9904
9196
  if (entry.kind === "web_search_group") {
9905
9197
  const allComplete = entry.calls.every((tc) => tc.status === "complete");
9906
9198
  const anyRunning = entry.calls.some((tc) => tc.status === "running");
9907
9199
  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) })
9200
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9201
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9202
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9203
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: cn("size-2 border-none", indicatorClass) })
9912
9204
  ] }),
9913
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(WebSearchGroupBlock, { tcs: entry.calls }) })
9205
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(WebSearchGroupBlock, { tcs: entry.calls }) })
9914
9206
  ] });
9915
9207
  }
9916
9208
  if (entry.kind === "text") {
@@ -9920,11 +9212,11 @@ function TimelineEntryItem({
9920
9212
  return /* @__PURE__ */ jsxRuntime.jsx(NarrationEntry, { entry, step });
9921
9213
  }
9922
9214
  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)" } }),
9215
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9216
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9217
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9926
9218
  /* @__PURE__ */ jsxRuntime.jsx(
9927
- TimelineIndicator,
9219
+ timeline.TimelineIndicator,
9928
9220
  {
9929
9221
  className: cn(
9930
9222
  "size-2 border-none",
@@ -9933,7 +9225,7 @@ function TimelineEntryItem({
9933
9225
  }
9934
9226
  )
9935
9227
  ] }),
9936
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9228
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9937
9229
  "div",
9938
9230
  {
9939
9231
  className: cn(
@@ -9950,21 +9242,21 @@ function TimelineEntryItem({
9950
9242
  ] });
9951
9243
  }
9952
9244
  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" })
9245
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9246
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9247
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9248
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
9957
9249
  ] }),
9958
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ThreadCards, { message: entry.message }) })
9250
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ThreadCards, { message: entry.message }) })
9959
9251
  ] });
9960
9252
  }
9961
9253
  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" })
9254
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9255
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9256
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9257
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-emerald-500" })
9966
9258
  ] }),
9967
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 py-1 text-sm ", children: [
9259
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 py-1 text-sm ", children: [
9968
9260
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: "Skill" }),
9969
9261
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground/60 truncate", children: entry.skill }),
9970
9262
  entry.stagedAt && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-foreground/60/70 ", children: [
@@ -9975,12 +9267,12 @@ function TimelineEntryItem({
9975
9267
  ] });
9976
9268
  }
9977
9269
  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" })
9270
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9271
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9272
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9273
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-sky-500" })
9982
9274
  ] }),
9983
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: sessionId ? /* @__PURE__ */ jsxRuntime.jsx(
9275
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: sessionId ? /* @__PURE__ */ jsxRuntime.jsx(
9984
9276
  ArtifactBlock,
9985
9277
  {
9986
9278
  sessionId: entry.originatingSessionId ?? sessionId,
@@ -9992,12 +9284,12 @@ function TimelineEntryItem({
9992
9284
  ) : null })
9993
9285
  ] });
9994
9286
  }
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" })
9287
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9288
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9289
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9290
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-primary" })
9999
9291
  ] }),
10000
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
9292
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx(OrbShimmerLabel, { state: "working", label: "Working on it...", className: "py-0.5" }) })
10001
9293
  ] });
10002
9294
  }
10003
9295
  function ReasoningEntry({
@@ -10005,12 +9297,12 @@ function ReasoningEntry({
10005
9297
  step
10006
9298
  }) {
10007
9299
  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" })
9300
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9301
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9302
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9303
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2" })
10012
9304
  ] }),
10013
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(Reasoning, { isStreaming: entry.isStreaming, children: [
9305
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsxs(Reasoning, { isStreaming: entry.isStreaming, children: [
10014
9306
  /* @__PURE__ */ jsxRuntime.jsx(ReasoningTrigger, {}),
10015
9307
  /* @__PURE__ */ jsxRuntime.jsx(ReasoningContent, { children: reasoning })
10016
9308
  ] }) })
@@ -10024,12 +9316,12 @@ function NarrationEntry({
10024
9316
  const { action, inferredNarration } = stripAndParseNextAction(text);
10025
9317
  const line = action ? action.body.trim().toLowerCase() === "done" ? null : action.body : inferredNarration;
10026
9318
  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" })
9319
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9320
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9321
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9322
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/30" })
10031
9323
  ] }),
10032
- /* @__PURE__ */ jsxRuntime.jsx(TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: renderInlineMarkdown(line) }) })
9324
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: renderInlineMarkdown(line) }) })
10033
9325
  ] });
10034
9326
  }
10035
9327
  function TextEntry({
@@ -10038,12 +9330,12 @@ function TextEntry({
10038
9330
  }) {
10039
9331
  const content = useSmoothStream(entry.content, entry.isStreaming);
10040
9332
  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" })
9333
+ return /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineItem, { step, children: [
9334
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineHeader, { children: [
9335
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineSeparator, { style: { backgroundColor: "var(--color-border)" } }),
9336
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.TimelineIndicator, { className: "size-2 border-none bg-foreground/40" })
10045
9337
  ] }),
10046
- /* @__PURE__ */ jsxRuntime.jsxs(TimelineContent, { children: [
9338
+ /* @__PURE__ */ jsxRuntime.jsxs(timeline.TimelineContent, { children: [
10047
9339
  /* @__PURE__ */ jsxRuntime.jsx(LoopResultAffordance, { message: entry.msg }),
10048
9340
  /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { children: cleaned }),
10049
9341
  entry.isFinalTurnText && entry.msg.status === "complete" && /* @__PURE__ */ jsxRuntime.jsx(TurnFeedback, { msg: entry.msg })
@@ -10223,7 +9515,7 @@ function useElapsedSeconds(since) {
10223
9515
  function formatElapsed(seconds) {
10224
9516
  return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m ${seconds % 60}s`;
10225
9517
  }
10226
- function CommandGroup2({ commands, live }) {
9518
+ function CommandGroup3({ commands, live }) {
10227
9519
  const [chosen, setChosen] = react.useState(null);
10228
9520
  const open = chosen ?? live !== void 0;
10229
9521
  const elapsed = useElapsedSeconds(live ? (commands[0]?.message ?? live).createdAt : void 0);
@@ -10311,7 +9603,7 @@ function IterationGroup({
10311
9603
  return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-0.5 text-sm text-muted-foreground", children: reasoningTokenLabel(message, false) });
10312
9604
  }
10313
9605
  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 });
9606
+ return commands.length === 1 ? /* @__PURE__ */ jsxRuntime.jsx(CommandRow, { label: commands[0].label, calls: commands[0].calls }) : /* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands });
10315
9607
  }
10316
9608
  function deriveFileArtifactsFromMessages(messages) {
10317
9609
  const terminalCommands = [];
@@ -10386,10 +9678,10 @@ function SimpleAssistantGroup({
10386
9678
  const endRun = (live) => {
10387
9679
  const key = (run[0]?.message ?? live)?.id;
10388
9680
  if (live && (run.length > 0 || liveCommands(live).length > 0)) {
10389
- rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup2, { commands: run, live }, key));
9681
+ rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands: run, live }, key));
10390
9682
  } else {
10391
9683
  if (run.length > 1) {
10392
- rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup2, { commands: run }, key));
9684
+ rows.push(/* @__PURE__ */ jsxRuntime.jsx(CommandGroup3, { commands: run }, key));
10393
9685
  } else if (run.length === 1) {
10394
9686
  rows.push(
10395
9687
  /* @__PURE__ */ jsxRuntime.jsx(CommandRow, { label: run[0].label, calls: run[0].calls }, run[0].key)
@@ -10521,7 +9813,7 @@ function AssistantGroup({
10521
9813
  const tail = messages[messages.length - 1];
10522
9814
  const showErrorInfo = tail && tail.role === "assistant" && tail.status === "error" && !!tail.errorInfo;
10523
9815
  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(
9816
+ /* @__PURE__ */ jsxRuntime.jsx(timeline.Timeline, { defaultValue: 999, className: "gap-0", children: entries.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsx(
10525
9817
  TimelineEntryItem,
10526
9818
  {
10527
9819
  entry,
@@ -10536,34 +9828,30 @@ function AssistantGroup({
10536
9828
  }
10537
9829
  function RetryBanner({ indicator }) {
10538
9830
  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
- );
9831
+ return /* @__PURE__ */ jsxRuntime.jsxs(alert.Alert, { variant: "warning", role: "status", children: [
9832
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, {}),
9833
+ /* @__PURE__ */ jsxRuntime.jsxs(alert.AlertTitle, { className: "flex min-w-0 items-center gap-2 font-medium", children: [
9834
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: indicator.title }),
9835
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "shrink-0 text-[11.5px] font-normal opacity-70", children: [
9836
+ "attempt ",
9837
+ indicator.attempt
9838
+ ] })
9839
+ ] }),
9840
+ indicator.detail && /* @__PURE__ */ jsxRuntime.jsx(alert.AlertAction, { children: /* @__PURE__ */ jsxRuntime.jsxs(
9841
+ button.Button,
9842
+ {
9843
+ variant: "ghost",
9844
+ size: "xs",
9845
+ onClick: () => setOpen((prev) => !prev),
9846
+ "aria-expanded": open,
9847
+ children: [
9848
+ open ? "Hide details" : "Details",
9849
+ open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, {})
9850
+ ]
9851
+ }
9852
+ ) }),
9853
+ 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 }) })
9854
+ ] });
10567
9855
  }
10568
9856
  function WorkingOnItIndicator({ activity }) {
10569
9857
  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 +13130,6 @@ function mapSelected(doc, edit) {
13842
13130
  objects: doc.objects.map((o) => o.selected ? edit(o) : o)
13843
13131
  };
13844
13132
  }
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
13133
  var TEXT_GLYPH_ADVANCE = 0.6;
13866
13134
  var AGENT_COLOR = "#2563eb";
13867
13135
  var TEXT_COLOR = "#111827";
@@ -14074,7 +13342,7 @@ function paintArtifactFrame(ctx, obj) {
14074
13342
  var rabbit;
14075
13343
  function rabbitPath() {
14076
13344
  if (rabbit === void 0) {
14077
- rabbit = typeof Path2D === "undefined" ? null : new Path2D(RABBIT_MARK_PATH);
13345
+ rabbit = typeof Path2D === "undefined" ? null : new Path2D(rabbitMark.RABBIT_MARK_PATH);
14078
13346
  }
14079
13347
  return rabbit;
14080
13348
  }
@@ -14089,11 +13357,11 @@ function paintSlot(ctx, obj) {
14089
13357
  const glyph = Math.max(12, Math.min(obj.h * 0.5, obj.w * 0.3, 40));
14090
13358
  const mark = rabbitPath();
14091
13359
  if (mark) {
14092
- const scale = glyph / RABBIT_MARK_BOX.h;
13360
+ const scale = glyph / rabbitMark.RABBIT_MARK_BOX.h;
14093
13361
  ctx.save();
14094
13362
  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
13363
+ obj.x + glyph * 0.3 - rabbitMark.RABBIT_MARK_BOX.x * scale,
13364
+ obj.y + (obj.h - glyph) / 2 - rabbitMark.RABBIT_MARK_BOX.y * scale
14097
13365
  );
14098
13366
  ctx.scale(scale, scale);
14099
13367
  ctx.fillStyle = "rgba(180, 83, 9, 0.9)";
@@ -15341,9 +14609,6 @@ async function latestBoardSession(adapter, agentId) {
15341
14609
  return null;
15342
14610
  }
15343
14611
  }
15344
-
15345
- // src/components/whiteboard/tool-rail.tsx
15346
- init_utils();
15347
14612
  var INK_COLORS = [
15348
14613
  "#111827",
15349
14614
  "#2563eb",
@@ -15358,10 +14623,12 @@ var TOOLS = [
15358
14623
  { id: "text", label: "Text", Icon: lucideReact.Type },
15359
14624
  // Where the agent should answer: click to place an answer box, or
15360
14625
  // drag one. The id stays "slot" -- that is what the object is.
15361
- { id: "slot", label: "Answer box", Icon: RabbitMark },
14626
+ { id: "slot", label: "Answer box", Icon: rabbitMark.RabbitMark },
15362
14627
  { id: "select", label: "Select", Icon: lucideReact.MousePointer2 },
15363
14628
  { id: "pan", label: "Pan", Icon: lucideReact.Hand }
15364
14629
  ];
14630
+ var TOOL_ITEM = "size-9 px-0 pointer-coarse:size-11";
14631
+ var SWATCH_ITEM = "size-7 px-0 pointer-coarse:size-11";
15365
14632
  function ToolRail({
15366
14633
  tool,
15367
14634
  onToolChange,
@@ -15379,66 +14646,66 @@ function ToolRail({
15379
14646
  return /* @__PURE__ */ jsxRuntime.jsxs(
15380
14647
  "div",
15381
14648
  {
15382
- className: "flex flex-col gap-1 rounded-lg border bg-background p-1",
14649
+ className: "flex flex-col items-center gap-1 rounded-lg border bg-background p-1",
15383
14650
  role: "toolbar",
15384
14651
  "aria-label": "Whiteboard tools",
15385
14652
  "aria-orientation": "vertical",
15386
14653
  children: [
15387
- TOOLS.map(({ id, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(
15388
- button.Button,
14654
+ /* @__PURE__ */ jsxRuntime.jsx(
14655
+ toggleGroup.ToggleGroup,
15389
14656
  {
15390
- type: "button",
15391
- size: "icon",
15392
- variant: tool === id ? "default" : "ghost",
15393
- "aria-label": label,
15394
- "aria-pressed": tool === id,
14657
+ type: "single",
14658
+ orientation: "vertical",
14659
+ "aria-label": "Tool",
14660
+ value: tool,
14661
+ onValueChange: (next) => {
14662
+ if (next) onToolChange(next);
14663
+ },
15395
14664
  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",
14665
+ children: TOOLS.map(({ id, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: id, "aria-label": label, className: TOOL_ITEM, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" }) }, id))
14666
+ }
14667
+ ),
14668
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
14669
+ /* @__PURE__ */ jsxRuntime.jsx(
14670
+ toggleGroup.ToggleGroup,
15404
14671
  {
15405
- type: "button",
15406
- "aria-label": `Colour ${c}`,
15407
- "aria-pressed": color === c,
14672
+ type: "single",
14673
+ variant: "outline",
14674
+ size: "sm",
14675
+ orientation: "vertical",
14676
+ "aria-label": "Colour",
14677
+ value: color,
14678
+ onValueChange: (next) => {
14679
+ if (next) onColorChange(next);
14680
+ },
15408
14681
  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",
14682
+ children: INK_COLORS.map((c) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: c, "aria-label": `Colour ${c}`, className: SWATCH_ITEM, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-5 rounded-full", style: { backgroundColor: c } }) }, c))
14683
+ }
14684
+ ),
14685
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
14686
+ /* @__PURE__ */ jsxRuntime.jsx(
14687
+ toggleGroup.ToggleGroup,
15421
14688
  {
15422
- type: "button",
15423
- "aria-label": `Width ${w}`,
15424
- "aria-pressed": width === w,
14689
+ type: "single",
14690
+ variant: "outline",
14691
+ size: "sm",
14692
+ orientation: "vertical",
14693
+ "aria-label": "Width",
14694
+ value: String(width),
14695
+ onValueChange: (next) => {
14696
+ if (next) onWidthChange(Number(next));
14697
+ },
15425
14698
  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(
14699
+ children: INK_WIDTHS.map((w) => /* @__PURE__ */ jsxRuntime.jsx(toggleGroup.ToggleGroupItem, { value: String(w), "aria-label": `Width ${w}`, className: SWATCH_ITEM, children: /* @__PURE__ */ jsxRuntime.jsx(
15432
14700
  "span",
15433
14701
  {
15434
14702
  className: "rounded-full bg-foreground",
15435
14703
  style: { width: w + 2, height: w + 2 }
15436
14704
  }
15437
- )
15438
- },
15439
- w
15440
- )),
15441
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
14705
+ ) }, w))
14706
+ }
14707
+ ),
14708
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px w-full bg-border" }),
15442
14709
  /* @__PURE__ */ jsxRuntime.jsx(
15443
14710
  button.Button,
15444
14711
  {
@@ -15492,6 +14759,13 @@ var VIEW_MODE_LABELS = {
15492
14759
  expert: "Advanced",
15493
14760
  whiteboard: "Whiteboard"
15494
14761
  };
14762
+ var VIEW_MODE_SEGMENTS2 = ["simple", "expert", "whiteboard"].map(
14763
+ (mode) => ({
14764
+ value: mode,
14765
+ label: VIEW_MODE_LABELS[mode],
14766
+ ariaLabel: `${VIEW_MODE_LABELS[mode]} view`
14767
+ })
14768
+ );
15495
14769
  function AgentWhiteboard(props) {
15496
14770
  const runtime = useAgentChatRuntime({
15497
14771
  adapter: props.adapter,
@@ -16317,7 +15591,7 @@ function WhiteboardSurface({
16317
15591
  }
16318
15592
  ),
16319
15593
  /* @__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: [
15594
+ /* @__PURE__ */ jsxRuntime.jsx(buttonGroup.ButtonGroup, { "aria-label": "Actions", children: USER_ACTIONS.map((a) => /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
16321
15595
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16322
15596
  button.Button,
16323
15597
  {
@@ -16362,21 +15636,15 @@ function WhiteboardSurface({
16362
15636
  children: "New board"
16363
15637
  }
16364
15638
  ) : 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",
15639
+ viewMode && onViewModeChange && hasAnswer ? /* @__PURE__ */ jsxRuntime.jsx(
15640
+ segmentedControl.SegmentedControl,
16367
15641
  {
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
15642
+ "aria-label": "View",
15643
+ segments: VIEW_MODE_SEGMENTS2,
15644
+ value: viewMode,
15645
+ onChange: onViewModeChange
15646
+ }
15647
+ ) : null
16380
15648
  ] })
16381
15649
  ] });
16382
15650
  }
@@ -16767,46 +16035,37 @@ function FileTreeFolder({
16767
16035
  onSelect?.(path);
16768
16036
  }, [onSelect, path]);
16769
16037
  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",
16038
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: listRow.listRowVariants({ size: "sm", active: isSelected }), children: [
16039
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
16040
+ "button",
16041
+ {
16042
+ className: "flex shrink-0 cursor-pointer items-center border-none bg-transparent p-0",
16043
+ type: "button",
16044
+ "aria-label": isExpanded ? `Collapse ${name}` : `Expand ${name}`,
16045
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16046
+ lucideReact.ChevronRightIcon,
16780
16047
  {
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
- }
16048
+ className: cn(
16049
+ "size-4 shrink-0 text-muted-foreground transition-transform",
16050
+ isExpanded && "rotate-90"
16792
16051
  )
16793
16052
  }
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
16053
  )
16807
- ]
16808
- }
16809
- ),
16054
+ }
16055
+ ) }),
16056
+ /* @__PURE__ */ jsxRuntime.jsxs(
16057
+ "button",
16058
+ {
16059
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 border-none bg-transparent p-0 text-left",
16060
+ onClick: handleSelect,
16061
+ type: "button",
16062
+ children: [
16063
+ /* @__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 }) }),
16064
+ /* @__PURE__ */ jsxRuntime.jsx(FileTreeName, { children: name })
16065
+ ]
16066
+ }
16067
+ )
16068
+ ] }),
16810
16069
  /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-5", children }) })
16811
16070
  ] }) });
16812
16071
  }
@@ -16835,8 +16094,8 @@ function FileTreeFile({
16835
16094
  "div",
16836
16095
  {
16837
16096
  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",
16097
+ listRow.listRowVariants({ size: "sm", active: isSelected }),
16098
+ "group cursor-pointer",
16840
16099
  className
16841
16100
  ),
16842
16101
  onClick: handleClick,
@@ -16873,14 +16132,14 @@ function forgetChatFiles() {
16873
16132
  chats.clear();
16874
16133
  changed();
16875
16134
  }
16876
- function subscribe2(listener) {
16135
+ function subscribe(listener) {
16877
16136
  listeners.add(listener);
16878
16137
  return () => {
16879
16138
  listeners.delete(listener);
16880
16139
  };
16881
16140
  }
16882
16141
  function useChatFiles(chat) {
16883
- return react.useSyncExternalStore(subscribe2, () => chat === null ? NONE : chats.get(chat) ?? NONE);
16142
+ return react.useSyncExternalStore(subscribe, () => chat === null ? NONE : chats.get(chat) ?? NONE);
16884
16143
  }
16885
16144
  var SKELETON_WIDTHS2 = [75, 60, 90, 65, 80, 70, 85, 55];
16886
16145
  var NO_ENTRIES = [];
@@ -16959,22 +16218,32 @@ function RenderEntries({
16959
16218
  entry.size != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 shrink-0 text-xs text-muted-foreground/60", children: formatFileSize(entry.size) }),
16960
16219
  /* @__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
16220
  /* @__PURE__ */ jsxRuntime.jsx(
16962
- "a",
16221
+ button.Button,
16963
16222
  {
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" })
16223
+ asChild: true,
16224
+ variant: "ghost",
16225
+ size: "icon-xs",
16226
+ className: "text-muted-foreground hover:text-foreground",
16227
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16228
+ "a",
16229
+ {
16230
+ href: downloadUrlFor(entry.path),
16231
+ download: fileName2,
16232
+ onClick: (event) => event.stopPropagation(),
16233
+ title: "Download",
16234
+ "aria-label": `Download ${fileName2}`,
16235
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.DownloadIcon, { className: "size-5" })
16236
+ }
16237
+ )
16971
16238
  }
16972
16239
  ),
16973
16240
  /* @__PURE__ */ jsxRuntime.jsx(
16974
- "button",
16241
+ button.Button,
16975
16242
  {
16976
16243
  type: "button",
16977
- className: "rounded p-0.5 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
16244
+ variant: "ghost",
16245
+ size: "icon-xs",
16246
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive",
16978
16247
  onClick: (event) => {
16979
16248
  event.stopPropagation();
16980
16249
  onDelete(entry.path);
@@ -17188,7 +16457,7 @@ function WorkspacePanel({
17188
16457
  type: "button",
17189
16458
  variant: "ghost",
17190
16459
  size: "icon-sm",
17191
- className: "rounded-xl text-foreground/80 md:size-11",
16460
+ className: "text-foreground/80 md:size-11",
17192
16461
  onClick: () => fileInputRef.current?.click(),
17193
16462
  disabled: disabled || !sessionId || uploading,
17194
16463
  "aria-label": "Upload files",
@@ -17204,7 +16473,7 @@ function WorkspacePanel({
17204
16473
  type: "button",
17205
16474
  variant: "ghost",
17206
16475
  size: "icon-sm",
17207
- className: "rounded-xl text-foreground/80 md:size-11",
16476
+ className: "text-foreground/80 md:size-11",
17208
16477
  onClick: () => void fetchTree(),
17209
16478
  disabled: !sessionId || loading,
17210
16479
  "aria-label": "Refresh workspace",
@@ -17252,24 +16521,28 @@ function WorkspacePanel({
17252
16521
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircleIcon, { className: "mt-0.5 size-4 shrink-0" }),
17253
16522
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: error })
17254
16523
  ] }),
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
- ] }),
16524
+ !loading && !error && entries.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
16525
+ emptyState.EmptyState,
16526
+ {
16527
+ className: "px-4 py-8",
16528
+ logoClassName: "size-9",
16529
+ title: "No workspace files",
16530
+ action: /* @__PURE__ */ jsxRuntime.jsxs(
16531
+ button.Button,
16532
+ {
16533
+ type: "button",
16534
+ variant: "outline",
16535
+ size: "sm",
16536
+ onClick: () => fileInputRef.current?.click(),
16537
+ disabled: disabled || !sessionId,
16538
+ children: [
16539
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadIcon, { className: "size-3.5" }),
16540
+ "Upload files"
16541
+ ]
16542
+ }
16543
+ )
16544
+ }
16545
+ ),
17273
16546
  entries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
17274
16547
  FileTree,
17275
16548
  {
@@ -17328,27 +16601,34 @@ function ConfirmDialog2({
17328
16601
  onOpenChange: (nextOpen) => {
17329
16602
  if (!nextOpen && !loading) onCancel();
17330
16603
  },
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
- ] })
16604
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
16605
+ dialog.DialogContent,
16606
+ {
16607
+ showCloseButton: false,
16608
+ className: "gap-3.5 px-6 pt-6 pb-5 sm:max-w-[430px]",
16609
+ children: [
16610
+ /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogHeader, { children: [
16611
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogTitle, { children: title }),
16612
+ /* @__PURE__ */ jsxRuntime.jsx(dialog.DialogDescription, { children: description })
16613
+ ] }),
16614
+ /* @__PURE__ */ jsxRuntime.jsxs(dialog.DialogFooter, { className: "pt-1.5", children: [
16615
+ /* @__PURE__ */ jsxRuntime.jsx(button.Button, { variant: "outline", disabled: loading, onClick: onCancel, children: "Cancel" }),
16616
+ /* @__PURE__ */ jsxRuntime.jsxs(
16617
+ button.Button,
16618
+ {
16619
+ variant: "destructive",
16620
+ disabled: loading,
16621
+ onClick: onConfirm,
16622
+ children: [
16623
+ loading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "mr-1.5 size-3.5 animate-spin" }),
16624
+ confirmLabel
16625
+ ]
16626
+ }
16627
+ )
16628
+ ] })
16629
+ ]
16630
+ }
16631
+ )
17352
16632
  }
17353
16633
  );
17354
16634
  }
@@ -17613,21 +16893,19 @@ function AgentChat({
17613
16893
  "div",
17614
16894
  {
17615
16895
  "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",
16896
+ className: "md:hidden flex shrink-0 justify-center border-b border-line bg-card px-3 py-2",
16897
+ children: /* @__PURE__ */ jsxRuntime.jsx(
16898
+ segmentedControl.SegmentedControl,
17619
16899
  {
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
- ))
16900
+ "aria-label": "Show",
16901
+ segments: mobilePanes.map((pane) => ({
16902
+ value: pane,
16903
+ label: MOBILE_PANE_LABELS[pane]
16904
+ })),
16905
+ value: activeMobilePane,
16906
+ onChange: setMobileView
16907
+ }
16908
+ )
17631
16909
  }
17632
16910
  ),
17633
16911
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -18064,35 +17342,26 @@ function IntegrationsPage({ agentId, adapter, onBack }) {
18064
17342
  }
18065
17343
  };
18066
17344
  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
- ),
17345
+ /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { asChild: true, variant: "muted", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, children: [
17346
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "size-4" }),
17347
+ "Back"
17348
+ ] }) }),
18079
17349
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18080
17350
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Integrations" }),
18081
17351
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Connect third-party services to enhance your agent's capabilities" })
18082
17352
  ] }),
18083
17353
  /* @__PURE__ */ jsxRuntime.jsx(
18084
- "input",
17354
+ input.Input,
18085
17355
  {
18086
17356
  type: "search",
18087
17357
  value: query,
18088
17358
  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"
17359
+ placeholder: "Search integrations..."
18091
17360
  }
18092
17361
  ),
18093
17362
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", className: "text-xs text-red-500", children: error }),
18094
17363
  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 }),
17364
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: category, role: "heading", "aria-level": 2, className: "pl-0" }),
18096
17365
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: items.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
18097
17366
  ToolkitRow,
18098
17367
  {
@@ -18115,53 +17384,76 @@ function ToolkitRow({
18115
17384
  const [open, setOpen] = react.useState(false);
18116
17385
  const [broken, setBroken] = react.useState(false);
18117
17386
  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",
17387
+ return (
17388
+ // A boxed disclosure: the header names the toolkit and opens its
17389
+ // description; Connect sits beside it, outside the trigger, since a
17390
+ // button cannot hold another.
17391
+ /* @__PURE__ */ jsxRuntime.jsxs(
17392
+ collapsible.Collapsible,
17393
+ {
17394
+ open,
17395
+ onOpenChange: setOpen,
17396
+ className: "rounded-[10px] border border-foreground/[0.08]",
17397
+ children: [
17398
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pr-3", children: [
17399
+ /* @__PURE__ */ jsxRuntime.jsx(
17400
+ collapsibleHeader.CollapsibleHeader,
18132
17401
  {
18133
- src: row.logo,
18134
- alt: name,
18135
- className: "h-5 w-5 rounded object-contain",
18136
- onError: () => setBroken(true)
17402
+ variant: "section",
17403
+ "aria-label": open ? "Collapse" : "Expand",
17404
+ className: "min-w-0 flex-1",
17405
+ children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
17406
+ 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(
17407
+ "img",
17408
+ {
17409
+ src: row.logo,
17410
+ alt: name,
17411
+ className: "size-5 shrink-0 rounded object-contain",
17412
+ onError: () => setBroken(true)
17413
+ }
17414
+ ),
17415
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: name })
17416
+ ] })
18137
17417
  }
18138
17418
  ),
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
- ] });
17419
+ /* @__PURE__ */ jsxRuntime.jsx(
17420
+ button.Button,
17421
+ {
17422
+ type: "button",
17423
+ variant: "outline",
17424
+ size: "xs",
17425
+ disabled: busy,
17426
+ onClick: row.connected ? onDisconnect : onConnect,
17427
+ className: "min-w-[6rem]",
17428
+ children: busy ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
17429
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "size-3.5 animate-spin" }),
17430
+ row.connected ? "Disconnecting" : "Connecting"
17431
+ ] }) : row.connected ? "Disconnect" : "Connect"
17432
+ }
17433
+ )
17434
+ ] }),
17435
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsible.CollapsibleContent, { className: "border-t border-foreground/[0.08] px-3 py-2.5 text-[13px] text-muted-foreground", children: [
17436
+ row.description && /* @__PURE__ */ jsxRuntime.jsx("p", { children: row.description }),
17437
+ /* @__PURE__ */ jsxRuntime.jsx(
17438
+ chip.TagPill,
17439
+ {
17440
+ label: row.auth_mode === "api_key" ? "API key" : "OAuth",
17441
+ className: "mt-1.5"
17442
+ }
17443
+ )
17444
+ ] })
17445
+ ]
17446
+ }
17447
+ )
17448
+ );
18164
17449
  }
17450
+
17451
+ // src/components/connections/coding-agents-panel.tsx
17452
+ init_utils();
17453
+ var MODES = [
17454
+ { value: "oauth", label: "Subscription" },
17455
+ { value: "api_key", label: "API key" }
17456
+ ];
18165
17457
  var PROVIDERS = [
18166
17458
  {
18167
17459
  key: "claude",
@@ -18210,18 +17502,10 @@ function CodingAgentsPanel({ agentId, adapter, onBack }) {
18210
17502
  }, [connections]);
18211
17503
  if (!supported) return null;
18212
17504
  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
- ),
17505
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(textLink.TextLink, { asChild: true, variant: "muted", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: onBack, children: [
17506
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeftIcon, { className: "size-4" }),
17507
+ "Back"
17508
+ ] }) }),
18225
17509
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18226
17510
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-foreground", children: "Coding agents" }),
18227
17511
  /* @__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 +17584,21 @@ function ProviderCard({
18300
17584
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-col gap-3 rounded-lg border border-border p-4", children: [
18301
17585
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
18302
17586
  /* @__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
- )
17587
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: connected ? "ok" : "muted", children: connected ? `Connected${connection?.auth_mode === "api_key" ? " (API key)" : ""}` : "Not connected" })
18336
17588
  ] }),
17589
+ /* @__PURE__ */ jsxRuntime.jsx(
17590
+ segmentedControl.SegmentedControl,
17591
+ {
17592
+ "aria-label": "Credential type",
17593
+ segments: MODES,
17594
+ value: mode,
17595
+ onChange: (next) => {
17596
+ setMode(next);
17597
+ setError(null);
17598
+ },
17599
+ className: "self-start"
17600
+ }
17601
+ ),
18337
17602
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: instructions }),
18338
17603
  /* @__PURE__ */ jsxRuntime.jsx(
18339
17604
  "textarea",
@@ -18345,7 +17610,7 @@ function ProviderCard({
18345
17610
  autoComplete: "off",
18346
17611
  rows: mode === "oauth" && meta.provider === "openai" ? 4 : 2,
18347
17612
  "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]"
17613
+ className: cn(controlStyles.CONTROL_FIELD, "resize-y font-mono [-webkit-text-security:disc]")
18349
17614
  }
18350
17615
  ),
18351
17616
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { role: "alert", className: "text-xs text-red-500", children: error }),
@@ -18473,21 +17738,27 @@ function kindIcon(kind) {
18473
17738
  }
18474
17739
  var VIEWS = {
18475
17740
  active: {
17741
+ label: "Active",
18476
17742
  statuses: ["pending"],
18477
17743
  kinds: ["input_required", "action_required", "governance_gate"],
18478
17744
  empty: "Nothing needs you right now"
18479
17745
  },
18480
17746
  updates: {
17747
+ label: "Updates",
18481
17748
  statuses: ["pending"],
18482
17749
  kinds: ["task_complete", "progress_checkin"],
18483
17750
  empty: "No news from your agent"
18484
17751
  },
18485
17752
  history: {
17753
+ label: "History",
18486
17754
  statuses: ["acknowledged", "responded", "expired"],
18487
17755
  empty: "No history yet"
18488
17756
  }
18489
17757
  };
18490
- var VIEW_NAMES = Object.keys(VIEWS);
17758
+ var VIEW_OPTIONS = Object.keys(VIEWS).map((id) => ({
17759
+ id,
17760
+ label: VIEWS[id].label
17761
+ }));
18491
17762
  function belongsToView(item, view) {
18492
17763
  const kinds = VIEWS[view].kinds;
18493
17764
  return VIEWS[view].statuses.includes(item.status) && (kinds === void 0 || kinds.includes(item.kind));
@@ -18511,7 +17782,6 @@ function InboxBody({ body, muted }) {
18511
17782
  }
18512
17783
  );
18513
17784
  }
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
17785
  function errorMessage(error, fallback) {
18516
17786
  return error instanceof Error && error.message ? error.message : fallback;
18517
17787
  }
@@ -18571,7 +17841,7 @@ function QuestionInput({
18571
17841
  "select",
18572
17842
  {
18573
17843
  "aria-label": prompt,
18574
- className: FIELD_CLASS,
17844
+ className: controlStyles.CONTROL_FIELD,
18575
17845
  disabled,
18576
17846
  value: useOther ? OTHER_OPTION : pickedIndex >= 0 ? String(pickedIndex) : "",
18577
17847
  onChange: (event) => {
@@ -18584,9 +17854,17 @@ function QuestionInput({
18584
17854
  if (choice) onPickChoice(choice.label);
18585
17855
  },
18586
17856
  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" })
17857
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, className: controlStyles.CONTROL_OPTION, children: "Select" }),
17858
+ choices.map((choice, index) => /* @__PURE__ */ jsxRuntime.jsx(
17859
+ "option",
17860
+ {
17861
+ value: String(index),
17862
+ className: controlStyles.CONTROL_OPTION,
17863
+ children: choice.label
17864
+ },
17865
+ choice.label
17866
+ )),
17867
+ allowOther && /* @__PURE__ */ jsxRuntime.jsx("option", { value: OTHER_OPTION, className: controlStyles.CONTROL_OPTION, children: "Other" })
18590
17868
  ]
18591
17869
  }
18592
17870
  ),
@@ -18594,7 +17872,7 @@ function QuestionInput({
18594
17872
  "input",
18595
17873
  {
18596
17874
  "aria-label": `${prompt} (other)`,
18597
- className: FIELD_CLASS,
17875
+ className: controlStyles.CONTROL_FIELD,
18598
17876
  placeholder: "Type your answer\u2026",
18599
17877
  disabled,
18600
17878
  value: typed,
@@ -18607,7 +17885,7 @@ function QuestionInput({
18607
17885
  "input",
18608
17886
  {
18609
17887
  "aria-label": prompt,
18610
- className: FIELD_CLASS,
17888
+ className: controlStyles.CONTROL_FIELD,
18611
17889
  disabled,
18612
17890
  value: typed,
18613
17891
  onChange: (event) => onType(event.target.value)
@@ -18972,18 +18250,10 @@ function InboxDetail({
18972
18250
  }) {
18973
18251
  const Icon = kindIcon(item.kind);
18974
18252
  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
- ),
18253
+ 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: [
18254
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeftIcon, {}),
18255
+ "Inbox"
18256
+ ] }) }),
18987
18257
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-5 flex min-w-0 items-start gap-3", children: [
18988
18258
  /* @__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
18259
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
@@ -19173,54 +18443,43 @@ function InboxPanel({
19173
18443
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InboxIcon, { className: "size-4 text-muted-foreground" }),
19174
18444
  /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "font-semibold", children: title })
19175
18445
  ] }),
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",
18446
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-line px-2 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
18447
+ toggleGroup.ViewSwitch,
19178
18448
  {
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
- )) }),
18449
+ label: "Inbox view",
18450
+ views: VIEW_OPTIONS,
18451
+ value: view,
18452
+ onChange: selectView
18453
+ }
18454
+ ) }),
19189
18455
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto", children: [
19190
18456
  error && items.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 px-4 py-3", children: [
19191
18457
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: error }),
19192
18458
  /* @__PURE__ */ jsxRuntime.jsx(button.Button, { type: "button", size: "sm", onClick: () => void load(null), children: "Try again" })
19193
18459
  ] }),
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
- }),
18460
+ items.length === 0 && !error && !loading && /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "px-4 py-10", title: VIEWS[view].empty }),
18461
+ items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
18462
+ listRow.ListRow,
18463
+ {
18464
+ size: "lg",
18465
+ icon: kindIcon(item.kind),
18466
+ label: item.title,
18467
+ description: `${kindLabel(item.kind)} \xB7 ${statusLabel(item.status)}`,
18468
+ meta: formatRelative(item.createdAt),
18469
+ isActive: item.id === selectedItemId,
18470
+ badge: !item.readAt && /* @__PURE__ */ jsxRuntime.jsx(
18471
+ "span",
18472
+ {
18473
+ "aria-label": "Unread",
18474
+ title: "Unread",
18475
+ className: "size-[7px] shrink-0 rounded-full bg-amber-500"
18476
+ }
18477
+ ),
18478
+ "aria-label": `Open inbox item ${item.title}`,
18479
+ onClick: () => void selectItem(item.id)
18480
+ },
18481
+ item.id
18482
+ )),
19224
18483
  nextCursor && /* @__PURE__ */ jsxRuntime.jsx(
19225
18484
  button.Button,
19226
18485
  {
@@ -19298,12 +18557,12 @@ function useInboxUnreadCount(adapter) {
19298
18557
  }, [listInbox, openInboxStream, refetch]);
19299
18558
  return { unreadCount, hasLoaded, error };
19300
18559
  }
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"
18560
+ var CATEGORY_TONE = {
18561
+ spawn: "warn",
18562
+ output: "muted",
18563
+ done: "ok",
18564
+ verdict: "warn",
18565
+ system: "muted"
19307
18566
  };
19308
18567
  function MissionActivityTab({ feed }) {
19309
18568
  const [filter, setFilter] = react.useState("all");
@@ -19313,15 +18572,15 @@ function MissionActivityTab({ feed }) {
19313
18572
  return newestFirst.filter((e) => missionEventCategory(e.type) === filter);
19314
18573
  }, [feed.events, filter]);
19315
18574
  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." });
18575
+ return /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "py-8", title: "No mission activity yet" });
19317
18576
  }
19318
18577
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
19319
18578
  /* @__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",
18579
+ toggle.FilterPill,
19321
18580
  {
19322
- type: "button",
18581
+ on: filter === cat,
19323
18582
  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"}`,
18583
+ className: "capitalize",
19325
18584
  children: cat
19326
18585
  },
19327
18586
  cat
@@ -19339,28 +18598,18 @@ function ActivityRow({
19339
18598
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-20 shrink-0 font-mono text-[10px] text-muted-foreground/60", children: formatMissionTimestamp(event.createdAt) }),
19340
18599
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
19341
18600
  /* @__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
- ),
18601
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: CATEGORY_TONE[category], className: "capitalize", children: category }),
19349
18602
  /* @__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
18603
+ taskId ? /* @__PURE__ */ jsxRuntime.jsx(chip.TagPill, { label: taskId.slice(0, 8), className: "font-mono" }) : null
19351
18604
  ] }),
19352
18605
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "min-w-0 flex-1 truncate text-foreground/80", children: renderInlineMarkdown(missionEventSummary(event)) }) })
19353
18606
  ] })
19354
18607
  ] });
19355
18608
  }
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";
18609
+ function missionVerdictTone(result) {
18610
+ if (result === "satisfied") return "ok";
18611
+ if (result === "failed" || result === "blocked") return "bad";
18612
+ return "warn";
19364
18613
  }
19365
18614
  function MissionMetadataTab({ mission }) {
19366
18615
  const rows = [
@@ -19411,7 +18660,7 @@ function MissionMetadataTab({ mission }) {
19411
18660
  mission.lastEvaluationResult ? /* @__PURE__ */ jsxRuntime.jsxs(
19412
18661
  "section",
19413
18662
  {
19414
- className: `space-y-2 rounded-md border p-4 ${verdictToneClass(mission.lastEvaluationResult)}`,
18663
+ className: `space-y-2 rounded-[10px] p-4 ${chip.TONE[missionVerdictTone(mission.lastEvaluationResult)]}`,
19415
18664
  children: [
19416
18665
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-mono text-[10px] uppercase tracking-widest", children: [
19417
18666
  "Last verdict \u2014 ",
@@ -19424,7 +18673,7 @@ function MissionMetadataTab({ mission }) {
19424
18673
  }
19425
18674
  ) : null,
19426
18675
  /* @__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" }),
18676
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Identifiers", className: "mb-2 pl-0" }),
19428
18677
  /* @__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
18678
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground/70", children: r.label }),
19430
18679
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "break-all text-foreground/90", children: r.value })
@@ -19444,22 +18693,11 @@ function compareNodes(a, b) {
19444
18693
  }
19445
18694
  return pa.length - pb.length;
19446
18695
  }
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
- }
18696
+ var IDEA_STATUS_TONE = {
18697
+ merged: "ok",
18698
+ running: "warn",
18699
+ failed: "bad"
18700
+ };
19463
18701
  function fmtScore(n) {
19464
18702
  if (n === null || n === void 0) return "\u2014";
19465
18703
  return n.toFixed(3).replace(/\.?0+$/, "") || "0";
@@ -19555,9 +18793,10 @@ function IdeaRow({
19555
18793
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
19556
18794
  /* @__PURE__ */ jsxRuntime.jsx("code", { className: "shrink-0 text-[11px] text-muted-foreground/60", children: node.nodeKey }),
19557
18795
  /* @__PURE__ */ jsxRuntime.jsx(
19558
- "span",
18796
+ chip.TonePill,
19559
18797
  {
19560
- className: `shrink-0 rounded border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wider ${statusToneClass(node.status)}`,
18798
+ tone: IDEA_STATUS_TONE[node.status] ?? "muted",
18799
+ className: node.status === "pruned" ? "capitalize line-through" : "capitalize",
19561
18800
  children: node.status
19562
18801
  }
19563
18802
  ),
@@ -19590,13 +18829,14 @@ function MissionResearchTab({ research }) {
19590
18829
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
19591
18830
  /* @__PURE__ */ jsxRuntime.jsx(RunHeader, { run }),
19592
18831
  /* @__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(
18832
+ /* @__PURE__ */ jsxRuntime.jsx(
18833
+ sectionLabel.SectionLabel,
18834
+ {
18835
+ label: `Idea tree \xB7 ${sorted.length} node${sorted.length === 1 ? "" : "s"}`,
18836
+ className: "mb-2 pl-0"
18837
+ }
18838
+ ),
18839
+ 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
18840
  IdeaRow,
19601
18841
  {
19602
18842
  node: n,
@@ -19608,27 +18848,30 @@ function MissionResearchTab({ research }) {
19608
18848
  ] })
19609
18849
  ] });
19610
18850
  }
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"
18851
+ var TASK_STATUS_TONE = {
18852
+ running: "warn",
18853
+ blocked: "warn",
18854
+ done: "ok",
18855
+ failed: "bad",
18856
+ active: "warn",
18857
+ completed: "ok"
19617
18858
  };
19618
- function statusBadgeClass(status) {
19619
- return TASK_STATUS_BADGE_CLASS[status] ?? "border-foreground/20 bg-foreground/5 text-foreground/70";
18859
+ function missionTaskStatusTone(status) {
18860
+ return TASK_STATUS_TONE[status] ?? "muted";
19620
18861
  }
19621
18862
  function TaskChip({
19622
18863
  task,
19623
18864
  onSelect
19624
18865
  }) {
19625
18866
  return /* @__PURE__ */ jsxRuntime.jsxs(
19626
- "button",
18867
+ button.Button,
19627
18868
  {
19628
18869
  type: "button",
18870
+ variant: "outline",
18871
+ size: "xs",
19629
18872
  "data-task-chip": true,
19630
18873
  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",
18874
+ className: "max-w-full",
19632
18875
  children: [
19633
18876
  /* @__PURE__ */ jsxRuntime.jsx(
19634
18877
  "span",
@@ -19636,8 +18879,8 @@ function TaskChip({
19636
18879
  className: `size-1.5 shrink-0 rounded-full ${missionTaskStatusDotClass(task.status)}`
19637
18880
  }
19638
18881
  ),
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) })
18882
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: missionTaskTitle(task.goal, 40) }),
18883
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] text-muted-foreground", children: task.id.slice(0, 8) })
19641
18884
  ]
19642
18885
  }
19643
18886
  );
@@ -19650,27 +18893,22 @@ function TaskRailRow({
19650
18893
  const preview = stripMissionControlMarkup(
19651
18894
  task.status === "done" && task.result ? task.result : task.goal
19652
18895
  );
19653
- return /* @__PURE__ */ jsxRuntime.jsxs(
19654
- "button",
18896
+ return /* @__PURE__ */ jsxRuntime.jsx(
18897
+ listRow.ListRow,
19655
18898
  {
19656
- type: "button",
18899
+ asChild: true,
18900
+ size: "sm",
18901
+ isActive: selected,
18902
+ label: task.goal,
18903
+ description: [task.agentDefName, preview].filter(Boolean).join(" \xB7 "),
19657
18904
  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
- ]
18905
+ className: "cursor-pointer",
18906
+ children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", children: /* @__PURE__ */ jsxRuntime.jsx(
18907
+ "span",
18908
+ {
18909
+ className: `size-2 shrink-0 rounded-full ${missionTaskStatusDotClass(task.status)}`
18910
+ }
18911
+ ) })
19674
18912
  }
19675
18913
  );
19676
18914
  }
@@ -19699,17 +18937,12 @@ function MissionTasksTab({
19699
18937
  return outputs.length > 0 ? outputs[outputs.length - 1] : null;
19700
18938
  }, [selected, taskEvents]);
19701
18939
  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." });
18940
+ return /* @__PURE__ */ jsxRuntime.jsx(emptyState.EmptyState, { className: "py-8", title: "No tasks spawned yet" });
19703
18941
  }
19704
18942
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 gap-4", children: [
19705
18943
  /* @__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(
18944
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: `${group.label} (${group.tasks.length})` }),
18945
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: group.tasks.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
19713
18946
  TaskRailRow,
19714
18947
  {
19715
18948
  task: t,
@@ -19762,14 +18995,7 @@ function TaskDetail({
19762
18995
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] text-muted-foreground/60", children: task.id.slice(0, 8) })
19763
18996
  ] }),
19764
18997
  /* @__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
- ),
18998
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTaskStatusTone(task.status), className: "capitalize", children: task.status }),
19773
18999
  task.agentDefName ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: task.agentDefName }) : null,
19774
19000
  task.attemptCount > 1 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
19775
19001
  "attempts ",
@@ -19785,30 +19011,26 @@ function TaskDetail({
19785
19011
  ] }),
19786
19012
  /* @__PURE__ */ jsxRuntime.jsx(OutcomeCard, { outcome }),
19787
19013
  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" }),
19014
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Dependencies", className: "pl-0" }),
19789
19015
  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" }),
19016
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[12px] text-subtle", children: "Depends on" }),
19791
19017
  parents.map((p) => /* @__PURE__ */ jsxRuntime.jsx(TaskChip, { task: p, onSelect }, p.id))
19792
19018
  ] }) : null,
19793
19019
  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" }),
19020
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mr-1 text-[12px] text-subtle", children: "Blocks" }),
19795
19021
  children.map((c) => /* @__PURE__ */ jsxRuntime.jsx(TaskChip, { task: c, onSelect }, c.id))
19796
19022
  ] }) : null
19797
19023
  ] }) : null,
19798
19024
  /* @__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" }),
19025
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: "Brief", className: "mb-1 pl-0" }),
19800
19026
  /* @__PURE__ */ jsxRuntime.jsx(MessageResponse, { className: "text-sm leading-relaxed text-foreground/90", children: task.goal })
19801
19027
  ] }),
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) })
19028
+ task.resultMetadata ? /* @__PURE__ */ jsxRuntime.jsxs(collapsible.Collapsible, { className: "rounded-[10px] border border-foreground/[0.08]", children: [
19029
+ /* @__PURE__ */ jsxRuntime.jsx(collapsibleHeader.CollapsibleHeader, { variant: "section", children: "Result metadata" }),
19030
+ /* @__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
19031
  ] }) : null,
19806
19032
  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
- ] }),
19033
+ /* @__PURE__ */ jsxRuntime.jsx(sectionLabel.SectionLabel, { label: `History (${taskEvents.length})`, className: "mb-2 pl-0" }),
19812
19034
  /* @__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
19035
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-16 shrink-0 font-mono text-[10px] text-muted-foreground/60", children: formatMissionTimestamp(e.createdAt) }),
19814
19036
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "", children: [
@@ -19931,11 +19153,6 @@ function OutcomeCard({ outcome }) {
19931
19153
  }
19932
19154
  );
19933
19155
  }
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
19156
  var MISSION_WORKER_KIND_TOOLTIP = {
19940
19157
  task: "Durable Task row created by spawn_task. Retried by the dispatcher; survives across coordinator wakes.",
19941
19158
  worker: "Async one-shot session spawned by spawn_worker. Durable session, no retry/DAG.",
@@ -19947,7 +19164,13 @@ function MissionWorkersTab({
19947
19164
  onOpenTranscript
19948
19165
  }) {
19949
19166
  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." });
19167
+ return /* @__PURE__ */ jsxRuntime.jsx(
19168
+ emptyState.EmptyState,
19169
+ {
19170
+ className: "py-8",
19171
+ title: "No workers attached to this mission right now"
19172
+ }
19173
+ );
19951
19174
  }
19952
19175
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: workers.map((w) => /* @__PURE__ */ jsxRuntime.jsx(
19953
19176
  WorkerCard2,
@@ -19977,18 +19200,11 @@ function WorkerCard2({
19977
19200
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
19978
19201
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-sm font-semibold text-foreground", children: worker.agentDefName ?? "worker" }),
19979
19202
  /* @__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
- ) }),
19203
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(chip.Chip, { size: "sm", className: "mt-1 capitalize", children: worker.kind }) }),
19988
19204
  /* @__PURE__ */ jsxRuntime.jsx(tooltip.TooltipContent, { className: "max-w-xs", children: MISSION_WORKER_KIND_TOOLTIP[worker.kind] })
19989
19205
  ] })
19990
19206
  ] }),
19991
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70", children: statusLabel2 })
19207
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTaskStatusTone(statusLabel2), className: "capitalize", children: statusLabel2 })
19992
19208
  ] }),
19993
19209
  counts ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline gap-6", children: [
19994
19210
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -20013,13 +19229,13 @@ function WorkerCard2({
20013
19229
  ] }),
20014
19230
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-xs text-foreground/80", children: deriveMissionWorkerActivityLabel(worker) }),
20015
19231
  /* @__PURE__ */ jsxRuntime.jsx(
20016
- "a",
19232
+ textLink.TextLink,
20017
19233
  {
19234
+ size: "sm",
20018
19235
  href: worker.transcriptUrl,
20019
19236
  target: "_blank",
20020
19237
  rel: "noreferrer",
20021
19238
  onClick: onTranscriptClick,
20022
- className: "inline-block text-xs text-primary hover:underline",
20023
19239
  children: "View session"
20024
19240
  }
20025
19241
  )
@@ -20090,8 +19306,15 @@ function useMissionEvents(input) {
20090
19306
  var DEFAULT_POLL_INTERVAL_MS = 5e3;
20091
19307
  function CountBadge({ n }) {
20092
19308
  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
- }
19309
+ return /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "secondary", children: n });
19310
+ }
19311
+ var MISSION_STATUS_TONE = {
19312
+ active: "warn",
19313
+ paused: "warn",
19314
+ satisfied: "ok",
19315
+ failed: "bad",
19316
+ cancelled: "bad"
19317
+ };
20095
19318
  var INITIAL_STATE = {
20096
19319
  mission: null,
20097
19320
  tasks: [],
@@ -20251,7 +19474,6 @@ function MissionDashboard({
20251
19474
  setBusy(false);
20252
19475
  }
20253
19476
  };
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
19477
  const isActive = ACTIVE_MISSION_STATUSES.has(mission.status);
20256
19478
  const iterationPct = mission.maxIterations > 0 ? Math.min(100, mission.iteration / mission.maxIterations * 100) : 0;
20257
19479
  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 +19481,10 @@ function MissionDashboard({
20259
19481
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
20260
19482
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
20261
19483
  /* @__PURE__ */ jsxRuntime.jsx(
20262
- "span",
19484
+ chip.TonePill,
20263
19485
  {
20264
- className: `rounded-md border px-2 py-0.5 font-mono text-[10px] font-semibold uppercase tracking-wider ${statusTone}`,
19486
+ tone: MISSION_STATUS_TONE[mission.status] ?? "muted",
19487
+ className: "capitalize",
20265
19488
  children: mission.status
20266
19489
  }
20267
19490
  ),
@@ -20273,9 +19496,9 @@ function MissionDashboard({
20273
19496
  ] }),
20274
19497
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 text-[10px] uppercase tracking-wider text-muted-foreground/60", children: "iterations" })
20275
19498
  ] }),
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 })
19499
+ mission.lastEvaluationResult ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-[12px] text-muted-foreground", children: [
19500
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Last verdict" }),
19501
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionVerdictTone(mission.lastEvaluationResult), children: mission.lastEvaluationResult })
20279
19502
  ] }) : null
20280
19503
  ] }),
20281
19504
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 flex-wrap items-center gap-2", children: [
@@ -20337,10 +19560,10 @@ function MissionDashboard({
20337
19560
  ] })
20338
19561
  ] }),
20339
19562
  /* @__PURE__ */ jsxRuntime.jsx(
20340
- Progress,
19563
+ progressBar.ProgressBar,
20341
19564
  {
20342
19565
  value: iterationPct,
20343
- className: `h-1 ${isActive ? "" : "opacity-40"}`
19566
+ className: isActive ? void 0 : "opacity-40"
20344
19567
  }
20345
19568
  ),
20346
19569
  /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Tooltip, { children: [
@@ -20418,11 +19641,10 @@ function MissionDashboard({
20418
19641
  ] }),
20419
19642
  /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-sm", children: [
20420
19643
  /* @__PURE__ */ jsxRuntime.jsx(
20421
- "input",
19644
+ checkbox.Checkbox,
20422
19645
  {
20423
- type: "checkbox",
20424
19646
  checked: cancelCascade,
20425
- onChange: (e) => setCancelCascade(e.target.checked)
19647
+ onCheckedChange: (checked) => setCancelCascade(checked === true)
20426
19648
  }
20427
19649
  ),
20428
19650
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
@@ -20463,9 +19685,6 @@ function MissionDashboard({
20463
19685
  )
20464
19686
  ] }) });
20465
19687
  }
20466
-
20467
- // src/components/missions/missions-panel.tsx
20468
- init_utils();
20469
19688
  var DEFAULT_POLL_INTERVAL_MS2 = 3e4;
20470
19689
  function fingerprint(items) {
20471
19690
  return items.map(
@@ -20480,6 +19699,12 @@ function sortMissions(items) {
20480
19699
  return (a.updatedAt ?? "") > (b.updatedAt ?? "") ? -1 : 1;
20481
19700
  });
20482
19701
  }
19702
+ function missionTone(status) {
19703
+ if (status === "active") return "ok";
19704
+ if (status === "paused" || status === "blocked") return "warn";
19705
+ if (status === "failed" || status === "max_iterations_reached") return "bad";
19706
+ return "muted";
19707
+ }
20483
19708
  function MissionRow({
20484
19709
  mission,
20485
19710
  onOpen,
@@ -20510,81 +19735,79 @@ function MissionRow({
20510
19735
  e.preventDefault();
20511
19736
  openMission();
20512
19737
  };
20513
- return /* @__PURE__ */ jsxRuntime.jsxs(
20514
- "div",
19738
+ return /* @__PURE__ */ jsxRuntime.jsx(
19739
+ listRow.ListRow,
20515
19740
  {
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
- ]
19741
+ asChild: true,
19742
+ size: "sm",
19743
+ icon: lucideReact.TargetIcon,
19744
+ label: description,
19745
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19746
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 flex", children: /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: missionTone(mission.status), children: mission.status }) }),
19747
+ meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block truncate", children: line }, line))
19748
+ ] }),
19749
+ className: "cursor-pointer items-start",
19750
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
19751
+ isActive && canMutate.pause && /* @__PURE__ */ jsxRuntime.jsx(
19752
+ button.Button,
19753
+ {
19754
+ variant: "ghost",
19755
+ size: "icon-xs",
19756
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
19757
+ onClick: (e) => {
19758
+ stopActionClick(e);
19759
+ onPause(mission.id);
19760
+ },
19761
+ "aria-label": "Pause mission",
19762
+ title: "Pause mission",
19763
+ disabled: busy,
19764
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, { className: "size-3.5" })
19765
+ }
19766
+ ),
19767
+ isPaused && canMutate.resume && /* @__PURE__ */ jsxRuntime.jsx(
19768
+ button.Button,
19769
+ {
19770
+ variant: "ghost",
19771
+ size: "icon-xs",
19772
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
19773
+ onClick: (e) => {
19774
+ stopActionClick(e);
19775
+ onResume(mission.id);
19776
+ },
19777
+ "aria-label": "Resume mission",
19778
+ title: "Resume mission",
19779
+ disabled: busy,
19780
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { className: "size-3.5" })
19781
+ }
19782
+ ),
19783
+ (isActive || isPaused) && canMutate.cancel && /* @__PURE__ */ jsxRuntime.jsx(
19784
+ button.Button,
19785
+ {
19786
+ variant: "ghost",
19787
+ size: "icon-xs",
19788
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive md:opacity-70 md:group-hover/list-row:opacity-100",
19789
+ onClick: (e) => {
19790
+ stopActionClick(e);
19791
+ onCancel(mission.id);
19792
+ },
19793
+ "aria-label": "Cancel mission",
19794
+ title: "Cancel mission",
19795
+ disabled: busy,
19796
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ban, { className: "size-3.5" })
19797
+ }
19798
+ )
19799
+ ] }),
19800
+ children: /* @__PURE__ */ jsxRuntime.jsx(
19801
+ "div",
19802
+ {
19803
+ onClick: openMission,
19804
+ onKeyDown: handleRowKeyDown,
19805
+ role: "button",
19806
+ tabIndex: 0,
19807
+ "aria-label": `Open mission ${description}`,
19808
+ title: "Open mission dashboard"
19809
+ }
19810
+ )
20588
19811
  }
20589
19812
  );
20590
19813
  }
@@ -20604,7 +19827,6 @@ function MissionsPanel({
20604
19827
  const [error, setError] = react.useState(null);
20605
19828
  const [hasEverLoaded, setHasEverLoaded] = react.useState(false);
20606
19829
  const [busyMissionId, setBusyMissionId] = react.useState(null);
20607
- const [collapsed, setCollapsed] = react.useState(false);
20608
19830
  const mounted = react.useRef(true);
20609
19831
  const requestId = react.useRef(0);
20610
19832
  const lastFingerprint = react.useRef("");
@@ -20722,44 +19944,31 @@ function MissionsPanel({
20722
19944
  );
20723
19945
  if (!hasEverLoaded) return null;
20724
19946
  if (!adapter.listMissions) return null;
20725
- const showBody = hideHeader || !collapsed;
20726
19947
  const canMutate = {
20727
19948
  pause: Boolean(adapter.pauseMission),
20728
19949
  resume: Boolean(adapter.resumeMission),
20729
19950
  cancel: Boolean(adapter.cancelMission)
20730
19951
  };
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
- ] });
19952
+ 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(
19953
+ MissionRow,
19954
+ {
19955
+ mission,
19956
+ busy: busyMissionId === mission.id,
19957
+ canMutate,
19958
+ onOpen: handleOpen,
19959
+ onPause: handlePause,
19960
+ onResume: handleResume,
19961
+ onCancel: handleCancel
19962
+ },
19963
+ mission.id
19964
+ )) });
19965
+ 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: [
19966
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { icon: lucideReact.TargetIcon, children: [
19967
+ title,
19968
+ activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: activeCount })
19969
+ ] }),
19970
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: body })
19971
+ ] }) });
20763
19972
  }
20764
19973
  var CITATION_RE = /\[(S\d+(?:\s*,\s*S\d+)*)\]/g;
20765
19974
  function splitCitations(text) {
@@ -20792,17 +20001,15 @@ function CitationText({
20792
20001
  return /* @__PURE__ */ jsxRuntime.jsx("span", { children: seg.value }, i);
20793
20002
  }
20794
20003
  const src = byId.get(seg.value);
20795
- return /* @__PURE__ */ jsxRuntime.jsx(
20004
+ return /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { asChild: true, className: "mx-0.5 cursor-pointer hover:bg-foreground/[0.12]", children: /* @__PURE__ */ jsxRuntime.jsx(
20796
20005
  "button",
20797
20006
  {
20798
20007
  type: "button",
20799
20008
  title: src ? `${src.title} \u2014 ${src.url}` : seg.value,
20800
20009
  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
20010
  children: seg.value
20803
- },
20804
- i
20805
- );
20011
+ }
20012
+ ) }, i);
20806
20013
  }) });
20807
20014
  }
20808
20015
 
@@ -20845,6 +20052,11 @@ function scheduleDisplay(item) {
20845
20052
  if (item.kind === "dynamic_loop") return null;
20846
20053
  return item.scheduleDisplay;
20847
20054
  }
20055
+ function statusTone(status) {
20056
+ if (status === "paused") return "warn";
20057
+ if (status === "failed") return "bad";
20058
+ return "muted";
20059
+ }
20848
20060
  function sortScheduledWork(items) {
20849
20061
  return [...items].sort((a, b) => {
20850
20062
  if (a.status === "active" && b.status !== "active") return -1;
@@ -20891,73 +20103,74 @@ function ScheduledWorkRow({
20891
20103
  const stopActionClick = (e) => {
20892
20104
  e.stopPropagation();
20893
20105
  };
20894
- return /* @__PURE__ */ jsxRuntime.jsxs(
20895
- "div",
20106
+ return /* @__PURE__ */ jsxRuntime.jsx(
20107
+ listRow.ListRow,
20896
20108
  {
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 })
20109
+ asChild: true,
20110
+ size: "sm",
20111
+ icon: lucideReact.CalendarClockIcon,
20112
+ label: title,
20113
+ description: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20114
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "mt-0.5 flex gap-1", children: [
20115
+ /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { children: formatKind(item.kind) }),
20116
+ statusText && /* @__PURE__ */ jsxRuntime.jsx(chip.TonePill, { tone: statusTone(statusText), children: statusText })
20920
20117
  ] }),
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
- ]
20118
+ meta.map((line) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 block truncate", children: line }, line)),
20119
+ item.lastError && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 line-clamp-2 whitespace-normal text-destructive", children: item.lastError })
20120
+ ] }),
20121
+ className: cn("items-start", lastSessionId && "cursor-pointer"),
20122
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20123
+ showRunNow && /* @__PURE__ */ jsxRuntime.jsx(
20124
+ button.Button,
20125
+ {
20126
+ variant: "ghost",
20127
+ size: "icon-xs",
20128
+ className: "text-muted-foreground hover:text-foreground md:opacity-70 md:group-hover/list-row:opacity-100",
20129
+ onClick: (e) => {
20130
+ stopActionClick(e);
20131
+ onRunNow(item.id);
20132
+ },
20133
+ "aria-label": "Run schedule now",
20134
+ title: "Run schedule now",
20135
+ disabled,
20136
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CalendarClockIcon, { className: "size-3.5" })
20137
+ }
20138
+ ),
20139
+ canCancel && isActive && /* @__PURE__ */ jsxRuntime.jsx(
20140
+ button.Button,
20141
+ {
20142
+ variant: "ghost",
20143
+ size: "icon-xs",
20144
+ className: "text-muted-foreground hover:bg-destructive/10 hover:text-destructive md:opacity-70 md:group-hover/list-row:opacity-100",
20145
+ onClick: (e) => {
20146
+ stopActionClick(e);
20147
+ onCancel(item.id);
20148
+ },
20149
+ "aria-label": "Cancel schedule",
20150
+ title: "Cancel schedule",
20151
+ disabled,
20152
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "size-3.5" })
20153
+ }
20154
+ )
20155
+ ] }),
20156
+ children: /* @__PURE__ */ jsxRuntime.jsx(
20157
+ "div",
20158
+ {
20159
+ onClick: openLastRun,
20160
+ onKeyDown: handleRowKeyDown,
20161
+ role: lastSessionId ? "button" : void 0,
20162
+ tabIndex: lastSessionId ? 0 : void 0,
20163
+ "aria-label": lastSessionId ? `Open last run for ${title}` : void 0,
20164
+ title: lastSessionId ? "Open last run" : void 0
20165
+ }
20166
+ )
20954
20167
  }
20955
20168
  );
20956
20169
  }
20957
20170
  function ScheduledWorkPanel({
20958
20171
  adapter,
20959
20172
  agentId,
20960
- title = "Scheduled Work",
20173
+ title = "Scheduled work",
20961
20174
  limit = DEFAULT_LIMIT2,
20962
20175
  status = "active",
20963
20176
  hideHeader = false,
@@ -20970,7 +20183,6 @@ function ScheduledWorkPanel({
20970
20183
  const [error, setError] = react.useState(null);
20971
20184
  const [hasEverLoaded, setHasEverLoaded] = react.useState(false);
20972
20185
  const [actionScheduleId, setActionScheduleId] = react.useState(null);
20973
- const [collapsed, setCollapsed] = react.useState(false);
20974
20186
  const mounted = react.useRef(true);
20975
20187
  const requestId = react.useRef(0);
20976
20188
  const lastFingerprint = react.useRef("");
@@ -21076,39 +20288,26 @@ function ScheduledWorkPanel({
21076
20288
  );
21077
20289
  if (!hasEverLoaded) return null;
21078
20290
  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
- ] });
20291
+ 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(
20292
+ ScheduledWorkRow,
20293
+ {
20294
+ item,
20295
+ canRunNow: Boolean(adapter.runScheduledWorkNow),
20296
+ canCancel: Boolean(adapter.cancelScheduledWork),
20297
+ actionScheduleId,
20298
+ onOpenLastRun: handleOpenLastRun,
20299
+ onRunNow: handleRunNow,
20300
+ onCancel: handleCancel
20301
+ },
20302
+ item.id
20303
+ )) });
20304
+ 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: [
20305
+ /* @__PURE__ */ jsxRuntime.jsxs(collapsibleHeader.CollapsibleHeader, { icon: lucideReact.CalendarClockIcon, children: [
20306
+ title,
20307
+ activeCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: activeCount })
20308
+ ] }),
20309
+ /* @__PURE__ */ jsxRuntime.jsx(collapsible.CollapsibleContent, { children: body })
20310
+ ] }) });
21112
20311
  }
21113
20312
  init_utils();
21114
20313
  var POLL_INTERVAL_ACTIVE_MS = 4e3;
@@ -21213,15 +20412,6 @@ function fallbackSessionTitle(entry) {
21213
20412
  if (entry.runKind === "scheduled") return "Scheduled run";
21214
20413
  return "New session";
21215
20414
  }
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
20415
  function TreeNodeRow({
21226
20416
  entry,
21227
20417
  depth,
@@ -21248,77 +20438,85 @@ function TreeNodeRow({
21248
20438
  if (hasChildren) setExpanded(isInActiveGroup);
21249
20439
  }, [isInActiveGroup, hasChildren]);
21250
20440
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21251
- /* @__PURE__ */ jsxRuntime.jsxs(
21252
- "div",
20441
+ /* @__PURE__ */ jsxRuntime.jsx(
20442
+ listRow.ListRow,
21253
20443
  {
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
- },
20444
+ asChild: true,
20445
+ size: "sm",
20446
+ label: title,
20447
+ description: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1", children: [
20448
+ entry.computer && // A chat on a folder of the user's computer, in every list of chats, the browser's too.
20449
+ /* @__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: [
20450
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LaptopIcon, { className: "w-3 h-3 shrink-0", "aria-hidden": "true" }),
20451
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: entry.computer })
20452
+ ] }),
20453
+ entry.computer && subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", children: "\xB7" }),
20454
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: subtitle })
20455
+ ] }),
20456
+ isActive,
21260
20457
  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)
20458
+ "cursor-pointer",
20459
+ !isActive && isInActiveGroup && "bg-foreground/[0.03]"
21264
20460
  ),
21265
20461
  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
- ] }),
20462
+ trailing: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
21293
20463
  isRunning && canStop && isChildSession && /* @__PURE__ */ jsxRuntime.jsx(
21294
- "button",
20464
+ button.Button,
21295
20465
  {
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",
20466
+ variant: "ghost",
20467
+ size: "icon-xs",
20468
+ 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
20469
  onClick: (e) => {
21299
20470
  e.stopPropagation();
21300
20471
  onStop(entry.id);
21301
20472
  },
21302
20473
  "aria-label": "Stop child session",
21303
20474
  title: "Stop child session",
21304
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareIcon, { className: "w-3 h-3", fill: "currentColor" })
20475
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquareIcon, { fill: "currentColor" })
21305
20476
  }
21306
20477
  ),
21307
20478
  canDelete && /* @__PURE__ */ jsxRuntime.jsx(
21308
- "button",
20479
+ button.Button,
21309
20480
  {
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",
20481
+ variant: "ghost",
20482
+ size: "icon-xs",
20483
+ 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
20484
  onClick: (e) => {
21313
20485
  e.stopPropagation();
21314
20486
  onDelete(entry.id);
21315
20487
  },
21316
20488
  "aria-label": "Delete session",
21317
20489
  title: "Delete session",
21318
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, { className: "w-3 h-3" })
20490
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2Icon, {})
21319
20491
  }
21320
20492
  )
21321
- ]
20493
+ ] }),
20494
+ children: /* @__PURE__ */ jsxRuntime.jsx(
20495
+ "div",
20496
+ {
20497
+ role: "button",
20498
+ tabIndex: 0,
20499
+ onClick: () => onSelect(entry.id),
20500
+ onKeyDown: (e) => {
20501
+ if (e.key === "Enter" || e.key === " ") onSelect(entry.id);
20502
+ },
20503
+ children: hasChildren ? /* @__PURE__ */ jsxRuntime.jsx(
20504
+ button.Button,
20505
+ {
20506
+ variant: "ghost",
20507
+ size: "icon-xs",
20508
+ className: "size-5",
20509
+ onClick: (e) => {
20510
+ e.stopPropagation();
20511
+ setExpanded(!expanded);
20512
+ },
20513
+ "aria-label": expanded ? "Collapse" : "Expand",
20514
+ "aria-expanded": expanded,
20515
+ children: expanded ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDownIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "size-3.5" })
20516
+ }
20517
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-5 shrink-0" })
20518
+ }
20519
+ )
21322
20520
  }
21323
20521
  ),
21324
20522
  hasChildren && expanded && entry.children.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -21516,11 +20714,15 @@ function SessionTreePanel({
21516
20714
  const topLevel = hideRoot ? roots.flatMap((r) => r.children) : roots;
21517
20715
  if (topLevel.length === 0) return null;
21518
20716
  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
- ] }),
20717
+ !hideHeader && /* @__PURE__ */ jsxRuntime.jsx(
20718
+ sectionLabel.SectionLabel,
20719
+ {
20720
+ label: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
20721
+ title,
20722
+ runningCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(badge.Badge, { variant: "default", className: "ml-1.5", children: runningCount })
20723
+ ] })
20724
+ }
20725
+ ),
21524
20726
  error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-destructive", children: error }),
21525
20727
  !error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-1 pb-2", children: topLevel.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(
21526
20728
  TreeNodeRow,