@tangle-network/agent-app 0.52.17 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,7 +50,7 @@ import {
50
50
  } from "./chunk-YJMCRXQQ.js";
51
51
 
52
52
  // src/web-react/index.tsx
53
- import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef12, useState as useState17, memo } from "react";
53
+ import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef13, useState as useState18, memo } from "react";
54
54
  import { InlineToolItem, RunRowShell } from "@tangle-network/ui/run";
55
55
 
56
56
  // src/web-react/smooth-text.ts
@@ -1435,10 +1435,221 @@ function getChatFundingRecovery(failure) {
1435
1435
  }
1436
1436
 
1437
1437
  // src/web-react/agent-profile-editor.tsx
1438
- import { useEffect as useEffect5, useId, useState as useState7 } from "react";
1438
+ import { useEffect as useEffect5, useId, useState as useState8 } from "react";
1439
1439
  import { agentProfileSchema } from "@tangle-network/agent-interface/profile-schema";
1440
- import { Button, Input, Textarea, Switch, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@tangle-network/sandbox-ui/primitives";
1440
+ import { Button as Button2, Input as Input2, Textarea, Switch, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@tangle-network/sandbox-ui/primitives";
1441
+
1442
+ // src/web-react/agent-profile-registry-search.tsx
1443
+ import { useRef as useRef5, useState as useState7 } from "react";
1444
+ import { Button, Input } from "@tangle-network/sandbox-ui/primitives";
1445
+
1446
+ // src/web-react/agent-profile-registry.ts
1447
+ var AgentProfileRegistryError = class extends Error {
1448
+ constructor(kind, message) {
1449
+ super(message);
1450
+ this.kind = kind;
1451
+ this.name = "AgentProfileRegistryError";
1452
+ }
1453
+ kind;
1454
+ };
1455
+
1456
+ // src/web-react/agent-profile-registry-search.tsx
1441
1457
  import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1458
+ var idle = { status: "idle", results: [], unavailable: [], failure: null };
1459
+ function failureOf(cause) {
1460
+ if (cause instanceof AgentProfileRegistryError) return { kind: cause.kind, message: cause.message };
1461
+ return { kind: "failed", message: cause instanceof Error ? cause.message : "Registry search failed." };
1462
+ }
1463
+ function failureText(failure) {
1464
+ if (failure.kind === "authorization-required") {
1465
+ return "Registry search needs authorization. Sign in again or ask a workspace owner.";
1466
+ }
1467
+ if (failure.kind === "unavailable") return failure.message || "Registry search is unavailable right now.";
1468
+ return failure.message || "Registry search failed.";
1469
+ }
1470
+ function useRegistrySearch(search) {
1471
+ const [state, setState] = useState7(idle);
1472
+ const request = useRef5(0);
1473
+ async function run(query) {
1474
+ const text = query.trim();
1475
+ if (!text) return;
1476
+ const epoch = ++request.current;
1477
+ const controller = new AbortController();
1478
+ setState((current) => ({ ...current, status: "searching", failure: null }));
1479
+ try {
1480
+ const result = await search(text, controller.signal);
1481
+ if (request.current !== epoch) return;
1482
+ setState({ status: "done", results: result.items, unavailable: result.unavailable ?? [], failure: null });
1483
+ } catch (cause) {
1484
+ if (request.current !== epoch) return;
1485
+ setState({ status: "done", results: [], unavailable: [], failure: failureOf(cause) });
1486
+ }
1487
+ }
1488
+ return { state, run };
1489
+ }
1490
+ function SearchBox({ label, placeholder, disabled, onSearch }) {
1491
+ const [query, setQuery] = useState7("");
1492
+ return /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
1493
+ /* @__PURE__ */ jsx7(
1494
+ Input,
1495
+ {
1496
+ "aria-label": label,
1497
+ disabled,
1498
+ value: query,
1499
+ placeholder,
1500
+ onChange: (event) => setQuery(event.target.value),
1501
+ onKeyDown: (event) => {
1502
+ if (event.key === "Enter") {
1503
+ event.preventDefault();
1504
+ onSearch(query);
1505
+ }
1506
+ }
1507
+ }
1508
+ ),
1509
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: disabled || !query.trim(), onClick: () => onSearch(query), children: "Search" })
1510
+ ] });
1511
+ }
1512
+ function SearchStatus({ state, empty }) {
1513
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
1514
+ state.status === "searching" && /* @__PURE__ */ jsx7("p", { role: "status", className: "text-xs text-muted-foreground", children: "Searching\u2026" }),
1515
+ state.failure && /* @__PURE__ */ jsx7("p", { role: "alert", className: "text-xs text-destructive", children: failureText(state.failure) }),
1516
+ !state.failure && state.unavailable.length > 0 && /* @__PURE__ */ jsxs5("p", { role: "status", className: "text-xs text-muted-foreground", children: [
1517
+ "Some catalogs could not answer: ",
1518
+ state.unavailable.join(", "),
1519
+ "."
1520
+ ] }),
1521
+ state.status === "done" && !state.failure && state.results.length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: empty })
1522
+ ] });
1523
+ }
1524
+ function AgentProfileRegistrySkillSearch({ registry, disabled, existing, validate, onAdd }) {
1525
+ const { state, run } = useRegistrySearch(async (query, signal) => {
1526
+ const result = await registry.searchSkills(query, signal);
1527
+ return { items: result.skills, unavailable: result.unavailable };
1528
+ });
1529
+ const [added, setAdded] = useState7([]);
1530
+ return /* @__PURE__ */ jsxs5("div", { className: "space-y-2 rounded-lg border border-border p-3", children: [
1531
+ /* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-foreground", children: "Find skills in maintained catalogs" }),
1532
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Search shows each skill's source and declared permissions. Adding a skill saves a reference; nothing is installed until the profile runs." }),
1533
+ /* @__PURE__ */ jsx7(
1534
+ SearchBox,
1535
+ {
1536
+ label: "Search skill catalogs",
1537
+ placeholder: "Search skills",
1538
+ disabled: disabled || state.status === "searching",
1539
+ onSearch: (query) => void run(query)
1540
+ }
1541
+ ),
1542
+ /* @__PURE__ */ jsx7(SearchStatus, { state, empty: "No skills matched that search." }),
1543
+ state.results.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: state.results.map((skill, index) => {
1544
+ const configured = existing.some((ref) => ref.name === skill.name) || added.includes(skill.name);
1545
+ const issue = configured ? null : validate(skill.ref);
1546
+ return /* @__PURE__ */ jsxs5(
1547
+ "li",
1548
+ {
1549
+ className: "space-y-1 rounded-lg border border-border p-3 text-sm",
1550
+ "aria-label": `Catalog skill ${skill.name}`,
1551
+ children: [
1552
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
1553
+ /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
1554
+ /* @__PURE__ */ jsx7("span", { className: "block break-words font-medium text-foreground", children: skill.name }),
1555
+ /* @__PURE__ */ jsx7("span", { className: "block text-xs text-muted-foreground", children: skill.catalog })
1556
+ ] }),
1557
+ /* @__PURE__ */ jsx7(
1558
+ Button,
1559
+ {
1560
+ type: "button",
1561
+ variant: "outline",
1562
+ size: "sm",
1563
+ disabled: disabled || configured || Boolean(issue),
1564
+ "aria-label": `Add skill ${skill.name}`,
1565
+ onClick: () => {
1566
+ if (onAdd(skill.ref)) setAdded((current) => [...current, skill.name]);
1567
+ },
1568
+ children: configured ? "Added" : "Add skill"
1569
+ }
1570
+ )
1571
+ ] }),
1572
+ skill.description && /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: skill.description }),
1573
+ skill.ref.kind === "github" && /* @__PURE__ */ jsxs5("p", { className: "break-words text-xs text-muted-foreground", children: [
1574
+ "Source: ",
1575
+ skill.ref.repository,
1576
+ " / ",
1577
+ skill.ref.path,
1578
+ skill.ref.ref ? ` @ ${skill.ref.ref}` : ""
1579
+ ] }),
1580
+ skill.permissions && skill.permissions.length > 0 && /* @__PURE__ */ jsxs5("p", { className: "text-xs text-muted-foreground", children: [
1581
+ "Requests: ",
1582
+ skill.permissions.join(", ")
1583
+ ] }),
1584
+ issue && /* @__PURE__ */ jsx7("p", { className: "text-xs text-destructive", children: issue })
1585
+ ]
1586
+ },
1587
+ `${skill.catalog}:${skill.name}:${index}`
1588
+ );
1589
+ }) })
1590
+ ] });
1591
+ }
1592
+ function AgentProfileRegistryMcpSearch({ registry, disabled, existingNames, validate, onAdd }) {
1593
+ const { state, run } = useRegistrySearch(async (query, signal) => {
1594
+ const result = await registry.searchMcpServers(query, signal);
1595
+ return { items: result.mcpServers, unavailable: result.unavailable };
1596
+ });
1597
+ const [added, setAdded] = useState7([]);
1598
+ return /* @__PURE__ */ jsxs5("div", { className: "space-y-2 rounded-lg border border-border p-3", children: [
1599
+ /* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-foreground", children: "Find MCP servers in registries" }),
1600
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Results come from the official MCP Registry and configured custom registries. Listing does not imply trust or authorize installation." }),
1601
+ /* @__PURE__ */ jsx7(
1602
+ SearchBox,
1603
+ {
1604
+ label: "Search MCP registries",
1605
+ placeholder: "Search MCP servers",
1606
+ disabled: disabled || state.status === "searching",
1607
+ onSearch: (query) => void run(query)
1608
+ }
1609
+ ),
1610
+ /* @__PURE__ */ jsx7(SearchStatus, { state, empty: "No MCP servers matched that search." }),
1611
+ state.results.length > 0 && /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: state.results.map((item, index) => {
1612
+ const configured = existingNames.includes(item.name) || added.includes(item.name);
1613
+ const issue = configured ? null : validate(item.name, item.server);
1614
+ return /* @__PURE__ */ jsxs5(
1615
+ "li",
1616
+ {
1617
+ className: "space-y-1 rounded-lg border border-border p-3 text-sm",
1618
+ "aria-label": `Registry server ${item.name}`,
1619
+ children: [
1620
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
1621
+ /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
1622
+ /* @__PURE__ */ jsx7("span", { className: "block break-words font-medium text-foreground", children: item.name }),
1623
+ /* @__PURE__ */ jsx7("span", { className: "block text-xs text-muted-foreground", children: item.catalog })
1624
+ ] }),
1625
+ /* @__PURE__ */ jsx7(
1626
+ Button,
1627
+ {
1628
+ type: "button",
1629
+ variant: "outline",
1630
+ size: "sm",
1631
+ disabled: disabled || configured || Boolean(issue),
1632
+ "aria-label": `Add server ${item.name}`,
1633
+ onClick: () => {
1634
+ if (onAdd(item.name, item.server)) setAdded((current) => [...current, item.name]);
1635
+ },
1636
+ children: configured ? "Added" : "Add server"
1637
+ }
1638
+ )
1639
+ ] }),
1640
+ item.description && /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: item.description }),
1641
+ /* @__PURE__ */ jsx7("p", { className: "break-words text-xs text-muted-foreground", children: "command" in item.server ? `Command: ${item.server.command}` : `URL: ${item.server.url}` }),
1642
+ issue && /* @__PURE__ */ jsx7("p", { className: "text-xs text-destructive", children: issue })
1643
+ ]
1644
+ },
1645
+ `${item.catalog}:${item.name}:${index}`
1646
+ );
1647
+ }) })
1648
+ ] });
1649
+ }
1650
+
1651
+ // src/web-react/agent-profile-editor.tsx
1652
+ import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1442
1653
  var RESOURCE_KIND_LABELS = {
1443
1654
  files: "Resource files",
1444
1655
  skills: "Skills",
@@ -1452,34 +1663,34 @@ function configuredResourceCount(profile, kind) {
1452
1663
  return Array.isArray(resource) ? resource.length : resource ? 1 : 0;
1453
1664
  }
1454
1665
  function Field({ label, hint, children }) {
1455
- return /* @__PURE__ */ jsxs5("label", { className: "block space-y-1.5 text-sm font-medium text-foreground", children: [
1456
- /* @__PURE__ */ jsx7("span", { children: label }),
1666
+ return /* @__PURE__ */ jsxs6("label", { className: "block space-y-1.5 text-sm font-medium text-foreground", children: [
1667
+ /* @__PURE__ */ jsx8("span", { children: label }),
1457
1668
  children,
1458
- hint && /* @__PURE__ */ jsx7("span", { className: "block text-xs font-normal text-muted-foreground", children: hint })
1669
+ hint && /* @__PURE__ */ jsx8("span", { className: "block text-xs font-normal text-muted-foreground", children: hint })
1459
1670
  ] });
1460
1671
  }
1461
1672
  function Section({ title, description, children }) {
1462
- return /* @__PURE__ */ jsxs5("section", { className: "space-y-4 rounded-xl border border-border bg-card p-4 sm:p-5", children: [
1463
- /* @__PURE__ */ jsxs5("div", { children: [
1464
- /* @__PURE__ */ jsx7("h2", { className: "text-base font-semibold text-foreground", children: title }),
1465
- description && /* @__PURE__ */ jsx7("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1673
+ return /* @__PURE__ */ jsxs6("section", { className: "space-y-4 rounded-xl border border-border bg-card p-4 sm:p-5", children: [
1674
+ /* @__PURE__ */ jsxs6("div", { children: [
1675
+ /* @__PURE__ */ jsx8("h2", { className: "text-base font-semibold text-foreground", children: title }),
1676
+ description && /* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1466
1677
  ] }),
1467
1678
  children
1468
1679
  ] });
1469
1680
  }
1470
1681
  function Disclosure({ title, description, detail, children }) {
1471
- return /* @__PURE__ */ jsxs5("details", { className: "group rounded-xl border border-border bg-card", children: [
1472
- /* @__PURE__ */ jsxs5("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 rounded-xl p-4 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:p-5", children: [
1473
- /* @__PURE__ */ jsxs5("span", { children: [
1474
- /* @__PURE__ */ jsx7("span", { className: "block text-base font-semibold text-foreground", children: title }),
1475
- description && /* @__PURE__ */ jsx7("span", { className: "mt-1 block text-sm text-muted-foreground", children: description })
1682
+ return /* @__PURE__ */ jsxs6("details", { className: "group rounded-xl border border-border bg-card", children: [
1683
+ /* @__PURE__ */ jsxs6("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 rounded-xl p-4 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:p-5", children: [
1684
+ /* @__PURE__ */ jsxs6("span", { children: [
1685
+ /* @__PURE__ */ jsx8("span", { className: "block text-base font-semibold text-foreground", children: title }),
1686
+ description && /* @__PURE__ */ jsx8("span", { className: "mt-1 block text-sm text-muted-foreground", children: description })
1476
1687
  ] }),
1477
- /* @__PURE__ */ jsxs5("span", { className: "flex shrink-0 items-center gap-2 text-sm text-muted-foreground", children: [
1688
+ /* @__PURE__ */ jsxs6("span", { className: "flex shrink-0 items-center gap-2 text-sm text-muted-foreground", children: [
1478
1689
  detail,
1479
- /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1690
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1480
1691
  ] })
1481
1692
  ] }),
1482
- /* @__PURE__ */ jsx7("div", { className: "space-y-4 border-t border-border p-4 sm:p-5", children })
1693
+ /* @__PURE__ */ jsx8("div", { className: "space-y-4 border-t border-border p-4 sm:p-5", children })
1483
1694
  ] });
1484
1695
  }
1485
1696
  function issueMessage(error) {
@@ -1537,17 +1748,17 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1537
1748
  function change(field, text) {
1538
1749
  onChange({ ...draft, [field]: text });
1539
1750
  }
1540
- return /* @__PURE__ */ jsxs5("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1541
- /* @__PURE__ */ jsx7(Field, { label: "Source", children: /* @__PURE__ */ jsxs5(Select, { disabled, value: draft.kind, onValueChange: (kind) => change("kind", kind), children: [
1542
- /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Source", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
1543
- /* @__PURE__ */ jsxs5(SelectContent, { children: [
1544
- /* @__PURE__ */ jsx7(SelectItem, { value: "github", children: "GitHub file" }),
1545
- /* @__PURE__ */ jsx7(SelectItem, { value: "inline", children: "Inline content" })
1751
+ return /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1752
+ /* @__PURE__ */ jsx8(Field, { label: "Source", children: /* @__PURE__ */ jsxs6(Select, { disabled, value: draft.kind, onValueChange: (kind) => change("kind", kind), children: [
1753
+ /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Source", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
1754
+ /* @__PURE__ */ jsxs6(SelectContent, { children: [
1755
+ /* @__PURE__ */ jsx8(SelectItem, { value: "github", children: "GitHub file" }),
1756
+ /* @__PURE__ */ jsx8(SelectItem, { value: "inline", children: "Inline content" })
1546
1757
  ] })
1547
1758
  ] }) }),
1548
- draft.kind === "github" ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
1549
- /* @__PURE__ */ jsx7(Field, { label: "Repository", hint: "GitHub owner/repo", children: /* @__PURE__ */ jsx7(
1550
- Input,
1759
+ draft.kind === "github" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
1760
+ /* @__PURE__ */ jsx8(Field, { label: "Repository", hint: "GitHub owner/repo", children: /* @__PURE__ */ jsx8(
1761
+ Input2,
1551
1762
  {
1552
1763
  disabled,
1553
1764
  value: draft.repository,
@@ -1555,8 +1766,8 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1555
1766
  placeholder: "owner/repo"
1556
1767
  }
1557
1768
  ) }),
1558
- /* @__PURE__ */ jsx7(Field, { label: "Repository path", hint: "Relative to the repository root", children: /* @__PURE__ */ jsx7(
1559
- Input,
1769
+ /* @__PURE__ */ jsx8(Field, { label: "Repository path", hint: "Relative to the repository root", children: /* @__PURE__ */ jsx8(
1770
+ Input2,
1560
1771
  {
1561
1772
  disabled,
1562
1773
  value: draft.path,
@@ -1564,8 +1775,8 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1564
1775
  placeholder: pathPlaceholder
1565
1776
  }
1566
1777
  ) }),
1567
- /* @__PURE__ */ jsx7(Field, { label: requireGitHubCommitSha ? "Commit SHA" : "Ref", hint: requireGitHubCommitSha ? "Use the full 40-character SHA of a fixed commit." : "Defaults to the main branch", children: /* @__PURE__ */ jsx7(
1568
- Input,
1778
+ /* @__PURE__ */ jsx8(Field, { label: requireGitHubCommitSha ? "Commit SHA" : "Ref", hint: requireGitHubCommitSha ? "Use the full 40-character SHA of a fixed commit." : "Defaults to the main branch", children: /* @__PURE__ */ jsx8(
1779
+ Input2,
1569
1780
  {
1570
1781
  disabled,
1571
1782
  value: draft.ref,
@@ -1573,13 +1784,13 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1573
1784
  placeholder: requireGitHubCommitSha ? "40-character commit SHA" : "main"
1574
1785
  }
1575
1786
  ) }),
1576
- /* @__PURE__ */ jsx7(
1787
+ /* @__PURE__ */ jsx8(
1577
1788
  Field,
1578
1789
  {
1579
1790
  label: requireSkillName ? "Skill name" : "Name",
1580
1791
  hint: requireSkillName ? "Unique lowercase name, up to 64 letters, numbers, dots, dashes, or underscores." : "Defaults to the source filename",
1581
- children: /* @__PURE__ */ jsx7(
1582
- Input,
1792
+ children: /* @__PURE__ */ jsx8(
1793
+ Input2,
1583
1794
  {
1584
1795
  disabled,
1585
1796
  value: draft.name,
@@ -1589,14 +1800,14 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1589
1800
  )
1590
1801
  }
1591
1802
  )
1592
- ] }) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
1593
- /* @__PURE__ */ jsx7(
1803
+ ] }) : /* @__PURE__ */ jsxs6(Fragment3, { children: [
1804
+ /* @__PURE__ */ jsx8(
1594
1805
  Field,
1595
1806
  {
1596
1807
  label: requireSkillName ? "Skill name" : "File name",
1597
1808
  hint: requireSkillName ? "Unique lowercase name, up to 64 letters, numbers, dots, dashes, or underscores." : void 0,
1598
- children: /* @__PURE__ */ jsx7(
1599
- Input,
1809
+ children: /* @__PURE__ */ jsx8(
1810
+ Input2,
1600
1811
  {
1601
1812
  disabled,
1602
1813
  value: draft.name,
@@ -1606,7 +1817,7 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1606
1817
  )
1607
1818
  }
1608
1819
  ),
1609
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Field, { label: "Content", children: /* @__PURE__ */ jsx7(
1820
+ /* @__PURE__ */ jsx8("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx8(Field, { label: "Content", children: /* @__PURE__ */ jsx8(
1610
1821
  Textarea,
1611
1822
  {
1612
1823
  className: "min-h-32 font-mono text-sm",
@@ -1657,28 +1868,29 @@ function AgentProfileEditor({
1657
1868
  requireGitHubCommitSha = false,
1658
1869
  requireUniqueSkillNames = false,
1659
1870
  showToolsAndPermissions = true,
1660
- publicHttpsMcpOnly = false
1871
+ publicHttpsMcpOnly = false,
1872
+ registry
1661
1873
  }) {
1662
1874
  const id = useId();
1663
1875
  const workspaceFilePrefix = normalizedFilePathPrefix(filePathPrefix);
1664
- const [error, setError] = useState7(null);
1665
- const [newTool, setNewTool] = useState7("");
1666
- const [showAllTools, setShowAllTools] = useState7(false);
1667
- const [mcpName, setMcpName] = useState7("");
1668
- const [mcpKind, setMcpKind] = useState7("http");
1876
+ const [error, setError] = useState8(null);
1877
+ const [newTool, setNewTool] = useState8("");
1878
+ const [showAllTools, setShowAllTools] = useState8(false);
1879
+ const [mcpName, setMcpName] = useState8("");
1880
+ const [mcpKind, setMcpKind] = useState8("http");
1669
1881
  const selectedMcpKind = publicHttpsMcpOnly && mcpKind === "stdio" ? "http" : mcpKind;
1670
- const [mcpTarget, setMcpTarget] = useState7("");
1671
- const [resourceDrafts, setResourceDrafts] = useState7({ skills: emptyResourceDraft(), tools: emptyResourceDraft() });
1672
- const [resourceEdit, setResourceEdit] = useState7(null);
1673
- const [newFile, setNewFile] = useState7(() => ({
1882
+ const [mcpTarget, setMcpTarget] = useState8("");
1883
+ const [resourceDrafts, setResourceDrafts] = useState8({ skills: emptyResourceDraft(), tools: emptyResourceDraft() });
1884
+ const [resourceEdit, setResourceEdit] = useState8(null);
1885
+ const [newFile, setNewFile] = useState8(() => ({
1674
1886
  path: normalizedFilePathPrefix(filePathPrefix) ?? "",
1675
1887
  resource: { ...emptyResourceDraft(), kind: "inline" },
1676
1888
  executable: false
1677
1889
  }));
1678
- const [addingFile, setAddingFile] = useState7(false);
1679
- const [fileEdit, setFileEdit] = useState7(null);
1680
- const [json, setJson] = useState7(() => JSON.stringify(value, null, 2));
1681
- const [jsonDirty, setJsonDirty] = useState7(false);
1890
+ const [addingFile, setAddingFile] = useState8(false);
1891
+ const [fileEdit, setFileEdit] = useState8(null);
1892
+ const [json, setJson] = useState8(() => JSON.stringify(value, null, 2));
1893
+ const [jsonDirty, setJsonDirty] = useState8(false);
1682
1894
  useEffect5(() => {
1683
1895
  if (!jsonDirty) setJson(JSON.stringify(value, null, 2));
1684
1896
  }, [value, jsonDirty]);
@@ -1763,9 +1975,9 @@ function AgentProfileEditor({
1763
1975
  return emit({ ...value, resources: { ...value.resources, files: next } });
1764
1976
  }
1765
1977
  function fileFields(draft, onChange2) {
1766
- return /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
1767
- /* @__PURE__ */ jsx7(Field, { label: "Workspace path", hint: workspaceFilePrefix ? "Place this file under " + workspaceFilePrefix : "Relative to the agent workspace", children: /* @__PURE__ */ jsx7(
1768
- Input,
1978
+ return /* @__PURE__ */ jsxs6("div", { className: "space-y-3", children: [
1979
+ /* @__PURE__ */ jsx8(Field, { label: "Workspace path", hint: workspaceFilePrefix ? "Place this file under " + workspaceFilePrefix : "Relative to the agent workspace", children: /* @__PURE__ */ jsx8(
1980
+ Input2,
1769
1981
  {
1770
1982
  disabled: editingDisabled,
1771
1983
  value: draft.path,
@@ -1773,7 +1985,7 @@ function AgentProfileEditor({
1773
1985
  placeholder: workspaceFilePrefix ? workspaceFilePrefix + "guide.md" : "docs/guide.md"
1774
1986
  }
1775
1987
  ) }),
1776
- /* @__PURE__ */ jsx7(
1988
+ /* @__PURE__ */ jsx8(
1777
1989
  ResourceFields,
1778
1990
  {
1779
1991
  draft: draft.resource,
@@ -1783,8 +1995,8 @@ function AgentProfileEditor({
1783
1995
  onChange: (resource) => onChange2({ ...draft, resource })
1784
1996
  }
1785
1997
  ),
1786
- allowExecutableFiles || draft.executable ? /* @__PURE__ */ jsxs5("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [
1787
- /* @__PURE__ */ jsx7(
1998
+ allowExecutableFiles || draft.executable ? /* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [
1999
+ /* @__PURE__ */ jsx8(
1788
2000
  Switch,
1789
2001
  {
1790
2002
  disabled: editingDisabled || !allowExecutableFiles && !draft.executable,
@@ -1795,25 +2007,25 @@ function AgentProfileEditor({
1795
2007
  }
1796
2008
  ),
1797
2009
  "Executable file"
1798
- ] }) : /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Executable files are unavailable for this profile." })
2010
+ ] }) : /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Executable files are unavailable for this profile." })
1799
2011
  ] });
1800
2012
  }
1801
2013
  function resourceSection(key, title, description) {
1802
2014
  const refs = value.resources?.[key] ?? [];
1803
2015
  const draft = resourceDrafts[key];
1804
- return /* @__PURE__ */ jsxs5(Disclosure, { title, description, detail: refs.length ? refs.length + " configured" : "Optional", children: [
1805
- refs.length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "None configured." }),
1806
- /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: refs.map((ref, index) => {
2016
+ return /* @__PURE__ */ jsxs6(Disclosure, { title, description, detail: refs.length ? refs.length + " configured" : "Optional", children: [
2017
+ refs.length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "None configured." }),
2018
+ /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: refs.map((ref, index) => {
1807
2019
  const issue = resourceIssue(key, resourceDraft(ref), refs, index, true);
1808
- return /* @__PURE__ */ jsxs5("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": title + " " + (index + 1), children: [
1809
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
1810
- /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
1811
- /* @__PURE__ */ jsx7("span", { className: "block break-words font-medium text-foreground", children: ref.name || (ref.kind === "github" ? ref.path : "Inline resource") }),
1812
- /* @__PURE__ */ jsx7("span", { className: "block break-words text-xs " + (ref.kind === "github" && !ref.repository ? "text-destructive" : "text-muted-foreground"), children: ref.kind === "github" ? (ref.repository ? ref.repository + " / " : "Repository required \xB7 ") + ref.path + (ref.ref ? " @ " + ref.ref : "") : "Inline content" })
2020
+ return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": title + " " + (index + 1), children: [
2021
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2022
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2023
+ /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: ref.name || (ref.kind === "github" ? ref.path : "Inline resource") }),
2024
+ /* @__PURE__ */ jsx8("span", { className: "block break-words text-xs " + (ref.kind === "github" && !ref.repository ? "text-destructive" : "text-muted-foreground"), children: ref.kind === "github" ? (ref.repository ? ref.repository + " / " : "Repository required \xB7 ") + ref.path + (ref.ref ? " @ " + ref.ref : "") : "Inline content" })
1813
2025
  ] }),
1814
- /* @__PURE__ */ jsxs5("div", { className: "flex shrink-0 gap-1", children: [
1815
- /* @__PURE__ */ jsx7(
1816
- Button,
2026
+ /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 gap-1", children: [
2027
+ /* @__PURE__ */ jsx8(
2028
+ Button2,
1817
2029
  {
1818
2030
  type: "button",
1819
2031
  variant: "ghost",
@@ -1823,8 +2035,8 @@ function AgentProfileEditor({
1823
2035
  children: "Edit"
1824
2036
  }
1825
2037
  ),
1826
- /* @__PURE__ */ jsx7(
1827
- Button,
2038
+ /* @__PURE__ */ jsx8(
2039
+ Button2,
1828
2040
  {
1829
2041
  type: "button",
1830
2042
  variant: "ghost",
@@ -1839,12 +2051,12 @@ function AgentProfileEditor({
1839
2051
  )
1840
2052
  ] })
1841
2053
  ] }),
1842
- (requireGitHubCommitSha || key === "skills" && requireUniqueSkillNames) && issue && /* @__PURE__ */ jsxs5("p", { className: "text-xs text-destructive", children: [
2054
+ (requireGitHubCommitSha || key === "skills" && requireUniqueSkillNames) && issue && /* @__PURE__ */ jsxs6("p", { className: "text-xs text-destructive", children: [
1843
2055
  issue,
1844
2056
  " Edit this resource before saving."
1845
2057
  ] }),
1846
- resourceEdit?.key === key && resourceEdit.index === index && /* @__PURE__ */ jsxs5("div", { className: "space-y-3 border-t border-border pt-3", children: [
1847
- /* @__PURE__ */ jsx7(
2058
+ resourceEdit?.key === key && resourceEdit.index === index && /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-3", children: [
2059
+ /* @__PURE__ */ jsx8(
1848
2060
  ResourceFields,
1849
2061
  {
1850
2062
  draft: resourceEdit.draft,
@@ -1855,15 +2067,25 @@ function AgentProfileEditor({
1855
2067
  onChange: (next) => setResourceEdit({ key, index, draft: next })
1856
2068
  }
1857
2069
  ),
1858
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
1859
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: applyResourceEdit, children: "Apply changes" }),
1860
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", onClick: () => setResourceEdit(null), children: "Cancel" })
2070
+ /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2071
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: applyResourceEdit, children: "Apply changes" }),
2072
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setResourceEdit(null), children: "Cancel" })
1861
2073
  ] })
1862
2074
  ] })
1863
2075
  ] }, index);
1864
2076
  }) }),
1865
- /* @__PURE__ */ jsxs5("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
1866
- /* @__PURE__ */ jsx7(
2077
+ key === "skills" && registry && /* @__PURE__ */ jsx8(
2078
+ AgentProfileRegistrySkillSearch,
2079
+ {
2080
+ registry,
2081
+ disabled: editingDisabled,
2082
+ existing: refs,
2083
+ validate: (ref) => resourceIssue("skills", resourceDraft(ref), refs),
2084
+ onAdd: (ref) => resources("skills", [...value.resources?.skills ?? [], ref])
2085
+ }
2086
+ ),
2087
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
2088
+ /* @__PURE__ */ jsx8(
1867
2089
  ResourceFields,
1868
2090
  {
1869
2091
  draft,
@@ -1874,12 +2096,12 @@ function AgentProfileEditor({
1874
2096
  onChange: (next) => setResourceDrafts((current) => ({ ...current, [key]: next }))
1875
2097
  }
1876
2098
  ),
1877
- /* @__PURE__ */ jsxs5(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => addResource(key), children: [
2099
+ /* @__PURE__ */ jsxs6(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => addResource(key), children: [
1878
2100
  "Add ",
1879
2101
  key === "skills" ? "skill" : "tool file"
1880
2102
  ] })
1881
2103
  ] }),
1882
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "GitHub files are fetched when the profile runs. Saving does not verify their contents or availability." })
2104
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "GitHub files are fetched when the profile runs. Saving does not verify their contents or availability." })
1883
2105
  ] });
1884
2106
  }
1885
2107
  function addMcp() {
@@ -1920,37 +2142,37 @@ function AgentProfileEditor({
1920
2142
  setError(cause instanceof Error ? cause.message : "Invalid JSON");
1921
2143
  }
1922
2144
  }
1923
- return /* @__PURE__ */ jsxs5("div", { className: "space-y-5 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
1924
- error && /* @__PURE__ */ jsx7("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
1925
- jsonDirty && /* @__PURE__ */ jsx7("p", { role: "status", className: "rounded-lg border border-border bg-muted p-3 text-sm text-foreground", children: "Apply or discard edits in Advanced JSON before using the other fields." }),
1926
- unsupportedResources.length > 0 && /* @__PURE__ */ jsxs5("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2145
+ return /* @__PURE__ */ jsxs6("div", { className: "space-y-5 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
2146
+ error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
2147
+ jsonDirty && /* @__PURE__ */ jsx8("p", { role: "status", className: "rounded-lg border border-border bg-muted p-3 text-sm text-foreground", children: "Apply or discard edits in Advanced JSON before using the other fields." }),
2148
+ unsupportedResources.length > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
1927
2149
  "This profile contains resources this product does not support: ",
1928
2150
  unsupportedResources.map((kind) => RESOURCE_KIND_LABELS[kind] + " (" + configuredResourceCount(value, kind) + ")").join(", "),
1929
2151
  ". They remain in the profile. Review or remove them in Advanced JSON before saving."
1930
2152
  ] }),
1931
- constrainedEntryCount > 0 && /* @__PURE__ */ jsxs5("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2153
+ constrainedEntryCount > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
1932
2154
  constrainedEntryCount,
1933
2155
  " configured resource ",
1934
2156
  constrainedEntryCount === 1 ? "entry needs" : "entries need",
1935
2157
  " repair before this product can save the profile. Review the resource sections or Advanced JSON. Existing values remain unchanged until you edit them."
1936
2158
  ] }),
1937
- invalidMcpCount > 0 && /* @__PURE__ */ jsxs5("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2159
+ invalidMcpCount > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
1938
2160
  invalidMcpCount,
1939
2161
  " configured MCP ",
1940
2162
  invalidMcpCount === 1 ? "server needs" : "servers need",
1941
2163
  " a public HTTPS endpoint before this product can save the profile. Review MCP servers or Advanced JSON. Existing values remain unchanged until you edit them."
1942
2164
  ] }),
1943
- /* @__PURE__ */ jsxs5(Section, { title: "Profile", description: "Name the agent and set its instructions.", children: [
1944
- /* @__PURE__ */ jsxs5("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1945
- /* @__PURE__ */ jsx7(Field, { label: "Name", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
1946
- /* @__PURE__ */ jsx7(Field, { label: "Description", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
2165
+ /* @__PURE__ */ jsxs6(Section, { title: "Profile", description: "Name the agent and set its instructions.", children: [
2166
+ /* @__PURE__ */ jsxs6("div", { className: "grid gap-4 sm:grid-cols-2", children: [
2167
+ /* @__PURE__ */ jsx8(Field, { label: "Name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
2168
+ /* @__PURE__ */ jsx8(Field, { label: "Description", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
1947
2169
  ] }),
1948
- /* @__PURE__ */ jsxs5("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
1949
- /* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
1950
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Project-level instructions. Each entry remains separate." }),
1951
- /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1952
- (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2", children: [
1953
- /* @__PURE__ */ jsx7(
2170
+ /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
2171
+ /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
2172
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Project-level instructions. Each entry remains separate." }),
2173
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
2174
+ (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-2", children: [
2175
+ /* @__PURE__ */ jsx8(
1954
2176
  Textarea,
1955
2177
  {
1956
2178
  "aria-label": "Instruction " + (index + 1),
@@ -1960,8 +2182,8 @@ function AgentProfileEditor({
1960
2182
  onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
1961
2183
  }
1962
2184
  ),
1963
- /* @__PURE__ */ jsx7(
1964
- Button,
2185
+ /* @__PURE__ */ jsx8(
2186
+ Button2,
1965
2187
  {
1966
2188
  type: "button",
1967
2189
  variant: "ghost",
@@ -1973,35 +2195,35 @@ function AgentProfileEditor({
1973
2195
  }
1974
2196
  )
1975
2197
  ] }, index)),
1976
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
2198
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
1977
2199
  ] })
1978
2200
  ] }),
1979
- /* @__PURE__ */ jsxs5("details", { className: "rounded-lg border border-border p-3", children: [
1980
- /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer font-medium text-foreground", children: "System prompt overrides" }),
1981
- /* @__PURE__ */ jsxs5("div", { className: "mt-4 space-y-4", children: [
1982
- /* @__PURE__ */ jsx7(Field, { label: "Append to system prompt", hint: "Keeps the harness system prompt and adds this text.", children: /* @__PURE__ */ jsx7(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
1983
- /* @__PURE__ */ jsx7(Field, { label: "Replace system prompt", hint: "Only use when the harness supports full replacement.", children: /* @__PURE__ */ jsx7(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.systemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value }) }) })
2201
+ /* @__PURE__ */ jsxs6("details", { className: "rounded-lg border border-border p-3", children: [
2202
+ /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer font-medium text-foreground", children: "System prompt overrides" }),
2203
+ /* @__PURE__ */ jsxs6("div", { className: "mt-4 space-y-4", children: [
2204
+ /* @__PURE__ */ jsx8(Field, { label: "Append to system prompt", hint: "Keeps the harness system prompt and adds this text.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
2205
+ /* @__PURE__ */ jsx8(Field, { label: "Replace system prompt", hint: "Only use when the harness supports full replacement.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.systemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value }) }) })
1984
2206
  ] })
1985
2207
  ] })
1986
2208
  ] }),
1987
- /* @__PURE__ */ jsxs5(Section, { title: "Model", description: "Set model preferences. The host decides which models can run.", children: [
1988
- /* @__PURE__ */ jsx7("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ jsx7(Field, { label: "Default model", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }) }),
1989
- /* @__PURE__ */ jsxs5("details", { className: "rounded-lg border border-border p-3", children: [
1990
- /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer font-medium text-foreground", children: "More model settings" }),
1991
- /* @__PURE__ */ jsxs5("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
1992
- /* @__PURE__ */ jsx7(Field, { label: "Small model", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
1993
- /* @__PURE__ */ jsx7(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
1994
- /* @__PURE__ */ jsx7(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs5(
2209
+ /* @__PURE__ */ jsxs6(Section, { title: "Model", description: "Set model preferences. The host decides which models can run.", children: [
2210
+ /* @__PURE__ */ jsx8("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ jsx8(Field, { label: "Default model", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }) }),
2211
+ /* @__PURE__ */ jsxs6("details", { className: "rounded-lg border border-border p-3", children: [
2212
+ /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer font-medium text-foreground", children: "More model settings" }),
2213
+ /* @__PURE__ */ jsxs6("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
2214
+ /* @__PURE__ */ jsx8(Field, { label: "Small model", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
2215
+ /* @__PURE__ */ jsx8(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
2216
+ /* @__PURE__ */ jsx8(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs6(
1995
2217
  Select,
1996
2218
  {
1997
2219
  disabled: editingDisabled,
1998
2220
  value: value.model?.reasoningEffort ?? "default",
1999
2221
  onValueChange: (level) => model({ ...value.model, reasoningEffort: level === "default" ? void 0 : level }),
2000
2222
  children: [
2001
- /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Thinking level", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
2002
- /* @__PURE__ */ jsxs5(SelectContent, { children: [
2003
- /* @__PURE__ */ jsx7(SelectItem, { value: "default", children: "Harness default" }),
2004
- ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx7(SelectItem, { value: level, children: level }, level))
2223
+ /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Thinking level", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2224
+ /* @__PURE__ */ jsxs6(SelectContent, { children: [
2225
+ /* @__PURE__ */ jsx8(SelectItem, { value: "default", children: "Harness default" }),
2226
+ ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx8(SelectItem, { value: level, children: level }, level))
2005
2227
  ] })
2006
2228
  ]
2007
2229
  }
@@ -2009,11 +2231,11 @@ function AgentProfileEditor({
2009
2231
  ] })
2010
2232
  ] })
2011
2233
  ] }),
2012
- showToolsAndPermissions && /* @__PURE__ */ jsxs5(Disclosure, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", detail: Object.keys(value.tools ?? {}).length + " configured", children: [
2013
- Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
2014
- /* @__PURE__ */ jsx7("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-border p-3 text-sm", children: [
2015
- /* @__PURE__ */ jsxs5("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
2016
- /* @__PURE__ */ jsx7(
2234
+ showToolsAndPermissions && /* @__PURE__ */ jsxs6(Disclosure, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", detail: Object.keys(value.tools ?? {}).length + " configured", children: [
2235
+ Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
2236
+ /* @__PURE__ */ jsx8("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-border p-3 text-sm", children: [
2237
+ /* @__PURE__ */ jsxs6("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
2238
+ /* @__PURE__ */ jsx8(
2017
2239
  Switch,
2018
2240
  {
2019
2241
  disabled: editingDisabled,
@@ -2023,9 +2245,9 @@ function AgentProfileEditor({
2023
2245
  ),
2024
2246
  name
2025
2247
  ] }),
2026
- /* @__PURE__ */ jsxs5("div", { className: "flex min-w-36 items-center gap-2 text-muted-foreground", children: [
2027
- /* @__PURE__ */ jsx7("span", { children: "Permission" }),
2028
- /* @__PURE__ */ jsxs5(
2248
+ /* @__PURE__ */ jsxs6("div", { className: "flex min-w-36 items-center gap-2 text-muted-foreground", children: [
2249
+ /* @__PURE__ */ jsx8("span", { children: "Permission" }),
2250
+ /* @__PURE__ */ jsxs6(
2029
2251
  Select,
2030
2252
  {
2031
2253
  disabled: editingDisabled,
@@ -2037,27 +2259,27 @@ function AgentProfileEditor({
2037
2259
  emit({ ...value, permissions });
2038
2260
  },
2039
2261
  children: [
2040
- /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Permission for " + name, children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
2041
- /* @__PURE__ */ jsxs5(SelectContent, { children: [
2042
- /* @__PURE__ */ jsx7(SelectItem, { value: "default", children: "Default" }),
2043
- /* @__PURE__ */ jsx7(SelectItem, { value: "allow", children: "Allow" }),
2044
- /* @__PURE__ */ jsx7(SelectItem, { value: "ask", children: "Ask" }),
2045
- /* @__PURE__ */ jsx7(SelectItem, { value: "deny", children: "Deny" })
2262
+ /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Permission for " + name, children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2263
+ /* @__PURE__ */ jsxs6(SelectContent, { children: [
2264
+ /* @__PURE__ */ jsx8(SelectItem, { value: "default", children: "Default" }),
2265
+ /* @__PURE__ */ jsx8(SelectItem, { value: "allow", children: "Allow" }),
2266
+ /* @__PURE__ */ jsx8(SelectItem, { value: "ask", children: "Ask" }),
2267
+ /* @__PURE__ */ jsx8(SelectItem, { value: "deny", children: "Deny" })
2046
2268
  ] })
2047
2269
  ]
2048
2270
  }
2049
2271
  )
2050
2272
  ] }),
2051
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2273
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2052
2274
  const tools = { ...value.tools };
2053
2275
  delete tools[name];
2054
2276
  emit({ ...value, tools });
2055
2277
  }, children: "Remove" })
2056
2278
  ] }, name)) }),
2057
- Object.keys(value.tools ?? {}).length > 4 && /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", onClick: () => setShowAllTools((current) => !current), children: showAllTools ? "Show fewer rules" : "Show " + (Object.keys(value.tools ?? {}).length - 4) + " more rules" }),
2058
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
2059
- /* @__PURE__ */ jsx7(Input, { "aria-label": "New tool name", disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
2060
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => {
2279
+ Object.keys(value.tools ?? {}).length > 4 && /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setShowAllTools((current) => !current), children: showAllTools ? "Show fewer rules" : "Show " + (Object.keys(value.tools ?? {}).length - 4) + " more rules" }),
2280
+ /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2281
+ /* @__PURE__ */ jsx8(Input2, { "aria-label": "New tool name", disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
2282
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => {
2061
2283
  const name = newTool.trim();
2062
2284
  if (!name || name in (value.tools ?? {})) {
2063
2285
  setError("Enter a unique tool name.");
@@ -2066,59 +2288,73 @@ function AgentProfileEditor({
2066
2288
  if (emit({ ...value, tools: { ...value.tools, [name]: true } })) setNewTool("");
2067
2289
  }, children: "Add tool" })
2068
2290
  ] }),
2069
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Nested permission rules remain in Advanced JSON." })
2291
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Nested permission rules remain in Advanced JSON." })
2070
2292
  ] }),
2071
2293
  allowsResource("skills") && resourceSection("skills", "Skills", "Add skill packages from a repository or inline content."),
2072
2294
  allowsResource("tools") && resourceSection("tools", "Tool files", "Provide files that a supported harness can discover as tools."),
2073
- /* @__PURE__ */ jsxs5(Disclosure, { title: "MCP servers", description: publicHttpsMcpOnly ? "Configure public HTTPS servers. Use secret references for credentials." : "Configure remote or local servers. Use secret references for credentials.", detail: Object.keys(value.mcp ?? {}).length + " configured", children: [
2074
- Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No servers configured." }),
2075
- /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs5("li", { className: "flex items-center justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
2076
- /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
2077
- /* @__PURE__ */ jsx7("span", { className: "font-medium", children: name }),
2078
- /* @__PURE__ */ jsx7("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
2079
- server.enabled !== false && /* @__PURE__ */ jsx7("p", { className: "truncate text-xs text-muted-foreground", children: "command" in server ? server.command : server.url }),
2080
- publicHttpsMcpOnly && publicHttpsMcpError(server) && /* @__PURE__ */ jsxs5("p", { className: "text-xs text-destructive", children: [
2295
+ /* @__PURE__ */ jsxs6(Disclosure, { title: "MCP servers", description: publicHttpsMcpOnly ? "Configure public HTTPS servers. Use secret references for credentials." : "Configure remote or local servers. Use secret references for credentials.", detail: Object.keys(value.mcp ?? {}).length + " configured", children: [
2296
+ Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No servers configured." }),
2297
+ /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs6("li", { className: "flex items-center justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
2298
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2299
+ /* @__PURE__ */ jsx8("span", { className: "font-medium", children: name }),
2300
+ /* @__PURE__ */ jsx8("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
2301
+ server.enabled !== false && /* @__PURE__ */ jsx8("p", { className: "truncate text-xs text-muted-foreground", children: "command" in server ? server.command : server.url }),
2302
+ publicHttpsMcpOnly && publicHttpsMcpError(server) && /* @__PURE__ */ jsxs6("p", { className: "text-xs text-destructive", children: [
2081
2303
  publicHttpsMcpError(server),
2082
2304
  " Remove this server or edit it in Advanced JSON before saving."
2083
2305
  ] })
2084
2306
  ] }),
2085
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2307
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2086
2308
  const mcp = { ...value.mcp };
2087
2309
  delete mcp[name];
2088
2310
  emit({ ...value, mcp });
2089
2311
  }, children: "Remove" })
2090
2312
  ] }, name)) }),
2091
- /* @__PURE__ */ jsxs5("div", { className: "grid gap-3 rounded-lg border border-dashed border-border p-3 sm:grid-cols-[1fr_10rem]", children: [
2092
- /* @__PURE__ */ jsx7(Field, { label: "Server name", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
2093
- /* @__PURE__ */ jsx7(Field, { label: "Transport", children: /* @__PURE__ */ jsxs5(Select, { disabled: editingDisabled, value: selectedMcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
2094
- /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
2095
- /* @__PURE__ */ jsxs5(SelectContent, { children: [
2096
- /* @__PURE__ */ jsx7(SelectItem, { value: "http", children: "HTTP" }),
2097
- /* @__PURE__ */ jsx7(SelectItem, { value: "sse", children: "SSE" }),
2098
- !publicHttpsMcpOnly && /* @__PURE__ */ jsx7(SelectItem, { value: "stdio", children: "Local command" })
2313
+ /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 rounded-lg border border-dashed border-border p-3 sm:grid-cols-[1fr_10rem]", children: [
2314
+ /* @__PURE__ */ jsx8(Field, { label: "Server name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
2315
+ /* @__PURE__ */ jsx8(Field, { label: "Transport", children: /* @__PURE__ */ jsxs6(Select, { disabled: editingDisabled, value: selectedMcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
2316
+ /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2317
+ /* @__PURE__ */ jsxs6(SelectContent, { children: [
2318
+ /* @__PURE__ */ jsx8(SelectItem, { value: "http", children: "HTTP" }),
2319
+ /* @__PURE__ */ jsx8(SelectItem, { value: "sse", children: "SSE" }),
2320
+ !publicHttpsMcpOnly && /* @__PURE__ */ jsx8(SelectItem, { value: "stdio", children: "Local command" })
2099
2321
  ] })
2100
2322
  ] }) }),
2101
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Field, { label: selectedMcpKind === "stdio" ? "Command" : "URL", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: selectedMcpKind === "stdio" ? "mcp-server" : "https://example.com/mcp" }) }) }),
2102
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
2323
+ /* @__PURE__ */ jsx8("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx8(Field, { label: selectedMcpKind === "stdio" ? "Command" : "URL", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: selectedMcpKind === "stdio" ? "mcp-server" : "https://example.com/mcp" }) }) }),
2324
+ /* @__PURE__ */ jsx8("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
2103
2325
  ] }),
2104
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
2326
+ registry && /* @__PURE__ */ jsx8(
2327
+ AgentProfileRegistryMcpSearch,
2328
+ {
2329
+ registry,
2330
+ disabled: editingDisabled,
2331
+ existingNames: Object.keys(value.mcp ?? {}),
2332
+ validate: (name, server) => {
2333
+ if (!name.trim()) return "The registry returned a server without a usable name.";
2334
+ if (name in (value.mcp ?? {})) return "A server with that name already exists.";
2335
+ return publicHttpsMcpOnly ? publicHttpsMcpError(server) : null;
2336
+ },
2337
+ onAdd: (name, server) => emit({ ...value, mcp: { ...value.mcp, [name]: server } })
2338
+ }
2339
+ ),
2340
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
2105
2341
  ] }),
2106
- allowsResource("files") && /* @__PURE__ */ jsxs5(Disclosure, { title: "Resource files", description: "Configure files for the agent workspace. The runtime determines whether it can place them.", detail: (value.resources?.files ?? []).length + " configured", children: [
2107
- (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No resource files configured." }),
2108
- /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => {
2342
+ allowsResource("files") && /* @__PURE__ */ jsxs6(Disclosure, { title: "Resource files", description: "Configure files for the agent workspace. The runtime determines whether it can place them.", detail: (value.resources?.files ?? []).length + " configured", children: [
2343
+ (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No resource files configured." }),
2344
+ /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => {
2109
2345
  const issues = fileIssues(fileDraft(mount), workspaceFilePrefix, allowExecutableFiles, requireGitHubCommitSha, true);
2110
- return /* @__PURE__ */ jsxs5("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2111
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2112
- /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
2113
- /* @__PURE__ */ jsx7("span", { className: "block break-words font-medium text-foreground", children: mount.path }),
2114
- /* @__PURE__ */ jsxs5("span", { className: "block break-words text-xs " + (mount.resource.kind === "github" && !mount.resource.repository ? "text-destructive" : "text-muted-foreground"), children: [
2346
+ return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2347
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2348
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2349
+ /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: mount.path }),
2350
+ /* @__PURE__ */ jsxs6("span", { className: "block break-words text-xs " + (mount.resource.kind === "github" && !mount.resource.repository ? "text-destructive" : "text-muted-foreground"), children: [
2115
2351
  mount.resource.kind === "github" ? (mount.resource.repository ? mount.resource.repository + " / " : "Repository required \xB7 ") + mount.resource.path + (mount.resource.ref ? " @ " + mount.resource.ref : "") : "Inline \xB7 " + mount.resource.name,
2116
2352
  mount.executable ? " \xB7 executable" : ""
2117
2353
  ] })
2118
2354
  ] }),
2119
- /* @__PURE__ */ jsxs5("div", { className: "flex shrink-0 gap-1", children: [
2120
- /* @__PURE__ */ jsx7(
2121
- Button,
2355
+ /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 gap-1", children: [
2356
+ /* @__PURE__ */ jsx8(
2357
+ Button2,
2122
2358
  {
2123
2359
  type: "button",
2124
2360
  variant: "ghost",
@@ -2128,8 +2364,8 @@ function AgentProfileEditor({
2128
2364
  children: "Edit"
2129
2365
  }
2130
2366
  ),
2131
- /* @__PURE__ */ jsx7(
2132
- Button,
2367
+ /* @__PURE__ */ jsx8(
2368
+ Button2,
2133
2369
  {
2134
2370
  type: "button",
2135
2371
  variant: "ghost",
@@ -2144,16 +2380,16 @@ function AgentProfileEditor({
2144
2380
  )
2145
2381
  ] })
2146
2382
  ] }),
2147
- issues.length > 0 && /* @__PURE__ */ jsx7("div", { className: "space-y-1 text-xs text-destructive", children: issues.map((issue) => /* @__PURE__ */ jsxs5("p", { children: [
2383
+ issues.length > 0 && /* @__PURE__ */ jsx8("div", { className: "space-y-1 text-xs text-destructive", children: issues.map((issue) => /* @__PURE__ */ jsxs6("p", { children: [
2148
2384
  issue,
2149
2385
  " Edit this file before saving."
2150
2386
  ] }, issue)) }),
2151
- mount.resource.kind === "inline" && fileEdit?.index !== index && /* @__PURE__ */ jsx7("pre", { className: "max-h-24 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-2 text-xs text-muted-foreground", children: mount.resource.content || "(Empty file)" }),
2152
- fileEdit?.index === index && /* @__PURE__ */ jsxs5("div", { className: "space-y-3 border-t border-border pt-3", children: [
2387
+ mount.resource.kind === "inline" && fileEdit?.index !== index && /* @__PURE__ */ jsx8("pre", { className: "max-h-24 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-2 text-xs text-muted-foreground", children: mount.resource.content || "(Empty file)" }),
2388
+ fileEdit?.index === index && /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-3", children: [
2153
2389
  fileFields(fileEdit.draft, (draft) => setFileEdit({ index, draft })),
2154
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
2155
- /* @__PURE__ */ jsx7(
2156
- Button,
2390
+ /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2391
+ /* @__PURE__ */ jsx8(
2392
+ Button2,
2157
2393
  {
2158
2394
  type: "button",
2159
2395
  variant: "outline",
@@ -2164,16 +2400,16 @@ function AgentProfileEditor({
2164
2400
  children: "Apply changes"
2165
2401
  }
2166
2402
  ),
2167
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", onClick: () => setFileEdit(null), children: "Cancel" })
2403
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setFileEdit(null), children: "Cancel" })
2168
2404
  ] })
2169
2405
  ] })
2170
2406
  ] }, index);
2171
2407
  }) }),
2172
- addingFile ? /* @__PURE__ */ jsxs5("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
2408
+ addingFile ? /* @__PURE__ */ jsxs6("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
2173
2409
  fileFields(newFile, setNewFile),
2174
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
2175
- /* @__PURE__ */ jsx7(
2176
- Button,
2410
+ /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2411
+ /* @__PURE__ */ jsx8(
2412
+ Button2,
2177
2413
  {
2178
2414
  type: "button",
2179
2415
  variant: "outline",
@@ -2187,31 +2423,31 @@ function AgentProfileEditor({
2187
2423
  children: "Add file"
2188
2424
  }
2189
2425
  ),
2190
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", onClick: () => setAddingFile(false), children: "Cancel" })
2426
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setAddingFile(false), children: "Cancel" })
2191
2427
  ] })
2192
- ] }) : /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => setAddingFile(true), children: "Add file" })
2428
+ ] }) : /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => setAddingFile(true), children: "Add file" })
2193
2429
  ] }),
2194
- /* @__PURE__ */ jsxs5(Disclosure, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
2195
- /* @__PURE__ */ jsx7("label", { htmlFor: id + "-json", className: "sr-only", children: "Full profile JSON" }),
2196
- /* @__PURE__ */ jsx7(Textarea, { id: id + "-json", className: "min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
2430
+ /* @__PURE__ */ jsxs6(Disclosure, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
2431
+ /* @__PURE__ */ jsx8("label", { htmlFor: id + "-json", className: "sr-only", children: "Full profile JSON" }),
2432
+ /* @__PURE__ */ jsx8(Textarea, { id: id + "-json", className: "min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
2197
2433
  setJson(event.target.value);
2198
2434
  setJsonDirty(true);
2199
2435
  } }),
2200
- /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-3", children: [
2201
- /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
2202
- jsonDirty && /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled, onClick: () => {
2436
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-3", children: [
2437
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
2438
+ jsonDirty && /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled, onClick: () => {
2203
2439
  setJson(JSON.stringify(value, null, 2));
2204
2440
  setJsonDirty(false);
2205
2441
  setError(null);
2206
2442
  }, children: "Discard JSON edits" })
2207
2443
  ] }),
2208
- /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Profiles are public configuration. Store credentials in a vault and reference them by secret key." })
2444
+ /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Profiles are public configuration. Store credentials in a vault and reference them by secret key." })
2209
2445
  ] })
2210
2446
  ] });
2211
2447
  }
2212
2448
 
2213
2449
  // src/web-react/agent-profile-viewer.tsx
2214
- import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
2450
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2215
2451
  function nonempty(value) {
2216
2452
  return Boolean(value?.trim());
2217
2453
  }
@@ -2225,38 +2461,38 @@ function resourceName(resource) {
2225
2461
  }
2226
2462
  function ResourceRow({ label, resource, path }) {
2227
2463
  const name = resourceName(resource);
2228
- return /* @__PURE__ */ jsxs6("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
2229
- /* @__PURE__ */ jsxs6("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
2230
- /* @__PURE__ */ jsx8("span", { className: "shrink-0 text-xs font-medium text-muted-foreground", children: label }),
2231
- path && /* @__PURE__ */ jsx8("code", { className: "break-all font-mono text-xs text-foreground", children: path }),
2232
- /* @__PURE__ */ jsx8("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
2233
- resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs6("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
2464
+ return /* @__PURE__ */ jsxs7("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
2465
+ /* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
2466
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs font-medium text-muted-foreground", children: label }),
2467
+ path && /* @__PURE__ */ jsx9("code", { className: "break-all font-mono text-xs text-foreground", children: path }),
2468
+ /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
2469
+ resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
2234
2470
  "at ",
2235
2471
  resource.ref
2236
2472
  ] })
2237
2473
  ] }),
2238
- resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs6("details", { className: "mt-1.5", children: [
2239
- /* @__PURE__ */ jsx8("summary", { className: "w-fit cursor-pointer select-none text-xs text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2240
- /* @__PURE__ */ jsx8("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-xs leading-relaxed text-foreground", children: resource.content })
2474
+ resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs7("details", { className: "mt-1.5", children: [
2475
+ /* @__PURE__ */ jsx9("summary", { className: "w-fit cursor-pointer select-none text-xs text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2476
+ /* @__PURE__ */ jsx9("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-xs leading-relaxed text-foreground", children: resource.content })
2241
2477
  ] })
2242
2478
  ] });
2243
2479
  }
2244
2480
  function PromptDetail({ label, note, value }) {
2245
- return /* @__PURE__ */ jsxs6("details", { className: "group/prompt min-w-0", children: [
2246
- /* @__PURE__ */ jsxs6("summary", { className: "flex min-w-0 cursor-pointer list-none items-start gap-2 rounded-md py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2247
- /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "mt-1 shrink-0 text-muted-foreground transition-transform group-open/prompt:rotate-90", children: "\u203A" }),
2248
- /* @__PURE__ */ jsxs6("span", { className: "min-w-0 flex-1", children: [
2249
- /* @__PURE__ */ jsx8("span", { className: "font-medium text-foreground", children: label }),
2250
- note && /* @__PURE__ */ jsx8("span", { className: "ml-2 text-xs text-muted-foreground", children: note }),
2251
- /* @__PURE__ */ jsx8("span", { className: "mt-1 block truncate text-xs text-muted-foreground", children: preview(value) })
2481
+ return /* @__PURE__ */ jsxs7("details", { className: "group/prompt min-w-0", children: [
2482
+ /* @__PURE__ */ jsxs7("summary", { className: "flex min-w-0 cursor-pointer list-none items-start gap-2 rounded-md py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2483
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "mt-1 shrink-0 text-muted-foreground transition-transform group-open/prompt:rotate-90", children: "\u203A" }),
2484
+ /* @__PURE__ */ jsxs7("span", { className: "min-w-0 flex-1", children: [
2485
+ /* @__PURE__ */ jsx9("span", { className: "font-medium text-foreground", children: label }),
2486
+ note && /* @__PURE__ */ jsx9("span", { className: "ml-2 text-xs text-muted-foreground", children: note }),
2487
+ /* @__PURE__ */ jsx9("span", { className: "mt-1 block truncate text-xs text-muted-foreground", children: preview(value) })
2252
2488
  ] })
2253
2489
  ] }),
2254
- /* @__PURE__ */ jsx8("pre", { className: "mb-2 ml-4 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: value })
2490
+ /* @__PURE__ */ jsx9("pre", { className: "mb-2 ml-4 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: value })
2255
2491
  ] });
2256
2492
  }
2257
2493
  function ProfileSection({ title, children }) {
2258
- return /* @__PURE__ */ jsxs6("section", { className: "min-w-0 py-3 first:pt-0 last:pb-0", "aria-label": title, children: [
2259
- /* @__PURE__ */ jsx8("h3", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }),
2494
+ return /* @__PURE__ */ jsxs7("section", { className: "min-w-0 py-3 first:pt-0 last:pb-0", "aria-label": title, children: [
2495
+ /* @__PURE__ */ jsx9("h3", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }),
2260
2496
  children
2261
2497
  ] });
2262
2498
  }
@@ -2309,45 +2545,45 @@ function AgentProfileViewer({ profile, className = "", defaultExpanded = true })
2309
2545
  const hasBehavior = Boolean(nonempty(prompt?.systemPrompt) || nonempty(prompt?.appendSystemPrompt) || instructions.length || (typeof resourceInstructions === "string" ? nonempty(resourceInstructions) : resourceInstructions));
2310
2546
  const hasConfiguration = Boolean(hasBehavior || tools.length || permissions.length || mcp.length || profile.connections?.length || resources.length || profile.resources?.failOnError || profile.subagents && Object.keys(profile.subagents).length || profile.hooks && Object.keys(profile.hooks).length || profile.modes && Object.keys(profile.modes).length);
2311
2547
  const hasProfileDetails = Boolean(profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.harness || profile.description || profile.version || profile.tags?.length || hasConfiguration);
2312
- return /* @__PURE__ */ jsxs6("section", { className: `min-w-0 text-sm ${className}`.trim(), "aria-label": "Agent profile", children: [
2313
- /* @__PURE__ */ jsxs6("header", { className: "min-w-0 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2314
- /* @__PURE__ */ jsx8("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2315
- nonempty(profile.description) && /* @__PURE__ */ jsx8("p", { className: "mt-1 whitespace-pre-wrap break-words leading-relaxed text-muted-foreground", children: profile.description }),
2316
- (profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs6("dl", { className: "mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs", children: [
2317
- profile.model?.default && /* @__PURE__ */ jsxs6("div", { className: "flex gap-1", children: [
2318
- /* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground", children: "Default model" }),
2319
- /* @__PURE__ */ jsx8("dd", { className: "font-medium text-foreground", children: profile.model.default })
2548
+ return /* @__PURE__ */ jsxs7("section", { className: `min-w-0 text-sm ${className}`.trim(), "aria-label": "Agent profile", children: [
2549
+ /* @__PURE__ */ jsxs7("header", { className: "min-w-0 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2550
+ /* @__PURE__ */ jsx9("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2551
+ nonempty(profile.description) && /* @__PURE__ */ jsx9("p", { className: "mt-1 whitespace-pre-wrap break-words leading-relaxed text-muted-foreground", children: profile.description }),
2552
+ (profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs7("dl", { className: "mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs", children: [
2553
+ profile.model?.default && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2554
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Default model" }),
2555
+ /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.default })
2320
2556
  ] }),
2321
- profile.model?.small && /* @__PURE__ */ jsxs6("div", { className: "flex gap-1", children: [
2322
- /* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground", children: "Small model" }),
2323
- /* @__PURE__ */ jsx8("dd", { className: "font-medium text-foreground", children: profile.model.small })
2557
+ profile.model?.small && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2558
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Small model" }),
2559
+ /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.small })
2324
2560
  ] }),
2325
- profile.model?.reasoningEffort && /* @__PURE__ */ jsxs6("div", { className: "flex gap-1", children: [
2326
- /* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground", children: "Reasoning" }),
2327
- /* @__PURE__ */ jsx8("dd", { className: "font-medium text-foreground", children: profile.model.reasoningEffort })
2561
+ profile.model?.reasoningEffort && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2562
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Reasoning" }),
2563
+ /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.reasoningEffort })
2328
2564
  ] }),
2329
- profile.harness && /* @__PURE__ */ jsxs6("div", { className: "flex gap-1", children: [
2330
- /* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground", children: "Preferred harness" }),
2331
- /* @__PURE__ */ jsx8("dd", { className: "font-medium text-foreground", children: profile.harness })
2565
+ profile.harness && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2566
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Preferred harness" }),
2567
+ /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.harness })
2332
2568
  ] }),
2333
- profile.version && /* @__PURE__ */ jsxs6("div", { className: "flex gap-1", children: [
2334
- /* @__PURE__ */ jsx8("dt", { className: "text-muted-foreground", children: "Version" }),
2335
- /* @__PURE__ */ jsx8("dd", { className: "font-medium text-foreground", children: profile.version })
2569
+ profile.version && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2570
+ /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Version" }),
2571
+ /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.version })
2336
2572
  ] }),
2337
- profile.tags?.map((tag) => /* @__PURE__ */ jsx8("div", { className: "rounded-full bg-muted px-2 py-0.5 text-muted-foreground", children: tag }, tag))
2573
+ profile.tags?.map((tag) => /* @__PURE__ */ jsx9("div", { className: "rounded-full bg-muted px-2 py-0.5 text-muted-foreground", children: tag }, tag))
2338
2574
  ] })
2339
2575
  ] }),
2340
- !hasProfileDetails && /* @__PURE__ */ jsx8("p", { className: "mt-4 border-t border-border pt-3 text-sm text-muted-foreground", children: "No profile details are configured." }),
2341
- hasConfiguration && /* @__PURE__ */ jsxs6("details", { open: defaultExpanded, className: "group/config mt-4 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2342
- /* @__PURE__ */ jsxs6("summary", { className: "flex cursor-pointer list-none items-center gap-2 rounded-md py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2343
- /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "text-muted-foreground transition-transform group-open/config:rotate-90", children: "\u203A" }),
2344
- /* @__PURE__ */ jsx8("span", { className: "font-medium text-foreground", children: "Profile configuration" }),
2345
- /* @__PURE__ */ jsx8("span", { className: "text-xs text-muted-foreground", children: [hasBehavior && "Instructions", (tools.length || permissions.length) > 0 && "Tools", mcp.length > 0 && "MCP", (resources.length || profile.resources?.failOnError) && "Resources", profile.connections?.length && "Connections", profile.subagents && Object.keys(profile.subagents).length > 0 && "Subagents", profile.hooks && Object.keys(profile.hooks).length > 0 && "Hooks", profile.modes && Object.keys(profile.modes).length > 0 && "Modes"].filter(Boolean).join(" \xB7 ") })
2576
+ !hasProfileDetails && /* @__PURE__ */ jsx9("p", { className: "mt-4 border-t border-border pt-3 text-sm text-muted-foreground", children: "No profile details are configured." }),
2577
+ hasConfiguration && /* @__PURE__ */ jsxs7("details", { open: defaultExpanded, className: "group/config mt-4 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2578
+ /* @__PURE__ */ jsxs7("summary", { className: "flex cursor-pointer list-none items-center gap-2 rounded-md py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2579
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "text-muted-foreground transition-transform group-open/config:rotate-90", children: "\u203A" }),
2580
+ /* @__PURE__ */ jsx9("span", { className: "font-medium text-foreground", children: "Profile configuration" }),
2581
+ /* @__PURE__ */ jsx9("span", { className: "text-xs text-muted-foreground", children: [hasBehavior && "Instructions", (tools.length || permissions.length) > 0 && "Tools", mcp.length > 0 && "MCP", (resources.length || profile.resources?.failOnError) && "Resources", profile.connections?.length && "Connections", profile.subagents && Object.keys(profile.subagents).length > 0 && "Subagents", profile.hooks && Object.keys(profile.hooks).length > 0 && "Hooks", profile.modes && Object.keys(profile.modes).length > 0 && "Modes"].filter(Boolean).join(" \xB7 ") })
2346
2582
  ] }),
2347
- /* @__PURE__ */ jsxs6("div", { className: "divide-y divide-border border-t border-border", children: [
2348
- hasBehavior && /* @__PURE__ */ jsx8(ProfileSection, { title: "Instructions", children: /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
2349
- nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx8(PromptDetail, { label: "System prompt", note: "Replaces the harness default", value: prompt.systemPrompt }),
2350
- nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx8(
2583
+ /* @__PURE__ */ jsxs7("div", { className: "divide-y divide-border border-t border-border", children: [
2584
+ hasBehavior && /* @__PURE__ */ jsx9(ProfileSection, { title: "Instructions", children: /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
2585
+ nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx9(PromptDetail, { label: "System prompt", note: "Replaces the harness default", value: prompt.systemPrompt }),
2586
+ nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx9(
2351
2587
  PromptDetail,
2352
2588
  {
2353
2589
  label: "Added system prompt",
@@ -2355,55 +2591,55 @@ function AgentProfileViewer({ profile, className = "", defaultExpanded = true })
2355
2591
  value: prompt.appendSystemPrompt
2356
2592
  }
2357
2593
  ),
2358
- instructions.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "space-y-1.5", children: [
2359
- /* @__PURE__ */ jsxs6("h4", { className: "font-medium text-foreground", children: [
2594
+ instructions.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2595
+ /* @__PURE__ */ jsxs7("h4", { className: "font-medium text-foreground", children: [
2360
2596
  "Project instructions ",
2361
- /* @__PURE__ */ jsx8("span", { className: "ml-1 font-normal text-xs text-muted-foreground", children: "Lower-privilege workspace guidance" })
2597
+ /* @__PURE__ */ jsx9("span", { className: "ml-1 font-normal text-xs text-muted-foreground", children: "Lower-privilege workspace guidance" })
2362
2598
  ] }),
2363
- /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsx8(PromptDetail, { label: `Instruction ${index + 1}`, value: instruction }) }, `${index}:${instruction}`)) })
2599
+ /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(PromptDetail, { label: `Instruction ${index + 1}`, value: instruction }) }, `${index}:${instruction}`)) })
2364
2600
  ] }),
2365
- typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx8(PromptDetail, { label: "Resource instructions", note: "Configured in resources", value: resourceInstructions }),
2366
- resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx8("ul", { children: /* @__PURE__ */ jsx8(ResourceRow, { label: "Instruction resource", resource: resourceInstructions }) })
2601
+ typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx9(PromptDetail, { label: "Resource instructions", note: "Configured in resources", value: resourceInstructions }),
2602
+ resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx9("ul", { children: /* @__PURE__ */ jsx9(ResourceRow, { label: "Instruction resource", resource: resourceInstructions }) })
2367
2603
  ] }) }),
2368
- (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx8(ProfileSection, { title: "Tool policy", children: /* @__PURE__ */ jsx8("div", { children: /* @__PURE__ */ jsx8("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
2604
+ (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Tool policy", children: /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
2369
2605
  const enabled = tools.find(([tool]) => tool === name)?.[1];
2370
2606
  const policy = permissions.find(([permission]) => permission === name)?.[1];
2371
- return /* @__PURE__ */ jsxs6("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2372
- /* @__PURE__ */ jsx8("code", { className: "min-w-0 break-all font-mono text-xs text-foreground", children: name }),
2373
- /* @__PURE__ */ jsx8("span", { className: "shrink-0 text-xs text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2607
+ return /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2608
+ /* @__PURE__ */ jsx9("code", { className: "min-w-0 break-all font-mono text-xs text-foreground", children: name }),
2609
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2374
2610
  ] }, name);
2375
2611
  }) }) }) }),
2376
- mcp.length > 0 && /* @__PURE__ */ jsx8(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx8("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs6("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2377
- /* @__PURE__ */ jsx8("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2378
- /* @__PURE__ */ jsx8("span", { className: "shrink-0 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2612
+ mcp.length > 0 && /* @__PURE__ */ jsx9(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2613
+ /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2614
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2379
2615
  ] }, name)) }) }),
2380
- Boolean(profile.connections?.length) && /* @__PURE__ */ jsx8(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs6("li", { className: "min-w-0", children: [
2381
- /* @__PURE__ */ jsx8("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2382
- connection.capabilities.length > 0 && /* @__PURE__ */ jsx8("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx8("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2616
+ Boolean(profile.connections?.length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
2617
+ /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2618
+ connection.capabilities.length > 0 && /* @__PURE__ */ jsx9("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2383
2619
  ] }, `${connection.alias ?? "connection"}:${index}`)) }) }),
2384
- (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs6(ProfileSection, { title: "Declared resources", children: [
2385
- /* @__PURE__ */ jsx8("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx8(ResourceRow, { ...item }, key)) }),
2386
- profile.resources?.failOnError && /* @__PURE__ */ jsx8("p", { className: "mt-2 text-xs text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2620
+ (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs7(ProfileSection, { title: "Declared resources", children: [
2621
+ /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx9(ResourceRow, { ...item }, key)) }),
2622
+ profile.resources?.failOnError && /* @__PURE__ */ jsx9("p", { className: "mt-2 text-xs text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2387
2623
  ] }),
2388
- Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx8(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx8("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs6("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
2389
- /* @__PURE__ */ jsx8("p", { className: "font-medium text-foreground", children: name }),
2390
- nonempty(subagent.description) && /* @__PURE__ */ jsx8("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-foreground", children: subagent.description })
2624
+ Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs7("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
2625
+ /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: name }),
2626
+ nonempty(subagent.description) && /* @__PURE__ */ jsx9("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-foreground", children: subagent.description })
2391
2627
  ] }, name)) }) }),
2392
- Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx8(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx8("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs6("li", { className: "flex min-w-0 justify-between gap-4", children: [
2393
- /* @__PURE__ */ jsx8("code", { className: "font-mono text-xs text-foreground", children: event }),
2394
- /* @__PURE__ */ jsxs6("span", { className: "text-xs text-muted-foreground", children: [
2628
+ Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 justify-between gap-4", children: [
2629
+ /* @__PURE__ */ jsx9("code", { className: "font-mono text-xs text-foreground", children: event }),
2630
+ /* @__PURE__ */ jsxs7("span", { className: "text-xs text-muted-foreground", children: [
2395
2631
  commands.length,
2396
2632
  " configured"
2397
2633
  ] })
2398
2634
  ] }, event)) }) }),
2399
- Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx8(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx8("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx8("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: mode }, mode)) }) })
2635
+ Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx9("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: mode }, mode)) }) })
2400
2636
  ] })
2401
2637
  ] })
2402
2638
  ] });
2403
2639
  }
2404
2640
 
2405
2641
  // src/web-react/durable-plan-flow.ts
2406
- import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef5, useState as useState8 } from "react";
2642
+ import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef6, useState as useState9 } from "react";
2407
2643
  var DurablePlanClientError = class extends Error {
2408
2644
  constructor(message, status, code, currentPlan) {
2409
2645
  super(message);
@@ -2490,12 +2726,12 @@ function createDurablePlanDecisionClient(options) {
2490
2726
  };
2491
2727
  }
2492
2728
  function useDurablePlanFlow(options) {
2493
- const [plan, setPlan] = useState8(options.plan);
2494
- const [deciding, setDeciding] = useState8(null);
2495
- const [restoring, setRestoring] = useState8(false);
2496
- const [error, setError] = useState8(null);
2497
- const attachments = useRef5(/* @__PURE__ */ new Map());
2498
- const decisionInFlight = useRef5(false);
2729
+ const [plan, setPlan] = useState9(options.plan);
2730
+ const [deciding, setDeciding] = useState9(null);
2731
+ const [restoring, setRestoring] = useState9(false);
2732
+ const [error, setError] = useState9(null);
2733
+ const attachments = useRef6(/* @__PURE__ */ new Map());
2734
+ const decisionInFlight = useRef6(false);
2499
2735
  useEffect6(() => setPlan(options.plan), [options.plan]);
2500
2736
  const apply = useCallback2(async (result) => {
2501
2737
  setPlan(result.plan);
@@ -2665,7 +2901,7 @@ function createDurableInteractionAnswerSubmitter(options) {
2665
2901
  }
2666
2902
 
2667
2903
  // src/web-react/use-chat-interactions.ts
2668
- import { useCallback as useCallback3, useMemo as useMemo3, useState as useState9 } from "react";
2904
+ import { useCallback as useCallback3, useMemo as useMemo3, useState as useState10 } from "react";
2669
2905
  function hasPendingContentDuplicate(list, interaction) {
2670
2906
  if (interaction.status !== "pending") return false;
2671
2907
  const signature = questionInteractionContentSignature(interaction);
@@ -2744,7 +2980,7 @@ function hydrateChatInteractions(list, persisted) {
2744
2980
  return persisted.reduce(upsertChatInteraction, list);
2745
2981
  }
2746
2982
  function useChatInteractions(options = {}) {
2747
- const [interactions, setInteractions] = useState9([]);
2983
+ const [interactions, setInteractions] = useState10([]);
2748
2984
  const upsert = useCallback3((interaction) => {
2749
2985
  setInteractions((prev) => upsertChatInteraction(prev, interaction));
2750
2986
  }, []);
@@ -2771,7 +3007,7 @@ function useChatInteractions(options = {}) {
2771
3007
  }
2772
3008
 
2773
3009
  // src/web-react/use-file-mentions.ts
2774
- import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef6, useState as useState10 } from "react";
3010
+ import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef7, useState as useState11 } from "react";
2775
3011
  var FILE_MENTION_KIND = "file";
2776
3012
  function toMentionItem(file) {
2777
3013
  return { id: file.path, label: file.name, detail: file.path, kind: FILE_MENTION_KIND };
@@ -2829,11 +3065,11 @@ function useFileMentions(options) {
2829
3065
  emptyText = DEFAULT_MENTION_EMPTY_TEXT
2830
3066
  } = options;
2831
3067
  const fetchImpl = options.fetchImpl ?? fetch;
2832
- const [state, setState] = useState10({ kind: "idle" });
2833
- const stateRef = useRef6(state);
3068
+ const [state, setState] = useState11({ kind: "idle" });
3069
+ const stateRef = useRef7(state);
2834
3070
  stateRef.current = state;
2835
- const inFlightRef = useRef6(null);
2836
- const [mentions, setMentions] = useState10([]);
3071
+ const inFlightRef = useRef7(null);
3072
+ const [mentions, setMentions] = useState11([]);
2837
3073
  const load = useCallback4(() => {
2838
3074
  if (inFlightRef.current) return inFlightRef.current;
2839
3075
  if (stateRef.current.kind === "idle") {
@@ -2940,8 +3176,8 @@ function segmentMentionContent(content, parts) {
2940
3176
  }
2941
3177
 
2942
3178
  // src/web-react/mission-activity.tsx
2943
- import { useCallback as useCallback5, useEffect as useEffect7, useState as useState11 } from "react";
2944
- import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
3179
+ import { useCallback as useCallback5, useEffect as useEffect7, useState as useState12 } from "react";
3180
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2945
3181
  var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
2946
3182
  var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
2947
3183
  var ERROR_STATUSES = /* @__PURE__ */ new Set(["failed", "error", "cancelled", "aborted"]);
@@ -2988,19 +3224,19 @@ function waterfallLayout(trace) {
2988
3224
  });
2989
3225
  }
2990
3226
  function ChevronGlyph({ className }) {
2991
- return /* @__PURE__ */ jsx9("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx9("path", { d: "m6 9 6 6 6-6" }) });
3227
+ return /* @__PURE__ */ jsx10("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx10("path", { d: "m6 9 6 6 6-6" }) });
2992
3228
  }
2993
3229
  function RefreshGlyph({ className }) {
2994
- return /* @__PURE__ */ jsx9("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx9("path", { d: "M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" }) });
3230
+ return /* @__PURE__ */ jsx10("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx10("path", { d: "M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" }) });
2995
3231
  }
2996
3232
  function CopyGlyph({ className }) {
2997
- return /* @__PURE__ */ jsxs7("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
2998
- /* @__PURE__ */ jsx9("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2999
- /* @__PURE__ */ jsx9("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
3233
+ return /* @__PURE__ */ jsxs8("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
3234
+ /* @__PURE__ */ jsx10("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
3235
+ /* @__PURE__ */ jsx10("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
3000
3236
  ] });
3001
3237
  }
3002
3238
  function TraceIdCopy({ traceId }) {
3003
- const [copied, setCopied] = useState11(false);
3239
+ const [copied, setCopied] = useState12(false);
3004
3240
  const copy = useCallback5(() => {
3005
3241
  void navigator.clipboard?.writeText(traceId).then(
3006
3242
  () => {
@@ -3011,7 +3247,7 @@ function TraceIdCopy({ traceId }) {
3011
3247
  }
3012
3248
  );
3013
3249
  }, [traceId]);
3014
- return /* @__PURE__ */ jsxs7(
3250
+ return /* @__PURE__ */ jsxs8(
3015
3251
  "button",
3016
3252
  {
3017
3253
  type: "button",
@@ -3020,29 +3256,29 @@ function TraceIdCopy({ traceId }) {
3020
3256
  "aria-label": "Copy trace id",
3021
3257
  className: "inline-flex min-w-0 items-center gap-1.5 rounded text-left font-mono text-muted-foreground transition hover:text-foreground",
3022
3258
  children: [
3023
- /* @__PURE__ */ jsx9("span", { className: "truncate", children: traceId }),
3024
- /* @__PURE__ */ jsx9(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
3025
- copied && /* @__PURE__ */ jsx9("span", { className: "shrink-0 not-italic text-success", children: "copied" })
3259
+ /* @__PURE__ */ jsx10("span", { className: "truncate", children: traceId }),
3260
+ /* @__PURE__ */ jsx10(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
3261
+ copied && /* @__PURE__ */ jsx10("span", { className: "shrink-0 not-italic text-success", children: "copied" })
3026
3262
  ]
3027
3263
  }
3028
3264
  );
3029
3265
  }
3030
3266
  function StatusDot({ tone }) {
3031
- return /* @__PURE__ */ jsxs7("span", { className: "inline-flex items-center", children: [
3032
- /* @__PURE__ */ jsx9(
3267
+ return /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center", children: [
3268
+ /* @__PURE__ */ jsx10(
3033
3269
  "span",
3034
3270
  {
3035
3271
  "aria-hidden": true,
3036
3272
  className: `h-2 w-2 shrink-0 rounded-full ${tone === "live" ? "bg-warning" : tone === "ok" ? "bg-success" : tone === "error" ? "bg-destructive" : "bg-muted-foreground/40"}`
3037
3273
  }
3038
3274
  ),
3039
- /* @__PURE__ */ jsx9("span", { className: "sr-only", children: tone })
3275
+ /* @__PURE__ */ jsx10("span", { className: "sr-only", children: tone })
3040
3276
  ] });
3041
3277
  }
3042
3278
  function RunLabel({ tool, detail, live }) {
3043
- return /* @__PURE__ */ jsxs7("span", { className: "min-w-0 flex-1 truncate", children: [
3044
- /* @__PURE__ */ jsx9("span", { className: live ? "agent-shimmer font-medium" : "font-medium", "data-motion": live ? "essential" : void 0, children: tool }),
3045
- /* @__PURE__ */ jsxs7("span", { className: "text-muted-foreground", children: [
3279
+ return /* @__PURE__ */ jsxs8("span", { className: "min-w-0 flex-1 truncate", children: [
3280
+ /* @__PURE__ */ jsx10("span", { className: live ? "agent-shimmer font-medium" : "font-medium", "data-motion": live ? "essential" : void 0, children: tool }),
3281
+ /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground", children: [
3046
3282
  " \u2014 ",
3047
3283
  detail
3048
3284
  ] })
@@ -3057,19 +3293,19 @@ function FlowWaterfall({ trace }) {
3057
3293
  const rows = waterfallLayout(trace);
3058
3294
  if (rows.length === 0) return null;
3059
3295
  const cost = formatActivityCost(trace.costUsd);
3060
- return /* @__PURE__ */ jsxs7("div", { className: "space-y-1", children: [
3061
- rows.map((row, i) => /* @__PURE__ */ jsxs7("div", { className: "grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-center gap-2", children: [
3062
- /* @__PURE__ */ jsx9("span", { className: "truncate font-mono text-xs text-muted-foreground", title: row.name, children: row.name }),
3063
- /* @__PURE__ */ jsx9("div", { className: "relative h-2 rounded-sm bg-secondary", children: /* @__PURE__ */ jsx9(
3296
+ return /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
3297
+ rows.map((row, i) => /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-center gap-2", children: [
3298
+ /* @__PURE__ */ jsx10("span", { className: "truncate font-mono text-xs text-muted-foreground", title: row.name, children: row.name }),
3299
+ /* @__PURE__ */ jsx10("div", { className: "relative h-2 rounded-sm bg-secondary", children: /* @__PURE__ */ jsx10(
3064
3300
  "div",
3065
3301
  {
3066
3302
  className: `absolute inset-y-0 rounded-sm ${row.ok ? BAR_CLASS[row.kind] : "bg-destructive/80"} ${row.approx ? "opacity-70" : ""}`,
3067
3303
  style: { left: `${row.offsetPct}%`, width: `${row.widthPct}%` }
3068
3304
  }
3069
3305
  ) }),
3070
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground/70", children: row.durationLabel })
3306
+ /* @__PURE__ */ jsx10("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground/70", children: row.durationLabel })
3071
3307
  ] }, i)),
3072
- /* @__PURE__ */ jsxs7("p", { className: "pt-0.5 text-right font-mono text-xs tabular-nums text-muted-foreground/60", children: [
3308
+ /* @__PURE__ */ jsxs8("p", { className: "pt-0.5 text-right font-mono text-xs tabular-nums text-muted-foreground/60", children: [
3073
3309
  (trace.totalMs / 1e3).toFixed(1),
3074
3310
  "s",
3075
3311
  cost ? ` \xB7 ${cost}` : ""
@@ -3081,35 +3317,35 @@ function LaneRow({ run, staggerIndex }) {
3081
3317
  const tone = activityTone(run.status);
3082
3318
  const cost = formatActivityCost(run.costUsd);
3083
3319
  const duration = formatActivityDuration(run.durationMs);
3084
- return /* @__PURE__ */ jsxs7("div", { className: "agent-arrive flex items-center gap-2 py-1 text-xs", style: arrival, children: [
3085
- /* @__PURE__ */ jsx9(StatusDot, { tone }),
3086
- /* @__PURE__ */ jsx9(RunLabel, { tool: run.tool, detail: run.detail, live: tone === "live" }),
3087
- tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */ jsx9("span", { className: "shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 font-mono text-xs text-warning", children: [run.iteration !== void 0 ? `iter ${run.iteration}` : null, run.phase ?? null].filter(Boolean).join(" \xB7 ") }),
3088
- /* @__PURE__ */ jsxs7("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-xs tabular-nums text-muted-foreground/70", children: [
3089
- tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx9("span", { children: run.status }),
3090
- cost && /* @__PURE__ */ jsx9("span", { children: cost }),
3091
- duration && /* @__PURE__ */ jsx9("span", { children: duration })
3320
+ return /* @__PURE__ */ jsxs8("div", { className: "agent-arrive flex items-center gap-2 py-1 text-xs", style: arrival, children: [
3321
+ /* @__PURE__ */ jsx10(StatusDot, { tone }),
3322
+ /* @__PURE__ */ jsx10(RunLabel, { tool: run.tool, detail: run.detail, live: tone === "live" }),
3323
+ tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */ jsx10("span", { className: "shrink-0 rounded-full bg-warning/10 px-1.5 py-0.5 font-mono text-xs text-warning", children: [run.iteration !== void 0 ? `iter ${run.iteration}` : null, run.phase ?? null].filter(Boolean).join(" \xB7 ") }),
3324
+ /* @__PURE__ */ jsxs8("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-xs tabular-nums text-muted-foreground/70", children: [
3325
+ tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx10("span", { children: run.status }),
3326
+ cost && /* @__PURE__ */ jsx10("span", { children: cost }),
3327
+ duration && /* @__PURE__ */ jsx10("span", { children: duration })
3092
3328
  ] })
3093
3329
  ] });
3094
3330
  }
3095
3331
  function MissionActivityLane({ activity, startedAt, nowMs }) {
3096
- const [expanded, setExpanded] = useState11(false);
3332
+ const [expanded, setExpanded] = useState12(false);
3097
3333
  if (activity.length === 0) return null;
3098
- return /* @__PURE__ */ jsxs7("div", { className: "mt-1 border-l border-border pl-3", children: [
3099
- activity.map((run, index) => /* @__PURE__ */ jsx9(LaneRow, { run, staggerIndex: index }, run.taskId)),
3100
- /* @__PURE__ */ jsxs7(
3334
+ return /* @__PURE__ */ jsxs8("div", { className: "mt-1 border-l border-border pl-3", children: [
3335
+ activity.map((run, index) => /* @__PURE__ */ jsx10(LaneRow, { run, staggerIndex: index }, run.taskId)),
3336
+ /* @__PURE__ */ jsxs8(
3101
3337
  "button",
3102
3338
  {
3103
3339
  type: "button",
3104
3340
  onClick: () => setExpanded((v) => !v),
3105
3341
  className: "flex items-center gap-1 py-0.5 text-xs font-medium text-muted-foreground/70 transition hover:text-foreground",
3106
3342
  children: [
3107
- /* @__PURE__ */ jsx9(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
3343
+ /* @__PURE__ */ jsx10(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
3108
3344
  "timeline"
3109
3345
  ]
3110
3346
  }
3111
3347
  ),
3112
- expanded && /* @__PURE__ */ jsx9("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx9(
3348
+ expanded && /* @__PURE__ */ jsx10("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx10(
3113
3349
  FlowWaterfall,
3114
3350
  {
3115
3351
  trace: stepActivityFlowTrace(activity, {
@@ -3126,39 +3362,39 @@ function ActivityRow({
3126
3362
  staggerIndex
3127
3363
  }) {
3128
3364
  const arrival = useArrivalStyle(staggerIndex);
3129
- const [open, setOpen] = useState11(false);
3365
+ const [open, setOpen] = useState12(false);
3130
3366
  const tone = activityTone(record.status);
3131
3367
  const cost = formatActivityCost(record.costUsd);
3132
3368
  const duration = formatActivityDuration(record.durationMs);
3133
- return /* @__PURE__ */ jsxs7("div", { className: "agent-arrive rounded-lg border border-card-edge bg-card", style: arrival, children: [
3134
- /* @__PURE__ */ jsxs7("button", { type: "button", onClick: () => setOpen((v) => !v), className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm", children: [
3135
- /* @__PURE__ */ jsx9(StatusDot, { tone }),
3136
- /* @__PURE__ */ jsx9(RunLabel, { tool: record.tool, detail: record.detail, live: tone === "live" }),
3137
- tone === "live" && (record.iteration !== void 0 || record.phase !== void 0) && /* @__PURE__ */ jsx9("span", { className: "shrink-0 rounded-full bg-warning/10 px-2 py-0.5 font-mono text-xs text-warning", children: [record.iteration !== void 0 ? `iter ${record.iteration}` : null, record.phase ?? null].filter(Boolean).join(" \xB7 ") }),
3138
- /* @__PURE__ */ jsx9(
3369
+ return /* @__PURE__ */ jsxs8("div", { className: "agent-arrive rounded-lg border border-card-edge bg-card", style: arrival, children: [
3370
+ /* @__PURE__ */ jsxs8("button", { type: "button", onClick: () => setOpen((v) => !v), className: "flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm", children: [
3371
+ /* @__PURE__ */ jsx10(StatusDot, { tone }),
3372
+ /* @__PURE__ */ jsx10(RunLabel, { tool: record.tool, detail: record.detail, live: tone === "live" }),
3373
+ tone === "live" && (record.iteration !== void 0 || record.phase !== void 0) && /* @__PURE__ */ jsx10("span", { className: "shrink-0 rounded-full bg-warning/10 px-2 py-0.5 font-mono text-xs text-warning", children: [record.iteration !== void 0 ? `iter ${record.iteration}` : null, record.phase ?? null].filter(Boolean).join(" \xB7 ") }),
3374
+ /* @__PURE__ */ jsx10(
3139
3375
  "span",
3140
3376
  {
3141
3377
  className: `shrink-0 rounded-full px-2 py-0.5 text-xs font-medium ${tone === "ok" ? "bg-success/10 text-success" : tone === "error" ? "bg-destructive/10 text-destructive" : tone === "live" ? "bg-warning/10 text-warning" : "bg-secondary text-muted-foreground"}`,
3142
3378
  children: record.status
3143
3379
  }
3144
3380
  ),
3145
- cost && /* @__PURE__ */ jsx9("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: cost }),
3146
- /* @__PURE__ */ jsx9(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
3381
+ cost && /* @__PURE__ */ jsx10("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: cost }),
3382
+ /* @__PURE__ */ jsx10(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
3147
3383
  ] }),
3148
- open && /* @__PURE__ */ jsxs7("div", { className: "space-y-2.5 border-t border-border px-3 py-2.5", children: [
3149
- record.durationMs !== void 0 && /* @__PURE__ */ jsx9("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx9(FlowWaterfall, { trace: stepActivityFlowTrace([record]) }) }),
3150
- /* @__PURE__ */ jsxs7("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs", children: [
3151
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground/60", children: "task" }),
3152
- /* @__PURE__ */ jsx9("dd", { className: "truncate text-muted-foreground", children: record.taskId }),
3153
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground/60", children: "started" }),
3154
- /* @__PURE__ */ jsx9("dd", { className: "text-muted-foreground", children: new Date(record.startedAt).toLocaleString() }),
3155
- duration && /* @__PURE__ */ jsxs7(Fragment3, { children: [
3156
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground/60", children: "duration" }),
3157
- /* @__PURE__ */ jsx9("dd", { className: "text-muted-foreground", children: duration })
3384
+ open && /* @__PURE__ */ jsxs8("div", { className: "space-y-2.5 border-t border-border px-3 py-2.5", children: [
3385
+ record.durationMs !== void 0 && /* @__PURE__ */ jsx10("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx10(FlowWaterfall, { trace: stepActivityFlowTrace([record]) }) }),
3386
+ /* @__PURE__ */ jsxs8("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs", children: [
3387
+ /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "task" }),
3388
+ /* @__PURE__ */ jsx10("dd", { className: "truncate text-muted-foreground", children: record.taskId }),
3389
+ /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "started" }),
3390
+ /* @__PURE__ */ jsx10("dd", { className: "text-muted-foreground", children: new Date(record.startedAt).toLocaleString() }),
3391
+ duration && /* @__PURE__ */ jsxs8(Fragment4, { children: [
3392
+ /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "duration" }),
3393
+ /* @__PURE__ */ jsx10("dd", { className: "text-muted-foreground", children: duration })
3158
3394
  ] }),
3159
- record.traceId && /* @__PURE__ */ jsxs7(Fragment3, { children: [
3160
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground/60", children: "trace" }),
3161
- /* @__PURE__ */ jsx9("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx9(TraceIdCopy, { traceId: record.traceId }) })
3395
+ record.traceId && /* @__PURE__ */ jsxs8(Fragment4, { children: [
3396
+ /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "trace" }),
3397
+ /* @__PURE__ */ jsx10("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx10(TraceIdCopy, { traceId: record.traceId }) })
3162
3398
  ] })
3163
3399
  ] }),
3164
3400
  record.missionRef && renderMissionRef?.(record.missionRef, record)
@@ -3166,10 +3402,10 @@ function ActivityRow({
3166
3402
  ] });
3167
3403
  }
3168
3404
  function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
3169
- const [rows, setRows] = useState11([]);
3170
- const [cursor, setCursor] = useState11(void 0);
3171
- const [status, setStatus] = useState11("loading");
3172
- const [error, setError] = useState11(null);
3405
+ const [rows, setRows] = useState12([]);
3406
+ const [cursor, setCursor] = useState12(void 0);
3407
+ const [status, setStatus] = useState12("loading");
3408
+ const [error, setError] = useState12(null);
3173
3409
  const load = useCallback5(
3174
3410
  async (from) => {
3175
3411
  setStatus("loading");
@@ -3190,10 +3426,10 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3190
3426
  void load();
3191
3427
  }, [load]);
3192
3428
  const loading = status === "loading";
3193
- return /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
3194
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
3195
- /* @__PURE__ */ jsx9("h2", { className: "flex-1 text-sm font-semibold", children: title }),
3196
- /* @__PURE__ */ jsx9(
3429
+ return /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
3430
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3431
+ /* @__PURE__ */ jsx10("h2", { className: "flex-1 text-sm font-semibold", children: title }),
3432
+ /* @__PURE__ */ jsx10(
3197
3433
  "button",
3198
3434
  {
3199
3435
  type: "button",
@@ -3201,15 +3437,15 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3201
3437
  disabled: loading,
3202
3438
  "aria-label": "Refresh",
3203
3439
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground disabled:opacity-50",
3204
- children: /* @__PURE__ */ jsx9(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
3440
+ children: /* @__PURE__ */ jsx10(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
3205
3441
  }
3206
3442
  )
3207
3443
  ] }),
3208
- status === "error" && /* @__PURE__ */ jsx9("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
3209
- status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx9("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
3210
- /* @__PURE__ */ jsx9("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
3211
- /* @__PURE__ */ jsx9("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record, index) => /* @__PURE__ */ jsx9(ActivityRow, { record, renderMissionRef, staggerIndex: index }, record.taskId)) }),
3212
- cursor && /* @__PURE__ */ jsx9(
3444
+ status === "error" && /* @__PURE__ */ jsx10("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
3445
+ status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx10("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
3446
+ /* @__PURE__ */ jsx10("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
3447
+ /* @__PURE__ */ jsx10("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record, index) => /* @__PURE__ */ jsx10(ActivityRow, { record, renderMissionRef, staggerIndex: index }, record.taskId)) }),
3448
+ cursor && /* @__PURE__ */ jsx10(
3213
3449
  "button",
3214
3450
  {
3215
3451
  type: "button",
@@ -3223,7 +3459,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3223
3459
  }
3224
3460
 
3225
3461
  // src/web-react/provenance.tsx
3226
- import { useCallback as useCallback6, useEffect as useEffect8, useId as useId2, useRef as useRef7, useState as useState12 } from "react";
3462
+ import { useCallback as useCallback6, useEffect as useEffect8, useId as useId2, useRef as useRef8, useState as useState13 } from "react";
3227
3463
 
3228
3464
  // src/web-react/provenance-model.ts
3229
3465
  var PROVENANCE_BASES = ["extracted", "entered", "computed", "asserted"];
@@ -3383,7 +3619,7 @@ function provenanceTriggerLabel(record, standing) {
3383
3619
  }
3384
3620
 
3385
3621
  // src/web-react/provenance.tsx
3386
- import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
3622
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3387
3623
  var BASIS_TONES = {
3388
3624
  extracted: "border-primary/30 bg-primary/10 text-primary",
3389
3625
  entered: "border-success/30 bg-success/10 text-success",
@@ -3408,27 +3644,27 @@ function BasisGlyph({ basis, className }) {
3408
3644
  };
3409
3645
  switch (basis) {
3410
3646
  case "extracted":
3411
- return /* @__PURE__ */ jsxs8("svg", { ...shared, children: [
3412
- /* @__PURE__ */ jsx10("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
3413
- /* @__PURE__ */ jsx10("polyline", { points: "14 3 14 8 19 8" }),
3414
- /* @__PURE__ */ jsx10("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
3647
+ return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3648
+ /* @__PURE__ */ jsx11("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
3649
+ /* @__PURE__ */ jsx11("polyline", { points: "14 3 14 8 19 8" }),
3650
+ /* @__PURE__ */ jsx11("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
3415
3651
  ] });
3416
3652
  case "entered":
3417
- return /* @__PURE__ */ jsxs8("svg", { ...shared, children: [
3418
- /* @__PURE__ */ jsx10("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
3419
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "7", r: "4" })
3653
+ return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3654
+ /* @__PURE__ */ jsx11("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
3655
+ /* @__PURE__ */ jsx11("circle", { cx: "12", cy: "7", r: "4" })
3420
3656
  ] });
3421
3657
  case "computed":
3422
- return /* @__PURE__ */ jsxs8("svg", { ...shared, children: [
3423
- /* @__PURE__ */ jsx10("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
3424
- /* @__PURE__ */ jsx10("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
3425
- /* @__PURE__ */ jsx10("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
3426
- /* @__PURE__ */ jsx10("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
3658
+ return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3659
+ /* @__PURE__ */ jsx11("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
3660
+ /* @__PURE__ */ jsx11("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
3661
+ /* @__PURE__ */ jsx11("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
3662
+ /* @__PURE__ */ jsx11("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
3427
3663
  ] });
3428
3664
  case "asserted":
3429
- return /* @__PURE__ */ jsxs8("svg", { ...shared, children: [
3430
- /* @__PURE__ */ jsx10("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
3431
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "3.2" })
3665
+ return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3666
+ /* @__PURE__ */ jsx11("path", { d: "M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M18.4 5.6l-2.1 2.1M7.7 16.3l-2.1 2.1" }),
3667
+ /* @__PURE__ */ jsx11("circle", { cx: "12", cy: "12", r: "3.2" })
3432
3668
  ] });
3433
3669
  }
3434
3670
  }
@@ -3448,11 +3684,11 @@ function SourceRow({
3448
3684
  const status = source.status ?? "ready";
3449
3685
  const statusLine = describeProvenanceSourceStatus(source);
3450
3686
  const openable = status === "ready" && (onOpenSource !== void 0 || source.href !== void 0);
3451
- return /* @__PURE__ */ jsxs8("li", { className: "rounded-md border border-card-edge bg-card px-2.5 py-2", children: [
3452
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
3453
- /* @__PURE__ */ jsx10("span", { className: "text-sm font-medium text-foreground", children: source.label }),
3454
- source.locator && /* @__PURE__ */ jsx10("span", { className: "text-xs text-muted-foreground", children: source.locator }),
3455
- openable && (onOpenSource ? /* @__PURE__ */ jsxs8(
3687
+ return /* @__PURE__ */ jsxs9("li", { className: "rounded-md border border-card-edge bg-card px-2.5 py-2", children: [
3688
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
3689
+ /* @__PURE__ */ jsx11("span", { className: "text-sm font-medium text-foreground", children: source.label }),
3690
+ source.locator && /* @__PURE__ */ jsx11("span", { className: "text-xs text-muted-foreground", children: source.locator }),
3691
+ openable && (onOpenSource ? /* @__PURE__ */ jsxs9(
3456
3692
  "button",
3457
3693
  {
3458
3694
  type: "button",
@@ -3463,7 +3699,7 @@ function SourceRow({
3463
3699
  source.label
3464
3700
  ]
3465
3701
  }
3466
- ) : /* @__PURE__ */ jsxs8(
3702
+ ) : /* @__PURE__ */ jsxs9(
3467
3703
  "a",
3468
3704
  {
3469
3705
  href: source.href,
@@ -3477,7 +3713,7 @@ function SourceRow({
3477
3713
  }
3478
3714
  ))
3479
3715
  ] }),
3480
- source.quote && /* @__PURE__ */ jsxs8("blockquote", { className: "mt-1 border-l-2 border-primary/50 pl-2 text-[12px] italic leading-snug text-foreground", children: [
3716
+ source.quote && /* @__PURE__ */ jsxs9("blockquote", { className: "mt-1 border-l-2 border-primary/50 pl-2 text-[12px] italic leading-snug text-foreground", children: [
3481
3717
  "\u201C",
3482
3718
  source.quote,
3483
3719
  "\u201D"
@@ -3486,14 +3722,14 @@ function SourceRow({
3486
3722
  // update is theirs to read, not an interruption. Either way it is TEXT
3487
3723
  // — a spinner alone and a greyed row alone both render as "nothing
3488
3724
  // here".
3489
- /* @__PURE__ */ jsxs8(
3725
+ /* @__PURE__ */ jsxs9(
3490
3726
  "p",
3491
3727
  {
3492
3728
  role: "status",
3493
3729
  className: `mt-1 text-xs ${status === "unavailable" ? "text-destructive" : "text-muted-foreground"}`,
3494
3730
  children: [
3495
3731
  statusLine,
3496
- status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx10(
3732
+ status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx11(
3497
3733
  "button",
3498
3734
  {
3499
3735
  type: "button",
@@ -3517,9 +3753,9 @@ function ProvenanceValue({
3517
3753
  missingValueLabel = DEFAULT_MISSING_VALUE_LABEL,
3518
3754
  className
3519
3755
  }) {
3520
- const [open, setOpen] = useState12(defaultOpen);
3521
- const triggerRef = useRef7(null);
3522
- const rootRef = useRef7(null);
3756
+ const [open, setOpen] = useState13(defaultOpen);
3757
+ const triggerRef = useRef8(null);
3758
+ const rootRef = useRef8(null);
3523
3759
  const panelId = useId2();
3524
3760
  const standing = rollUpProvenanceStanding(record, confidencePolicy);
3525
3761
  const basisMeta = provenanceBasisMeta(record.basis);
@@ -3560,12 +3796,12 @@ function ProvenanceValue({
3560
3796
  document.removeEventListener("touchstart", onPointerDown, true);
3561
3797
  };
3562
3798
  }, [open]);
3563
- const summary = /* @__PURE__ */ jsxs8("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
3564
- record.label && /* @__PURE__ */ jsx10("span", { className: "text-xs text-muted-foreground", children: record.label }),
3565
- /* @__PURE__ */ jsx10("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record.display : missingValueLabel })
3799
+ const summary = /* @__PURE__ */ jsxs9("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
3800
+ record.label && /* @__PURE__ */ jsx11("span", { className: "text-xs text-muted-foreground", children: record.label }),
3801
+ /* @__PURE__ */ jsx11("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record.display : missingValueLabel })
3566
3802
  ] });
3567
3803
  if (maxDepth <= 0) {
3568
- return /* @__PURE__ */ jsxs8(
3804
+ return /* @__PURE__ */ jsxs9(
3569
3805
  "div",
3570
3806
  {
3571
3807
  className: `inline-block max-w-full ${className ?? ""}`,
@@ -3573,22 +3809,22 @@ function ProvenanceValue({
3573
3809
  "data-provenance-standing": standing,
3574
3810
  children: [
3575
3811
  summary,
3576
- /* @__PURE__ */ jsxs8(
3812
+ /* @__PURE__ */ jsxs9(
3577
3813
  "span",
3578
3814
  {
3579
3815
  className: `ml-1.5 inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium ${BASIS_TONES[record.basis]}`,
3580
3816
  children: [
3581
- /* @__PURE__ */ jsx10(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3817
+ /* @__PURE__ */ jsx11(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3582
3818
  basisMeta.label
3583
3819
  ]
3584
3820
  }
3585
3821
  ),
3586
- /* @__PURE__ */ jsx10("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: describeProvenance(record) })
3822
+ /* @__PURE__ */ jsx11("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: describeProvenance(record) })
3587
3823
  ]
3588
3824
  }
3589
3825
  );
3590
3826
  }
3591
- return /* @__PURE__ */ jsxs8(
3827
+ return /* @__PURE__ */ jsxs9(
3592
3828
  "div",
3593
3829
  {
3594
3830
  ref: rootRef,
@@ -3597,9 +3833,9 @@ function ProvenanceValue({
3597
3833
  "data-provenance-basis": record.basis,
3598
3834
  "data-provenance-standing": standing,
3599
3835
  children: [
3600
- /* @__PURE__ */ jsxs8("span", { className: "inline-flex flex-wrap items-baseline gap-1.5", children: [
3836
+ /* @__PURE__ */ jsxs9("span", { className: "inline-flex flex-wrap items-baseline gap-1.5", children: [
3601
3837
  summary,
3602
- /* @__PURE__ */ jsxs8(
3838
+ /* @__PURE__ */ jsxs9(
3603
3839
  "button",
3604
3840
  {
3605
3841
  ref: triggerRef,
@@ -3610,17 +3846,17 @@ function ProvenanceValue({
3610
3846
  "aria-label": provenanceTriggerLabel(record, standing),
3611
3847
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium transition hover:brightness-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${BASIS_TONES[record.basis]}`,
3612
3848
  children: [
3613
- /* @__PURE__ */ jsx10(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3614
- /* @__PURE__ */ jsx10("span", { "aria-hidden": true, children: basisMeta.label })
3849
+ /* @__PURE__ */ jsx11(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3850
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": true, children: basisMeta.label })
3615
3851
  ]
3616
3852
  }
3617
3853
  ),
3618
3854
  standing !== "settled" && // Legible at rest: what to do about the value does not wait for
3619
3855
  // someone to open the panel. `aria-hidden` because the trigger's
3620
3856
  // accessible name already carries it — this is the visual half.
3621
- /* @__PURE__ */ jsx10("span", { "aria-hidden": true, className: `text-xs font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
3857
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: `text-xs font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
3622
3858
  ] }),
3623
- open && /* @__PURE__ */ jsxs8(
3859
+ open && /* @__PURE__ */ jsxs9(
3624
3860
  "div",
3625
3861
  {
3626
3862
  id: panelId,
@@ -3628,19 +3864,19 @@ function ProvenanceValue({
3628
3864
  "aria-label": provenanceTriggerLabel(record, standing),
3629
3865
  className: "mt-1.5 w-full min-w-0 space-y-2 rounded-lg border border-border bg-card px-3 py-2.5 text-left",
3630
3866
  children: [
3631
- /* @__PURE__ */ jsxs8("div", { children: [
3632
- /* @__PURE__ */ jsx10("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record) }),
3633
- /* @__PURE__ */ jsxs8("p", { className: `mt-0.5 text-xs leading-snug ${STANDING_TONES[standing]}`, children: [
3867
+ /* @__PURE__ */ jsxs9("div", { children: [
3868
+ /* @__PURE__ */ jsx11("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record) }),
3869
+ /* @__PURE__ */ jsxs9("p", { className: `mt-0.5 text-xs leading-snug ${STANDING_TONES[standing]}`, children: [
3634
3870
  standingMeta.label,
3635
3871
  " \u2014 ",
3636
3872
  provenanceNextMove(record, standing, confidencePolicy)
3637
3873
  ] }),
3638
- basisMeta.checkableAgainst === null && /* @__PURE__ */ jsxs8("p", { className: "mt-0.5 text-xs leading-snug text-muted-foreground", children: [
3874
+ basisMeta.checkableAgainst === null && /* @__PURE__ */ jsxs9("p", { className: "mt-0.5 text-xs leading-snug text-muted-foreground", children: [
3639
3875
  basisMeta.meaning,
3640
3876
  " There is nothing outside the model to check it against."
3641
3877
  ] })
3642
3878
  ] }),
3643
- sources.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx10(
3879
+ sources.length > 0 && /* @__PURE__ */ jsx11("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx11(
3644
3880
  SourceRow,
3645
3881
  {
3646
3882
  source,
@@ -3653,12 +3889,12 @@ function ProvenanceValue({
3653
3889
  gaps.filter((gap) => gap.kind !== "unavailable-source").map((gap) => (
3654
3890
  // An unavailable source already states itself on its own row; a
3655
3891
  // structural gap has no row to state it, so it gets one here.
3656
- /* @__PURE__ */ jsx10("p", { className: "rounded-md bg-destructive/10 px-2 py-1.5 text-xs leading-snug text-destructive", children: gap.message }, gap.kind)
3892
+ /* @__PURE__ */ jsx11("p", { className: "rounded-md bg-destructive/10 px-2 py-1.5 text-xs leading-snug text-destructive", children: gap.message }, gap.kind)
3657
3893
  )),
3658
- loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx10("p", { role: "status", className: "text-xs text-muted-foreground", children: "Looking up where this came from\u2026" }),
3659
- inputs.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "border-t border-border pt-2", children: [
3660
- /* @__PURE__ */ jsx10("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
3661
- /* @__PURE__ */ jsx10("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10(
3894
+ loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx11("p", { role: "status", className: "text-xs text-muted-foreground", children: "Looking up where this came from\u2026" }),
3895
+ inputs.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "border-t border-border pt-2", children: [
3896
+ /* @__PURE__ */ jsx11("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
3897
+ /* @__PURE__ */ jsx11("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(
3662
3898
  ProvenanceValue,
3663
3899
  {
3664
3900
  record: input,
@@ -3679,26 +3915,26 @@ function ProvenanceValue({
3679
3915
  }
3680
3916
  function ProvenanceLegend({ bases, className }) {
3681
3917
  if (bases.length === 0) return null;
3682
- return /* @__PURE__ */ jsx10("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
3918
+ return /* @__PURE__ */ jsx11("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
3683
3919
  const meta = provenanceBasisMeta(basis);
3684
- return /* @__PURE__ */ jsxs8("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
3685
- /* @__PURE__ */ jsxs8(
3920
+ return /* @__PURE__ */ jsxs9("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
3921
+ /* @__PURE__ */ jsxs9(
3686
3922
  "span",
3687
3923
  {
3688
3924
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium ${BASIS_TONES[basis]}`,
3689
3925
  children: [
3690
- /* @__PURE__ */ jsx10(BasisGlyph, { basis, className: "h-3 w-3" }),
3926
+ /* @__PURE__ */ jsx11(BasisGlyph, { basis, className: "h-3 w-3" }),
3691
3927
  meta.label
3692
3928
  ]
3693
3929
  }
3694
3930
  ),
3695
- /* @__PURE__ */ jsx10("span", { children: meta.meaning })
3931
+ /* @__PURE__ */ jsx11("span", { children: meta.meaning })
3696
3932
  ] }, basis);
3697
3933
  }) });
3698
3934
  }
3699
3935
 
3700
3936
  // src/web-react/seat-paywall.tsx
3701
- import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3937
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3702
3938
  function usd(cents) {
3703
3939
  return new Intl.NumberFormat("en-US", {
3704
3940
  style: "currency",
@@ -3708,7 +3944,7 @@ function usd(cents) {
3708
3944
  }).format(cents / 100);
3709
3945
  }
3710
3946
  function CheckGlyph3() {
3711
- return /* @__PURE__ */ jsx11(
3947
+ return /* @__PURE__ */ jsx12(
3712
3948
  "svg",
3713
3949
  {
3714
3950
  className: "h-4 w-4 shrink-0 text-primary",
@@ -3719,14 +3955,14 @@ function CheckGlyph3() {
3719
3955
  strokeLinecap: "round",
3720
3956
  strokeLinejoin: "round",
3721
3957
  "aria-hidden": true,
3722
- children: /* @__PURE__ */ jsx11("path", { d: "M20 6 9 17l-5-5" })
3958
+ children: /* @__PURE__ */ jsx12("path", { d: "M20 6 9 17l-5-5" })
3723
3959
  }
3724
3960
  );
3725
3961
  }
3726
3962
  function Benefit({ children }) {
3727
- return /* @__PURE__ */ jsxs9("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
3728
- /* @__PURE__ */ jsx11("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx11(CheckGlyph3, {}) }),
3729
- /* @__PURE__ */ jsx11("span", { children })
3963
+ return /* @__PURE__ */ jsxs10("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
3964
+ /* @__PURE__ */ jsx12("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx12(CheckGlyph3, {}) }),
3965
+ /* @__PURE__ */ jsx12("span", { children })
3730
3966
  ] });
3731
3967
  }
3732
3968
  function SeatPaywall({
@@ -3744,45 +3980,45 @@ function SeatPaywall({
3744
3980
  const recurringPrice = offer ? usd(offer.recurring.priceCents) : `$${priceUsd}`;
3745
3981
  const recurringUsage = offer ? usd(offer.recurring.includedCreditsCents) : `$${includedUsageUsd}`;
3746
3982
  const introductory = offer?.introductory ?? null;
3747
- return /* @__PURE__ */ jsx11("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs9("div", { className: "w-full max-w-md rounded-2xl border border-card-edge bg-card p-8", children: [
3748
- /* @__PURE__ */ jsx11("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: product }),
3749
- /* @__PURE__ */ jsxs9("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
3983
+ return /* @__PURE__ */ jsx12("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs10("div", { className: "w-full max-w-md rounded-2xl border border-card-edge bg-card p-8", children: [
3984
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: product }),
3985
+ /* @__PURE__ */ jsxs10("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
3750
3986
  "Unlock ",
3751
3987
  product
3752
3988
  ] }),
3753
- tagline && /* @__PURE__ */ jsx11("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
3754
- introductory ? /* @__PURE__ */ jsxs9(Fragment4, { children: [
3755
- /* @__PURE__ */ jsxs9("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
3756
- /* @__PURE__ */ jsx11("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
3757
- /* @__PURE__ */ jsx11("span", { className: "text-sm text-muted-foreground", children: "first month" })
3989
+ tagline && /* @__PURE__ */ jsx12("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
3990
+ introductory ? /* @__PURE__ */ jsxs10(Fragment5, { children: [
3991
+ /* @__PURE__ */ jsxs10("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
3992
+ /* @__PURE__ */ jsx12("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
3993
+ /* @__PURE__ */ jsx12("span", { className: "text-sm text-muted-foreground", children: "first month" })
3758
3994
  ] }),
3759
- /* @__PURE__ */ jsxs9("p", { className: "mt-1 text-sm text-muted-foreground", children: [
3995
+ /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
3760
3996
  "Includes ",
3761
3997
  usd(introductory.includedCreditsCents),
3762
3998
  " of AI usage in your first month"
3763
3999
  ] }),
3764
- /* @__PURE__ */ jsxs9("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4000
+ /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
3765
4001
  "Then ",
3766
4002
  recurringPrice,
3767
4003
  "/mo \xB7 includes ",
3768
4004
  recurringUsage,
3769
4005
  "/mo of AI usage"
3770
4006
  ] })
3771
- ] }) : /* @__PURE__ */ jsxs9(Fragment4, { children: [
3772
- /* @__PURE__ */ jsxs9("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
3773
- /* @__PURE__ */ jsx11("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
3774
- /* @__PURE__ */ jsx11("span", { className: "text-sm text-muted-foreground", children: "/mo" })
4007
+ ] }) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
4008
+ /* @__PURE__ */ jsxs10("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
4009
+ /* @__PURE__ */ jsx12("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
4010
+ /* @__PURE__ */ jsx12("span", { className: "text-sm text-muted-foreground", children: "/mo" })
3775
4011
  ] }),
3776
- /* @__PURE__ */ jsxs9("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4012
+ /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
3777
4013
  "Includes ",
3778
4014
  recurringUsage,
3779
4015
  "/mo of AI usage"
3780
4016
  ] })
3781
4017
  ] }),
3782
- /* @__PURE__ */ jsx11("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
4018
+ /* @__PURE__ */ jsx12("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
3783
4019
  `Full access to ${product}`
3784
- ]).map((benefit, i) => /* @__PURE__ */ jsx11(Benefit, { children: benefit }, i)) }),
3785
- /* @__PURE__ */ jsx11(
4020
+ ]).map((benefit, i) => /* @__PURE__ */ jsx12(Benefit, { children: benefit }, i)) }),
4021
+ /* @__PURE__ */ jsx12(
3786
4022
  "button",
3787
4023
  {
3788
4024
  type: "button",
@@ -3792,20 +4028,20 @@ function SeatPaywall({
3792
4028
  children: pending ? "Opening checkout\u2026" : ctaLabel ?? "Continue to checkout"
3793
4029
  }
3794
4030
  ),
3795
- footnote && /* @__PURE__ */ jsx11("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
4031
+ footnote && /* @__PURE__ */ jsx12("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
3796
4032
  ] }) });
3797
4033
  }
3798
4034
 
3799
4035
  // src/web-react/record-grid.tsx
3800
4036
  import {
3801
- Fragment as Fragment5,
4037
+ Fragment as Fragment6,
3802
4038
  isValidElement,
3803
4039
  useCallback as useCallback7,
3804
4040
  useEffect as useEffect9,
3805
4041
  useId as useId3,
3806
4042
  useMemo as useMemo5,
3807
- useRef as useRef8,
3808
- useState as useState13
4043
+ useRef as useRef9,
4044
+ useState as useState14
3809
4045
  } from "react";
3810
4046
 
3811
4047
  // src/web-react/record-grid-model.ts
@@ -4161,7 +4397,7 @@ function pruneRecordGridOverlay(rows, overlay) {
4161
4397
  }
4162
4398
 
4163
4399
  // src/web-react/record-grid.tsx
4164
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
4400
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4165
4401
  var EMPTY_RECORD_GRID_ROWS = [];
4166
4402
  var CELL_KEY_SEPARATOR = "\0";
4167
4403
  function cellKey(rowId, columnId) {
@@ -4221,23 +4457,23 @@ function RecordGrid({
4221
4457
  className
4222
4458
  }) {
4223
4459
  const fieldPrefix = useId3();
4224
- const [overlay, setOverlay] = useState13(EMPTY_RECORD_GRID_OVERLAY);
4225
- const [editing, setEditingState] = useState13(null);
4226
- const [cellErrors, setCellErrors] = useState13({});
4227
- const [rowErrors, setRowErrors] = useState13({});
4228
- const [pendingRows, setPendingRows] = useState13({});
4229
- const [focus, setFocus] = useState13(null);
4230
- const [openSource, setOpenSource] = useState13(null);
4231
- const [confirmDelete, setConfirmDelete] = useState13(null);
4232
- const [adding, setAdding] = useState13(false);
4233
- const [draft, setDraft] = useState13({ ...newRowDefaults ?? {} });
4234
- const [draftErrors, setDraftErrors] = useState13({});
4235
- const [draftError, setDraftError] = useState13(null);
4236
- const [creating, setCreating] = useState13(false);
4237
- const cellRefs = useRef8(/* @__PURE__ */ new Map());
4238
- const settling = useRef8(false);
4239
- const draftCounter = useRef8(0);
4240
- const editingRef = useRef8(null);
4460
+ const [overlay, setOverlay] = useState14(EMPTY_RECORD_GRID_OVERLAY);
4461
+ const [editing, setEditingState] = useState14(null);
4462
+ const [cellErrors, setCellErrors] = useState14({});
4463
+ const [rowErrors, setRowErrors] = useState14({});
4464
+ const [pendingRows, setPendingRows] = useState14({});
4465
+ const [focus, setFocus] = useState14(null);
4466
+ const [openSource, setOpenSource] = useState14(null);
4467
+ const [confirmDelete, setConfirmDelete] = useState14(null);
4468
+ const [adding, setAdding] = useState14(false);
4469
+ const [draft, setDraft] = useState14({ ...newRowDefaults ?? {} });
4470
+ const [draftErrors, setDraftErrors] = useState14({});
4471
+ const [draftError, setDraftError] = useState14(null);
4472
+ const [creating, setCreating] = useState14(false);
4473
+ const cellRefs = useRef9(/* @__PURE__ */ new Map());
4474
+ const settling = useRef9(false);
4475
+ const draftCounter = useRef9(0);
4476
+ const editingRef = useRef9(null);
4241
4477
  const setEditing = useCallback7((next) => {
4242
4478
  editingRef.current = next;
4243
4479
  setEditingState(next);
@@ -4473,9 +4709,9 @@ function RecordGrid({
4473
4709
  [beginEdit, columns, editing, focusCell, onUpdate, reviewing, visibleRows]
4474
4710
  );
4475
4711
  if (state.status === "idle" || state.status === "loading") {
4476
- return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
4712
+ return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4477
4713
  toolbar,
4478
- /* @__PURE__ */ jsxs10(
4714
+ /* @__PURE__ */ jsxs11(
4479
4715
  "div",
4480
4716
  {
4481
4717
  role: "status",
@@ -4483,22 +4719,22 @@ function RecordGrid({
4483
4719
  "aria-live": "polite",
4484
4720
  className: "space-y-2 rounded-xl border border-card-edge bg-card p-4",
4485
4721
  children: [
4486
- /* @__PURE__ */ jsxs10("span", { className: "sr-only", children: [
4722
+ /* @__PURE__ */ jsxs11("span", { className: "sr-only", children: [
4487
4723
  "Loading ",
4488
4724
  caption
4489
4725
  ] }),
4490
- Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx12("div", { className: "h-8 animate-pulse rounded-md bg-secondary", "aria-hidden": true }, index))
4726
+ Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx13("div", { className: "h-8 animate-pulse rounded-md bg-secondary", "aria-hidden": true }, index))
4491
4727
  ]
4492
4728
  }
4493
4729
  )
4494
4730
  ] });
4495
4731
  }
4496
4732
  if (state.status === "error") {
4497
- return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
4733
+ return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4498
4734
  toolbar,
4499
- /* @__PURE__ */ jsxs10("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
4500
- /* @__PURE__ */ jsx12("p", { className: "text-sm font-medium text-destructive", children: state.message }),
4501
- /* @__PURE__ */ jsx12(
4735
+ /* @__PURE__ */ jsxs11("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
4736
+ /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium text-destructive", children: state.message }),
4737
+ /* @__PURE__ */ jsx13(
4502
4738
  "button",
4503
4739
  {
4504
4740
  type: "button",
@@ -4510,7 +4746,7 @@ function RecordGrid({
4510
4746
  ] })
4511
4747
  ] });
4512
4748
  }
4513
- const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */ jsx12(
4749
+ const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */ jsx13(
4514
4750
  AddRecordForm,
4515
4751
  {
4516
4752
  columns,
@@ -4529,13 +4765,13 @@ function RecordGrid({
4529
4765
  }
4530
4766
  ) : null;
4531
4767
  if (visibleRows.length === 0 && !reviewing) {
4532
- return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
4768
+ return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4533
4769
  toolbar,
4534
- addForm ?? /* @__PURE__ */ jsxs10("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
4535
- /* @__PURE__ */ jsx12("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
4536
- empty.description && /* @__PURE__ */ jsx12("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
4537
- /* @__PURE__ */ jsxs10("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
4538
- empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx12(
4770
+ addForm ?? /* @__PURE__ */ jsxs11("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
4771
+ /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
4772
+ empty.description && /* @__PURE__ */ jsx13("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
4773
+ /* @__PURE__ */ jsxs11("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
4774
+ empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx13(
4539
4775
  "button",
4540
4776
  {
4541
4777
  type: "button",
@@ -4544,7 +4780,7 @@ function RecordGrid({
4544
4780
  children: empty.action.label
4545
4781
  }
4546
4782
  )),
4547
- onCreate && /* @__PURE__ */ jsx12(
4783
+ onCreate && /* @__PURE__ */ jsx13(
4548
4784
  "button",
4549
4785
  {
4550
4786
  type: "button",
@@ -4569,18 +4805,18 @@ function RecordGrid({
4569
4805
  addedCount > 0 ? `${addedCount} added` : null,
4570
4806
  removedCount > 0 ? `${removedCount} removed` : null
4571
4807
  ].filter((part) => part !== null).join(" \xB7 ");
4572
- const reviewBar = reviewing ? /* @__PURE__ */ jsxs10(
4808
+ const reviewBar = reviewing ? /* @__PURE__ */ jsxs11(
4573
4809
  "div",
4574
4810
  {
4575
4811
  "data-record-grid-review": "",
4576
4812
  className: "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-card-edge bg-card px-4 py-2.5",
4577
4813
  children: [
4578
- /* @__PURE__ */ jsxs10("div", { className: "min-w-0", children: [
4579
- /* @__PURE__ */ jsx12("p", { className: "text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: "Proposed changes" }),
4580
- /* @__PURE__ */ jsx12("p", { className: "mt-0.5 text-xs tabular-nums text-muted-foreground", children: reviewSummary })
4814
+ /* @__PURE__ */ jsxs11("div", { className: "min-w-0", children: [
4815
+ /* @__PURE__ */ jsx13("p", { className: "text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: "Proposed changes" }),
4816
+ /* @__PURE__ */ jsx13("p", { className: "mt-0.5 text-xs tabular-nums text-muted-foreground", children: reviewSummary })
4581
4817
  ] }),
4582
- (onAcceptAll || onRejectAll) && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
4583
- onRejectAll && /* @__PURE__ */ jsx12(
4818
+ (onAcceptAll || onRejectAll) && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
4819
+ onRejectAll && /* @__PURE__ */ jsx13(
4584
4820
  "button",
4585
4821
  {
4586
4822
  type: "button",
@@ -4590,7 +4826,7 @@ function RecordGrid({
4590
4826
  children: "Reject all"
4591
4827
  }
4592
4828
  ),
4593
- onAcceptAll && /* @__PURE__ */ jsx12(
4829
+ onAcceptAll && /* @__PURE__ */ jsx13(
4594
4830
  "button",
4595
4831
  {
4596
4832
  type: "button",
@@ -4604,10 +4840,10 @@ function RecordGrid({
4604
4840
  ]
4605
4841
  }
4606
4842
  ) : null;
4607
- return /* @__PURE__ */ jsxs10("div", { className: `space-y-3 ${className ?? ""}`, children: [
4843
+ return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4608
4844
  toolbar,
4609
4845
  reviewBar,
4610
- /* @__PURE__ */ jsx12("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs10(
4846
+ /* @__PURE__ */ jsx13("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs11(
4611
4847
  "table",
4612
4848
  {
4613
4849
  role: "grid",
@@ -4615,8 +4851,8 @@ function RecordGrid({
4615
4851
  className: "w-full border-collapse text-left text-sm",
4616
4852
  onKeyDown: handleGridKeyDown,
4617
4853
  children: [
4618
- /* @__PURE__ */ jsx12("thead", { children: /* @__PURE__ */ jsxs10("tr", { role: "row", className: "border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4619
- columns.map((column) => /* @__PURE__ */ jsx12(
4854
+ /* @__PURE__ */ jsx13("thead", { children: /* @__PURE__ */ jsxs11("tr", { role: "row", className: "border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4855
+ columns.map((column) => /* @__PURE__ */ jsx13(
4620
4856
  "th",
4621
4857
  {
4622
4858
  role: "columnheader",
@@ -4626,17 +4862,17 @@ function RecordGrid({
4626
4862
  },
4627
4863
  column.id
4628
4864
  )),
4629
- showActionsColumn && /* @__PURE__ */ jsx12("th", { role: "columnheader", scope: "col", className: "w-px px-3 py-2 font-medium", children: /* @__PURE__ */ jsx12("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
4865
+ showActionsColumn && /* @__PURE__ */ jsx13("th", { role: "columnheader", scope: "col", className: "w-px px-3 py-2 font-medium", children: /* @__PURE__ */ jsx13("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
4630
4866
  ] }) }),
4631
- /* @__PURE__ */ jsxs10("tbody", { children: [
4867
+ /* @__PURE__ */ jsxs11("tbody", { children: [
4632
4868
  visibleRows.map((row) => {
4633
4869
  const rowLabel = recordGridRowLabel(columns, row);
4634
4870
  const pending = row.id in pendingRows;
4635
4871
  const rowError = rowErrors[row.id];
4636
4872
  const rowDiff = reviewing ? diffByRow.get(row.id) : void 0;
4637
4873
  const removedRow = rowDiff?.kind === "removed";
4638
- return /* @__PURE__ */ jsxs10(Fragment5, { children: [
4639
- /* @__PURE__ */ jsxs10(
4874
+ return /* @__PURE__ */ jsxs11(Fragment6, { children: [
4875
+ /* @__PURE__ */ jsxs11(
4640
4876
  "tr",
4641
4877
  {
4642
4878
  role: "row",
@@ -4656,8 +4892,8 @@ function RecordGrid({
4656
4892
  const errorId = `${fieldPrefix}-cell-error-${row.id}-${column.id}`;
4657
4893
  const cellDiff = rowDiff?.kind === "changed" ? diffCellByKey.get(key) : void 0;
4658
4894
  if (isEditing && editable) {
4659
- return /* @__PURE__ */ jsxs10("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4660
- /* @__PURE__ */ jsx12(
4895
+ return /* @__PURE__ */ jsxs11("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4896
+ /* @__PURE__ */ jsx13(
4661
4897
  CellEditor,
4662
4898
  {
4663
4899
  column,
@@ -4670,11 +4906,11 @@ function RecordGrid({
4670
4906
  onCancel: () => cancelEdit(row, column)
4671
4907
  }
4672
4908
  ),
4673
- cellError !== void 0 && /* @__PURE__ */ jsx12("p", { id: errorId, role: "alert", className: "mt-1 text-xs leading-snug text-destructive", children: cellError })
4909
+ cellError !== void 0 && /* @__PURE__ */ jsx13("p", { id: errorId, role: "alert", className: "mt-1 text-xs leading-snug text-destructive", children: cellError })
4674
4910
  ] }, column.id);
4675
4911
  }
4676
4912
  if (column.kind === "boolean" && editable) {
4677
- return /* @__PURE__ */ jsx12("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx12(
4913
+ return /* @__PURE__ */ jsx13("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx13(
4678
4914
  "input",
4679
4915
  {
4680
4916
  type: "checkbox",
@@ -4693,7 +4929,7 @@ function RecordGrid({
4693
4929
  ) }, column.id);
4694
4930
  }
4695
4931
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
4696
- return /* @__PURE__ */ jsx12(
4932
+ return /* @__PURE__ */ jsx13(
4697
4933
  "td",
4698
4934
  {
4699
4935
  role: "gridcell",
@@ -4711,20 +4947,20 @@ function RecordGrid({
4711
4947
  className: `px-3 py-2 outline-none focus:ring-2 focus:ring-inset focus:ring-primary/50 ${alignmentClass(
4712
4948
  column
4713
4949
  )} ${editable ? "cursor-text" : ""}`,
4714
- children: /* @__PURE__ */ jsxs10("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4715
- column.id === columns[0]?.id && removedRow && /* @__PURE__ */ jsx12("span", { className: "inline-flex shrink-0 rounded border border-destructive/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-destructive", children: "Remove" }),
4716
- cellDiff ? /* @__PURE__ */ jsxs10("span", { className: "inline-flex max-w-full flex-wrap items-baseline gap-x-1.5", children: [
4717
- /* @__PURE__ */ jsx12("span", { className: "tabular-nums text-destructive line-through decoration-destructive/60", children: formatRecordGridValue(column, cellDiff.before, locale) || "\u2014" }),
4718
- /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2192" }),
4719
- /* @__PURE__ */ jsx12("span", { className: "tabular-nums font-medium text-success", children: formatRecordGridValue(column, cellDiff.after, locale) || "\u2014" })
4720
- ] }) : /* @__PURE__ */ jsx12(
4950
+ children: /* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4951
+ column.id === columns[0]?.id && removedRow && /* @__PURE__ */ jsx13("span", { className: "inline-flex shrink-0 rounded border border-destructive/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-destructive", children: "Remove" }),
4952
+ cellDiff ? /* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full flex-wrap items-baseline gap-x-1.5", children: [
4953
+ /* @__PURE__ */ jsx13("span", { className: "tabular-nums text-destructive line-through decoration-destructive/60", children: formatRecordGridValue(column, cellDiff.before, locale) || "\u2014" }),
4954
+ /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2192" }),
4955
+ /* @__PURE__ */ jsx13("span", { className: "tabular-nums font-medium text-success", children: formatRecordGridValue(column, cellDiff.after, locale) || "\u2014" })
4956
+ ] }) : /* @__PURE__ */ jsx13(
4721
4957
  "span",
4722
4958
  {
4723
4959
  className: removedRow ? "truncate text-destructive line-through decoration-destructive/60" : display === "" ? "text-muted-foreground" : "truncate text-foreground",
4724
4960
  children: display === "" ? applicable ? "\u2014" : "n/a" : display
4725
4961
  }
4726
4962
  ),
4727
- source && /* @__PURE__ */ jsx12(
4963
+ source && /* @__PURE__ */ jsx13(
4728
4964
  SourceMarker,
4729
4965
  {
4730
4966
  panelId: `${fieldPrefix}-source-${row.id}-${column.id}`,
@@ -4740,7 +4976,7 @@ function RecordGrid({
4740
4976
  column.id
4741
4977
  );
4742
4978
  }),
4743
- showActionsColumn && /* @__PURE__ */ jsx12("td", { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx12(
4979
+ showActionsColumn && /* @__PURE__ */ jsx13("td", { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx13(
4744
4980
  ReviewActions,
4745
4981
  {
4746
4982
  rowId: row.id,
@@ -4749,8 +4985,8 @@ function RecordGrid({
4749
4985
  onAccept: onAcceptRow,
4750
4986
  onReject: onRejectRow
4751
4987
  }
4752
- ) : row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center gap-1.5", children: [
4753
- /* @__PURE__ */ jsx12(
4988
+ ) : row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
4989
+ /* @__PURE__ */ jsx13(
4754
4990
  "button",
4755
4991
  {
4756
4992
  type: "button",
@@ -4760,7 +4996,7 @@ function RecordGrid({
4760
4996
  children: "Delete"
4761
4997
  }
4762
4998
  ),
4763
- /* @__PURE__ */ jsx12(
4999
+ /* @__PURE__ */ jsx13(
4764
5000
  "button",
4765
5001
  {
4766
5002
  type: "button",
@@ -4770,14 +5006,14 @@ function RecordGrid({
4770
5006
  children: "Cancel"
4771
5007
  }
4772
5008
  )
4773
- ] }) : /* @__PURE__ */ jsx12(
5009
+ ] }) : /* @__PURE__ */ jsx13(
4774
5010
  "button",
4775
5011
  {
4776
5012
  type: "button",
4777
5013
  "aria-label": `Delete ${rowLabel}`,
4778
5014
  onClick: () => setConfirmDelete(row.id),
4779
5015
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
4780
- children: /* @__PURE__ */ jsxs10(
5016
+ children: /* @__PURE__ */ jsxs11(
4781
5017
  "svg",
4782
5018
  {
4783
5019
  viewBox: "0 0 24 24",
@@ -4789,8 +5025,8 @@ function RecordGrid({
4789
5025
  strokeLinejoin: "round",
4790
5026
  "aria-hidden": true,
4791
5027
  children: [
4792
- /* @__PURE__ */ jsx12("polyline", { points: "3 6 5 6 21 6" }),
4793
- /* @__PURE__ */ jsx12("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
5028
+ /* @__PURE__ */ jsx13("polyline", { points: "3 6 5 6 21 6" }),
5029
+ /* @__PURE__ */ jsx13("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
4794
5030
  ]
4795
5031
  }
4796
5032
  )
@@ -4799,12 +5035,12 @@ function RecordGrid({
4799
5035
  ]
4800
5036
  }
4801
5037
  ),
4802
- rowError !== void 0 && /* @__PURE__ */ jsx12("tr", { role: "row", className: "border-b border-border", children: /* @__PURE__ */ jsx12("td", { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx12("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
5038
+ rowError !== void 0 && /* @__PURE__ */ jsx13("tr", { role: "row", className: "border-b border-border", children: /* @__PURE__ */ jsx13("td", { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx13("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
4803
5039
  ] }, row.id);
4804
5040
  }),
4805
5041
  reviewing && addedRows.map((row) => {
4806
5042
  const rowLabel = recordGridRowLabel(columns, row);
4807
- return /* @__PURE__ */ jsxs10(
5043
+ return /* @__PURE__ */ jsxs11(
4808
5044
  "tr",
4809
5045
  {
4810
5046
  role: "row",
@@ -4815,9 +5051,9 @@ function RecordGrid({
4815
5051
  const applicable = isRecordGridCellApplicable(column, row.values);
4816
5052
  const value = row.values[column.id] ?? null;
4817
5053
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
4818
- return /* @__PURE__ */ jsx12("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs10("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4819
- columnIndex === 0 && /* @__PURE__ */ jsx12("span", { className: "inline-flex shrink-0 rounded border border-success/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-success", children: "New" }),
4820
- /* @__PURE__ */ jsx12(
5054
+ return /* @__PURE__ */ jsx13("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
5055
+ columnIndex === 0 && /* @__PURE__ */ jsx13("span", { className: "inline-flex shrink-0 rounded border border-success/60 px-1 py-px text-[11px] font-semibold uppercase tracking-[0.05em] text-success", children: "New" }),
5056
+ /* @__PURE__ */ jsx13(
4821
5057
  "span",
4822
5058
  {
4823
5059
  className: `tabular-nums ${display === "" ? "text-muted-foreground" : "truncate text-foreground"}`,
@@ -4826,7 +5062,7 @@ function RecordGrid({
4826
5062
  )
4827
5063
  ] }) }, column.id);
4828
5064
  }),
4829
- /* @__PURE__ */ jsx12("td", { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx12(
5065
+ /* @__PURE__ */ jsx13("td", { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx13(
4830
5066
  ReviewActions,
4831
5067
  {
4832
5068
  rowId: row.id,
@@ -4842,8 +5078,8 @@ function RecordGrid({
4842
5078
  );
4843
5079
  })
4844
5080
  ] }),
4845
- hasFooter && /* @__PURE__ */ jsx12("tfoot", { children: /* @__PURE__ */ jsxs10("tr", { role: "row", className: "border-t-2 border-border", children: [
4846
- columns.map((column) => /* @__PURE__ */ jsx12(
5081
+ hasFooter && /* @__PURE__ */ jsx13("tfoot", { children: /* @__PURE__ */ jsxs11("tr", { role: "row", className: "border-t-2 border-border", children: [
5082
+ columns.map((column) => /* @__PURE__ */ jsx13(
4847
5083
  "td",
4848
5084
  {
4849
5085
  role: "gridcell",
@@ -4852,19 +5088,19 @@ function RecordGrid({
4852
5088
  },
4853
5089
  column.id
4854
5090
  )),
4855
- showActionsColumn && /* @__PURE__ */ jsx12("td", { role: "gridcell" })
5091
+ showActionsColumn && /* @__PURE__ */ jsx13("td", { role: "gridcell" })
4856
5092
  ] }) })
4857
5093
  ]
4858
5094
  }
4859
5095
  ) }),
4860
- onCreate && !reviewing && (addForm ?? /* @__PURE__ */ jsxs10(
5096
+ onCreate && !reviewing && (addForm ?? /* @__PURE__ */ jsxs11(
4861
5097
  "button",
4862
5098
  {
4863
5099
  type: "button",
4864
5100
  onClick: openAdd,
4865
5101
  className: "inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-sm font-medium text-foreground transition hover:bg-accent",
4866
5102
  children: [
4867
- /* @__PURE__ */ jsxs10(
5103
+ /* @__PURE__ */ jsxs11(
4868
5104
  "svg",
4869
5105
  {
4870
5106
  viewBox: "0 0 24 24",
@@ -4876,8 +5112,8 @@ function RecordGrid({
4876
5112
  strokeLinejoin: "round",
4877
5113
  "aria-hidden": true,
4878
5114
  children: [
4879
- /* @__PURE__ */ jsx12("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
4880
- /* @__PURE__ */ jsx12("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
5115
+ /* @__PURE__ */ jsx13("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
5116
+ /* @__PURE__ */ jsx13("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
4881
5117
  ]
4882
5118
  }
4883
5119
  ),
@@ -4889,8 +5125,8 @@ function RecordGrid({
4889
5125
  }
4890
5126
  function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
4891
5127
  const noun = kind === "changed" ? `proposed change to ${rowLabel}` : kind === "added" ? `new row ${rowLabel}` : `removal of ${rowLabel}`;
4892
- return /* @__PURE__ */ jsxs10("span", { className: "inline-flex items-center gap-1.5", children: [
4893
- onReject && /* @__PURE__ */ jsx12(
5128
+ return /* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
5129
+ onReject && /* @__PURE__ */ jsx13(
4894
5130
  "button",
4895
5131
  {
4896
5132
  type: "button",
@@ -4900,7 +5136,7 @@ function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
4900
5136
  children: "Reject"
4901
5137
  }
4902
5138
  ),
4903
- onAccept && /* @__PURE__ */ jsx12(
5139
+ onAccept && /* @__PURE__ */ jsx13(
4904
5140
  "button",
4905
5141
  {
4906
5142
  type: "button",
@@ -4921,7 +5157,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
4921
5157
  className: INPUT_CLASS
4922
5158
  };
4923
5159
  if (column.kind === "select") {
4924
- return /* @__PURE__ */ jsxs10(
5160
+ return /* @__PURE__ */ jsxs11(
4925
5161
  "select",
4926
5162
  {
4927
5163
  ...shared,
@@ -4938,8 +5174,8 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
4938
5174
  },
4939
5175
  onBlur: () => onCommit(text),
4940
5176
  children: [
4941
- /* @__PURE__ */ jsx12("option", { value: "", children: "\u2014" }),
4942
- column.options.map((option) => /* @__PURE__ */ jsx12("option", { value: option.value, children: option.label }, option.value))
5177
+ /* @__PURE__ */ jsx13("option", { value: "", children: "\u2014" }),
5178
+ column.options.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
4943
5179
  ]
4944
5180
  }
4945
5181
  );
@@ -4957,7 +5193,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
4957
5193
  }
4958
5194
  };
4959
5195
  if (column.kind === "text" && column.multiline === true) {
4960
- return /* @__PURE__ */ jsx12(
5196
+ return /* @__PURE__ */ jsx13(
4961
5197
  "textarea",
4962
5198
  {
4963
5199
  ...shared,
@@ -4969,7 +5205,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
4969
5205
  }
4970
5206
  );
4971
5207
  }
4972
- return /* @__PURE__ */ jsx12(
5208
+ return /* @__PURE__ */ jsx13(
4973
5209
  "input",
4974
5210
  {
4975
5211
  ...shared,
@@ -4991,8 +5227,8 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
4991
5227
  [onToggle]
4992
5228
  );
4993
5229
  const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
4994
- return /* @__PURE__ */ jsxs10("span", { ref: containerRef, className: "relative inline-flex", children: [
4995
- /* @__PURE__ */ jsx12(
5230
+ return /* @__PURE__ */ jsxs11("span", { ref: containerRef, className: "relative inline-flex", children: [
5231
+ /* @__PURE__ */ jsx13(
4996
5232
  "button",
4997
5233
  {
4998
5234
  type: "button",
@@ -5005,7 +5241,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5005
5241
  onToggle();
5006
5242
  },
5007
5243
  className: `inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${BASIS_TONES2[basis]}`,
5008
- children: /* @__PURE__ */ jsx12(
5244
+ children: /* @__PURE__ */ jsx13(
5009
5245
  "svg",
5010
5246
  {
5011
5247
  viewBox: "0 0 24 24",
@@ -5015,12 +5251,12 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5015
5251
  strokeWidth: "2.5",
5016
5252
  strokeLinecap: "round",
5017
5253
  "aria-hidden": true,
5018
- children: /* @__PURE__ */ jsx12("path", { d: "M9 8h6M9 12h6M9 16h3" })
5254
+ children: /* @__PURE__ */ jsx13("path", { d: "M9 8h6M9 12h6M9 16h3" })
5019
5255
  }
5020
5256
  )
5021
5257
  }
5022
5258
  ),
5023
- /* @__PURE__ */ jsxs10(
5259
+ /* @__PURE__ */ jsxs11(
5024
5260
  PopoverSurface,
5025
5261
  {
5026
5262
  open,
@@ -5030,17 +5266,17 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5030
5266
  panelRef,
5031
5267
  className: `w-64 rounded-lg border border-card-edge bg-popover p-3 text-left ${OVERLAY_SHADOW}`,
5032
5268
  children: [
5033
- source.quote && /* @__PURE__ */ jsxs10("span", { className: "block border-l-2 border-primary/50 pl-2 text-xs italic leading-snug text-foreground", children: [
5269
+ source.quote && /* @__PURE__ */ jsxs11("span", { className: "block border-l-2 border-primary/50 pl-2 text-xs italic leading-snug text-foreground", children: [
5034
5270
  "\u201C",
5035
5271
  source.quote,
5036
5272
  "\u201D"
5037
5273
  ] }),
5038
- /* @__PURE__ */ jsxs10("span", { className: "mt-2 block text-xs text-muted-foreground", children: [
5274
+ /* @__PURE__ */ jsxs11("span", { className: "mt-2 block text-xs text-muted-foreground", children: [
5039
5275
  source.label ?? "Source",
5040
5276
  source.locator ? ` \xB7 ${source.locator}` : "",
5041
5277
  ` \xB7 ${BASIS_TITLES[basis]}`
5042
5278
  ] }),
5043
- source.href && /* @__PURE__ */ jsx12(
5279
+ source.href && /* @__PURE__ */ jsx13(
5044
5280
  "a",
5045
5281
  {
5046
5282
  href: source.href,
@@ -5069,7 +5305,7 @@ function AddRecordForm({
5069
5305
  onCancel
5070
5306
  }) {
5071
5307
  const groups = useMemo5(() => groupColumns(columns), [columns]);
5072
- return /* @__PURE__ */ jsxs10(
5308
+ return /* @__PURE__ */ jsxs11(
5073
5309
  "form",
5074
5310
  {
5075
5311
  noValidate: true,
@@ -5080,31 +5316,31 @@ function AddRecordForm({
5080
5316
  },
5081
5317
  className: "space-y-4 rounded-xl border border-card-edge bg-card p-4",
5082
5318
  children: [
5083
- /* @__PURE__ */ jsx12("h3", { className: "text-sm font-semibold text-foreground", children: label }),
5084
- formError !== null && /* @__PURE__ */ jsx12("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
5319
+ /* @__PURE__ */ jsx13("h3", { className: "text-sm font-semibold text-foreground", children: label }),
5320
+ formError !== null && /* @__PURE__ */ jsx13("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
5085
5321
  groups.map((group) => {
5086
5322
  const fields = group.columns.filter((column) => isRecordGridCellApplicable(column, draft));
5087
5323
  if (fields.length === 0) return null;
5088
- return /* @__PURE__ */ jsxs10(
5324
+ return /* @__PURE__ */ jsxs11(
5089
5325
  "fieldset",
5090
5326
  {
5091
5327
  className: group.label === null ? "min-w-0" : "min-w-0 rounded-lg border border-card-edge p-3",
5092
5328
  children: [
5093
- group.label !== null && /* @__PURE__ */ jsx12("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
5094
- /* @__PURE__ */ jsx12("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
5329
+ group.label !== null && /* @__PURE__ */ jsx13("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
5330
+ /* @__PURE__ */ jsx13("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
5095
5331
  const fieldId = `${fieldPrefix}-${column.id}`;
5096
5332
  const errorId = `${fieldId}-error`;
5097
5333
  const message = errors[column.id];
5098
- return /* @__PURE__ */ jsxs10(
5334
+ return /* @__PURE__ */ jsxs11(
5099
5335
  "div",
5100
5336
  {
5101
5337
  className: column.kind === "text" && column.multiline === true ? "sm:col-span-2" : "",
5102
5338
  children: [
5103
- /* @__PURE__ */ jsxs10("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
5339
+ /* @__PURE__ */ jsxs11("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
5104
5340
  column.header,
5105
- column.required === true && /* @__PURE__ */ jsx12("span", { className: "ml-0.5 text-destructive", children: "*" })
5341
+ column.required === true && /* @__PURE__ */ jsx13("span", { className: "ml-0.5 text-destructive", children: "*" })
5106
5342
  ] }),
5107
- /* @__PURE__ */ jsx12(
5343
+ /* @__PURE__ */ jsx13(
5108
5344
  DraftField,
5109
5345
  {
5110
5346
  column,
@@ -5115,8 +5351,8 @@ function AddRecordForm({
5115
5351
  onValue: (next) => setDraft({ ...draft, [column.id]: next })
5116
5352
  }
5117
5353
  ),
5118
- column.hint && /* @__PURE__ */ jsx12("p", { className: "mt-1 text-xs text-muted-foreground", children: column.hint }),
5119
- message !== void 0 && /* @__PURE__ */ jsx12("p", { id: errorId, role: "alert", className: "mt-1 text-xs text-destructive", children: message })
5354
+ column.hint && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-muted-foreground", children: column.hint }),
5355
+ message !== void 0 && /* @__PURE__ */ jsx13("p", { id: errorId, role: "alert", className: "mt-1 text-xs text-destructive", children: message })
5120
5356
  ]
5121
5357
  },
5122
5358
  column.id
@@ -5127,8 +5363,8 @@ function AddRecordForm({
5127
5363
  group.label ?? "_"
5128
5364
  );
5129
5365
  }),
5130
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
5131
- /* @__PURE__ */ jsx12(
5366
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
5367
+ /* @__PURE__ */ jsx13(
5132
5368
  "button",
5133
5369
  {
5134
5370
  type: "submit",
@@ -5137,7 +5373,7 @@ function AddRecordForm({
5137
5373
  children: busy ? "Saving\u2026" : "Save"
5138
5374
  }
5139
5375
  ),
5140
- /* @__PURE__ */ jsx12(
5376
+ /* @__PURE__ */ jsx13(
5141
5377
  "button",
5142
5378
  {
5143
5379
  type: "button",
@@ -5158,7 +5394,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5158
5394
  "aria-describedby": describedBy
5159
5395
  };
5160
5396
  if (column.kind === "boolean") {
5161
- return /* @__PURE__ */ jsx12(
5397
+ return /* @__PURE__ */ jsx13(
5162
5398
  "input",
5163
5399
  {
5164
5400
  ...shared,
@@ -5170,7 +5406,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5170
5406
  );
5171
5407
  }
5172
5408
  if (column.kind === "select") {
5173
- return /* @__PURE__ */ jsxs10(
5409
+ return /* @__PURE__ */ jsxs11(
5174
5410
  "select",
5175
5411
  {
5176
5412
  ...shared,
@@ -5178,14 +5414,14 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5178
5414
  value: typeof value === "string" ? value : "",
5179
5415
  onChange: (event) => onValue(event.target.value === "" ? null : event.target.value),
5180
5416
  children: [
5181
- /* @__PURE__ */ jsx12("option", { value: "", children: "\u2014" }),
5182
- column.options.map((option) => /* @__PURE__ */ jsx12("option", { value: option.value, children: option.label }, option.value))
5417
+ /* @__PURE__ */ jsx13("option", { value: "", children: "\u2014" }),
5418
+ column.options.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
5183
5419
  ]
5184
5420
  }
5185
5421
  );
5186
5422
  }
5187
5423
  if (column.kind === "text" && column.multiline === true) {
5188
- return /* @__PURE__ */ jsx12(
5424
+ return /* @__PURE__ */ jsx13(
5189
5425
  "textarea",
5190
5426
  {
5191
5427
  ...shared,
@@ -5197,7 +5433,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5197
5433
  );
5198
5434
  }
5199
5435
  if (column.kind === "number" || column.kind === "currency") {
5200
- return /* @__PURE__ */ jsx12(
5436
+ return /* @__PURE__ */ jsx13(
5201
5437
  "input",
5202
5438
  {
5203
5439
  ...shared,
@@ -5217,7 +5453,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5217
5453
  }
5218
5454
  );
5219
5455
  }
5220
- return /* @__PURE__ */ jsx12(
5456
+ return /* @__PURE__ */ jsx13(
5221
5457
  "input",
5222
5458
  {
5223
5459
  ...shared,
@@ -5235,15 +5471,15 @@ import {
5235
5471
  useEffect as useEffect10,
5236
5472
  useId as useId4,
5237
5473
  useMemo as useMemo6,
5238
- useRef as useRef9,
5239
- useState as useState14
5474
+ useRef as useRef10,
5475
+ useState as useState15
5240
5476
  } from "react";
5241
5477
  import { createPortal } from "react-dom";
5242
- import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
5478
+ import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
5243
5479
  function SearchGlyph({ className }) {
5244
- return /* @__PURE__ */ jsxs11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
5245
- /* @__PURE__ */ jsx13("circle", { cx: "11", cy: "11", r: "8" }),
5246
- /* @__PURE__ */ jsx13("path", { d: "m21 21-4.3-4.3" })
5480
+ return /* @__PURE__ */ jsxs12("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
5481
+ /* @__PURE__ */ jsx14("circle", { cx: "11", cy: "11", r: "8" }),
5482
+ /* @__PURE__ */ jsx14("path", { d: "m21 21-4.3-4.3" })
5247
5483
  ] });
5248
5484
  }
5249
5485
  function CommandPalette({
@@ -5258,7 +5494,7 @@ function CommandPalette({
5258
5494
  emptyMessage,
5259
5495
  label = "Command palette"
5260
5496
  }) {
5261
- const [internalOpen, setInternalOpen] = useState14(false);
5497
+ const [internalOpen, setInternalOpen] = useState15(false);
5262
5498
  const open = controlledOpen ?? internalOpen;
5263
5499
  const setOpen = useCallback8(
5264
5500
  (next) => {
@@ -5267,9 +5503,9 @@ function CommandPalette({
5267
5503
  },
5268
5504
  [controlledOpen, onOpenChange]
5269
5505
  );
5270
- const [query, setQuery] = useState14(initialQuery ?? "");
5271
- const [active, setActive] = useState14(0);
5272
- const inputRef = useRef9(null);
5506
+ const [query, setQuery] = useState15(initialQuery ?? "");
5507
+ const [active, setActive] = useState15(0);
5508
+ const inputRef = useRef10(null);
5273
5509
  const surfaceId = useId4();
5274
5510
  const listId = `${surfaceId}-list`;
5275
5511
  const flat = useMemo6(() => filterCommandPaletteItems(items, query), [items, query]);
@@ -5287,7 +5523,7 @@ function CommandPalette({
5287
5523
  document.addEventListener("keydown", onKeyDown);
5288
5524
  return () => document.removeEventListener("keydown", onKeyDown);
5289
5525
  }, [hotkey, open, setOpen]);
5290
- const restoreFocusRef = useRef9(null);
5526
+ const restoreFocusRef = useRef10(null);
5291
5527
  useEffect10(() => {
5292
5528
  if (open) {
5293
5529
  restoreFocusRef.current = document.activeElement;
@@ -5330,8 +5566,8 @@ function CommandPalette({
5330
5566
  if (!open || typeof document === "undefined") return null;
5331
5567
  let rowIndex = -1;
5332
5568
  return createPortal(
5333
- /* @__PURE__ */ jsxs11(Fragment6, { children: [
5334
- /* @__PURE__ */ jsx13(
5569
+ /* @__PURE__ */ jsxs12(Fragment7, { children: [
5570
+ /* @__PURE__ */ jsx14(
5335
5571
  "div",
5336
5572
  {
5337
5573
  "aria-hidden": true,
@@ -5340,7 +5576,7 @@ function CommandPalette({
5340
5576
  className: "fixed inset-0 z-[999] bg-background/80"
5341
5577
  }
5342
5578
  ),
5343
- /* @__PURE__ */ jsx13("div", { className: "pointer-events-none fixed inset-x-0 top-[15%] z-[1000] flex justify-center px-4", children: /* @__PURE__ */ jsxs11(
5579
+ /* @__PURE__ */ jsx14("div", { className: "pointer-events-none fixed inset-x-0 top-[15%] z-[1000] flex justify-center px-4", children: /* @__PURE__ */ jsxs12(
5344
5580
  "div",
5345
5581
  {
5346
5582
  role: "dialog",
@@ -5349,9 +5585,9 @@ function CommandPalette({
5349
5585
  ...{ [POPOVER_SURFACE_ATTR]: surfaceId },
5350
5586
  className: `agent-pop-in pointer-events-auto flex max-h-[70vh] w-[560px] max-w-full flex-col overflow-hidden rounded-xl border border-card-edge bg-popover ${OVERLAY_SHADOW}`,
5351
5587
  children: [
5352
- /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
5353
- /* @__PURE__ */ jsx13(SearchGlyph, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5354
- /* @__PURE__ */ jsx13(
5588
+ /* @__PURE__ */ jsxs12("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
5589
+ /* @__PURE__ */ jsx14(SearchGlyph, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5590
+ /* @__PURE__ */ jsx14(
5355
5591
  "input",
5356
5592
  {
5357
5593
  ref: inputRef,
@@ -5372,15 +5608,15 @@ function CommandPalette({
5372
5608
  }
5373
5609
  )
5374
5610
  ] }),
5375
- /* @__PURE__ */ jsxs11("div", { role: "listbox", id: listId, className: "min-h-0 flex-1 overflow-y-auto p-1 pb-2", children: [
5376
- loading && /* @__PURE__ */ jsx13("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading\u2026" }),
5377
- !loading && flat.length === 0 && /* @__PURE__ */ jsx13("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: emptyMessage ?? (query.trim() ? `No results for \u201C${query.trim()}\u201D` : "Nothing here yet") }),
5378
- !loading && sections.map((section) => /* @__PURE__ */ jsxs11("div", { children: [
5379
- /* @__PURE__ */ jsx13("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.group }),
5611
+ /* @__PURE__ */ jsxs12("div", { role: "listbox", id: listId, className: "min-h-0 flex-1 overflow-y-auto p-1 pb-2", children: [
5612
+ loading && /* @__PURE__ */ jsx14("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading\u2026" }),
5613
+ !loading && flat.length === 0 && /* @__PURE__ */ jsx14("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: emptyMessage ?? (query.trim() ? `No results for \u201C${query.trim()}\u201D` : "Nothing here yet") }),
5614
+ !loading && sections.map((section) => /* @__PURE__ */ jsxs12("div", { children: [
5615
+ /* @__PURE__ */ jsx14("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.group }),
5380
5616
  section.items.map((item) => {
5381
5617
  rowIndex += 1;
5382
5618
  const index = rowIndex;
5383
- return /* @__PURE__ */ jsxs11(
5619
+ return /* @__PURE__ */ jsxs12(
5384
5620
  "div",
5385
5621
  {
5386
5622
  id: `${listId}-${index}`,
@@ -5390,9 +5626,9 @@ function CommandPalette({
5390
5626
  onClick: () => choose(item),
5391
5627
  className: `flex w-full cursor-pointer items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-sm ${index === activeIndex ? "bg-accent" : ""}`,
5392
5628
  children: [
5393
- /* @__PURE__ */ jsx13("span", { className: "truncate text-foreground", children: item.label }),
5394
- item.description && /* @__PURE__ */ jsx13("span", { className: "truncate text-xs text-muted-foreground", children: item.description }),
5395
- item.hint && /* @__PURE__ */ jsx13("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-muted-foreground", children: item.hint })
5629
+ /* @__PURE__ */ jsx14("span", { className: "truncate text-foreground", children: item.label }),
5630
+ item.description && /* @__PURE__ */ jsx14("span", { className: "truncate text-xs text-muted-foreground", children: item.description }),
5631
+ item.hint && /* @__PURE__ */ jsx14("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-muted-foreground", children: item.hint })
5396
5632
  ]
5397
5633
  },
5398
5634
  item.id
@@ -5400,15 +5636,15 @@ function CommandPalette({
5400
5636
  })
5401
5637
  ] }, section.group))
5402
5638
  ] }),
5403
- /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center justify-between border-t border-border px-3 py-2 text-xs text-muted-foreground", children: [
5404
- /* @__PURE__ */ jsx13("span", { className: "tabular-nums", children: query.trim() ? `${flat.length} of ${items.length}` : `${items.length} items` }),
5405
- /* @__PURE__ */ jsxs11("span", { className: "flex items-center gap-1.5", children: [
5406
- /* @__PURE__ */ jsx13("kbd", { className: "rounded border border-border bg-background px-1 py-0.5", children: "\u2191\u2193" }),
5407
- /* @__PURE__ */ jsx13("span", { children: "navigate" }),
5408
- /* @__PURE__ */ jsx13("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "\u21B5" }),
5409
- /* @__PURE__ */ jsx13("span", { children: "select" }),
5410
- /* @__PURE__ */ jsx13("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "esc" }),
5411
- /* @__PURE__ */ jsx13("span", { children: "close" })
5639
+ /* @__PURE__ */ jsxs12("div", { className: "flex shrink-0 items-center justify-between border-t border-border px-3 py-2 text-xs text-muted-foreground", children: [
5640
+ /* @__PURE__ */ jsx14("span", { className: "tabular-nums", children: query.trim() ? `${flat.length} of ${items.length}` : `${items.length} items` }),
5641
+ /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-1.5", children: [
5642
+ /* @__PURE__ */ jsx14("kbd", { className: "rounded border border-border bg-background px-1 py-0.5", children: "\u2191\u2193" }),
5643
+ /* @__PURE__ */ jsx14("span", { children: "navigate" }),
5644
+ /* @__PURE__ */ jsx14("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "\u21B5" }),
5645
+ /* @__PURE__ */ jsx14("span", { children: "select" }),
5646
+ /* @__PURE__ */ jsx14("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "esc" }),
5647
+ /* @__PURE__ */ jsx14("span", { children: "close" })
5412
5648
  ] })
5413
5649
  ] })
5414
5650
  ]
@@ -5420,7 +5656,7 @@ function CommandPalette({
5420
5656
  }
5421
5657
 
5422
5658
  // src/web-react/sparkline.tsx
5423
- import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
5659
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
5424
5660
  var DEFAULT_SPARKLINE_WIDTH = 96;
5425
5661
  var DEFAULT_SPARKLINE_HEIGHT = 24;
5426
5662
  var DEFAULT_INSET = 2.5;
@@ -5526,21 +5762,21 @@ function Sparkline({
5526
5762
  const geometry = sparklineGeometry(values, { width, height });
5527
5763
  const accessibleName = sparklineLabel(values, { label, format });
5528
5764
  if (geometry.points.length === 0) {
5529
- return /* @__PURE__ */ jsxs12(
5765
+ return /* @__PURE__ */ jsxs13(
5530
5766
  "span",
5531
5767
  {
5532
5768
  "data-sparkline": geometry.gaps > 0 ? "unavailable" : "empty",
5533
5769
  className: joinClasses("text-[11px] text-muted-foreground", className),
5534
5770
  children: [
5535
- /* @__PURE__ */ jsx14("span", { className: "sr-only", children: accessibleName }),
5536
- /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", children: geometry.gaps > 0 ? unavailableLabel : emptyLabel })
5771
+ /* @__PURE__ */ jsx15("span", { className: "sr-only", children: accessibleName }),
5772
+ /* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: geometry.gaps > 0 ? unavailableLabel : emptyLabel })
5537
5773
  ]
5538
5774
  }
5539
5775
  );
5540
5776
  }
5541
5777
  const drawsLine = geometry.segments.some((segment) => segment.length > 1);
5542
5778
  const end = geometry.points[geometry.points.length - 1];
5543
- return /* @__PURE__ */ jsxs12(
5779
+ return /* @__PURE__ */ jsxs13(
5544
5780
  "svg",
5545
5781
  {
5546
5782
  role: "img",
@@ -5557,7 +5793,7 @@ function Sparkline({
5557
5793
  geometry.segments.map((segment, index) => {
5558
5794
  const key = `segment-${index}`;
5559
5795
  if (segment.length > 1) {
5560
- return /* @__PURE__ */ jsx14(
5796
+ return /* @__PURE__ */ jsx15(
5561
5797
  "polyline",
5562
5798
  {
5563
5799
  points: sparklinePointsAttribute(segment),
@@ -5573,9 +5809,9 @@ function Sparkline({
5573
5809
  }
5574
5810
  const only = segment[0];
5575
5811
  if (only.x === end.x && only.y === end.y) return null;
5576
- return /* @__PURE__ */ jsx14("circle", { cx: only.x, cy: only.y, r: DOT_RADIUS, fill: "currentColor" }, key);
5812
+ return /* @__PURE__ */ jsx15("circle", { cx: only.x, cy: only.y, r: DOT_RADIUS, fill: "currentColor" }, key);
5577
5813
  }),
5578
- /* @__PURE__ */ jsx14("circle", { cx: end.x, cy: end.y, r: DOT_RADIUS, fill: "currentColor" })
5814
+ /* @__PURE__ */ jsx15("circle", { cx: end.x, cy: end.y, r: DOT_RADIUS, fill: "currentColor" })
5579
5815
  ]
5580
5816
  }
5581
5817
  );
@@ -5586,10 +5822,10 @@ import {
5586
5822
  isValidElement as isValidElement2,
5587
5823
  useCallback as useCallback9,
5588
5824
  useEffect as useEffect11,
5589
- useRef as useRef10,
5590
- useState as useState15
5825
+ useRef as useRef11,
5826
+ useState as useState16
5591
5827
  } from "react";
5592
- import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
5828
+ import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
5593
5829
  function insightDelta(value, previous) {
5594
5830
  if (typeof value !== "number" || !Number.isFinite(value)) return null;
5595
5831
  if (typeof previous !== "number" || !Number.isFinite(previous)) return null;
@@ -5642,7 +5878,7 @@ function InsightCard({
5642
5878
  const tone = delta ? insightDeltaTone(delta.direction, polarity) : "neutral";
5643
5879
  const unavailable = typeof value === "number" && !Number.isFinite(value);
5644
5880
  const shown = typeof value === "number" ? format(value) : value;
5645
- return /* @__PURE__ */ jsxs13(
5881
+ return /* @__PURE__ */ jsxs14(
5646
5882
  "article",
5647
5883
  {
5648
5884
  "data-insight-card": "",
@@ -5650,40 +5886,40 @@ function InsightCard({
5650
5886
  className: joinClasses("agent-arrive flex h-full flex-col rounded-xl border border-card-edge bg-card p-4", className),
5651
5887
  style,
5652
5888
  children: [
5653
- eyebrow ? /* @__PURE__ */ jsx15("p", { "data-insight-eyebrow": "", className: "mb-0.5 text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: eyebrow }) : null,
5654
- /* @__PURE__ */ jsxs13("div", { className: "flex items-baseline justify-between gap-2", children: [
5655
- /* @__PURE__ */ jsx15("h3", { className: "text-[13px] font-medium text-muted-foreground", children: title }),
5889
+ eyebrow ? /* @__PURE__ */ jsx16("p", { "data-insight-eyebrow": "", className: "mb-0.5 text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: eyebrow }) : null,
5890
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-baseline justify-between gap-2", children: [
5891
+ /* @__PURE__ */ jsx16("h3", { className: "text-[13px] font-medium text-muted-foreground", children: title }),
5656
5892
  live ? (
5657
5893
  // No `data-motion` opt-out: the word is the signal and the sweep is
5658
5894
  // emphasis, so the reduced-motion floor reaches this like everything
5659
5895
  // else and leaves a static, legible label.
5660
- /* @__PURE__ */ jsx15("span", { className: "agent-shimmer shrink-0 text-[11px] font-medium", "data-insight-live": "", children: liveLabel })
5896
+ /* @__PURE__ */ jsx16("span", { className: "agent-shimmer shrink-0 text-[11px] font-medium", "data-insight-live": "", children: liveLabel })
5661
5897
  ) : null
5662
5898
  ] }),
5663
- /* @__PURE__ */ jsx15("p", { className: "mt-1 flex items-baseline gap-1", children: unavailable ? /* @__PURE__ */ jsxs13("span", { "data-insight-value": "unavailable", className: "text-xl font-semibold text-muted-foreground", children: [
5664
- /* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: INSIGHT_UNAVAILABLE_GLYPH }),
5665
- /* @__PURE__ */ jsx15("span", { className: "sr-only", children: INSIGHT_UNAVAILABLE_LABEL })
5666
- ] }) : /* @__PURE__ */ jsxs13(Fragment7, { children: [
5667
- /* @__PURE__ */ jsx15("span", { className: "text-xl font-semibold tabular-nums text-foreground", children: shown }),
5668
- unit ? /* @__PURE__ */ jsx15("span", { className: "text-[11px] text-muted-foreground", children: unit }) : null
5899
+ /* @__PURE__ */ jsx16("p", { className: "mt-1 flex items-baseline gap-1", children: unavailable ? /* @__PURE__ */ jsxs14("span", { "data-insight-value": "unavailable", className: "text-xl font-semibold text-muted-foreground", children: [
5900
+ /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: INSIGHT_UNAVAILABLE_GLYPH }),
5901
+ /* @__PURE__ */ jsx16("span", { className: "sr-only", children: INSIGHT_UNAVAILABLE_LABEL })
5902
+ ] }) : /* @__PURE__ */ jsxs14(Fragment8, { children: [
5903
+ /* @__PURE__ */ jsx16("span", { className: "text-xl font-semibold tabular-nums text-foreground", children: shown }),
5904
+ unit ? /* @__PURE__ */ jsx16("span", { className: "text-[11px] text-muted-foreground", children: unit }) : null
5669
5905
  ] }) }),
5670
- delta ? /* @__PURE__ */ jsxs13("p", { "data-insight-delta": delta.direction, className: `mt-0.5 text-[11px] font-medium ${TONE_CLASS[tone]}`, children: [
5671
- /* @__PURE__ */ jsxs13("span", { "aria-hidden": "true", children: [
5906
+ delta ? /* @__PURE__ */ jsxs14("p", { "data-insight-delta": delta.direction, className: `mt-0.5 text-[11px] font-medium ${TONE_CLASS[tone]}`, children: [
5907
+ /* @__PURE__ */ jsxs14("span", { "aria-hidden": "true", children: [
5672
5908
  DIRECTION_GLYPH[delta.direction],
5673
5909
  " "
5674
5910
  ] }),
5675
5911
  formatInsightDelta(delta, format)
5676
5912
  ] }) : null,
5677
- description ? /* @__PURE__ */ jsx15("p", { className: "mt-1 text-[11px] text-muted-foreground", children: description }) : null,
5678
- series ? /* @__PURE__ */ jsx15("div", { className: "mt-2 text-muted-foreground", children: /* @__PURE__ */ jsx15(Sparkline, { values: series, label: seriesLabel ?? title, format }) }) : null,
5679
- action ? /* @__PURE__ */ jsx15("div", { className: "mt-3", children: renderInsightAction(action) }) : null
5913
+ description ? /* @__PURE__ */ jsx16("p", { className: "mt-1 text-[11px] text-muted-foreground", children: description }) : null,
5914
+ series ? /* @__PURE__ */ jsx16("div", { className: "mt-2 text-muted-foreground", children: /* @__PURE__ */ jsx16(Sparkline, { values: series, label: seriesLabel ?? title, format }) }) : null,
5915
+ action ? /* @__PURE__ */ jsx16("div", { className: "mt-3", children: renderInsightAction(action) }) : null
5680
5916
  ]
5681
5917
  }
5682
5918
  );
5683
5919
  }
5684
5920
  function renderInsightAction(action) {
5685
5921
  if (isValidElement2(action)) return action;
5686
- return /* @__PURE__ */ jsx15(
5922
+ return /* @__PURE__ */ jsx16(
5687
5923
  "button",
5688
5924
  {
5689
5925
  type: "button",
@@ -5752,14 +5988,14 @@ function InsightDeck({
5752
5988
  className,
5753
5989
  onPageChange
5754
5990
  }) {
5755
- const [page, setPage] = useState15(0);
5756
- const [held, setHeld] = useState15(null);
5991
+ const [page, setPage] = useState16(0);
5992
+ const [held, setHeld] = useState16(null);
5757
5993
  const answered = state.status === "error" || state.status === "empty";
5758
5994
  const carried = state.status === "ready" ? state.value : answered ? null : held;
5759
5995
  if (carried !== held) setHeld(carried);
5760
5996
  const shown = carried !== null && state.status !== "ready" ? { status: "ready", value: carried, retry: state.retry } : state;
5761
5997
  const refreshing = shown !== state;
5762
- const reported = useRef10(0);
5998
+ const reported = useRef11(0);
5763
5999
  const settlePage = useCallback9(
5764
6000
  (next) => {
5765
6001
  if (reported.current === next) return;
@@ -5768,7 +6004,7 @@ function InsightDeck({
5768
6004
  },
5769
6005
  [onPageChange]
5770
6006
  );
5771
- return /* @__PURE__ */ jsx15(
6007
+ return /* @__PURE__ */ jsx16(
5772
6008
  AsyncView,
5773
6009
  {
5774
6010
  state: shown,
@@ -5776,7 +6012,7 @@ function InsightDeck({
5776
6012
  loadingLabel,
5777
6013
  retryLabel,
5778
6014
  className,
5779
- children: (insights) => /* @__PURE__ */ jsx15(
6015
+ children: (insights) => /* @__PURE__ */ jsx16(
5780
6016
  InsightPages,
5781
6017
  {
5782
6018
  insights,
@@ -5843,9 +6079,9 @@ function InsightPages({
5843
6079
  const pageCount = insightPageCount(insights.length, size);
5844
6080
  const current = Math.min(Math.max(page, 0), pageCount - 1);
5845
6081
  const visible = insightPageSlice(insights, current, size);
5846
- const sectionRef = useRef10(null);
5847
- const listRef = useRef10(null);
5848
- const recoverFocus = useRef10(false);
6082
+ const sectionRef = useRef11(null);
6083
+ const listRef = useRef11(null);
6084
+ const recoverFocus = useRef11(false);
5849
6085
  useEffect11(() => {
5850
6086
  onPageSettled(current);
5851
6087
  }, [current, onPageSettled]);
@@ -5889,7 +6125,7 @@ function InsightPages({
5889
6125
  }
5890
6126
  if (moved) event.preventDefault();
5891
6127
  };
5892
- return /* @__PURE__ */ jsxs13(
6128
+ return /* @__PURE__ */ jsxs14(
5893
6129
  "section",
5894
6130
  {
5895
6131
  ref: sectionRef,
@@ -5901,7 +6137,7 @@ function InsightPages({
5901
6137
  tabIndex: pageCount > 1 ? 0 : void 0,
5902
6138
  "aria-keyshortcuts": pageCount > 1 ? "ArrowLeft ArrowRight PageUp PageDown Home End" : void 0,
5903
6139
  children: [
5904
- /* @__PURE__ */ jsx15("ul", { ref: listRef, className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ id, style, ...card }, index) => (
6140
+ /* @__PURE__ */ jsx16("ul", { ref: listRef, className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ id, style, ...card }, index) => (
5905
6141
  // The page index is in the key on purpose: a page turn is an arrival,
5906
6142
  // and reusing the node would swap the text under a card that never
5907
6143
  // moved. Remounting replays `.agent-arrive` with the new stagger.
@@ -5912,10 +6148,10 @@ function InsightPages({
5912
6148
  // does not arrive a second time. The key does BOTH jobs — but only
5913
6149
  // because the deck now keeps this subtree mounted across a reload
5914
6150
  // (see `InsightDeck`); a key is never compared across a teardown.
5915
- /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(InsightCard, { ...card, style: staggerStyle(index, style) }) }, `${current}:${id}`)
6151
+ /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(InsightCard, { ...card, style: staggerStyle(index, style) }) }, `${current}:${id}`)
5916
6152
  )) }),
5917
- /* @__PURE__ */ jsxs13("div", { className: pageCount > 1 ? "flex items-center justify-between gap-2" : void 0, children: [
5918
- /* @__PURE__ */ jsxs13(
6153
+ /* @__PURE__ */ jsxs14("div", { className: pageCount > 1 ? "flex items-center justify-between gap-2" : void 0, children: [
6154
+ /* @__PURE__ */ jsxs14(
5919
6155
  "p",
5920
6156
  {
5921
6157
  role: "status",
@@ -5929,8 +6165,8 @@ function InsightPages({
5929
6165
  ]
5930
6166
  }
5931
6167
  ),
5932
- pageCount > 1 ? /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
5933
- /* @__PURE__ */ jsx15(PagerButton, { label: "Previous insights", glyph: "\u2039", atEnd: current === 0, onClick: () => goTo(current - 1) }),
6168
+ pageCount > 1 ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1", children: [
6169
+ /* @__PURE__ */ jsx16(PagerButton, { label: "Previous insights", glyph: "\u2039", atEnd: current === 0, onClick: () => goTo(current - 1) }),
5934
6170
  pageCount <= MAX_PAGE_DOTS ? Array.from({ length: pageCount }, (_, index) => (
5935
6171
  // WCAG 2.2 SC 2.5.8 wants a 24x24 CSS px target. The dot stays
5936
6172
  // 8px because a 24px dot is a different control; the BUTTON
@@ -5938,7 +6174,7 @@ function InsightPages({
5938
6174
  // and the span is the graphic. The Spacing exception cannot
5939
6175
  // rescue the bare dot — at a 12px pitch the 24px circle around
5940
6176
  // each centre overlaps its neighbour's.
5941
- /* @__PURE__ */ jsx15(
6177
+ /* @__PURE__ */ jsx16(
5942
6178
  "button",
5943
6179
  {
5944
6180
  type: "button",
@@ -5946,7 +6182,7 @@ function InsightPages({
5946
6182
  "aria-current": index === current ? "page" : void 0,
5947
6183
  onClick: () => goTo(index),
5948
6184
  className: "group flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
5949
- children: /* @__PURE__ */ jsx15(
6185
+ children: /* @__PURE__ */ jsx16(
5950
6186
  "span",
5951
6187
  {
5952
6188
  "aria-hidden": "true",
@@ -5960,7 +6196,7 @@ function InsightPages({
5960
6196
  index
5961
6197
  )
5962
6198
  )) : null,
5963
- /* @__PURE__ */ jsx15(
6199
+ /* @__PURE__ */ jsx16(
5964
6200
  PagerButton,
5965
6201
  {
5966
6202
  label: "Next insights",
@@ -5981,7 +6217,7 @@ function PagerButton({
5981
6217
  atEnd,
5982
6218
  onClick
5983
6219
  }) {
5984
- return /* @__PURE__ */ jsx15(
6220
+ return /* @__PURE__ */ jsx16(
5985
6221
  "button",
5986
6222
  {
5987
6223
  type: "button",
@@ -5991,14 +6227,14 @@ function PagerButton({
5991
6227
  if (!atEnd) onClick();
5992
6228
  },
5993
6229
  className: `flex h-6 w-6 items-center justify-center rounded-md border border-border text-xs text-muted-foreground transition ${atEnd ? "opacity-40" : "hover:bg-accent hover:text-foreground"}`,
5994
- children: /* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: glyph })
6230
+ children: /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: glyph })
5995
6231
  }
5996
6232
  );
5997
6233
  }
5998
6234
 
5999
6235
  // src/web-react/api-access-panel.tsx
6000
- import { useEffect as useEffect12, useRef as useRef11, useState as useState16 } from "react";
6001
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
6236
+ import { useEffect as useEffect12, useRef as useRef12, useState as useState17 } from "react";
6237
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
6002
6238
  var defaultExpiryChoices = [1, 7, 30];
6003
6239
  var inputClass = "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground";
6004
6240
  var buttonClass = "inline-flex items-center justify-center rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50";
@@ -6050,20 +6286,20 @@ function ApiAccessPanel({
6050
6286
  onRevoke,
6051
6287
  onChanged
6052
6288
  }) {
6053
- const [name, setName] = useState16("");
6289
+ const [name, setName] = useState17("");
6054
6290
  const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
6055
6291
  const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
6056
- const [days, setDays] = useState16(fallbackDays);
6292
+ const [days, setDays] = useState17(fallbackDays);
6057
6293
  const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
6058
- const [scopes, setScopes] = useState16(() => expandScopes(defaultScopes, access));
6059
- const [creating, setCreating] = useState16(false);
6060
- const [revoking, setRevoking] = useState16(null);
6061
- const [created, setCreated] = useState16(null);
6062
- const [notice, setNotice] = useState16(null);
6063
- const [error, setError] = useState16(null);
6064
- const keyHeading = useRef11(null);
6065
- const nameInput = useRef11(null);
6066
- const keyWasShown = useRef11(false);
6294
+ const [scopes, setScopes] = useState17(() => expandScopes(defaultScopes, access));
6295
+ const [creating, setCreating] = useState17(false);
6296
+ const [revoking, setRevoking] = useState17(null);
6297
+ const [created, setCreated] = useState17(null);
6298
+ const [notice, setNotice] = useState17(null);
6299
+ const [error, setError] = useState17(null);
6300
+ const keyHeading = useRef12(null);
6301
+ const nameInput = useRef12(null);
6302
+ const keyWasShown = useRef12(false);
6067
6303
  const selectedScopes = pruneScopes(scopes, access);
6068
6304
  useEffect12(() => {
6069
6305
  setScopes((current) => {
@@ -6116,20 +6352,20 @@ function ApiAccessPanel({
6116
6352
  setRevoking(null);
6117
6353
  }
6118
6354
  }
6119
- return /* @__PURE__ */ jsx16("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs14("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
6120
- /* @__PURE__ */ jsxs14("div", { className: "space-y-2", children: [
6121
- accountHref && /* @__PURE__ */ jsx16("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6122
- /* @__PURE__ */ jsx16("h1", { className: "text-2xl font-semibold text-foreground", children: "API access" }),
6123
- /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: description ?? "Connect a client to your account. Each key acts with your permissions and only the access you choose." })
6355
+ return /* @__PURE__ */ jsx17("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs15("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
6356
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
6357
+ accountHref && /* @__PURE__ */ jsx17("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6358
+ /* @__PURE__ */ jsx17("h1", { className: "text-2xl font-semibold text-foreground", children: "API access" }),
6359
+ /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: description ?? "Connect a client to your account. Each key acts with your permissions and only the access you choose." })
6124
6360
  ] }),
6125
- error && /* @__PURE__ */ jsx16("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6126
- notice && /* @__PURE__ */ jsx16("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6127
- created ? /* @__PURE__ */ jsxs14("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6128
- /* @__PURE__ */ jsx16("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6129
- /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
6130
- /* @__PURE__ */ jsxs14("div", { className: "flex gap-2", children: [
6131
- /* @__PURE__ */ jsx16("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
6132
- /* @__PURE__ */ jsx16("button", { className: buttonClass, onClick: async () => {
6361
+ error && /* @__PURE__ */ jsx17("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6362
+ notice && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6363
+ created ? /* @__PURE__ */ jsxs15("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6364
+ /* @__PURE__ */ jsx17("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6365
+ /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: "Copy it directly into your client\u2019s secret storage. It is shown only now. Keep it out of chat messages and prompts." }),
6366
+ /* @__PURE__ */ jsxs15("div", { className: "flex gap-2", children: [
6367
+ /* @__PURE__ */ jsx17("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
6368
+ /* @__PURE__ */ jsx17("button", { className: buttonClass, onClick: async () => {
6133
6369
  try {
6134
6370
  await navigator.clipboard.writeText(created.key);
6135
6371
  setNotice("Key copied");
@@ -6138,32 +6374,32 @@ function ApiAccessPanel({
6138
6374
  }
6139
6375
  }, children: "Copy key" })
6140
6376
  ] }),
6141
- /* @__PURE__ */ jsx16("button", { className: outlineClass, onClick: () => {
6377
+ /* @__PURE__ */ jsx17("button", { className: outlineClass, onClick: () => {
6142
6378
  setCreated(null);
6143
6379
  setNotice(null);
6144
6380
  }, children: "I\u2019ve saved it" })
6145
- ] }) : /* @__PURE__ */ jsxs14("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6146
- /* @__PURE__ */ jsx16("h2", { className: "font-medium", children: "Create a key" }),
6147
- /* @__PURE__ */ jsxs14("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6148
- /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
6149
- /* @__PURE__ */ jsx16("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6150
- /* @__PURE__ */ jsx16("input", { ref: nameInput, id: "key-name", className: inputClass, value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
6381
+ ] }) : /* @__PURE__ */ jsxs15("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6382
+ /* @__PURE__ */ jsx17("h2", { className: "font-medium", children: "Create a key" }),
6383
+ /* @__PURE__ */ jsxs15("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6384
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
6385
+ /* @__PURE__ */ jsx17("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6386
+ /* @__PURE__ */ jsx17("input", { ref: nameInput, id: "key-name", className: inputClass, value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
6151
6387
  ] }),
6152
- /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5", children: [
6153
- /* @__PURE__ */ jsx16("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6154
- /* @__PURE__ */ jsx16("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs14("option", { value: days2, children: [
6388
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
6389
+ /* @__PURE__ */ jsx17("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6390
+ /* @__PURE__ */ jsx17("select", { id: "key-expiry", value: selectedDays ?? "", onChange: (event) => setDays(Number(event.target.value)), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: allowedDays.map((days2) => /* @__PURE__ */ jsxs15("option", { value: days2, children: [
6155
6391
  days2,
6156
6392
  " ",
6157
6393
  days2 === 1 ? "day" : "days"
6158
6394
  ] }, days2)) })
6159
6395
  ] })
6160
6396
  ] }),
6161
- /* @__PURE__ */ jsxs14("fieldset", { className: "space-y-3", children: [
6162
- /* @__PURE__ */ jsx16("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6397
+ /* @__PURE__ */ jsxs15("fieldset", { className: "space-y-3", children: [
6398
+ /* @__PURE__ */ jsx17("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6163
6399
  access.map((option) => {
6164
6400
  const unavailable = !expandScopes([option.scope], access).includes(option.scope);
6165
- return /* @__PURE__ */ jsxs14("label", { className: "flex cursor-pointer items-start gap-3", children: [
6166
- /* @__PURE__ */ jsx16(
6401
+ return /* @__PURE__ */ jsxs15("label", { className: "flex cursor-pointer items-start gap-3", children: [
6402
+ /* @__PURE__ */ jsx17(
6167
6403
  "input",
6168
6404
  {
6169
6405
  type: "checkbox",
@@ -6173,38 +6409,38 @@ function ApiAccessPanel({
6173
6409
  onChange: (event) => setScopes((current) => event.target.checked ? expandScopes([...current, option.scope], access) : pruneScopes(current.filter((scope) => scope !== option.scope), access))
6174
6410
  }
6175
6411
  ),
6176
- /* @__PURE__ */ jsxs14("span", { className: "text-sm", children: [
6177
- /* @__PURE__ */ jsx16("span", { className: "block font-medium", children: option.label }),
6178
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: option.description }),
6179
- unavailable && /* @__PURE__ */ jsx16("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6412
+ /* @__PURE__ */ jsxs15("span", { className: "text-sm", children: [
6413
+ /* @__PURE__ */ jsx17("span", { className: "block font-medium", children: option.label }),
6414
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: option.description }),
6415
+ unavailable && /* @__PURE__ */ jsx17("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6180
6416
  ] })
6181
6417
  ] }, option.scope);
6182
6418
  })
6183
6419
  ] }),
6184
- limitsDescription && /* @__PURE__ */ jsx16("p", { className: "text-xs text-muted-foreground", children: limitsDescription }),
6185
- /* @__PURE__ */ jsx16("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6420
+ limitsDescription && /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: limitsDescription }),
6421
+ /* @__PURE__ */ jsx17("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6186
6422
  ] }),
6187
- /* @__PURE__ */ jsxs14("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6188
- /* @__PURE__ */ jsx16("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6189
- keys.length === 0 ? /* @__PURE__ */ jsx16("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx16("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs14("li", { className: "flex items-start justify-between gap-3 p-4", children: [
6190
- /* @__PURE__ */ jsxs14("div", { className: "min-w-0 space-y-1", children: [
6191
- /* @__PURE__ */ jsx16("p", { className: "break-words text-sm font-medium", children: key.name }),
6192
- /* @__PURE__ */ jsx16("p", { className: "text-xs text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
6193
- /* @__PURE__ */ jsx16("p", { className: "text-xs text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") })
6423
+ /* @__PURE__ */ jsxs15("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6424
+ /* @__PURE__ */ jsx17("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6425
+ keys.length === 0 ? /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx17("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs15("li", { className: "flex items-start justify-between gap-3 p-4", children: [
6426
+ /* @__PURE__ */ jsxs15("div", { className: "min-w-0 space-y-1", children: [
6427
+ /* @__PURE__ */ jsx17("p", { className: "break-words text-sm font-medium", children: key.name }),
6428
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
6429
+ /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") })
6194
6430
  ] }),
6195
- /* @__PURE__ */ jsx16("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6431
+ /* @__PURE__ */ jsx17("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6196
6432
  ] }, key.id)) })
6197
6433
  ] }),
6198
- /* @__PURE__ */ jsxs14("p", { className: "text-sm text-muted-foreground", children: [
6434
+ /* @__PURE__ */ jsxs15("p", { className: "text-sm text-muted-foreground", children: [
6199
6435
  "Use ",
6200
- /* @__PURE__ */ jsx16("code", { className: "text-xs", children: baseUrl }),
6436
+ /* @__PURE__ */ jsx17("code", { className: "text-xs", children: baseUrl }),
6201
6437
  " as the API base and send the key as a Bearer credential."
6202
6438
  ] })
6203
6439
  ] }) });
6204
6440
  }
6205
6441
 
6206
6442
  // src/web-react/index.tsx
6207
- import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
6443
+ import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
6208
6444
  function formatModelCost(msg, models) {
6209
6445
  if (msg.promptTokens == null && msg.completionTokens == null) return null;
6210
6446
  const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
@@ -6223,41 +6459,41 @@ function formatTokensPerSecond(msg) {
6223
6459
  return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
6224
6460
  }
6225
6461
  function RunDrillIn({ run, onClose }) {
6226
- return /* @__PURE__ */ jsxs15("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
6227
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6228
- /* @__PURE__ */ jsx17(
6462
+ return /* @__PURE__ */ jsxs16("div", { className: `fixed inset-y-0 right-0 z-50 flex w-[480px] max-w-full flex-col border-l border-card-edge bg-popover ${OVERLAY_SHADOW}`, children: [
6463
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6464
+ /* @__PURE__ */ jsx18(
6229
6465
  "span",
6230
6466
  {
6231
6467
  className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
6232
6468
  }
6233
6469
  ),
6234
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
6235
- /* @__PURE__ */ jsx17("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6236
- /* @__PURE__ */ jsx17("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6470
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
6471
+ /* @__PURE__ */ jsx18("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6472
+ /* @__PURE__ */ jsx18("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6237
6473
  ] }),
6238
- /* @__PURE__ */ jsx17(
6474
+ /* @__PURE__ */ jsx18(
6239
6475
  "button",
6240
6476
  {
6241
6477
  type: "button",
6242
6478
  onClick: onClose,
6243
6479
  "aria-label": "Close",
6244
6480
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6245
- children: /* @__PURE__ */ jsx17("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx17("path", { d: "M18 6 6 18M6 6l12 12" }) })
6481
+ children: /* @__PURE__ */ jsx18("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx18("path", { d: "M18 6 6 18M6 6l12 12" }) })
6246
6482
  }
6247
6483
  )
6248
6484
  ] }),
6249
- /* @__PURE__ */ jsxs15("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6250
- run.steps.length === 0 && /* @__PURE__ */ jsx17("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6251
- run.steps.map((step, i) => /* @__PURE__ */ jsxs15("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6252
- /* @__PURE__ */ jsxs15("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6253
- /* @__PURE__ */ jsx17("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6254
- /* @__PURE__ */ jsx17("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6255
- /* @__PURE__ */ jsx17("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6485
+ /* @__PURE__ */ jsxs16("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6486
+ run.steps.length === 0 && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6487
+ run.steps.map((step, i) => /* @__PURE__ */ jsxs16("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6488
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6489
+ /* @__PURE__ */ jsx18("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6490
+ /* @__PURE__ */ jsx18("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6491
+ /* @__PURE__ */ jsx18("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6256
6492
  ] }),
6257
- step.detail && /* @__PURE__ */ jsx17("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
6493
+ step.detail && /* @__PURE__ */ jsx18("pre", { className: "max-h-48 overflow-auto whitespace-pre-wrap px-3 py-2 font-mono text-xs leading-relaxed text-muted-foreground", children: step.detail })
6258
6494
  ] }, i))
6259
6495
  ] }),
6260
- /* @__PURE__ */ jsx17("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
6496
+ /* @__PURE__ */ jsx18("p", { className: "border-t border-border px-4 py-2 text-xs text-muted-foreground", children: "Read-only transcript \u2014 reply in the main chat." })
6261
6497
  ] });
6262
6498
  }
6263
6499
  function pendingApprovalOf(call) {
@@ -6273,23 +6509,23 @@ function ChatEmptyState({
6273
6509
  }) {
6274
6510
  const doorCount = Math.min(doors?.length ?? 0, 3);
6275
6511
  const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
6276
- return /* @__PURE__ */ jsxs15("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6277
- /* @__PURE__ */ jsx17("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx17(BrandMark, { size: 32, className: "shrink-0" }) }),
6278
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6279
- /* @__PURE__ */ jsx17("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6280
- subline && /* @__PURE__ */ jsx17("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6281
- doors && doors.length > 0 && /* @__PURE__ */ jsx17("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs15(
6512
+ return /* @__PURE__ */ jsxs16("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6513
+ /* @__PURE__ */ jsx18("span", { className: "mb-5 inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10 ring-1 ring-primary/15", children: /* @__PURE__ */ jsx18(BrandMark, { size: 32, className: "shrink-0" }) }),
6514
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6515
+ /* @__PURE__ */ jsx18("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6516
+ subline && /* @__PURE__ */ jsx18("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6517
+ doors && doors.length > 0 && /* @__PURE__ */ jsx18("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs16(
6282
6518
  "button",
6283
6519
  {
6284
6520
  type: "button",
6285
6521
  onClick: door.onSelect,
6286
6522
  className: "group flex min-h-[44px] flex-col items-start rounded-xl border border-border bg-card px-4 py-3 text-left transition hover:border-primary/40 hover:bg-accent",
6287
6523
  children: [
6288
- /* @__PURE__ */ jsxs15("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6524
+ /* @__PURE__ */ jsxs16("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6289
6525
  door.icon,
6290
6526
  door.label
6291
6527
  ] }),
6292
- door.description && /* @__PURE__ */ jsx17("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6528
+ door.description && /* @__PURE__ */ jsx18("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6293
6529
  ]
6294
6530
  },
6295
6531
  i
@@ -6298,26 +6534,26 @@ function ChatEmptyState({
6298
6534
  }
6299
6535
  function ToolGlyph({ name, className }) {
6300
6536
  if (name.startsWith("sandbox_")) {
6301
- return /* @__PURE__ */ jsxs15("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6302
- /* @__PURE__ */ jsx17("polyline", { points: "4 17 10 11 4 5" }),
6303
- /* @__PURE__ */ jsx17("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6537
+ return /* @__PURE__ */ jsxs16("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6538
+ /* @__PURE__ */ jsx18("polyline", { points: "4 17 10 11 4 5" }),
6539
+ /* @__PURE__ */ jsx18("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6304
6540
  ] });
6305
6541
  }
6306
6542
  if (name === "submit_proposal") {
6307
- return /* @__PURE__ */ jsxs15("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6308
- /* @__PURE__ */ jsx17("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6309
- /* @__PURE__ */ jsx17("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6543
+ return /* @__PURE__ */ jsxs16("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6544
+ /* @__PURE__ */ jsx18("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6545
+ /* @__PURE__ */ jsx18("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6310
6546
  ] });
6311
6547
  }
6312
6548
  if (name === "schedule_followup") {
6313
- return /* @__PURE__ */ jsxs15("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6314
- /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "9" }),
6315
- /* @__PURE__ */ jsx17("path", { d: "M12 7v5l3 3" })
6549
+ return /* @__PURE__ */ jsxs16("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6550
+ /* @__PURE__ */ jsx18("circle", { cx: "12", cy: "12", r: "9" }),
6551
+ /* @__PURE__ */ jsx18("path", { d: "M12 7v5l3 3" })
6316
6552
  ] });
6317
6553
  }
6318
- return /* @__PURE__ */ jsxs15("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6319
- /* @__PURE__ */ jsx17("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6320
- /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "4" })
6554
+ return /* @__PURE__ */ jsxs16("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6555
+ /* @__PURE__ */ jsx18("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6556
+ /* @__PURE__ */ jsx18("circle", { cx: "12", cy: "12", r: "4" })
6321
6557
  ] });
6322
6558
  }
6323
6559
  function toolOutcomeOf(call) {
@@ -6403,40 +6639,40 @@ function truncate(v, max = 240) {
6403
6639
  function KvRows({ data }) {
6404
6640
  const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
6405
6641
  if (!entries.length) return null;
6406
- return /* @__PURE__ */ jsx17("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs15("div", { className: "contents", children: [
6407
- /* @__PURE__ */ jsx17("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6408
- /* @__PURE__ */ jsx17("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6642
+ return /* @__PURE__ */ jsx18("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs16("div", { className: "contents", children: [
6643
+ /* @__PURE__ */ jsx18("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6644
+ /* @__PURE__ */ jsx18("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6409
6645
  ] }, k)) });
6410
6646
  }
6411
6647
  function ShellDetail({ call }) {
6412
6648
  const outcome = toolOutcomeOf(call);
6413
6649
  const r = outcome?.result ?? {};
6414
- return /* @__PURE__ */ jsxs15("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
6415
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
6416
- /* @__PURE__ */ jsx17("span", { className: "select-none text-zinc-500", children: "$" }),
6417
- /* @__PURE__ */ jsx17("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
6418
- r.exitCode != null && /* @__PURE__ */ jsxs15("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
6650
+ return /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
6651
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
6652
+ /* @__PURE__ */ jsx18("span", { className: "select-none text-zinc-500", children: "$" }),
6653
+ /* @__PURE__ */ jsx18("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
6654
+ r.exitCode != null && /* @__PURE__ */ jsxs16("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
6419
6655
  "exit ",
6420
6656
  r.exitCode
6421
6657
  ] })
6422
6658
  ] }),
6423
- /* @__PURE__ */ jsx17("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap px-3 pb-2.5 pt-1.5 text-zinc-300", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6659
+ /* @__PURE__ */ jsx18("pre", { className: "max-h-56 overflow-auto whitespace-pre-wrap px-3 pb-2.5 pt-1.5 text-zinc-300", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6424
6660
  ] });
6425
6661
  }
6426
6662
  function DefaultToolDetail({ call }) {
6427
6663
  const result = call.result;
6428
6664
  const envelope = typeof result === "object" && result !== null ? result : null;
6429
- return /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
6430
- call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs15("div", { children: [
6431
- /* @__PURE__ */ jsx17("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6432
- /* @__PURE__ */ jsx17(KvRows, { data: call.args })
6665
+ return /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
6666
+ call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs16("div", { children: [
6667
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6668
+ /* @__PURE__ */ jsx18(KvRows, { data: call.args })
6433
6669
  ] }),
6434
- envelope ? /* @__PURE__ */ jsxs15("div", { children: [
6435
- /* @__PURE__ */ jsx17("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6436
- envelope.ok === false ? /* @__PURE__ */ jsx17("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx17(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx17("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6437
- ] }) : result != null ? /* @__PURE__ */ jsxs15("div", { children: [
6438
- /* @__PURE__ */ jsx17("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6439
- /* @__PURE__ */ jsx17("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6670
+ envelope ? /* @__PURE__ */ jsxs16("div", { children: [
6671
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6672
+ envelope.ok === false ? /* @__PURE__ */ jsx18("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx18(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx18("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6673
+ ] }) : result != null ? /* @__PURE__ */ jsxs16("div", { children: [
6674
+ /* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6675
+ /* @__PURE__ */ jsx18("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6440
6676
  ] }) : null
6441
6677
  ] });
6442
6678
  }
@@ -6447,24 +6683,24 @@ function ProposalCard({
6447
6683
  approval,
6448
6684
  renderers
6449
6685
  }) {
6450
- const [expanded, setExpanded] = useState17(false);
6686
+ const [expanded, setExpanded] = useState18(false);
6451
6687
  const { summary, meta, typeSlug } = proposalPreview(call);
6452
6688
  const custom = renderers?.[call.name]?.(call, message);
6453
6689
  const { pending: deciding, run: decide } = usePending();
6454
- return /* @__PURE__ */ jsxs15("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
6455
- /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6456
- /* @__PURE__ */ jsx17("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx17(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6457
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
6458
- /* @__PURE__ */ jsx17("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6459
- /* @__PURE__ */ jsx17("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6460
- summary && /* @__PURE__ */ jsx17("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6461
- typeSlug && /* @__PURE__ */ jsx17("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6462
- meta.length > 0 && /* @__PURE__ */ jsx17("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx17("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6690
+ return /* @__PURE__ */ jsxs16("div", { className: "w-full max-w-full rounded-xl border border-warning/50 bg-warning/[0.06] text-sm shadow-sm ring-1 ring-warning/10", children: [
6691
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6692
+ /* @__PURE__ */ jsx18("span", { className: "mt-0.5 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-warning/15 text-warning", children: /* @__PURE__ */ jsx18(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6693
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
6694
+ /* @__PURE__ */ jsx18("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6695
+ /* @__PURE__ */ jsx18("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6696
+ summary && /* @__PURE__ */ jsx18("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6697
+ typeSlug && /* @__PURE__ */ jsx18("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6698
+ meta.length > 0 && /* @__PURE__ */ jsx18("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx18("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6463
6699
  ] })
6464
6700
  ] }),
6465
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6466
- approval && /* @__PURE__ */ jsxs15(Fragment8, { children: [
6467
- /* @__PURE__ */ jsx17(
6701
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6702
+ approval && /* @__PURE__ */ jsxs16(Fragment9, { children: [
6703
+ /* @__PURE__ */ jsx18(
6468
6704
  "button",
6469
6705
  {
6470
6706
  type: "button",
@@ -6474,7 +6710,7 @@ function ProposalCard({
6474
6710
  children: "Approve & run"
6475
6711
  }
6476
6712
  ),
6477
- /* @__PURE__ */ jsx17(
6713
+ /* @__PURE__ */ jsx18(
6478
6714
  "button",
6479
6715
  {
6480
6716
  type: "button",
@@ -6485,7 +6721,7 @@ function ProposalCard({
6485
6721
  }
6486
6722
  )
6487
6723
  ] }),
6488
- /* @__PURE__ */ jsxs15(
6724
+ /* @__PURE__ */ jsxs16(
6489
6725
  "button",
6490
6726
  {
6491
6727
  type: "button",
@@ -6494,12 +6730,12 @@ function ProposalCard({
6494
6730
  className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
6495
6731
  children: [
6496
6732
  expanded ? "Hide details" : "View details",
6497
- /* @__PURE__ */ jsx17(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6733
+ /* @__PURE__ */ jsx18(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6498
6734
  ]
6499
6735
  }
6500
6736
  )
6501
6737
  ] }),
6502
- expanded && /* @__PURE__ */ jsx17("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx17(DefaultToolDetail, { call }) })
6738
+ expanded && /* @__PURE__ */ jsx18("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx18(DefaultToolDetail, { call }) })
6503
6739
  ] });
6504
6740
  }
6505
6741
  function formatFollowupWhen(when) {
@@ -6514,14 +6750,14 @@ function FollowupCard({ call }) {
6514
6750
  const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
6515
6751
  const failed = toolCallFailed(call);
6516
6752
  const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
6517
- return /* @__PURE__ */ jsx17("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6518
- /* @__PURE__ */ jsxs15("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6519
- /* @__PURE__ */ jsx17("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx17(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6520
- /* @__PURE__ */ jsx17("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6521
- when && /* @__PURE__ */ jsx17("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
6522
- /* @__PURE__ */ jsx17("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx17("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx17("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx17("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6753
+ return /* @__PURE__ */ jsx18("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6754
+ /* @__PURE__ */ jsxs16("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6755
+ /* @__PURE__ */ jsx18("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--radius-sm)] border border-border bg-muted text-muted-foreground", children: /* @__PURE__ */ jsx18(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6756
+ /* @__PURE__ */ jsx18("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6757
+ when && /* @__PURE__ */ jsx18("span", { title: when, className: "hidden min-w-0 flex-1 truncate font-mono text-xs tabular-nums text-muted-foreground sm:inline", children: formatFollowupWhen(when) }),
6758
+ /* @__PURE__ */ jsx18("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx18("svg", { className: "h-3 w-3 shrink-0 animate-spin text-[var(--accent-text)]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx18("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx18("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6523
6759
  ] }),
6524
- errorText && /* @__PURE__ */ jsx17("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6760
+ errorText && /* @__PURE__ */ jsx18("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6525
6761
  ] }) });
6526
6762
  }
6527
6763
  function toolRowTitle(call) {
@@ -6544,10 +6780,10 @@ function ToolCallCard({
6544
6780
  const arrival = useArrivalStyle(staggerIndex ?? 0);
6545
6781
  const pending = call.status === "done" ? pendingApprovalOf(call) : null;
6546
6782
  const kind = blockKindOf(call);
6547
- const arrive = (row) => /* @__PURE__ */ jsx17("div", { className: "agent-arrive", style: arrival, children: row });
6783
+ const arrive = (row) => /* @__PURE__ */ jsx18("div", { className: "agent-arrive", style: arrival, children: row });
6548
6784
  if (pending) {
6549
6785
  return arrive(
6550
- /* @__PURE__ */ jsx17(
6786
+ /* @__PURE__ */ jsx18(
6551
6787
  ProposalCard,
6552
6788
  {
6553
6789
  call,
@@ -6560,18 +6796,18 @@ function ToolCallCard({
6560
6796
  );
6561
6797
  }
6562
6798
  if (kind === "followup") {
6563
- return arrive(/* @__PURE__ */ jsx17(FollowupCard, { call }));
6799
+ return arrive(/* @__PURE__ */ jsx18(FollowupCard, { call }));
6564
6800
  }
6565
6801
  const custom = renderers?.[call.name]?.(call, message);
6566
6802
  return arrive(
6567
- /* @__PURE__ */ jsx17(
6803
+ /* @__PURE__ */ jsx18(
6568
6804
  InlineToolItem,
6569
6805
  {
6570
6806
  part: chatToolCallPart(call),
6571
6807
  title: toolRowTitle(call),
6572
6808
  description: toolRowDescription(call),
6573
- renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx17(ShellDetail, { call }) : /* @__PURE__ */ jsx17(DefaultToolDetail, { call })),
6574
- actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx17(
6809
+ renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx18(ShellDetail, { call }) : /* @__PURE__ */ jsx18(DefaultToolDetail, { call })),
6810
+ actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx18(
6575
6811
  "button",
6576
6812
  {
6577
6813
  type: "button",
@@ -6579,9 +6815,9 @@ function ToolCallCard({
6579
6815
  "aria-label": "Open full transcript",
6580
6816
  title: "Open full transcript",
6581
6817
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6582
- children: /* @__PURE__ */ jsxs15("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6583
- /* @__PURE__ */ jsx17("path", { d: "M7 17 17 7" }),
6584
- /* @__PURE__ */ jsx17("path", { d: "M7 7h10v10" })
6818
+ children: /* @__PURE__ */ jsxs16("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6819
+ /* @__PURE__ */ jsx18("path", { d: "M7 17 17 7" }),
6820
+ /* @__PURE__ */ jsx18("path", { d: "M7 7h10v10" })
6585
6821
  ] })
6586
6822
  }
6587
6823
  ) : void 0
@@ -6590,7 +6826,7 @@ function ToolCallCard({
6590
6826
  );
6591
6827
  }
6592
6828
  function StreamingCaret() {
6593
- return /* @__PURE__ */ jsx17(
6829
+ return /* @__PURE__ */ jsx18(
6594
6830
  "span",
6595
6831
  {
6596
6832
  className: "ml-0.5 inline-block h-[1.1em] w-[3px] translate-y-[2px] animate-[agent-caret_1s_step-end_infinite] rounded-sm bg-foreground/70",
@@ -6615,9 +6851,9 @@ function SegmentText({
6615
6851
  // the container on top of that makes the paragraph shimmer while it types.
6616
6852
  // The distinction is what separates "the answer materialised" from "the
6617
6853
  // log was appended to".
6618
- /* @__PURE__ */ jsxs15("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6854
+ /* @__PURE__ */ jsxs16("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6619
6855
  body,
6620
- showCaret && /* @__PURE__ */ jsx17(StreamingCaret, {})
6856
+ showCaret && /* @__PURE__ */ jsx18(StreamingCaret, {})
6621
6857
  ] })
6622
6858
  );
6623
6859
  }
@@ -6642,7 +6878,7 @@ function SegmentedBody({
6642
6878
  const leftoverToolCalls = (msg.toolCalls ?? []).filter(
6643
6879
  (tc) => !segmentToolIds.has(tc.id)
6644
6880
  );
6645
- const renderToolCard = (call, index) => /* @__PURE__ */ jsx17(
6881
+ const renderToolCard = (call, index) => /* @__PURE__ */ jsx18(
6646
6882
  ToolCallCard,
6647
6883
  {
6648
6884
  call,
@@ -6670,7 +6906,7 @@ function SegmentedBody({
6670
6906
  for (const g of groups) {
6671
6907
  if (g.kind === "text") {
6672
6908
  children.push(
6673
- /* @__PURE__ */ jsx17(
6909
+ /* @__PURE__ */ jsx18(
6674
6910
  SegmentText,
6675
6911
  {
6676
6912
  content: g.content,
@@ -6686,13 +6922,13 @@ function SegmentedBody({
6686
6922
  }
6687
6923
  if (!streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool)) {
6688
6924
  children.push(
6689
- /* @__PURE__ */ jsxs15("details", { children: [
6690
- /* @__PURE__ */ jsxs15("summary", { className: "cursor-pointer select-none rounded-md py-0.5 text-xs font-medium text-muted-foreground [transition:color_var(--motion-control)] hover:text-foreground", children: [
6925
+ /* @__PURE__ */ jsxs16("details", { children: [
6926
+ /* @__PURE__ */ jsxs16("summary", { className: "cursor-pointer select-none rounded-md py-0.5 text-xs font-medium text-muted-foreground [transition:color_var(--motion-control)] hover:text-foreground", children: [
6691
6927
  "Worked through ",
6692
6928
  g.calls.length,
6693
6929
  " steps"
6694
6930
  ] }),
6695
- /* @__PURE__ */ jsx17("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6931
+ /* @__PURE__ */ jsx18("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6696
6932
  ] }, `tools-fold-${g.index}`)
6697
6933
  );
6698
6934
  continue;
@@ -6701,9 +6937,9 @@ function SegmentedBody({
6701
6937
  }
6702
6938
  leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
6703
6939
  if (streaming && segments[lastIndex]?.kind === "tool") {
6704
- children.push(/* @__PURE__ */ jsx17(StreamingCaret, {}, "streaming-caret"));
6940
+ children.push(/* @__PURE__ */ jsx18(StreamingCaret, {}, "streaming-caret"));
6705
6941
  }
6706
- return /* @__PURE__ */ jsx17("div", { className: "flex flex-col gap-2", children });
6942
+ return /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-2", children });
6707
6943
  }
6708
6944
  var QUIET_META_LANE_CLASS = "mt-1 flex h-[18px] items-center gap-2 text-xs tabular-nums text-muted-foreground opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100";
6709
6945
  function copyTextOf(msg) {
@@ -6712,8 +6948,8 @@ function copyTextOf(msg) {
6712
6948
  return msg.content;
6713
6949
  }
6714
6950
  function CopyMessageButton({ text }) {
6715
- const [copied, setCopied] = useState17(false);
6716
- const timerRef = useRef12(null);
6951
+ const [copied, setCopied] = useState18(false);
6952
+ const timerRef = useRef13(null);
6717
6953
  useEffect13(
6718
6954
  () => () => {
6719
6955
  if (timerRef.current !== null) clearTimeout(timerRef.current);
@@ -6733,7 +6969,7 @@ function CopyMessageButton({ text }) {
6733
6969
  }
6734
6970
  );
6735
6971
  };
6736
- return /* @__PURE__ */ jsx17(
6972
+ return /* @__PURE__ */ jsx18(
6737
6973
  "button",
6738
6974
  {
6739
6975
  type: "button",
@@ -6741,9 +6977,9 @@ function CopyMessageButton({ text }) {
6741
6977
  "aria-label": "Copy message",
6742
6978
  title: "Copy message",
6743
6979
  className: "rounded p-0.5 text-muted-foreground transition hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6744
- children: copied ? /* @__PURE__ */ jsx17("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx17("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs15("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6745
- /* @__PURE__ */ jsx17("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6746
- /* @__PURE__ */ jsx17("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6980
+ children: copied ? /* @__PURE__ */ jsx18("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx18("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs16("svg", { className: "h-3.5 w-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6981
+ /* @__PURE__ */ jsx18("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6982
+ /* @__PURE__ */ jsx18("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6747
6983
  ] })
6748
6984
  }
6749
6985
  );
@@ -6769,9 +7005,9 @@ function AssistantMessageImpl({
6769
7005
  const body = useMemo7(() => renderBody(content), [renderBody, content]);
6770
7006
  const segments = msg.segments;
6771
7007
  const hasAnswerText = content !== "" || (segments?.some((s) => s.kind === "text" && s.content.trim() !== "") ?? false);
6772
- const reasoningScrollRef = useRef12(null);
6773
- const thinkStartRef = useRef12(null);
6774
- const thinkMsRef = useRef12(null);
7008
+ const reasoningScrollRef = useRef13(null);
7009
+ const thinkStartRef = useRef13(null);
7010
+ const thinkMsRef = useRef13(null);
6775
7011
  if (streaming && reasoning && !hasAnswerText && thinkStartRef.current === null) {
6776
7012
  thinkStartRef.current = performance.now();
6777
7013
  }
@@ -6785,15 +7021,15 @@ function AssistantMessageImpl({
6785
7021
  const thinkingSeconds = useThinkingSeconds(
6786
7022
  streaming && !!reasoning && !hasAnswerText
6787
7023
  );
6788
- const [reasoningToggled, setReasoningToggled] = useState17(null);
7024
+ const [reasoningToggled, setReasoningToggled] = useState18(null);
6789
7025
  const reasoningOpen = reasoningToggled ?? !hasAnswerText;
6790
7026
  const quiet = chrome === "quiet";
6791
- return /* @__PURE__ */ jsxs15("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6792
- !quiet && /* @__PURE__ */ jsxs15("div", { className: "mb-1 flex items-baseline gap-2 text-xs tabular-nums text-muted-foreground", children: [
6793
- /* @__PURE__ */ jsx17("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
6794
- msg.modelUsed && /* @__PURE__ */ jsx17("span", { className: "font-mono normal-case", children: msg.modelUsed }),
6795
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx17("span", { children: formatTokensPerSecond(msg) }),
6796
- formatModelCost(msg, models) && /* @__PURE__ */ jsx17("span", { children: formatModelCost(msg, models) })
7027
+ return /* @__PURE__ */ jsxs16("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7028
+ !quiet && /* @__PURE__ */ jsxs16("div", { className: "mb-1 flex items-baseline gap-2 text-xs tabular-nums text-muted-foreground", children: [
7029
+ /* @__PURE__ */ jsx18("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
7030
+ msg.modelUsed && /* @__PURE__ */ jsx18("span", { className: "font-mono normal-case", children: msg.modelUsed }),
7031
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx18("span", { children: formatTokensPerSecond(msg) }),
7032
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx18("span", { children: formatModelCost(msg, models) })
6797
7033
  ] }),
6798
7034
  reasoning && // The canonical run-row grammar (RunRowShell — the same shell the tool
6799
7035
  // rows compose): one family of rows instead of a bespoke disclosure per
@@ -6803,12 +7039,12 @@ function AssistantMessageImpl({
6803
7039
  // and a click outranks the default from then on — the contract the old
6804
7040
  // hand-rolled disclosure had, now enforced through the shell's
6805
7041
  // controlled `open`.
6806
- /* @__PURE__ */ jsx17(
7042
+ /* @__PURE__ */ jsx18(
6807
7043
  RunRowShell,
6808
7044
  {
6809
7045
  className: "mb-2",
6810
- icon: /* @__PURE__ */ jsx17(BrainGlyph, { className: "h-3.5 w-3.5" }),
6811
- title: !hasAnswerText ? /* @__PURE__ */ jsxs15("span", { className: "agent-shimmer", "data-motion": "essential", children: [
7046
+ icon: /* @__PURE__ */ jsx18(BrainGlyph, { className: "h-3.5 w-3.5" }),
7047
+ title: !hasAnswerText ? /* @__PURE__ */ jsxs16("span", { className: "agent-shimmer", "data-motion": "essential", children: [
6812
7048
  "Thinking",
6813
7049
  thinkingSeconds >= 1 ? ` \xB7 ${thinkingSeconds}s` : "\u2026"
6814
7050
  ] }) : thinkMsRef.current != null ? (
@@ -6823,7 +7059,7 @@ function AssistantMessageImpl({
6823
7059
  status: hasAnswerText ? "idle" : "running",
6824
7060
  open: reasoningOpen,
6825
7061
  onOpenChange: (next) => setReasoningToggled(next),
6826
- children: /* @__PURE__ */ jsx17(
7062
+ children: /* @__PURE__ */ jsx18(
6827
7063
  "div",
6828
7064
  {
6829
7065
  ref: reasoningScrollRef,
@@ -6833,7 +7069,7 @@ function AssistantMessageImpl({
6833
7069
  )
6834
7070
  }
6835
7071
  ),
6836
- segments && segments.length > 0 ? /* @__PURE__ */ jsx17(
7072
+ segments && segments.length > 0 ? /* @__PURE__ */ jsx18(
6837
7073
  SegmentedBody,
6838
7074
  {
6839
7075
  segments,
@@ -6845,12 +7081,12 @@ function AssistantMessageImpl({
6845
7081
  toolRenderers,
6846
7082
  messageClassName
6847
7083
  }
6848
- ) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
6849
- /* @__PURE__ */ jsxs15("div", { className: messageClassName, children: [
7084
+ ) : /* @__PURE__ */ jsxs16(Fragment9, { children: [
7085
+ /* @__PURE__ */ jsxs16("div", { className: messageClassName, children: [
6850
7086
  body,
6851
- streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx17(StreamingCaret, {})
7087
+ streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx18(StreamingCaret, {})
6852
7088
  ] }),
6853
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx17("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx17(
7089
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx18("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx18(
6854
7090
  ToolCallCard,
6855
7091
  {
6856
7092
  call: tc,
@@ -6863,7 +7099,7 @@ function AssistantMessageImpl({
6863
7099
  tc.id
6864
7100
  )) })
6865
7101
  ] }),
6866
- durableCards && msg.parts && /* @__PURE__ */ jsx17(
7102
+ durableCards && msg.parts && /* @__PURE__ */ jsx18(
6867
7103
  DurableChatCards,
6868
7104
  {
6869
7105
  ...durableCards,
@@ -6872,7 +7108,7 @@ function AssistantMessageImpl({
6872
7108
  className: "mt-3"
6873
7109
  }
6874
7110
  ),
6875
- workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx17(
7111
+ workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx18(
6876
7112
  WorkProductCard,
6877
7113
  {
6878
7114
  part,
@@ -6882,7 +7118,7 @@ function AssistantMessageImpl({
6882
7118
  `${part.ref.id}:${part.ref.version}`
6883
7119
  )),
6884
7120
  renderExtras?.(msg),
6885
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx17("div", { className: "mt-2", children: /* @__PURE__ */ jsx17(
7121
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx18("div", { className: "mt-2", children: /* @__PURE__ */ jsx18(
6886
7122
  MessageAttachments,
6887
7123
  {
6888
7124
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6890,17 +7126,17 @@ function AssistantMessageImpl({
6890
7126
  justify: "start"
6891
7127
  }
6892
7128
  ) }),
6893
- quiet && /* @__PURE__ */ jsxs15("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
6894
- /* @__PURE__ */ jsx17(CopyMessageButton, { text: copyTextOf(msg) }),
6895
- msg.modelUsed && /* @__PURE__ */ jsx17("span", { className: "font-mono", children: msg.modelUsed }),
6896
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx17("span", { children: formatTokensPerSecond(msg) }),
6897
- formatModelCost(msg, models) && /* @__PURE__ */ jsx17("span", { children: formatModelCost(msg, models) })
7129
+ quiet && /* @__PURE__ */ jsxs16("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
7130
+ /* @__PURE__ */ jsx18(CopyMessageButton, { text: copyTextOf(msg) }),
7131
+ msg.modelUsed && /* @__PURE__ */ jsx18("span", { className: "font-mono", children: msg.modelUsed }),
7132
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx18("span", { children: formatTokensPerSecond(msg) }),
7133
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx18("span", { children: formatModelCost(msg, models) })
6898
7134
  ] })
6899
7135
  ] });
6900
7136
  }
6901
7137
  var AssistantMessage = memo(AssistantMessageImpl);
6902
7138
  function useThinkingSeconds(active) {
6903
- const [seconds, setSeconds] = useState17(0);
7139
+ const [seconds, setSeconds] = useState18(0);
6904
7140
  useEffect13(() => {
6905
7141
  if (!active) return;
6906
7142
  setSeconds(0);
@@ -6911,23 +7147,23 @@ function useThinkingSeconds(active) {
6911
7147
  }
6912
7148
  function ThinkingRow({ agentLabel, chrome = "labeled" }) {
6913
7149
  const seconds = useThinkingSeconds(true);
6914
- return /* @__PURE__ */ jsxs15("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
6915
- chrome !== "quiet" && /* @__PURE__ */ jsx17("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
6916
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-[15px] text-muted-foreground", children: [
6917
- /* @__PURE__ */ jsx17("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx17("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
7150
+ return /* @__PURE__ */ jsxs16("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
7151
+ chrome !== "quiet" && /* @__PURE__ */ jsx18("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
7152
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-[15px] text-muted-foreground", children: [
7153
+ /* @__PURE__ */ jsx18("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx18("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
6918
7154
  "Thinking",
6919
7155
  seconds >= 3 ? ` \xB7 ${seconds}s` : "..."
6920
7156
  ] })
6921
7157
  ] });
6922
7158
  }
6923
7159
  function StreamErrorRow({ message, onRetry }) {
6924
- return /* @__PURE__ */ jsx17("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs15("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
6925
- /* @__PURE__ */ jsxs15("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6926
- /* @__PURE__ */ jsx17("circle", { cx: "12", cy: "12", r: "9" }),
6927
- /* @__PURE__ */ jsx17("path", { d: "M12 8v4m0 4h.01" })
7160
+ return /* @__PURE__ */ jsx18("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs16("div", { role: "alert", className: "flex items-start gap-2.5 rounded-lg border border-destructive/40 bg-destructive/5 px-3 py-2.5 text-sm text-destructive", children: [
7161
+ /* @__PURE__ */ jsxs16("svg", { className: "mt-0.5 h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
7162
+ /* @__PURE__ */ jsx18("circle", { cx: "12", cy: "12", r: "9" }),
7163
+ /* @__PURE__ */ jsx18("path", { d: "M12 8v4m0 4h.01" })
6928
7164
  ] }),
6929
- /* @__PURE__ */ jsx17("span", { className: "min-w-0 flex-1 break-words", children: message }),
6930
- onRetry && /* @__PURE__ */ jsx17(
7165
+ /* @__PURE__ */ jsx18("span", { className: "min-w-0 flex-1 break-words", children: message }),
7166
+ onRetry && /* @__PURE__ */ jsx18(
6931
7167
  "button",
6932
7168
  {
6933
7169
  type: "button",
@@ -6963,32 +7199,32 @@ function ChatMessages({
6963
7199
  const messageClassName = messageSize === "large" ? "agent-app-message-copy text-[17px] leading-[1.6]" : "agent-app-message-copy text-base leading-[1.6]";
6964
7200
  const assistantMessageClassName = `${messageClassName} bg-transparent text-[hsl(var(--foreground))]`;
6965
7201
  const renderBody = useMemo7(
6966
- () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx17("p", { className: "whitespace-pre-wrap", children: content })),
7202
+ () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx18("p", { className: "whitespace-pre-wrap", children: content })),
6967
7203
  [renderMarkdown]
6968
7204
  );
6969
7205
  const lastIsUser = messages[messages.length - 1]?.role === "user";
6970
7206
  const quiet = chrome === "quiet";
6971
7207
  if (messages.length === 0 && !loading && !error) {
6972
- const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx17(ChatEmptyState, { ...emptyState });
6973
- return /* @__PURE__ */ jsxs15(Fragment8, { children: [
7208
+ const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx18(ChatEmptyState, { ...emptyState });
7209
+ return /* @__PURE__ */ jsxs16(Fragment9, { children: [
6974
7210
  header,
6975
7211
  empty
6976
7212
  ] });
6977
7213
  }
6978
- return /* @__PURE__ */ jsxs15(Fragment8, { children: [
7214
+ return /* @__PURE__ */ jsxs16(Fragment9, { children: [
6979
7215
  header,
6980
7216
  messages.map(
6981
- (msg) => msg.role === "user" ? /* @__PURE__ */ jsxs15("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6982
- /* @__PURE__ */ jsxs15("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6983
- !quiet && /* @__PURE__ */ jsx17("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
6984
- /* @__PURE__ */ jsx17(
7217
+ (msg) => msg.role === "user" ? /* @__PURE__ */ jsxs16("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7218
+ /* @__PURE__ */ jsxs16("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7219
+ !quiet && /* @__PURE__ */ jsx18("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
7220
+ /* @__PURE__ */ jsx18(
6985
7221
  "div",
6986
7222
  {
6987
7223
  className: `rounded-2xl bg-[hsl(var(--foreground))] px-4 py-2.5 text-[hsl(var(--background))] ${quiet ? "" : "rounded-tr-md "}${messageClassName}`,
6988
- children: /* @__PURE__ */ jsx17("p", { className: "whitespace-pre-wrap", children: msg.content })
7224
+ children: /* @__PURE__ */ jsx18("p", { className: "whitespace-pre-wrap", children: msg.content })
6989
7225
  }
6990
7226
  ),
6991
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx17("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx17(
7227
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx18("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx18(
6992
7228
  MessageAttachments,
6993
7229
  {
6994
7230
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6997,8 +7233,8 @@ function ChatMessages({
6997
7233
  }
6998
7234
  ) })
6999
7235
  ] }),
7000
- quiet && /* @__PURE__ */ jsx17("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx17(CopyMessageButton, { text: msg.content }) })
7001
- ] }, msg.id) : /* @__PURE__ */ jsx17(
7236
+ quiet && /* @__PURE__ */ jsx18("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx18(CopyMessageButton, { text: msg.content }) })
7237
+ ] }, msg.id) : /* @__PURE__ */ jsx18(
7002
7238
  AssistantMessage,
7003
7239
  {
7004
7240
  msg,
@@ -7019,8 +7255,8 @@ function ChatMessages({
7019
7255
  msg.id
7020
7256
  )
7021
7257
  ),
7022
- loading && lastIsUser && /* @__PURE__ */ jsx17(ThinkingRow, { agentLabel, chrome }),
7023
- error && !loading && /* @__PURE__ */ jsx17(StreamErrorRow, { message: error, onRetry })
7258
+ loading && lastIsUser && /* @__PURE__ */ jsx18(ThinkingRow, { agentLabel, chrome }),
7259
+ error && !loading && /* @__PURE__ */ jsx18(StreamErrorRow, { message: error, onRetry })
7024
7260
  ] });
7025
7261
  }
7026
7262
 
@@ -7056,6 +7292,7 @@ export {
7056
7292
  consumeChatStream,
7057
7293
  streamChatTurn,
7058
7294
  getChatFundingRecovery,
7295
+ AgentProfileRegistryError,
7059
7296
  AgentProfileEditor,
7060
7297
  AgentProfileViewer,
7061
7298
  DurablePlanClientError,
@@ -7158,4 +7395,4 @@ export {
7158
7395
  useThinkingSeconds,
7159
7396
  ChatMessages
7160
7397
  };
7161
- //# sourceMappingURL=chunk-JHHNODBT.js.map
7398
+ //# sourceMappingURL=chunk-2LPNGZFG.js.map