@mcp-b/react-components 0.17.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CRuMi1Pb.d.ts → AgentChat-ClxViuUM.d.ts} +1 -20
  3. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  4. package/dist/{CodeBlock-Co1noLbC.js → CodeBlock-Bb-IPBc_.js} +9 -6
  5. package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  6. package/dist/{FileTree-B7bBsUyU.js → FileTree-CUlXfnmc.js} +42 -16
  7. package/dist/{Message-C4eYRogZ.js → Message-rZEaaD8Q.js} +13 -20
  8. package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-4GsCWcZV.js} +15 -22
  9. package/dist/{PromptInput-OLfXPuHM.d.ts → PromptInput-Bdh9pqlo.d.ts} +4 -6
  10. package/dist/{Select-CwSqP07Y.d.ts → Select-B_13gg_J.d.ts} +2 -2
  11. package/dist/{Tabs-9zddXDQo.d.ts → Tabs-ColWK-XA.d.ts} +10 -2
  12. package/dist/{ThinkChat-DInElus-.js → ThinkChat-15EhfvYJ.js} +84 -61
  13. package/dist/{ThinkChatActivity-BgesTfZ4.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +4 -7
  14. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  15. package/dist/{Toggle-DaXpe1Lc.d.ts → Toggle-JKZ43D5S.d.ts} +1 -1
  16. package/dist/{ToggleGroup-yseEWkOC.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +2 -2
  17. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  18. package/dist/{WorkspaceExplorer-sZewzT2O.d.ts → WorkspaceExplorer-B9dQWNVK.d.ts} +2 -2
  19. package/dist/{WorkspaceFile-C8UzuSH4.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  20. package/dist/{WorkspaceFileView-DNdGAEiX.js → WorkspaceFileView-CEdArlOT.js} +120 -127
  21. package/dist/{WorkspaceLink-B1ykV1dS.js → WorkspaceLink-BYYeTQLf.js} +6 -27
  22. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  23. package/dist/{class-names-Bk-QLWWI.js → class-names-BiMDVpUo.js} +4 -1
  24. package/dist/components/Accordion.js +7 -2
  25. package/dist/components/Activity.js +2 -2
  26. package/dist/components/AgentActivity.d.ts +1 -1
  27. package/dist/components/AgentActivity.js +4 -5
  28. package/dist/components/AgentActivityPreview.d.ts +9 -9
  29. package/dist/components/AgentActivityPreview.js +8 -12
  30. package/dist/components/AgentAttention.d.ts +1 -1
  31. package/dist/components/AgentAttention.js +1 -1
  32. package/dist/components/AgentChat.d.ts +1 -1
  33. package/dist/components/AgentChat.js +94 -62
  34. package/dist/components/AgentChatMessageEditor.js +2 -2
  35. package/dist/components/AgentChatTurnError.js +2 -2
  36. package/dist/components/AgentConnection.js +3 -3
  37. package/dist/components/AgentMessageParts.js +1 -1
  38. package/dist/components/AgentToolDetail.d.ts +6 -4
  39. package/dist/components/AgentToolDetail.js +12 -10
  40. package/dist/components/AlertDialog.js +1 -1
  41. package/dist/components/AppTopBar.d.ts +24 -7
  42. package/dist/components/AppTopBar.js +32 -8
  43. package/dist/components/Approval.js +4 -4
  44. package/dist/components/Artifact.d.ts +1 -1
  45. package/dist/components/Artifact.js +6 -4
  46. package/dist/components/Autocomplete.js +1 -1
  47. package/dist/components/Avatar.d.ts +1 -1
  48. package/dist/components/Avatar.js +2 -2
  49. package/dist/components/Badge.js +3 -0
  50. package/dist/components/BrowserLiveView.js +27 -12
  51. package/dist/components/BrowserReplay.js +4 -3
  52. package/dist/components/BrowserRunPanel.js +5 -5
  53. package/dist/components/Button.d.ts +1 -1
  54. package/dist/components/Button.js +14 -11
  55. package/dist/components/Card.d.ts +7 -8
  56. package/dist/components/Card.js +19 -10
  57. package/dist/components/ChainOfThought.d.ts +1 -1
  58. package/dist/components/ChainOfThought.js +2 -2
  59. package/dist/components/ChatGptSignInScreen.js +8 -8
  60. package/dist/components/Checkbox.js +2 -2
  61. package/dist/components/CheckboxGroup.js +1 -1
  62. package/dist/components/Checkpoint.js +2 -2
  63. package/dist/components/CodeBlock.d.ts +1 -1
  64. package/dist/components/CodeBlock.js +1 -1
  65. package/dist/components/CodexModelSelector.js +35 -15
  66. package/dist/components/Collapsible.js +2 -2
  67. package/dist/components/Combobox.js +1 -1
  68. package/dist/components/Commit.d.ts +1 -1
  69. package/dist/components/Commit.js +3 -3
  70. package/dist/components/Context.js +1 -1
  71. package/dist/components/ContextMenu.js +2 -2
  72. package/dist/components/Conversation.d.ts +1 -1
  73. package/dist/components/Conversation.js +5 -4
  74. package/dist/components/DescriptionListParts.js +1 -1
  75. package/dist/components/Dialog.js +1 -1
  76. package/dist/components/EnvironmentVariables.d.ts +1 -1
  77. package/dist/components/EnvironmentVariables.js +3 -3
  78. package/dist/components/Field.js +5 -2
  79. package/dist/components/Fieldset.js +1 -1
  80. package/dist/components/FileTree.d.ts +6 -0
  81. package/dist/components/FileTree.js +1 -1
  82. package/dist/components/Form.js +1 -1
  83. package/dist/components/GithubMotionMark.js +1 -1
  84. package/dist/components/IconButton.d.ts +2 -3
  85. package/dist/components/IconButton.js +2 -1
  86. package/dist/components/InlineCitation.js +1 -1
  87. package/dist/components/Input.js +1 -1
  88. package/dist/components/Marker.js +1 -1
  89. package/dist/components/McpConnectionRequest.js +2 -2
  90. package/dist/components/McpServerPicker.js +2 -2
  91. package/dist/components/MediaPreviewCard.d.ts +103 -0
  92. package/dist/components/MediaPreviewCard.js +193 -0
  93. package/dist/components/Menu.js +1 -1
  94. package/dist/components/Menubar.js +2 -2
  95. package/dist/components/Message.d.ts +4 -1
  96. package/dist/components/Message.js +1 -1
  97. package/dist/components/MessageScroller.d.ts +1 -1
  98. package/dist/components/MessageScroller.js +5 -4
  99. package/dist/components/Meter.js +1 -1
  100. package/dist/components/ModelSelector.d.ts +4 -3
  101. package/dist/components/ModelSelector.js +1 -1
  102. package/dist/components/NavigationMenu.js +1 -1
  103. package/dist/components/NumberField.js +1 -1
  104. package/dist/components/Plan.js +2 -2
  105. package/dist/components/Popover.js +1 -1
  106. package/dist/components/PreviewCard.js +1 -1
  107. package/dist/components/PricingBillingToggle.js +1 -1
  108. package/dist/components/PricingFAQ.js +1 -1
  109. package/dist/components/PricingPage.js +2 -1
  110. package/dist/components/PricingPlanCard.js +4 -3
  111. package/dist/components/PricingUsageCalculator.js +2 -2
  112. package/dist/components/Progress.js +1 -1
  113. package/dist/components/PromptInput.d.ts +1 -1
  114. package/dist/components/PromptInput.js +31 -18
  115. package/dist/components/Queue.d.ts +1 -1
  116. package/dist/components/Queue.js +2 -3
  117. package/dist/components/RadioGroup.js +1 -1
  118. package/dist/components/Reasoning.js +3 -6
  119. package/dist/components/ResizableSidePanel.js +1 -1
  120. package/dist/components/ResponsiveSidebarShell.js +16 -10
  121. package/dist/components/ScrollArea.js +2 -1
  122. package/dist/components/SearchField.d.ts +43 -0
  123. package/dist/components/SearchField.js +52 -0
  124. package/dist/components/Select.d.ts +1 -1
  125. package/dist/components/Select.js +5 -6
  126. package/dist/components/Separator.js +1 -1
  127. package/dist/components/Slider.js +1 -1
  128. package/dist/components/Sources.js +2 -2
  129. package/dist/components/Stepper.js +16 -9
  130. package/dist/components/SubagentRunDetails.js +1 -1
  131. package/dist/components/SubagentRunIndicator.js +2 -2
  132. package/dist/components/SubagentRunList.d.ts +3 -5
  133. package/dist/components/SubagentRunList.js +3 -4
  134. package/dist/components/SubagentRunSelector.d.ts +8 -12
  135. package/dist/components/SubagentRunSelector.js +17 -20
  136. package/dist/components/Switch.d.ts +2 -2
  137. package/dist/components/Switch.js +4 -5
  138. package/dist/components/Tabs.d.ts +2 -2
  139. package/dist/components/Tabs.js +12 -3
  140. package/dist/components/Task.js +2 -2
  141. package/dist/components/Terminal.d.ts +2 -2
  142. package/dist/components/Terminal.js +5 -4
  143. package/dist/components/TestResults.js +10 -6
  144. package/dist/components/Textarea.js +1 -1
  145. package/dist/components/ThemeModeControl.js +1 -1
  146. package/dist/components/ThinkChat.d.ts +33 -20
  147. package/dist/components/ThinkChat.js +4 -4
  148. package/dist/components/ThinkChatActivity.d.ts +2 -2
  149. package/dist/components/ThinkChatActivity.js +8 -10
  150. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  151. package/dist/components/ThinkChatActivitySummary.js +7 -3
  152. package/dist/components/ThinkChatToolPanels.js +26 -16
  153. package/dist/components/ThinkExecutionDetail.js +2 -2
  154. package/dist/components/ThinkExecutionStatus.js +2 -2
  155. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  156. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  157. package/dist/components/ThinkFullApp.d.ts +36 -35
  158. package/dist/components/ThinkFullApp.js +156 -109
  159. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  160. package/dist/components/ThinkFullAppViewSwitch.js +1 -1
  161. package/dist/components/ThinkRecoveryNotice.js +18 -12
  162. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  163. package/dist/components/ThinkRoutineBrowser.js +33 -40
  164. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  165. package/dist/components/ThinkRoutineDetail.js +4 -4
  166. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  167. package/dist/components/ThinkRoutineForm.js +11 -10
  168. package/dist/components/ThinkRoutineLibrary.d.ts +24 -31
  169. package/dist/components/ThinkRoutineLibrary.js +57 -80
  170. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  171. package/dist/components/ThinkRoutineRuns.js +31 -24
  172. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  173. package/dist/components/ThinkThreadPicker.js +163 -39
  174. package/dist/components/Toast.js +1 -1
  175. package/dist/components/Toggle.d.ts +1 -1
  176. package/dist/components/Toggle.js +9 -7
  177. package/dist/components/ToggleGroup.d.ts +1 -1
  178. package/dist/components/ToggleGroup.js +15 -13
  179. package/dist/components/ToolInvocation.js +1 -1
  180. package/dist/components/Toolbar.js +1 -1
  181. package/dist/components/Tooltip.d.ts +8 -1
  182. package/dist/components/Tooltip.js +11 -2
  183. package/dist/components/TransitionSurface.d.ts +27 -0
  184. package/dist/components/TransitionSurface.js +20 -0
  185. package/dist/components/WebPreview.d.ts +5 -5
  186. package/dist/components/WebPreview.js +68 -54
  187. package/dist/components/Workspace.d.ts +2 -2
  188. package/dist/components/Workspace.js +358 -328
  189. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  190. package/dist/components/WorkspaceBrowser.js +15 -25
  191. package/dist/components/WorkspaceExplorer.d.ts +5 -5
  192. package/dist/components/WorkspaceExplorer.js +19 -32
  193. package/dist/components/WorkspaceFile.d.ts +1 -1
  194. package/dist/components/WorkspaceFileView.d.ts +14 -2
  195. package/dist/components/WorkspaceFileView.js +1 -1
  196. package/dist/components/WorkspaceHeader.d.ts +0 -8
  197. package/dist/components/WorkspaceHeader.js +3 -15
  198. package/dist/components/WorkspaceLink.d.ts +1 -1
  199. package/dist/components/WorkspaceLink.js +1 -1
  200. package/dist/components/icons.d.ts +2 -2
  201. package/dist/components/icons.js +2 -2
  202. package/dist/{copy-button-cYsJBauI.js → copy-button-BtRwhRks.js} +3 -2
  203. package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
  204. package/dist/{icons--FqCZEc3.js → icons-DKXiSepE.js} +7 -3
  205. package/dist/{icons-DpUqY8Mp.d.ts → icons-DkRtZmvT.d.ts} +22 -2
  206. package/dist/navigation-link-Cob7KBlM.js +19 -0
  207. package/dist/styles/accordion.css +4 -19
  208. package/dist/styles/activity.css +48 -56
  209. package/dist/styles/agent-activity-preview.css +2 -0
  210. package/dist/styles/agent-chat.css +14 -22
  211. package/dist/styles/alert-dialog.css +16 -18
  212. package/dist/styles/app-top-bar.css +17 -9
  213. package/dist/styles/approval.css +11 -6
  214. package/dist/styles/artifact.css +6 -6
  215. package/dist/styles/autocomplete.css +2 -1
  216. package/dist/styles/avatar.css +35 -30
  217. package/dist/styles/badge.css +10 -10
  218. package/dist/styles/base-ui-motion.css +94 -39
  219. package/dist/styles/browser-control-overlay.css +0 -1
  220. package/dist/styles/browser-live-view.css +39 -22
  221. package/dist/styles/browser-replay.css +1 -1
  222. package/dist/styles/browser-run-panel.css +8 -4
  223. package/dist/styles/button.css +36 -33
  224. package/dist/styles/card.css +5 -6
  225. package/dist/styles/chain-of-thought.css +22 -16
  226. package/dist/styles/checkbox.css +18 -5
  227. package/dist/styles/codex-model-selector.css +46 -8
  228. package/dist/styles/collapsible.css +10 -10
  229. package/dist/styles/combobox.css +3 -2
  230. package/dist/styles/commit.css +19 -18
  231. package/dist/styles/composition-motion.css +83 -0
  232. package/dist/styles/context-menu.css +3 -3
  233. package/dist/styles/context.css +11 -10
  234. package/dist/styles/conversation.css +18 -23
  235. package/dist/styles/dialog.css +15 -15
  236. package/dist/styles/field.css +32 -12
  237. package/dist/styles/file-tree.css +69 -9
  238. package/dist/styles/form.css +1 -1
  239. package/dist/styles/index.css +5 -0
  240. package/dist/styles/input.css +2 -2
  241. package/dist/styles/marker.css +14 -13
  242. package/dist/styles/mcp-server-picker.css +20 -17
  243. package/dist/styles/media-preview-card.css +160 -0
  244. package/dist/styles/menu.css +11 -11
  245. package/dist/styles/menubar.css +12 -11
  246. package/dist/styles/message.css +27 -21
  247. package/dist/styles/meter.css +2 -2
  248. package/dist/styles/model-selector.css +16 -14
  249. package/dist/styles/motion-reduction.css +29 -0
  250. package/dist/styles/navigation-menu.css +14 -30
  251. package/dist/styles/number-field.css +22 -4
  252. package/dist/styles/plan.css +5 -0
  253. package/dist/styles/popover.css +15 -16
  254. package/dist/styles/preview-card.css +2 -32
  255. package/dist/styles/progress.css +8 -3
  256. package/dist/styles/prompt-input.css +87 -70
  257. package/dist/styles/queue.css +48 -32
  258. package/dist/styles/radio.css +19 -12
  259. package/dist/styles/reasoning.css +2 -1
  260. package/dist/styles/recipes.css +109 -37
  261. package/dist/styles/resizable-side-panel.css +4 -10
  262. package/dist/styles/responsive-sidebar-shell.css +16 -15
  263. package/dist/styles/scroll-area.css +32 -15
  264. package/dist/styles/search-field.css +21 -0
  265. package/dist/styles/select.css +19 -12
  266. package/dist/styles/slider.css +25 -29
  267. package/dist/styles/sources.css +3 -3
  268. package/dist/styles/stepper.css +36 -26
  269. package/dist/styles/subagent-run.css +1 -1
  270. package/dist/styles/switch.css +32 -29
  271. package/dist/styles/tabs.css +79 -23
  272. package/dist/styles/task.css +13 -9
  273. package/dist/styles/test-results.css +29 -23
  274. package/dist/styles/theme-mode-control.css +8 -0
  275. package/dist/styles/think-execution-workbench.css +18 -15
  276. package/dist/styles/think-full-app.css +45 -68
  277. package/dist/styles/think-routine-library.css +43 -24
  278. package/dist/styles/think-thread-picker.css +193 -51
  279. package/dist/styles/toast.css +48 -27
  280. package/dist/styles/toggle-group.css +2 -36
  281. package/dist/styles/toggle.css +29 -5
  282. package/dist/styles/toolbar.css +25 -27
  283. package/dist/styles/tooltip.css +2 -32
  284. package/dist/styles/transition-surface.css +55 -0
  285. package/dist/styles/workspace-explorer.css +99 -44
  286. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  287. package/dist/utils/codex-model-catalog.d.ts +2 -8
  288. package/dist/utils/codex-model-catalog.js +2 -16
  289. package/dist/utils/mcp-server-catalog.d.ts +139 -0
  290. package/dist/utils/mcp-server-catalog.js +98 -0
  291. package/dist/utils/structured-code.d.ts +1 -1
  292. package/package.json +13 -7
  293. package/dist/Workspace-C9RFoxcu.d.ts +0 -62
  294. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -1,8 +1,11 @@
1
- import { t as cx } from "../class-names-Bk-QLWWI.js";
2
- import { I as PlusIcon, J as WarningIcon, V as SpinnerIcon, m as DotIcon } from "../icons--FqCZEc3.js";
3
- import { Button } from "./Button.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { K as SpinnerIcon, Q as WarningIcon, V as PlusIcon, _ as DotIcon, t as ArchiveIcon } from "../icons-DKXiSepE.js";
3
+ import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
4
+ import { Button, buttonVariants } from "./Button.js";
5
+ import { SearchField } from "./SearchField.js";
6
+ import { AlertDialog } from "./AlertDialog.js";
4
7
  import { ScrollArea } from "./ScrollArea.js";
5
- import "react";
8
+ import * as React from "react";
6
9
  import { jsx, jsxs } from "react/jsx-runtime";
7
10
  //#region src/components/ThinkThreadPicker.tsx
8
11
  function toThreadDate(value) {
@@ -49,6 +52,9 @@ function formatThreadStatus(thread) {
49
52
  function isThreadBusy(status) {
50
53
  return status === "pending" || status === "running" || status === "starting" || status === "streaming" || status === "submitted" || status === "recovering";
51
54
  }
55
+ function errorMessage(error) {
56
+ return error instanceof Error ? error.message : String(error);
57
+ }
52
58
  function summarizeThinkThreads(threads) {
53
59
  return threads.reduce((summary, thread) => {
54
60
  if (isThreadBusy(thread.status)) summary.running += 1;
@@ -98,12 +104,55 @@ function ThinkThreadStatusIndicators({ summary, className }) {
98
104
  * Thread roster UI for sub-agent chat apps.
99
105
  *
100
106
  * This component does not call Think or Cloudflare RPC methods directly. Feed
101
- * it from the parent agent's roster method, then route `onSelect` into the
102
- * child `useAgent({ sub: [...] })` name. Keep backend contract notes beside the
103
- * parent Think agent because `listThreads()`/`createThread()` are app-owned.
107
+ * it from the parent agent's roster method, then render app-owned route links
108
+ * that select the child `useAgent({ sub: [...] })` name. Keep backend contract
109
+ * notes beside the parent Think agent because
110
+ * `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
104
111
  */
105
- function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
112
+ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onDelete, className, title = "Recents", "aria-label": ariaLabel = "Threads", ref, ...props }) {
106
113
  const statusSummary = summarizeThinkThreads(threads);
114
+ const [query, setQuery] = React.useState("");
115
+ const [deleteOpen, setDeleteOpen] = React.useState(false);
116
+ const [deleteCandidate, setDeleteCandidate] = React.useState();
117
+ const [deleteBusy, setDeleteBusy] = React.useState(false);
118
+ const [deleteError, setDeleteError] = React.useState();
119
+ const deleteSucceededRef = React.useRef(false);
120
+ const deleteFallbackIdRef = React.useRef(void 0);
121
+ const threadLinkRefs = React.useRef(/* @__PURE__ */ new Map());
122
+ const deleteButtonRefs = React.useRef(/* @__PURE__ */ new Map());
123
+ const createButtonRef = React.useRef(null);
124
+ const navRef = React.useRef(null);
125
+ const normalizedQuery = query.trim().toLocaleLowerCase();
126
+ const visibleThreads = normalizedQuery ? threads.filter((thread) => thread.title.toLocaleLowerCase().includes(normalizedQuery)) : threads;
127
+ const requestDelete = (thread) => {
128
+ const index = threads.findIndex((candidate) => candidate.id === thread.id);
129
+ deleteFallbackIdRef.current = threads[index + 1]?.id ?? threads[index - 1]?.id ?? void 0;
130
+ deleteSucceededRef.current = false;
131
+ setDeleteCandidate(thread);
132
+ setDeleteError(void 0);
133
+ setDeleteOpen(true);
134
+ };
135
+ const performDelete = async () => {
136
+ if (!deleteCandidate || !onDelete) return;
137
+ setDeleteBusy(true);
138
+ setDeleteError(void 0);
139
+ try {
140
+ await onDelete(deleteCandidate);
141
+ deleteSucceededRef.current = true;
142
+ setDeleteOpen(false);
143
+ } catch (error) {
144
+ setDeleteError(errorMessage(error));
145
+ } finally {
146
+ setDeleteBusy(false);
147
+ }
148
+ };
149
+ const resolveDeleteFinalFocus = () => {
150
+ if (deleteSucceededRef.current) {
151
+ const fallbackId = deleteFallbackIdRef.current;
152
+ return (fallbackId ? threadLinkRefs.current.get(fallbackId) : void 0) ?? createButtonRef.current ?? navRef.current;
153
+ }
154
+ return (deleteCandidate ? deleteButtonRefs.current.get(deleteCandidate.id) : void 0) ?? createButtonRef.current ?? navRef.current;
155
+ };
107
156
  return /* @__PURE__ */ jsxs("aside", {
108
157
  ref,
109
158
  className: cx("think-thread-picker", className),
@@ -116,53 +165,90 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
116
165
  children: title
117
166
  }), /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: statusSummary })]
118
167
  }),
168
+ /* @__PURE__ */ jsxs(SearchField.Root, {
169
+ className: "think-thread-picker__search",
170
+ name: "thread-search",
171
+ children: [/* @__PURE__ */ jsx(SearchField.Label, {
172
+ className: "sigvelo-visually-hidden",
173
+ children: "Search threads"
174
+ }), /* @__PURE__ */ jsx(SearchField.Control, {
175
+ value: query,
176
+ placeholder: "Search recent threads",
177
+ autoComplete: "off",
178
+ onChange: (event) => setQuery(event.currentTarget.value)
179
+ })]
180
+ }),
119
181
  /* @__PURE__ */ jsx("nav", {
182
+ ref: navRef,
120
183
  className: "think-thread-picker__nav",
121
184
  "aria-label": ariaLabel,
185
+ tabIndex: -1,
122
186
  children: /* @__PURE__ */ jsxs(ScrollArea.Root, {
123
187
  className: "think-thread-picker__scroll",
124
188
  children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, {
125
189
  className: "think-thread-picker__viewport",
126
190
  "aria-label": "Thread list",
127
- children: threads.length ? /* @__PURE__ */ jsx("ul", {
191
+ children: visibleThreads.length ? /* @__PURE__ */ jsx("ul", {
128
192
  className: "think-thread-picker__list",
129
- children: threads.map((thread) => {
193
+ children: visibleThreads.map((thread) => {
130
194
  const timestamp = formatThreadTimestamp(thread);
131
195
  const statusLabel = formatThreadStatus(thread);
132
196
  const busy = isThreadBusy(thread.status);
133
- return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Button, {
134
- type: "button",
135
- variant: "ghost",
136
- color: "neutral",
137
- size: "sm",
138
- className: "think-thread-picker__thread",
139
- "data-selected": thread.id === selectedId ? "true" : "false",
140
- "data-status": thread.status,
141
- "aria-current": thread.id === selectedId ? "page" : void 0,
142
- onClick: () => onSelect(thread.id),
143
- children: [/* @__PURE__ */ jsx("span", {
144
- className: "think-thread-picker__thread-title",
145
- children: thread.title
146
- }), statusLabel ? /* @__PURE__ */ jsx("span", {
147
- className: "think-thread-picker__thread-status",
148
- role: "img",
149
- "aria-label": statusLabel,
150
- title: statusLabel,
151
- children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(DotIcon, {})
152
- }) : timestamp?.date ? /* @__PURE__ */ jsx("time", {
153
- className: "think-thread-picker__thread-time",
154
- dateTime: timestamp.date.toISOString(),
155
- title: timestamp.date.toLocaleString(),
156
- children: timestamp.label
157
- }) : timestamp ? /* @__PURE__ */ jsx("span", {
158
- className: "think-thread-picker__thread-time",
159
- children: timestamp.label
197
+ return /* @__PURE__ */ jsxs("li", {
198
+ className: "think-thread-picker__item",
199
+ children: [/* @__PURE__ */ jsxs(NavigationLink, {
200
+ render: renderThreadLink(thread),
201
+ ref: (node) => {
202
+ if (node) threadLinkRefs.current.set(thread.id, node);
203
+ else threadLinkRefs.current.delete(thread.id);
204
+ },
205
+ className: buttonVariants({
206
+ variant: "ghost",
207
+ color: "neutral",
208
+ size: "sm",
209
+ className: "think-thread-picker__thread"
210
+ }),
211
+ "data-thread-status": thread.status,
212
+ children: [/* @__PURE__ */ jsx("span", {
213
+ className: "think-thread-picker__thread-title",
214
+ children: thread.title
215
+ }), statusLabel ? /* @__PURE__ */ jsx("span", {
216
+ className: "think-thread-picker__thread-status",
217
+ role: "img",
218
+ "aria-label": statusLabel,
219
+ title: statusLabel,
220
+ children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(DotIcon, {})
221
+ }) : timestamp?.date ? /* @__PURE__ */ jsx("time", {
222
+ className: "think-thread-picker__thread-time",
223
+ dateTime: timestamp.date.toISOString(),
224
+ title: timestamp.date.toLocaleString(),
225
+ children: timestamp.label
226
+ }) : timestamp ? /* @__PURE__ */ jsx("span", {
227
+ className: "think-thread-picker__thread-time",
228
+ children: timestamp.label
229
+ }) : null]
230
+ }), onDelete ? /* @__PURE__ */ jsx(Button, {
231
+ ref: (node) => {
232
+ if (node) deleteButtonRefs.current.set(thread.id, node);
233
+ else deleteButtonRefs.current.delete(thread.id);
234
+ },
235
+ type: "button",
236
+ variant: "ghost",
237
+ color: "neutral",
238
+ size: "sm",
239
+ iconOnly: true,
240
+ className: "think-thread-picker__delete",
241
+ "aria-label": `Delete thread ${thread.title}`,
242
+ "aria-haspopup": "dialog",
243
+ disabled: deleteBusy,
244
+ onClick: () => requestDelete(thread),
245
+ children: /* @__PURE__ */ jsx(ArchiveIcon, {})
160
246
  }) : null]
161
- }) }, thread.id);
247
+ }, thread.id);
162
248
  })
163
249
  }) : /* @__PURE__ */ jsx("p", {
164
250
  className: "think-thread-picker__empty",
165
- children: "No threads yet."
251
+ children: threads.length ? "No matching threads." : "No threads yet."
166
252
  })
167
253
  }), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, {
168
254
  orientation: "vertical",
@@ -173,6 +259,7 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
173
259
  onCreate ? /* @__PURE__ */ jsx("div", {
174
260
  className: "think-thread-picker__footer",
175
261
  children: /* @__PURE__ */ jsxs(Button, {
262
+ ref: createButtonRef,
176
263
  type: "button",
177
264
  variant: "normal",
178
265
  color: "neutral",
@@ -181,6 +268,43 @@ function ThinkThreadPicker({ threads, selectedId, onSelect, onCreate, className,
181
268
  onClick: () => void onCreate(),
182
269
  children: [/* @__PURE__ */ jsx(PlusIcon, {}), /* @__PURE__ */ jsx("span", { children: "New thread" })]
183
270
  })
271
+ }) : null,
272
+ onDelete && deleteCandidate ? /* @__PURE__ */ jsx(AlertDialog.Root, {
273
+ open: deleteOpen,
274
+ onOpenChange: (open, eventDetails) => {
275
+ if (deleteBusy) {
276
+ eventDetails.cancel();
277
+ return;
278
+ }
279
+ setDeleteOpen(open);
280
+ if (!open) setDeleteError(void 0);
281
+ },
282
+ children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
283
+ finalFocus: resolveDeleteFinalFocus,
284
+ children: [
285
+ /* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
286
+ "Delete ",
287
+ deleteCandidate.title,
288
+ "?"
289
+ ] }),
290
+ /* @__PURE__ */ jsx(AlertDialog.Description, { children: "This permanently deletes the conversation, its schedules, and its execution history. Any active work stops. This action cannot be undone." }),
291
+ deleteError ? /* @__PURE__ */ jsxs("p", {
292
+ className: "think-thread-picker__delete-error",
293
+ role: "alert",
294
+ children: [/* @__PURE__ */ jsx(WarningIcon, {}), /* @__PURE__ */ jsx("span", { children: deleteError })]
295
+ }) : null,
296
+ /* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [/* @__PURE__ */ jsx(AlertDialog.Close, {
297
+ disabled: deleteBusy,
298
+ children: "Cancel"
299
+ }), /* @__PURE__ */ jsxs(Button, {
300
+ type: "button",
301
+ color: "destructive",
302
+ disabled: deleteBusy,
303
+ onClick: () => void performDelete(),
304
+ children: [deleteBusy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : null, deleteBusy ? "Deleting…" : "Delete thread"]
305
+ })] })
306
+ ]
307
+ }) })] })
184
308
  }) : null
185
309
  ]
186
310
  });
@@ -1,4 +1,4 @@
1
- import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Toast as Toast$1 } from "@base-ui/react/toast";
@@ -1,2 +1,2 @@
1
- import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-DaXpe1Lc.js";
1
+ import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-JKZ43D5S.js";
2
2
  export { Toggle, ToggleProps, ToggleVariantsOptions, toggleVariants };
@@ -1,13 +1,13 @@
1
- import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
5
5
  //#region src/components/Toggle.tsx
6
- function toggleVariants({ variant = "default", size = "default", className } = {}) {
6
+ function toggleVariants({ variant = "default", size = "md", className } = {}) {
7
7
  return [
8
8
  "toggle",
9
9
  variant === "outline" && "toggle--outline",
10
- size !== "default" && `toggle--${size}`,
10
+ size !== "md" && `toggle--${size}`,
11
11
  className
12
12
  ].filter(Boolean).join(" ");
13
13
  }
@@ -52,13 +52,15 @@ function toggleVariants({ variant = "default", size = "default", className } = {
52
52
  * @see {@link https://base-ui.com/react/components/toggle | Base UI Toggle}
53
53
  */
54
54
  function Toggle({ className, variant, size, ref, ...props }) {
55
+ const classes = mergeBaseClassName(toggleVariants({
56
+ variant,
57
+ size
58
+ }), className);
55
59
  return /* @__PURE__ */ jsx(Toggle$1, {
56
60
  ref,
57
61
  "data-slot": "toggle",
58
- className: mergeBaseClassName(toggleVariants({
59
- variant,
60
- size
61
- }), className),
62
+ "data-size": size ?? "md",
63
+ className: classes,
62
64
  ...props
63
65
  });
64
66
  }
@@ -1,2 +1,2 @@
1
- import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-yseEWkOC.js";
1
+ import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-DNd6cDJZ.js";
2
2
  export { ToggleGroup, ToggleGroupItemProps, ToggleGroupProps };
@@ -1,4 +1,4 @@
1
- import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import { toggleVariants } from "./Toggle.js";
3
3
  import * as React from "react";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -7,12 +7,9 @@ import { Toggle } from "@base-ui/react/toggle";
7
7
  //#region src/components/ToggleGroup.tsx
8
8
  const ToggleGroupContext = React.createContext({
9
9
  variant: "default",
10
- size: "default",
10
+ size: "md",
11
11
  spacing: 0
12
12
  });
13
- function normalizeSize(size) {
14
- return size === "md" ? "default" : size;
15
- }
16
13
  /**
17
14
  * A toggle group component for selecting one or multiple options.
18
15
  *
@@ -39,7 +36,6 @@ function normalizeSize(size) {
39
36
  * @see {@link https://base-ui.com/react/components/toggle-group | Base UI Toggle Group}
40
37
  */
41
38
  function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", className, children, style, ref, ...props }) {
42
- const normalizedSize = normalizeSize(size);
43
39
  const gap = `${spacing * .25}rem`;
44
40
  const groupStyle = typeof style === "function" ? (state) => ({
45
41
  ...style(state),
@@ -48,21 +44,27 @@ function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", classN
48
44
  ...style,
49
45
  gap
50
46
  };
47
+ const classes = mergeBaseClassName(["toggle-group", size !== "md" && `toggle-group--${size}`].filter(Boolean).join(" "), className);
48
+ const contextValue = React.useMemo(() => ({
49
+ variant,
50
+ size,
51
+ spacing
52
+ }), [
53
+ size,
54
+ spacing,
55
+ variant
56
+ ]);
51
57
  return /* @__PURE__ */ jsx(ToggleGroup$1, {
52
58
  ref,
53
- "data-size": normalizedSize,
59
+ "data-size": size,
54
60
  "data-slot": "toggle-group",
55
61
  "data-spacing": spacing,
56
62
  "data-variant": variant,
57
- className: mergeBaseClassName(["toggle-group", size !== "md" && `toggle-group--${size}`].filter(Boolean).join(" "), className),
63
+ className: classes,
58
64
  style: groupStyle,
59
65
  ...props,
60
66
  children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
61
- value: {
62
- variant,
63
- size: normalizedSize,
64
- spacing
65
- },
67
+ value: contextValue,
66
68
  children
67
69
  })
68
70
  });
@@ -1,6 +1,6 @@
1
1
  import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
2
2
  import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ThinkChatToolParts.js";
3
- import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
3
+ import { t as summarizeToolInput } from "../summarize-tool-input-CqTcGRYy.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { getToolName } from "ai";
6
6
  import { getToolInput, getToolOutput, getToolPartState } from "@cloudflare/think/react";
@@ -1,4 +1,4 @@
1
- import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
@@ -40,6 +40,13 @@ declare function TooltipProvider({
40
40
  ...props
41
41
  }: TooltipProviderProps): React.JSX.Element;
42
42
  declare function TooltipTrigger(props: TooltipTriggerProps): React.JSX.Element;
43
+ declare function TooltipPositioner({
44
+ className,
45
+ ref,
46
+ ...props
47
+ }: TooltipPositionerProps & {
48
+ ref?: React.Ref<HTMLDivElement>;
49
+ }): React.JSX.Element;
43
50
  declare function TooltipPopup({
44
51
  className,
45
52
  ref,
@@ -77,7 +84,7 @@ declare const Tooltip: {
77
84
  Provider: typeof TooltipProvider;
78
85
  Trigger: typeof TooltipTrigger;
79
86
  Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
80
- Positioner: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TooltipPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
87
+ Positioner: typeof TooltipPositioner;
81
88
  Popup: typeof TooltipPopup;
82
89
  Viewport: typeof TooltipViewport;
83
90
  Arrow: typeof TooltipArrow;
@@ -1,4 +1,4 @@
1
- import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
@@ -37,6 +37,15 @@ function TooltipTrigger(props) {
37
37
  ...props
38
38
  });
39
39
  }
40
+ function TooltipPositioner({ className, ref, ...props }) {
41
+ const classes = mergeBaseClassName(["tooltip__positioner", "base-ui-positioner"].filter(Boolean).join(" "), className);
42
+ return /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
43
+ ref,
44
+ "data-slot": "tooltip-positioner",
45
+ className: classes,
46
+ ...props
47
+ });
48
+ }
40
49
  function TooltipPopup({ className, ref, role = "tooltip", ...props }) {
41
50
  const classes = mergeBaseClassName(["tooltip__popup", "base-ui-popup"].filter(Boolean).join(" "), className);
42
51
  return /* @__PURE__ */ jsx(Tooltip$1.Popup, {
@@ -80,7 +89,7 @@ const Tooltip = {
80
89
  Provider: TooltipProvider,
81
90
  Trigger: TooltipTrigger,
82
91
  Portal: Tooltip$1.Portal,
83
- Positioner: Tooltip$1.Positioner,
92
+ Positioner: TooltipPositioner,
84
93
  Popup: TooltipPopup,
85
94
  Viewport: TooltipViewport,
86
95
  Arrow: TooltipArrow
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+
3
+ //#region src/components/TransitionSurface.d.ts
4
+ type TransitionSurfaceVariant = "fade" | "scale" | "slide-block" | "slide-inline";
5
+ interface TransitionSurfaceProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ /**
7
+ * The restrained entrance and hidden-state treatment applied to the surface.
8
+ * Pair separate surfaces around Suspense fallback and resolved content.
9
+ * @default "fade"
10
+ */
11
+ variant?: TransitionSurfaceVariant;
12
+ }
13
+ /**
14
+ * A lightweight presence surface for content inserted by React or revealed
15
+ * from `hidden`. CSS owns its motion through `@starting-style` and discrete
16
+ * transitions; this component does not own data loading or Suspense state.
17
+ */
18
+ declare function TransitionSurface({
19
+ className,
20
+ variant,
21
+ ref,
22
+ ...props
23
+ }: TransitionSurfaceProps & {
24
+ ref?: React.Ref<HTMLDivElement>;
25
+ }): React.JSX.Element;
26
+ //#endregion
27
+ export { TransitionSurface, TransitionSurfaceProps, TransitionSurfaceVariant };
@@ -0,0 +1,20 @@
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/components/TransitionSurface.tsx
5
+ /**
6
+ * A lightweight presence surface for content inserted by React or revealed
7
+ * from `hidden`. CSS owns its motion through `@starting-style` and discrete
8
+ * transitions; this component does not own data loading or Suspense state.
9
+ */
10
+ function TransitionSurface({ className, variant = "fade", ref, ...props }) {
11
+ return /* @__PURE__ */ jsx("div", {
12
+ ref,
13
+ "data-slot": "transition-surface",
14
+ "data-variant": variant,
15
+ className: cx("transition-surface", className),
16
+ ...props
17
+ });
18
+ }
19
+ //#endregion
20
+ export { TransitionSurface };
@@ -1,4 +1,4 @@
1
- import { r as ButtonProps } from "../Button-FX_hpqxm.js";
1
+ import { r as ButtonProps } from "../Button-DLGzHsjc.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/WebPreview.d.ts
@@ -17,9 +17,9 @@ interface WebPreviewContextValue {
17
17
  interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
18
18
  /** Initial URL for uncontrolled preview history. */
19
19
  defaultUrl?: string;
20
- /** Controlled URL pushed into preview history when it changes. */
20
+ /** Controlled URL. Controlled previews leave history ownership to the caller. */
21
21
  url?: string;
22
- /** Called when the displayed URL changes. */
22
+ /** Called when navigation requests a URL change. Controlled callers update `url`. */
23
23
  onUrlChange?: (url: string) => void;
24
24
  /** Additional class names for layout only; do not override iframe sandboxing from apps. */
25
25
  className?: string;
@@ -28,8 +28,8 @@ interface WebPreviewProps extends React.HTMLAttributes<HTMLDivElement> {
28
28
  }
29
29
  /**
30
30
  * An iframe preview with a navigation bar, URL input, and optional console
31
- * panel. Tracks browsing history internally so back/forward buttons work
32
- * without depending on the iframe's own history.
31
+ * panel. Uncontrolled previews track browsing history internally; controlled
32
+ * previews leave history and back/forward behavior to their caller.
33
33
  *
34
34
  * Built internally for agent/browser preview surfaces. Use it to display a
35
35
  * known URL with local navigation controls. Do not use it for trusted app