@tangle-network/agent-app 0.58.6 → 0.58.7

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-LQYIBL3G.js";
51
51
 
52
52
  // src/web-react/index.tsx
53
- import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef13, useState as useState18, memo } from "react";
53
+ import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef13, useState as useState19, memo } from "react";
54
54
  import { isViewerMessage, MessageAuthor } from "@tangle-network/ui/chat";
55
55
  import { InlineToolItem, RunRowShell } from "@tangle-network/ui/run";
56
56
 
@@ -1649,8 +1649,34 @@ function AgentProfileRegistryMcpSearch({ registry, disabled, existingNames, vali
1649
1649
  ] });
1650
1650
  }
1651
1651
 
1652
+ // src/web-react/agent-profile-layout.tsx
1653
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1654
+ var sectionGlyphs = {
1655
+ Identity: { path: "M20 21v-2a7 7 0 0 0-14 0v2 M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0", color: "bg-primary/10 text-primary" },
1656
+ "Prompts and instructions": { path: "M8 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-3 M9 15l3-1 9-9-2-2-9 9-1 3", color: "bg-primary/10 text-primary" },
1657
+ "Tools and permissions": { path: "M12 3 3 7v6c0 5 9 9 9 9s9-4 9-9V7l-9-4 M8 12l3 3 5-6", color: "bg-success/10 text-success" },
1658
+ "Model and runtime": { path: "M8 8h8v8H8z M9 3v5m6-5v5M9 16v5m6-5v5M3 9h5m-5 6h5m8-6h5m-5 6h5", color: "bg-primary/10 text-primary" }
1659
+ };
1660
+ var resourceGlyph = { path: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6 M14 2v6h6 M8 13h8m-8 4h6", color: "bg-warning/10 text-warning-strong" };
1661
+ function ProfileSectionHeading({ title }) {
1662
+ const glyph = sectionGlyphs[title] ?? resourceGlyph;
1663
+ return /* @__PURE__ */ jsxs6("span", { className: "flex min-w-0 items-center gap-3", children: [
1664
+ /* @__PURE__ */ jsx8("span", { className: `flex size-9 shrink-0 items-center justify-center rounded-lg ${glyph.color}`, children: /* @__PURE__ */ jsx8("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", className: "size-4", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx8("path", { d: glyph.path }) }) }),
1665
+ /* @__PURE__ */ jsx8("span", { className: "min-w-0 break-words text-sm font-semibold text-foreground", children: title })
1666
+ ] });
1667
+ }
1668
+ function ProfileCard({ title, description, children }) {
1669
+ return /* @__PURE__ */ jsxs6("section", { "aria-label": title, className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: [
1670
+ /* @__PURE__ */ jsxs6("header", { className: "border-b border-border bg-muted/35 px-4 py-3 sm:px-5", children: [
1671
+ /* @__PURE__ */ jsx8("h3", { children: /* @__PURE__ */ jsx8(ProfileSectionHeading, { title }) }),
1672
+ description && /* @__PURE__ */ jsx8("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: description })
1673
+ ] }),
1674
+ /* @__PURE__ */ jsx8("div", { className: "min-w-0 space-y-4 p-4 sm:p-5", children })
1675
+ ] });
1676
+ }
1677
+
1652
1678
  // src/web-react/agent-profile-editor.tsx
1653
- import { Fragment as Fragment3, jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1679
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1654
1680
  var RESOURCE_KIND_LABELS = {
1655
1681
  files: "Resource files",
1656
1682
  skills: "Skills",
@@ -1664,34 +1690,28 @@ function configuredResourceCount(profile, kind) {
1664
1690
  return Array.isArray(resource) ? resource.length : resource ? 1 : 0;
1665
1691
  }
1666
1692
  function Field({ label, hint, children }) {
1667
- return /* @__PURE__ */ jsxs6("label", { className: "block space-y-1.5 text-sm font-medium text-foreground", children: [
1668
- /* @__PURE__ */ jsx8("span", { children: label }),
1693
+ return /* @__PURE__ */ jsxs7("label", { className: "block space-y-1.5 text-sm font-medium text-foreground", children: [
1694
+ /* @__PURE__ */ jsx9("span", { children: label }),
1669
1695
  children,
1670
- hint && /* @__PURE__ */ jsx8("span", { className: "block text-xs font-normal text-muted-foreground", children: hint })
1696
+ hint && /* @__PURE__ */ jsx9("span", { className: "block text-xs font-normal text-muted-foreground", children: hint })
1671
1697
  ] });
1672
1698
  }
1673
1699
  function Section({ title, description, children }) {
1674
- return /* @__PURE__ */ jsxs6("section", { className: "grid min-w-0 gap-4 border-t border-border py-6 first:border-t-0 first:pt-0 sm:grid-cols-[9rem_minmax(0,1fr)] sm:gap-6", children: [
1675
- /* @__PURE__ */ jsxs6("div", { children: [
1676
- /* @__PURE__ */ jsx8("h2", { className: "text-sm font-medium text-muted-foreground", children: title }),
1677
- description && /* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1678
- ] }),
1679
- /* @__PURE__ */ jsx8("div", { className: "min-w-0 space-y-4", children })
1680
- ] });
1700
+ return /* @__PURE__ */ jsx9(ProfileCard, { title, description, children });
1681
1701
  }
1682
1702
  function Disclosure({ title, description, detail, children }) {
1683
- return /* @__PURE__ */ jsxs6("details", { className: "group min-w-0 border-t border-border", children: [
1684
- /* @__PURE__ */ jsxs6("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 rounded-sm py-5 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
1685
- /* @__PURE__ */ jsxs6("span", { children: [
1686
- /* @__PURE__ */ jsx8("span", { className: "block text-sm font-medium text-foreground", children: title }),
1687
- description && /* @__PURE__ */ jsx8("span", { className: "mt-1 block text-sm text-muted-foreground", children: description })
1703
+ return /* @__PURE__ */ jsxs7("details", { className: "group min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: [
1704
+ /* @__PURE__ */ jsxs7("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 bg-muted/35 px-4 py-3 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:px-5", children: [
1705
+ /* @__PURE__ */ jsxs7("span", { className: "min-w-0", children: [
1706
+ /* @__PURE__ */ jsx9(ProfileSectionHeading, { title }),
1707
+ description && /* @__PURE__ */ jsx9("span", { className: "mt-2 block text-sm leading-6 text-muted-foreground", children: description })
1688
1708
  ] }),
1689
- /* @__PURE__ */ jsxs6("span", { className: "flex shrink-0 items-center gap-2 text-sm text-muted-foreground", children: [
1709
+ /* @__PURE__ */ jsxs7("span", { className: "flex shrink-0 items-center gap-2 text-xs text-muted-foreground", children: [
1690
1710
  detail,
1691
- /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1711
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1692
1712
  ] })
1693
1713
  ] }),
1694
- /* @__PURE__ */ jsx8("div", { className: "min-w-0 space-y-4 pb-6", children })
1714
+ /* @__PURE__ */ jsx9("div", { className: "min-w-0 space-y-4 border-t border-border p-4 sm:p-5", children })
1695
1715
  ] });
1696
1716
  }
1697
1717
  function issueMessage(error) {
@@ -1749,16 +1769,16 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1749
1769
  function change(field, text) {
1750
1770
  onChange({ ...draft, [field]: text });
1751
1771
  }
1752
- return /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1753
- /* @__PURE__ */ jsx8(Field, { label: "Source", children: /* @__PURE__ */ jsxs6(Select, { disabled, value: draft.kind, onValueChange: (kind) => change("kind", kind), children: [
1754
- /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Source", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
1755
- /* @__PURE__ */ jsxs6(SelectContent, { children: [
1756
- /* @__PURE__ */ jsx8(SelectItem, { value: "github", children: "GitHub file" }),
1757
- /* @__PURE__ */ jsx8(SelectItem, { value: "inline", children: "Inline content" })
1772
+ return /* @__PURE__ */ jsxs7("div", { className: "grid gap-3 sm:grid-cols-2", children: [
1773
+ /* @__PURE__ */ jsx9(Field, { label: "Source", children: /* @__PURE__ */ jsxs7(Select, { disabled, value: draft.kind, onValueChange: (kind) => change("kind", kind), children: [
1774
+ /* @__PURE__ */ jsx9(SelectTrigger, { "aria-label": "Source", children: /* @__PURE__ */ jsx9(SelectValue, {}) }),
1775
+ /* @__PURE__ */ jsxs7(SelectContent, { children: [
1776
+ /* @__PURE__ */ jsx9(SelectItem, { value: "github", children: "GitHub file" }),
1777
+ /* @__PURE__ */ jsx9(SelectItem, { value: "inline", children: "Inline content" })
1758
1778
  ] })
1759
1779
  ] }) }),
1760
- draft.kind === "github" ? /* @__PURE__ */ jsxs6(Fragment3, { children: [
1761
- /* @__PURE__ */ jsx8(Field, { label: "Repository", hint: "GitHub owner/repo", children: /* @__PURE__ */ jsx8(
1780
+ draft.kind === "github" ? /* @__PURE__ */ jsxs7(Fragment3, { children: [
1781
+ /* @__PURE__ */ jsx9(Field, { label: "Repository", hint: "GitHub owner/repo", children: /* @__PURE__ */ jsx9(
1762
1782
  Input2,
1763
1783
  {
1764
1784
  disabled,
@@ -1767,7 +1787,7 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1767
1787
  placeholder: "owner/repo"
1768
1788
  }
1769
1789
  ) }),
1770
- /* @__PURE__ */ jsx8(Field, { label: "Repository path", hint: "Relative to the repository root", children: /* @__PURE__ */ jsx8(
1790
+ /* @__PURE__ */ jsx9(Field, { label: "Repository path", hint: "Relative to the repository root", children: /* @__PURE__ */ jsx9(
1771
1791
  Input2,
1772
1792
  {
1773
1793
  disabled,
@@ -1776,7 +1796,7 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1776
1796
  placeholder: pathPlaceholder
1777
1797
  }
1778
1798
  ) }),
1779
- /* @__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(
1799
+ /* @__PURE__ */ jsx9(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__ */ jsx9(
1780
1800
  Input2,
1781
1801
  {
1782
1802
  disabled,
@@ -1785,12 +1805,12 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1785
1805
  placeholder: requireGitHubCommitSha ? "40-character commit SHA" : "main"
1786
1806
  }
1787
1807
  ) }),
1788
- /* @__PURE__ */ jsx8(
1808
+ /* @__PURE__ */ jsx9(
1789
1809
  Field,
1790
1810
  {
1791
1811
  label: requireSkillName ? "Skill name" : "Name",
1792
1812
  hint: requireSkillName ? "Unique lowercase name, up to 64 letters, numbers, dots, dashes, or underscores." : "Defaults to the source filename",
1793
- children: /* @__PURE__ */ jsx8(
1813
+ children: /* @__PURE__ */ jsx9(
1794
1814
  Input2,
1795
1815
  {
1796
1816
  disabled,
@@ -1801,13 +1821,13 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1801
1821
  )
1802
1822
  }
1803
1823
  )
1804
- ] }) : /* @__PURE__ */ jsxs6(Fragment3, { children: [
1805
- /* @__PURE__ */ jsx8(
1824
+ ] }) : /* @__PURE__ */ jsxs7(Fragment3, { children: [
1825
+ /* @__PURE__ */ jsx9(
1806
1826
  Field,
1807
1827
  {
1808
1828
  label: requireSkillName ? "Skill name" : "File name",
1809
1829
  hint: requireSkillName ? "Unique lowercase name, up to 64 letters, numbers, dots, dashes, or underscores." : void 0,
1810
- children: /* @__PURE__ */ jsx8(
1830
+ children: /* @__PURE__ */ jsx9(
1811
1831
  Input2,
1812
1832
  {
1813
1833
  disabled,
@@ -1818,7 +1838,7 @@ function ResourceFields({ draft, onChange, disabled, pathPlaceholder, requireGit
1818
1838
  )
1819
1839
  }
1820
1840
  ),
1821
- /* @__PURE__ */ jsx8("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx8(Field, { label: "Content", children: /* @__PURE__ */ jsx8(
1841
+ /* @__PURE__ */ jsx9("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx9(Field, { label: "Content", children: /* @__PURE__ */ jsx9(
1822
1842
  Textarea,
1823
1843
  {
1824
1844
  className: "min-h-32 font-mono text-sm",
@@ -1985,8 +2005,8 @@ function AgentProfileEditor({
1985
2005
  return emit({ ...value, resources: { ...value.resources, files: next } });
1986
2006
  }
1987
2007
  function fileFields(draft, onChange2) {
1988
- return /* @__PURE__ */ jsxs6("div", { className: "space-y-3", children: [
1989
- /* @__PURE__ */ jsx8(Field, { label: "Workspace path", hint: workspaceFilePrefix ? "Place this file under " + workspaceFilePrefix : "Relative to the agent workspace", children: /* @__PURE__ */ jsx8(
2008
+ return /* @__PURE__ */ jsxs7("div", { className: "space-y-3", children: [
2009
+ /* @__PURE__ */ jsx9(Field, { label: "Workspace path", hint: workspaceFilePrefix ? "Place this file under " + workspaceFilePrefix : "Relative to the agent workspace", children: /* @__PURE__ */ jsx9(
1990
2010
  Input2,
1991
2011
  {
1992
2012
  disabled: editingDisabled,
@@ -1995,7 +2015,7 @@ function AgentProfileEditor({
1995
2015
  placeholder: workspaceFilePrefix ? workspaceFilePrefix + "guide.md" : "docs/guide.md"
1996
2016
  }
1997
2017
  ) }),
1998
- /* @__PURE__ */ jsx8(
2018
+ /* @__PURE__ */ jsx9(
1999
2019
  ResourceFields,
2000
2020
  {
2001
2021
  draft: draft.resource,
@@ -2005,8 +2025,8 @@ function AgentProfileEditor({
2005
2025
  onChange: (resource) => onChange2({ ...draft, resource })
2006
2026
  }
2007
2027
  ),
2008
- allowExecutableFiles || draft.executable ? /* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [
2009
- /* @__PURE__ */ jsx8(
2028
+ allowExecutableFiles || draft.executable ? /* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2 text-sm text-foreground", children: [
2029
+ /* @__PURE__ */ jsx9(
2010
2030
  Switch,
2011
2031
  {
2012
2032
  disabled: editingDisabled || !allowExecutableFiles && !draft.executable,
@@ -2017,24 +2037,24 @@ function AgentProfileEditor({
2017
2037
  }
2018
2038
  ),
2019
2039
  "Executable file"
2020
- ] }) : /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Executable files are unavailable for this profile." })
2040
+ ] }) : /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground", children: "Executable files are unavailable for this profile." })
2021
2041
  ] });
2022
2042
  }
2023
2043
  function resourceSection(key, title, description) {
2024
2044
  const refs = value.resources?.[key] ?? [];
2025
2045
  const draft = resourceDrafts[key];
2026
- return /* @__PURE__ */ jsxs6(Disclosure, { title, description, detail: refs.length ? refs.length + " configured" : "Optional", children: [
2027
- refs.length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "None configured." }),
2028
- /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: refs.map((ref, index) => {
2046
+ return /* @__PURE__ */ jsxs7(Disclosure, { title, description, detail: refs.length ? refs.length + " configured" : "Optional", children: [
2047
+ refs.length === 0 && /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: "None configured." }),
2048
+ /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: refs.map((ref, index) => {
2029
2049
  const issue = resourceIssue(key, resourceDraft(ref), refs, index, true);
2030
- return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": title + " " + (index + 1), children: [
2031
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2032
- /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2033
- /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: ref.name || (ref.kind === "github" ? ref.path : "Inline resource") }),
2034
- /* @__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" })
2050
+ return /* @__PURE__ */ jsxs7("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": title + " " + (index + 1), children: [
2051
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2052
+ /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2053
+ /* @__PURE__ */ jsx9("span", { className: "block break-words font-medium text-foreground", children: ref.name || (ref.kind === "github" ? ref.path : "Inline resource") }),
2054
+ /* @__PURE__ */ jsx9("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" })
2035
2055
  ] }),
2036
- /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 gap-1", children: [
2037
- /* @__PURE__ */ jsx8(
2056
+ /* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 gap-1", children: [
2057
+ /* @__PURE__ */ jsx9(
2038
2058
  Button2,
2039
2059
  {
2040
2060
  type: "button",
@@ -2045,7 +2065,7 @@ function AgentProfileEditor({
2045
2065
  children: "Edit"
2046
2066
  }
2047
2067
  ),
2048
- /* @__PURE__ */ jsx8(
2068
+ /* @__PURE__ */ jsx9(
2049
2069
  Button2,
2050
2070
  {
2051
2071
  type: "button",
@@ -2061,12 +2081,12 @@ function AgentProfileEditor({
2061
2081
  )
2062
2082
  ] })
2063
2083
  ] }),
2064
- (requireGitHubCommitSha || key === "skills" && requireUniqueSkillNames) && issue && /* @__PURE__ */ jsxs6("p", { className: "text-xs text-destructive", children: [
2084
+ (requireGitHubCommitSha || key === "skills" && requireUniqueSkillNames) && issue && /* @__PURE__ */ jsxs7("p", { className: "text-xs text-destructive", children: [
2065
2085
  issue,
2066
2086
  " Edit this resource before saving."
2067
2087
  ] }),
2068
- resourceEdit?.key === key && resourceEdit.index === index && /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-3", children: [
2069
- /* @__PURE__ */ jsx8(
2088
+ resourceEdit?.key === key && resourceEdit.index === index && /* @__PURE__ */ jsxs7("div", { className: "space-y-3 border-t border-border pt-3", children: [
2089
+ /* @__PURE__ */ jsx9(
2070
2090
  ResourceFields,
2071
2091
  {
2072
2092
  draft: resourceEdit.draft,
@@ -2077,14 +2097,14 @@ function AgentProfileEditor({
2077
2097
  onChange: (next) => setResourceEdit({ key, index, draft: next })
2078
2098
  }
2079
2099
  ),
2080
- /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2081
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: applyResourceEdit, children: "Apply changes" }),
2082
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setResourceEdit(null), children: "Cancel" })
2100
+ /* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
2101
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: applyResourceEdit, children: "Apply changes" }),
2102
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", onClick: () => setResourceEdit(null), children: "Cancel" })
2083
2103
  ] })
2084
2104
  ] })
2085
2105
  ] }, index);
2086
2106
  }) }),
2087
- key === "skills" && registry && /* @__PURE__ */ jsx8(
2107
+ key === "skills" && registry && /* @__PURE__ */ jsx9(
2088
2108
  AgentProfileRegistrySkillSearch,
2089
2109
  {
2090
2110
  registry,
@@ -2094,8 +2114,8 @@ function AgentProfileEditor({
2094
2114
  onAdd: (ref) => resources("skills", [...value.resources?.skills ?? [], ref])
2095
2115
  }
2096
2116
  ),
2097
- /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-4", children: [
2098
- /* @__PURE__ */ jsx8(
2117
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-3 border-t border-border pt-4", children: [
2118
+ /* @__PURE__ */ jsx9(
2099
2119
  ResourceFields,
2100
2120
  {
2101
2121
  draft,
@@ -2106,12 +2126,12 @@ function AgentProfileEditor({
2106
2126
  onChange: (next) => setResourceDrafts((current) => ({ ...current, [key]: next }))
2107
2127
  }
2108
2128
  ),
2109
- /* @__PURE__ */ jsxs6(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => addResource(key), children: [
2129
+ /* @__PURE__ */ jsxs7(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => addResource(key), children: [
2110
2130
  "Add ",
2111
2131
  key === "skills" ? "skill" : "tool file"
2112
2132
  ] })
2113
2133
  ] }),
2114
- /* @__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." })
2134
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground", children: "GitHub files are fetched when the profile runs. Saving does not verify their contents or availability." })
2115
2135
  ] });
2116
2136
  }
2117
2137
  function addMcp() {
@@ -2152,50 +2172,51 @@ function AgentProfileEditor({
2152
2172
  setError(cause instanceof Error ? cause.message : "Invalid JSON");
2153
2173
  }
2154
2174
  }
2155
- return /* @__PURE__ */ jsxs6("div", { className: "min-w-0 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
2156
- error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
2157
- 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." }),
2158
- 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: [
2175
+ return /* @__PURE__ */ jsxs7("div", { className: "min-w-0 space-y-4 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
2176
+ error && /* @__PURE__ */ jsx9("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
2177
+ jsonDirty && /* @__PURE__ */ jsx9("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." }),
2178
+ unsupportedResources.length > 0 && /* @__PURE__ */ jsxs7("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2159
2179
  "This profile contains resources this product does not support: ",
2160
2180
  unsupportedResources.map((kind) => RESOURCE_KIND_LABELS[kind] + " (" + configuredResourceCount(value, kind) + ")").join(", "),
2161
2181
  ". They remain in the profile. Review or remove them in Advanced JSON before saving."
2162
2182
  ] }),
2163
- constrainedEntryCount > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2183
+ constrainedEntryCount > 0 && /* @__PURE__ */ jsxs7("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2164
2184
  constrainedEntryCount,
2165
2185
  " configured resource ",
2166
2186
  constrainedEntryCount === 1 ? "entry needs" : "entries need",
2167
2187
  " repair before this product can save the profile. Review the resource sections or Advanced JSON. Existing values remain unchanged until you edit them."
2168
2188
  ] }),
2169
- invalidMcpCount > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2189
+ invalidMcpCount > 0 && /* @__PURE__ */ jsxs7("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
2170
2190
  invalidMcpCount,
2171
2191
  " configured MCP ",
2172
2192
  invalidMcpCount === 1 ? "server needs" : "servers need",
2173
2193
  " 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."
2174
2194
  ] }),
2175
- /* @__PURE__ */ jsx8(Section, { title: "Identity", children: /* @__PURE__ */ jsxs6("div", { className: "grid gap-4 sm:grid-cols-2", children: [
2176
- /* @__PURE__ */ jsx8(Field, { label: "Name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
2177
- /* @__PURE__ */ jsx8(Field, { label: "Description", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
2195
+ /* @__PURE__ */ jsx9(Section, { title: "Identity", children: /* @__PURE__ */ jsxs7("div", { className: "grid gap-4 sm:grid-cols-2", children: [
2196
+ /* @__PURE__ */ jsx9(Field, { label: "Name", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
2197
+ /* @__PURE__ */ jsx9(Field, { label: "Description", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
2178
2198
  ] }) }),
2179
- /* @__PURE__ */ jsxs6(Section, { title: "Instructions", children: [
2180
- /* @__PURE__ */ jsx8(Field, { label: "System instructions", hint: "Replaces default system instructions.", children: /* @__PURE__ */ jsx8(
2199
+ /* @__PURE__ */ jsxs7(Section, { title: "Prompts and instructions", children: [
2200
+ /* @__PURE__ */ jsx9(Field, { label: "System prompt", hint: "prompt.systemPrompt \xB7 Replaces the harness default where supported. Clear it to use the default.", children: /* @__PURE__ */ jsx9(
2181
2201
  Textarea,
2182
2202
  {
2183
- "aria-label": "System instructions",
2203
+ "aria-label": "System prompt",
2184
2204
  className: "min-h-52 text-base leading-7 sm:text-sm",
2185
2205
  disabled: editingDisabled,
2186
2206
  value: value.prompt?.systemPrompt ?? "",
2187
2207
  onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value })
2188
2208
  }
2189
2209
  ) }),
2190
- /* @__PURE__ */ jsxs6("details", { className: "group/instructions", open: Boolean(value.prompt?.appendSystemPrompt || value.prompt?.instructions?.length), children: [
2191
- /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Additional instructions" }),
2192
- /* @__PURE__ */ jsxs6("div", { className: "mt-3 space-y-5", children: [
2193
- /* @__PURE__ */ jsx8(Field, { label: "Append to system prompt", hint: "Adds to the system prompt without replacing it.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
2194
- /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
2195
- /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
2196
- /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
2197
- (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-2", children: [
2198
- /* @__PURE__ */ jsx8(
2210
+ /* @__PURE__ */ jsxs7("details", { className: "group/instructions", open: Boolean(value.prompt?.appendSystemPrompt || value.prompt?.instructions?.length), children: [
2211
+ /* @__PURE__ */ jsx9("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Additional instructions" }),
2212
+ /* @__PURE__ */ jsxs7("div", { className: "mt-3 space-y-5", children: [
2213
+ /* @__PURE__ */ jsx9(Field, { label: "Appended system prompt", hint: "prompt.appendSystemPrompt \xB7 Appended after the system prompt, or after the harness default when no override is set.", children: /* @__PURE__ */ jsx9(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
2214
+ /* @__PURE__ */ jsxs7("div", { role: "group", "aria-label": "Project instructions", className: "space-y-2", children: [
2215
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-foreground", children: "Project instructions" }),
2216
+ /* @__PURE__ */ jsx9("p", { className: "text-sm leading-6 text-muted-foreground", children: "prompt.instructions \xB7 Lower-priority workspace guidance, separate from the system prompt." }),
2217
+ /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
2218
+ (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs7("div", { className: "flex items-start gap-2", children: [
2219
+ /* @__PURE__ */ jsx9(
2199
2220
  Textarea,
2200
2221
  {
2201
2222
  "aria-label": "Instruction " + (index + 1),
@@ -2205,7 +2226,7 @@ function AgentProfileEditor({
2205
2226
  onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
2206
2227
  }
2207
2228
  ),
2208
- /* @__PURE__ */ jsx8(
2229
+ /* @__PURE__ */ jsx9(
2209
2230
  Button2,
2210
2231
  {
2211
2232
  type: "button",
@@ -2218,30 +2239,30 @@ function AgentProfileEditor({
2218
2239
  }
2219
2240
  )
2220
2241
  ] }, index)),
2221
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
2242
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
2222
2243
  ] })
2223
2244
  ] })
2224
2245
  ] })
2225
2246
  ] })
2226
2247
  ] }),
2227
- /* @__PURE__ */ jsxs6(Section, { title: "Model", children: [
2228
- /* @__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" }) }) }),
2229
- /* @__PURE__ */ jsxs6("details", { children: [
2230
- /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "More model settings" }),
2231
- /* @__PURE__ */ jsxs6("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
2232
- /* @__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" }) }),
2233
- /* @__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 }) }) }),
2234
- /* @__PURE__ */ jsx8(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs6(
2248
+ /* @__PURE__ */ jsxs7(Section, { title: "Model and runtime", children: [
2249
+ /* @__PURE__ */ jsx9("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ jsx9(Field, { label: "Default model", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }) }),
2250
+ /* @__PURE__ */ jsxs7("details", { children: [
2251
+ /* @__PURE__ */ jsx9("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "More model settings" }),
2252
+ /* @__PURE__ */ jsxs7("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
2253
+ /* @__PURE__ */ jsx9(Field, { label: "Small model", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
2254
+ /* @__PURE__ */ jsx9(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
2255
+ /* @__PURE__ */ jsx9(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs7(
2235
2256
  Select,
2236
2257
  {
2237
2258
  disabled: editingDisabled,
2238
2259
  value: value.model?.reasoningEffort ?? "default",
2239
2260
  onValueChange: (level) => model({ ...value.model, reasoningEffort: level === "default" ? void 0 : level }),
2240
2261
  children: [
2241
- /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Thinking level", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2242
- /* @__PURE__ */ jsxs6(SelectContent, { children: [
2243
- /* @__PURE__ */ jsx8(SelectItem, { value: "default", children: "Harness default" }),
2244
- ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx8(SelectItem, { value: level, children: level }, level))
2262
+ /* @__PURE__ */ jsx9(SelectTrigger, { "aria-label": "Thinking level", children: /* @__PURE__ */ jsx9(SelectValue, {}) }),
2263
+ /* @__PURE__ */ jsxs7(SelectContent, { children: [
2264
+ /* @__PURE__ */ jsx9(SelectItem, { value: "default", children: "Harness default" }),
2265
+ ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx9(SelectItem, { value: level, children: level }, level))
2245
2266
  ] })
2246
2267
  ]
2247
2268
  }
@@ -2249,11 +2270,11 @@ function AgentProfileEditor({
2249
2270
  ] })
2250
2271
  ] })
2251
2272
  ] }),
2252
- 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: [
2253
- Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
2254
- /* @__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 border-b border-border py-3 text-sm", children: [
2255
- /* @__PURE__ */ jsxs6("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
2256
- /* @__PURE__ */ jsx8(
2273
+ showToolsAndPermissions && /* @__PURE__ */ jsxs7(Disclosure, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", detail: Object.keys(value.tools ?? {}).length + " configured", children: [
2274
+ Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
2275
+ /* @__PURE__ */ jsx9("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-3 border-b border-border py-3 text-sm", children: [
2276
+ /* @__PURE__ */ jsxs7("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
2277
+ /* @__PURE__ */ jsx9(
2257
2278
  Switch,
2258
2279
  {
2259
2280
  disabled: editingDisabled,
@@ -2263,9 +2284,9 @@ function AgentProfileEditor({
2263
2284
  ),
2264
2285
  name
2265
2286
  ] }),
2266
- /* @__PURE__ */ jsxs6("div", { className: "flex min-w-36 items-center gap-2 text-muted-foreground", children: [
2267
- /* @__PURE__ */ jsx8("span", { children: "Permission" }),
2268
- /* @__PURE__ */ jsxs6(
2287
+ /* @__PURE__ */ jsxs7("div", { className: "flex min-w-36 items-center gap-2 text-muted-foreground", children: [
2288
+ /* @__PURE__ */ jsx9("span", { children: "Permission" }),
2289
+ /* @__PURE__ */ jsxs7(
2269
2290
  Select,
2270
2291
  {
2271
2292
  disabled: editingDisabled,
@@ -2277,27 +2298,27 @@ function AgentProfileEditor({
2277
2298
  emit({ ...value, permissions });
2278
2299
  },
2279
2300
  children: [
2280
- /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Permission for " + name, children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2281
- /* @__PURE__ */ jsxs6(SelectContent, { children: [
2282
- /* @__PURE__ */ jsx8(SelectItem, { value: "default", children: "Default" }),
2283
- /* @__PURE__ */ jsx8(SelectItem, { value: "allow", children: "Allow" }),
2284
- /* @__PURE__ */ jsx8(SelectItem, { value: "ask", children: "Ask" }),
2285
- /* @__PURE__ */ jsx8(SelectItem, { value: "deny", children: "Deny" })
2301
+ /* @__PURE__ */ jsx9(SelectTrigger, { "aria-label": "Permission for " + name, children: /* @__PURE__ */ jsx9(SelectValue, {}) }),
2302
+ /* @__PURE__ */ jsxs7(SelectContent, { children: [
2303
+ /* @__PURE__ */ jsx9(SelectItem, { value: "default", children: "Default" }),
2304
+ /* @__PURE__ */ jsx9(SelectItem, { value: "allow", children: "Allow" }),
2305
+ /* @__PURE__ */ jsx9(SelectItem, { value: "ask", children: "Ask" }),
2306
+ /* @__PURE__ */ jsx9(SelectItem, { value: "deny", children: "Deny" })
2286
2307
  ] })
2287
2308
  ]
2288
2309
  }
2289
2310
  )
2290
2311
  ] }),
2291
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2312
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2292
2313
  const tools = { ...value.tools };
2293
2314
  delete tools[name];
2294
2315
  emit({ ...value, tools });
2295
2316
  }, children: "Remove" })
2296
2317
  ] }, name)) }),
2297
- 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" }),
2298
- /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2299
- /* @__PURE__ */ jsx8(Input2, { "aria-label": "New tool name", disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
2300
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => {
2318
+ Object.keys(value.tools ?? {}).length > 4 && /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", onClick: () => setShowAllTools((current) => !current), children: showAllTools ? "Show fewer rules" : "Show " + (Object.keys(value.tools ?? {}).length - 4) + " more rules" }),
2319
+ /* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
2320
+ /* @__PURE__ */ jsx9(Input2, { "aria-label": "New tool name", disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
2321
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => {
2301
2322
  const name = newTool.trim();
2302
2323
  if (!name || name in (value.tools ?? {})) {
2303
2324
  setError("Enter a unique tool name.");
@@ -2306,42 +2327,42 @@ function AgentProfileEditor({
2306
2327
  if (emit({ ...value, tools: { ...value.tools, [name]: true } })) setNewTool("");
2307
2328
  }, children: "Add tool" })
2308
2329
  ] }),
2309
- /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Nested permission rules remain in Advanced JSON." })
2330
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground", children: "Nested permission rules remain in Advanced JSON." })
2310
2331
  ] }),
2311
2332
  allowsResource("skills") && resourceSection("skills", "Skills", "Add skill packages from a repository or inline content."),
2312
2333
  allowsResource("tools") && resourceSection("tools", "Tool files", "Files that define custom tools."),
2313
- /* @__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: [
2314
- Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No servers configured." }),
2315
- /* @__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 border-b border-border py-3 text-sm", children: [
2316
- /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2317
- /* @__PURE__ */ jsx8("span", { className: "font-medium", children: name }),
2318
- /* @__PURE__ */ jsx8("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
2319
- server.enabled !== false && /* @__PURE__ */ jsx8("p", { className: "truncate text-xs text-muted-foreground", children: "command" in server ? server.command : server.url }),
2320
- publicHttpsMcpOnly && publicHttpsMcpError(server) && /* @__PURE__ */ jsxs6("p", { className: "text-xs text-destructive", children: [
2334
+ /* @__PURE__ */ jsxs7(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: [
2335
+ Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: "No servers configured." }),
2336
+ /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs7("li", { className: "flex items-center justify-between gap-3 border-b border-border py-3 text-sm", children: [
2337
+ /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2338
+ /* @__PURE__ */ jsx9("span", { className: "font-medium", children: name }),
2339
+ /* @__PURE__ */ jsx9("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
2340
+ server.enabled !== false && /* @__PURE__ */ jsx9("p", { className: "truncate text-xs text-muted-foreground", children: "command" in server ? server.command : server.url }),
2341
+ publicHttpsMcpOnly && publicHttpsMcpError(server) && /* @__PURE__ */ jsxs7("p", { className: "text-xs text-destructive", children: [
2321
2342
  publicHttpsMcpError(server),
2322
2343
  " Remove this server or edit it in Advanced JSON before saving."
2323
2344
  ] })
2324
2345
  ] }),
2325
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2346
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
2326
2347
  const mcp = { ...value.mcp };
2327
2348
  delete mcp[name];
2328
2349
  emit({ ...value, mcp });
2329
2350
  }, children: "Remove" })
2330
2351
  ] }, name)) }),
2331
- /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 border-t border-border pt-4 sm:grid-cols-[1fr_10rem]", children: [
2332
- /* @__PURE__ */ jsx8(Field, { label: "Server name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
2333
- /* @__PURE__ */ jsx8(Field, { label: "Transport", children: /* @__PURE__ */ jsxs6(Select, { disabled: editingDisabled, value: selectedMcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
2334
- /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
2335
- /* @__PURE__ */ jsxs6(SelectContent, { children: [
2336
- /* @__PURE__ */ jsx8(SelectItem, { value: "http", children: "HTTP" }),
2337
- /* @__PURE__ */ jsx8(SelectItem, { value: "sse", children: "SSE" }),
2338
- !publicHttpsMcpOnly && /* @__PURE__ */ jsx8(SelectItem, { value: "stdio", children: "Local command" })
2352
+ /* @__PURE__ */ jsxs7("div", { className: "grid gap-3 border-t border-border pt-4 sm:grid-cols-[1fr_10rem]", children: [
2353
+ /* @__PURE__ */ jsx9(Field, { label: "Server name", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
2354
+ /* @__PURE__ */ jsx9(Field, { label: "Transport", children: /* @__PURE__ */ jsxs7(Select, { disabled: editingDisabled, value: selectedMcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
2355
+ /* @__PURE__ */ jsx9(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx9(SelectValue, {}) }),
2356
+ /* @__PURE__ */ jsxs7(SelectContent, { children: [
2357
+ /* @__PURE__ */ jsx9(SelectItem, { value: "http", children: "HTTP" }),
2358
+ /* @__PURE__ */ jsx9(SelectItem, { value: "sse", children: "SSE" }),
2359
+ !publicHttpsMcpOnly && /* @__PURE__ */ jsx9(SelectItem, { value: "stdio", children: "Local command" })
2339
2360
  ] })
2340
2361
  ] }) }),
2341
- /* @__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" }) }) }),
2342
- /* @__PURE__ */ jsx8("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
2362
+ /* @__PURE__ */ jsx9("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx9(Field, { label: selectedMcpKind === "stdio" ? "Command" : "URL", children: /* @__PURE__ */ jsx9(Input2, { disabled: editingDisabled, value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: selectedMcpKind === "stdio" ? "mcp-server" : "https://example.com/mcp" }) }) }),
2363
+ /* @__PURE__ */ jsx9("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
2343
2364
  ] }),
2344
- registry && /* @__PURE__ */ jsx8(
2365
+ registry && /* @__PURE__ */ jsx9(
2345
2366
  AgentProfileRegistryMcpSearch,
2346
2367
  {
2347
2368
  registry,
@@ -2355,23 +2376,23 @@ function AgentProfileEditor({
2355
2376
  onAdd: (name, server) => emit({ ...value, mcp: { ...value.mcp, [name]: server } })
2356
2377
  }
2357
2378
  ),
2358
- /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
2379
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
2359
2380
  ] }),
2360
- allowsResource("files") && /* @__PURE__ */ jsxs6(Disclosure, { title: "Resource files", description: "Files to add to the agent workspace.", detail: (value.resources?.files ?? []).length + " configured", children: [
2361
- (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No resource files configured." }),
2362
- /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => {
2381
+ allowsResource("files") && /* @__PURE__ */ jsxs7(Disclosure, { title: "Resource files", description: "Files to add to the agent workspace.", detail: (value.resources?.files ?? []).length + " configured", children: [
2382
+ (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: "No resource files configured." }),
2383
+ /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => {
2363
2384
  const issues = fileIssues(fileDraft(mount), workspaceFilePrefix, allowExecutableFiles, requireGitHubCommitSha, true);
2364
- return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2365
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2366
- /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2367
- /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: mount.path }),
2368
- /* @__PURE__ */ jsxs6("span", { className: "block break-words text-xs " + (mount.resource.kind === "github" && !mount.resource.repository ? "text-destructive" : "text-muted-foreground"), children: [
2385
+ return /* @__PURE__ */ jsxs7("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2386
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2387
+ /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2388
+ /* @__PURE__ */ jsx9("span", { className: "block break-words font-medium text-foreground", children: mount.path }),
2389
+ /* @__PURE__ */ jsxs7("span", { className: "block break-words text-xs " + (mount.resource.kind === "github" && !mount.resource.repository ? "text-destructive" : "text-muted-foreground"), children: [
2369
2390
  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,
2370
2391
  mount.executable ? " \xB7 executable" : ""
2371
2392
  ] })
2372
2393
  ] }),
2373
- /* @__PURE__ */ jsxs6("div", { className: "flex shrink-0 gap-1", children: [
2374
- /* @__PURE__ */ jsx8(
2394
+ /* @__PURE__ */ jsxs7("div", { className: "flex shrink-0 gap-1", children: [
2395
+ /* @__PURE__ */ jsx9(
2375
2396
  Button2,
2376
2397
  {
2377
2398
  type: "button",
@@ -2382,7 +2403,7 @@ function AgentProfileEditor({
2382
2403
  children: "Edit"
2383
2404
  }
2384
2405
  ),
2385
- /* @__PURE__ */ jsx8(
2406
+ /* @__PURE__ */ jsx9(
2386
2407
  Button2,
2387
2408
  {
2388
2409
  type: "button",
@@ -2398,15 +2419,15 @@ function AgentProfileEditor({
2398
2419
  )
2399
2420
  ] })
2400
2421
  ] }),
2401
- issues.length > 0 && /* @__PURE__ */ jsx8("div", { className: "space-y-1 text-xs text-destructive", children: issues.map((issue) => /* @__PURE__ */ jsxs6("p", { children: [
2422
+ issues.length > 0 && /* @__PURE__ */ jsx9("div", { className: "space-y-1 text-xs text-destructive", children: issues.map((issue) => /* @__PURE__ */ jsxs7("p", { children: [
2402
2423
  issue,
2403
2424
  " Edit this file before saving."
2404
2425
  ] }, issue)) }),
2405
- 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)" }),
2406
- fileEdit?.index === index && /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-3", children: [
2426
+ mount.resource.kind === "inline" && fileEdit?.index !== index && /* @__PURE__ */ jsx9("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)" }),
2427
+ fileEdit?.index === index && /* @__PURE__ */ jsxs7("div", { className: "space-y-3 border-t border-border pt-3", children: [
2407
2428
  fileFields(fileEdit.draft, (draft) => setFileEdit({ index, draft })),
2408
- /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2409
- /* @__PURE__ */ jsx8(
2429
+ /* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
2430
+ /* @__PURE__ */ jsx9(
2410
2431
  Button2,
2411
2432
  {
2412
2433
  type: "button",
@@ -2418,15 +2439,15 @@ function AgentProfileEditor({
2418
2439
  children: "Apply changes"
2419
2440
  }
2420
2441
  ),
2421
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setFileEdit(null), children: "Cancel" })
2442
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", onClick: () => setFileEdit(null), children: "Cancel" })
2422
2443
  ] })
2423
2444
  ] })
2424
2445
  ] }, index);
2425
2446
  }) }),
2426
- addingFile ? /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-4", children: [
2447
+ addingFile ? /* @__PURE__ */ jsxs7("div", { className: "space-y-3 border-t border-border pt-4", children: [
2427
2448
  fileFields(newFile, setNewFile),
2428
- /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2429
- /* @__PURE__ */ jsx8(
2449
+ /* @__PURE__ */ jsxs7("div", { className: "flex gap-2", children: [
2450
+ /* @__PURE__ */ jsx9(
2430
2451
  Button2,
2431
2452
  {
2432
2453
  type: "button",
@@ -2441,31 +2462,34 @@ function AgentProfileEditor({
2441
2462
  children: "Add file"
2442
2463
  }
2443
2464
  ),
2444
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", onClick: () => setAddingFile(false), children: "Cancel" })
2465
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", onClick: () => setAddingFile(false), children: "Cancel" })
2445
2466
  ] })
2446
- ] }) : /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => setAddingFile(true), children: "Add file" })
2467
+ ] }) : /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => setAddingFile(true), children: "Add file" })
2447
2468
  ] }),
2448
- /* @__PURE__ */ jsxs6(Disclosure, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
2449
- /* @__PURE__ */ jsx8("label", { htmlFor: id + "-json", className: "sr-only", children: "Full profile JSON" }),
2450
- /* @__PURE__ */ jsx8(Textarea, { id: id + "-json", className: "min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
2469
+ /* @__PURE__ */ jsxs7(Disclosure, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
2470
+ /* @__PURE__ */ jsx9("label", { htmlFor: id + "-json", className: "sr-only", children: "Full profile JSON" }),
2471
+ /* @__PURE__ */ jsx9(Textarea, { id: id + "-json", className: "min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
2451
2472
  setJson(event.target.value);
2452
2473
  setJsonDirty(true);
2453
2474
  } }),
2454
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-3", children: [
2455
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
2456
- jsonDirty && /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled, onClick: () => {
2475
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-3", children: [
2476
+ /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "outline", disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
2477
+ jsonDirty && /* @__PURE__ */ jsx9(Button2, { type: "button", variant: "ghost", className: "text-destructive", disabled, onClick: () => {
2457
2478
  setJson(JSON.stringify(value, null, 2));
2458
2479
  setJsonDirty(false);
2459
2480
  setError(null);
2460
2481
  }, children: "Discard JSON edits" })
2461
2482
  ] }),
2462
- /* @__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." })
2483
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-muted-foreground", children: "Profiles are public configuration. Store credentials in a vault and reference them by secret key." })
2463
2484
  ] })
2464
2485
  ] });
2465
2486
  }
2466
2487
 
2467
2488
  // src/web-react/agent-profile-viewer.tsx
2468
- import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2489
+ import { useState as useState9 } from "react";
2490
+ import { Button as Button3, CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/sandbox-ui/primitives";
2491
+ import { CopyButton } from "@tangle-network/sandbox-ui/markdown";
2492
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
2469
2493
  function nonempty(value) {
2470
2494
  return Boolean(value?.trim());
2471
2495
  }
@@ -2475,45 +2499,43 @@ function resourceName(resource) {
2475
2499
  }
2476
2500
  function ResourceRow({ label, resource, path }) {
2477
2501
  const name = resourceName(resource);
2478
- return /* @__PURE__ */ jsxs7("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
2479
- /* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
2480
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm font-medium text-muted-foreground", children: label }),
2481
- path && /* @__PURE__ */ jsx9("code", { className: "break-all font-mono text-sm text-foreground", children: path }),
2482
- /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
2483
- resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-sm text-muted-foreground", children: [
2502
+ return /* @__PURE__ */ jsxs8("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
2503
+ /* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
2504
+ /* @__PURE__ */ jsx10("span", { className: "shrink-0 text-sm font-medium text-muted-foreground", children: label }),
2505
+ path && /* @__PURE__ */ jsx10("code", { className: "break-all font-mono text-sm text-foreground", children: path }),
2506
+ /* @__PURE__ */ jsx10("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
2507
+ resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs8("span", { className: "shrink-0 text-sm text-muted-foreground", children: [
2484
2508
  "at ",
2485
2509
  resource.ref
2486
2510
  ] })
2487
2511
  ] }),
2488
- resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs7("details", { className: "mt-1.5", children: [
2489
- /* @__PURE__ */ jsx9("summary", { className: "w-fit cursor-pointer select-none text-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2490
- /* @__PURE__ */ jsx9("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: resource.content })
2512
+ resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs8("details", { className: "mt-1.5", children: [
2513
+ /* @__PURE__ */ jsx10("summary", { className: "w-fit cursor-pointer select-none text-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2514
+ /* @__PURE__ */ jsx10("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: resource.content })
2491
2515
  ] })
2492
2516
  ] });
2493
2517
  }
2494
- function PromptDetail({ label, note, value }) {
2495
- return /* @__PURE__ */ jsxs7("div", { className: "min-w-0 space-y-2", children: [
2496
- label && /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
2497
- /* @__PURE__ */ jsx9("h4", { className: "font-medium text-foreground", children: label }),
2498
- note && /* @__PURE__ */ jsx9("span", { className: "text-sm text-muted-foreground", children: note })
2518
+ function PromptDetail({ label, path, note, value }) {
2519
+ return /* @__PURE__ */ jsxs8("div", { className: "min-w-0 space-y-3", children: [
2520
+ /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
2521
+ /* @__PURE__ */ jsx10("h4", { className: "text-sm font-semibold text-foreground", children: label }),
2522
+ /* @__PURE__ */ jsx10("code", { className: "block break-all font-mono text-xs text-primary", children: path }),
2523
+ /* @__PURE__ */ jsx10("p", { className: "text-sm leading-6 text-muted-foreground", children: note })
2499
2524
  ] }),
2500
- /* @__PURE__ */ jsx9("div", { className: "whitespace-pre-wrap break-words text-sm leading-7 text-foreground", children: value })
2525
+ /* @__PURE__ */ jsx10("div", { className: "whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/35 p-4 text-sm leading-7 text-foreground", children: value })
2501
2526
  ] });
2502
2527
  }
2503
2528
  function ProfileSection({ title, children }) {
2504
- return /* @__PURE__ */ jsxs7("section", { className: "grid min-w-0 gap-3 border-t border-border py-6 first:border-t-0 first:pt-0 sm:grid-cols-[9rem_minmax(0,1fr)] sm:gap-6", "aria-label": title, children: [
2505
- /* @__PURE__ */ jsx9("h3", { className: "text-sm font-medium text-muted-foreground", children: title }),
2506
- /* @__PURE__ */ jsx9("div", { className: "min-w-0", children })
2507
- ] });
2529
+ return /* @__PURE__ */ jsx10(ProfileCard, { title, children });
2508
2530
  }
2509
2531
  function ProfileConfiguration({ expanded, children }) {
2510
- if (expanded) return /* @__PURE__ */ jsx9("div", { children });
2511
- return /* @__PURE__ */ jsxs7("details", { className: "group/config border-t border-border pt-4", children: [
2512
- /* @__PURE__ */ jsxs7("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 rounded-sm py-2 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2532
+ if (expanded) return /* @__PURE__ */ jsx10("div", { className: "space-y-4", children });
2533
+ return /* @__PURE__ */ jsxs8("details", { className: "group/config border-t border-border pt-4", children: [
2534
+ /* @__PURE__ */ jsxs8("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 rounded-sm py-2 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2513
2535
  "Profile configuration ",
2514
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "text-muted-foreground group-open/config:rotate-90", children: "\u203A" })
2536
+ /* @__PURE__ */ jsx10("span", { "aria-hidden": "true", className: "text-muted-foreground group-open/config:rotate-90", children: "\u203A" })
2515
2537
  ] }),
2516
- /* @__PURE__ */ jsx9("div", { className: "pt-4", children })
2538
+ /* @__PURE__ */ jsx10("div", { className: "space-y-4 pt-4", children })
2517
2539
  ] });
2518
2540
  }
2519
2541
  function permissionRows(profile) {
@@ -2554,7 +2576,7 @@ function configuredResources(profile) {
2554
2576
  }))
2555
2577
  ];
2556
2578
  }
2557
- function AgentProfileViewer({ profile, className = "", defaultExpanded = true, showIdentity = true }) {
2579
+ function ProfileOverview({ profile, defaultExpanded = true, showIdentity = true }) {
2558
2580
  const permissions = permissionRows(profile);
2559
2581
  const resources = configuredResources(profile);
2560
2582
  const prompt = profile.prompt;
@@ -2565,88 +2587,141 @@ function AgentProfileViewer({ profile, className = "", defaultExpanded = true, s
2565
2587
  const hasBehavior = Boolean(nonempty(prompt?.systemPrompt) || nonempty(prompt?.appendSystemPrompt) || instructions.length || (typeof resourceInstructions === "string" ? nonempty(resourceInstructions) : resourceInstructions));
2566
2588
  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);
2567
2589
  const hasProfileDetails = Boolean(profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.model?.provider || profile.harness || profile.description || profile.version || profile.tags?.length || hasConfiguration);
2568
- return /* @__PURE__ */ jsxs7("section", { className: `min-w-0 text-sm text-foreground ${className}`.trim(), "aria-label": "Agent profile", children: [
2569
- (showIdentity || nonempty(profile.description)) && /* @__PURE__ */ jsxs7("header", { className: "mb-6 min-w-0", children: [
2570
- showIdentity && /* @__PURE__ */ jsx9("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2571
- nonempty(profile.description) && /* @__PURE__ */ jsx9("p", { className: "mt-2 whitespace-pre-wrap break-words leading-6 text-muted-foreground", children: profile.description })
2590
+ return /* @__PURE__ */ jsxs8("div", { className: "min-w-0 text-sm text-foreground", children: [
2591
+ (showIdentity || nonempty(profile.description)) && /* @__PURE__ */ jsxs8("header", { className: "mb-6 min-w-0", children: [
2592
+ showIdentity && /* @__PURE__ */ jsx10("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2593
+ nonempty(profile.description) && /* @__PURE__ */ jsx10("p", { className: "mt-2 whitespace-pre-wrap break-words leading-6 text-muted-foreground", children: profile.description })
2572
2594
  ] }),
2573
- !hasProfileDetails && /* @__PURE__ */ jsx9("p", { className: "text-muted-foreground", children: "No profile details are configured." }),
2574
- (hasConfiguration || profile.model || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs7(ProfileConfiguration, { expanded: defaultExpanded, children: [
2575
- hasBehavior && /* @__PURE__ */ jsx9(ProfileSection, { title: "Instructions", children: /* @__PURE__ */ jsxs7("div", { className: "space-y-6", children: [
2576
- nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx9(PromptDetail, { label: nonempty(prompt.appendSystemPrompt) || instructions.length ? "System instructions" : void 0, note: "Replaces default instructions", value: prompt.systemPrompt }),
2577
- nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx9(
2595
+ !hasProfileDetails && /* @__PURE__ */ jsx10("p", { className: "text-muted-foreground", children: "No profile details are configured." }),
2596
+ (hasConfiguration || profile.model || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs8(ProfileConfiguration, { expanded: defaultExpanded, children: [
2597
+ hasBehavior && /* @__PURE__ */ jsx10(ProfileSection, { title: "Prompts and instructions", children: /* @__PURE__ */ jsxs8("div", { className: "space-y-6", children: [
2598
+ !nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
2599
+ /* @__PURE__ */ jsx10("h4", { className: "text-sm font-semibold", children: "System prompt" }),
2600
+ /* @__PURE__ */ jsx10("code", { className: "block font-mono text-xs text-primary", children: "prompt.systemPrompt" }),
2601
+ /* @__PURE__ */ jsx10("p", { className: "text-sm leading-6 text-muted-foreground", children: "No override configured. The runtime supplies its default system prompt." })
2602
+ ] }),
2603
+ nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx10(PromptDetail, { label: "System prompt", path: "prompt.systemPrompt", note: "The profile\u2019s system prompt override. Replaces the harness default where supported.", value: prompt.systemPrompt }),
2604
+ nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx10(
2578
2605
  PromptDetail,
2579
2606
  {
2580
- label: "Added system prompt",
2581
- note: nonempty(prompt.systemPrompt) ? "Supplements the system prompt above" : "Supplements the harness default",
2607
+ label: "Appended system prompt",
2608
+ path: "prompt.appendSystemPrompt",
2609
+ note: "Appended after the system prompt, or after the harness default when no override is set.",
2582
2610
  value: prompt.appendSystemPrompt
2583
2611
  }
2584
2612
  ),
2585
- instructions.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2586
- /* @__PURE__ */ jsxs7("h4", { className: "font-medium text-foreground", children: [
2587
- "Project instructions ",
2588
- /* @__PURE__ */ jsx9("span", { className: "ml-1 font-normal text-sm text-muted-foreground", children: "Lower-privilege workspace guidance" })
2589
- ] }),
2590
- /* @__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}`)) })
2613
+ instructions.length > 0 && /* @__PURE__ */ jsxs8("div", { className: "space-y-1.5", children: [
2614
+ /* @__PURE__ */ jsx10("h4", { className: "text-sm font-semibold text-foreground", children: "Project instructions" }),
2615
+ /* @__PURE__ */ jsx10("code", { className: "block break-all font-mono text-xs text-primary", children: "prompt.instructions" }),
2616
+ /* @__PURE__ */ jsx10("p", { className: "pb-2 text-sm leading-6 text-muted-foreground", children: "Lower-priority workspace guidance. These entries are separate from the system prompt." }),
2617
+ /* @__PURE__ */ jsx10("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx10("li", { children: /* @__PURE__ */ jsx10("div", { className: "whitespace-pre-wrap break-words rounded-lg border border-border bg-muted/35 p-4 text-sm leading-7", children: instruction }) }, `${index}:${instruction}`)) })
2591
2618
  ] }),
2592
- typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx9(PromptDetail, { label: "Resource instructions", note: "Configured in resources", value: resourceInstructions }),
2593
- resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx9("ul", { children: /* @__PURE__ */ jsx9(ResourceRow, { label: "Instruction resource", resource: resourceInstructions }) })
2619
+ typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx10(PromptDetail, { label: "Resource instructions", path: "resources.instructions", note: "Instructions declared with workspace resources. Their loading is controlled by the runtime.", value: resourceInstructions }),
2620
+ resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx10("ul", { children: /* @__PURE__ */ jsx10(ResourceRow, { label: "resources.instructions", resource: resourceInstructions }) })
2594
2621
  ] }) }),
2595
- (profile.model?.default || profile.model?.small || profile.model?.provider || profile.model?.reasoningEffort || profile.harness) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Model and runtime", children: /* @__PURE__ */ jsx9("dl", { className: "grid gap-x-6 gap-y-4 sm:grid-cols-2", children: [
2622
+ (profile.model?.default || profile.model?.small || profile.model?.provider || profile.model?.reasoningEffort || profile.harness) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Model and runtime", children: /* @__PURE__ */ jsx10("dl", { className: "grid gap-x-6 gap-y-4 sm:grid-cols-2", children: [
2596
2623
  ["Default model", profile.model?.default],
2597
2624
  ["Provider", profile.model?.provider],
2598
2625
  ["Preferred harness", profile.harness],
2599
2626
  ["Reasoning", profile.model?.reasoningEffort],
2600
2627
  ["Small model", profile.model?.small]
2601
- ].filter(([, value]) => value).map(([label, value]) => /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2602
- /* @__PURE__ */ jsx9("dt", { className: "mb-1 text-sm text-muted-foreground", children: label }),
2603
- /* @__PURE__ */ jsx9("dd", { className: "break-words font-medium", children: value })
2628
+ ].filter(([, value]) => value).map(([label, value]) => /* @__PURE__ */ jsxs8("div", { className: "min-w-0", children: [
2629
+ /* @__PURE__ */ jsx10("dt", { className: "mb-1 text-sm text-muted-foreground", children: label }),
2630
+ /* @__PURE__ */ jsx10("dd", { className: "break-words font-medium", children: value })
2604
2631
  ] }, label)) }) }),
2605
- (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Tools and permissions", 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) => {
2632
+ (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Tools and permissions", children: /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
2606
2633
  const enabled = tools.find(([tool]) => tool === name)?.[1];
2607
2634
  const policy = permissions.find(([permission]) => permission === name)?.[1];
2608
- 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: [
2609
- /* @__PURE__ */ jsx9("code", { className: "min-w-0 break-all font-mono text-sm text-foreground", children: name }),
2610
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2635
+ return /* @__PURE__ */ jsxs8("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2636
+ /* @__PURE__ */ jsx10("code", { className: "min-w-0 break-all font-mono text-sm text-foreground", children: name }),
2637
+ /* @__PURE__ */ jsx10("span", { className: "shrink-0 text-sm text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2611
2638
  ] }, name);
2612
2639
  }) }) }) }),
2613
- 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: [
2614
- /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2615
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2640
+ mcp.length > 0 && /* @__PURE__ */ jsx10(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx10("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs8("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2641
+ /* @__PURE__ */ jsx10("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2642
+ /* @__PURE__ */ jsx10("span", { className: "shrink-0 text-sm text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2616
2643
  ] }, name)) }) }),
2617
- 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: [
2618
- /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2619
- 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-sm text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2644
+ Boolean(profile.connections?.length) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx10("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs8("li", { className: "min-w-0", children: [
2645
+ /* @__PURE__ */ jsx10("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2646
+ connection.capabilities.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx10("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2620
2647
  ] }, `${connection.alias ?? "connection"}:${index}`)) }) }),
2621
- (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs7(ProfileSection, { title: "Declared resources", children: [
2622
- /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx9(ResourceRow, { ...item }, key)) }),
2623
- profile.resources?.failOnError && /* @__PURE__ */ jsx9("p", { className: "mt-2 text-sm text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2648
+ (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs8(ProfileSection, { title: "Declared resources", children: [
2649
+ /* @__PURE__ */ jsx10("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx10(ResourceRow, { ...item }, key)) }),
2650
+ profile.resources?.failOnError && /* @__PURE__ */ jsx10("p", { className: "mt-2 text-sm text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2624
2651
  ] }),
2625
- 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: [
2626
- /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: name }),
2627
- nonempty(subagent.description) && /* @__PURE__ */ jsx9("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground", children: subagent.description })
2652
+ Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx10("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs8("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
2653
+ /* @__PURE__ */ jsx10("p", { className: "font-medium text-foreground", children: name }),
2654
+ nonempty(subagent.description) && /* @__PURE__ */ jsx10("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground", children: subagent.description })
2628
2655
  ] }, name)) }) }),
2629
- 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: [
2630
- /* @__PURE__ */ jsx9("code", { className: "font-mono text-sm text-foreground", children: event }),
2631
- /* @__PURE__ */ jsxs7("span", { className: "text-sm text-muted-foreground", children: [
2656
+ Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx10("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs8("li", { className: "flex min-w-0 justify-between gap-4", children: [
2657
+ /* @__PURE__ */ jsx10("code", { className: "font-mono text-sm text-foreground", children: event }),
2658
+ /* @__PURE__ */ jsxs8("span", { className: "text-sm text-muted-foreground", children: [
2632
2659
  commands.length,
2633
2660
  " configured"
2634
2661
  ] })
2635
2662
  ] }, event)) }) }),
2636
- 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-sm text-muted-foreground", children: mode }, mode)) }) }),
2637
- (profile.version || profile.tags?.length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Metadata", children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-muted-foreground", children: [
2638
- profile.version && /* @__PURE__ */ jsxs7("span", { children: [
2663
+ Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx10("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx10("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: mode }, mode)) }) }),
2664
+ (profile.version || profile.tags?.length) && /* @__PURE__ */ jsx10(ProfileSection, { title: "Metadata", children: /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-muted-foreground", children: [
2665
+ profile.version && /* @__PURE__ */ jsxs8("span", { children: [
2639
2666
  "Version ",
2640
2667
  profile.version
2641
2668
  ] }),
2642
- profile.tags?.map((tag) => /* @__PURE__ */ jsx9("span", { children: tag }, tag))
2669
+ profile.tags?.map((tag) => /* @__PURE__ */ jsx10("span", { children: tag }, tag))
2643
2670
  ] }) })
2644
2671
  ] })
2645
2672
  ] });
2646
2673
  }
2674
+ function JsonValue({ value, name }) {
2675
+ if (value !== null && typeof value === "object") {
2676
+ const entries = Object.entries(value);
2677
+ return /* @__PURE__ */ jsx10("li", { className: "min-w-0 list-none", children: /* @__PURE__ */ jsxs8("details", { open: true, children: [
2678
+ /* @__PURE__ */ jsxs8("summary", { className: "cursor-pointer break-all rounded px-2 py-2 font-mono text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
2679
+ /* @__PURE__ */ jsx10("span", { className: "font-medium text-primary", children: name }),
2680
+ /* @__PURE__ */ jsx10("span", { className: "ml-2 text-xs text-muted-foreground", children: Array.isArray(value) ? `Array \xB7 ${entries.length}` : `Object \xB7 ${entries.length}` })
2681
+ ] }),
2682
+ /* @__PURE__ */ jsxs8("ul", { className: "ml-3 min-w-0 border-l border-border pl-3", children: [
2683
+ entries.map(([key, child]) => /* @__PURE__ */ jsx10(JsonValue, { name: key, value: child }, key)),
2684
+ entries.length === 0 && /* @__PURE__ */ jsx10("li", { className: "block px-2 py-1 font-mono text-sm text-muted-foreground", children: Array.isArray(value) ? "[]" : "{}" })
2685
+ ] })
2686
+ ] }) });
2687
+ }
2688
+ return /* @__PURE__ */ jsxs8("li", { className: "min-w-0 list-none px-2 py-2", children: [
2689
+ /* @__PURE__ */ jsxs8("span", { className: "block break-all font-mono text-xs font-medium text-primary", children: [
2690
+ name,
2691
+ /* @__PURE__ */ jsx10("span", { className: "ml-2 font-normal text-muted-foreground", children: value === null ? "null" : typeof value })
2692
+ ] }),
2693
+ /* @__PURE__ */ jsx10("span", { className: "mt-1 block whitespace-pre-wrap break-words font-mono text-sm leading-6 text-foreground", children: typeof value === "string" ? value || '""' : JSON.stringify(value) })
2694
+ ] });
2695
+ }
2696
+ function AgentProfileViewer({ profile, className = "", showFullProfile = false, ...overview }) {
2697
+ const [view, setView] = useState9("overview");
2698
+ const json = showFullProfile ? JSON.stringify(profile, null, 2) : "";
2699
+ return /* @__PURE__ */ jsx10("section", { className: `min-w-0 text-sm text-foreground ${className}`.trim(), "aria-label": "Agent profile", children: showFullProfile ? /* @__PURE__ */ jsxs8(Tabs, { value: view, onValueChange: setView, children: [
2700
+ /* @__PURE__ */ jsxs8("div", { className: "mb-4 flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card p-2", children: [
2701
+ /* @__PURE__ */ jsxs8(TabsList, { "aria-label": "Profile view", className: "h-auto flex-wrap justify-start", children: [
2702
+ /* @__PURE__ */ jsx10(TabsTrigger, { value: "overview", children: "Overview" }),
2703
+ /* @__PURE__ */ jsx10(TabsTrigger, { value: "json", children: "JSON tree" }),
2704
+ /* @__PURE__ */ jsx10(TabsTrigger, { value: "raw", children: "Raw" })
2705
+ ] }),
2706
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
2707
+ /* @__PURE__ */ jsx10(CopyButton, { text: json }),
2708
+ /* @__PURE__ */ jsx10(Button3, { asChild: true, variant: "outline", size: "sm", children: /* @__PURE__ */ jsx10("a", { href: `data:application/json;charset=utf-8,${encodeURIComponent(json)}`, download: "agent-profile.json", children: "Download" }) })
2709
+ ] })
2710
+ ] }),
2711
+ /* @__PURE__ */ jsx10(TabsContent, { value: "overview", className: "mt-0", children: /* @__PURE__ */ jsx10(ProfileOverview, { profile, ...overview }) }),
2712
+ /* @__PURE__ */ jsx10(TabsContent, { value: "json", className: "mt-0", children: /* @__PURE__ */ jsxs8("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: [
2713
+ /* @__PURE__ */ jsxs8("div", { className: "border-b border-border bg-muted/35 p-4", children: [
2714
+ /* @__PURE__ */ jsx10(ProfileSectionHeading, { title: "Full profile JSON" }),
2715
+ /* @__PURE__ */ jsx10("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: "Every configured field, including extensions. Expand or collapse any object." })
2716
+ ] }),
2717
+ /* @__PURE__ */ jsx10("ul", { className: "min-w-0 p-2 sm:p-4", children: Object.entries(profile).map(([key, value]) => /* @__PURE__ */ jsx10(JsonValue, { name: key, value }, key)) })
2718
+ ] }) }),
2719
+ /* @__PURE__ */ jsx10(TabsContent, { value: "raw", className: "min-w-0 mt-0", children: /* @__PURE__ */ jsx10(CodeBlock, { code: json, language: "json", label: "agent-profile.json", showLineNumbers: true, className: "max-w-full" }) })
2720
+ ] }) : /* @__PURE__ */ jsx10(ProfileOverview, { profile, ...overview }) });
2721
+ }
2647
2722
 
2648
2723
  // src/web-react/durable-plan-flow.ts
2649
- import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef6, useState as useState9 } from "react";
2724
+ import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef6, useState as useState10 } from "react";
2650
2725
  var DurablePlanClientError = class extends Error {
2651
2726
  constructor(message, status, code, currentPlan) {
2652
2727
  super(message);
@@ -2733,10 +2808,10 @@ function createDurablePlanDecisionClient(options) {
2733
2808
  };
2734
2809
  }
2735
2810
  function useDurablePlanFlow(options) {
2736
- const [plan, setPlan] = useState9(options.plan);
2737
- const [deciding, setDeciding] = useState9(null);
2738
- const [restoring, setRestoring] = useState9(false);
2739
- const [error, setError] = useState9(null);
2811
+ const [plan, setPlan] = useState10(options.plan);
2812
+ const [deciding, setDeciding] = useState10(null);
2813
+ const [restoring, setRestoring] = useState10(false);
2814
+ const [error, setError] = useState10(null);
2740
2815
  const attachments = useRef6(/* @__PURE__ */ new Map());
2741
2816
  const decisionInFlight = useRef6(false);
2742
2817
  useEffect6(() => setPlan(options.plan), [options.plan]);
@@ -2908,7 +2983,7 @@ function createDurableInteractionAnswerSubmitter(options) {
2908
2983
  }
2909
2984
 
2910
2985
  // src/web-react/use-chat-interactions.ts
2911
- import { useCallback as useCallback3, useMemo as useMemo3, useState as useState10 } from "react";
2986
+ import { useCallback as useCallback3, useMemo as useMemo3, useState as useState11 } from "react";
2912
2987
  function hasPendingContentDuplicate(list, interaction) {
2913
2988
  if (interaction.status !== "pending") return false;
2914
2989
  const signature = questionInteractionContentSignature(interaction);
@@ -2987,7 +3062,7 @@ function hydrateChatInteractions(list, persisted) {
2987
3062
  return persisted.reduce(upsertChatInteraction, list);
2988
3063
  }
2989
3064
  function useChatInteractions(options = {}) {
2990
- const [interactions, setInteractions] = useState10([]);
3065
+ const [interactions, setInteractions] = useState11([]);
2991
3066
  const upsert = useCallback3((interaction) => {
2992
3067
  setInteractions((prev) => upsertChatInteraction(prev, interaction));
2993
3068
  }, []);
@@ -3014,7 +3089,7 @@ function useChatInteractions(options = {}) {
3014
3089
  }
3015
3090
 
3016
3091
  // src/web-react/use-file-mentions.ts
3017
- import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef7, useState as useState11 } from "react";
3092
+ import { useCallback as useCallback4, useMemo as useMemo4, useRef as useRef7, useState as useState12 } from "react";
3018
3093
  var FILE_MENTION_KIND = "file";
3019
3094
  function toMentionItem(file) {
3020
3095
  return { id: file.path, label: file.name, detail: file.path, kind: FILE_MENTION_KIND };
@@ -3072,11 +3147,11 @@ function useFileMentions(options) {
3072
3147
  emptyText = DEFAULT_MENTION_EMPTY_TEXT
3073
3148
  } = options;
3074
3149
  const fetchImpl = options.fetchImpl ?? fetch;
3075
- const [state, setState] = useState11({ kind: "idle" });
3150
+ const [state, setState] = useState12({ kind: "idle" });
3076
3151
  const stateRef = useRef7(state);
3077
3152
  stateRef.current = state;
3078
3153
  const inFlightRef = useRef7(null);
3079
- const [mentions, setMentions] = useState11([]);
3154
+ const [mentions, setMentions] = useState12([]);
3080
3155
  const load = useCallback4(() => {
3081
3156
  if (inFlightRef.current) return inFlightRef.current;
3082
3157
  if (stateRef.current.kind === "idle") {
@@ -3183,8 +3258,8 @@ function segmentMentionContent(content, parts) {
3183
3258
  }
3184
3259
 
3185
3260
  // src/web-react/mission-activity.tsx
3186
- import { useCallback as useCallback5, useEffect as useEffect7, useState as useState12 } from "react";
3187
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
3261
+ import { useCallback as useCallback5, useEffect as useEffect7, useState as useState13 } from "react";
3262
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3188
3263
  var LIVE_STATUSES = /* @__PURE__ */ new Set(["pending", "running"]);
3189
3264
  var OK_STATUSES = /* @__PURE__ */ new Set(["completed", "done", "succeeded"]);
3190
3265
  var ERROR_STATUSES = /* @__PURE__ */ new Set(["failed", "error", "cancelled", "aborted"]);
@@ -3231,19 +3306,19 @@ function waterfallLayout(trace) {
3231
3306
  });
3232
3307
  }
3233
3308
  function ChevronGlyph({ className }) {
3234
- 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" }) });
3309
+ return /* @__PURE__ */ jsx11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx11("path", { d: "m6 9 6 6 6-6" }) });
3235
3310
  }
3236
3311
  function RefreshGlyph({ className }) {
3237
- 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" }) });
3312
+ return /* @__PURE__ */ jsx11("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx11("path", { d: "M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6" }) });
3238
3313
  }
3239
3314
  function CopyGlyph({ className }) {
3240
- return /* @__PURE__ */ jsxs8("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
3241
- /* @__PURE__ */ jsx10("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
3242
- /* @__PURE__ */ jsx10("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
3315
+ return /* @__PURE__ */ jsxs9("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
3316
+ /* @__PURE__ */ jsx11("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
3317
+ /* @__PURE__ */ jsx11("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
3243
3318
  ] });
3244
3319
  }
3245
3320
  function TraceIdCopy({ traceId }) {
3246
- const [copied, setCopied] = useState12(false);
3321
+ const [copied, setCopied] = useState13(false);
3247
3322
  const copy = useCallback5(() => {
3248
3323
  void navigator.clipboard?.writeText(traceId).then(
3249
3324
  () => {
@@ -3254,7 +3329,7 @@ function TraceIdCopy({ traceId }) {
3254
3329
  }
3255
3330
  );
3256
3331
  }, [traceId]);
3257
- return /* @__PURE__ */ jsxs8(
3332
+ return /* @__PURE__ */ jsxs9(
3258
3333
  "button",
3259
3334
  {
3260
3335
  type: "button",
@@ -3263,29 +3338,29 @@ function TraceIdCopy({ traceId }) {
3263
3338
  "aria-label": "Copy trace id",
3264
3339
  className: "inline-flex min-w-0 items-center gap-1.5 rounded text-left font-mono text-muted-foreground transition hover:text-foreground",
3265
3340
  children: [
3266
- /* @__PURE__ */ jsx10("span", { className: "truncate", children: traceId }),
3267
- /* @__PURE__ */ jsx10(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
3268
- copied && /* @__PURE__ */ jsx10("span", { className: "shrink-0 not-italic text-success", children: "copied" })
3341
+ /* @__PURE__ */ jsx11("span", { className: "truncate", children: traceId }),
3342
+ /* @__PURE__ */ jsx11(CopyGlyph, { className: "h-3 w-3 shrink-0" }),
3343
+ copied && /* @__PURE__ */ jsx11("span", { className: "shrink-0 not-italic text-success", children: "copied" })
3269
3344
  ]
3270
3345
  }
3271
3346
  );
3272
3347
  }
3273
3348
  function StatusDot({ tone }) {
3274
- return /* @__PURE__ */ jsxs8("span", { className: "inline-flex items-center", children: [
3275
- /* @__PURE__ */ jsx10(
3349
+ return /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center", children: [
3350
+ /* @__PURE__ */ jsx11(
3276
3351
  "span",
3277
3352
  {
3278
3353
  "aria-hidden": true,
3279
3354
  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"}`
3280
3355
  }
3281
3356
  ),
3282
- /* @__PURE__ */ jsx10("span", { className: "sr-only", children: tone })
3357
+ /* @__PURE__ */ jsx11("span", { className: "sr-only", children: tone })
3283
3358
  ] });
3284
3359
  }
3285
3360
  function RunLabel({ tool, detail, live }) {
3286
- return /* @__PURE__ */ jsxs8("span", { className: "min-w-0 flex-1 truncate", children: [
3287
- /* @__PURE__ */ jsx10("span", { className: live ? "agent-shimmer font-medium" : "font-medium", "data-motion": live ? "essential" : void 0, children: tool }),
3288
- /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground", children: [
3361
+ return /* @__PURE__ */ jsxs9("span", { className: "min-w-0 flex-1 truncate", children: [
3362
+ /* @__PURE__ */ jsx11("span", { className: live ? "agent-shimmer font-medium" : "font-medium", "data-motion": live ? "essential" : void 0, children: tool }),
3363
+ /* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground", children: [
3289
3364
  " \u2014 ",
3290
3365
  detail
3291
3366
  ] })
@@ -3300,19 +3375,19 @@ function FlowWaterfall({ trace }) {
3300
3375
  const rows = waterfallLayout(trace);
3301
3376
  if (rows.length === 0) return null;
3302
3377
  const cost = formatActivityCost(trace.costUsd);
3303
- return /* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
3304
- rows.map((row, i) => /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-center gap-2", children: [
3305
- /* @__PURE__ */ jsx10("span", { className: "truncate font-mono text-xs text-muted-foreground", title: row.name, children: row.name }),
3306
- /* @__PURE__ */ jsx10("div", { className: "relative h-2 rounded-sm bg-secondary", children: /* @__PURE__ */ jsx10(
3378
+ return /* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
3379
+ rows.map((row, i) => /* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-[minmax(0,2fr)_minmax(0,3fr)_auto] items-center gap-2", children: [
3380
+ /* @__PURE__ */ jsx11("span", { className: "truncate font-mono text-xs text-muted-foreground", title: row.name, children: row.name }),
3381
+ /* @__PURE__ */ jsx11("div", { className: "relative h-2 rounded-sm bg-secondary", children: /* @__PURE__ */ jsx11(
3307
3382
  "div",
3308
3383
  {
3309
3384
  className: `absolute inset-y-0 rounded-sm ${row.ok ? BAR_CLASS[row.kind] : "bg-destructive/80"} ${row.approx ? "opacity-70" : ""}`,
3310
3385
  style: { left: `${row.offsetPct}%`, width: `${row.widthPct}%` }
3311
3386
  }
3312
3387
  ) }),
3313
- /* @__PURE__ */ jsx10("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground/70", children: row.durationLabel })
3388
+ /* @__PURE__ */ jsx11("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground/70", children: row.durationLabel })
3314
3389
  ] }, i)),
3315
- /* @__PURE__ */ jsxs8("p", { className: "pt-0.5 text-right font-mono text-xs tabular-nums text-muted-foreground/60", children: [
3390
+ /* @__PURE__ */ jsxs9("p", { className: "pt-0.5 text-right font-mono text-xs tabular-nums text-muted-foreground/60", children: [
3316
3391
  (trace.totalMs / 1e3).toFixed(1),
3317
3392
  "s",
3318
3393
  cost ? ` \xB7 ${cost}` : ""
@@ -3324,35 +3399,35 @@ function LaneRow({ run, staggerIndex }) {
3324
3399
  const tone = activityTone(run.status);
3325
3400
  const cost = formatActivityCost(run.costUsd);
3326
3401
  const duration = formatActivityDuration(run.durationMs);
3327
- return /* @__PURE__ */ jsxs8("div", { className: "agent-arrive flex items-center gap-2 py-1 text-xs", style: arrival, children: [
3328
- /* @__PURE__ */ jsx10(StatusDot, { tone }),
3329
- /* @__PURE__ */ jsx10(RunLabel, { tool: run.tool, detail: run.detail, live: tone === "live" }),
3330
- 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 ") }),
3331
- /* @__PURE__ */ jsxs8("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-xs tabular-nums text-muted-foreground/70", children: [
3332
- tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx10("span", { children: run.status }),
3333
- cost && /* @__PURE__ */ jsx10("span", { children: cost }),
3334
- duration && /* @__PURE__ */ jsx10("span", { children: duration })
3402
+ return /* @__PURE__ */ jsxs9("div", { className: "agent-arrive flex items-center gap-2 py-1 text-xs", style: arrival, children: [
3403
+ /* @__PURE__ */ jsx11(StatusDot, { tone }),
3404
+ /* @__PURE__ */ jsx11(RunLabel, { tool: run.tool, detail: run.detail, live: tone === "live" }),
3405
+ tone === "live" && (run.iteration !== void 0 || run.phase !== void 0) && /* @__PURE__ */ jsx11("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 ") }),
3406
+ /* @__PURE__ */ jsxs9("span", { className: "flex shrink-0 items-center gap-1.5 font-mono text-xs tabular-nums text-muted-foreground/70", children: [
3407
+ tone !== "live" && tone !== "ok" && /* @__PURE__ */ jsx11("span", { children: run.status }),
3408
+ cost && /* @__PURE__ */ jsx11("span", { children: cost }),
3409
+ duration && /* @__PURE__ */ jsx11("span", { children: duration })
3335
3410
  ] })
3336
3411
  ] });
3337
3412
  }
3338
3413
  function MissionActivityLane({ activity, startedAt, nowMs }) {
3339
- const [expanded, setExpanded] = useState12(false);
3414
+ const [expanded, setExpanded] = useState13(false);
3340
3415
  if (activity.length === 0) return null;
3341
- return /* @__PURE__ */ jsxs8("div", { className: "mt-1 border-l border-border pl-3", children: [
3342
- activity.map((run, index) => /* @__PURE__ */ jsx10(LaneRow, { run, staggerIndex: index }, run.taskId)),
3343
- /* @__PURE__ */ jsxs8(
3416
+ return /* @__PURE__ */ jsxs9("div", { className: "mt-1 border-l border-border pl-3", children: [
3417
+ activity.map((run, index) => /* @__PURE__ */ jsx11(LaneRow, { run, staggerIndex: index }, run.taskId)),
3418
+ /* @__PURE__ */ jsxs9(
3344
3419
  "button",
3345
3420
  {
3346
3421
  type: "button",
3347
3422
  onClick: () => setExpanded((v) => !v),
3348
3423
  className: "flex items-center gap-1 py-0.5 text-xs font-medium text-muted-foreground/70 transition hover:text-foreground",
3349
3424
  children: [
3350
- /* @__PURE__ */ jsx10(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
3425
+ /* @__PURE__ */ jsx11(ChevronGlyph, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` }),
3351
3426
  "timeline"
3352
3427
  ]
3353
3428
  }
3354
3429
  ),
3355
- expanded && /* @__PURE__ */ jsx10("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx10(
3430
+ expanded && /* @__PURE__ */ jsx11("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx11(
3356
3431
  FlowWaterfall,
3357
3432
  {
3358
3433
  trace: stepActivityFlowTrace(activity, {
@@ -3369,39 +3444,39 @@ function ActivityRow({
3369
3444
  staggerIndex
3370
3445
  }) {
3371
3446
  const arrival = useArrivalStyle(staggerIndex);
3372
- const [open, setOpen] = useState12(false);
3447
+ const [open, setOpen] = useState13(false);
3373
3448
  const tone = activityTone(record.status);
3374
3449
  const cost = formatActivityCost(record.costUsd);
3375
3450
  const duration = formatActivityDuration(record.durationMs);
3376
- return /* @__PURE__ */ jsxs8("div", { className: "agent-arrive rounded-lg border border-card-edge bg-card", style: arrival, children: [
3377
- /* @__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: [
3378
- /* @__PURE__ */ jsx10(StatusDot, { tone }),
3379
- /* @__PURE__ */ jsx10(RunLabel, { tool: record.tool, detail: record.detail, live: tone === "live" }),
3380
- 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 ") }),
3381
- /* @__PURE__ */ jsx10(
3451
+ return /* @__PURE__ */ jsxs9("div", { className: "agent-arrive rounded-lg border border-card-edge bg-card", style: arrival, children: [
3452
+ /* @__PURE__ */ jsxs9("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: [
3453
+ /* @__PURE__ */ jsx11(StatusDot, { tone }),
3454
+ /* @__PURE__ */ jsx11(RunLabel, { tool: record.tool, detail: record.detail, live: tone === "live" }),
3455
+ tone === "live" && (record.iteration !== void 0 || record.phase !== void 0) && /* @__PURE__ */ jsx11("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 ") }),
3456
+ /* @__PURE__ */ jsx11(
3382
3457
  "span",
3383
3458
  {
3384
3459
  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"}`,
3385
3460
  children: record.status
3386
3461
  }
3387
3462
  ),
3388
- cost && /* @__PURE__ */ jsx10("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: cost }),
3389
- /* @__PURE__ */ jsx10(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
3463
+ cost && /* @__PURE__ */ jsx11("span", { className: "shrink-0 font-mono text-xs tabular-nums text-muted-foreground", children: cost }),
3464
+ /* @__PURE__ */ jsx11(ChevronGlyph, { className: `h-3 w-3 shrink-0 text-muted-foreground transition-transform ${open ? "rotate-180" : ""}` })
3390
3465
  ] }),
3391
- open && /* @__PURE__ */ jsxs8("div", { className: "space-y-2.5 border-t border-border px-3 py-2.5", children: [
3392
- record.durationMs !== void 0 && /* @__PURE__ */ jsx10("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx10(FlowWaterfall, { trace: stepActivityFlowTrace([record]) }) }),
3393
- /* @__PURE__ */ jsxs8("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs", children: [
3394
- /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "task" }),
3395
- /* @__PURE__ */ jsx10("dd", { className: "truncate text-muted-foreground", children: record.taskId }),
3396
- /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "started" }),
3397
- /* @__PURE__ */ jsx10("dd", { className: "text-muted-foreground", children: new Date(record.startedAt).toLocaleString() }),
3398
- duration && /* @__PURE__ */ jsxs8(Fragment4, { children: [
3399
- /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "duration" }),
3400
- /* @__PURE__ */ jsx10("dd", { className: "text-muted-foreground", children: duration })
3466
+ open && /* @__PURE__ */ jsxs9("div", { className: "space-y-2.5 border-t border-border px-3 py-2.5", children: [
3467
+ record.durationMs !== void 0 && /* @__PURE__ */ jsx11("div", { className: "rounded-md border border-border bg-secondary p-2", children: /* @__PURE__ */ jsx11(FlowWaterfall, { trace: stepActivityFlowTrace([record]) }) }),
3468
+ /* @__PURE__ */ jsxs9("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-xs", children: [
3469
+ /* @__PURE__ */ jsx11("dt", { className: "text-muted-foreground/60", children: "task" }),
3470
+ /* @__PURE__ */ jsx11("dd", { className: "truncate text-muted-foreground", children: record.taskId }),
3471
+ /* @__PURE__ */ jsx11("dt", { className: "text-muted-foreground/60", children: "started" }),
3472
+ /* @__PURE__ */ jsx11("dd", { className: "text-muted-foreground", children: new Date(record.startedAt).toLocaleString() }),
3473
+ duration && /* @__PURE__ */ jsxs9(Fragment4, { children: [
3474
+ /* @__PURE__ */ jsx11("dt", { className: "text-muted-foreground/60", children: "duration" }),
3475
+ /* @__PURE__ */ jsx11("dd", { className: "text-muted-foreground", children: duration })
3401
3476
  ] }),
3402
- record.traceId && /* @__PURE__ */ jsxs8(Fragment4, { children: [
3403
- /* @__PURE__ */ jsx10("dt", { className: "text-muted-foreground/60", children: "trace" }),
3404
- /* @__PURE__ */ jsx10("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx10(TraceIdCopy, { traceId: record.traceId }) })
3477
+ record.traceId && /* @__PURE__ */ jsxs9(Fragment4, { children: [
3478
+ /* @__PURE__ */ jsx11("dt", { className: "text-muted-foreground/60", children: "trace" }),
3479
+ /* @__PURE__ */ jsx11("dd", { className: "min-w-0", children: /* @__PURE__ */ jsx11(TraceIdCopy, { traceId: record.traceId }) })
3405
3480
  ] })
3406
3481
  ] }),
3407
3482
  record.missionRef && renderMissionRef?.(record.missionRef, record)
@@ -3409,10 +3484,10 @@ function ActivityRow({
3409
3484
  ] });
3410
3485
  }
3411
3486
  function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent activity", emptyLabel = "No agent runs yet." }) {
3412
- const [rows, setRows] = useState12([]);
3413
- const [cursor, setCursor] = useState12(void 0);
3414
- const [status, setStatus] = useState12("loading");
3415
- const [error, setError] = useState12(null);
3487
+ const [rows, setRows] = useState13([]);
3488
+ const [cursor, setCursor] = useState13(void 0);
3489
+ const [status, setStatus] = useState13("loading");
3490
+ const [error, setError] = useState13(null);
3416
3491
  const load = useCallback5(
3417
3492
  async (from) => {
3418
3493
  setStatus("loading");
@@ -3433,10 +3508,10 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3433
3508
  void load();
3434
3509
  }, [load]);
3435
3510
  const loading = status === "loading";
3436
- return /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
3437
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
3438
- /* @__PURE__ */ jsx10("h2", { className: "flex-1 text-sm font-semibold", children: title }),
3439
- /* @__PURE__ */ jsx10(
3511
+ return /* @__PURE__ */ jsxs9("div", { className: "space-y-2", children: [
3512
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
3513
+ /* @__PURE__ */ jsx11("h2", { className: "flex-1 text-sm font-semibold", children: title }),
3514
+ /* @__PURE__ */ jsx11(
3440
3515
  "button",
3441
3516
  {
3442
3517
  type: "button",
@@ -3444,15 +3519,15 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3444
3519
  disabled: loading,
3445
3520
  "aria-label": "Refresh",
3446
3521
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground disabled:opacity-50",
3447
- children: /* @__PURE__ */ jsx10(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
3522
+ children: /* @__PURE__ */ jsx11(RefreshGlyph, { className: `h-3.5 w-3.5 ${loading ? "animate-spin" : ""}` })
3448
3523
  }
3449
3524
  )
3450
3525
  ] }),
3451
- 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 }),
3452
- status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx10("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
3453
- /* @__PURE__ */ jsx10("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
3454
- /* @__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)) }),
3455
- cursor && /* @__PURE__ */ jsx10(
3526
+ status === "error" && /* @__PURE__ */ jsx11("p", { role: "alert", className: "rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: error }),
3527
+ status === "ready" && rows.length === 0 && /* @__PURE__ */ jsx11("p", { className: "px-1 text-sm text-muted-foreground", children: emptyLabel }),
3528
+ /* @__PURE__ */ jsx11("span", { role: "status", "aria-live": "polite", "aria-busy": loading, className: "sr-only", children: loading ? "Loading activity\u2026" : "" }),
3529
+ /* @__PURE__ */ jsx11("div", { className: "space-y-1.5", "aria-busy": loading, children: rows.map((record, index) => /* @__PURE__ */ jsx11(ActivityRow, { record, renderMissionRef, staggerIndex: index }, record.taskId)) }),
3530
+ cursor && /* @__PURE__ */ jsx11(
3456
3531
  "button",
3457
3532
  {
3458
3533
  type: "button",
@@ -3466,7 +3541,7 @@ function AgentActivityPanel({ fetchActivity, renderMissionRef, title = "Agent ac
3466
3541
  }
3467
3542
 
3468
3543
  // src/web-react/provenance.tsx
3469
- import { useCallback as useCallback6, useEffect as useEffect8, useId as useId2, useRef as useRef8, useState as useState13 } from "react";
3544
+ import { useCallback as useCallback6, useEffect as useEffect8, useId as useId2, useRef as useRef8, useState as useState14 } from "react";
3470
3545
 
3471
3546
  // src/web-react/provenance-model.ts
3472
3547
  var PROVENANCE_BASES = ["extracted", "entered", "computed", "asserted"];
@@ -3626,7 +3701,7 @@ function provenanceTriggerLabel(record, standing) {
3626
3701
  }
3627
3702
 
3628
3703
  // src/web-react/provenance.tsx
3629
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
3704
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
3630
3705
  var BASIS_TONES = {
3631
3706
  extracted: "border-primary/30 bg-primary/10 text-primary",
3632
3707
  entered: "border-success/30 bg-success/10 text-success",
@@ -3651,27 +3726,27 @@ function BasisGlyph({ basis, className }) {
3651
3726
  };
3652
3727
  switch (basis) {
3653
3728
  case "extracted":
3654
- return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3655
- /* @__PURE__ */ jsx11("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
3656
- /* @__PURE__ */ jsx11("polyline", { points: "14 3 14 8 19 8" }),
3657
- /* @__PURE__ */ jsx11("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
3729
+ return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
3730
+ /* @__PURE__ */ jsx12("path", { d: "M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" }),
3731
+ /* @__PURE__ */ jsx12("polyline", { points: "14 3 14 8 19 8" }),
3732
+ /* @__PURE__ */ jsx12("line", { x1: "9", y1: "13", x2: "15", y2: "13" })
3658
3733
  ] });
3659
3734
  case "entered":
3660
- return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3661
- /* @__PURE__ */ jsx11("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
3662
- /* @__PURE__ */ jsx11("circle", { cx: "12", cy: "7", r: "4" })
3735
+ return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
3736
+ /* @__PURE__ */ jsx12("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
3737
+ /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "7", r: "4" })
3663
3738
  ] });
3664
3739
  case "computed":
3665
- return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3666
- /* @__PURE__ */ jsx11("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
3667
- /* @__PURE__ */ jsx11("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
3668
- /* @__PURE__ */ jsx11("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
3669
- /* @__PURE__ */ jsx11("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
3740
+ return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
3741
+ /* @__PURE__ */ jsx12("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
3742
+ /* @__PURE__ */ jsx12("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
3743
+ /* @__PURE__ */ jsx12("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
3744
+ /* @__PURE__ */ jsx12("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
3670
3745
  ] });
3671
3746
  case "asserted":
3672
- return /* @__PURE__ */ jsxs9("svg", { ...shared, children: [
3673
- /* @__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" }),
3674
- /* @__PURE__ */ jsx11("circle", { cx: "12", cy: "12", r: "3.2" })
3747
+ return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
3748
+ /* @__PURE__ */ jsx12("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" }),
3749
+ /* @__PURE__ */ jsx12("circle", { cx: "12", cy: "12", r: "3.2" })
3675
3750
  ] });
3676
3751
  }
3677
3752
  }
@@ -3691,11 +3766,11 @@ function SourceRow({
3691
3766
  const status = source.status ?? "ready";
3692
3767
  const statusLine = describeProvenanceSourceStatus(source);
3693
3768
  const openable = status === "ready" && (onOpenSource !== void 0 || source.href !== void 0);
3694
- return /* @__PURE__ */ jsxs9("li", { className: "rounded-md border border-card-edge bg-card px-2.5 py-2", children: [
3695
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
3696
- /* @__PURE__ */ jsx11("span", { className: "text-sm font-medium text-foreground", children: source.label }),
3697
- source.locator && /* @__PURE__ */ jsx11("span", { className: "text-xs text-muted-foreground", children: source.locator }),
3698
- openable && (onOpenSource ? /* @__PURE__ */ jsxs9(
3769
+ return /* @__PURE__ */ jsxs10("li", { className: "rounded-md border border-card-edge bg-card px-2.5 py-2", children: [
3770
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
3771
+ /* @__PURE__ */ jsx12("span", { className: "text-sm font-medium text-foreground", children: source.label }),
3772
+ source.locator && /* @__PURE__ */ jsx12("span", { className: "text-xs text-muted-foreground", children: source.locator }),
3773
+ openable && (onOpenSource ? /* @__PURE__ */ jsxs10(
3699
3774
  "button",
3700
3775
  {
3701
3776
  type: "button",
@@ -3706,7 +3781,7 @@ function SourceRow({
3706
3781
  source.label
3707
3782
  ]
3708
3783
  }
3709
- ) : /* @__PURE__ */ jsxs9(
3784
+ ) : /* @__PURE__ */ jsxs10(
3710
3785
  "a",
3711
3786
  {
3712
3787
  href: source.href,
@@ -3720,7 +3795,7 @@ function SourceRow({
3720
3795
  }
3721
3796
  ))
3722
3797
  ] }),
3723
- source.quote && /* @__PURE__ */ jsxs9("blockquote", { className: "mt-1 border-l-2 border-primary/50 pl-2 text-[12px] italic leading-snug text-foreground", children: [
3798
+ source.quote && /* @__PURE__ */ jsxs10("blockquote", { className: "mt-1 border-l-2 border-primary/50 pl-2 text-[12px] italic leading-snug text-foreground", children: [
3724
3799
  "\u201C",
3725
3800
  source.quote,
3726
3801
  "\u201D"
@@ -3729,14 +3804,14 @@ function SourceRow({
3729
3804
  // update is theirs to read, not an interruption. Either way it is TEXT
3730
3805
  // — a spinner alone and a greyed row alone both render as "nothing
3731
3806
  // here".
3732
- /* @__PURE__ */ jsxs9(
3807
+ /* @__PURE__ */ jsxs10(
3733
3808
  "p",
3734
3809
  {
3735
3810
  role: "status",
3736
3811
  className: `mt-1 text-xs ${status === "unavailable" ? "text-destructive" : "text-muted-foreground"}`,
3737
3812
  children: [
3738
3813
  statusLine,
3739
- status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx11(
3814
+ status === "unavailable" && onRetrySource && /* @__PURE__ */ jsx12(
3740
3815
  "button",
3741
3816
  {
3742
3817
  type: "button",
@@ -3760,7 +3835,7 @@ function ProvenanceValue({
3760
3835
  missingValueLabel = DEFAULT_MISSING_VALUE_LABEL,
3761
3836
  className
3762
3837
  }) {
3763
- const [open, setOpen] = useState13(defaultOpen);
3838
+ const [open, setOpen] = useState14(defaultOpen);
3764
3839
  const triggerRef = useRef8(null);
3765
3840
  const rootRef = useRef8(null);
3766
3841
  const panelId = useId2();
@@ -3803,12 +3878,12 @@ function ProvenanceValue({
3803
3878
  document.removeEventListener("touchstart", onPointerDown, true);
3804
3879
  };
3805
3880
  }, [open]);
3806
- const summary = /* @__PURE__ */ jsxs9("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
3807
- record.label && /* @__PURE__ */ jsx11("span", { className: "text-xs text-muted-foreground", children: record.label }),
3808
- /* @__PURE__ */ jsx11("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record.display : missingValueLabel })
3881
+ const summary = /* @__PURE__ */ jsxs10("span", { className: "inline-flex flex-wrap items-baseline gap-x-1.5", children: [
3882
+ record.label && /* @__PURE__ */ jsx12("span", { className: "text-xs text-muted-foreground", children: record.label }),
3883
+ /* @__PURE__ */ jsx12("span", { className: hasValue ? "text-sm text-foreground" : "text-sm italic text-muted-foreground", children: hasValue ? record.display : missingValueLabel })
3809
3884
  ] });
3810
3885
  if (maxDepth <= 0) {
3811
- return /* @__PURE__ */ jsxs9(
3886
+ return /* @__PURE__ */ jsxs10(
3812
3887
  "div",
3813
3888
  {
3814
3889
  className: `inline-block max-w-full [overflow-wrap:anywhere] ${className ?? ""}`,
@@ -3816,22 +3891,22 @@ function ProvenanceValue({
3816
3891
  "data-provenance-standing": standing,
3817
3892
  children: [
3818
3893
  summary,
3819
- /* @__PURE__ */ jsxs9(
3894
+ /* @__PURE__ */ jsxs10(
3820
3895
  "span",
3821
3896
  {
3822
3897
  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]}`,
3823
3898
  children: [
3824
- /* @__PURE__ */ jsx11(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3899
+ /* @__PURE__ */ jsx12(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3825
3900
  basisMeta.label
3826
3901
  ]
3827
3902
  }
3828
3903
  ),
3829
- /* @__PURE__ */ jsx11("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: describeProvenance(record) })
3904
+ /* @__PURE__ */ jsx12("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: describeProvenance(record) })
3830
3905
  ]
3831
3906
  }
3832
3907
  );
3833
3908
  }
3834
- return /* @__PURE__ */ jsxs9(
3909
+ return /* @__PURE__ */ jsxs10(
3835
3910
  "div",
3836
3911
  {
3837
3912
  ref: rootRef,
@@ -3840,9 +3915,9 @@ function ProvenanceValue({
3840
3915
  "data-provenance-basis": record.basis,
3841
3916
  "data-provenance-standing": standing,
3842
3917
  children: [
3843
- /* @__PURE__ */ jsxs9("span", { className: "inline-flex flex-wrap items-baseline gap-1.5", children: [
3918
+ /* @__PURE__ */ jsxs10("span", { className: "inline-flex flex-wrap items-baseline gap-1.5", children: [
3844
3919
  summary,
3845
- /* @__PURE__ */ jsxs9(
3920
+ /* @__PURE__ */ jsxs10(
3846
3921
  "button",
3847
3922
  {
3848
3923
  ref: triggerRef,
@@ -3853,17 +3928,17 @@ function ProvenanceValue({
3853
3928
  "aria-label": provenanceTriggerLabel(record, standing),
3854
3929
  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]}`,
3855
3930
  children: [
3856
- /* @__PURE__ */ jsx11(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3857
- /* @__PURE__ */ jsx11("span", { "aria-hidden": true, children: basisMeta.label })
3931
+ /* @__PURE__ */ jsx12(BasisGlyph, { basis: record.basis, className: "h-3 w-3" }),
3932
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": true, children: basisMeta.label })
3858
3933
  ]
3859
3934
  }
3860
3935
  ),
3861
3936
  standing !== "settled" && // Legible at rest: what to do about the value does not wait for
3862
3937
  // someone to open the panel. `aria-hidden` because the trigger's
3863
3938
  // accessible name already carries it — this is the visual half.
3864
- /* @__PURE__ */ jsx11("span", { "aria-hidden": true, className: `text-xs font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
3939
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": true, className: `text-xs font-medium ${STANDING_TONES[standing]}`, children: standingMeta.label })
3865
3940
  ] }),
3866
- open && /* @__PURE__ */ jsxs9(
3941
+ open && /* @__PURE__ */ jsxs10(
3867
3942
  "div",
3868
3943
  {
3869
3944
  id: panelId,
@@ -3871,19 +3946,19 @@ function ProvenanceValue({
3871
3946
  "aria-label": provenanceTriggerLabel(record, standing),
3872
3947
  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",
3873
3948
  children: [
3874
- /* @__PURE__ */ jsxs9("div", { children: [
3875
- /* @__PURE__ */ jsx11("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record) }),
3876
- /* @__PURE__ */ jsxs9("p", { className: `mt-0.5 text-xs leading-snug ${STANDING_TONES[standing]}`, children: [
3949
+ /* @__PURE__ */ jsxs10("div", { children: [
3950
+ /* @__PURE__ */ jsx12("p", { className: "text-[12px] leading-snug text-foreground", children: describeProvenance(record) }),
3951
+ /* @__PURE__ */ jsxs10("p", { className: `mt-0.5 text-xs leading-snug ${STANDING_TONES[standing]}`, children: [
3877
3952
  standingMeta.label,
3878
3953
  " \u2014 ",
3879
3954
  provenanceNextMove(record, standing, confidencePolicy)
3880
3955
  ] }),
3881
- basisMeta.checkableAgainst === null && /* @__PURE__ */ jsxs9("p", { className: "mt-0.5 text-xs leading-snug text-muted-foreground", children: [
3956
+ basisMeta.checkableAgainst === null && /* @__PURE__ */ jsxs10("p", { className: "mt-0.5 text-xs leading-snug text-muted-foreground", children: [
3882
3957
  basisMeta.meaning,
3883
3958
  " There is nothing outside the model to check it against."
3884
3959
  ] })
3885
3960
  ] }),
3886
- sources.length > 0 && /* @__PURE__ */ jsx11("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx11(
3961
+ sources.length > 0 && /* @__PURE__ */ jsx12("ul", { className: "space-y-1.5", children: sources.map((source, index) => /* @__PURE__ */ jsx12(
3887
3962
  SourceRow,
3888
3963
  {
3889
3964
  source,
@@ -3896,12 +3971,12 @@ function ProvenanceValue({
3896
3971
  gaps.filter((gap) => gap.kind !== "unavailable-source").map((gap) => (
3897
3972
  // An unavailable source already states itself on its own row; a
3898
3973
  // structural gap has no row to state it, so it gets one here.
3899
- /* @__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)
3974
+ /* @__PURE__ */ jsx12("p", { className: "rounded-md bg-destructive/10 px-2 py-1.5 text-xs leading-snug text-destructive", children: gap.message }, gap.kind)
3900
3975
  )),
3901
- 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" }),
3902
- inputs.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "border-t border-border pt-2", children: [
3903
- /* @__PURE__ */ jsx11("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
3904
- /* @__PURE__ */ jsx11("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(
3976
+ loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx12("p", { role: "status", className: "text-xs text-muted-foreground", children: "Looking up where this came from\u2026" }),
3977
+ inputs.length > 0 && /* @__PURE__ */ jsxs10("div", { className: "border-t border-border pt-2", children: [
3978
+ /* @__PURE__ */ jsx12("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
3979
+ /* @__PURE__ */ jsx12("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsx12(
3905
3980
  ProvenanceValue,
3906
3981
  {
3907
3982
  record: input,
@@ -3922,26 +3997,26 @@ function ProvenanceValue({
3922
3997
  }
3923
3998
  function ProvenanceLegend({ bases, className }) {
3924
3999
  if (bases.length === 0) return null;
3925
- return /* @__PURE__ */ jsx11("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
4000
+ return /* @__PURE__ */ jsx12("ul", { className: `flex flex-wrap items-center gap-x-3 gap-y-1.5 ${className ?? ""}`, children: bases.map((basis) => {
3926
4001
  const meta = provenanceBasisMeta(basis);
3927
- return /* @__PURE__ */ jsxs9("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
3928
- /* @__PURE__ */ jsxs9(
4002
+ return /* @__PURE__ */ jsxs10("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
4003
+ /* @__PURE__ */ jsxs10(
3929
4004
  "span",
3930
4005
  {
3931
4006
  className: `inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-xs font-medium ${BASIS_TONES[basis]}`,
3932
4007
  children: [
3933
- /* @__PURE__ */ jsx11(BasisGlyph, { basis, className: "h-3 w-3" }),
4008
+ /* @__PURE__ */ jsx12(BasisGlyph, { basis, className: "h-3 w-3" }),
3934
4009
  meta.label
3935
4010
  ]
3936
4011
  }
3937
4012
  ),
3938
- /* @__PURE__ */ jsx11("span", { children: meta.meaning })
4013
+ /* @__PURE__ */ jsx12("span", { children: meta.meaning })
3939
4014
  ] }, basis);
3940
4015
  }) });
3941
4016
  }
3942
4017
 
3943
4018
  // src/web-react/seat-paywall.tsx
3944
- import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
4019
+ import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
3945
4020
  function usd(cents) {
3946
4021
  return new Intl.NumberFormat("en-US", {
3947
4022
  style: "currency",
@@ -3951,7 +4026,7 @@ function usd(cents) {
3951
4026
  }).format(cents / 100);
3952
4027
  }
3953
4028
  function CheckGlyph3() {
3954
- return /* @__PURE__ */ jsx12(
4029
+ return /* @__PURE__ */ jsx13(
3955
4030
  "svg",
3956
4031
  {
3957
4032
  className: "h-4 w-4 shrink-0 text-primary",
@@ -3962,14 +4037,14 @@ function CheckGlyph3() {
3962
4037
  strokeLinecap: "round",
3963
4038
  strokeLinejoin: "round",
3964
4039
  "aria-hidden": true,
3965
- children: /* @__PURE__ */ jsx12("path", { d: "M20 6 9 17l-5-5" })
4040
+ children: /* @__PURE__ */ jsx13("path", { d: "M20 6 9 17l-5-5" })
3966
4041
  }
3967
4042
  );
3968
4043
  }
3969
4044
  function Benefit({ children }) {
3970
- return /* @__PURE__ */ jsxs10("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
3971
- /* @__PURE__ */ jsx12("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx12(CheckGlyph3, {}) }),
3972
- /* @__PURE__ */ jsx12("span", { children })
4045
+ return /* @__PURE__ */ jsxs11("li", { className: "flex items-start gap-2.5 text-sm text-foreground", children: [
4046
+ /* @__PURE__ */ jsx13("span", { className: "mt-0.5", children: /* @__PURE__ */ jsx13(CheckGlyph3, {}) }),
4047
+ /* @__PURE__ */ jsx13("span", { children })
3973
4048
  ] });
3974
4049
  }
3975
4050
  function SeatPaywall({
@@ -3987,45 +4062,45 @@ function SeatPaywall({
3987
4062
  const recurringPrice = offer ? usd(offer.recurring.priceCents) : `$${priceUsd}`;
3988
4063
  const recurringUsage = offer ? usd(offer.recurring.includedCreditsCents) : `$${includedUsageUsd}`;
3989
4064
  const introductory = offer?.introductory ?? null;
3990
- 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: [
3991
- /* @__PURE__ */ jsx12("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: product }),
3992
- /* @__PURE__ */ jsxs10("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
4065
+ return /* @__PURE__ */ jsx13("div", { className: "flex min-h-[60vh] w-full items-center justify-center p-6", children: /* @__PURE__ */ jsxs11("div", { className: "w-full max-w-md rounded-2xl border border-card-edge bg-card p-8", children: [
4066
+ /* @__PURE__ */ jsx13("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: product }),
4067
+ /* @__PURE__ */ jsxs11("h1", { className: "mt-2 text-2xl font-semibold tracking-tight text-foreground", children: [
3993
4068
  "Unlock ",
3994
4069
  product
3995
4070
  ] }),
3996
- tagline && /* @__PURE__ */ jsx12("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
3997
- introductory ? /* @__PURE__ */ jsxs10(Fragment5, { children: [
3998
- /* @__PURE__ */ jsxs10("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
3999
- /* @__PURE__ */ jsx12("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
4000
- /* @__PURE__ */ jsx12("span", { className: "text-sm text-muted-foreground", children: "first month" })
4071
+ tagline && /* @__PURE__ */ jsx13("p", { className: "mt-2 text-sm text-muted-foreground", children: tagline }),
4072
+ introductory ? /* @__PURE__ */ jsxs11(Fragment5, { children: [
4073
+ /* @__PURE__ */ jsxs11("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
4074
+ /* @__PURE__ */ jsx13("span", { className: "text-3xl font-semibold text-foreground", children: usd(introductory.priceCents) }),
4075
+ /* @__PURE__ */ jsx13("span", { className: "text-sm text-muted-foreground", children: "first month" })
4001
4076
  ] }),
4002
- /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4077
+ /* @__PURE__ */ jsxs11("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4003
4078
  "Includes ",
4004
4079
  usd(introductory.includedCreditsCents),
4005
4080
  " of AI usage in your first month"
4006
4081
  ] }),
4007
- /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4082
+ /* @__PURE__ */ jsxs11("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4008
4083
  "Then ",
4009
4084
  recurringPrice,
4010
4085
  "/mo \xB7 includes ",
4011
4086
  recurringUsage,
4012
4087
  "/mo of AI usage"
4013
4088
  ] })
4014
- ] }) : /* @__PURE__ */ jsxs10(Fragment5, { children: [
4015
- /* @__PURE__ */ jsxs10("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
4016
- /* @__PURE__ */ jsx12("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
4017
- /* @__PURE__ */ jsx12("span", { className: "text-sm text-muted-foreground", children: "/mo" })
4089
+ ] }) : /* @__PURE__ */ jsxs11(Fragment5, { children: [
4090
+ /* @__PURE__ */ jsxs11("div", { className: "mt-6 flex items-baseline gap-1.5", children: [
4091
+ /* @__PURE__ */ jsx13("span", { className: "text-3xl font-semibold text-foreground", children: recurringPrice }),
4092
+ /* @__PURE__ */ jsx13("span", { className: "text-sm text-muted-foreground", children: "/mo" })
4018
4093
  ] }),
4019
- /* @__PURE__ */ jsxs10("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4094
+ /* @__PURE__ */ jsxs11("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4020
4095
  "Includes ",
4021
4096
  recurringUsage,
4022
4097
  "/mo of AI usage"
4023
4098
  ] })
4024
4099
  ] }),
4025
- /* @__PURE__ */ jsx12("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
4100
+ /* @__PURE__ */ jsx13("ul", { className: "mt-6 space-y-2.5", children: (benefits ?? [
4026
4101
  `Full access to ${product}`
4027
- ]).map((benefit, i) => /* @__PURE__ */ jsx12(Benefit, { children: benefit }, i)) }),
4028
- /* @__PURE__ */ jsx12(
4102
+ ]).map((benefit, i) => /* @__PURE__ */ jsx13(Benefit, { children: benefit }, i)) }),
4103
+ /* @__PURE__ */ jsx13(
4029
4104
  "button",
4030
4105
  {
4031
4106
  type: "button",
@@ -4035,7 +4110,7 @@ function SeatPaywall({
4035
4110
  children: pending ? "Opening checkout\u2026" : ctaLabel ?? "Continue to checkout"
4036
4111
  }
4037
4112
  ),
4038
- footnote && /* @__PURE__ */ jsx12("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
4113
+ footnote && /* @__PURE__ */ jsx13("p", { className: "mt-3 text-center text-xs text-muted-foreground/70", children: footnote })
4039
4114
  ] }) });
4040
4115
  }
4041
4116
 
@@ -4048,7 +4123,7 @@ import {
4048
4123
  useId as useId3,
4049
4124
  useMemo as useMemo5,
4050
4125
  useRef as useRef9,
4051
- useState as useState14
4126
+ useState as useState15
4052
4127
  } from "react";
4053
4128
 
4054
4129
  // src/web-react/record-grid-model.ts
@@ -4404,7 +4479,7 @@ function pruneRecordGridOverlay(rows, overlay) {
4404
4479
  }
4405
4480
 
4406
4481
  // src/web-react/record-grid.tsx
4407
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
4482
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
4408
4483
  var EMPTY_RECORD_GRID_ROWS = [];
4409
4484
  var CELL_KEY_SEPARATOR = "\0";
4410
4485
  function cellKey(rowId, columnId) {
@@ -4464,19 +4539,19 @@ function RecordGrid({
4464
4539
  className
4465
4540
  }) {
4466
4541
  const fieldPrefix = useId3();
4467
- const [overlay, setOverlay] = useState14(EMPTY_RECORD_GRID_OVERLAY);
4468
- const [editing, setEditingState] = useState14(null);
4469
- const [cellErrors, setCellErrors] = useState14({});
4470
- const [rowErrors, setRowErrors] = useState14({});
4471
- const [pendingRows, setPendingRows] = useState14({});
4472
- const [focus, setFocus] = useState14(null);
4473
- const [openSource, setOpenSource] = useState14(null);
4474
- const [confirmDelete, setConfirmDelete] = useState14(null);
4475
- const [adding, setAdding] = useState14(false);
4476
- const [draft, setDraft] = useState14({ ...newRowDefaults ?? {} });
4477
- const [draftErrors, setDraftErrors] = useState14({});
4478
- const [draftError, setDraftError] = useState14(null);
4479
- const [creating, setCreating] = useState14(false);
4542
+ const [overlay, setOverlay] = useState15(EMPTY_RECORD_GRID_OVERLAY);
4543
+ const [editing, setEditingState] = useState15(null);
4544
+ const [cellErrors, setCellErrors] = useState15({});
4545
+ const [rowErrors, setRowErrors] = useState15({});
4546
+ const [pendingRows, setPendingRows] = useState15({});
4547
+ const [focus, setFocus] = useState15(null);
4548
+ const [openSource, setOpenSource] = useState15(null);
4549
+ const [confirmDelete, setConfirmDelete] = useState15(null);
4550
+ const [adding, setAdding] = useState15(false);
4551
+ const [draft, setDraft] = useState15({ ...newRowDefaults ?? {} });
4552
+ const [draftErrors, setDraftErrors] = useState15({});
4553
+ const [draftError, setDraftError] = useState15(null);
4554
+ const [creating, setCreating] = useState15(false);
4480
4555
  const cellRefs = useRef9(/* @__PURE__ */ new Map());
4481
4556
  const settling = useRef9(false);
4482
4557
  const draftCounter = useRef9(0);
@@ -4716,9 +4791,9 @@ function RecordGrid({
4716
4791
  [beginEdit, columns, editing, focusCell, onUpdate, reviewing, visibleRows]
4717
4792
  );
4718
4793
  if (state.status === "idle" || state.status === "loading") {
4719
- return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4794
+ return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
4720
4795
  toolbar,
4721
- /* @__PURE__ */ jsxs11(
4796
+ /* @__PURE__ */ jsxs12(
4722
4797
  "div",
4723
4798
  {
4724
4799
  role: "status",
@@ -4726,22 +4801,22 @@ function RecordGrid({
4726
4801
  "aria-live": "polite",
4727
4802
  className: "space-y-2 rounded-xl border border-card-edge bg-card p-4",
4728
4803
  children: [
4729
- /* @__PURE__ */ jsxs11("span", { className: "sr-only", children: [
4804
+ /* @__PURE__ */ jsxs12("span", { className: "sr-only", children: [
4730
4805
  "Loading ",
4731
4806
  caption
4732
4807
  ] }),
4733
- Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx13("div", { className: "h-8 animate-pulse rounded-md bg-secondary", "aria-hidden": true }, index))
4808
+ Array.from({ length: Math.max(1, loadingRowCount) }, (_, index) => /* @__PURE__ */ jsx14("div", { className: "h-8 animate-pulse rounded-md bg-secondary", "aria-hidden": true }, index))
4734
4809
  ]
4735
4810
  }
4736
4811
  )
4737
4812
  ] });
4738
4813
  }
4739
4814
  if (state.status === "error") {
4740
- return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4815
+ return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
4741
4816
  toolbar,
4742
- /* @__PURE__ */ jsxs11("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
4743
- /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium text-destructive", children: state.message }),
4744
- /* @__PURE__ */ jsx13(
4817
+ /* @__PURE__ */ jsxs12("div", { role: "alert", className: "rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-4", children: [
4818
+ /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-destructive", children: state.message }),
4819
+ /* @__PURE__ */ jsx14(
4745
4820
  "button",
4746
4821
  {
4747
4822
  type: "button",
@@ -4753,7 +4828,7 @@ function RecordGrid({
4753
4828
  ] })
4754
4829
  ] });
4755
4830
  }
4756
- const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */ jsx13(
4831
+ const addForm = adding && onCreate && !reviewing ? /* @__PURE__ */ jsx14(
4757
4832
  AddRecordForm,
4758
4833
  {
4759
4834
  columns,
@@ -4772,13 +4847,13 @@ function RecordGrid({
4772
4847
  }
4773
4848
  ) : null;
4774
4849
  if (visibleRows.length === 0 && !reviewing) {
4775
- return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4850
+ return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
4776
4851
  toolbar,
4777
- addForm ?? /* @__PURE__ */ jsxs11("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
4778
- /* @__PURE__ */ jsx13("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
4779
- empty.description && /* @__PURE__ */ jsx13("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
4780
- /* @__PURE__ */ jsxs11("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
4781
- empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx13(
4852
+ addForm ?? /* @__PURE__ */ jsxs12("div", { className: "rounded-xl border border-dashed border-border px-6 py-10 text-center", children: [
4853
+ /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium text-foreground", children: empty.title }),
4854
+ empty.description && /* @__PURE__ */ jsx14("p", { className: "mx-auto mt-1 max-w-md text-sm text-muted-foreground", children: empty.description }),
4855
+ /* @__PURE__ */ jsxs12("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-2", children: [
4856
+ empty.action && (isValidElement(empty.action) ? empty.action : /* @__PURE__ */ jsx14(
4782
4857
  "button",
4783
4858
  {
4784
4859
  type: "button",
@@ -4787,7 +4862,7 @@ function RecordGrid({
4787
4862
  children: empty.action.label
4788
4863
  }
4789
4864
  )),
4790
- onCreate && /* @__PURE__ */ jsx13(
4865
+ onCreate && /* @__PURE__ */ jsx14(
4791
4866
  "button",
4792
4867
  {
4793
4868
  type: "button",
@@ -4812,18 +4887,18 @@ function RecordGrid({
4812
4887
  addedCount > 0 ? `${addedCount} added` : null,
4813
4888
  removedCount > 0 ? `${removedCount} removed` : null
4814
4889
  ].filter((part) => part !== null).join(" \xB7 ");
4815
- const reviewBar = reviewing ? /* @__PURE__ */ jsxs11(
4890
+ const reviewBar = reviewing ? /* @__PURE__ */ jsxs12(
4816
4891
  "div",
4817
4892
  {
4818
4893
  "data-record-grid-review": "",
4819
4894
  className: "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-card-edge bg-card px-4 py-2.5",
4820
4895
  children: [
4821
- /* @__PURE__ */ jsxs11("div", { className: "min-w-0", children: [
4822
- /* @__PURE__ */ jsx13("p", { className: "text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: "Proposed changes" }),
4823
- /* @__PURE__ */ jsx13("p", { className: "mt-0.5 text-xs tabular-nums text-muted-foreground", children: reviewSummary })
4896
+ /* @__PURE__ */ jsxs12("div", { className: "min-w-0", children: [
4897
+ /* @__PURE__ */ jsx14("p", { className: "text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: "Proposed changes" }),
4898
+ /* @__PURE__ */ jsx14("p", { className: "mt-0.5 text-xs tabular-nums text-muted-foreground", children: reviewSummary })
4824
4899
  ] }),
4825
- (onAcceptAll || onRejectAll) && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
4826
- onRejectAll && /* @__PURE__ */ jsx13(
4900
+ (onAcceptAll || onRejectAll) && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
4901
+ onRejectAll && /* @__PURE__ */ jsx14(
4827
4902
  "button",
4828
4903
  {
4829
4904
  type: "button",
@@ -4833,7 +4908,7 @@ function RecordGrid({
4833
4908
  children: "Reject all"
4834
4909
  }
4835
4910
  ),
4836
- onAcceptAll && /* @__PURE__ */ jsx13(
4911
+ onAcceptAll && /* @__PURE__ */ jsx14(
4837
4912
  "button",
4838
4913
  {
4839
4914
  type: "button",
@@ -4847,10 +4922,10 @@ function RecordGrid({
4847
4922
  ]
4848
4923
  }
4849
4924
  ) : null;
4850
- return /* @__PURE__ */ jsxs11("div", { className: `space-y-3 ${className ?? ""}`, children: [
4925
+ return /* @__PURE__ */ jsxs12("div", { className: `space-y-3 ${className ?? ""}`, children: [
4851
4926
  toolbar,
4852
4927
  reviewBar,
4853
- /* @__PURE__ */ jsx13("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs11(
4928
+ /* @__PURE__ */ jsx14("div", { className: "overflow-x-auto rounded-xl border border-card-edge bg-card", children: /* @__PURE__ */ jsxs12(
4854
4929
  "table",
4855
4930
  {
4856
4931
  role: "grid",
@@ -4858,8 +4933,8 @@ function RecordGrid({
4858
4933
  className: "w-full border-collapse text-left text-sm",
4859
4934
  onKeyDown: handleGridKeyDown,
4860
4935
  children: [
4861
- /* @__PURE__ */ jsx13("thead", { children: /* @__PURE__ */ jsxs11("tr", { role: "row", className: "border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4862
- columns.map((column) => /* @__PURE__ */ jsx13(
4936
+ /* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsxs12("tr", { role: "row", className: "border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground", children: [
4937
+ columns.map((column) => /* @__PURE__ */ jsx14(
4863
4938
  "th",
4864
4939
  {
4865
4940
  role: "columnheader",
@@ -4869,17 +4944,17 @@ function RecordGrid({
4869
4944
  },
4870
4945
  column.id
4871
4946
  )),
4872
- 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" }) })
4947
+ showActionsColumn && /* @__PURE__ */ jsx14("th", { role: "columnheader", scope: "col", className: "w-px px-3 py-2 font-medium", children: /* @__PURE__ */ jsx14("span", { className: "sr-only", children: reviewing ? "Review" : "Row actions" }) })
4873
4948
  ] }) }),
4874
- /* @__PURE__ */ jsxs11("tbody", { children: [
4949
+ /* @__PURE__ */ jsxs12("tbody", { children: [
4875
4950
  visibleRows.map((row) => {
4876
4951
  const rowLabel = recordGridRowLabel(columns, row);
4877
4952
  const pending = row.id in pendingRows;
4878
4953
  const rowError = rowErrors[row.id];
4879
4954
  const rowDiff = reviewing ? diffByRow.get(row.id) : void 0;
4880
4955
  const removedRow = rowDiff?.kind === "removed";
4881
- return /* @__PURE__ */ jsxs11(Fragment6, { children: [
4882
- /* @__PURE__ */ jsxs11(
4956
+ return /* @__PURE__ */ jsxs12(Fragment6, { children: [
4957
+ /* @__PURE__ */ jsxs12(
4883
4958
  "tr",
4884
4959
  {
4885
4960
  role: "row",
@@ -4899,8 +4974,8 @@ function RecordGrid({
4899
4974
  const errorId = `${fieldPrefix}-cell-error-${row.id}-${column.id}`;
4900
4975
  const cellDiff = rowDiff?.kind === "changed" ? diffCellByKey.get(key) : void 0;
4901
4976
  if (isEditing && editable) {
4902
- return /* @__PURE__ */ jsxs11("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4903
- /* @__PURE__ */ jsx13(
4977
+ return /* @__PURE__ */ jsxs12("td", { role: "gridcell", className: `px-3 py-1.5 ${alignmentClass(column)}`, children: [
4978
+ /* @__PURE__ */ jsx14(
4904
4979
  CellEditor,
4905
4980
  {
4906
4981
  column,
@@ -4913,11 +4988,11 @@ function RecordGrid({
4913
4988
  onCancel: () => cancelEdit(row, column)
4914
4989
  }
4915
4990
  ),
4916
- cellError !== void 0 && /* @__PURE__ */ jsx13("p", { id: errorId, role: "alert", className: "mt-1 text-xs leading-snug text-destructive", children: cellError })
4991
+ cellError !== void 0 && /* @__PURE__ */ jsx14("p", { id: errorId, role: "alert", className: "mt-1 text-xs leading-snug text-destructive", children: cellError })
4917
4992
  ] }, column.id);
4918
4993
  }
4919
4994
  if (column.kind === "boolean" && editable) {
4920
- return /* @__PURE__ */ jsx13("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx13(
4995
+ return /* @__PURE__ */ jsx14("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsx14(
4921
4996
  "input",
4922
4997
  {
4923
4998
  type: "checkbox",
@@ -4936,7 +5011,7 @@ function RecordGrid({
4936
5011
  ) }, column.id);
4937
5012
  }
4938
5013
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
4939
- return /* @__PURE__ */ jsx13(
5014
+ return /* @__PURE__ */ jsx14(
4940
5015
  "td",
4941
5016
  {
4942
5017
  role: "gridcell",
@@ -4954,20 +5029,20 @@ function RecordGrid({
4954
5029
  className: `px-3 py-2 outline-none focus:ring-2 focus:ring-inset focus:ring-primary/50 ${alignmentClass(
4955
5030
  column
4956
5031
  )} ${editable ? "cursor-text" : ""}`,
4957
- children: /* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
4958
- 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" }),
4959
- cellDiff ? /* @__PURE__ */ jsxs11("span", { className: "inline-flex max-w-full flex-wrap items-baseline gap-x-1.5", children: [
4960
- /* @__PURE__ */ jsx13("span", { className: "tabular-nums text-destructive line-through decoration-destructive/60", children: formatRecordGridValue(column, cellDiff.before, locale) || "\u2014" }),
4961
- /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2192" }),
4962
- /* @__PURE__ */ jsx13("span", { className: "tabular-nums font-medium text-success", children: formatRecordGridValue(column, cellDiff.after, locale) || "\u2014" })
4963
- ] }) : /* @__PURE__ */ jsx13(
5032
+ children: /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
5033
+ column.id === columns[0]?.id && removedRow && /* @__PURE__ */ jsx14("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" }),
5034
+ cellDiff ? /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full flex-wrap items-baseline gap-x-1.5", children: [
5035
+ /* @__PURE__ */ jsx14("span", { className: "tabular-nums text-destructive line-through decoration-destructive/60", children: formatRecordGridValue(column, cellDiff.before, locale) || "\u2014" }),
5036
+ /* @__PURE__ */ jsx14("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2192" }),
5037
+ /* @__PURE__ */ jsx14("span", { className: "tabular-nums font-medium text-success", children: formatRecordGridValue(column, cellDiff.after, locale) || "\u2014" })
5038
+ ] }) : /* @__PURE__ */ jsx14(
4964
5039
  "span",
4965
5040
  {
4966
5041
  className: removedRow ? "truncate text-destructive line-through decoration-destructive/60" : display === "" ? "text-muted-foreground" : "truncate text-foreground",
4967
5042
  children: display === "" ? applicable ? "\u2014" : "n/a" : display
4968
5043
  }
4969
5044
  ),
4970
- source && /* @__PURE__ */ jsx13(
5045
+ source && /* @__PURE__ */ jsx14(
4971
5046
  SourceMarker,
4972
5047
  {
4973
5048
  panelId: `${fieldPrefix}-source-${row.id}-${column.id}`,
@@ -4983,7 +5058,7 @@ function RecordGrid({
4983
5058
  column.id
4984
5059
  );
4985
5060
  }),
4986
- showActionsColumn && /* @__PURE__ */ jsx13("td", { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx13(
5061
+ showActionsColumn && /* @__PURE__ */ jsx14("td", { role: "gridcell", className: "px-3 py-2 text-right", children: reviewing ? rowDiff && /* @__PURE__ */ jsx14(
4987
5062
  ReviewActions,
4988
5063
  {
4989
5064
  rowId: row.id,
@@ -4992,8 +5067,8 @@ function RecordGrid({
4992
5067
  onAccept: onAcceptRow,
4993
5068
  onReject: onRejectRow
4994
5069
  }
4995
- ) : row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
4996
- /* @__PURE__ */ jsx13(
5070
+ ) : row.readOnly === true ? null : confirmDelete === row.id ? /* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1.5", children: [
5071
+ /* @__PURE__ */ jsx14(
4997
5072
  "button",
4998
5073
  {
4999
5074
  type: "button",
@@ -5003,7 +5078,7 @@ function RecordGrid({
5003
5078
  children: "Delete"
5004
5079
  }
5005
5080
  ),
5006
- /* @__PURE__ */ jsx13(
5081
+ /* @__PURE__ */ jsx14(
5007
5082
  "button",
5008
5083
  {
5009
5084
  type: "button",
@@ -5013,14 +5088,14 @@ function RecordGrid({
5013
5088
  children: "Cancel"
5014
5089
  }
5015
5090
  )
5016
- ] }) : /* @__PURE__ */ jsx13(
5091
+ ] }) : /* @__PURE__ */ jsx14(
5017
5092
  "button",
5018
5093
  {
5019
5094
  type: "button",
5020
5095
  "aria-label": `Delete ${rowLabel}`,
5021
5096
  onClick: () => setConfirmDelete(row.id),
5022
5097
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-destructive/10 hover:text-destructive",
5023
- children: /* @__PURE__ */ jsxs11(
5098
+ children: /* @__PURE__ */ jsxs12(
5024
5099
  "svg",
5025
5100
  {
5026
5101
  viewBox: "0 0 24 24",
@@ -5032,8 +5107,8 @@ function RecordGrid({
5032
5107
  strokeLinejoin: "round",
5033
5108
  "aria-hidden": true,
5034
5109
  children: [
5035
- /* @__PURE__ */ jsx13("polyline", { points: "3 6 5 6 21 6" }),
5036
- /* @__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" })
5110
+ /* @__PURE__ */ jsx14("polyline", { points: "3 6 5 6 21 6" }),
5111
+ /* @__PURE__ */ jsx14("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" })
5037
5112
  ]
5038
5113
  }
5039
5114
  )
@@ -5042,12 +5117,12 @@ function RecordGrid({
5042
5117
  ]
5043
5118
  }
5044
5119
  ),
5045
- 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 }) }) })
5120
+ rowError !== void 0 && /* @__PURE__ */ jsx14("tr", { role: "row", className: "border-b border-border", children: /* @__PURE__ */ jsx14("td", { role: "gridcell", colSpan: columnSpan, className: "px-3 pb-2", children: /* @__PURE__ */ jsx14("p", { role: "alert", className: "rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs text-destructive", children: rowError }) }) })
5046
5121
  ] }, row.id);
5047
5122
  }),
5048
5123
  reviewing && addedRows.map((row) => {
5049
5124
  const rowLabel = recordGridRowLabel(columns, row);
5050
- return /* @__PURE__ */ jsxs11(
5125
+ return /* @__PURE__ */ jsxs12(
5051
5126
  "tr",
5052
5127
  {
5053
5128
  role: "row",
@@ -5058,9 +5133,9 @@ function RecordGrid({
5058
5133
  const applicable = isRecordGridCellApplicable(column, row.values);
5059
5134
  const value = row.values[column.id] ?? null;
5060
5135
  const display = applicable ? formatRecordGridValue(column, value, locale) : "";
5061
- 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: [
5062
- 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" }),
5063
- /* @__PURE__ */ jsx13(
5136
+ return /* @__PURE__ */ jsx14("td", { role: "gridcell", className: `px-3 py-2 ${alignmentClass(column)}`, children: /* @__PURE__ */ jsxs12("span", { className: "inline-flex max-w-full items-center gap-1.5", children: [
5137
+ columnIndex === 0 && /* @__PURE__ */ jsx14("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" }),
5138
+ /* @__PURE__ */ jsx14(
5064
5139
  "span",
5065
5140
  {
5066
5141
  className: `tabular-nums ${display === "" ? "text-muted-foreground" : "truncate text-foreground"}`,
@@ -5069,7 +5144,7 @@ function RecordGrid({
5069
5144
  )
5070
5145
  ] }) }, column.id);
5071
5146
  }),
5072
- /* @__PURE__ */ jsx13("td", { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx13(
5147
+ /* @__PURE__ */ jsx14("td", { role: "gridcell", className: "px-3 py-2 text-right", children: /* @__PURE__ */ jsx14(
5073
5148
  ReviewActions,
5074
5149
  {
5075
5150
  rowId: row.id,
@@ -5085,8 +5160,8 @@ function RecordGrid({
5085
5160
  );
5086
5161
  })
5087
5162
  ] }),
5088
- hasFooter && /* @__PURE__ */ jsx13("tfoot", { children: /* @__PURE__ */ jsxs11("tr", { role: "row", className: "border-t-2 border-border", children: [
5089
- columns.map((column) => /* @__PURE__ */ jsx13(
5163
+ hasFooter && /* @__PURE__ */ jsx14("tfoot", { children: /* @__PURE__ */ jsxs12("tr", { role: "row", className: "border-t-2 border-border", children: [
5164
+ columns.map((column) => /* @__PURE__ */ jsx14(
5090
5165
  "td",
5091
5166
  {
5092
5167
  role: "gridcell",
@@ -5095,19 +5170,19 @@ function RecordGrid({
5095
5170
  },
5096
5171
  column.id
5097
5172
  )),
5098
- showActionsColumn && /* @__PURE__ */ jsx13("td", { role: "gridcell" })
5173
+ showActionsColumn && /* @__PURE__ */ jsx14("td", { role: "gridcell" })
5099
5174
  ] }) })
5100
5175
  ]
5101
5176
  }
5102
5177
  ) }),
5103
- onCreate && !reviewing && (addForm ?? /* @__PURE__ */ jsxs11(
5178
+ onCreate && !reviewing && (addForm ?? /* @__PURE__ */ jsxs12(
5104
5179
  "button",
5105
5180
  {
5106
5181
  type: "button",
5107
5182
  onClick: openAdd,
5108
5183
  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",
5109
5184
  children: [
5110
- /* @__PURE__ */ jsxs11(
5185
+ /* @__PURE__ */ jsxs12(
5111
5186
  "svg",
5112
5187
  {
5113
5188
  viewBox: "0 0 24 24",
@@ -5119,8 +5194,8 @@ function RecordGrid({
5119
5194
  strokeLinejoin: "round",
5120
5195
  "aria-hidden": true,
5121
5196
  children: [
5122
- /* @__PURE__ */ jsx13("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
5123
- /* @__PURE__ */ jsx13("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
5197
+ /* @__PURE__ */ jsx14("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
5198
+ /* @__PURE__ */ jsx14("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
5124
5199
  ]
5125
5200
  }
5126
5201
  ),
@@ -5132,8 +5207,8 @@ function RecordGrid({
5132
5207
  }
5133
5208
  function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
5134
5209
  const noun = kind === "changed" ? `proposed change to ${rowLabel}` : kind === "added" ? `new row ${rowLabel}` : `removal of ${rowLabel}`;
5135
- return /* @__PURE__ */ jsxs11("span", { className: "inline-flex items-center gap-1.5", children: [
5136
- onReject && /* @__PURE__ */ jsx13(
5210
+ return /* @__PURE__ */ jsxs12("span", { className: "inline-flex items-center gap-1.5", children: [
5211
+ onReject && /* @__PURE__ */ jsx14(
5137
5212
  "button",
5138
5213
  {
5139
5214
  type: "button",
@@ -5143,7 +5218,7 @@ function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }) {
5143
5218
  children: "Reject"
5144
5219
  }
5145
5220
  ),
5146
- onAccept && /* @__PURE__ */ jsx13(
5221
+ onAccept && /* @__PURE__ */ jsx14(
5147
5222
  "button",
5148
5223
  {
5149
5224
  type: "button",
@@ -5164,7 +5239,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
5164
5239
  className: INPUT_CLASS
5165
5240
  };
5166
5241
  if (column.kind === "select") {
5167
- return /* @__PURE__ */ jsxs11(
5242
+ return /* @__PURE__ */ jsxs12(
5168
5243
  "select",
5169
5244
  {
5170
5245
  ...shared,
@@ -5181,8 +5256,8 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
5181
5256
  },
5182
5257
  onBlur: () => onCommit(text),
5183
5258
  children: [
5184
- /* @__PURE__ */ jsx13("option", { value: "", children: "\u2014" }),
5185
- column.options.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
5259
+ /* @__PURE__ */ jsx14("option", { value: "", children: "\u2014" }),
5260
+ column.options.map((option) => /* @__PURE__ */ jsx14("option", { value: option.value, children: option.label }, option.value))
5186
5261
  ]
5187
5262
  }
5188
5263
  );
@@ -5200,7 +5275,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
5200
5275
  }
5201
5276
  };
5202
5277
  if (column.kind === "text" && column.multiline === true) {
5203
- return /* @__PURE__ */ jsx13(
5278
+ return /* @__PURE__ */ jsx14(
5204
5279
  "textarea",
5205
5280
  {
5206
5281
  ...shared,
@@ -5212,7 +5287,7 @@ function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCo
5212
5287
  }
5213
5288
  );
5214
5289
  }
5215
- return /* @__PURE__ */ jsx13(
5290
+ return /* @__PURE__ */ jsx14(
5216
5291
  "input",
5217
5292
  {
5218
5293
  ...shared,
@@ -5234,8 +5309,8 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5234
5309
  [onToggle]
5235
5310
  );
5236
5311
  const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen);
5237
- return /* @__PURE__ */ jsxs11("span", { ref: containerRef, className: "relative inline-flex", children: [
5238
- /* @__PURE__ */ jsx13(
5312
+ return /* @__PURE__ */ jsxs12("span", { ref: containerRef, className: "relative inline-flex", children: [
5313
+ /* @__PURE__ */ jsx14(
5239
5314
  "button",
5240
5315
  {
5241
5316
  type: "button",
@@ -5248,7 +5323,7 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5248
5323
  onToggle();
5249
5324
  },
5250
5325
  className: `inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border ${BASIS_TONES2[basis]}`,
5251
- children: /* @__PURE__ */ jsx13(
5326
+ children: /* @__PURE__ */ jsx14(
5252
5327
  "svg",
5253
5328
  {
5254
5329
  viewBox: "0 0 24 24",
@@ -5258,12 +5333,12 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5258
5333
  strokeWidth: "2.5",
5259
5334
  strokeLinecap: "round",
5260
5335
  "aria-hidden": true,
5261
- children: /* @__PURE__ */ jsx13("path", { d: "M9 8h6M9 12h6M9 16h3" })
5336
+ children: /* @__PURE__ */ jsx14("path", { d: "M9 8h6M9 12h6M9 16h3" })
5262
5337
  }
5263
5338
  )
5264
5339
  }
5265
5340
  ),
5266
- /* @__PURE__ */ jsxs11(
5341
+ /* @__PURE__ */ jsxs12(
5267
5342
  PopoverSurface,
5268
5343
  {
5269
5344
  open,
@@ -5273,17 +5348,17 @@ function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle
5273
5348
  panelRef,
5274
5349
  className: `w-64 rounded-lg border border-card-edge bg-popover p-3 text-left ${OVERLAY_SHADOW}`,
5275
5350
  children: [
5276
- source.quote && /* @__PURE__ */ jsxs11("span", { className: "block border-l-2 border-primary/50 pl-2 text-xs italic leading-snug text-foreground", children: [
5351
+ source.quote && /* @__PURE__ */ jsxs12("span", { className: "block border-l-2 border-primary/50 pl-2 text-xs italic leading-snug text-foreground", children: [
5277
5352
  "\u201C",
5278
5353
  source.quote,
5279
5354
  "\u201D"
5280
5355
  ] }),
5281
- /* @__PURE__ */ jsxs11("span", { className: "mt-2 block text-xs text-muted-foreground", children: [
5356
+ /* @__PURE__ */ jsxs12("span", { className: "mt-2 block text-xs text-muted-foreground", children: [
5282
5357
  source.label ?? "Source",
5283
5358
  source.locator ? ` \xB7 ${source.locator}` : "",
5284
5359
  ` \xB7 ${BASIS_TITLES[basis]}`
5285
5360
  ] }),
5286
- source.href && /* @__PURE__ */ jsx13(
5361
+ source.href && /* @__PURE__ */ jsx14(
5287
5362
  "a",
5288
5363
  {
5289
5364
  href: source.href,
@@ -5312,7 +5387,7 @@ function AddRecordForm({
5312
5387
  onCancel
5313
5388
  }) {
5314
5389
  const groups = useMemo5(() => groupColumns(columns), [columns]);
5315
- return /* @__PURE__ */ jsxs11(
5390
+ return /* @__PURE__ */ jsxs12(
5316
5391
  "form",
5317
5392
  {
5318
5393
  noValidate: true,
@@ -5323,31 +5398,31 @@ function AddRecordForm({
5323
5398
  },
5324
5399
  className: "space-y-4 rounded-xl border border-card-edge bg-card p-4",
5325
5400
  children: [
5326
- /* @__PURE__ */ jsx13("h3", { className: "text-sm font-semibold text-foreground", children: label }),
5327
- formError !== null && /* @__PURE__ */ jsx13("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
5401
+ /* @__PURE__ */ jsx14("h3", { className: "text-sm font-semibold text-foreground", children: label }),
5402
+ formError !== null && /* @__PURE__ */ jsx14("p", { role: "alert", className: "rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive", children: formError }),
5328
5403
  groups.map((group) => {
5329
5404
  const fields = group.columns.filter((column) => isRecordGridCellApplicable(column, draft));
5330
5405
  if (fields.length === 0) return null;
5331
- return /* @__PURE__ */ jsxs11(
5406
+ return /* @__PURE__ */ jsxs12(
5332
5407
  "fieldset",
5333
5408
  {
5334
5409
  className: group.label === null ? "min-w-0" : "min-w-0 rounded-lg border border-card-edge p-3",
5335
5410
  children: [
5336
- group.label !== null && /* @__PURE__ */ jsx13("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
5337
- /* @__PURE__ */ jsx13("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
5411
+ group.label !== null && /* @__PURE__ */ jsx14("legend", { className: "px-1 text-xs font-medium text-muted-foreground", children: group.label }),
5412
+ /* @__PURE__ */ jsx14("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map((column) => {
5338
5413
  const fieldId = `${fieldPrefix}-${column.id}`;
5339
5414
  const errorId = `${fieldId}-error`;
5340
5415
  const message = errors[column.id];
5341
- return /* @__PURE__ */ jsxs11(
5416
+ return /* @__PURE__ */ jsxs12(
5342
5417
  "div",
5343
5418
  {
5344
5419
  className: column.kind === "text" && column.multiline === true ? "sm:col-span-2" : "",
5345
5420
  children: [
5346
- /* @__PURE__ */ jsxs11("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
5421
+ /* @__PURE__ */ jsxs12("label", { htmlFor: fieldId, className: "mb-1 block text-xs font-medium text-muted-foreground", children: [
5347
5422
  column.header,
5348
- column.required === true && /* @__PURE__ */ jsx13("span", { className: "ml-0.5 text-destructive", children: "*" })
5423
+ column.required === true && /* @__PURE__ */ jsx14("span", { className: "ml-0.5 text-destructive", children: "*" })
5349
5424
  ] }),
5350
- /* @__PURE__ */ jsx13(
5425
+ /* @__PURE__ */ jsx14(
5351
5426
  DraftField,
5352
5427
  {
5353
5428
  column,
@@ -5358,8 +5433,8 @@ function AddRecordForm({
5358
5433
  onValue: (next) => setDraft({ ...draft, [column.id]: next })
5359
5434
  }
5360
5435
  ),
5361
- column.hint && /* @__PURE__ */ jsx13("p", { className: "mt-1 text-xs text-muted-foreground", children: column.hint }),
5362
- message !== void 0 && /* @__PURE__ */ jsx13("p", { id: errorId, role: "alert", className: "mt-1 text-xs text-destructive", children: message })
5436
+ column.hint && /* @__PURE__ */ jsx14("p", { className: "mt-1 text-xs text-muted-foreground", children: column.hint }),
5437
+ message !== void 0 && /* @__PURE__ */ jsx14("p", { id: errorId, role: "alert", className: "mt-1 text-xs text-destructive", children: message })
5363
5438
  ]
5364
5439
  },
5365
5440
  column.id
@@ -5370,8 +5445,8 @@ function AddRecordForm({
5370
5445
  group.label ?? "_"
5371
5446
  );
5372
5447
  }),
5373
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
5374
- /* @__PURE__ */ jsx13(
5448
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
5449
+ /* @__PURE__ */ jsx14(
5375
5450
  "button",
5376
5451
  {
5377
5452
  type: "submit",
@@ -5380,7 +5455,7 @@ function AddRecordForm({
5380
5455
  children: busy ? "Saving\u2026" : "Save"
5381
5456
  }
5382
5457
  ),
5383
- /* @__PURE__ */ jsx13(
5458
+ /* @__PURE__ */ jsx14(
5384
5459
  "button",
5385
5460
  {
5386
5461
  type: "button",
@@ -5401,7 +5476,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5401
5476
  "aria-describedby": describedBy
5402
5477
  };
5403
5478
  if (column.kind === "boolean") {
5404
- return /* @__PURE__ */ jsx13(
5479
+ return /* @__PURE__ */ jsx14(
5405
5480
  "input",
5406
5481
  {
5407
5482
  ...shared,
@@ -5413,7 +5488,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5413
5488
  );
5414
5489
  }
5415
5490
  if (column.kind === "select") {
5416
- return /* @__PURE__ */ jsxs11(
5491
+ return /* @__PURE__ */ jsxs12(
5417
5492
  "select",
5418
5493
  {
5419
5494
  ...shared,
@@ -5421,14 +5496,14 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5421
5496
  value: typeof value === "string" ? value : "",
5422
5497
  onChange: (event) => onValue(event.target.value === "" ? null : event.target.value),
5423
5498
  children: [
5424
- /* @__PURE__ */ jsx13("option", { value: "", children: "\u2014" }),
5425
- column.options.map((option) => /* @__PURE__ */ jsx13("option", { value: option.value, children: option.label }, option.value))
5499
+ /* @__PURE__ */ jsx14("option", { value: "", children: "\u2014" }),
5500
+ column.options.map((option) => /* @__PURE__ */ jsx14("option", { value: option.value, children: option.label }, option.value))
5426
5501
  ]
5427
5502
  }
5428
5503
  );
5429
5504
  }
5430
5505
  if (column.kind === "text" && column.multiline === true) {
5431
- return /* @__PURE__ */ jsx13(
5506
+ return /* @__PURE__ */ jsx14(
5432
5507
  "textarea",
5433
5508
  {
5434
5509
  ...shared,
@@ -5440,7 +5515,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5440
5515
  );
5441
5516
  }
5442
5517
  if (column.kind === "number" || column.kind === "currency") {
5443
- return /* @__PURE__ */ jsx13(
5518
+ return /* @__PURE__ */ jsx14(
5444
5519
  "input",
5445
5520
  {
5446
5521
  ...shared,
@@ -5460,7 +5535,7 @@ function DraftField({ column, id, value, invalid, describedBy, onValue }) {
5460
5535
  }
5461
5536
  );
5462
5537
  }
5463
- return /* @__PURE__ */ jsx13(
5538
+ return /* @__PURE__ */ jsx14(
5464
5539
  "input",
5465
5540
  {
5466
5541
  ...shared,
@@ -5479,14 +5554,14 @@ import {
5479
5554
  useId as useId4,
5480
5555
  useMemo as useMemo6,
5481
5556
  useRef as useRef10,
5482
- useState as useState15
5557
+ useState as useState16
5483
5558
  } from "react";
5484
5559
  import { createPortal } from "react-dom";
5485
- import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
5560
+ import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
5486
5561
  function SearchGlyph({ className }) {
5487
- return /* @__PURE__ */ jsxs12("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
5488
- /* @__PURE__ */ jsx14("circle", { cx: "11", cy: "11", r: "8" }),
5489
- /* @__PURE__ */ jsx14("path", { d: "m21 21-4.3-4.3" })
5562
+ return /* @__PURE__ */ jsxs13("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
5563
+ /* @__PURE__ */ jsx15("circle", { cx: "11", cy: "11", r: "8" }),
5564
+ /* @__PURE__ */ jsx15("path", { d: "m21 21-4.3-4.3" })
5490
5565
  ] });
5491
5566
  }
5492
5567
  function CommandPalette({
@@ -5501,7 +5576,7 @@ function CommandPalette({
5501
5576
  emptyMessage,
5502
5577
  label = "Command palette"
5503
5578
  }) {
5504
- const [internalOpen, setInternalOpen] = useState15(false);
5579
+ const [internalOpen, setInternalOpen] = useState16(false);
5505
5580
  const open = controlledOpen ?? internalOpen;
5506
5581
  const setOpen = useCallback8(
5507
5582
  (next) => {
@@ -5510,8 +5585,8 @@ function CommandPalette({
5510
5585
  },
5511
5586
  [controlledOpen, onOpenChange]
5512
5587
  );
5513
- const [query, setQuery] = useState15(initialQuery ?? "");
5514
- const [active, setActive] = useState15(0);
5588
+ const [query, setQuery] = useState16(initialQuery ?? "");
5589
+ const [active, setActive] = useState16(0);
5515
5590
  const inputRef = useRef10(null);
5516
5591
  const surfaceId = useId4();
5517
5592
  const listId = `${surfaceId}-list`;
@@ -5573,8 +5648,8 @@ function CommandPalette({
5573
5648
  if (!open || typeof document === "undefined") return null;
5574
5649
  let rowIndex = -1;
5575
5650
  return createPortal(
5576
- /* @__PURE__ */ jsxs12(Fragment7, { children: [
5577
- /* @__PURE__ */ jsx14(
5651
+ /* @__PURE__ */ jsxs13(Fragment7, { children: [
5652
+ /* @__PURE__ */ jsx15(
5578
5653
  "div",
5579
5654
  {
5580
5655
  "aria-hidden": true,
@@ -5583,7 +5658,7 @@ function CommandPalette({
5583
5658
  className: "fixed inset-0 z-[999] bg-background/80"
5584
5659
  }
5585
5660
  ),
5586
- /* @__PURE__ */ jsx14("div", { className: "pointer-events-none fixed inset-x-0 top-[15%] z-[1000] flex justify-center px-4", children: /* @__PURE__ */ jsxs12(
5661
+ /* @__PURE__ */ jsx15("div", { className: "pointer-events-none fixed inset-x-0 top-[15%] z-[1000] flex justify-center px-4", children: /* @__PURE__ */ jsxs13(
5587
5662
  "div",
5588
5663
  {
5589
5664
  role: "dialog",
@@ -5592,9 +5667,9 @@ function CommandPalette({
5592
5667
  ...{ [POPOVER_SURFACE_ATTR]: surfaceId },
5593
5668
  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}`,
5594
5669
  children: [
5595
- /* @__PURE__ */ jsxs12("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
5596
- /* @__PURE__ */ jsx14(SearchGlyph, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5597
- /* @__PURE__ */ jsx14(
5670
+ /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center gap-2 border-b border-border px-3 py-2.5", children: [
5671
+ /* @__PURE__ */ jsx15(SearchGlyph, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
5672
+ /* @__PURE__ */ jsx15(
5598
5673
  "input",
5599
5674
  {
5600
5675
  ref: inputRef,
@@ -5615,15 +5690,15 @@ function CommandPalette({
5615
5690
  }
5616
5691
  )
5617
5692
  ] }),
5618
- /* @__PURE__ */ jsxs12("div", { role: "listbox", id: listId, className: "min-h-0 flex-1 overflow-y-auto p-1 pb-2", children: [
5619
- loading && /* @__PURE__ */ jsx14("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading\u2026" }),
5620
- !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") }),
5621
- !loading && sections.map((section) => /* @__PURE__ */ jsxs12("div", { children: [
5622
- /* @__PURE__ */ jsx14("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.group }),
5693
+ /* @__PURE__ */ jsxs13("div", { role: "listbox", id: listId, className: "min-h-0 flex-1 overflow-y-auto p-1 pb-2", children: [
5694
+ loading && /* @__PURE__ */ jsx15("div", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "Loading\u2026" }),
5695
+ !loading && flat.length === 0 && /* @__PURE__ */ jsx15("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") }),
5696
+ !loading && sections.map((section) => /* @__PURE__ */ jsxs13("div", { children: [
5697
+ /* @__PURE__ */ jsx15("div", { className: "px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: section.group }),
5623
5698
  section.items.map((item) => {
5624
5699
  rowIndex += 1;
5625
5700
  const index = rowIndex;
5626
- return /* @__PURE__ */ jsxs12(
5701
+ return /* @__PURE__ */ jsxs13(
5627
5702
  "div",
5628
5703
  {
5629
5704
  id: `${listId}-${index}`,
@@ -5633,9 +5708,9 @@ function CommandPalette({
5633
5708
  onClick: () => choose(item),
5634
5709
  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" : ""}`,
5635
5710
  children: [
5636
- /* @__PURE__ */ jsx14("span", { className: "truncate text-foreground", children: item.label }),
5637
- item.description && /* @__PURE__ */ jsx14("span", { className: "truncate text-xs text-muted-foreground", children: item.description }),
5638
- item.hint && /* @__PURE__ */ jsx14("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-muted-foreground", children: item.hint })
5711
+ /* @__PURE__ */ jsx15("span", { className: "truncate text-foreground", children: item.label }),
5712
+ item.description && /* @__PURE__ */ jsx15("span", { className: "truncate text-xs text-muted-foreground", children: item.description }),
5713
+ item.hint && /* @__PURE__ */ jsx15("span", { className: "ml-auto shrink-0 text-xs tabular-nums text-muted-foreground", children: item.hint })
5639
5714
  ]
5640
5715
  },
5641
5716
  item.id
@@ -5643,15 +5718,15 @@ function CommandPalette({
5643
5718
  })
5644
5719
  ] }, section.group))
5645
5720
  ] }),
5646
- /* @__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: [
5647
- /* @__PURE__ */ jsx14("span", { className: "tabular-nums", children: query.trim() ? `${flat.length} of ${items.length}` : `${items.length} items` }),
5648
- /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-1.5", children: [
5649
- /* @__PURE__ */ jsx14("kbd", { className: "rounded border border-border bg-background px-1 py-0.5", children: "\u2191\u2193" }),
5650
- /* @__PURE__ */ jsx14("span", { children: "navigate" }),
5651
- /* @__PURE__ */ jsx14("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "\u21B5" }),
5652
- /* @__PURE__ */ jsx14("span", { children: "select" }),
5653
- /* @__PURE__ */ jsx14("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "esc" }),
5654
- /* @__PURE__ */ jsx14("span", { children: "close" })
5721
+ /* @__PURE__ */ jsxs13("div", { className: "flex shrink-0 items-center justify-between border-t border-border px-3 py-2 text-xs text-muted-foreground", children: [
5722
+ /* @__PURE__ */ jsx15("span", { className: "tabular-nums", children: query.trim() ? `${flat.length} of ${items.length}` : `${items.length} items` }),
5723
+ /* @__PURE__ */ jsxs13("span", { className: "flex items-center gap-1.5", children: [
5724
+ /* @__PURE__ */ jsx15("kbd", { className: "rounded border border-border bg-background px-1 py-0.5", children: "\u2191\u2193" }),
5725
+ /* @__PURE__ */ jsx15("span", { children: "navigate" }),
5726
+ /* @__PURE__ */ jsx15("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "\u21B5" }),
5727
+ /* @__PURE__ */ jsx15("span", { children: "select" }),
5728
+ /* @__PURE__ */ jsx15("kbd", { className: "ml-1.5 rounded border border-border bg-background px-1 py-0.5", children: "esc" }),
5729
+ /* @__PURE__ */ jsx15("span", { children: "close" })
5655
5730
  ] })
5656
5731
  ] })
5657
5732
  ]
@@ -5663,7 +5738,7 @@ function CommandPalette({
5663
5738
  }
5664
5739
 
5665
5740
  // src/web-react/sparkline.tsx
5666
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
5741
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
5667
5742
  var DEFAULT_SPARKLINE_WIDTH = 96;
5668
5743
  var DEFAULT_SPARKLINE_HEIGHT = 24;
5669
5744
  var DEFAULT_INSET = 2.5;
@@ -5769,21 +5844,21 @@ function Sparkline({
5769
5844
  const geometry = sparklineGeometry(values, { width, height });
5770
5845
  const accessibleName = sparklineLabel(values, { label, format });
5771
5846
  if (geometry.points.length === 0) {
5772
- return /* @__PURE__ */ jsxs13(
5847
+ return /* @__PURE__ */ jsxs14(
5773
5848
  "span",
5774
5849
  {
5775
5850
  "data-sparkline": geometry.gaps > 0 ? "unavailable" : "empty",
5776
5851
  className: joinClasses("text-[11px] text-muted-foreground", className),
5777
5852
  children: [
5778
- /* @__PURE__ */ jsx15("span", { className: "sr-only", children: accessibleName }),
5779
- /* @__PURE__ */ jsx15("span", { "aria-hidden": "true", children: geometry.gaps > 0 ? unavailableLabel : emptyLabel })
5853
+ /* @__PURE__ */ jsx16("span", { className: "sr-only", children: accessibleName }),
5854
+ /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: geometry.gaps > 0 ? unavailableLabel : emptyLabel })
5780
5855
  ]
5781
5856
  }
5782
5857
  );
5783
5858
  }
5784
5859
  const drawsLine = geometry.segments.some((segment) => segment.length > 1);
5785
5860
  const end = geometry.points[geometry.points.length - 1];
5786
- return /* @__PURE__ */ jsxs13(
5861
+ return /* @__PURE__ */ jsxs14(
5787
5862
  "svg",
5788
5863
  {
5789
5864
  role: "img",
@@ -5800,7 +5875,7 @@ function Sparkline({
5800
5875
  geometry.segments.map((segment, index) => {
5801
5876
  const key = `segment-${index}`;
5802
5877
  if (segment.length > 1) {
5803
- return /* @__PURE__ */ jsx15(
5878
+ return /* @__PURE__ */ jsx16(
5804
5879
  "polyline",
5805
5880
  {
5806
5881
  points: sparklinePointsAttribute(segment),
@@ -5816,9 +5891,9 @@ function Sparkline({
5816
5891
  }
5817
5892
  const only = segment[0];
5818
5893
  if (only.x === end.x && only.y === end.y) return null;
5819
- return /* @__PURE__ */ jsx15("circle", { cx: only.x, cy: only.y, r: DOT_RADIUS, fill: "currentColor" }, key);
5894
+ return /* @__PURE__ */ jsx16("circle", { cx: only.x, cy: only.y, r: DOT_RADIUS, fill: "currentColor" }, key);
5820
5895
  }),
5821
- /* @__PURE__ */ jsx15("circle", { cx: end.x, cy: end.y, r: DOT_RADIUS, fill: "currentColor" })
5896
+ /* @__PURE__ */ jsx16("circle", { cx: end.x, cy: end.y, r: DOT_RADIUS, fill: "currentColor" })
5822
5897
  ]
5823
5898
  }
5824
5899
  );
@@ -5830,9 +5905,9 @@ import {
5830
5905
  useCallback as useCallback9,
5831
5906
  useEffect as useEffect11,
5832
5907
  useRef as useRef11,
5833
- useState as useState16
5908
+ useState as useState17
5834
5909
  } from "react";
5835
- import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
5910
+ import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
5836
5911
  function insightDelta(value, previous) {
5837
5912
  if (typeof value !== "number" || !Number.isFinite(value)) return null;
5838
5913
  if (typeof previous !== "number" || !Number.isFinite(previous)) return null;
@@ -5885,7 +5960,7 @@ function InsightCard({
5885
5960
  const tone = delta ? insightDeltaTone(delta.direction, polarity) : "neutral";
5886
5961
  const unavailable = typeof value === "number" && !Number.isFinite(value);
5887
5962
  const shown = typeof value === "number" ? format(value) : value;
5888
- return /* @__PURE__ */ jsxs14(
5963
+ return /* @__PURE__ */ jsxs15(
5889
5964
  "article",
5890
5965
  {
5891
5966
  "data-insight-card": "",
@@ -5893,40 +5968,40 @@ function InsightCard({
5893
5968
  className: joinClasses("agent-arrive flex h-full flex-col rounded-xl border border-card-edge bg-card p-4", className),
5894
5969
  style,
5895
5970
  children: [
5896
- 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,
5897
- /* @__PURE__ */ jsxs14("div", { className: "flex items-baseline justify-between gap-2", children: [
5898
- /* @__PURE__ */ jsx16("h3", { className: "text-[13px] font-medium text-muted-foreground", children: title }),
5971
+ eyebrow ? /* @__PURE__ */ jsx17("p", { "data-insight-eyebrow": "", className: "mb-0.5 text-[11px] font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: eyebrow }) : null,
5972
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-baseline justify-between gap-2", children: [
5973
+ /* @__PURE__ */ jsx17("h3", { className: "text-[13px] font-medium text-muted-foreground", children: title }),
5899
5974
  live ? (
5900
5975
  // No `data-motion` opt-out: the word is the signal and the sweep is
5901
5976
  // emphasis, so the reduced-motion floor reaches this like everything
5902
5977
  // else and leaves a static, legible label.
5903
- /* @__PURE__ */ jsx16("span", { className: "agent-shimmer shrink-0 text-[11px] font-medium", "data-insight-live": "", children: liveLabel })
5978
+ /* @__PURE__ */ jsx17("span", { className: "agent-shimmer shrink-0 text-[11px] font-medium", "data-insight-live": "", children: liveLabel })
5904
5979
  ) : null
5905
5980
  ] }),
5906
- /* @__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: [
5907
- /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: INSIGHT_UNAVAILABLE_GLYPH }),
5908
- /* @__PURE__ */ jsx16("span", { className: "sr-only", children: INSIGHT_UNAVAILABLE_LABEL })
5909
- ] }) : /* @__PURE__ */ jsxs14(Fragment8, { children: [
5910
- /* @__PURE__ */ jsx16("span", { className: "text-xl font-semibold tabular-nums text-foreground", children: shown }),
5911
- unit ? /* @__PURE__ */ jsx16("span", { className: "text-[11px] text-muted-foreground", children: unit }) : null
5981
+ /* @__PURE__ */ jsx17("p", { className: "mt-1 flex items-baseline gap-1", children: unavailable ? /* @__PURE__ */ jsxs15("span", { "data-insight-value": "unavailable", className: "text-xl font-semibold text-muted-foreground", children: [
5982
+ /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: INSIGHT_UNAVAILABLE_GLYPH }),
5983
+ /* @__PURE__ */ jsx17("span", { className: "sr-only", children: INSIGHT_UNAVAILABLE_LABEL })
5984
+ ] }) : /* @__PURE__ */ jsxs15(Fragment8, { children: [
5985
+ /* @__PURE__ */ jsx17("span", { className: "text-xl font-semibold tabular-nums text-foreground", children: shown }),
5986
+ unit ? /* @__PURE__ */ jsx17("span", { className: "text-[11px] text-muted-foreground", children: unit }) : null
5912
5987
  ] }) }),
5913
- delta ? /* @__PURE__ */ jsxs14("p", { "data-insight-delta": delta.direction, className: `mt-0.5 text-[11px] font-medium ${TONE_CLASS[tone]}`, children: [
5914
- /* @__PURE__ */ jsxs14("span", { "aria-hidden": "true", children: [
5988
+ delta ? /* @__PURE__ */ jsxs15("p", { "data-insight-delta": delta.direction, className: `mt-0.5 text-[11px] font-medium ${TONE_CLASS[tone]}`, children: [
5989
+ /* @__PURE__ */ jsxs15("span", { "aria-hidden": "true", children: [
5915
5990
  DIRECTION_GLYPH[delta.direction],
5916
5991
  " "
5917
5992
  ] }),
5918
5993
  formatInsightDelta(delta, format)
5919
5994
  ] }) : null,
5920
- description ? /* @__PURE__ */ jsx16("p", { className: "mt-1 text-[11px] text-muted-foreground", children: description }) : null,
5921
- series ? /* @__PURE__ */ jsx16("div", { className: "mt-2 text-muted-foreground", children: /* @__PURE__ */ jsx16(Sparkline, { values: series, label: seriesLabel ?? title, format }) }) : null,
5922
- action ? /* @__PURE__ */ jsx16("div", { className: "mt-3", children: renderInsightAction(action) }) : null
5995
+ description ? /* @__PURE__ */ jsx17("p", { className: "mt-1 text-[11px] text-muted-foreground", children: description }) : null,
5996
+ series ? /* @__PURE__ */ jsx17("div", { className: "mt-2 text-muted-foreground", children: /* @__PURE__ */ jsx17(Sparkline, { values: series, label: seriesLabel ?? title, format }) }) : null,
5997
+ action ? /* @__PURE__ */ jsx17("div", { className: "mt-3", children: renderInsightAction(action) }) : null
5923
5998
  ]
5924
5999
  }
5925
6000
  );
5926
6001
  }
5927
6002
  function renderInsightAction(action) {
5928
6003
  if (isValidElement2(action)) return action;
5929
- return /* @__PURE__ */ jsx16(
6004
+ return /* @__PURE__ */ jsx17(
5930
6005
  "button",
5931
6006
  {
5932
6007
  type: "button",
@@ -5995,8 +6070,8 @@ function InsightDeck({
5995
6070
  className,
5996
6071
  onPageChange
5997
6072
  }) {
5998
- const [page, setPage] = useState16(0);
5999
- const [held, setHeld] = useState16(null);
6073
+ const [page, setPage] = useState17(0);
6074
+ const [held, setHeld] = useState17(null);
6000
6075
  const answered = state.status === "error" || state.status === "empty";
6001
6076
  const carried = state.status === "ready" ? state.value : answered ? null : held;
6002
6077
  if (carried !== held) setHeld(carried);
@@ -6011,7 +6086,7 @@ function InsightDeck({
6011
6086
  },
6012
6087
  [onPageChange]
6013
6088
  );
6014
- return /* @__PURE__ */ jsx16(
6089
+ return /* @__PURE__ */ jsx17(
6015
6090
  AsyncView,
6016
6091
  {
6017
6092
  state: shown,
@@ -6019,7 +6094,7 @@ function InsightDeck({
6019
6094
  loadingLabel,
6020
6095
  retryLabel,
6021
6096
  className,
6022
- children: (insights) => /* @__PURE__ */ jsx16(
6097
+ children: (insights) => /* @__PURE__ */ jsx17(
6023
6098
  InsightPages,
6024
6099
  {
6025
6100
  insights,
@@ -6132,7 +6207,7 @@ function InsightPages({
6132
6207
  }
6133
6208
  if (moved) event.preventDefault();
6134
6209
  };
6135
- return /* @__PURE__ */ jsxs14(
6210
+ return /* @__PURE__ */ jsxs15(
6136
6211
  "section",
6137
6212
  {
6138
6213
  ref: sectionRef,
@@ -6144,7 +6219,7 @@ function InsightPages({
6144
6219
  tabIndex: pageCount > 1 ? 0 : void 0,
6145
6220
  "aria-keyshortcuts": pageCount > 1 ? "ArrowLeft ArrowRight PageUp PageDown Home End" : void 0,
6146
6221
  children: [
6147
- /* @__PURE__ */ jsx16("ul", { ref: listRef, className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ id, style, ...card }, index) => (
6222
+ /* @__PURE__ */ jsx17("ul", { ref: listRef, className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: visible.map(({ id, style, ...card }, index) => (
6148
6223
  // The page index is in the key on purpose: a page turn is an arrival,
6149
6224
  // and reusing the node would swap the text under a card that never
6150
6225
  // moved. Remounting replays `.agent-arrive` with the new stagger.
@@ -6155,10 +6230,10 @@ function InsightPages({
6155
6230
  // does not arrive a second time. The key does BOTH jobs — but only
6156
6231
  // because the deck now keeps this subtree mounted across a reload
6157
6232
  // (see `InsightDeck`); a key is never compared across a teardown.
6158
- /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(InsightCard, { ...card, style: staggerStyle(index, style) }) }, `${current}:${id}`)
6233
+ /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17(InsightCard, { ...card, style: staggerStyle(index, style) }) }, `${current}:${id}`)
6159
6234
  )) }),
6160
- /* @__PURE__ */ jsxs14("div", { className: pageCount > 1 ? "flex items-center justify-between gap-2" : void 0, children: [
6161
- /* @__PURE__ */ jsxs14(
6235
+ /* @__PURE__ */ jsxs15("div", { className: pageCount > 1 ? "flex items-center justify-between gap-2" : void 0, children: [
6236
+ /* @__PURE__ */ jsxs15(
6162
6237
  "p",
6163
6238
  {
6164
6239
  role: "status",
@@ -6172,8 +6247,8 @@ function InsightPages({
6172
6247
  ]
6173
6248
  }
6174
6249
  ),
6175
- pageCount > 1 ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1", children: [
6176
- /* @__PURE__ */ jsx16(PagerButton, { label: "Previous insights", glyph: "\u2039", atEnd: current === 0, onClick: () => goTo(current - 1) }),
6250
+ pageCount > 1 ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
6251
+ /* @__PURE__ */ jsx17(PagerButton, { label: "Previous insights", glyph: "\u2039", atEnd: current === 0, onClick: () => goTo(current - 1) }),
6177
6252
  pageCount <= MAX_PAGE_DOTS ? Array.from({ length: pageCount }, (_, index) => (
6178
6253
  // WCAG 2.2 SC 2.5.8 wants a 24x24 CSS px target. The dot stays
6179
6254
  // 8px because a 24px dot is a different control; the BUTTON
@@ -6181,7 +6256,7 @@ function InsightPages({
6181
6256
  // and the span is the graphic. The Spacing exception cannot
6182
6257
  // rescue the bare dot — at a 12px pitch the 24px circle around
6183
6258
  // each centre overlaps its neighbour's.
6184
- /* @__PURE__ */ jsx16(
6259
+ /* @__PURE__ */ jsx17(
6185
6260
  "button",
6186
6261
  {
6187
6262
  type: "button",
@@ -6189,7 +6264,7 @@ function InsightPages({
6189
6264
  "aria-current": index === current ? "page" : void 0,
6190
6265
  onClick: () => goTo(index),
6191
6266
  className: "group flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
6192
- children: /* @__PURE__ */ jsx16(
6267
+ children: /* @__PURE__ */ jsx17(
6193
6268
  "span",
6194
6269
  {
6195
6270
  "aria-hidden": "true",
@@ -6203,7 +6278,7 @@ function InsightPages({
6203
6278
  index
6204
6279
  )
6205
6280
  )) : null,
6206
- /* @__PURE__ */ jsx16(
6281
+ /* @__PURE__ */ jsx17(
6207
6282
  PagerButton,
6208
6283
  {
6209
6284
  label: "Next insights",
@@ -6224,7 +6299,7 @@ function PagerButton({
6224
6299
  atEnd,
6225
6300
  onClick
6226
6301
  }) {
6227
- return /* @__PURE__ */ jsx16(
6302
+ return /* @__PURE__ */ jsx17(
6228
6303
  "button",
6229
6304
  {
6230
6305
  type: "button",
@@ -6234,14 +6309,14 @@ function PagerButton({
6234
6309
  if (!atEnd) onClick();
6235
6310
  },
6236
6311
  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"}`,
6237
- children: /* @__PURE__ */ jsx16("span", { "aria-hidden": "true", children: glyph })
6312
+ children: /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", children: glyph })
6238
6313
  }
6239
6314
  );
6240
6315
  }
6241
6316
 
6242
6317
  // src/web-react/api-access-panel.tsx
6243
- import { useEffect as useEffect12, useRef as useRef12, useState as useState17 } from "react";
6244
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
6318
+ import { useEffect as useEffect12, useRef as useRef12, useState as useState18 } from "react";
6319
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
6245
6320
  var defaultExpiryChoices = [1, 7, 30];
6246
6321
  var inputClass = "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm text-foreground";
6247
6322
  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";
@@ -6293,17 +6368,17 @@ function ApiAccessPanel({
6293
6368
  onRevoke,
6294
6369
  onChanged
6295
6370
  }) {
6296
- const [name, setName] = useState17("");
6371
+ const [name, setName] = useState18("");
6297
6372
  const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
6298
6373
  const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
6299
- const [days, setDays] = useState17(fallbackDays);
6374
+ const [days, setDays] = useState18(fallbackDays);
6300
6375
  const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
6301
- const [scopes, setScopes] = useState17(() => expandScopes(defaultScopes, access));
6302
- const [creating, setCreating] = useState17(false);
6303
- const [revoking, setRevoking] = useState17(null);
6304
- const [created, setCreated] = useState17(null);
6305
- const [notice, setNotice] = useState17(null);
6306
- const [error, setError] = useState17(null);
6376
+ const [scopes, setScopes] = useState18(() => expandScopes(defaultScopes, access));
6377
+ const [creating, setCreating] = useState18(false);
6378
+ const [revoking, setRevoking] = useState18(null);
6379
+ const [created, setCreated] = useState18(null);
6380
+ const [notice, setNotice] = useState18(null);
6381
+ const [error, setError] = useState18(null);
6307
6382
  const keyHeading = useRef12(null);
6308
6383
  const nameInput = useRef12(null);
6309
6384
  const keyWasShown = useRef12(false);
@@ -6359,20 +6434,20 @@ function ApiAccessPanel({
6359
6434
  setRevoking(null);
6360
6435
  }
6361
6436
  }
6362
- 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: [
6363
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
6364
- accountHref && /* @__PURE__ */ jsx17("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6365
- /* @__PURE__ */ jsx17("h1", { className: "text-2xl font-semibold text-foreground", children: "API access" }),
6366
- /* @__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." })
6437
+ return /* @__PURE__ */ jsx18("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs16("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
6438
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
6439
+ accountHref && /* @__PURE__ */ jsx18("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6440
+ /* @__PURE__ */ jsx18("h1", { className: "text-2xl font-semibold text-foreground", children: "API access" }),
6441
+ /* @__PURE__ */ jsx18("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." })
6367
6442
  ] }),
6368
- error && /* @__PURE__ */ jsx17("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6369
- notice && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6370
- created ? /* @__PURE__ */ jsxs15("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6371
- /* @__PURE__ */ jsx17("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6372
- /* @__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." }),
6373
- /* @__PURE__ */ jsxs15("div", { className: "flex gap-2", children: [
6374
- /* @__PURE__ */ jsx17("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
6375
- /* @__PURE__ */ jsx17("button", { className: buttonClass, onClick: async () => {
6443
+ error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6444
+ notice && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6445
+ created ? /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6446
+ /* @__PURE__ */ jsx18("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6447
+ /* @__PURE__ */ jsx18("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." }),
6448
+ /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
6449
+ /* @__PURE__ */ jsx18("input", { "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: `${inputClass} min-w-0 font-mono` }),
6450
+ /* @__PURE__ */ jsx18("button", { className: buttonClass, onClick: async () => {
6376
6451
  try {
6377
6452
  await navigator.clipboard.writeText(created.key);
6378
6453
  setNotice("Key copied");
@@ -6381,32 +6456,32 @@ function ApiAccessPanel({
6381
6456
  }
6382
6457
  }, children: "Copy key" })
6383
6458
  ] }),
6384
- /* @__PURE__ */ jsx17("button", { className: outlineClass, onClick: () => {
6459
+ /* @__PURE__ */ jsx18("button", { className: outlineClass, onClick: () => {
6385
6460
  setCreated(null);
6386
6461
  setNotice(null);
6387
6462
  }, children: "I\u2019ve saved it" })
6388
- ] }) : /* @__PURE__ */ jsxs15("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6389
- /* @__PURE__ */ jsx17("h2", { className: "font-medium", children: "Create a key" }),
6390
- /* @__PURE__ */ jsxs15("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6391
- /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
6392
- /* @__PURE__ */ jsx17("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6393
- /* @__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" })
6463
+ ] }) : /* @__PURE__ */ jsxs16("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6464
+ /* @__PURE__ */ jsx18("h2", { className: "font-medium", children: "Create a key" }),
6465
+ /* @__PURE__ */ jsxs16("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6466
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
6467
+ /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6468
+ /* @__PURE__ */ jsx18("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" })
6394
6469
  ] }),
6395
- /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
6396
- /* @__PURE__ */ jsx17("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6397
- /* @__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: [
6470
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
6471
+ /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6472
+ /* @__PURE__ */ jsx18("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__ */ jsxs16("option", { value: days2, children: [
6398
6473
  days2,
6399
6474
  " ",
6400
6475
  days2 === 1 ? "day" : "days"
6401
6476
  ] }, days2)) })
6402
6477
  ] })
6403
6478
  ] }),
6404
- /* @__PURE__ */ jsxs15("fieldset", { className: "space-y-3", children: [
6405
- /* @__PURE__ */ jsx17("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6479
+ /* @__PURE__ */ jsxs16("fieldset", { className: "space-y-3", children: [
6480
+ /* @__PURE__ */ jsx18("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6406
6481
  access.map((option) => {
6407
6482
  const unavailable = !expandScopes([option.scope], access).includes(option.scope);
6408
- return /* @__PURE__ */ jsxs15("label", { className: "flex cursor-pointer items-start gap-3", children: [
6409
- /* @__PURE__ */ jsx17(
6483
+ return /* @__PURE__ */ jsxs16("label", { className: "flex cursor-pointer items-start gap-3", children: [
6484
+ /* @__PURE__ */ jsx18(
6410
6485
  "input",
6411
6486
  {
6412
6487
  type: "checkbox",
@@ -6416,31 +6491,31 @@ function ApiAccessPanel({
6416
6491
  onChange: (event) => setScopes((current) => event.target.checked ? expandScopes([...current, option.scope], access) : pruneScopes(current.filter((scope) => scope !== option.scope), access))
6417
6492
  }
6418
6493
  ),
6419
- /* @__PURE__ */ jsxs15("span", { className: "text-sm", children: [
6420
- /* @__PURE__ */ jsx17("span", { className: "block font-medium", children: option.label }),
6421
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: option.description }),
6422
- unavailable && /* @__PURE__ */ jsx17("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6494
+ /* @__PURE__ */ jsxs16("span", { className: "text-sm", children: [
6495
+ /* @__PURE__ */ jsx18("span", { className: "block font-medium", children: option.label }),
6496
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: option.description }),
6497
+ unavailable && /* @__PURE__ */ jsx18("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6423
6498
  ] })
6424
6499
  ] }, option.scope);
6425
6500
  })
6426
6501
  ] }),
6427
- limitsDescription && /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: limitsDescription }),
6428
- /* @__PURE__ */ jsx17("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6502
+ limitsDescription && /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground", children: limitsDescription }),
6503
+ /* @__PURE__ */ jsx18("button", { className: buttonClass, type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6429
6504
  ] }),
6430
- /* @__PURE__ */ jsxs15("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6431
- /* @__PURE__ */ jsx17("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6432
- 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: [
6433
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 space-y-1", children: [
6434
- /* @__PURE__ */ jsx17("p", { className: "break-words text-sm font-medium", children: key.name }),
6435
- /* @__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" }),
6436
- /* @__PURE__ */ jsx17("p", { className: "text-xs text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") })
6505
+ /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6506
+ /* @__PURE__ */ jsx18("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6507
+ keys.length === 0 ? /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx18("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs16("li", { className: "flex items-start justify-between gap-3 p-4", children: [
6508
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 space-y-1", children: [
6509
+ /* @__PURE__ */ jsx18("p", { className: "break-words text-sm font-medium", children: key.name }),
6510
+ /* @__PURE__ */ jsx18("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" }),
6511
+ /* @__PURE__ */ jsx18("p", { className: "text-xs text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") })
6437
6512
  ] }),
6438
- /* @__PURE__ */ jsx17("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6513
+ /* @__PURE__ */ jsx18("button", { className: outlineClass, disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6439
6514
  ] }, key.id)) })
6440
6515
  ] }),
6441
- /* @__PURE__ */ jsxs15("p", { className: "text-sm text-muted-foreground", children: [
6516
+ /* @__PURE__ */ jsxs16("p", { className: "text-sm text-muted-foreground", children: [
6442
6517
  "Use ",
6443
- /* @__PURE__ */ jsx17("code", { className: "text-xs", children: baseUrl }),
6518
+ /* @__PURE__ */ jsx18("code", { className: "text-xs", children: baseUrl }),
6444
6519
  " as the API base and send the key as a Bearer credential."
6445
6520
  ] })
6446
6521
  ] }) });
@@ -6448,37 +6523,37 @@ function ApiAccessPanel({
6448
6523
 
6449
6524
  // src/web-react/agent-profile-choices.tsx
6450
6525
  import { useId as useId5 } from "react";
6451
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
6526
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
6452
6527
  function AgentProfileChoices({ value, profiles, onChange, disabled, locked, lockReason, onNewChat, label = "Agent profile" }) {
6453
6528
  const name = useId5();
6454
6529
  const selected = profiles.find((profile) => profile.id === value);
6455
6530
  if (locked) {
6456
- return /* @__PURE__ */ jsxs16("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
6457
- /* @__PURE__ */ jsx18("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
6458
- /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
6459
- onNewChat && !disabled && /* @__PURE__ */ jsx18("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
6531
+ return /* @__PURE__ */ jsxs17("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
6532
+ /* @__PURE__ */ jsx19("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
6533
+ /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
6534
+ onNewChat && !disabled && /* @__PURE__ */ jsx19("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
6460
6535
  ] });
6461
6536
  }
6462
- return /* @__PURE__ */ jsxs16("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
6463
- /* @__PURE__ */ jsx18("legend", { className: "sr-only", children: label }),
6464
- /* @__PURE__ */ jsxs16("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
6465
- profiles.map((profile) => /* @__PURE__ */ jsxs16("label", { className: "flex min-h-10 cursor-pointer items-start gap-2 rounded-lg border border-transparent p-2 text-sm hover:bg-muted has-[:checked]:border-border has-[:checked]:bg-muted has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60", children: [
6466
- /* @__PURE__ */ jsx18("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
6537
+ return /* @__PURE__ */ jsxs17("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
6538
+ /* @__PURE__ */ jsx19("legend", { className: "sr-only", children: label }),
6539
+ /* @__PURE__ */ jsxs17("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
6540
+ profiles.map((profile) => /* @__PURE__ */ jsxs17("label", { className: "flex min-h-10 cursor-pointer items-start gap-2 rounded-lg border border-transparent p-2 text-sm hover:bg-muted has-[:checked]:border-border has-[:checked]:bg-muted has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-60", children: [
6541
+ /* @__PURE__ */ jsx19("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
6467
6542
  if (!disabled) onChange(profile.id);
6468
6543
  }, className: "mt-1 shrink-0 accent-primary" }),
6469
- /* @__PURE__ */ jsxs16("span", { className: "min-w-0", children: [
6470
- /* @__PURE__ */ jsx18("span", { className: "block font-medium text-foreground", children: profile.name }),
6471
- profile.description && /* @__PURE__ */ jsx18("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
6544
+ /* @__PURE__ */ jsxs17("span", { className: "min-w-0", children: [
6545
+ /* @__PURE__ */ jsx19("span", { className: "block font-medium text-foreground", children: profile.name }),
6546
+ profile.description && /* @__PURE__ */ jsx19("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
6472
6547
  ] })
6473
6548
  ] }, profile.id)),
6474
- profiles.length === 0 && /* @__PURE__ */ jsx18("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
6549
+ profiles.length === 0 && /* @__PURE__ */ jsx19("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
6475
6550
  ] })
6476
6551
  ] });
6477
6552
  }
6478
6553
 
6479
6554
  // src/web-react/composer-profile-pill.tsx
6480
6555
  import { AgentProfilePicker } from "@tangle-network/sandbox-ui/chat";
6481
- import { jsx as jsx19 } from "react/jsx-runtime";
6556
+ import { jsx as jsx20 } from "react/jsx-runtime";
6482
6557
  var TRIGGER = {
6483
6558
  composer: "max-w-[180px]",
6484
6559
  // A menu panel repoints surface-container to its own tone, which would leave
@@ -6501,7 +6576,7 @@ function ComposerProfilePill({
6501
6576
  placement = "composer",
6502
6577
  className
6503
6578
  }) {
6504
- return /* @__PURE__ */ jsx19(
6579
+ return /* @__PURE__ */ jsx20(
6505
6580
  AgentProfilePicker,
6506
6581
  {
6507
6582
  value: selection.value,
@@ -6523,7 +6598,7 @@ function ComposerProfilePill({
6523
6598
  }
6524
6599
 
6525
6600
  // src/web-react/index.tsx
6526
- import { Fragment as Fragment9, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
6601
+ import { Fragment as Fragment9, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
6527
6602
  function formatModelCost(msg, models) {
6528
6603
  if (msg.promptTokens == null && msg.completionTokens == null) return null;
6529
6604
  const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
@@ -6542,41 +6617,41 @@ function formatTokensPerSecond(msg) {
6542
6617
  return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
6543
6618
  }
6544
6619
  function RunDrillIn({ run, onClose }) {
6545
- return /* @__PURE__ */ jsxs17("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: [
6546
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6547
- /* @__PURE__ */ jsx20(
6620
+ return /* @__PURE__ */ jsxs18("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: [
6621
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6622
+ /* @__PURE__ */ jsx21(
6548
6623
  "span",
6549
6624
  {
6550
6625
  className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
6551
6626
  }
6552
6627
  ),
6553
- /* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
6554
- /* @__PURE__ */ jsx20("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6555
- /* @__PURE__ */ jsx20("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6628
+ /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
6629
+ /* @__PURE__ */ jsx21("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6630
+ /* @__PURE__ */ jsx21("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6556
6631
  ] }),
6557
- /* @__PURE__ */ jsx20(
6632
+ /* @__PURE__ */ jsx21(
6558
6633
  "button",
6559
6634
  {
6560
6635
  type: "button",
6561
6636
  onClick: onClose,
6562
6637
  "aria-label": "Close",
6563
6638
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6564
- children: /* @__PURE__ */ jsx20("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx20("path", { d: "M18 6 6 18M6 6l12 12" }) })
6639
+ children: /* @__PURE__ */ jsx21("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx21("path", { d: "M18 6 6 18M6 6l12 12" }) })
6565
6640
  }
6566
6641
  )
6567
6642
  ] }),
6568
- /* @__PURE__ */ jsxs17("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6569
- run.steps.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6570
- run.steps.map((step, i) => /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6571
- /* @__PURE__ */ jsxs17("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6572
- /* @__PURE__ */ jsx20("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6573
- /* @__PURE__ */ jsx20("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6574
- /* @__PURE__ */ jsx20("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6643
+ /* @__PURE__ */ jsxs18("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6644
+ run.steps.length === 0 && /* @__PURE__ */ jsx21("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6645
+ run.steps.map((step, i) => /* @__PURE__ */ jsxs18("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6646
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6647
+ /* @__PURE__ */ jsx21("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6648
+ /* @__PURE__ */ jsx21("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6649
+ /* @__PURE__ */ jsx21("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6575
6650
  ] }),
6576
- step.detail && /* @__PURE__ */ jsx20("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 })
6651
+ step.detail && /* @__PURE__ */ jsx21("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 })
6577
6652
  ] }, i))
6578
6653
  ] }),
6579
- /* @__PURE__ */ jsx20("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." })
6654
+ /* @__PURE__ */ jsx21("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." })
6580
6655
  ] });
6581
6656
  }
6582
6657
  function pendingApprovalOf(call) {
@@ -6592,23 +6667,23 @@ function ChatEmptyState({
6592
6667
  }) {
6593
6668
  const doorCount = Math.min(doors?.length ?? 0, 3);
6594
6669
  const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
6595
- return /* @__PURE__ */ jsxs17("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6596
- /* @__PURE__ */ jsx20("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__ */ jsx20(BrandMark, { size: 32, className: "shrink-0" }) }),
6597
- /* @__PURE__ */ jsx20("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6598
- /* @__PURE__ */ jsx20("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6599
- subline && /* @__PURE__ */ jsx20("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6600
- doors && doors.length > 0 && /* @__PURE__ */ jsx20("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs17(
6670
+ return /* @__PURE__ */ jsxs18("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6671
+ /* @__PURE__ */ jsx21("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__ */ jsx21(BrandMark, { size: 32, className: "shrink-0" }) }),
6672
+ /* @__PURE__ */ jsx21("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6673
+ /* @__PURE__ */ jsx21("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6674
+ subline && /* @__PURE__ */ jsx21("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6675
+ doors && doors.length > 0 && /* @__PURE__ */ jsx21("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs18(
6601
6676
  "button",
6602
6677
  {
6603
6678
  type: "button",
6604
6679
  onClick: door.onSelect,
6605
6680
  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",
6606
6681
  children: [
6607
- /* @__PURE__ */ jsxs17("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6682
+ /* @__PURE__ */ jsxs18("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6608
6683
  door.icon,
6609
6684
  door.label
6610
6685
  ] }),
6611
- door.description && /* @__PURE__ */ jsx20("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6686
+ door.description && /* @__PURE__ */ jsx21("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6612
6687
  ]
6613
6688
  },
6614
6689
  i
@@ -6617,26 +6692,26 @@ function ChatEmptyState({
6617
6692
  }
6618
6693
  function ToolGlyph({ name, className }) {
6619
6694
  if (name.startsWith("sandbox_")) {
6620
- return /* @__PURE__ */ jsxs17("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6621
- /* @__PURE__ */ jsx20("polyline", { points: "4 17 10 11 4 5" }),
6622
- /* @__PURE__ */ jsx20("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6695
+ return /* @__PURE__ */ jsxs18("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6696
+ /* @__PURE__ */ jsx21("polyline", { points: "4 17 10 11 4 5" }),
6697
+ /* @__PURE__ */ jsx21("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6623
6698
  ] });
6624
6699
  }
6625
6700
  if (name === "submit_proposal") {
6626
- return /* @__PURE__ */ jsxs17("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6627
- /* @__PURE__ */ jsx20("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6628
- /* @__PURE__ */ jsx20("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6701
+ return /* @__PURE__ */ jsxs18("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6702
+ /* @__PURE__ */ jsx21("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6703
+ /* @__PURE__ */ jsx21("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6629
6704
  ] });
6630
6705
  }
6631
6706
  if (name === "schedule_followup") {
6632
- return /* @__PURE__ */ jsxs17("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6633
- /* @__PURE__ */ jsx20("circle", { cx: "12", cy: "12", r: "9" }),
6634
- /* @__PURE__ */ jsx20("path", { d: "M12 7v5l3 3" })
6707
+ return /* @__PURE__ */ jsxs18("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6708
+ /* @__PURE__ */ jsx21("circle", { cx: "12", cy: "12", r: "9" }),
6709
+ /* @__PURE__ */ jsx21("path", { d: "M12 7v5l3 3" })
6635
6710
  ] });
6636
6711
  }
6637
- return /* @__PURE__ */ jsxs17("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6638
- /* @__PURE__ */ jsx20("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6639
- /* @__PURE__ */ jsx20("circle", { cx: "12", cy: "12", r: "4" })
6712
+ return /* @__PURE__ */ jsxs18("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6713
+ /* @__PURE__ */ jsx21("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6714
+ /* @__PURE__ */ jsx21("circle", { cx: "12", cy: "12", r: "4" })
6640
6715
  ] });
6641
6716
  }
6642
6717
  function toolOutcomeOf(call) {
@@ -6722,40 +6797,40 @@ function truncate(v, max = 240) {
6722
6797
  function KvRows({ data }) {
6723
6798
  const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
6724
6799
  if (!entries.length) return null;
6725
- return /* @__PURE__ */ jsx20("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs17("div", { className: "contents", children: [
6726
- /* @__PURE__ */ jsx20("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6727
- /* @__PURE__ */ jsx20("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6800
+ return /* @__PURE__ */ jsx21("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs18("div", { className: "contents", children: [
6801
+ /* @__PURE__ */ jsx21("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6802
+ /* @__PURE__ */ jsx21("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6728
6803
  ] }, k)) });
6729
6804
  }
6730
6805
  function ShellDetail({ call }) {
6731
6806
  const outcome = toolOutcomeOf(call);
6732
6807
  const r = outcome?.result ?? {};
6733
- return /* @__PURE__ */ jsxs17("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
6734
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
6735
- /* @__PURE__ */ jsx20("span", { className: "select-none text-zinc-500", children: "$" }),
6736
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
6737
- r.exitCode != null && /* @__PURE__ */ jsxs17("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
6808
+ return /* @__PURE__ */ jsxs18("div", { className: "overflow-hidden rounded-md bg-zinc-900 font-mono text-xs leading-relaxed", children: [
6809
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 px-3 pt-2 text-zinc-400", children: [
6810
+ /* @__PURE__ */ jsx21("span", { className: "select-none text-zinc-500", children: "$" }),
6811
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 truncate text-zinc-200", children: String(call.args?.command ?? "") }),
6812
+ r.exitCode != null && /* @__PURE__ */ jsxs18("span", { className: r.exitCode === 0 ? "text-success" : "text-destructive", children: [
6738
6813
  "exit ",
6739
6814
  r.exitCode
6740
6815
  ] })
6741
6816
  ] }),
6742
- /* @__PURE__ */ jsx20("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)" })
6817
+ /* @__PURE__ */ jsx21("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)" })
6743
6818
  ] });
6744
6819
  }
6745
6820
  function DefaultToolDetail({ call }) {
6746
6821
  const result = call.result;
6747
6822
  const envelope = typeof result === "object" && result !== null ? result : null;
6748
- return /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
6749
- call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs17("div", { children: [
6750
- /* @__PURE__ */ jsx20("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6751
- /* @__PURE__ */ jsx20(KvRows, { data: call.args })
6823
+ return /* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
6824
+ call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs18("div", { children: [
6825
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6826
+ /* @__PURE__ */ jsx21(KvRows, { data: call.args })
6752
6827
  ] }),
6753
- envelope ? /* @__PURE__ */ jsxs17("div", { children: [
6754
- /* @__PURE__ */ jsx20("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6755
- envelope.ok === false ? /* @__PURE__ */ jsx20("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx20(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx20("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6756
- ] }) : result != null ? /* @__PURE__ */ jsxs17("div", { children: [
6757
- /* @__PURE__ */ jsx20("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6758
- /* @__PURE__ */ jsx20("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6828
+ envelope ? /* @__PURE__ */ jsxs18("div", { children: [
6829
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6830
+ envelope.ok === false ? /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx21(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx21("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6831
+ ] }) : result != null ? /* @__PURE__ */ jsxs18("div", { children: [
6832
+ /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6833
+ /* @__PURE__ */ jsx21("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6759
6834
  ] }) : null
6760
6835
  ] });
6761
6836
  }
@@ -6766,24 +6841,24 @@ function ProposalCard({
6766
6841
  approval,
6767
6842
  renderers
6768
6843
  }) {
6769
- const [expanded, setExpanded] = useState18(false);
6844
+ const [expanded, setExpanded] = useState19(false);
6770
6845
  const { summary, meta, typeSlug } = proposalPreview(call);
6771
6846
  const custom = renderers?.[call.name]?.(call, message);
6772
6847
  const { pending: deciding, run: decide } = usePending();
6773
- return /* @__PURE__ */ jsxs17("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: [
6774
- /* @__PURE__ */ jsxs17("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6775
- /* @__PURE__ */ jsx20("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__ */ jsx20(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6776
- /* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
6777
- /* @__PURE__ */ jsx20("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6778
- /* @__PURE__ */ jsx20("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6779
- summary && /* @__PURE__ */ jsx20("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6780
- typeSlug && /* @__PURE__ */ jsx20("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6781
- meta.length > 0 && /* @__PURE__ */ jsx20("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx20("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6848
+ return /* @__PURE__ */ jsxs18("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: [
6849
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6850
+ /* @__PURE__ */ jsx21("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__ */ jsx21(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6851
+ /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1", children: [
6852
+ /* @__PURE__ */ jsx21("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6853
+ /* @__PURE__ */ jsx21("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6854
+ summary && /* @__PURE__ */ jsx21("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6855
+ typeSlug && /* @__PURE__ */ jsx21("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6856
+ meta.length > 0 && /* @__PURE__ */ jsx21("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx21("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6782
6857
  ] })
6783
6858
  ] }),
6784
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6785
- approval && /* @__PURE__ */ jsxs17(Fragment9, { children: [
6786
- /* @__PURE__ */ jsx20(
6859
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6860
+ approval && /* @__PURE__ */ jsxs18(Fragment9, { children: [
6861
+ /* @__PURE__ */ jsx21(
6787
6862
  "button",
6788
6863
  {
6789
6864
  type: "button",
@@ -6793,7 +6868,7 @@ function ProposalCard({
6793
6868
  children: "Approve & run"
6794
6869
  }
6795
6870
  ),
6796
- /* @__PURE__ */ jsx20(
6871
+ /* @__PURE__ */ jsx21(
6797
6872
  "button",
6798
6873
  {
6799
6874
  type: "button",
@@ -6804,7 +6879,7 @@ function ProposalCard({
6804
6879
  }
6805
6880
  )
6806
6881
  ] }),
6807
- /* @__PURE__ */ jsxs17(
6882
+ /* @__PURE__ */ jsxs18(
6808
6883
  "button",
6809
6884
  {
6810
6885
  type: "button",
@@ -6813,12 +6888,12 @@ function ProposalCard({
6813
6888
  className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
6814
6889
  children: [
6815
6890
  expanded ? "Hide details" : "View details",
6816
- /* @__PURE__ */ jsx20(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6891
+ /* @__PURE__ */ jsx21(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6817
6892
  ]
6818
6893
  }
6819
6894
  )
6820
6895
  ] }),
6821
- expanded && /* @__PURE__ */ jsx20("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx20(DefaultToolDetail, { call }) })
6896
+ expanded && /* @__PURE__ */ jsx21("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx21(DefaultToolDetail, { call }) })
6822
6897
  ] });
6823
6898
  }
6824
6899
  function formatFollowupWhen(when) {
@@ -6833,14 +6908,14 @@ function FollowupCard({ call }) {
6833
6908
  const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
6834
6909
  const failed = toolCallFailed(call);
6835
6910
  const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
6836
- return /* @__PURE__ */ jsx20("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6837
- /* @__PURE__ */ jsxs17("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6838
- /* @__PURE__ */ jsx20("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__ */ jsx20(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6839
- /* @__PURE__ */ jsx20("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6840
- when && /* @__PURE__ */ jsx20("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) }),
6841
- /* @__PURE__ */ jsx20("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx20("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__ */ jsx20("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx20("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6911
+ return /* @__PURE__ */ jsx21("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6912
+ /* @__PURE__ */ jsxs18("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6913
+ /* @__PURE__ */ jsx21("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__ */ jsx21(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6914
+ /* @__PURE__ */ jsx21("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6915
+ when && /* @__PURE__ */ jsx21("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) }),
6916
+ /* @__PURE__ */ jsx21("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx21("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__ */ jsx21("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx21("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6842
6917
  ] }),
6843
- errorText && /* @__PURE__ */ jsx20("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6918
+ errorText && /* @__PURE__ */ jsx21("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6844
6919
  ] }) });
6845
6920
  }
6846
6921
  function toolRowTitle(call) {
@@ -6863,10 +6938,10 @@ function ToolCallCard({
6863
6938
  const arrival = useArrivalStyle(staggerIndex ?? 0);
6864
6939
  const pending = call.status === "done" ? pendingApprovalOf(call) : null;
6865
6940
  const kind = blockKindOf(call);
6866
- const arrive = (row) => /* @__PURE__ */ jsx20("div", { className: "agent-arrive", style: arrival, children: row });
6941
+ const arrive = (row) => /* @__PURE__ */ jsx21("div", { className: "agent-arrive", style: arrival, children: row });
6867
6942
  if (pending) {
6868
6943
  return arrive(
6869
- /* @__PURE__ */ jsx20(
6944
+ /* @__PURE__ */ jsx21(
6870
6945
  ProposalCard,
6871
6946
  {
6872
6947
  call,
@@ -6879,18 +6954,18 @@ function ToolCallCard({
6879
6954
  );
6880
6955
  }
6881
6956
  if (kind === "followup") {
6882
- return arrive(/* @__PURE__ */ jsx20(FollowupCard, { call }));
6957
+ return arrive(/* @__PURE__ */ jsx21(FollowupCard, { call }));
6883
6958
  }
6884
6959
  const custom = renderers?.[call.name]?.(call, message);
6885
6960
  return arrive(
6886
- /* @__PURE__ */ jsx20(
6961
+ /* @__PURE__ */ jsx21(
6887
6962
  InlineToolItem,
6888
6963
  {
6889
6964
  part: chatToolCallPart(call),
6890
6965
  title: toolRowTitle(call),
6891
6966
  description: toolRowDescription(call),
6892
- renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx20(ShellDetail, { call }) : /* @__PURE__ */ jsx20(DefaultToolDetail, { call })),
6893
- actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx20(
6967
+ renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx21(ShellDetail, { call }) : /* @__PURE__ */ jsx21(DefaultToolDetail, { call })),
6968
+ actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx21(
6894
6969
  "button",
6895
6970
  {
6896
6971
  type: "button",
@@ -6898,9 +6973,9 @@ function ToolCallCard({
6898
6973
  "aria-label": "Open full transcript",
6899
6974
  title: "Open full transcript",
6900
6975
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6901
- children: /* @__PURE__ */ jsxs17("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: [
6902
- /* @__PURE__ */ jsx20("path", { d: "M7 17 17 7" }),
6903
- /* @__PURE__ */ jsx20("path", { d: "M7 7h10v10" })
6976
+ children: /* @__PURE__ */ jsxs18("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: [
6977
+ /* @__PURE__ */ jsx21("path", { d: "M7 17 17 7" }),
6978
+ /* @__PURE__ */ jsx21("path", { d: "M7 7h10v10" })
6904
6979
  ] })
6905
6980
  }
6906
6981
  ) : void 0
@@ -6909,7 +6984,7 @@ function ToolCallCard({
6909
6984
  );
6910
6985
  }
6911
6986
  function StreamingCaret() {
6912
- return /* @__PURE__ */ jsx20(
6987
+ return /* @__PURE__ */ jsx21(
6913
6988
  "span",
6914
6989
  {
6915
6990
  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",
@@ -6934,9 +7009,9 @@ function SegmentText({
6934
7009
  // the container on top of that makes the paragraph shimmer while it types.
6935
7010
  // The distinction is what separates "the answer materialised" from "the
6936
7011
  // log was appended to".
6937
- /* @__PURE__ */ jsxs17("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
7012
+ /* @__PURE__ */ jsxs18("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6938
7013
  body,
6939
- showCaret && /* @__PURE__ */ jsx20(StreamingCaret, {})
7014
+ showCaret && /* @__PURE__ */ jsx21(StreamingCaret, {})
6940
7015
  ] })
6941
7016
  );
6942
7017
  }
@@ -6961,7 +7036,7 @@ function SegmentedBody({
6961
7036
  const leftoverToolCalls = (msg.toolCalls ?? []).filter(
6962
7037
  (tc) => !segmentToolIds.has(tc.id)
6963
7038
  );
6964
- const renderToolCard = (call, index) => /* @__PURE__ */ jsx20(
7039
+ const renderToolCard = (call, index) => /* @__PURE__ */ jsx21(
6965
7040
  ToolCallCard,
6966
7041
  {
6967
7042
  call,
@@ -6990,12 +7065,12 @@ function SegmentedBody({
6990
7065
  const children = [];
6991
7066
  for (const g of groups) {
6992
7067
  if (g.kind === "notice") {
6993
- children.push(/* @__PURE__ */ jsx20(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
7068
+ children.push(/* @__PURE__ */ jsx21(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
6994
7069
  continue;
6995
7070
  }
6996
7071
  if (g.kind === "text") {
6997
7072
  children.push(
6998
- /* @__PURE__ */ jsx20(
7073
+ /* @__PURE__ */ jsx21(
6999
7074
  SegmentText,
7000
7075
  {
7001
7076
  content: g.content,
@@ -7011,13 +7086,13 @@ function SegmentedBody({
7011
7086
  }
7012
7087
  if (!streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool)) {
7013
7088
  children.push(
7014
- /* @__PURE__ */ jsxs17("details", { children: [
7015
- /* @__PURE__ */ jsxs17("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: [
7089
+ /* @__PURE__ */ jsxs18("details", { children: [
7090
+ /* @__PURE__ */ jsxs18("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: [
7016
7091
  "Worked through ",
7017
7092
  g.calls.length,
7018
7093
  " steps"
7019
7094
  ] }),
7020
- /* @__PURE__ */ jsx20("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
7095
+ /* @__PURE__ */ jsx21("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
7021
7096
  ] }, `tools-fold-${g.index}`)
7022
7097
  );
7023
7098
  continue;
@@ -7026,9 +7101,9 @@ function SegmentedBody({
7026
7101
  }
7027
7102
  leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
7028
7103
  if (streaming && segments[lastIndex]?.kind === "tool") {
7029
- children.push(/* @__PURE__ */ jsx20(StreamingCaret, {}, "streaming-caret"));
7104
+ children.push(/* @__PURE__ */ jsx21(StreamingCaret, {}, "streaming-caret"));
7030
7105
  }
7031
- return /* @__PURE__ */ jsx20("div", { className: "flex flex-col gap-2", children });
7106
+ return /* @__PURE__ */ jsx21("div", { className: "flex flex-col gap-2", children });
7032
7107
  }
7033
7108
  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";
7034
7109
  function copyTextOf(msg) {
@@ -7037,7 +7112,7 @@ function copyTextOf(msg) {
7037
7112
  return msg.content;
7038
7113
  }
7039
7114
  function CopyMessageButton({ text }) {
7040
- const [copied, setCopied] = useState18(false);
7115
+ const [copied, setCopied] = useState19(false);
7041
7116
  const timerRef = useRef13(null);
7042
7117
  useEffect13(
7043
7118
  () => () => {
@@ -7058,7 +7133,7 @@ function CopyMessageButton({ text }) {
7058
7133
  }
7059
7134
  );
7060
7135
  };
7061
- return /* @__PURE__ */ jsx20(
7136
+ return /* @__PURE__ */ jsx21(
7062
7137
  "button",
7063
7138
  {
7064
7139
  type: "button",
@@ -7066,9 +7141,9 @@ function CopyMessageButton({ text }) {
7066
7141
  "aria-label": "Copy message",
7067
7142
  title: "Copy message",
7068
7143
  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",
7069
- children: copied ? /* @__PURE__ */ jsx20("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__ */ jsx20("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs17("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: [
7070
- /* @__PURE__ */ jsx20("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
7071
- /* @__PURE__ */ jsx20("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
7144
+ children: copied ? /* @__PURE__ */ jsx21("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__ */ jsx21("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs18("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: [
7145
+ /* @__PURE__ */ jsx21("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
7146
+ /* @__PURE__ */ jsx21("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
7072
7147
  ] })
7073
7148
  }
7074
7149
  );
@@ -7110,20 +7185,20 @@ function AssistantMessageImpl({
7110
7185
  const thinkingSeconds = useThinkingSeconds(
7111
7186
  streaming && !!reasoning && !hasAnswerText
7112
7187
  );
7113
- const [reasoningToggled, setReasoningToggled] = useState18(null);
7188
+ const [reasoningToggled, setReasoningToggled] = useState19(null);
7114
7189
  const reasoningOpen = reasoningToggled ?? !hasAnswerText;
7115
7190
  const quiet = chrome === "quiet";
7116
- return /* @__PURE__ */ jsxs17("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7117
- quiet && msg.author && /* @__PURE__ */ jsx20(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
7118
- !quiet && /* @__PURE__ */ jsxs17(
7191
+ return /* @__PURE__ */ jsxs18("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7192
+ quiet && msg.author && /* @__PURE__ */ jsx21(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
7193
+ !quiet && /* @__PURE__ */ jsxs18(
7119
7194
  "div",
7120
7195
  {
7121
7196
  className: `mb-1 flex ${msg.author ? "items-center" : "items-baseline"} gap-2 text-xs tabular-nums text-muted-foreground`,
7122
7197
  children: [
7123
- msg.author ? /* @__PURE__ */ jsx20(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx20("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
7124
- msg.modelUsed && /* @__PURE__ */ jsx20("span", { className: "font-mono normal-case", children: msg.modelUsed }),
7125
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx20("span", { children: formatTokensPerSecond(msg) }),
7126
- formatModelCost(msg, models) && /* @__PURE__ */ jsx20("span", { children: formatModelCost(msg, models) })
7198
+ msg.author ? /* @__PURE__ */ jsx21(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx21("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
7199
+ msg.modelUsed && /* @__PURE__ */ jsx21("span", { className: "font-mono normal-case", children: msg.modelUsed }),
7200
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx21("span", { children: formatTokensPerSecond(msg) }),
7201
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx21("span", { children: formatModelCost(msg, models) })
7127
7202
  ]
7128
7203
  }
7129
7204
  ),
@@ -7135,12 +7210,12 @@ function AssistantMessageImpl({
7135
7210
  // and a click outranks the default from then on — the contract the old
7136
7211
  // hand-rolled disclosure had, now enforced through the shell's
7137
7212
  // controlled `open`.
7138
- /* @__PURE__ */ jsx20(
7213
+ /* @__PURE__ */ jsx21(
7139
7214
  RunRowShell,
7140
7215
  {
7141
7216
  className: "mb-2",
7142
- icon: /* @__PURE__ */ jsx20(BrainGlyph, { className: "h-3.5 w-3.5" }),
7143
- title: !hasAnswerText ? /* @__PURE__ */ jsxs17("span", { className: "agent-shimmer", "data-motion": "essential", children: [
7217
+ icon: /* @__PURE__ */ jsx21(BrainGlyph, { className: "h-3.5 w-3.5" }),
7218
+ title: !hasAnswerText ? /* @__PURE__ */ jsxs18("span", { className: "agent-shimmer", "data-motion": "essential", children: [
7144
7219
  "Thinking",
7145
7220
  thinkingSeconds >= 1 ? ` \xB7 ${thinkingSeconds}s` : "\u2026"
7146
7221
  ] }) : thinkMsRef.current != null ? (
@@ -7155,7 +7230,7 @@ function AssistantMessageImpl({
7155
7230
  status: hasAnswerText ? "idle" : "running",
7156
7231
  open: reasoningOpen,
7157
7232
  onOpenChange: (next) => setReasoningToggled(next),
7158
- children: /* @__PURE__ */ jsx20(
7233
+ children: /* @__PURE__ */ jsx21(
7159
7234
  "div",
7160
7235
  {
7161
7236
  ref: reasoningScrollRef,
@@ -7165,7 +7240,7 @@ function AssistantMessageImpl({
7165
7240
  )
7166
7241
  }
7167
7242
  ),
7168
- segments && segments.length > 0 ? /* @__PURE__ */ jsx20(
7243
+ segments && segments.length > 0 ? /* @__PURE__ */ jsx21(
7169
7244
  SegmentedBody,
7170
7245
  {
7171
7246
  segments,
@@ -7177,12 +7252,12 @@ function AssistantMessageImpl({
7177
7252
  toolRenderers,
7178
7253
  messageClassName
7179
7254
  }
7180
- ) : /* @__PURE__ */ jsxs17(Fragment9, { children: [
7181
- /* @__PURE__ */ jsxs17("div", { className: messageClassName, children: [
7255
+ ) : /* @__PURE__ */ jsxs18(Fragment9, { children: [
7256
+ /* @__PURE__ */ jsxs18("div", { className: messageClassName, children: [
7182
7257
  body,
7183
- streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx20(StreamingCaret, {})
7258
+ streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx21(StreamingCaret, {})
7184
7259
  ] }),
7185
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx20("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx20(
7260
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx21("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx21(
7186
7261
  ToolCallCard,
7187
7262
  {
7188
7263
  call: tc,
@@ -7195,7 +7270,7 @@ function AssistantMessageImpl({
7195
7270
  tc.id
7196
7271
  )) })
7197
7272
  ] }),
7198
- durableCards && msg.parts && /* @__PURE__ */ jsx20(
7273
+ durableCards && msg.parts && /* @__PURE__ */ jsx21(
7199
7274
  DurableChatCards,
7200
7275
  {
7201
7276
  ...durableCards,
@@ -7204,7 +7279,7 @@ function AssistantMessageImpl({
7204
7279
  className: "mt-3"
7205
7280
  }
7206
7281
  ),
7207
- workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx20(
7282
+ workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx21(
7208
7283
  WorkProductCard,
7209
7284
  {
7210
7285
  part,
@@ -7214,7 +7289,7 @@ function AssistantMessageImpl({
7214
7289
  `${part.ref.id}:${part.ref.version}`
7215
7290
  )),
7216
7291
  renderExtras?.(msg),
7217
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx20("div", { className: "mt-2", children: /* @__PURE__ */ jsx20(
7292
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx21("div", { className: "mt-2", children: /* @__PURE__ */ jsx21(
7218
7293
  MessageAttachments,
7219
7294
  {
7220
7295
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -7222,17 +7297,17 @@ function AssistantMessageImpl({
7222
7297
  justify: "start"
7223
7298
  }
7224
7299
  ) }),
7225
- quiet && /* @__PURE__ */ jsxs17("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
7226
- /* @__PURE__ */ jsx20(CopyMessageButton, { text: copyTextOf(msg) }),
7227
- msg.modelUsed && /* @__PURE__ */ jsx20("span", { className: "font-mono", children: msg.modelUsed }),
7228
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx20("span", { children: formatTokensPerSecond(msg) }),
7229
- formatModelCost(msg, models) && /* @__PURE__ */ jsx20("span", { children: formatModelCost(msg, models) })
7300
+ quiet && /* @__PURE__ */ jsxs18("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
7301
+ /* @__PURE__ */ jsx21(CopyMessageButton, { text: copyTextOf(msg) }),
7302
+ msg.modelUsed && /* @__PURE__ */ jsx21("span", { className: "font-mono", children: msg.modelUsed }),
7303
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx21("span", { children: formatTokensPerSecond(msg) }),
7304
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx21("span", { children: formatModelCost(msg, models) })
7230
7305
  ] })
7231
7306
  ] });
7232
7307
  }
7233
7308
  var AssistantMessage = memo(AssistantMessageImpl);
7234
7309
  function useThinkingSeconds(active) {
7235
- const [seconds, setSeconds] = useState18(0);
7310
+ const [seconds, setSeconds] = useState19(0);
7236
7311
  useEffect13(() => {
7237
7312
  if (!active) return;
7238
7313
  setSeconds(0);
@@ -7243,10 +7318,10 @@ function useThinkingSeconds(active) {
7243
7318
  }
7244
7319
  function ThinkingRow({ agentLabel, chrome = "labeled" }) {
7245
7320
  const seconds = useThinkingSeconds(true);
7246
- return /* @__PURE__ */ jsxs17("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
7247
- chrome !== "quiet" && /* @__PURE__ */ jsx20("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
7248
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 text-[15px] text-muted-foreground", children: [
7249
- /* @__PURE__ */ jsx20("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx20("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
7321
+ return /* @__PURE__ */ jsxs18("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
7322
+ chrome !== "quiet" && /* @__PURE__ */ jsx21("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
7323
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 text-[15px] text-muted-foreground", children: [
7324
+ /* @__PURE__ */ jsx21("svg", { className: "h-4 w-4 animate-spin", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: /* @__PURE__ */ jsx21("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }),
7250
7325
  "Thinking",
7251
7326
  seconds >= 3 ? ` \xB7 ${seconds}s` : "..."
7252
7327
  ] })
@@ -7257,29 +7332,29 @@ var NOTICE_TONE_CLASS = {
7257
7332
  warning: "border-warning/40 bg-warning/10 text-warning-strong"
7258
7333
  };
7259
7334
  function SegmentNotice({ tone, content }) {
7260
- return /* @__PURE__ */ jsxs17(
7335
+ return /* @__PURE__ */ jsxs18(
7261
7336
  "div",
7262
7337
  {
7263
7338
  "data-notice-tone": tone,
7264
7339
  className: `flex items-start gap-2.5 rounded-lg border px-3 py-2.5 text-sm ${NOTICE_TONE_CLASS[tone]}`,
7265
7340
  children: [
7266
- /* @__PURE__ */ jsxs17("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: [
7267
- /* @__PURE__ */ jsx20("circle", { cx: "12", cy: "12", r: "9" }),
7268
- /* @__PURE__ */ jsx20("path", { d: "M12 8v4m0 4h.01" })
7341
+ /* @__PURE__ */ jsxs18("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: [
7342
+ /* @__PURE__ */ jsx21("circle", { cx: "12", cy: "12", r: "9" }),
7343
+ /* @__PURE__ */ jsx21("path", { d: "M12 8v4m0 4h.01" })
7269
7344
  ] }),
7270
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
7345
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
7271
7346
  ]
7272
7347
  }
7273
7348
  );
7274
7349
  }
7275
7350
  function StreamErrorRow({ message, onRetry }) {
7276
- return /* @__PURE__ */ jsx20("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs17("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: [
7277
- /* @__PURE__ */ jsxs17("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: [
7278
- /* @__PURE__ */ jsx20("circle", { cx: "12", cy: "12", r: "9" }),
7279
- /* @__PURE__ */ jsx20("path", { d: "M12 8v4m0 4h.01" })
7351
+ return /* @__PURE__ */ jsx21("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs18("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: [
7352
+ /* @__PURE__ */ jsxs18("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: [
7353
+ /* @__PURE__ */ jsx21("circle", { cx: "12", cy: "12", r: "9" }),
7354
+ /* @__PURE__ */ jsx21("path", { d: "M12 8v4m0 4h.01" })
7280
7355
  ] }),
7281
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 break-words", children: message }),
7282
- onRetry && /* @__PURE__ */ jsx20(
7356
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 break-words", children: message }),
7357
+ onRetry && /* @__PURE__ */ jsx21(
7283
7358
  "button",
7284
7359
  {
7285
7360
  type: "button",
@@ -7298,19 +7373,19 @@ function OtherPersonMessage({
7298
7373
  resolveAttachmentUrl
7299
7374
  }) {
7300
7375
  const attachments = resolveAttachmentUrl ? attachmentPartsFromMessageParts(msg.parts) : [];
7301
- return /* @__PURE__ */ jsxs17("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7302
- /* @__PURE__ */ jsxs17("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7303
- /* @__PURE__ */ jsx20(MessageAuthor, { author, className: "mb-1.5" }),
7304
- /* @__PURE__ */ jsx20(
7376
+ return /* @__PURE__ */ jsxs18("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7377
+ /* @__PURE__ */ jsxs18("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7378
+ /* @__PURE__ */ jsx21(MessageAuthor, { author, className: "mb-1.5" }),
7379
+ /* @__PURE__ */ jsx21(
7305
7380
  "div",
7306
7381
  {
7307
7382
  className: `w-fit max-w-full rounded-2xl border border-[hsl(var(--border))] bg-[hsl(var(--card))] px-4 py-2.5 text-[hsl(var(--foreground))] ${quiet ? "" : "rounded-tl-md "}${messageClassName}`,
7308
- children: /* @__PURE__ */ jsx20("p", { className: "whitespace-pre-wrap", children: msg.content })
7383
+ children: /* @__PURE__ */ jsx21("p", { className: "whitespace-pre-wrap", children: msg.content })
7309
7384
  }
7310
7385
  ),
7311
- resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx20("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx20(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
7386
+ resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx21("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx21(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
7312
7387
  ] }),
7313
- quiet && /* @__PURE__ */ jsx20("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx20(CopyMessageButton, { text: msg.content }) })
7388
+ quiet && /* @__PURE__ */ jsx21("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx21(CopyMessageButton, { text: msg.content }) })
7314
7389
  ] });
7315
7390
  }
7316
7391
  function ChatMessages({
@@ -7339,22 +7414,22 @@ function ChatMessages({
7339
7414
  const messageClassName = messageSize === "large" ? "agent-app-message-copy text-[17px] leading-[1.6]" : "agent-app-message-copy text-base leading-[1.6]";
7340
7415
  const assistantMessageClassName = `${messageClassName} bg-transparent text-[hsl(var(--foreground))]`;
7341
7416
  const renderBody = useMemo7(
7342
- () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx20("p", { className: "whitespace-pre-wrap", children: content })),
7417
+ () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx21("p", { className: "whitespace-pre-wrap", children: content })),
7343
7418
  [renderMarkdown]
7344
7419
  );
7345
7420
  const lastIsUser = messages[messages.length - 1]?.role === "user";
7346
7421
  const quiet = chrome === "quiet";
7347
7422
  if (messages.length === 0 && !loading && !error) {
7348
- const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx20(ChatEmptyState, { ...emptyState });
7349
- return /* @__PURE__ */ jsxs17(Fragment9, { children: [
7423
+ const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx21(ChatEmptyState, { ...emptyState });
7424
+ return /* @__PURE__ */ jsxs18(Fragment9, { children: [
7350
7425
  header,
7351
7426
  empty
7352
7427
  ] });
7353
7428
  }
7354
- return /* @__PURE__ */ jsxs17(Fragment9, { children: [
7429
+ return /* @__PURE__ */ jsxs18(Fragment9, { children: [
7355
7430
  header,
7356
7431
  messages.map(
7357
- (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx20(
7432
+ (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx21(
7358
7433
  OtherPersonMessage,
7359
7434
  {
7360
7435
  msg,
@@ -7364,17 +7439,17 @@ function ChatMessages({
7364
7439
  resolveAttachmentUrl
7365
7440
  },
7366
7441
  msg.id
7367
- ) : msg.role === "user" ? /* @__PURE__ */ jsxs17("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7368
- /* @__PURE__ */ jsxs17("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7369
- !quiet && /* @__PURE__ */ jsx20("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
7370
- /* @__PURE__ */ jsx20(
7442
+ ) : msg.role === "user" ? /* @__PURE__ */ jsxs18("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7443
+ /* @__PURE__ */ jsxs18("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7444
+ !quiet && /* @__PURE__ */ jsx21("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
7445
+ /* @__PURE__ */ jsx21(
7371
7446
  "div",
7372
7447
  {
7373
7448
  className: `rounded-2xl bg-[hsl(var(--foreground))] px-4 py-2.5 text-[hsl(var(--background))] ${quiet ? "" : "rounded-tr-md "}${messageClassName}`,
7374
- children: /* @__PURE__ */ jsx20("p", { className: "whitespace-pre-wrap", children: msg.content })
7449
+ children: /* @__PURE__ */ jsx21("p", { className: "whitespace-pre-wrap", children: msg.content })
7375
7450
  }
7376
7451
  ),
7377
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx20("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx20(
7452
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx21("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx21(
7378
7453
  MessageAttachments,
7379
7454
  {
7380
7455
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -7383,8 +7458,8 @@ function ChatMessages({
7383
7458
  }
7384
7459
  ) })
7385
7460
  ] }),
7386
- quiet && /* @__PURE__ */ jsx20("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx20(CopyMessageButton, { text: msg.content }) })
7387
- ] }, msg.id) : /* @__PURE__ */ jsx20(
7461
+ quiet && /* @__PURE__ */ jsx21("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx21(CopyMessageButton, { text: msg.content }) })
7462
+ ] }, msg.id) : /* @__PURE__ */ jsx21(
7388
7463
  AssistantMessage,
7389
7464
  {
7390
7465
  msg,
@@ -7405,8 +7480,8 @@ function ChatMessages({
7405
7480
  msg.id
7406
7481
  )
7407
7482
  ),
7408
- loading && lastIsUser && /* @__PURE__ */ jsx20(ThinkingRow, { agentLabel, chrome }),
7409
- error && !loading && /* @__PURE__ */ jsx20(StreamErrorRow, { message: error, onRetry })
7483
+ loading && lastIsUser && /* @__PURE__ */ jsx21(ThinkingRow, { agentLabel, chrome }),
7484
+ error && !loading && /* @__PURE__ */ jsx21(StreamErrorRow, { message: error, onRetry })
7410
7485
  ] });
7411
7486
  }
7412
7487
 
@@ -7547,4 +7622,4 @@ export {
7547
7622
  useThinkingSeconds,
7548
7623
  ChatMessages
7549
7624
  };
7550
- //# sourceMappingURL=chunk-5NRXHO32.js.map
7625
+ //# sourceMappingURL=chunk-W3L2OUBH.js.map