@mcp-b/react-components 0.16.0 → 0.17.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 (298) hide show
  1. package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-CRuMi1Pb.d.ts} +4 -10
  2. package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
  3. package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
  4. package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Co1noLbC.js} +2 -2
  5. package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-Dnpr88ZQ.d.ts} +2 -2
  6. package/dist/Collapsible-N64ASIQr.d.ts +119 -0
  7. package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
  8. package/dist/{FileTree-CkVbIMWV.js → FileTree-B7bBsUyU.js} +7 -7
  9. package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
  10. package/dist/{Message-BkMdE3bS.js → Message-C4eYRogZ.js} +3 -3
  11. package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-BNrZlY_Y.js} +5 -5
  12. package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-OLfXPuHM.d.ts} +39 -67
  13. package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
  14. package/dist/{Select-BeEsefzh.d.ts → Select-CwSqP07Y.d.ts} +14 -42
  15. package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-9zddXDQo.d.ts} +5 -19
  16. package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-DInElus-.js} +53 -26
  17. package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-BgesTfZ4.d.ts} +12 -4
  18. package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
  19. package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
  20. package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-DaXpe1Lc.d.ts} +1 -1
  21. package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-yseEWkOC.d.ts} +3 -4
  22. package/dist/{Workspace-D39LxGvP.d.ts → Workspace-C9RFoxcu.d.ts} +1 -1
  23. package/dist/WorkspaceExplorer-sZewzT2O.d.ts +32 -0
  24. package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-C8UzuSH4.d.ts} +1 -1
  25. package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-DNdGAEiX.js} +5 -5
  26. package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-B1ykV1dS.js} +15 -29
  27. package/dist/class-names-Bk-QLWWI.js +11 -0
  28. package/dist/components/Accordion.d.ts +5 -15
  29. package/dist/components/Accordion.js +11 -10
  30. package/dist/components/Activity.d.ts +5 -10
  31. package/dist/components/Activity.js +2 -2
  32. package/dist/components/AgentActivity.js +1 -1
  33. package/dist/components/AgentActivityPreview.js +2 -2
  34. package/dist/components/AgentAttention.d.ts +1 -1
  35. package/dist/components/AgentAttention.js +1 -1
  36. package/dist/components/AgentChat.d.ts +2 -2
  37. package/dist/components/AgentChat.js +27 -164
  38. package/dist/components/AgentChatMessageEditor.js +1 -1
  39. package/dist/components/AgentConnection.js +4 -4
  40. package/dist/components/AgentMessageParts.d.ts +2 -0
  41. package/dist/components/AgentMessageParts.js +119 -0
  42. package/dist/components/AgentToolDetail.d.ts +55 -0
  43. package/dist/components/AgentToolDetail.js +98 -0
  44. package/dist/components/AgentToolRunsContext.d.ts +2 -0
  45. package/dist/components/AgentToolRunsContext.js +16 -0
  46. package/dist/components/AlertDialog.d.ts +7 -19
  47. package/dist/components/AlertDialog.js +21 -32
  48. package/dist/components/AppTopBar.d.ts +4 -1
  49. package/dist/components/AppTopBar.js +5 -5
  50. package/dist/components/Approval.d.ts +102 -0
  51. package/dist/components/Approval.js +227 -0
  52. package/dist/components/Artifact.d.ts +2 -4
  53. package/dist/components/Artifact.js +3 -3
  54. package/dist/components/Autocomplete.d.ts +11 -33
  55. package/dist/components/Autocomplete.js +23 -30
  56. package/dist/components/Avatar.d.ts +3 -11
  57. package/dist/components/Avatar.js +13 -12
  58. package/dist/components/BrowserLiveView.js +2 -2
  59. package/dist/components/BrowserReplay.js +2 -2
  60. package/dist/components/BrowserRunPanel.js +58 -78
  61. package/dist/components/Button.js +4 -9
  62. package/dist/components/ChainOfThought.d.ts +5 -11
  63. package/dist/components/ChainOfThought.js +3 -2
  64. package/dist/components/ChatGptSignInScreen.js +3 -3
  65. package/dist/components/Checkbox.d.ts +2 -4
  66. package/dist/components/Checkbox.js +6 -5
  67. package/dist/components/CheckboxGroup.d.ts +1 -3
  68. package/dist/components/CheckboxGroup.js +15 -14
  69. package/dist/components/Checkpoint.d.ts +64 -0
  70. package/dist/components/Checkpoint.js +63 -0
  71. package/dist/components/CodeBlock.d.ts +1 -1
  72. package/dist/components/CodeBlock.js +1 -1
  73. package/dist/components/CodexModelSelector.d.ts +1 -1
  74. package/dist/components/CodexModelSelector.js +2 -2
  75. package/dist/components/Collapsible.d.ts +1 -124
  76. package/dist/components/Collapsible.js +7 -10
  77. package/dist/components/Combobox.d.ts +1 -1
  78. package/dist/components/Combobox.js +23 -30
  79. package/dist/components/Commit.d.ts +5 -11
  80. package/dist/components/Commit.js +6 -5
  81. package/dist/components/Context.js +1 -1
  82. package/dist/components/ContextMenu.d.ts +21 -37
  83. package/dist/components/ContextMenu.js +34 -51
  84. package/dist/components/Conversation.d.ts +2 -4
  85. package/dist/components/Conversation.js +2 -2
  86. package/dist/components/DescriptionListParts.js +1 -1
  87. package/dist/components/Dialog.d.ts +6 -17
  88. package/dist/components/Dialog.js +17 -24
  89. package/dist/components/EnvironmentVariables.d.ts +1 -1
  90. package/dist/components/EnvironmentVariables.js +4 -3
  91. package/dist/components/Field.d.ts +17 -20
  92. package/dist/components/Field.js +16 -16
  93. package/dist/components/Fieldset.d.ts +2 -7
  94. package/dist/components/Fieldset.js +7 -6
  95. package/dist/components/FileTree.js +1 -1
  96. package/dist/components/Form.d.ts +1 -4
  97. package/dist/components/Form.js +3 -2
  98. package/dist/components/GithubMotionMark.js +1 -1
  99. package/dist/components/InlineCitation.d.ts +66 -0
  100. package/dist/components/InlineCitation.js +142 -0
  101. package/dist/components/Input.d.ts +1 -4
  102. package/dist/components/Input.js +3 -2
  103. package/dist/components/Marker.js +1 -1
  104. package/dist/components/McpConnectionRequest.js +2 -2
  105. package/dist/components/McpServerPicker.d.ts +1 -1
  106. package/dist/components/McpServerPicker.js +6 -5
  107. package/dist/components/Menu.d.ts +1 -1
  108. package/dist/components/Menu.js +33 -52
  109. package/dist/components/Menubar.d.ts +22 -43
  110. package/dist/components/Menubar.js +36 -53
  111. package/dist/components/Message.d.ts +3 -6
  112. package/dist/components/Message.js +1 -1
  113. package/dist/components/MessageScroller.d.ts +1 -1
  114. package/dist/components/MessageScroller.js +3 -3
  115. package/dist/components/Meter.d.ts +5 -20
  116. package/dist/components/Meter.js +11 -10
  117. package/dist/components/ModelSelector.d.ts +2 -6
  118. package/dist/components/ModelSelector.js +1 -1
  119. package/dist/components/NavigationMenu.d.ts +11 -33
  120. package/dist/components/NavigationMenu.js +23 -30
  121. package/dist/components/NumberField.d.ts +6 -24
  122. package/dist/components/NumberField.js +13 -12
  123. package/dist/components/Plan.d.ts +103 -0
  124. package/dist/components/Plan.js +113 -0
  125. package/dist/components/Popover.d.ts +9 -36
  126. package/dist/components/Popover.js +23 -34
  127. package/dist/components/PreviewCard.d.ts +6 -24
  128. package/dist/components/PreviewCard.js +13 -24
  129. package/dist/components/PricingBillingToggle.js +1 -1
  130. package/dist/components/PricingFAQ.js +1 -1
  131. package/dist/components/PricingPlanCard.js +3 -3
  132. package/dist/components/PricingUsageCalculator.js +2 -2
  133. package/dist/components/Progress.d.ts +3 -8
  134. package/dist/components/Progress.js +7 -10
  135. package/dist/components/PromptInput.d.ts +2 -2
  136. package/dist/components/PromptInput.js +52 -200
  137. package/dist/components/Queue.d.ts +6 -16
  138. package/dist/components/Queue.js +2 -2
  139. package/dist/components/RadioGroup.d.ts +3 -8
  140. package/dist/components/RadioGroup.js +7 -10
  141. package/dist/components/Reasoning.d.ts +4 -8
  142. package/dist/components/Reasoning.js +3 -3
  143. package/dist/components/ResizableSidePanel.js +2 -2
  144. package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
  145. package/dist/components/ResponsiveSidebarShell.js +4 -3
  146. package/dist/components/ScrollArea.d.ts +5 -20
  147. package/dist/components/ScrollArea.js +11 -10
  148. package/dist/components/Select.d.ts +1 -1
  149. package/dist/components/Select.js +32 -55
  150. package/dist/components/Separator.d.ts +1 -5
  151. package/dist/components/Separator.js +3 -6
  152. package/dist/components/Slider.d.ts +6 -19
  153. package/dist/components/Slider.js +15 -14
  154. package/dist/components/Sources.d.ts +4 -9
  155. package/dist/components/Sources.js +3 -2
  156. package/dist/components/Stepper.js +2 -2
  157. package/dist/components/SubagentRunDetails.js +1 -1
  158. package/dist/components/SubagentRunIndicator.js +2 -2
  159. package/dist/components/SubagentRunList.js +1 -2
  160. package/dist/components/SubagentRunSelector.d.ts +2 -11
  161. package/dist/components/SubagentRunSelector.js +16 -15
  162. package/dist/components/Switch.d.ts +2 -5
  163. package/dist/components/Switch.js +5 -8
  164. package/dist/components/Tabs.d.ts +2 -2
  165. package/dist/components/Tabs.js +10 -16
  166. package/dist/components/Task.d.ts +4 -9
  167. package/dist/components/Task.js +4 -3
  168. package/dist/components/Terminal.d.ts +2 -3
  169. package/dist/components/Terminal.js +3 -3
  170. package/dist/components/TestResults.d.ts +4 -9
  171. package/dist/components/TestResults.js +3 -2
  172. package/dist/components/Textarea.js +1 -1
  173. package/dist/components/ThemeModeControl.js +1 -1
  174. package/dist/components/ThinkChat.d.ts +21 -11
  175. package/dist/components/ThinkChat.js +5 -3
  176. package/dist/components/ThinkChatActivity.d.ts +1 -1
  177. package/dist/components/ThinkChatActivity.js +26 -7
  178. package/dist/components/ThinkChatContext.d.ts +1 -1
  179. package/dist/components/ThinkChatToolPanels.js +2 -2
  180. package/dist/components/ThinkExecutionDetail.js +2 -2
  181. package/dist/components/ThinkExecutionStatus.js +2 -2
  182. package/dist/components/ThinkExecutionWorkbench.js +2 -2
  183. package/dist/components/ThinkFullApp.d.ts +33 -9
  184. package/dist/components/ThinkFullApp.js +118 -64
  185. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  186. package/dist/components/ThinkFullAppViewSwitch.js +2 -2
  187. package/dist/components/ThinkPendingApproval.d.ts +60 -0
  188. package/dist/components/ThinkPendingApproval.js +99 -0
  189. package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
  190. package/dist/components/ThinkRecoveryNotice.js +40 -0
  191. package/dist/components/ThinkRoutine.js +1 -0
  192. package/dist/components/ThinkRoutineBrowser.js +6 -6
  193. package/dist/components/ThinkRoutineDetail.js +1 -1
  194. package/dist/components/ThinkRoutineForm.js +2 -2
  195. package/dist/components/ThinkRoutineLibrary.d.ts +9 -0
  196. package/dist/components/ThinkRoutineLibrary.js +67 -20
  197. package/dist/components/ThinkRoutineRuns.js +1 -1
  198. package/dist/components/ThinkThreadPicker.js +2 -2
  199. package/dist/components/ThinkThreadShell.d.ts +1 -1
  200. package/dist/components/Toast.d.ts +7 -28
  201. package/dist/components/Toast.js +15 -14
  202. package/dist/components/Toggle.d.ts +1 -1
  203. package/dist/components/Toggle.js +5 -5
  204. package/dist/components/ToggleGroup.d.ts +1 -1
  205. package/dist/components/ToggleGroup.js +8 -15
  206. package/dist/components/ToolApproval.d.ts +28 -0
  207. package/dist/components/ToolApproval.js +35 -0
  208. package/dist/components/ToolInvocation.d.ts +26 -0
  209. package/dist/components/ToolInvocation.js +72 -0
  210. package/dist/components/Toolbar.d.ts +6 -24
  211. package/dist/components/Toolbar.js +13 -12
  212. package/dist/components/Tooltip.d.ts +3 -9
  213. package/dist/components/Tooltip.js +7 -10
  214. package/dist/components/WebPreview.d.ts +1 -2
  215. package/dist/components/WebPreview.js +4 -3
  216. package/dist/components/Workspace.d.ts +1 -1
  217. package/dist/components/Workspace.js +5 -20
  218. package/dist/components/WorkspaceBrowser.d.ts +1 -1
  219. package/dist/components/WorkspaceBrowser.js +3 -3
  220. package/dist/components/WorkspaceExplorer.d.ts +3 -31
  221. package/dist/components/WorkspaceExplorer.js +3 -3
  222. package/dist/components/WorkspaceFile.d.ts +1 -1
  223. package/dist/components/WorkspaceFileView.d.ts +1 -1
  224. package/dist/components/WorkspaceFileView.js +1 -1
  225. package/dist/components/WorkspaceHeader.js +1 -1
  226. package/dist/components/WorkspaceLink.js +1 -1
  227. package/dist/components/icons.d.ts +2 -2
  228. package/dist/components/icons.js +2 -2
  229. package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-CQx3LQAC.d.ts} +1 -2
  230. package/dist/{copy-button-Dejn5heL.js → copy-button-cYsJBauI.js} +1 -1
  231. package/dist/{icons-CpfUer49.js → icons--FqCZEc3.js} +3 -2
  232. package/dist/{icons-GQd1xF4e.d.ts → icons-DpUqY8Mp.d.ts} +6 -1
  233. package/dist/styles/agent-activity-preview.css +13 -11
  234. package/dist/styles/agent-attention.css +19 -13
  235. package/dist/styles/agent-chat.css +0 -41
  236. package/dist/styles/agent-connection.css +9 -21
  237. package/dist/styles/agent-tool-detail.css +54 -0
  238. package/dist/styles/alert-dialog.css +11 -11
  239. package/dist/styles/app-top-bar.css +9 -7
  240. package/dist/styles/approval.css +172 -0
  241. package/dist/styles/artifact.css +0 -12
  242. package/dist/styles/browser-run-panel.css +5 -2
  243. package/dist/styles/card.css +8 -8
  244. package/dist/styles/chain-of-thought.css +5 -13
  245. package/dist/styles/checkpoint.css +58 -0
  246. package/dist/styles/codex-model-selector.css +3 -3
  247. package/dist/styles/combobox.css +3 -2
  248. package/dist/styles/commit.css +0 -21
  249. package/dist/styles/context-menu.css +1 -9
  250. package/dist/styles/dialog.css +11 -11
  251. package/dist/styles/environment-variables.css +0 -13
  252. package/dist/styles/field.css +14 -14
  253. package/dist/styles/fieldset.css +5 -5
  254. package/dist/styles/file-tree.css +0 -16
  255. package/dist/styles/index.css +8 -4
  256. package/dist/styles/inline-citation.css +107 -0
  257. package/dist/styles/mcp-connection-request.css +3 -3
  258. package/dist/styles/mcp-server-picker.css +1 -30
  259. package/dist/styles/menu.css +1 -30
  260. package/dist/styles/menubar.css +0 -8
  261. package/dist/styles/message-scroller.css +0 -12
  262. package/dist/styles/message.css +0 -12
  263. package/dist/styles/model-selector.css +18 -32
  264. package/dist/styles/plan.css +127 -0
  265. package/dist/styles/popover.css +7 -43
  266. package/dist/styles/preview-card.css +1 -1
  267. package/dist/styles/prompt-input.css +2 -195
  268. package/dist/styles/recipes.css +139 -12
  269. package/dist/styles/responsive-sidebar-shell.css +16 -19
  270. package/dist/styles/select.css +3 -3
  271. package/dist/styles/sources.css +6 -14
  272. package/dist/styles/subagent-run.css +12 -70
  273. package/dist/styles/task.css +17 -26
  274. package/dist/styles/test-results.css +17 -23
  275. package/dist/styles/textarea.css +1 -1
  276. package/dist/styles/think-execution-workbench.css +9 -9
  277. package/dist/styles/think-full-app.css +49 -33
  278. package/dist/styles/think-routine-library.css +30 -38
  279. package/dist/styles/think-thread-picker.css +15 -0
  280. package/dist/styles/toast.css +4 -11
  281. package/dist/styles/tooltip.css +1 -1
  282. package/dist/styles/utilities.css +31 -0
  283. package/dist/styles/web-preview.css +0 -21
  284. package/dist/styles/workspace-explorer.css +20 -65
  285. package/dist/think-agent-Cip5KAPj.d.ts +7 -0
  286. package/dist/utils/codex-model-catalog.d.ts +4 -4
  287. package/dist/utils/structured-code.d.ts +1 -1
  288. package/dist/workspace-path-L_KmjRjq.js +26 -0
  289. package/package.json +3 -4
  290. package/dist/class-names-9UtZwb0J.js +0 -12
  291. package/dist/components/AppFrame.d.ts +0 -24
  292. package/dist/components/AppFrame.js +0 -25
  293. package/dist/components/Shell.d.ts +0 -163
  294. package/dist/components/Shell.js +0 -137
  295. package/dist/components/SubagentRun.d.ts +0 -86
  296. package/dist/components/SubagentRun.js +0 -108
  297. package/dist/styles/app-frame.css +0 -15
  298. package/dist/styles/shell.css +0 -122
@@ -1,8 +1,8 @@
1
1
  import { r as ButtonProps } from "./Button-FX_hpqxm.js";
2
- import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, g as SelectScrollUpArrowProps, h as SelectScrollDownArrowProps, i as SelectGroupProps, l as SelectLabelProps, m as SelectProps, n as SelectBackdropProps, o as SelectItemIndicatorProps, p as SelectPositionerProps, r as SelectGroupLabelProps, s as SelectItemProps, t as Select, u as SelectListProps, v as SelectTriggerProps, y as SelectValueProps } from "./Select-BeEsefzh.js";
3
- import { i as TabsListProps, n as TabProps, r as Tabs, t as TabPanelProps } from "./Tabs-3Zc4tb9D.js";
4
- import { t as Combobox } from "./Combobox-B9Fcd6q-.js";
5
- import { d as MenuProps, s as MenuItemProps, t as Menu } from "./Menu-Bgu-ufb5.js";
2
+ import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, g as SelectScrollUpArrowProps, h as SelectScrollDownArrowProps, i as SelectGroupProps, l as SelectLabelProps, m as SelectProps, n as SelectBackdropProps, o as SelectItemIndicatorProps, p as SelectPositionerProps, r as SelectGroupLabelProps, s as SelectItemProps, t as Select, u as SelectListProps, v as SelectTriggerProps, y as SelectValueProps } from "./Select-CwSqP07Y.js";
3
+ import { i as TabsListProps, n as TabProps, r as Tabs, t as TabPanelProps } from "./Tabs-9zddXDQo.js";
4
+ import { t as Combobox } from "./Combobox-CYc37s5l.js";
5
+ import { d as MenuProps, s as MenuItemProps, t as Menu } from "./Menu-L6MZm-7N.js";
6
6
  import * as React from "react";
7
7
  import { ChatAddToolApproveResponseFunction, ChatStatus, DynamicToolUIPart, FileUIPart, ToolUIPart, UIMessage } from "ai";
8
8
  import { PendingApproval, Think } from "@cloudflare/think";
@@ -216,8 +216,7 @@ type PromptInputButtonTooltip = string | {
216
216
  side?: TooltipSide;
217
217
  };
218
218
  type PromptInputTooltipConfig = Exclude<PromptInputButtonTooltip, string>;
219
- interface PromptInputButtonProps extends Omit<ButtonProps, "children" | "className"> {
220
- className?: string;
219
+ interface PromptInputButtonProps extends Omit<ButtonProps, "children"> {
221
220
  tooltip?: PromptInputButtonTooltip;
222
221
  children?: React.ReactNode;
223
222
  }
@@ -331,8 +330,7 @@ declare function PromptInputPermissionSelector({
331
330
  onValueChange,
332
331
  question
333
332
  }: PromptInputPermissionSelectorProps): React.JSX.Element;
334
- interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "className" | "type"> {
335
- className?: string;
333
+ interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "type"> {
336
334
  status?: ChatStatus;
337
335
  onStop?: () => void;
338
336
  children?: React.ReactNode;
@@ -359,22 +357,30 @@ declare function PromptInputSubmit({
359
357
  }: PromptInputSubmitProps & {
360
358
  ref?: React.Ref<HTMLButtonElement>;
361
359
  }): React.JSX.Element;
360
+ /**
361
+ * Resolve Think execution approvals that do not use the AI SDK
362
+ * `approval-requested` part: paused codemode executions and durable-pause
363
+ * approvals from `pendingApprovals()`. Pass the whole upstream Think agent
364
+ * stub; the component calls its client-callable RPCs directly:
365
+ *
366
+ * ```tsx
367
+ * <PromptInputApproval part={part} thinkStub={agent.stub} />
368
+ * ```
369
+ *
370
+ * On approve, upstream resumes or runs the parked execution and auto-continues
371
+ * the chat. Both RPCs are idempotent, so a stale click resolves to "already
372
+ * handled".
373
+ */
362
374
  /** The id a response must carry: the approval id, or the paused run's executionId. */
363
375
  declare function getApprovalRequestId(part: ToolUIPart | DynamicToolUIPart): string | undefined;
364
376
  /** Component-local identity: paused executions can ask for multiple approvals. */
365
377
  declare function getApprovalStateKey(part: ToolUIPart | DynamicToolUIPart): string | undefined;
366
- interface PendingToolApproval<MessageT extends UIMessage = UIMessage> {
367
- message: MessageT;
368
- messageIndex: number;
369
- part: ToolUIPart | DynamicToolUIPart;
370
- partIndex: number;
371
- }
372
378
  /** Derives pending tool approvals straight from the messages — no app-owned shapes. */
373
- declare function getPendingToolApprovals<MessageT extends UIMessage>(messages: readonly MessageT[], {
379
+ declare function getPendingToolApprovals(messages: readonly UIMessage[], {
374
380
  pausedExecutions
375
381
  }?: {
376
382
  pausedExecutions?: boolean;
377
- }): Array<PendingToolApproval<MessageT>>;
383
+ }): Array<ToolUIPart | DynamicToolUIPart>;
378
384
  interface PromptInputApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
379
385
  /**
380
386
  * The `approval-requested` tool part — or a paused codemode execution —
@@ -464,8 +470,6 @@ declare const PromptInputSelect: {
464
470
  ref,
465
471
  ...props
466
472
  }: SelectPositionerProps & {
467
- className?: string;
468
- } & {
469
473
  ref?: React.Ref<HTMLDivElement>;
470
474
  }) => React.JSX.Element;
471
475
  Popup: ({
@@ -620,27 +624,21 @@ declare const PromptInputCommand: {
620
624
  className,
621
625
  ref,
622
626
  ...props
623
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput>, "className"> & {
624
- className?: string;
625
- } & {
627
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput> & {
626
628
  ref?: React.Ref<HTMLInputElement>;
627
629
  }) => React.JSX.Element;
628
630
  Trigger: ({
629
631
  className,
630
632
  ref,
631
633
  ...props
632
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxTrigger>, "className"> & {
633
- className?: string;
634
- } & {
634
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxTrigger> & {
635
635
  ref?: React.Ref<HTMLButtonElement>;
636
636
  }) => React.JSX.Element;
637
637
  Clear: ({
638
638
  className,
639
639
  ref,
640
640
  ...props
641
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear>, "className"> & {
642
- className?: string;
643
- } & {
641
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear> & {
644
642
  ref?: React.Ref<HTMLButtonElement>;
645
643
  }) => React.JSX.Element;
646
644
  Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -648,9 +646,7 @@ declare const PromptInputCommand: {
648
646
  className,
649
647
  ref,
650
648
  ...props
651
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPositioner>, "className"> & {
652
- className?: string;
653
- } & {
649
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPositioner> & {
654
650
  ref?: React.Ref<HTMLDivElement>;
655
651
  }) => React.JSX.Element;
656
652
  Popup: ({
@@ -658,63 +654,49 @@ declare const PromptInputCommand: {
658
654
  tabIndex,
659
655
  ref,
660
656
  ...props
661
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPopup>, "className"> & {
662
- className?: string;
663
- } & {
657
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPopup> & {
664
658
  ref?: React.Ref<HTMLDivElement>;
665
659
  }) => React.JSX.Element;
666
660
  List: ({
667
661
  className,
668
662
  ref,
669
663
  ...props
670
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxList>, "className"> & {
671
- className?: string;
672
- } & {
664
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxList> & {
673
665
  ref?: React.Ref<HTMLDivElement>;
674
666
  }) => React.JSX.Element;
675
667
  Item: ({
676
668
  className,
677
669
  ref,
678
670
  ...props
679
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem>, "className"> & {
680
- className?: string;
681
- } & {
671
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem> & {
682
672
  ref?: React.Ref<HTMLDivElement>;
683
673
  }) => React.JSX.Element;
684
674
  ItemIndicator: ({
685
675
  className,
686
676
  ref,
687
677
  ...props
688
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator>, "className"> & {
689
- className?: string;
690
- } & {
678
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator> & {
691
679
  ref?: React.Ref<HTMLSpanElement>;
692
680
  }) => React.JSX.Element;
693
681
  Empty: ({
694
682
  className,
695
683
  ref,
696
684
  ...props
697
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty>, "className"> & {
698
- className?: string;
699
- } & {
685
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty> & {
700
686
  ref?: React.Ref<HTMLDivElement>;
701
687
  }) => React.JSX.Element;
702
688
  Group: ({
703
689
  className,
704
690
  ref,
705
691
  ...props
706
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup>, "className"> & {
707
- className?: string;
708
- } & {
692
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup> & {
709
693
  ref?: React.Ref<HTMLDivElement>;
710
694
  }) => React.JSX.Element;
711
695
  GroupLabel: ({
712
696
  className,
713
697
  ref,
714
698
  ...props
715
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel>, "className"> & {
716
- className?: string;
717
- } & {
699
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel> & {
718
700
  ref?: React.Ref<HTMLDivElement>;
719
701
  }) => React.JSX.Element;
720
702
  Value: typeof import("@base-ui/react").ComboboxValue;
@@ -728,9 +710,7 @@ declare const PromptInputCommandInput: ({
728
710
  className,
729
711
  ref,
730
712
  ...props
731
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput>, "className"> & {
732
- className?: string;
733
- } & {
713
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput> & {
734
714
  ref?: React.Ref<HTMLInputElement>;
735
715
  }) => React.JSX.Element;
736
716
  type PromptInputCommandListProps = React.ComponentPropsWithoutRef<typeof Combobox.List>;
@@ -746,9 +726,7 @@ declare const PromptInputCommandEmpty: ({
746
726
  className,
747
727
  ref,
748
728
  ...props
749
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty>, "className"> & {
750
- className?: string;
751
- } & {
729
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty> & {
752
730
  ref?: React.Ref<HTMLDivElement>;
753
731
  }) => React.JSX.Element;
754
732
  type PromptInputCommandGroupProps = React.ComponentPropsWithoutRef<typeof Combobox.Group>;
@@ -756,9 +734,7 @@ declare const PromptInputCommandGroup: ({
756
734
  className,
757
735
  ref,
758
736
  ...props
759
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup>, "className"> & {
760
- className?: string;
761
- } & {
737
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup> & {
762
738
  ref?: React.Ref<HTMLDivElement>;
763
739
  }) => React.JSX.Element;
764
740
  type PromptInputCommandGroupLabelProps = React.ComponentPropsWithoutRef<typeof Combobox.GroupLabel>;
@@ -766,9 +742,7 @@ declare const PromptInputCommandGroupLabel: ({
766
742
  className,
767
743
  ref,
768
744
  ...props
769
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel>, "className"> & {
770
- className?: string;
771
- } & {
745
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel> & {
772
746
  ref?: React.Ref<HTMLDivElement>;
773
747
  }) => React.JSX.Element;
774
748
  type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof Combobox.Item>;
@@ -776,9 +750,7 @@ declare const PromptInputCommandItem: ({
776
750
  className,
777
751
  ref,
778
752
  ...props
779
- }: Omit<React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem>, "className"> & {
780
- className?: string;
781
- } & {
753
+ }: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem> & {
782
754
  ref?: React.Ref<HTMLDivElement>;
783
755
  }) => React.JSX.Element;
784
756
  type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Combobox.Separator>;
@@ -878,4 +850,4 @@ declare function PromptInputContextSelector({
878
850
  action
879
851
  }: PromptInputContextSelectorProps): React.JSX.Element;
880
852
  //#endregion
881
- export { PromptInputDictation as $, PromptInputCommandComposerProps as A, PromptInputTabLabelProps as At, PromptInputCommandItem as B, TooltipSide as Bt, PromptInputBody as C, PromptInputSubmitProps as Ct, PromptInputButtonTooltip as D, PromptInputTabItem as Dt, PromptInputButtonProps as E, PromptInputTabBodyProps as Et, PromptInputCommandGroupLabel as F, PromptInputTextareaProps as Ft, PromptInputCommandSeparator as G, usePromptInputController as Gt, PromptInputCommandList as H, getApprovalStateKey as Ht, PromptInputCommandGroupLabelProps as I, PromptInputTools as It, PromptInputContextAction as J, PromptInputCommandSeparatorProps as K, useProviderAttachments as Kt, PromptInputCommandGroupProps as L, PromptInputToolsProps as Lt, PromptInputCommandEmpty as M, PromptInputTabsList as Mt, PromptInputCommandEmptyProps as N, PromptInputTabsListProps as Nt, PromptInputCommand as O, PromptInputTabItemProps as Ot, PromptInputCommandGroup as P, PromptInputTextarea as Pt, PromptInputControllerProps as Q, PromptInputCommandInput as R, PromptInputTooltipConfig as Rt, PromptInputAttachmentsProps as S, PromptInputSubmit as St, PromptInputButton as T, PromptInputTabBody as Tt, PromptInputCommandListProps as U, getPendingToolApprovals as Ut, PromptInputCommandItemProps as V, getApprovalRequestId as Vt, PromptInputCommandProps as W, usePromptInputAttachments as Wt, PromptInputContextSelector as X, PromptInputContextItem as Y, PromptInputContextSelectorProps as Z, PromptInputApproval as _, PromptInputReference as _t, PromptInputActionAddAttachments as a, PromptInputHoverCard as at, PromptInputAttachmentProps as b, PromptInputSelect as bt, PromptInputActionAddScreenshotProps as c, PromptInputHoverCardProps as ct, PromptInputActionMenuContentProps as d, PromptInputMessage as dt, PromptInputDictationProps as et, PromptInputActionMenuItem as f, PromptInputPermissionSelector as ft, PromptInputActionMenuTriggerProps as g, PromptInputProviderProps as gt, PromptInputActionMenuTrigger as h, PromptInputProvider as ht, PromptInput as i, PromptInputHeaderProps as it, PromptInputCommandDefinition as j, PromptInputTabProps as jt, PromptInputCommandComposer as k, PromptInputTabLabel as kt, PromptInputActionMenu as l, PromptInputHoverCardTrigger as lt, PromptInputActionMenuProps as m, PromptInputProps as mt, PendingToolApproval as n, PromptInputFooterProps as nt, PromptInputActionAddAttachmentsProps as o, PromptInputHoverCardContent as ot, PromptInputActionMenuItemProps as p, PromptInputPermissionSelectorProps as pt, PromptInputCommandTrigger as q, PermissionMode as r, PromptInputHeader as rt, PromptInputActionAddScreenshot as s, PromptInputHoverCardContentProps as st, AttachmentsContext as t, PromptInputFooter as tt, PromptInputActionMenuContent as u, PromptInputHoverCardTriggerProps as ut, PromptInputApprovalProps as v, PromptInputReferences as vt, PromptInputBodyProps as w, PromptInputTab as wt, PromptInputAttachments as x, PromptInputSelectProps as xt, PromptInputAttachment as y, PromptInputReferencesProps as yt, PromptInputCommandInputProps as z, TextInputContext as zt };
853
+ export { PromptInputDictationProps as $, PromptInputCommandDefinition as A, PromptInputTabProps as At, PromptInputCommandItemProps as B, getApprovalRequestId as Bt, PromptInputBodyProps as C, PromptInputTab as Ct, PromptInputCommand as D, PromptInputTabItemProps as Dt, PromptInputButtonTooltip as E, PromptInputTabItem as Et, PromptInputCommandGroupLabelProps as F, PromptInputTools as Ft, PromptInputCommandSeparatorProps as G, useProviderAttachments as Gt, PromptInputCommandListProps as H, getPendingToolApprovals as Ht, PromptInputCommandGroupProps as I, PromptInputToolsProps as It, PromptInputContextItem as J, PromptInputCommandTrigger as K, PromptInputCommandInput as L, PromptInputTooltipConfig as Lt, PromptInputCommandEmptyProps as M, PromptInputTabsListProps as Mt, PromptInputCommandGroup as N, PromptInputTextarea as Nt, PromptInputCommandComposer as O, PromptInputTabLabel as Ot, PromptInputCommandGroupLabel as P, PromptInputTextareaProps as Pt, PromptInputDictation as Q, PromptInputCommandInputProps as R, TextInputContext as Rt, PromptInputBody as S, PromptInputSubmitProps as St, PromptInputButtonProps as T, PromptInputTabBodyProps as Tt, PromptInputCommandProps as U, usePromptInputAttachments as Ut, PromptInputCommandList as V, getApprovalStateKey as Vt, PromptInputCommandSeparator as W, usePromptInputController as Wt, PromptInputContextSelectorProps as X, PromptInputContextSelector as Y, PromptInputControllerProps as Z, PromptInputApprovalProps as _, PromptInputReferences as _t, PromptInputActionAddAttachmentsProps as a, PromptInputHoverCardContent as at, PromptInputAttachments as b, PromptInputSelectProps as bt, PromptInputActionMenu as c, PromptInputHoverCardTrigger as ct, PromptInputActionMenuItem as d, PromptInputPermissionSelector as dt, PromptInputFooter as et, PromptInputActionMenuItemProps as f, PromptInputPermissionSelectorProps as ft, PromptInputApproval as g, PromptInputReference as gt, PromptInputActionMenuTriggerProps as h, PromptInputProviderProps as ht, PromptInputActionAddAttachments as i, PromptInputHoverCard as it, PromptInputCommandEmpty as j, PromptInputTabsList as jt, PromptInputCommandComposerProps as k, PromptInputTabLabelProps as kt, PromptInputActionMenuContent as l, PromptInputHoverCardTriggerProps as lt, PromptInputActionMenuTrigger as m, PromptInputProvider as mt, PermissionMode as n, PromptInputHeader as nt, PromptInputActionAddScreenshot as o, PromptInputHoverCardContentProps as ot, PromptInputActionMenuProps as p, PromptInputProps as pt, PromptInputContextAction as q, PromptInput as r, PromptInputHeaderProps as rt, PromptInputActionAddScreenshotProps as s, PromptInputHoverCardProps as st, AttachmentsContext as t, PromptInputFooterProps as tt, PromptInputActionMenuContentProps as u, PromptInputMessage as ut, PromptInputAttachment as v, PromptInputReferencesProps as vt, PromptInputButton as w, PromptInputTabBody as wt, PromptInputAttachmentsProps as x, PromptInputSubmit as xt, PromptInputAttachmentProps as y, PromptInputSelect as yt, PromptInputCommandItem as z, TooltipSide as zt };
@@ -44,6 +44,7 @@ interface ResponsiveSidebarShellProps extends React.HTMLAttributes<HTMLDivElemen
44
44
  /**
45
45
  * Responsive master-detail shell with a resizable desktop sidebar and a compact
46
46
  * floating sidebar that leaves the main content in place as a dismiss target.
47
+ * The root exposes `data-sidebar-open="true" | "false"` as its public styling hook.
47
48
  */
48
49
  declare function ResponsiveSidebarShell({
49
50
  sidebar,
@@ -3,11 +3,8 @@ import { Select } from "@base-ui/react/select";
3
3
 
4
4
  //#region src/components/Select.d.ts
5
5
  type SelectProps<Value = unknown> = Select.Root.Props<Value>;
6
- interface SelectLabelProps extends Omit<Select.Label.Props, "className"> {
7
- className?: string;
8
- }
9
- interface SelectTriggerProps extends Omit<Select.Trigger.Props, "className"> {
10
- className?: string;
6
+ interface SelectLabelProps extends Select.Label.Props {}
7
+ interface SelectTriggerProps extends Select.Trigger.Props {
11
8
  /**
12
9
  * The size of the select trigger.
13
10
  * @default 'default'
@@ -18,45 +15,22 @@ interface SelectValueProps extends Omit<Select.Value.Props, "children"> {
18
15
  placeholder?: string;
19
16
  children?: Select.Value.Props["children"];
20
17
  }
21
- interface SelectIconProps extends Omit<Select.Icon.Props, "className"> {
22
- className?: string;
23
- }
18
+ interface SelectIconProps extends Select.Icon.Props {}
24
19
  interface SelectPortalProps extends Select.Portal.Props {}
25
- interface SelectBackdropProps extends Omit<Select.Backdrop.Props, "className"> {
26
- className?: string;
27
- }
20
+ interface SelectBackdropProps extends Select.Backdrop.Props {}
28
21
  interface SelectPositionerProps extends Select.Positioner.Props {}
29
- interface SelectPopupProps extends Omit<Select.Popup.Props, "className"> {
30
- className?: string;
31
- }
32
- interface SelectListProps extends Omit<Select.List.Props, "className"> {
33
- className?: string;
34
- }
35
- interface SelectItemProps extends Omit<Select.Item.Props, "className"> {
36
- className?: string;
37
- }
38
- interface SelectItemTextProps extends Omit<Select.ItemText.Props, "className"> {
39
- className?: string;
40
- }
41
- interface SelectItemIndicatorProps extends Omit<Select.ItemIndicator.Props, "className"> {
42
- className?: string;
43
- }
44
- interface SelectGroupProps extends Omit<Select.Group.Props, "className"> {
45
- className?: string;
22
+ interface SelectPopupProps extends Select.Popup.Props {}
23
+ interface SelectListProps extends Select.List.Props {}
24
+ interface SelectItemProps extends Select.Item.Props {}
25
+ interface SelectItemTextProps extends Select.ItemText.Props {}
26
+ interface SelectItemIndicatorProps extends Select.ItemIndicator.Props {}
27
+ interface SelectGroupProps extends Select.Group.Props {
46
28
  label?: string;
47
29
  }
48
- interface SelectGroupLabelProps extends Omit<Select.GroupLabel.Props, "className"> {
49
- className?: string;
50
- }
51
- interface SelectSeparatorProps extends Omit<Select.Separator.Props, "className"> {
52
- className?: string;
53
- }
54
- interface SelectScrollUpArrowProps extends Omit<Select.ScrollUpArrow.Props, "className"> {
55
- className?: string;
56
- }
57
- interface SelectScrollDownArrowProps extends Omit<Select.ScrollDownArrow.Props, "className"> {
58
- className?: string;
59
- }
30
+ interface SelectGroupLabelProps extends Select.GroupLabel.Props {}
31
+ interface SelectSeparatorProps extends Select.Separator.Props {}
32
+ interface SelectScrollUpArrowProps extends Select.ScrollUpArrow.Props {}
33
+ interface SelectScrollDownArrowProps extends Select.ScrollDownArrow.Props {}
60
34
  /**
61
35
  * A select component for choosing from a list of options.
62
36
  *
@@ -122,8 +96,6 @@ declare function SelectPositioner({
122
96
  ref,
123
97
  ...props
124
98
  }: SelectPositionerProps & {
125
- className?: string;
126
- } & {
127
99
  ref?: React.Ref<HTMLDivElement>;
128
100
  }): React.JSX.Element;
129
101
  declare function SelectPopup({
@@ -2,32 +2,18 @@ import * as React from "react";
2
2
  import { Tabs } from "@base-ui/react/tabs";
3
3
 
4
4
  //#region src/components/Tabs.d.ts
5
- interface TabsProps extends Omit<Tabs.Root.Props, "className"> {
6
- className?: string;
5
+ interface TabsProps extends Tabs.Root.Props {
7
6
  /**
8
7
  * The visual style variant.
9
8
  * @default 'default'
10
9
  */
11
10
  variant?: "default" | "bordered";
12
11
  }
13
- interface TabsListProps extends Omit<Tabs.List.Props, "className"> {
14
- className?: string;
12
+ interface TabsListProps extends Tabs.List.Props {
15
13
  variant?: "default" | "line" | null;
16
14
  }
17
- interface TabProps extends Omit<Tabs.Tab.Props, "className"> {
18
- className?: string;
19
- }
20
- interface TabPanelProps extends Omit<Tabs.Panel.Props, "className"> {
21
- className?: string;
22
- }
23
- interface TabsListVariantsOptions {
24
- variant?: "default" | "line" | null;
25
- className?: string;
26
- }
27
- declare function tabsListVariants({
28
- variant,
29
- className
30
- }?: TabsListVariantsOptions): string;
15
+ interface TabProps extends Tabs.Tab.Props {}
16
+ interface TabPanelProps extends Tabs.Panel.Props {}
31
17
  /**
32
18
  * A tabs component for organizing content into separate views.
33
19
  *
@@ -84,4 +70,4 @@ declare const Tabs$1: {
84
70
  Panel: typeof TabPanel;
85
71
  };
86
72
  //#endregion
87
- export { TabsListVariantsOptions as a, TabsListProps as i, TabProps as n, TabsProps as o, Tabs$1 as r, tabsListVariants as s, TabPanelProps as t };
73
+ export { TabsProps as a, TabsListProps as i, TabProps as n, Tabs$1 as r, TabPanelProps as t };
@@ -1,11 +1,13 @@
1
1
  import { AgentChat } from "./components/AgentChat.js";
2
- import { AgentChatTurnError } from "./components/AgentChatTurnError.js";
2
+ import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./components/AgentToolRunsContext.js";
3
+ import { SubagentRunList } from "./components/SubagentRunList.js";
3
4
  import { ThinkChatContext, useThinkChatContext } from "./components/ThinkChatContext.js";
4
5
  import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/ThinkChatActivity.js";
6
+ import { ThinkRecoveryNotice } from "./components/ThinkRecoveryNotice.js";
5
7
  import * as React from "react";
6
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
9
  import { useAgentChat } from "@cloudflare/think/react";
8
- import { useAgent } from "agents/react";
10
+ import { useAgent, useAgentToolEvents } from "agents/react";
9
11
  //#region src/components/_internal/think-approvals.ts
10
12
  /**
11
13
  * Ambient approvals belong to their stub. An explicit different stub may only
@@ -75,11 +77,15 @@ function useThinkPendingApprovals(stub, refreshKey) {
75
77
  * `ThinkChat.Root` create one) and `ThinkChat.Messages` renders the message
76
78
  * stream with agent work folded into collapsed Activity blocks.
77
79
  */
78
- function ThinkChatProvider({ chat, children }) {
79
- return /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
80
+ function ThinkChatProvider({ agentTools, chat, children }) {
81
+ const chatProvider = /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
80
82
  value: chat,
81
83
  children
82
84
  });
85
+ return agentTools ? /* @__PURE__ */ jsx(AgentToolRunsProvider, {
86
+ agentTools,
87
+ children: chatProvider
88
+ }) : chatProvider;
83
89
  }
84
90
  /**
85
91
  * Batteries-included root: connects to the named Think agent (upstream's
@@ -102,15 +108,23 @@ function ThinkChatRoot({ agent: agentOption, name, children }) {
102
108
  name: name ?? agentOption.name
103
109
  });
104
110
  const chat = useAgentChat({ agent });
111
+ const agentTools = useAgentToolEvents({ agent });
112
+ const agentIdentity = JSON.stringify(agent.path);
105
113
  const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
106
- return /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
107
- value: chat,
108
- children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
109
- value: {
110
- ...approvals,
111
- thinkStub: agent.stub
112
- },
113
- children
114
+ React.useEffect(() => {
115
+ agentTools.resetLocalState();
116
+ }, [agentIdentity]);
117
+ return /* @__PURE__ */ jsx(AgentToolRunsProvider, {
118
+ agentTools,
119
+ children: /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
120
+ value: chat,
121
+ children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
122
+ value: {
123
+ ...approvals,
124
+ thinkStub: agent.stub
125
+ },
126
+ children
127
+ })
114
128
  })
115
129
  });
116
130
  }
@@ -125,8 +139,9 @@ const ThinkChatApprovalsContext = React.createContext(null);
125
139
  * inside the log) or `excludeTools` + your own `renderPart` (standalone
126
140
  * card) — see README "App-specific tools" and the Custom Tool Panel story.
127
141
  */
128
- function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
142
+ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentToolRunSelect, selectedAgentToolRunId, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
129
143
  const chat = useThinkChatContext("ThinkChat.Messages");
144
+ const agentTools = useOptionalAgentToolRuns();
130
145
  const approvals = React.useContext(ThinkChatApprovalsContext);
131
146
  const status = toAgentChatStatus(chat);
132
147
  const resolvedApprovals = resolveThinkApprovalProps({
@@ -140,8 +155,15 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
140
155
  });
141
156
  const defaultRenderPart = React.useMemo(() => createThinkChatActivityRenderer({
142
157
  excludeTools,
158
+ onAgentToolRunSelect,
159
+ selectedAgentToolRunId,
143
160
  toolRenderers
144
- }), [excludeTools, toolRenderers]);
161
+ }), [
162
+ excludeTools,
163
+ onAgentToolRunSelect,
164
+ selectedAgentToolRunId,
165
+ toolRenderers
166
+ ]);
145
167
  const resolvedRenderPart = React.useMemo(() => renderPart ? (context) => {
146
168
  const renderBuiltIn = () => {
147
169
  const builtIn = defaultRenderPart(context);
@@ -153,18 +175,21 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
153
175
  });
154
176
  return custom === void 0 ? renderBuiltIn() : custom;
155
177
  } : defaultRenderPart, [defaultRenderPart, renderPart]);
156
- const retryMessageId = chat.error ? chat.messages.findLast((message) => message.role !== "system")?.id : void 0;
157
- const defaultNotice = chat.isRecovering ? /* @__PURE__ */ jsx(Fragment, { children: "Reconnecting to the agent…" }) : chat.connectionError ? /* @__PURE__ */ jsxs("span", {
158
- "data-tone": "danger",
159
- children: ["Connection lost", chat.connectionError.reason ? ` — ${chat.connectionError.reason}` : ""]
160
- }) : chat.error ? /* @__PURE__ */ jsx(AgentChatTurnError, {
161
- error: chat.error,
162
- onDismiss: chat.clearError,
163
- onRetry: retryMessageId ? () => {
164
- chat.clearError();
165
- chat.regenerate({ messageId: retryMessageId });
166
- } : void 0
167
- }) : void 0;
178
+ const defaultNotice = /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat });
179
+ const backgroundRuns = onAgentToolRunSelect ? agentTools?.unboundRuns : void 0;
180
+ const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length ? /* @__PURE__ */ jsxs("div", {
181
+ className: "subagent-run__tray",
182
+ "data-slot": "background-agent-runs",
183
+ children: [/* @__PURE__ */ jsx("span", {
184
+ className: "subagent-run__tray-label",
185
+ children: "Background agents"
186
+ }), /* @__PURE__ */ jsx(SubagentRunList, {
187
+ "aria-label": "Background agent runs",
188
+ runs: backgroundRuns,
189
+ selectedRunId: selectedAgentToolRunId,
190
+ onSelect: onAgentToolRunSelect
191
+ })]
192
+ }) : null] }) : void 0;
168
193
  return /* @__PURE__ */ jsx(AgentChat, {
169
194
  ...props,
170
195
  renderPart: resolvedRenderPart,
@@ -176,6 +201,7 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
176
201
  onExecutionSettled: resolvedApprovals.onExecutionSettled,
177
202
  pendingApprovals: resolvedApprovals.pendingApprovals,
178
203
  notice: notice ?? defaultNotice,
204
+ composerHeader: resolvedComposerHeader,
179
205
  onRegenerate: (messageId) => void chat.regenerate({ messageId }),
180
206
  onSubmit: ({ text, files, references }) => {
181
207
  const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
@@ -205,6 +231,7 @@ const ThinkChat = {
205
231
  Root: ThinkChatRoot,
206
232
  Messages: ThinkChatMessages,
207
233
  Activity: ThinkChatActivity,
234
+ RecoveryNotice: ThinkRecoveryNotice,
208
235
  renderActivityPart: renderThinkChatActivityPart,
209
236
  createActivityRenderer: createThinkChatActivityRenderer
210
237
  };
@@ -1,7 +1,9 @@
1
- import { i as AgentChatProps, o as AgentChatRenderPartContext } from "./AgentChat-CrlpbvQJ.js";
1
+ import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
2
+ import { r as AgentChatProps } from "./AgentChat-CRuMi1Pb.js";
2
3
  import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
3
4
  import * as React from "react";
4
5
  import { DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
6
+ import { AgentToolRunState } from "agents/agent-tools";
5
7
 
6
8
  //#region src/components/ThinkChatActivity.d.ts
7
9
  /**
@@ -16,7 +18,7 @@ interface ThinkChatToolRenderer {
16
18
  panel?: (part: ToolUIPart | DynamicToolUIPart) => React.ReactNode;
17
19
  }
18
20
  type ThinkChatToolRenderers = Record<string, ThinkChatToolRenderer>;
19
- interface ThinkChatActivityRendererOptions {
21
+ interface ThinkChatActivityRendererOptions<MessageT extends UIMessage = UIMessage> {
20
22
  /**
21
23
  * Tool names to keep out of activity folding entirely — the run splits
22
24
  * around them and they fall through to your own renderPart / AgentChat's
@@ -26,6 +28,10 @@ interface ThinkChatActivityRendererOptions {
26
28
  excludeTools?: readonly string[];
27
29
  /** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
28
30
  toolRenderers?: ThinkChatToolRenderers;
31
+ /** Selected retained child shown in an adjacent detail surface. */
32
+ selectedAgentToolRunId?: string | null;
33
+ /** Opens a whole upstream retained run in the host-owned detail surface. */
34
+ onAgentToolRunSelect?: (run: AgentToolRunState<MessageT["parts"][number]>) => void;
29
35
  }
30
36
  interface ThinkChatActivityProps {
31
37
  /** Render with the log expanded. */
@@ -58,9 +64,11 @@ declare function ThinkChatActivity({
58
64
  */
59
65
  declare function createThinkChatActivityRenderer<MessageT extends UIMessage = UIMessage>({
60
66
  excludeTools,
67
+ onAgentToolRunSelect,
68
+ selectedAgentToolRunId,
61
69
  toolRenderers
62
- }?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
70
+ }?: ThinkChatActivityRendererOptions<MessageT>): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
63
71
  /** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
64
- declare const renderThinkChatActivityPart: (context: AgentChatRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
72
+ declare const renderThinkChatActivityPart: (context: AgentMessageRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
65
73
  //#endregion
66
74
  export { ThinkChatToolRenderers as a, ThinkChatToolRenderer as i, ThinkChatActivityProps as n, createThinkChatActivityRenderer as o, ThinkChatActivityRendererOptions as r, renderThinkChatActivityPart as s, ThinkChatActivity as t };
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
- import { useAgentChat } from "@cloudflare/think/react";
3
2
  import { UIMessage } from "ai";
3
+ import { useAgentChat } from "@cloudflare/think/react";
4
4
 
5
5
  //#region src/components/ThinkChatContext.d.ts
6
6
  /** The complete upstream Think chat hook value, preserving app state and message extensions. */
@@ -0,0 +1,19 @@
1
+ import { n as ThinkChatValue } from "./ThinkChatContext-DrsZqdaO.js";
2
+ import { UIMessage } from "ai";
3
+
4
+ //#region src/components/ThinkRecoveryNotice.d.ts
5
+ interface ThinkRecoveryNoticeProps<State = unknown, MessageT extends UIMessage = UIMessage> {
6
+ /** The complete `useAgentChat` value from `@cloudflare/think/react`. */
7
+ chat: ThinkChatValue<State, MessageT>;
8
+ }
9
+ /**
10
+ * Native Think recovery, connection, and turn-error content for AgentChat's
11
+ * persistent polite notice region. Think exposes no recovery phase, progress,
12
+ * checkpoint, attempt count, or timeline to the browser, so this adapter does
13
+ * not claim those details.
14
+ */
15
+ declare function ThinkRecoveryNotice<State = unknown, MessageT extends UIMessage = UIMessage>({
16
+ chat
17
+ }: ThinkRecoveryNoticeProps<State, MessageT>): import("react").JSX.Element | null;
18
+ //#endregion
19
+ export { ThinkRecoveryNoticeProps as n, ThinkRecoveryNotice as t };
@@ -10,7 +10,7 @@ interface ToggleVariantsOptions {
10
10
  /**
11
11
  * Props for the Toggle component.
12
12
  */
13
- interface ToggleProps extends Omit<React.ComponentPropsWithoutRef<typeof Toggle>, "className">, ToggleVariantsOptions {}
13
+ interface ToggleProps extends React.ComponentPropsWithoutRef<typeof Toggle>, Omit<ToggleVariantsOptions, "className"> {}
14
14
  declare function toggleVariants({
15
15
  variant,
16
16
  size,
@@ -1,12 +1,11 @@
1
- import { r as ToggleVariantsOptions } from "./Toggle-CAAlNl-M.js";
1
+ import { r as ToggleVariantsOptions } from "./Toggle-DaXpe1Lc.js";
2
2
  import * as React from "react";
3
3
  import { ToggleGroup } from "@base-ui/react/toggle-group";
4
4
  import { Toggle } from "@base-ui/react/toggle";
5
5
 
6
6
  //#region src/components/ToggleGroup.d.ts
7
7
  type ToggleGroupSize = ToggleVariantsOptions["size"] | "md";
8
- interface ToggleGroupProps extends Omit<React.ComponentPropsWithRef<typeof ToggleGroup>, "className"> {
9
- className?: string;
8
+ interface ToggleGroupProps extends React.ComponentPropsWithRef<typeof ToggleGroup> {
10
9
  variant?: ToggleVariantsOptions["variant"];
11
10
  /**
12
11
  * The size of the toggle group.
@@ -15,7 +14,7 @@ interface ToggleGroupProps extends Omit<React.ComponentPropsWithRef<typeof Toggl
15
14
  size?: ToggleGroupSize;
16
15
  spacing?: number;
17
16
  }
18
- interface ToggleGroupItemProps extends Omit<React.ComponentPropsWithRef<typeof Toggle>, "className">, ToggleVariantsOptions {}
17
+ interface ToggleGroupItemProps extends React.ComponentPropsWithRef<typeof Toggle>, Omit<ToggleVariantsOptions, "className"> {}
19
18
  /**
20
19
  * A toggle group component for selecting one or multiple options.
21
20
  *