@tangle-network/agent-app 0.60.179 → 0.60.180

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.
@@ -32,6 +32,9 @@ import {
32
32
  import {
33
33
  AsyncView
34
34
  } from "./chunk-LN5RBVGP.js";
35
+ import {
36
+ ReviewFeedbackForm
37
+ } from "./chunk-ATQQCG4I.js";
35
38
  import {
36
39
  attachmentPartsFromMessageParts
37
40
  } from "./chunk-YR6TZ777.js";
@@ -58,7 +61,7 @@ import {
58
61
  } from "./chunk-6VQCFJWP.js";
59
62
 
60
63
  // src/web-react/index.tsx
61
- import { useEffect as useEffect15, useMemo as useMemo8, useRef as useRef14, useState as useState21, memo } from "react";
64
+ import { useEffect as useEffect16, useMemo as useMemo8, useRef as useRef15, useState as useState22, memo } from "react";
62
65
  import { isViewerMessage, MessageAuthor, TRANSCRIPT_TEXT } from "@tangle-network/ui/chat";
63
66
  import { TerminalDisplay, TerminalLine } from "@tangle-network/ui/primitives";
64
67
  import { InlineToolItem } from "@tangle-network/ui/run";
@@ -5671,10 +5674,212 @@ function PagerButton({
5671
5674
  );
5672
5675
  }
5673
5676
 
5674
- // src/web-react/api-access-panel.tsx
5677
+ // src/web-react/review-inbox.tsx
5675
5678
  import { useEffect as useEffect14, useRef as useRef13, useState as useState19 } from "react";
5676
- import { Button as Button4, Input, PageHeader } from "@tangle-network/ui/primitives";
5677
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
5679
+ import { Button as Button4, PageHeader } from "@tangle-network/ui/primitives";
5680
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
5681
+ var revisionKey = (item) => JSON.stringify([item.id, item.revision]);
5682
+ function ordered(items) {
5683
+ return [...items].sort((left, right) => left.createdAt - right.createdAt || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
5684
+ }
5685
+ function ReviewInbox({ items, initialSelectedId, renderItem, onVerdict, onFeedback, loading = false, error, onRefresh }) {
5686
+ const [round2, setRound] = useState19(() => ordered(items).map((item) => item.id));
5687
+ const [answered, setAnswered] = useState19(/* @__PURE__ */ new Set());
5688
+ const [resolvedElsewhere, setResolvedElsewhere] = useState19(/* @__PURE__ */ new Set());
5689
+ const [activeId, setActiveId] = useState19(() => items.some((item) => item.id === initialSelectedId) ? initialSelectedId : ordered(items)[0]?.id ?? null);
5690
+ const [busy, setBusy] = useState19(false);
5691
+ const [refreshing, setRefreshing] = useState19(false);
5692
+ const [restart, setRestart] = useState19(false);
5693
+ const [refreshError, setRefreshError] = useState19("");
5694
+ const cache = useRef13(/* @__PURE__ */ new Map());
5695
+ const drafts = useRef13(/* @__PURE__ */ new Map());
5696
+ const pending = useRef13(false);
5697
+ const section = useRef13(null);
5698
+ const form = useRef13(null);
5699
+ for (const item of items) cache.current.set(item.id, item);
5700
+ const currentItems = new Map(items.map((item) => [item.id, item]));
5701
+ const missing = loading || error || busy || refreshing ? resolvedElsewhere : new Set(round2.filter((id) => !currentItems.has(id)));
5702
+ const unanswered = round2.filter((id) => {
5703
+ const item = cache.current.get(id);
5704
+ return item && !answered.has(revisionKey(item)) && !missing.has(id);
5705
+ });
5706
+ const currentId = activeId && unanswered.includes(activeId) ? activeId : unanswered.find((id) => round2.indexOf(id) > round2.indexOf(activeId ?? "")) ?? unanswered[0];
5707
+ const active = currentId ? cache.current.get(currentId) : void 0;
5708
+ const currentKey = active ? revisionKey(active) : "";
5709
+ const available = !!active && currentItems.has(active.id);
5710
+ const canReview = !!active && available && active.canReview;
5711
+ const rank = currentId ? round2.indexOf(currentId) + 1 : round2.length;
5712
+ const reviewed = round2.length - unanswered.length;
5713
+ useEffect14(() => {
5714
+ if (loading || !restart && (round2.length > 0 || items.length === 0)) return;
5715
+ const next = ordered(items).map((item) => item.id);
5716
+ setRound(next);
5717
+ setActiveId(initialSelectedId && next.includes(initialSelectedId) ? initialSelectedId : next[0] ?? null);
5718
+ setAnswered(/* @__PURE__ */ new Set());
5719
+ setResolvedElsewhere(/* @__PURE__ */ new Set());
5720
+ setRestart(false);
5721
+ }, [items, loading, restart, round2.length, initialSelectedId]);
5722
+ useEffect14(() => {
5723
+ if (loading || error || busy || refreshing) return;
5724
+ const present = new Set(items.map((item) => item.id));
5725
+ setResolvedElsewhere((previous) => {
5726
+ const next = new Set(round2.filter((id) => !present.has(id)));
5727
+ return next.size === previous.size && [...next].every((id) => previous.has(id)) ? previous : next;
5728
+ });
5729
+ }, [items, loading, error, busy, refreshing, round2]);
5730
+ useEffect14(() => {
5731
+ setActiveId(currentId ?? null);
5732
+ section.current?.focus({ preventScroll: true });
5733
+ }, [currentKey]);
5734
+ function navigate(direction) {
5735
+ if (pending.current || unanswered.length < 2) return;
5736
+ const index = Math.max(0, unanswered.indexOf(currentId));
5737
+ setActiveId(unanswered[(index + direction + unanswered.length) % unanswered.length]);
5738
+ }
5739
+ async function verdict(item, value) {
5740
+ if (pending.current || !item.canReview || !currentItems.has(item.id)) return;
5741
+ pending.current = true;
5742
+ setBusy(true);
5743
+ try {
5744
+ await onVerdict(item, value);
5745
+ const nextAnswered = new Set(answered).add(revisionKey(item));
5746
+ setAnswered(nextAnswered);
5747
+ const remaining = round2.filter((id) => {
5748
+ const candidate = cache.current.get(id);
5749
+ return candidate && !nextAnswered.has(revisionKey(candidate));
5750
+ });
5751
+ const position = round2.indexOf(item.id);
5752
+ setActiveId(remaining.find((id) => round2.indexOf(id) > position) ?? remaining[0] ?? null);
5753
+ } finally {
5754
+ pending.current = false;
5755
+ setBusy(false);
5756
+ }
5757
+ }
5758
+ async function feedback(item, value) {
5759
+ if (!onFeedback || pending.current || !item.canReview || !currentItems.has(item.id)) return;
5760
+ pending.current = true;
5761
+ setBusy(true);
5762
+ try {
5763
+ await onFeedback(item, value);
5764
+ } finally {
5765
+ pending.current = false;
5766
+ setBusy(false);
5767
+ }
5768
+ }
5769
+ async function refresh() {
5770
+ if (!onRefresh || pending.current) return;
5771
+ pending.current = true;
5772
+ setRefreshing(true);
5773
+ setRefreshError("");
5774
+ try {
5775
+ await onRefresh();
5776
+ setRestart(true);
5777
+ } catch (cause) {
5778
+ setRefreshError(cause instanceof Error ? cause.message : "The inbox could not refresh. Your drafts are kept.");
5779
+ } finally {
5780
+ pending.current = false;
5781
+ setRefreshing(false);
5782
+ }
5783
+ }
5784
+ useEffect14(() => {
5785
+ function shortcut(event) {
5786
+ if (event.defaultPrevented || event.repeat || event.altKey || event.ctrlKey || event.metaKey || event.isComposing) return;
5787
+ const target = event.target instanceof Element ? event.target : null;
5788
+ const typing = target?.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"]');
5789
+ if (event.key === "Escape" && typing instanceof HTMLElement) {
5790
+ typing.blur();
5791
+ event.preventDefault();
5792
+ return;
5793
+ }
5794
+ if (typing || target && target !== document.body && !section.current?.contains(target) || pending.current || refreshing) return;
5795
+ const key = event.key.toLowerCase();
5796
+ if (key === "j") {
5797
+ event.preventDefault();
5798
+ navigate(1);
5799
+ } else if (key === "k") {
5800
+ event.preventDefault();
5801
+ navigate(-1);
5802
+ } else if (active && canReview && key === "s") {
5803
+ event.preventDefault();
5804
+ form.current?.focusScore();
5805
+ } else if (active && canReview && (key === "a" || key === "r")) {
5806
+ event.preventDefault();
5807
+ void form.current?.submitVerdict(key === "a" ? "approve" : "request_changes");
5808
+ }
5809
+ }
5810
+ window.addEventListener("keydown", shortcut);
5811
+ return () => window.removeEventListener("keydown", shortcut);
5812
+ });
5813
+ return /* @__PURE__ */ jsxs16(
5814
+ "section",
5815
+ {
5816
+ ref: section,
5817
+ tabIndex: -1,
5818
+ "aria-label": "Review inbox",
5819
+ "aria-busy": busy || refreshing || loading,
5820
+ className: "mx-auto min-w-0 max-w-4xl space-y-5 outline-none",
5821
+ "data-review-inbox": true,
5822
+ children: [
5823
+ /* @__PURE__ */ jsx18(
5824
+ PageHeader,
5825
+ {
5826
+ title: "Review inbox",
5827
+ description: "Review the oldest work first. Every decision includes your score and feedback.",
5828
+ actions: onRefresh && /* @__PURE__ */ jsx18(Button4, { variant: "outline", disabled: busy || refreshing || loading, onClick: () => void refresh(), children: refreshing ? "Refreshing\u2026" : "Refresh" }),
5829
+ meta: /* @__PURE__ */ jsx18("p", { role: "status", "data-review-progress": true, children: active ? `${rank} of ${round2.length}` : `${reviewed} of ${round2.length} resolved` })
5830
+ }
5831
+ ),
5832
+ (error || refreshError) && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-sm text-[var(--surface-danger-text)]", children: error || refreshError }),
5833
+ round2.length > 0 && /* @__PURE__ */ jsx18("progress", { "aria-label": "Items resolved this round", value: reviewed, max: round2.length, className: "h-1.5 w-full accent-primary" }),
5834
+ (loading || error) && !active ? /* @__PURE__ */ jsx18("p", { role: "status", children: loading ? "Loading the review inbox\u2026" : "The review inbox could not load." }) : !active ? /* @__PURE__ */ jsxs16("div", { className: "py-12 text-center", children: [
5835
+ /* @__PURE__ */ jsx18("h2", { className: "text-xl font-semibold", children: "All caught up" }),
5836
+ /* @__PURE__ */ jsxs16("p", { className: "mt-2 text-sm text-muted-foreground", children: [
5837
+ reviewed,
5838
+ " of ",
5839
+ round2.length,
5840
+ " resolved this round."
5841
+ ] })
5842
+ ] }) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
5843
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
5844
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
5845
+ /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: active.kind }),
5846
+ /* @__PURE__ */ jsx18("h2", { className: "break-words text-lg font-semibold", "data-review-title": true, children: active.title })
5847
+ ] }),
5848
+ /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
5849
+ /* @__PURE__ */ jsx18(Button4, { variant: "outline", "aria-keyshortcuts": "K", disabled: busy || unanswered.length < 2, onClick: () => navigate(-1), children: "Previous" }),
5850
+ /* @__PURE__ */ jsx18(Button4, { variant: "outline", "aria-keyshortcuts": "J", disabled: busy || unanswered.length < 2, onClick: () => navigate(1), children: "Next" })
5851
+ ] })
5852
+ ] }),
5853
+ available && !active.canReview && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "You do not have permission to review this item." }),
5854
+ /* @__PURE__ */ jsx18("div", { className: "min-w-0", "data-review-content": true, children: renderItem(active) }),
5855
+ /* @__PURE__ */ jsx18(
5856
+ ReviewFeedbackForm,
5857
+ {
5858
+ ref: form,
5859
+ draftKey: currentKey,
5860
+ drafts: drafts.current,
5861
+ input: active.input,
5862
+ preview: active.preview,
5863
+ feedback: active.feedback,
5864
+ disabled: !canReview || busy || loading,
5865
+ approveLabel: active.approveLabel,
5866
+ allowedVerdicts: active.allowedVerdicts,
5867
+ onVerdict: (decision, value) => verdict(active, { verdict: decision, ...value }),
5868
+ onFeedback: onFeedback ? (value) => feedback(active, value) : void 0
5869
+ },
5870
+ currentKey
5871
+ ),
5872
+ /* @__PURE__ */ jsx18("p", { className: "text-xs leading-5 text-muted-foreground", children: "A approve \xB7 R request changes \xB7 S score \xB7 J/K next/previous \xB7 Esc leave a field. Shortcuts pause while typing." })
5873
+ ] })
5874
+ ]
5875
+ }
5876
+ );
5877
+ }
5878
+
5879
+ // src/web-react/api-access-panel.tsx
5880
+ import { useEffect as useEffect15, useRef as useRef14, useState as useState20 } from "react";
5881
+ import { Button as Button5, Input, PageHeader as PageHeader2 } from "@tangle-network/ui/primitives";
5882
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
5678
5883
  var defaultExpiryChoices = [1, 7, 30];
5679
5884
  function pruneScopes(scopes, access) {
5680
5885
  const offered = new Map(access.map((option) => [option.scope, option]));
@@ -5725,31 +5930,31 @@ function ApiAccessPanel({
5725
5930
  onRevoke,
5726
5931
  onChanged
5727
5932
  }) {
5728
- const [name, setName] = useState19("");
5729
- const [reach, setReach] = useState19("");
5933
+ const [name, setName] = useState20("");
5934
+ const [reach, setReach] = useState20("");
5730
5935
  const selectedWorkspace = workspaces?.some((workspace) => workspace.id === reach) ? reach : "";
5731
5936
  const workspaceName = (id) => workspaces?.find((workspace) => workspace.id === id)?.name ?? `A removed ${workspaceNoun.singular}`;
5732
5937
  const allowedDays = [...new Set(expiryDays)].filter((days2) => days2 > 0 && Number.isFinite(new Date(Date.now() + days2 * 864e5).getTime()));
5733
5938
  const fallbackDays = allowedDays.includes(defaultExpiryDays) ? defaultExpiryDays : allowedDays[0];
5734
- const [days, setDays] = useState19(fallbackDays);
5939
+ const [days, setDays] = useState20(fallbackDays);
5735
5940
  const selectedDays = days !== void 0 && allowedDays.includes(days) ? days : fallbackDays;
5736
- const [scopes, setScopes] = useState19(() => expandScopes(defaultScopes, access));
5737
- const [creating, setCreating] = useState19(false);
5738
- const [revoking, setRevoking] = useState19(null);
5739
- const [created, setCreated] = useState19(null);
5740
- const [notice, setNotice] = useState19(null);
5741
- const [error, setError] = useState19(null);
5742
- const keyHeading = useRef13(null);
5743
- const nameInput = useRef13(null);
5744
- const keyWasShown = useRef13(false);
5941
+ const [scopes, setScopes] = useState20(() => expandScopes(defaultScopes, access));
5942
+ const [creating, setCreating] = useState20(false);
5943
+ const [revoking, setRevoking] = useState20(null);
5944
+ const [created, setCreated] = useState20(null);
5945
+ const [notice, setNotice] = useState20(null);
5946
+ const [error, setError] = useState20(null);
5947
+ const keyHeading = useRef14(null);
5948
+ const nameInput = useRef14(null);
5949
+ const keyWasShown = useRef14(false);
5745
5950
  const selectedScopes = pruneScopes(scopes, access);
5746
- useEffect14(() => {
5951
+ useEffect15(() => {
5747
5952
  setScopes((current) => {
5748
5953
  const next = pruneScopes(current, access);
5749
5954
  return next.length === current.length ? current : next;
5750
5955
  });
5751
5956
  }, [access]);
5752
- useEffect14(() => {
5957
+ useEffect15(() => {
5753
5958
  if (created) {
5754
5959
  keyHeading.current?.focus();
5755
5960
  keyWasShown.current = true;
@@ -5795,11 +6000,11 @@ function ApiAccessPanel({
5795
6000
  setRevoking(null);
5796
6001
  }
5797
6002
  }
5798
- 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: [
5799
- /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
5800
- accountHref && /* @__PURE__ */ jsx18("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
5801
- /* @__PURE__ */ jsx18(
5802
- PageHeader,
6003
+ return /* @__PURE__ */ jsx19("main", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs17("div", { className: "mx-auto max-w-2xl space-y-8 px-4 py-8 sm:px-8", children: [
6004
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
6005
+ accountHref && /* @__PURE__ */ jsx19("a", { href: accountHref, className: "text-sm text-muted-foreground hover:text-foreground", children: "Account" }),
6006
+ /* @__PURE__ */ jsx19(
6007
+ PageHeader2,
5803
6008
  {
5804
6009
  className: "mb-0",
5805
6010
  title: "API access",
@@ -5807,14 +6012,14 @@ function ApiAccessPanel({
5807
6012
  }
5808
6013
  )
5809
6014
  ] }),
5810
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
5811
- notice && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
5812
- created ? /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
5813
- /* @__PURE__ */ jsx18("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
5814
- /* @__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." }),
5815
- /* @__PURE__ */ jsxs16("div", { className: "flex gap-2", children: [
5816
- /* @__PURE__ */ jsx18(Input, { size: "lg", "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: "min-w-0 font-mono" }),
5817
- /* @__PURE__ */ jsx18(Button4, { onClick: async () => {
6015
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "rounded-lg border border-destructive/40 p-3 text-sm text-destructive", children: error }),
6016
+ notice && /* @__PURE__ */ jsx19("p", { role: "status", className: "text-sm text-muted-foreground", children: notice }),
6017
+ created ? /* @__PURE__ */ jsxs17("section", { "aria-labelledby": "save-api-key", className: "space-y-4 rounded-xl border border-border bg-card p-5", children: [
6018
+ /* @__PURE__ */ jsx19("h2", { ref: keyHeading, tabIndex: -1, id: "save-api-key", className: "font-medium outline-none", children: "Save your key" }),
6019
+ /* @__PURE__ */ jsx19("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." }),
6020
+ /* @__PURE__ */ jsxs17("div", { className: "flex gap-2", children: [
6021
+ /* @__PURE__ */ jsx19(Input, { size: "lg", "aria-label": "New API key", type: "password", value: created.key, readOnly: true, autoComplete: "off", className: "min-w-0 font-mono" }),
6022
+ /* @__PURE__ */ jsx19(Button5, { onClick: async () => {
5818
6023
  try {
5819
6024
  await navigator.clipboard.writeText(created.key);
5820
6025
  setNotice("Key copied");
@@ -5823,46 +6028,46 @@ function ApiAccessPanel({
5823
6028
  }
5824
6029
  }, children: "Copy key" })
5825
6030
  ] }),
5826
- /* @__PURE__ */ jsx18(Button4, { variant: "outline", onClick: () => {
6031
+ /* @__PURE__ */ jsx19(Button5, { variant: "outline", onClick: () => {
5827
6032
  setCreated(null);
5828
6033
  setNotice(null);
5829
6034
  }, children: "I\u2019ve saved it" })
5830
- ] }) : /* @__PURE__ */ jsxs16("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
5831
- /* @__PURE__ */ jsx18("h2", { className: "font-medium", children: "Create a key" }),
5832
- /* @__PURE__ */ jsxs16("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
5833
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5834
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
5835
- /* @__PURE__ */ jsx18(Input, { size: "lg", ref: nameInput, id: "key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
6035
+ ] }) : /* @__PURE__ */ jsxs17("form", { onSubmit: createKey, className: "space-y-5 rounded-xl border border-border bg-card p-5", children: [
6036
+ /* @__PURE__ */ jsx19("h2", { className: "font-medium", children: "Create a key" }),
6037
+ /* @__PURE__ */ jsxs17("div", { className: "grid gap-4 sm:grid-cols-[1fr_10rem]", children: [
6038
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6039
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-name", children: "Name" }),
6040
+ /* @__PURE__ */ jsx19(Input, { size: "lg", ref: nameInput, id: "key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: "Client on my server", maxLength: 100, required: true, autoComplete: "off" })
5836
6041
  ] }),
5837
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5838
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
5839
- /* @__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: [
6042
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6043
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-expiry", children: "Expires in" }),
6044
+ /* @__PURE__ */ jsx19("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__ */ jsxs17("option", { value: days2, children: [
5840
6045
  days2,
5841
6046
  " ",
5842
6047
  days2 === 1 ? "day" : "days"
5843
6048
  ] }, days2)) })
5844
6049
  ] })
5845
6050
  ] }),
5846
- workspaces && workspaces.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
5847
- /* @__PURE__ */ jsx18("label", { className: "text-sm font-medium", htmlFor: "key-reach", children: "Reaches" }),
5848
- /* @__PURE__ */ jsxs16("select", { id: "key-reach", value: selectedWorkspace, onChange: (event) => setReach(event.target.value), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: [
5849
- /* @__PURE__ */ jsxs16("option", { value: "", children: [
6051
+ workspaces && workspaces.length > 0 && /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
6052
+ /* @__PURE__ */ jsx19("label", { className: "text-sm font-medium", htmlFor: "key-reach", children: "Reaches" }),
6053
+ /* @__PURE__ */ jsxs17("select", { id: "key-reach", value: selectedWorkspace, onChange: (event) => setReach(event.target.value), className: "h-11 w-full rounded-lg border border-input bg-background px-3 text-sm", children: [
6054
+ /* @__PURE__ */ jsxs17("option", { value: "", children: [
5850
6055
  "All ",
5851
6056
  workspaceNoun.plural,
5852
6057
  ", including new ones"
5853
6058
  ] }),
5854
- workspaces.map((workspace) => /* @__PURE__ */ jsxs16("option", { value: workspace.id, children: [
6059
+ workspaces.map((workspace) => /* @__PURE__ */ jsxs17("option", { value: workspace.id, children: [
5855
6060
  "Only ",
5856
6061
  workspace.name
5857
6062
  ] }, workspace.id))
5858
6063
  ] })
5859
6064
  ] }),
5860
- /* @__PURE__ */ jsxs16("fieldset", { className: "space-y-3", children: [
5861
- /* @__PURE__ */ jsx18("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
6065
+ /* @__PURE__ */ jsxs17("fieldset", { className: "space-y-3", children: [
6066
+ /* @__PURE__ */ jsx19("legend", { className: "mb-3 text-sm font-medium", children: "Permissions" }),
5862
6067
  access.map((option) => {
5863
6068
  const unavailable = !expandScopes([option.scope], access).includes(option.scope);
5864
- return /* @__PURE__ */ jsxs16("label", { className: "flex cursor-pointer items-start gap-3", children: [
5865
- /* @__PURE__ */ jsx18(
6069
+ return /* @__PURE__ */ jsxs17("label", { className: "flex cursor-pointer items-start gap-3", children: [
6070
+ /* @__PURE__ */ jsx19(
5866
6071
  "input",
5867
6072
  {
5868
6073
  type: "checkbox",
@@ -5872,42 +6077,42 @@ function ApiAccessPanel({
5872
6077
  onChange: (event) => setScopes((current) => event.target.checked ? expandScopes([...current, option.scope], access) : pruneScopes(current.filter((scope) => scope !== option.scope), access))
5873
6078
  }
5874
6079
  ),
5875
- /* @__PURE__ */ jsxs16("span", { className: "text-sm", children: [
5876
- /* @__PURE__ */ jsx18("span", { className: "block font-medium", children: option.label }),
5877
- /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: option.description }),
5878
- unavailable && /* @__PURE__ */ jsx18("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
6080
+ /* @__PURE__ */ jsxs17("span", { className: "text-sm", children: [
6081
+ /* @__PURE__ */ jsx19("span", { className: "block font-medium", children: option.label }),
6082
+ /* @__PURE__ */ jsx19("span", { className: "text-muted-foreground", children: option.description }),
6083
+ unavailable && /* @__PURE__ */ jsx19("span", { className: "block text-muted-foreground", children: "Required permission unavailable." })
5879
6084
  ] })
5880
6085
  ] }, option.scope);
5881
6086
  })
5882
6087
  ] }),
5883
- limitsDescription && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: limitsDescription }),
5884
- /* @__PURE__ */ jsx18(Button4, { type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
6088
+ limitsDescription && /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: limitsDescription }),
6089
+ /* @__PURE__ */ jsx19(Button5, { type: "submit", disabled: creating || !name.trim() || !selectedScopes.length || selectedDays === void 0, children: creating ? "Creating\u2026" : "Create key" })
5885
6090
  ] }),
5886
- /* @__PURE__ */ jsxs16("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
5887
- /* @__PURE__ */ jsx18("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
5888
- 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: [
5889
- /* @__PURE__ */ jsxs16("div", { className: "min-w-0 space-y-1", children: [
5890
- /* @__PURE__ */ jsx18("p", { className: "break-words text-sm font-medium", children: key.name }),
5891
- /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
5892
- /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") }),
5893
- workspaces && /* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: key.workspaceIds?.length ? `Only ${key.workspaceIds.map(workspaceName).join(", ")}` : `All ${workspaceNoun.plural}` })
6091
+ /* @__PURE__ */ jsxs17("section", { "aria-labelledby": "existing-keys", className: "space-y-3", children: [
6092
+ /* @__PURE__ */ jsx19("h2", { id: "existing-keys", className: "font-medium", children: "Your keys" }),
6093
+ keys.length === 0 ? /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "No keys yet." }) : /* @__PURE__ */ jsx19("ul", { className: "divide-y divide-border rounded-xl border border-border bg-card", children: keys.map((key) => /* @__PURE__ */ jsxs17("li", { className: "flex items-start justify-between gap-3 p-4", children: [
6094
+ /* @__PURE__ */ jsxs17("div", { className: "min-w-0 space-y-1", children: [
6095
+ /* @__PURE__ */ jsx19("p", { className: "break-words text-sm font-medium", children: key.name }),
6096
+ /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.expiresAt ? `${new Date(key.expiresAt).getTime() <= Date.now() ? "Expired" : "Expires"} ${new Date(key.expiresAt).toLocaleDateString()}` : "No expiry" }),
6097
+ /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.scopes.map((scope) => access.find((access2) => access2.scope === scope)?.label ?? scope).join(" \xB7 ") }),
6098
+ workspaces && /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: key.workspaceIds?.length ? `Only ${key.workspaceIds.map(workspaceName).join(", ")}` : `All ${workspaceNoun.plural}` })
5894
6099
  ] }),
5895
- /* @__PURE__ */ jsx18(Button4, { variant: "outline", disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
6100
+ /* @__PURE__ */ jsx19(Button5, { variant: "outline", disabled: revoking !== null, onClick: () => revokeKey(key.id), "aria-label": `Revoke ${key.name}`, children: revoking === key.id ? "Revoking\u2026" : "Revoke" })
5896
6101
  ] }, key.id)) })
5897
6102
  ] }),
5898
- /* @__PURE__ */ jsxs16("p", { className: "text-sm text-muted-foreground", children: [
6103
+ /* @__PURE__ */ jsxs17("p", { className: "text-sm text-muted-foreground", children: [
5899
6104
  "Use ",
5900
- /* @__PURE__ */ jsx18("code", { className: "text-sm", children: baseUrl }),
6105
+ /* @__PURE__ */ jsx19("code", { className: "text-sm", children: baseUrl }),
5901
6106
  " as the API base and send the key as a Bearer credential."
5902
6107
  ] })
5903
6108
  ] }) });
5904
6109
  }
5905
6110
 
5906
6111
  // src/web-react/agent-setup-block.tsx
5907
- import { useState as useState20 } from "react";
5908
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
6112
+ import { useState as useState21 } from "react";
6113
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
5909
6114
  function AgentSetupBlock({ productName, setupUrl, markdown, description, className }) {
5910
- const [notice, setNotice] = useState20(null);
6115
+ const [notice, setNotice] = useState21(null);
5911
6116
  const prompt = markdown ?? `Set up ${productName} for me. Fetch ${setupUrl} and follow every step in it.`;
5912
6117
  async function copy() {
5913
6118
  try {
@@ -5917,15 +6122,15 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5917
6122
  setNotice(`Clipboard unavailable. Open ${setupUrl} and copy it from there.`);
5918
6123
  }
5919
6124
  }
5920
- return /* @__PURE__ */ jsxs17(
6125
+ return /* @__PURE__ */ jsxs18(
5921
6126
  "section",
5922
6127
  {
5923
6128
  "aria-labelledby": "agent-setup-heading",
5924
6129
  className: `space-y-3 rounded-xl border border-border bg-card p-5 ${className ?? ""}`.trim(),
5925
6130
  children: [
5926
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
5927
- /* @__PURE__ */ jsx19("h2", { id: "agent-setup-heading", className: "font-medium text-foreground", children: "Hand this to your agent" }),
5928
- /* @__PURE__ */ jsx19(
6131
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
6132
+ /* @__PURE__ */ jsx20("h2", { id: "agent-setup-heading", className: "font-medium text-foreground", children: "Hand this to your agent" }),
6133
+ /* @__PURE__ */ jsx20(
5929
6134
  "button",
5930
6135
  {
5931
6136
  type: "button",
@@ -5935,13 +6140,13 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5935
6140
  }
5936
6141
  )
5937
6142
  ] }),
5938
- /* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: description ?? `Your coding agent sets up ${productName} end to end: it asks you to approve once, gets its own capped key, installs the client, and verifies a first call.` }),
5939
- /* @__PURE__ */ jsxs17("p", { className: "text-sm text-muted-foreground", children: [
6143
+ /* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: description ?? `Your coding agent sets up ${productName} end to end: it asks you to approve once, gets its own capped key, installs the client, and verifies a first call.` }),
6144
+ /* @__PURE__ */ jsxs18("p", { className: "text-sm text-muted-foreground", children: [
5940
6145
  "Raw prompt:",
5941
6146
  " ",
5942
- /* @__PURE__ */ jsx19("a", { href: setupUrl, className: "font-mono text-foreground underline", children: setupUrl })
6147
+ /* @__PURE__ */ jsx20("a", { href: setupUrl, className: "font-mono text-foreground underline", children: setupUrl })
5943
6148
  ] }),
5944
- notice ? /* @__PURE__ */ jsx19("p", { role: "status", className: "text-sm text-foreground", children: notice }) : null
6149
+ notice ? /* @__PURE__ */ jsx20("p", { role: "status", className: "text-sm text-foreground", children: notice }) : null
5945
6150
  ]
5946
6151
  }
5947
6152
  );
@@ -5949,37 +6154,37 @@ function AgentSetupBlock({ productName, setupUrl, markdown, description, classNa
5949
6154
 
5950
6155
  // src/web-react/agent-profile-choices.tsx
5951
6156
  import { useId as useId4 } from "react";
5952
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
6157
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
5953
6158
  function AgentProfileChoices({ value, profiles, onChange, disabled, locked, lockReason, onNewChat, label = "Agent profile" }) {
5954
6159
  const name = useId4();
5955
6160
  const selected = profiles.find((profile) => profile.id === value);
5956
6161
  if (locked) {
5957
- return /* @__PURE__ */ jsxs18("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
5958
- /* @__PURE__ */ jsx20("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
5959
- /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
5960
- onNewChat && !disabled && /* @__PURE__ */ jsx20("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
6162
+ return /* @__PURE__ */ jsxs19("div", { className: "space-y-2 rounded-lg border border-border p-3 text-sm", children: [
6163
+ /* @__PURE__ */ jsx21("p", { className: "font-medium text-foreground", children: selected?.name ?? value }),
6164
+ /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground", children: lockReason ?? "This conversation stays on its current profile." }),
6165
+ onNewChat && !disabled && /* @__PURE__ */ jsx21("button", { type: "button", onClick: onNewChat, className: "text-sm font-medium text-primary underline underline-offset-4", children: "New chat to switch profile" })
5961
6166
  ] });
5962
6167
  }
5963
- return /* @__PURE__ */ jsxs18("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
5964
- /* @__PURE__ */ jsx20("legend", { className: "sr-only", children: label }),
5965
- /* @__PURE__ */ jsxs18("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
5966
- profiles.map((profile) => /* @__PURE__ */ jsxs18("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: [
5967
- /* @__PURE__ */ jsx20("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
6168
+ return /* @__PURE__ */ jsxs19("fieldset", { disabled, className: "min-w-0 space-y-1", children: [
6169
+ /* @__PURE__ */ jsx21("legend", { className: "sr-only", children: label }),
6170
+ /* @__PURE__ */ jsxs19("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [
6171
+ profiles.map((profile) => /* @__PURE__ */ jsxs19("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: [
6172
+ /* @__PURE__ */ jsx21("input", { type: "radio", name, value: profile.id, checked: profile.id === value, disabled, onChange: () => {
5968
6173
  if (!disabled) onChange(profile.id);
5969
6174
  }, className: "mt-1 shrink-0 accent-primary" }),
5970
- /* @__PURE__ */ jsxs18("span", { className: "min-w-0", children: [
5971
- /* @__PURE__ */ jsx20("span", { className: "block font-medium text-foreground", children: profile.name }),
5972
- profile.description && /* @__PURE__ */ jsx20("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
6175
+ /* @__PURE__ */ jsxs19("span", { className: "min-w-0", children: [
6176
+ /* @__PURE__ */ jsx21("span", { className: "block font-medium text-foreground", children: profile.name }),
6177
+ profile.description && /* @__PURE__ */ jsx21("span", { className: "mt-0.5 block text-xs text-muted-foreground", children: profile.description })
5973
6178
  ] })
5974
6179
  ] }, profile.id)),
5975
- profiles.length === 0 && /* @__PURE__ */ jsx20("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
6180
+ profiles.length === 0 && /* @__PURE__ */ jsx21("p", { role: "status", className: "p-2 text-sm text-muted-foreground", children: "No profiles available." })
5976
6181
  ] })
5977
6182
  ] });
5978
6183
  }
5979
6184
 
5980
6185
  // src/web-react/composer-profile-pill.tsx
5981
6186
  import { AgentProfilePicker } from "@tangle-network/sandbox-ui/chat";
5982
- import { jsx as jsx21 } from "react/jsx-runtime";
6187
+ import { jsx as jsx22 } from "react/jsx-runtime";
5983
6188
  var TRIGGER = {
5984
6189
  composer: "max-w-[180px]",
5985
6190
  // A menu panel repoints surface-container to its own tone, which would leave
@@ -6004,7 +6209,7 @@ function ComposerProfilePill({
6004
6209
  placement = "composer",
6005
6210
  className
6006
6211
  }) {
6007
- return /* @__PURE__ */ jsx21(
6212
+ return /* @__PURE__ */ jsx22(
6008
6213
  AgentProfilePicker,
6009
6214
  {
6010
6215
  value: selection.value,
@@ -6028,7 +6233,7 @@ function ComposerProfilePill({
6028
6233
  }
6029
6234
 
6030
6235
  // src/web-react/index.tsx
6031
- import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
6236
+ import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
6032
6237
  function formatModelCost(msg, models) {
6033
6238
  if (msg.promptTokens == null && msg.completionTokens == null) return null;
6034
6239
  const pricing = models.find((m) => m.id === msg.modelUsed)?.pricing;
@@ -6042,41 +6247,41 @@ function formatTokensPerSecond(msg) {
6042
6247
  return `${Math.round(msg.completionTokens / (msg.durationMs / 1e3))} tok/s`;
6043
6248
  }
6044
6249
  function RunDrillIn({ run, onClose }) {
6045
- return /* @__PURE__ */ jsxs19("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: [
6046
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6047
- /* @__PURE__ */ jsx22(
6250
+ return /* @__PURE__ */ jsxs20("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: [
6251
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 border-b border-border px-4 py-3", children: [
6252
+ /* @__PURE__ */ jsx23(
6048
6253
  "span",
6049
6254
  {
6050
6255
  className: `h-2 w-2 shrink-0 rounded-full ${run.status === "running" ? "bg-warning" : run.status === "error" ? "bg-destructive" : "bg-success"}`
6051
6256
  }
6052
6257
  ),
6053
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
6054
- /* @__PURE__ */ jsx22("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6055
- /* @__PURE__ */ jsx22("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6258
+ /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
6259
+ /* @__PURE__ */ jsx23("p", { className: "truncate text-[15px] font-semibold", children: run.title }),
6260
+ /* @__PURE__ */ jsx23("p", { className: "truncate font-mono text-xs text-muted-foreground", children: run.toolName })
6056
6261
  ] }),
6057
- /* @__PURE__ */ jsx22(
6262
+ /* @__PURE__ */ jsx23(
6058
6263
  "button",
6059
6264
  {
6060
6265
  type: "button",
6061
6266
  onClick: onClose,
6062
6267
  "aria-label": "Close",
6063
6268
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6064
- children: /* @__PURE__ */ jsx22("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx22("path", { d: "M18 6 6 18M6 6l12 12" }) })
6269
+ children: /* @__PURE__ */ jsx23("svg", { className: "h-4 w-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx23("path", { d: "M18 6 6 18M6 6l12 12" }) })
6065
6270
  }
6066
6271
  )
6067
6272
  ] }),
6068
- /* @__PURE__ */ jsxs19("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6069
- run.steps.length === 0 && /* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6070
- run.steps.map((step, i) => /* @__PURE__ */ jsxs19("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6071
- /* @__PURE__ */ jsxs19("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6072
- /* @__PURE__ */ jsx22("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6073
- /* @__PURE__ */ jsx22("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6074
- /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6273
+ /* @__PURE__ */ jsxs20("div", { className: "flex-1 space-y-3 overflow-y-auto p-4", children: [
6274
+ run.steps.length === 0 && /* @__PURE__ */ jsx23("p", { className: "text-sm text-muted-foreground", children: "No steps recorded yet." }),
6275
+ run.steps.map((step, i) => /* @__PURE__ */ jsxs20("div", { className: "rounded-lg border border-card-edge bg-card", children: [
6276
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-baseline gap-2 border-b border-border px-3 py-1.5", children: [
6277
+ /* @__PURE__ */ jsx23("span", { className: `font-mono text-xs ${step.status === "error" ? "text-destructive" : "text-muted-foreground"}`, children: step.status === "error" ? "\u2717" : "$" }),
6278
+ /* @__PURE__ */ jsx23("code", { className: "min-w-0 flex-1 truncate font-mono text-xs", children: step.label }),
6279
+ /* @__PURE__ */ jsx23("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: new Date(step.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) })
6075
6280
  ] }),
6076
- step.detail && /* @__PURE__ */ jsx22("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 })
6281
+ step.detail && /* @__PURE__ */ jsx23("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 })
6077
6282
  ] }, i))
6078
6283
  ] }),
6079
- /* @__PURE__ */ jsx22("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." })
6284
+ /* @__PURE__ */ jsx23("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." })
6080
6285
  ] });
6081
6286
  }
6082
6287
  function pendingApprovalOf(call) {
@@ -6092,23 +6297,23 @@ function ChatEmptyState({
6092
6297
  }) {
6093
6298
  const doorCount = Math.min(doors?.length ?? 0, 3);
6094
6299
  const doorsGridClass = doorCount === 1 ? "mx-auto max-w-sm sm:grid-cols-1" : doorCount === 2 ? "sm:grid-cols-2" : "sm:grid-cols-3";
6095
- return /* @__PURE__ */ jsxs19("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6096
- /* @__PURE__ */ jsx22("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__ */ jsx22(BrandMark, { size: 32, className: "shrink-0" }) }),
6097
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6098
- /* @__PURE__ */ jsx22("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6099
- subline && /* @__PURE__ */ jsx22("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6100
- doors && doors.length > 0 && /* @__PURE__ */ jsx22("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs19(
6300
+ return /* @__PURE__ */ jsxs20("div", { className: "mx-auto flex w-full max-w-2xl flex-col items-center px-6 py-12 text-center sm:py-20", children: [
6301
+ /* @__PURE__ */ jsx23("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__ */ jsx23(BrandMark, { size: 32, className: "shrink-0" }) }),
6302
+ /* @__PURE__ */ jsx23("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: productName }),
6303
+ /* @__PURE__ */ jsx23("h2", { className: "mt-1.5 text-balance text-2xl font-semibold leading-tight text-foreground", children: headline }),
6304
+ subline && /* @__PURE__ */ jsx23("p", { className: "mt-3 max-w-md text-[15px] leading-relaxed text-muted-foreground", children: subline }),
6305
+ doors && doors.length > 0 && /* @__PURE__ */ jsx23("div", { className: `mt-7 grid w-full gap-2.5 ${doorsGridClass}`, children: doors.slice(0, 3).map((door, i) => /* @__PURE__ */ jsxs20(
6101
6306
  "button",
6102
6307
  {
6103
6308
  type: "button",
6104
6309
  onClick: door.onSelect,
6105
6310
  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",
6106
6311
  children: [
6107
- /* @__PURE__ */ jsxs19("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6312
+ /* @__PURE__ */ jsxs20("span", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
6108
6313
  door.icon,
6109
6314
  door.label
6110
6315
  ] }),
6111
- door.description && /* @__PURE__ */ jsx22("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6316
+ door.description && /* @__PURE__ */ jsx23("span", { className: "mt-0.5 text-[12px] leading-snug text-muted-foreground", children: door.description })
6112
6317
  ]
6113
6318
  },
6114
6319
  i
@@ -6117,26 +6322,26 @@ function ChatEmptyState({
6117
6322
  }
6118
6323
  function ToolGlyph({ name, className }) {
6119
6324
  if (name.startsWith("sandbox_")) {
6120
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6121
- /* @__PURE__ */ jsx22("polyline", { points: "4 17 10 11 4 5" }),
6122
- /* @__PURE__ */ jsx22("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6325
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6326
+ /* @__PURE__ */ jsx23("polyline", { points: "4 17 10 11 4 5" }),
6327
+ /* @__PURE__ */ jsx23("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
6123
6328
  ] });
6124
6329
  }
6125
6330
  if (name === "submit_proposal") {
6126
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6127
- /* @__PURE__ */ jsx22("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6128
- /* @__PURE__ */ jsx22("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6331
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6332
+ /* @__PURE__ */ jsx23("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
6333
+ /* @__PURE__ */ jsx23("path", { d: "M14 2v6h6M9 15l2 2 4-4" })
6129
6334
  ] });
6130
6335
  }
6131
6336
  if (name === "schedule_followup") {
6132
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6133
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6134
- /* @__PURE__ */ jsx22("path", { d: "M12 7v5l3 3" })
6337
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": true, children: [
6338
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6339
+ /* @__PURE__ */ jsx23("path", { d: "M12 7v5l3 3" })
6135
6340
  ] });
6136
6341
  }
6137
- return /* @__PURE__ */ jsxs19("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6138
- /* @__PURE__ */ jsx22("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6139
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "4" })
6342
+ return /* @__PURE__ */ jsxs20("svg", { className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
6343
+ /* @__PURE__ */ jsx23("path", { d: "M12 3v3m0 12v3M3 12h3m12 0h3" }),
6344
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "4" })
6140
6345
  ] });
6141
6346
  }
6142
6347
  function toolOutcomeOf(call) {
@@ -6222,37 +6427,37 @@ function truncate(v, max = 240) {
6222
6427
  function KvRows({ data }) {
6223
6428
  const entries = Object.entries(data).filter(([, v]) => v !== void 0 && v !== null && v !== "");
6224
6429
  if (!entries.length) return null;
6225
- return /* @__PURE__ */ jsx22("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs19("div", { className: "contents", children: [
6226
- /* @__PURE__ */ jsx22("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6227
- /* @__PURE__ */ jsx22("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6430
+ return /* @__PURE__ */ jsx23("dl", { className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1", children: entries.map(([k, v]) => /* @__PURE__ */ jsxs20("div", { className: "contents", children: [
6431
+ /* @__PURE__ */ jsx23("dt", { className: "font-mono text-xs text-muted-foreground", children: k }),
6432
+ /* @__PURE__ */ jsx23("dd", { className: "min-w-0 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground", children: truncate(v) })
6228
6433
  ] }, k)) });
6229
6434
  }
6230
6435
  function ShellDetail({ call }) {
6231
6436
  const outcome = toolOutcomeOf(call);
6232
6437
  const r = outcome?.result ?? {};
6233
- return /* @__PURE__ */ jsxs19(TerminalDisplay, { showHeader: false, autoScroll: false, maxHeight: "14rem", className: "text-xs", children: [
6234
- /* @__PURE__ */ jsx22(TerminalLine, { type: "command", children: String(call.args?.command ?? "") }),
6235
- r.exitCode != null && /* @__PURE__ */ jsxs19(TerminalLine, { type: r.exitCode === 0 ? "success" : "error", children: [
6438
+ return /* @__PURE__ */ jsxs20(TerminalDisplay, { showHeader: false, autoScroll: false, maxHeight: "14rem", className: "text-xs", children: [
6439
+ /* @__PURE__ */ jsx23(TerminalLine, { type: "command", children: String(call.args?.command ?? "") }),
6440
+ r.exitCode != null && /* @__PURE__ */ jsxs20(TerminalLine, { type: r.exitCode === 0 ? "success" : "error", children: [
6236
6441
  "exit ",
6237
6442
  r.exitCode
6238
6443
  ] }),
6239
- /* @__PURE__ */ jsx22(TerminalLine, { type: outcome?.ok === false ? "error" : "output", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6444
+ /* @__PURE__ */ jsx23(TerminalLine, { type: outcome?.ok === false ? "error" : "output", children: outcome?.ok === false ? outcome.message ?? "failed" : [r.stdout, r.stderr].filter(Boolean).join("\n") || "(no output)" })
6240
6445
  ] });
6241
6446
  }
6242
6447
  function DefaultToolDetail({ call }) {
6243
6448
  const result = call.result;
6244
6449
  const envelope = typeof result === "object" && result !== null ? result : null;
6245
- return /* @__PURE__ */ jsxs19("div", { className: "space-y-2", children: [
6246
- call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs19("div", { children: [
6247
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6248
- /* @__PURE__ */ jsx22(KvRows, { data: call.args })
6450
+ return /* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
6451
+ call.args && Object.keys(call.args).length > 0 && /* @__PURE__ */ jsxs20("div", { children: [
6452
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Called with" }),
6453
+ /* @__PURE__ */ jsx23(KvRows, { data: call.args })
6249
6454
  ] }),
6250
- envelope ? /* @__PURE__ */ jsxs19("div", { children: [
6251
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6252
- envelope.ok === false ? /* @__PURE__ */ jsx22("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx22(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx22("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6253
- ] }) : result != null ? /* @__PURE__ */ jsxs19("div", { children: [
6254
- /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6255
- /* @__PURE__ */ jsx22("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6455
+ envelope ? /* @__PURE__ */ jsxs20("div", { children: [
6456
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: envelope.ok === false ? "Failed" : "Result" }),
6457
+ envelope.ok === false ? /* @__PURE__ */ jsx23("p", { className: "text-xs text-destructive", children: envelope.message ?? "Tool failed" }) : envelope.result && typeof envelope.result === "object" ? /* @__PURE__ */ jsx23(KvRows, { data: envelope.result }) : envelope.result != null ? /* @__PURE__ */ jsx23("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(envelope.result) }) : null
6458
+ ] }) : result != null ? /* @__PURE__ */ jsxs20("div", { children: [
6459
+ /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: "Result" }),
6460
+ /* @__PURE__ */ jsx23("p", { className: "font-mono text-xs text-muted-foreground", children: truncate(result) })
6256
6461
  ] }) : null
6257
6462
  ] });
6258
6463
  }
@@ -6263,24 +6468,24 @@ function ProposalCard({
6263
6468
  approval,
6264
6469
  renderers
6265
6470
  }) {
6266
- const [expanded, setExpanded] = useState21(false);
6471
+ const [expanded, setExpanded] = useState22(false);
6267
6472
  const { summary, meta, typeSlug } = proposalPreview(call);
6268
6473
  const custom = renderers?.[call.name]?.(call, message);
6269
6474
  const { pending: deciding, run: decide } = usePending();
6270
- return /* @__PURE__ */ jsxs19("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: [
6271
- /* @__PURE__ */ jsxs19("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6272
- /* @__PURE__ */ jsx22("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__ */ jsx22(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6273
- /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1", children: [
6274
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6275
- /* @__PURE__ */ jsx22("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6276
- summary && /* @__PURE__ */ jsx22("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6277
- typeSlug && /* @__PURE__ */ jsx22("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6278
- meta.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx22("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6475
+ return /* @__PURE__ */ jsxs20("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: [
6476
+ /* @__PURE__ */ jsxs20("div", { className: "flex items-start gap-2.5 px-4 pt-3.5", children: [
6477
+ /* @__PURE__ */ jsx23("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__ */ jsx23(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6478
+ /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
6479
+ /* @__PURE__ */ jsx23("p", { className: "text-xs font-semibold uppercase tracking-[0.05em] text-warning-strong", children: approval ? "Needs your approval" : "Awaiting approval" }),
6480
+ /* @__PURE__ */ jsx23("p", { className: "mt-0.5 text-[15px] font-semibold leading-snug text-foreground", children: friendlyToolTitle(call) }),
6481
+ summary && /* @__PURE__ */ jsx23("p", { className: "mt-1 text-xs leading-relaxed text-muted-foreground", children: summary }),
6482
+ typeSlug && /* @__PURE__ */ jsx23("p", { className: "mt-1 font-mono text-xs text-muted-foreground", children: typeSlug }),
6483
+ meta.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: meta.map((m, i) => /* @__PURE__ */ jsx23("span", { className: "rounded-full bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground", children: m }, i)) })
6279
6484
  ] })
6280
6485
  ] }),
6281
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6282
- approval && /* @__PURE__ */ jsxs19(Fragment6, { children: [
6283
- /* @__PURE__ */ jsx22(
6486
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-2 px-4 pb-3.5 pt-3", children: [
6487
+ approval && /* @__PURE__ */ jsxs20(Fragment7, { children: [
6488
+ /* @__PURE__ */ jsx23(
6284
6489
  "button",
6285
6490
  {
6286
6491
  type: "button",
@@ -6290,7 +6495,7 @@ function ProposalCard({
6290
6495
  children: "Approve & run"
6291
6496
  }
6292
6497
  ),
6293
- /* @__PURE__ */ jsx22(
6498
+ /* @__PURE__ */ jsx23(
6294
6499
  "button",
6295
6500
  {
6296
6501
  type: "button",
@@ -6301,7 +6506,7 @@ function ProposalCard({
6301
6506
  }
6302
6507
  )
6303
6508
  ] }),
6304
- /* @__PURE__ */ jsxs19(
6509
+ /* @__PURE__ */ jsxs20(
6305
6510
  "button",
6306
6511
  {
6307
6512
  type: "button",
@@ -6310,12 +6515,12 @@ function ProposalCard({
6310
6515
  className: "ml-auto inline-flex items-center gap-1 rounded text-[12px] font-medium text-muted-foreground transition hover:text-foreground",
6311
6516
  children: [
6312
6517
  expanded ? "Hide details" : "View details",
6313
- /* @__PURE__ */ jsx22(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6518
+ /* @__PURE__ */ jsx23(ChevronDown, { className: `h-3 w-3 transition-transform ${expanded ? "rotate-180" : ""}` })
6314
6519
  ]
6315
6520
  }
6316
6521
  )
6317
6522
  ] }),
6318
- expanded && /* @__PURE__ */ jsx22("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx22(DefaultToolDetail, { call }) })
6523
+ expanded && /* @__PURE__ */ jsx23("div", { className: "border-t border-warning/20 px-4 py-3 text-xs", children: custom ?? /* @__PURE__ */ jsx23(DefaultToolDetail, { call }) })
6319
6524
  ] });
6320
6525
  }
6321
6526
  function formatFollowupWhen(when) {
@@ -6330,14 +6535,14 @@ function FollowupCard({ call }) {
6330
6535
  const when = typeof a.when === "string" ? a.when : typeof a.at === "string" ? a.at : typeof a.schedule === "string" ? a.schedule : null;
6331
6536
  const failed = toolCallFailed(call);
6332
6537
  const errorText = failed ? toolOutcomeOf(call)?.message ?? "Scheduling failed" : null;
6333
- return /* @__PURE__ */ jsx22("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6334
- /* @__PURE__ */ jsxs19("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6335
- /* @__PURE__ */ jsx22("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__ */ jsx22(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6336
- /* @__PURE__ */ jsx22("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6337
- when && /* @__PURE__ */ jsx22("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) }),
6338
- /* @__PURE__ */ jsx22("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx22("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__ */ jsx22("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx22("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6538
+ return /* @__PURE__ */ jsx23("div", { className: "flex items-start gap-2", children: /* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1 overflow-hidden rounded-[var(--radius-lg)] border border-[var(--border-subtle)] bg-[var(--md3-surface-container)]", children: [
6539
+ /* @__PURE__ */ jsxs20("div", { className: "flex w-full items-center gap-2.5 px-3 py-2", children: [
6540
+ /* @__PURE__ */ jsx23("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__ */ jsx23(ToolGlyph, { name: call.name, className: "h-3.5 w-3.5" }) }),
6541
+ /* @__PURE__ */ jsx23("span", { className: "shrink-0 whitespace-nowrap text-xs font-medium text-foreground", children: friendlyToolTitle(call) }),
6542
+ when && /* @__PURE__ */ jsx23("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) }),
6543
+ /* @__PURE__ */ jsx23("span", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: call.status === "running" ? /* @__PURE__ */ jsx23("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__ */ jsx23("path", { d: "M21 12a9 9 0 1 1-6.219-8.56", strokeLinecap: "round" }) }) : /* @__PURE__ */ jsx23("span", { className: `h-1.5 w-1.5 shrink-0 rounded-full ${failed ? "bg-[var(--surface-danger-text)]" : "bg-[var(--surface-success-text)]"}` }) })
6339
6544
  ] }),
6340
- errorText && /* @__PURE__ */ jsx22("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6545
+ errorText && /* @__PURE__ */ jsx23("div", { className: "border-t border-border px-3 py-2 text-xs text-[var(--surface-danger-text)]", children: errorText })
6341
6546
  ] }) });
6342
6547
  }
6343
6548
  function toolRowTitle(call) {
@@ -6360,10 +6565,10 @@ function ToolCallCard({
6360
6565
  const arrival = useArrivalStyle(staggerIndex ?? 0);
6361
6566
  const pending = call.status === "done" ? pendingApprovalOf(call) : null;
6362
6567
  const kind = blockKindOf(call);
6363
- const arrive = (row) => /* @__PURE__ */ jsx22("div", { className: "agent-arrive", style: arrival, children: row });
6568
+ const arrive = (row) => /* @__PURE__ */ jsx23("div", { className: "agent-arrive", style: arrival, children: row });
6364
6569
  if (pending) {
6365
6570
  return arrive(
6366
- /* @__PURE__ */ jsx22(
6571
+ /* @__PURE__ */ jsx23(
6367
6572
  ProposalCard,
6368
6573
  {
6369
6574
  call,
@@ -6376,18 +6581,18 @@ function ToolCallCard({
6376
6581
  );
6377
6582
  }
6378
6583
  if (kind === "followup") {
6379
- return arrive(/* @__PURE__ */ jsx22(FollowupCard, { call }));
6584
+ return arrive(/* @__PURE__ */ jsx23(FollowupCard, { call }));
6380
6585
  }
6381
6586
  const custom = renderers?.[call.name]?.(call, message);
6382
6587
  return arrive(
6383
- /* @__PURE__ */ jsx22(
6588
+ /* @__PURE__ */ jsx23(
6384
6589
  InlineToolItem,
6385
6590
  {
6386
6591
  part: chatToolCallPart(call),
6387
6592
  title: toolRowTitle(call),
6388
6593
  description: toolRowDescription(call),
6389
- renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx22(ShellDetail, { call }) : /* @__PURE__ */ jsx22(DefaultToolDetail, { call })),
6390
- actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx22(
6594
+ renderToolDetail: () => custom ?? (call.name === "sandbox_run_command" ? /* @__PURE__ */ jsx23(ShellDetail, { call }) : /* @__PURE__ */ jsx23(DefaultToolDetail, { call })),
6595
+ actions: onOpenRun && call.name.startsWith("sandbox_") ? /* @__PURE__ */ jsx23(
6391
6596
  "button",
6392
6597
  {
6393
6598
  type: "button",
@@ -6395,9 +6600,9 @@ function ToolCallCard({
6395
6600
  "aria-label": "Open full transcript",
6396
6601
  title: "Open full transcript",
6397
6602
  className: "rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground",
6398
- children: /* @__PURE__ */ jsxs19("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: [
6399
- /* @__PURE__ */ jsx22("path", { d: "M7 17 17 7" }),
6400
- /* @__PURE__ */ jsx22("path", { d: "M7 7h10v10" })
6603
+ children: /* @__PURE__ */ jsxs20("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: [
6604
+ /* @__PURE__ */ jsx23("path", { d: "M7 17 17 7" }),
6605
+ /* @__PURE__ */ jsx23("path", { d: "M7 7h10v10" })
6401
6606
  ] })
6402
6607
  }
6403
6608
  ) : void 0
@@ -6406,7 +6611,7 @@ function ToolCallCard({
6406
6611
  );
6407
6612
  }
6408
6613
  function StreamingCaret() {
6409
- return /* @__PURE__ */ jsx22(
6614
+ return /* @__PURE__ */ jsx23(
6410
6615
  "span",
6411
6616
  {
6412
6617
  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",
@@ -6431,9 +6636,9 @@ function SegmentText({
6431
6636
  // the container on top of that makes the paragraph shimmer while it types.
6432
6637
  // The distinction is what separates "the answer materialised" from "the
6433
6638
  // log was appended to".
6434
- /* @__PURE__ */ jsxs19("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6639
+ /* @__PURE__ */ jsxs20("div", { className: `${messageClassName}${streaming ? "" : " agent-stream-in"}`, children: [
6435
6640
  body,
6436
- showCaret && /* @__PURE__ */ jsx22(StreamingCaret, {})
6641
+ showCaret && /* @__PURE__ */ jsx23(StreamingCaret, {})
6437
6642
  ] })
6438
6643
  );
6439
6644
  }
@@ -6458,7 +6663,7 @@ function SegmentedBody({
6458
6663
  const leftoverToolCalls = (msg.toolCalls ?? []).filter(
6459
6664
  (tc) => !segmentToolIds.has(tc.id)
6460
6665
  );
6461
- const renderToolCard = (call, index) => /* @__PURE__ */ jsx22(
6666
+ const renderToolCard = (call, index) => /* @__PURE__ */ jsx23(
6462
6667
  ToolCallCard,
6463
6668
  {
6464
6669
  call,
@@ -6487,12 +6692,12 @@ function SegmentedBody({
6487
6692
  const children = [];
6488
6693
  for (const g of groups) {
6489
6694
  if (g.kind === "notice") {
6490
- children.push(/* @__PURE__ */ jsx22(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
6695
+ children.push(/* @__PURE__ */ jsx23(SegmentNotice, { tone: g.tone, content: g.content }, `notice-${g.index}`));
6491
6696
  continue;
6492
6697
  }
6493
6698
  if (g.kind === "text") {
6494
6699
  children.push(
6495
- /* @__PURE__ */ jsx22(
6700
+ /* @__PURE__ */ jsx23(
6496
6701
  SegmentText,
6497
6702
  {
6498
6703
  content: g.content,
@@ -6508,13 +6713,13 @@ function SegmentedBody({
6508
6713
  }
6509
6714
  if (!streaming && g.calls.length >= COLLAPSE_TOOL_RUN_AT && !g.calls.some(isImportantTool)) {
6510
6715
  children.push(
6511
- /* @__PURE__ */ jsxs19("details", { children: [
6512
- /* @__PURE__ */ jsxs19("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: [
6716
+ /* @__PURE__ */ jsxs20("details", { children: [
6717
+ /* @__PURE__ */ jsxs20("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: [
6513
6718
  "Worked through ",
6514
6719
  g.calls.length,
6515
6720
  " steps"
6516
6721
  ] }),
6517
- /* @__PURE__ */ jsx22("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6722
+ /* @__PURE__ */ jsx23("div", { className: "mt-1.5 flex flex-col gap-1.5", children: g.calls.map(renderToolCard) })
6518
6723
  ] }, `tools-fold-${g.index}`)
6519
6724
  );
6520
6725
  continue;
@@ -6523,9 +6728,9 @@ function SegmentedBody({
6523
6728
  }
6524
6729
  leftoverToolCalls.forEach((call, index) => children.push(renderToolCard(call, index)));
6525
6730
  if (streaming && segments[lastIndex]?.kind === "tool") {
6526
- children.push(/* @__PURE__ */ jsx22(StreamingCaret, {}, "streaming-caret"));
6731
+ children.push(/* @__PURE__ */ jsx23(StreamingCaret, {}, "streaming-caret"));
6527
6732
  }
6528
- return /* @__PURE__ */ jsx22("div", { className: "flex flex-col gap-2", children });
6733
+ return /* @__PURE__ */ jsx23("div", { className: "flex flex-col gap-2", children });
6529
6734
  }
6530
6735
  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";
6531
6736
  function copyTextOf(msg) {
@@ -6534,9 +6739,9 @@ function copyTextOf(msg) {
6534
6739
  return msg.content;
6535
6740
  }
6536
6741
  function CopyMessageButton({ text }) {
6537
- const [copied, setCopied] = useState21(false);
6538
- const timerRef = useRef14(null);
6539
- useEffect15(
6742
+ const [copied, setCopied] = useState22(false);
6743
+ const timerRef = useRef15(null);
6744
+ useEffect16(
6540
6745
  () => () => {
6541
6746
  if (timerRef.current !== null) clearTimeout(timerRef.current);
6542
6747
  },
@@ -6555,7 +6760,7 @@ function CopyMessageButton({ text }) {
6555
6760
  }
6556
6761
  );
6557
6762
  };
6558
- return /* @__PURE__ */ jsx22(
6763
+ return /* @__PURE__ */ jsx23(
6559
6764
  "button",
6560
6765
  {
6561
6766
  type: "button",
@@ -6563,9 +6768,9 @@ function CopyMessageButton({ text }) {
6563
6768
  "aria-label": "Copy message",
6564
6769
  title: "Copy message",
6565
6770
  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",
6566
- children: copied ? /* @__PURE__ */ jsx22("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__ */ jsx22("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs19("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: [
6567
- /* @__PURE__ */ jsx22("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6568
- /* @__PURE__ */ jsx22("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6771
+ children: copied ? /* @__PURE__ */ jsx23("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__ */ jsx23("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ jsxs20("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: [
6772
+ /* @__PURE__ */ jsx23("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
6773
+ /* @__PURE__ */ jsx23("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
6569
6774
  ] })
6570
6775
  }
6571
6776
  );
@@ -6591,21 +6796,21 @@ function AssistantMessageImpl({
6591
6796
  const segments = msg.segments;
6592
6797
  const hasAnswerText = content !== "" || (segments?.some((s) => (s.kind === "text" || s.kind === "notice") && s.content.trim() !== "") ?? false);
6593
6798
  const quiet = chrome === "quiet";
6594
- return /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6595
- quiet && msg.author && /* @__PURE__ */ jsx22(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
6596
- !quiet && /* @__PURE__ */ jsxs19(
6799
+ return /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6800
+ quiet && msg.author && /* @__PURE__ */ jsx23(MessageAuthor, { author: msg.author, className: "mb-1.5" }),
6801
+ !quiet && /* @__PURE__ */ jsxs20(
6597
6802
  "div",
6598
6803
  {
6599
6804
  className: `mb-1 flex ${msg.author ? "items-center" : "items-baseline"} gap-2 text-xs tabular-nums text-muted-foreground`,
6600
6805
  children: [
6601
- msg.author ? /* @__PURE__ */ jsx22(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx22("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
6602
- msg.modelUsed && /* @__PURE__ */ jsx22("span", { className: "font-mono normal-case", children: msg.modelUsed }),
6603
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx22("span", { children: formatTokensPerSecond(msg) }),
6604
- formatModelCost(msg, models) && /* @__PURE__ */ jsx22("span", { children: formatModelCost(msg, models) })
6806
+ msg.author ? /* @__PURE__ */ jsx23(MessageAuthor, { author: msg.author }) : /* @__PURE__ */ jsx23("span", { className: "font-semibold uppercase tracking-[0.05em]", children: agentLabel }),
6807
+ msg.modelUsed && /* @__PURE__ */ jsx23("span", { className: "font-mono normal-case", children: msg.modelUsed }),
6808
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx23("span", { children: formatTokensPerSecond(msg) }),
6809
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx23("span", { children: formatModelCost(msg, models) })
6605
6810
  ]
6606
6811
  }
6607
6812
  ),
6608
- /* @__PURE__ */ jsx22(
6813
+ /* @__PURE__ */ jsx23(
6609
6814
  ReasoningRow,
6610
6815
  {
6611
6816
  className: "mb-2",
@@ -6615,7 +6820,7 @@ function AssistantMessageImpl({
6615
6820
  thinking: streaming && !hasAnswerText && msg.reasoningEndedAt === void 0
6616
6821
  }
6617
6822
  ),
6618
- segments && segments.length > 0 ? /* @__PURE__ */ jsx22(
6823
+ segments && segments.length > 0 ? /* @__PURE__ */ jsx23(
6619
6824
  SegmentedBody,
6620
6825
  {
6621
6826
  segments,
@@ -6627,12 +6832,12 @@ function AssistantMessageImpl({
6627
6832
  toolRenderers,
6628
6833
  messageClassName
6629
6834
  }
6630
- ) : /* @__PURE__ */ jsxs19(Fragment6, { children: [
6631
- /* @__PURE__ */ jsxs19("div", { className: messageClassName, children: [
6835
+ ) : /* @__PURE__ */ jsxs20(Fragment7, { children: [
6836
+ /* @__PURE__ */ jsxs20("div", { className: messageClassName, children: [
6632
6837
  body,
6633
- streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx22(StreamingCaret, {})
6838
+ streaming && content && !msg.toolCalls?.length && /* @__PURE__ */ jsx23(StreamingCaret, {})
6634
6839
  ] }),
6635
- msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx22(
6840
+ msg.toolCalls && msg.toolCalls.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-2 flex flex-col gap-1.5", children: msg.toolCalls.map((tc, index) => /* @__PURE__ */ jsx23(
6636
6841
  ToolCallCard,
6637
6842
  {
6638
6843
  call: tc,
@@ -6645,7 +6850,7 @@ function AssistantMessageImpl({
6645
6850
  tc.id
6646
6851
  )) })
6647
6852
  ] }),
6648
- durableCards && msg.parts && /* @__PURE__ */ jsx22(
6853
+ durableCards && msg.parts && /* @__PURE__ */ jsx23(
6649
6854
  DurableChatCards,
6650
6855
  {
6651
6856
  ...durableCards,
@@ -6654,7 +6859,7 @@ function AssistantMessageImpl({
6654
6859
  className: "mt-3"
6655
6860
  }
6656
6861
  ),
6657
- workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx22(
6862
+ workProductCards && workProductPartsFromMessageParts(msg.parts).map((part) => /* @__PURE__ */ jsx23(
6658
6863
  WorkProductCard,
6659
6864
  {
6660
6865
  part,
@@ -6664,7 +6869,7 @@ function AssistantMessageImpl({
6664
6869
  `${part.ref.id}:${part.ref.version}`
6665
6870
  )),
6666
6871
  renderExtras?.(msg),
6667
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-2", children: /* @__PURE__ */ jsx22(
6872
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-2", children: /* @__PURE__ */ jsx23(
6668
6873
  MessageAttachments,
6669
6874
  {
6670
6875
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6672,18 +6877,18 @@ function AssistantMessageImpl({
6672
6877
  justify: "start"
6673
6878
  }
6674
6879
  ) }),
6675
- quiet && /* @__PURE__ */ jsxs19("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
6676
- /* @__PURE__ */ jsx22(CopyMessageButton, { text: copyTextOf(msg) }),
6677
- msg.modelUsed && /* @__PURE__ */ jsx22("span", { className: "font-mono", children: msg.modelUsed }),
6678
- formatTokensPerSecond(msg) && /* @__PURE__ */ jsx22("span", { children: formatTokensPerSecond(msg) }),
6679
- formatModelCost(msg, models) && /* @__PURE__ */ jsx22("span", { children: formatModelCost(msg, models) })
6880
+ quiet && /* @__PURE__ */ jsxs20("div", { "data-testid": "message-meta-lane", className: QUIET_META_LANE_CLASS, children: [
6881
+ /* @__PURE__ */ jsx23(CopyMessageButton, { text: copyTextOf(msg) }),
6882
+ msg.modelUsed && /* @__PURE__ */ jsx23("span", { className: "font-mono", children: msg.modelUsed }),
6883
+ formatTokensPerSecond(msg) && /* @__PURE__ */ jsx23("span", { children: formatTokensPerSecond(msg) }),
6884
+ formatModelCost(msg, models) && /* @__PURE__ */ jsx23("span", { children: formatModelCost(msg, models) })
6680
6885
  ] })
6681
6886
  ] });
6682
6887
  }
6683
6888
  var AssistantMessage = memo(AssistantMessageImpl);
6684
6889
  function useThinkingSeconds(active) {
6685
- const [seconds, setSeconds] = useState21(0);
6686
- useEffect15(() => {
6890
+ const [seconds, setSeconds] = useState22(0);
6891
+ useEffect16(() => {
6687
6892
  if (!active) return;
6688
6893
  setSeconds(0);
6689
6894
  const id = setInterval(() => setSeconds((s) => s + 1), 1e3);
@@ -6692,9 +6897,9 @@ function useThinkingSeconds(active) {
6692
6897
  return seconds;
6693
6898
  }
6694
6899
  function ThinkingRow({ agentLabel, chrome = "labeled", phase }) {
6695
- return /* @__PURE__ */ jsxs19("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
6696
- chrome !== "quiet" && /* @__PURE__ */ jsx22("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
6697
- /* @__PURE__ */ jsx22(TurnProgress, { phase, pendingMessage: "Thinking\u2026", className: "text-[15px]" })
6900
+ return /* @__PURE__ */ jsxs20("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: [
6901
+ chrome !== "quiet" && /* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: agentLabel }),
6902
+ /* @__PURE__ */ jsx23(TurnProgress, { phase, pendingMessage: "Thinking\u2026", className: "text-[15px]" })
6698
6903
  ] });
6699
6904
  }
6700
6905
  var NOTICE_TONE_CLASS = {
@@ -6702,29 +6907,29 @@ var NOTICE_TONE_CLASS = {
6702
6907
  warning: "border-warning/40 bg-warning/10 text-warning-strong"
6703
6908
  };
6704
6909
  function SegmentNotice({ tone, content }) {
6705
- return /* @__PURE__ */ jsxs19(
6910
+ return /* @__PURE__ */ jsxs20(
6706
6911
  "div",
6707
6912
  {
6708
6913
  "data-notice-tone": tone,
6709
6914
  className: `flex items-start gap-2.5 rounded-lg border px-3 py-2.5 text-sm ${NOTICE_TONE_CLASS[tone]}`,
6710
6915
  children: [
6711
- /* @__PURE__ */ jsxs19("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: [
6712
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6713
- /* @__PURE__ */ jsx22("path", { d: "M12 8v4m0 4h.01" })
6916
+ /* @__PURE__ */ jsxs20("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: [
6917
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6918
+ /* @__PURE__ */ jsx23("path", { d: "M12 8v4m0 4h.01" })
6714
6919
  ] }),
6715
- /* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
6920
+ /* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 whitespace-pre-wrap break-words", children: content })
6716
6921
  ]
6717
6922
  }
6718
6923
  );
6719
6924
  }
6720
6925
  function StreamErrorRow({ message, onRetry }) {
6721
- return /* @__PURE__ */ jsx22("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs19("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: [
6722
- /* @__PURE__ */ jsxs19("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: [
6723
- /* @__PURE__ */ jsx22("circle", { cx: "12", cy: "12", r: "9" }),
6724
- /* @__PURE__ */ jsx22("path", { d: "M12 8v4m0 4h.01" })
6926
+ return /* @__PURE__ */ jsx23("div", { className: "mx-auto w-full max-w-3xl px-6 py-3", children: /* @__PURE__ */ jsxs20("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: [
6927
+ /* @__PURE__ */ jsxs20("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: [
6928
+ /* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "9" }),
6929
+ /* @__PURE__ */ jsx23("path", { d: "M12 8v4m0 4h.01" })
6725
6930
  ] }),
6726
- /* @__PURE__ */ jsx22("span", { className: "min-w-0 flex-1 break-words", children: message }),
6727
- onRetry && /* @__PURE__ */ jsx22(
6931
+ /* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 break-words", children: message }),
6932
+ onRetry && /* @__PURE__ */ jsx23(
6728
6933
  "button",
6729
6934
  {
6730
6935
  type: "button",
@@ -6743,19 +6948,19 @@ function OtherPersonMessage({
6743
6948
  resolveAttachmentUrl
6744
6949
  }) {
6745
6950
  const attachments = resolveAttachmentUrl ? attachmentPartsFromMessageParts(msg.parts) : [];
6746
- return /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6747
- /* @__PURE__ */ jsxs19("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6748
- /* @__PURE__ */ jsx22(MessageAuthor, { author, className: "mb-1.5" }),
6749
- /* @__PURE__ */ jsx22(
6951
+ return /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6952
+ /* @__PURE__ */ jsxs20("div", { className: `w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6953
+ /* @__PURE__ */ jsx23(MessageAuthor, { author, className: "mb-1.5" }),
6954
+ /* @__PURE__ */ jsx23(
6750
6955
  "div",
6751
6956
  {
6752
6957
  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}`,
6753
- children: /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: msg.content })
6958
+ children: /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: msg.content })
6754
6959
  }
6755
6960
  ),
6756
- resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx22(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
6961
+ resolveAttachmentUrl && attachments.length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx23(MessageAttachments, { parts: attachments, resolveFileUrl: resolveAttachmentUrl, justify: "start" }) })
6757
6962
  ] }),
6758
- quiet && /* @__PURE__ */ jsx22("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx22(CopyMessageButton, { text: msg.content }) })
6963
+ quiet && /* @__PURE__ */ jsx23("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-start`, children: /* @__PURE__ */ jsx23(CopyMessageButton, { text: msg.content }) })
6759
6964
  ] });
6760
6965
  }
6761
6966
  function ChatMessages({
@@ -6785,22 +6990,22 @@ function ChatMessages({
6785
6990
  const messageClassName = messageSize === "large" ? `agent-app-message-copy ${TRANSCRIPT_TEXT} [--transcript-font-size:1.0625rem]` : `agent-app-message-copy ${TRANSCRIPT_TEXT}`;
6786
6991
  const assistantMessageClassName = `${messageClassName} bg-transparent text-[hsl(var(--foreground))]`;
6787
6992
  const renderBody = useMemo8(
6788
- () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: content })),
6993
+ () => renderMarkdown ?? ((content) => /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: content })),
6789
6994
  [renderMarkdown]
6790
6995
  );
6791
6996
  const lastIsUser = messages[messages.length - 1]?.role === "user";
6792
6997
  const quiet = chrome === "quiet";
6793
6998
  if (messages.length === 0 && !loading && !error) {
6794
- const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx22(ChatEmptyState, { ...emptyState });
6795
- return /* @__PURE__ */ jsxs19(Fragment6, { children: [
6999
+ const empty = renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx23(ChatEmptyState, { ...emptyState });
7000
+ return /* @__PURE__ */ jsxs20(Fragment7, { children: [
6796
7001
  header,
6797
7002
  empty
6798
7003
  ] });
6799
7004
  }
6800
- return /* @__PURE__ */ jsxs19(Fragment6, { children: [
7005
+ return /* @__PURE__ */ jsxs20(Fragment7, { children: [
6801
7006
  header,
6802
7007
  messages.map(
6803
- (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx22(
7008
+ (msg) => msg.role === "user" && msg.author && !isViewerMessage(msg.author, viewerId) ? /* @__PURE__ */ jsx23(
6804
7009
  OtherPersonMessage,
6805
7010
  {
6806
7011
  msg,
@@ -6810,17 +7015,17 @@ function ChatMessages({
6810
7015
  resolveAttachmentUrl
6811
7016
  },
6812
7017
  msg.id
6813
- ) : msg.role === "user" ? /* @__PURE__ */ jsxs19("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
6814
- /* @__PURE__ */ jsxs19("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
6815
- !quiet && /* @__PURE__ */ jsx22("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
6816
- /* @__PURE__ */ jsx22(
7018
+ ) : msg.role === "user" ? /* @__PURE__ */ jsxs20("div", { className: `mx-auto w-full max-w-3xl px-6 ${quiet ? "group pb-1 pt-3" : "py-3"}`, children: [
7019
+ /* @__PURE__ */ jsxs20("div", { className: `ml-auto w-fit ${quiet ? "max-w-[72%]" : "max-w-[85%]"}`, children: [
7020
+ !quiet && /* @__PURE__ */ jsx23("p", { className: "mb-1 text-right text-xs font-semibold uppercase tracking-[0.05em] text-muted-foreground", children: userLabel }),
7021
+ /* @__PURE__ */ jsx23(
6817
7022
  "div",
6818
7023
  {
6819
7024
  className: `rounded-2xl bg-[hsl(var(--foreground))] px-4 py-2.5 text-[hsl(var(--background))] ${quiet ? "" : "rounded-tr-md "}${messageClassName}`,
6820
- children: /* @__PURE__ */ jsx22("p", { className: "whitespace-pre-wrap", children: msg.content })
7025
+ children: /* @__PURE__ */ jsx23("p", { className: "whitespace-pre-wrap", children: msg.content })
6821
7026
  }
6822
7027
  ),
6823
- resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx22("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx22(
7028
+ resolveAttachmentUrl && attachmentPartsFromMessageParts(msg.parts).length > 0 && /* @__PURE__ */ jsx23("div", { className: "mt-1.5", children: /* @__PURE__ */ jsx23(
6824
7029
  MessageAttachments,
6825
7030
  {
6826
7031
  parts: attachmentPartsFromMessageParts(msg.parts),
@@ -6829,8 +7034,8 @@ function ChatMessages({
6829
7034
  }
6830
7035
  ) })
6831
7036
  ] }),
6832
- quiet && /* @__PURE__ */ jsx22("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx22(CopyMessageButton, { text: msg.content }) })
6833
- ] }, msg.id) : /* @__PURE__ */ jsx22(
7037
+ quiet && /* @__PURE__ */ jsx23("div", { "data-testid": "message-meta-lane", className: `${QUIET_META_LANE_CLASS} justify-end`, children: /* @__PURE__ */ jsx23(CopyMessageButton, { text: msg.content }) })
7038
+ ] }, msg.id) : /* @__PURE__ */ jsx23(
6834
7039
  AssistantMessage,
6835
7040
  {
6836
7041
  msg,
@@ -6851,8 +7056,8 @@ function ChatMessages({
6851
7056
  msg.id
6852
7057
  )
6853
7058
  ),
6854
- loading && lastIsUser && /* @__PURE__ */ jsx22(ThinkingRow, { agentLabel, chrome, phase: turnPhase }),
6855
- error && !loading && /* @__PURE__ */ jsx22(StreamErrorRow, { message: error, onRetry })
7059
+ loading && lastIsUser && /* @__PURE__ */ jsx23(ThinkingRow, { agentLabel, chrome, phase: turnPhase }),
7060
+ error && !loading && /* @__PURE__ */ jsx23(StreamErrorRow, { message: error, onRetry })
6856
7061
  ] });
6857
7062
  }
6858
7063
 
@@ -6988,6 +7193,7 @@ export {
6988
7193
  insightPageCount,
6989
7194
  insightPageSlice,
6990
7195
  InsightDeck,
7196
+ ReviewInbox,
6991
7197
  ApiAccessPanel,
6992
7198
  AgentSetupBlock,
6993
7199
  AgentProfileChoices,
@@ -7001,4 +7207,4 @@ export {
7001
7207
  useThinkingSeconds,
7002
7208
  ChatMessages
7003
7209
  };
7004
- //# sourceMappingURL=chunk-QGOGX3DL.js.map
7210
+ //# sourceMappingURL=chunk-6ZUVYAKB.js.map