@mcp-b/react-components 0.16.1 → 0.18.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 (371) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-ClxViuUM.d.ts} +4 -29
  3. package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
  4. package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
  5. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  6. package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Bfp5PAg3.js} +9 -6
  7. package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  8. package/dist/Collapsible-N64ASIQr.d.ts +119 -0
  9. package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
  10. package/dist/{FileTree-CkVbIMWV.js → FileTree-3zYtrddG.js} +46 -20
  11. package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
  12. package/dist/{Message-BkMdE3bS.js → Message-BXtmfc9Q.js} +13 -20
  13. package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-Cqw_qrUG.js} +18 -25
  14. package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-Bdh9pqlo.d.ts} +41 -71
  15. package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
  16. package/dist/{Select-BeEsefzh.d.ts → Select-B_13gg_J.d.ts} +16 -44
  17. package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-ColWK-XA.d.ts} +14 -20
  18. package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-15EhfvYJ.js} +123 -73
  19. package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +9 -4
  20. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  21. package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
  22. package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
  23. package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-JKZ43D5S.d.ts} +2 -2
  24. package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +4 -5
  25. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  26. package/dist/WorkspaceExplorer-B9dQWNVK.d.ts +32 -0
  27. package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  28. package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-C68Ub8S8.js} +121 -128
  29. package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-BYYeTQLf.js} +20 -55
  30. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  31. package/dist/class-names-BiMDVpUo.js +14 -0
  32. package/dist/components/Accordion.d.ts +5 -15
  33. package/dist/components/Accordion.js +16 -10
  34. package/dist/components/Activity.d.ts +5 -10
  35. package/dist/components/Activity.js +2 -2
  36. package/dist/components/AgentActivity.d.ts +1 -1
  37. package/dist/components/AgentActivity.js +4 -5
  38. package/dist/components/AgentActivityPreview.d.ts +9 -9
  39. package/dist/components/AgentActivityPreview.js +8 -12
  40. package/dist/components/AgentAttention.d.ts +2 -2
  41. package/dist/components/AgentAttention.js +1 -1
  42. package/dist/components/AgentChat.d.ts +2 -2
  43. package/dist/components/AgentChat.js +113 -218
  44. package/dist/components/AgentChatMessageEditor.js +3 -3
  45. package/dist/components/AgentChatTurnError.js +2 -2
  46. package/dist/components/AgentConnection.js +4 -4
  47. package/dist/components/AgentMessageParts.d.ts +2 -0
  48. package/dist/components/AgentMessageParts.js +119 -0
  49. package/dist/components/AgentToolDetail.d.ts +57 -0
  50. package/dist/components/AgentToolDetail.js +100 -0
  51. package/dist/components/AgentToolRunsContext.d.ts +2 -0
  52. package/dist/components/AgentToolRunsContext.js +16 -0
  53. package/dist/components/AlertDialog.d.ts +7 -19
  54. package/dist/components/AlertDialog.js +21 -32
  55. package/dist/components/AppTopBar.d.ts +28 -8
  56. package/dist/components/AppTopBar.js +36 -12
  57. package/dist/components/Approval.d.ts +102 -0
  58. package/dist/components/Approval.js +227 -0
  59. package/dist/components/Artifact.d.ts +3 -5
  60. package/dist/components/Artifact.js +7 -5
  61. package/dist/components/Autocomplete.d.ts +11 -33
  62. package/dist/components/Autocomplete.js +23 -30
  63. package/dist/components/Avatar.d.ts +4 -12
  64. package/dist/components/Avatar.js +13 -12
  65. package/dist/components/Badge.js +3 -0
  66. package/dist/components/BrowserLiveView.js +27 -12
  67. package/dist/components/BrowserReplay.js +4 -3
  68. package/dist/components/BrowserRunPanel.js +58 -78
  69. package/dist/components/Button.d.ts +1 -1
  70. package/dist/components/Button.js +14 -16
  71. package/dist/components/Card.d.ts +7 -8
  72. package/dist/components/Card.js +19 -10
  73. package/dist/components/ChainOfThought.d.ts +5 -11
  74. package/dist/components/ChainOfThought.js +3 -2
  75. package/dist/components/ChatGptSignInScreen.js +8 -8
  76. package/dist/components/Checkbox.d.ts +2 -4
  77. package/dist/components/Checkbox.js +6 -5
  78. package/dist/components/CheckboxGroup.d.ts +1 -3
  79. package/dist/components/CheckboxGroup.js +15 -14
  80. package/dist/components/Checkpoint.d.ts +64 -0
  81. package/dist/components/Checkpoint.js +63 -0
  82. package/dist/components/CodeBlock.d.ts +1 -1
  83. package/dist/components/CodeBlock.js +1 -1
  84. package/dist/components/CodexModelSelector.d.ts +1 -1
  85. package/dist/components/CodexModelSelector.js +2 -2
  86. package/dist/components/Collapsible.d.ts +1 -124
  87. package/dist/components/Collapsible.js +7 -10
  88. package/dist/components/Combobox.d.ts +1 -1
  89. package/dist/components/Combobox.js +23 -30
  90. package/dist/components/Commit.d.ts +5 -11
  91. package/dist/components/Commit.js +6 -5
  92. package/dist/components/Context.js +1 -1
  93. package/dist/components/ContextMenu.d.ts +21 -37
  94. package/dist/components/ContextMenu.js +34 -51
  95. package/dist/components/Conversation.d.ts +3 -5
  96. package/dist/components/Conversation.js +5 -4
  97. package/dist/components/DescriptionListParts.js +1 -1
  98. package/dist/components/Dialog.d.ts +6 -17
  99. package/dist/components/Dialog.js +17 -24
  100. package/dist/components/EnvironmentVariables.d.ts +1 -1
  101. package/dist/components/EnvironmentVariables.js +4 -3
  102. package/dist/components/Field.d.ts +17 -20
  103. package/dist/components/Field.js +20 -17
  104. package/dist/components/Fieldset.d.ts +2 -7
  105. package/dist/components/Fieldset.js +7 -6
  106. package/dist/components/FileTree.d.ts +6 -0
  107. package/dist/components/FileTree.js +1 -1
  108. package/dist/components/Form.d.ts +1 -4
  109. package/dist/components/Form.js +3 -2
  110. package/dist/components/GithubMotionMark.js +1 -1
  111. package/dist/components/IconButton.d.ts +2 -3
  112. package/dist/components/IconButton.js +2 -1
  113. package/dist/components/InlineCitation.d.ts +66 -0
  114. package/dist/components/InlineCitation.js +142 -0
  115. package/dist/components/Input.d.ts +1 -4
  116. package/dist/components/Input.js +3 -2
  117. package/dist/components/Marker.js +1 -1
  118. package/dist/components/McpConnectionRequest.js +2 -2
  119. package/dist/components/McpServerPicker.d.ts +1 -1
  120. package/dist/components/McpServerPicker.js +6 -5
  121. package/dist/components/MediaPreviewCard.d.ts +103 -0
  122. package/dist/components/MediaPreviewCard.js +193 -0
  123. package/dist/components/Menu.d.ts +1 -1
  124. package/dist/components/Menu.js +33 -52
  125. package/dist/components/Menubar.d.ts +22 -43
  126. package/dist/components/Menubar.js +36 -53
  127. package/dist/components/Message.d.ts +7 -7
  128. package/dist/components/Message.js +1 -1
  129. package/dist/components/MessageScroller.d.ts +2 -2
  130. package/dist/components/MessageScroller.js +6 -5
  131. package/dist/components/Meter.d.ts +5 -20
  132. package/dist/components/Meter.js +11 -10
  133. package/dist/components/ModelSelector.d.ts +6 -9
  134. package/dist/components/ModelSelector.js +1 -1
  135. package/dist/components/NavigationMenu.d.ts +11 -33
  136. package/dist/components/NavigationMenu.js +23 -30
  137. package/dist/components/NumberField.d.ts +6 -24
  138. package/dist/components/NumberField.js +13 -12
  139. package/dist/components/Plan.d.ts +103 -0
  140. package/dist/components/Plan.js +113 -0
  141. package/dist/components/Popover.d.ts +9 -36
  142. package/dist/components/Popover.js +23 -34
  143. package/dist/components/PreviewCard.d.ts +6 -24
  144. package/dist/components/PreviewCard.js +13 -24
  145. package/dist/components/PricingBillingToggle.js +1 -1
  146. package/dist/components/PricingFAQ.js +1 -1
  147. package/dist/components/PricingPage.js +2 -1
  148. package/dist/components/PricingPlanCard.js +5 -4
  149. package/dist/components/PricingUsageCalculator.js +3 -3
  150. package/dist/components/Progress.d.ts +3 -8
  151. package/dist/components/Progress.js +7 -10
  152. package/dist/components/PromptInput.d.ts +2 -2
  153. package/dist/components/PromptInput.js +83 -218
  154. package/dist/components/Queue.d.ts +7 -17
  155. package/dist/components/Queue.js +2 -3
  156. package/dist/components/RadioGroup.d.ts +3 -8
  157. package/dist/components/RadioGroup.js +7 -10
  158. package/dist/components/Reasoning.d.ts +4 -8
  159. package/dist/components/Reasoning.js +3 -6
  160. package/dist/components/ResizableSidePanel.js +2 -2
  161. package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
  162. package/dist/components/ResponsiveSidebarShell.js +18 -11
  163. package/dist/components/ScrollArea.d.ts +5 -20
  164. package/dist/components/ScrollArea.js +12 -10
  165. package/dist/components/SearchField.d.ts +43 -0
  166. package/dist/components/SearchField.js +52 -0
  167. package/dist/components/Select.d.ts +1 -1
  168. package/dist/components/Select.js +33 -57
  169. package/dist/components/Separator.d.ts +1 -5
  170. package/dist/components/Separator.js +3 -6
  171. package/dist/components/Slider.d.ts +6 -19
  172. package/dist/components/Slider.js +15 -14
  173. package/dist/components/Sources.d.ts +4 -9
  174. package/dist/components/Sources.js +3 -2
  175. package/dist/components/Stepper.js +16 -9
  176. package/dist/components/SubagentRunDetails.js +1 -1
  177. package/dist/components/SubagentRunIndicator.js +2 -2
  178. package/dist/components/SubagentRunList.d.ts +3 -5
  179. package/dist/components/SubagentRunList.js +3 -5
  180. package/dist/components/SubagentRunSelector.d.ts +9 -22
  181. package/dist/components/SubagentRunSelector.js +29 -31
  182. package/dist/components/Switch.d.ts +4 -7
  183. package/dist/components/Switch.js +6 -10
  184. package/dist/components/Tabs.d.ts +2 -2
  185. package/dist/components/Tabs.js +21 -18
  186. package/dist/components/Task.d.ts +4 -9
  187. package/dist/components/Task.js +4 -3
  188. package/dist/components/Terminal.d.ts +3 -4
  189. package/dist/components/Terminal.js +5 -4
  190. package/dist/components/TestResults.d.ts +4 -9
  191. package/dist/components/TestResults.js +11 -6
  192. package/dist/components/Textarea.js +1 -1
  193. package/dist/components/ThemeModeControl.js +1 -1
  194. package/dist/components/ThinkChat.d.ts +45 -22
  195. package/dist/components/ThinkChat.js +7 -5
  196. package/dist/components/ThinkChatActivity.d.ts +2 -2
  197. package/dist/components/ThinkChatActivity.js +24 -7
  198. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  199. package/dist/components/ThinkChatActivitySummary.js +7 -3
  200. package/dist/components/ThinkChatContext.d.ts +1 -1
  201. package/dist/components/ThinkChatToolPanels.js +27 -17
  202. package/dist/components/ThinkExecutionDetail.js +2 -2
  203. package/dist/components/ThinkExecutionStatus.js +2 -2
  204. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  205. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  206. package/dist/components/ThinkFullApp.d.ts +40 -15
  207. package/dist/components/ThinkFullApp.js +193 -117
  208. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  209. package/dist/components/ThinkFullAppViewSwitch.js +2 -2
  210. package/dist/components/ThinkPendingApproval.d.ts +60 -0
  211. package/dist/components/ThinkPendingApproval.js +99 -0
  212. package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
  213. package/dist/components/ThinkRecoveryNotice.js +46 -0
  214. package/dist/components/ThinkRoutine.js +1 -0
  215. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  216. package/dist/components/ThinkRoutineBrowser.js +37 -44
  217. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  218. package/dist/components/ThinkRoutineDetail.js +4 -4
  219. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  220. package/dist/components/ThinkRoutineForm.js +11 -10
  221. package/dist/components/ThinkRoutineLibrary.d.ts +27 -25
  222. package/dist/components/ThinkRoutineLibrary.js +104 -80
  223. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  224. package/dist/components/ThinkRoutineRuns.js +31 -24
  225. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  226. package/dist/components/ThinkThreadPicker.js +163 -39
  227. package/dist/components/ThinkThreadShell.d.ts +1 -1
  228. package/dist/components/Toast.d.ts +7 -28
  229. package/dist/components/Toast.js +15 -14
  230. package/dist/components/Toggle.d.ts +1 -1
  231. package/dist/components/Toggle.js +10 -8
  232. package/dist/components/ToggleGroup.d.ts +1 -1
  233. package/dist/components/ToggleGroup.js +21 -26
  234. package/dist/components/ToolApproval.d.ts +28 -0
  235. package/dist/components/ToolApproval.js +35 -0
  236. package/dist/components/ToolInvocation.d.ts +26 -0
  237. package/dist/components/ToolInvocation.js +72 -0
  238. package/dist/components/Toolbar.d.ts +6 -24
  239. package/dist/components/Toolbar.js +13 -12
  240. package/dist/components/Tooltip.d.ts +11 -10
  241. package/dist/components/Tooltip.js +17 -11
  242. package/dist/components/TransitionSurface.d.ts +27 -0
  243. package/dist/components/TransitionSurface.js +20 -0
  244. package/dist/components/WebPreview.d.ts +6 -7
  245. package/dist/components/WebPreview.js +70 -55
  246. package/dist/components/Workspace.d.ts +2 -2
  247. package/dist/components/Workspace.js +361 -346
  248. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  249. package/dist/components/WorkspaceBrowser.js +16 -26
  250. package/dist/components/WorkspaceExplorer.d.ts +5 -33
  251. package/dist/components/WorkspaceExplorer.js +19 -32
  252. package/dist/components/WorkspaceFile.d.ts +1 -1
  253. package/dist/components/WorkspaceFileView.d.ts +14 -2
  254. package/dist/components/WorkspaceFileView.js +1 -1
  255. package/dist/components/WorkspaceHeader.d.ts +0 -8
  256. package/dist/components/WorkspaceHeader.js +3 -15
  257. package/dist/components/WorkspaceLink.d.ts +1 -1
  258. package/dist/components/WorkspaceLink.js +1 -1
  259. package/dist/components/icons.d.ts +2 -2
  260. package/dist/components/icons.js +2 -2
  261. package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-D7aAYA-2.d.ts} +2 -3
  262. package/dist/{copy-button-Dejn5heL.js → copy-button-DeK6KXEV.js} +3 -2
  263. package/dist/{icons-CpfUer49.js → icons-CQJ-aMnI.js} +7 -3
  264. package/dist/{icons-GQd1xF4e.d.ts → icons-CYXmvKlJ.d.ts} +22 -2
  265. package/dist/navigation-link-Cob7KBlM.js +19 -0
  266. package/dist/styles/accordion.css +4 -19
  267. package/dist/styles/activity.css +48 -56
  268. package/dist/styles/agent-activity-preview.css +6 -0
  269. package/dist/styles/agent-chat.css +14 -63
  270. package/dist/styles/agent-connection.css +0 -12
  271. package/dist/styles/agent-tool-detail.css +54 -0
  272. package/dist/styles/alert-dialog.css +16 -18
  273. package/dist/styles/app-top-bar.css +17 -9
  274. package/dist/styles/approval.css +177 -0
  275. package/dist/styles/artifact.css +6 -18
  276. package/dist/styles/autocomplete.css +2 -1
  277. package/dist/styles/avatar.css +35 -30
  278. package/dist/styles/badge.css +10 -10
  279. package/dist/styles/base-ui-motion.css +94 -39
  280. package/dist/styles/browser-control-overlay.css +0 -1
  281. package/dist/styles/browser-live-view.css +39 -22
  282. package/dist/styles/browser-replay.css +1 -1
  283. package/dist/styles/browser-run-panel.css +13 -6
  284. package/dist/styles/button.css +36 -33
  285. package/dist/styles/card.css +5 -6
  286. package/dist/styles/chain-of-thought.css +22 -24
  287. package/dist/styles/checkbox.css +18 -5
  288. package/dist/styles/checkpoint.css +58 -0
  289. package/dist/styles/codex-model-selector.css +3 -7
  290. package/dist/styles/collapsible.css +10 -10
  291. package/dist/styles/combobox.css +4 -3
  292. package/dist/styles/commit.css +19 -39
  293. package/dist/styles/composition-motion.css +83 -0
  294. package/dist/styles/context-menu.css +3 -11
  295. package/dist/styles/context.css +11 -10
  296. package/dist/styles/conversation.css +18 -23
  297. package/dist/styles/dialog.css +15 -15
  298. package/dist/styles/environment-variables.css +0 -13
  299. package/dist/styles/field.css +32 -12
  300. package/dist/styles/file-tree.css +66 -22
  301. package/dist/styles/form.css +1 -1
  302. package/dist/styles/index.css +13 -4
  303. package/dist/styles/inline-citation.css +107 -0
  304. package/dist/styles/input.css +2 -2
  305. package/dist/styles/marker.css +14 -13
  306. package/dist/styles/mcp-server-picker.css +20 -47
  307. package/dist/styles/media-preview-card.css +160 -0
  308. package/dist/styles/menu.css +11 -40
  309. package/dist/styles/menubar.css +12 -19
  310. package/dist/styles/message-scroller.css +0 -12
  311. package/dist/styles/message.css +25 -31
  312. package/dist/styles/meter.css +2 -2
  313. package/dist/styles/model-selector.css +16 -34
  314. package/dist/styles/motion-reduction.css +29 -0
  315. package/dist/styles/navigation-menu.css +14 -30
  316. package/dist/styles/number-field.css +22 -4
  317. package/dist/styles/plan.css +132 -0
  318. package/dist/styles/popover.css +15 -52
  319. package/dist/styles/preview-card.css +2 -32
  320. package/dist/styles/progress.css +8 -3
  321. package/dist/styles/prompt-input.css +76 -269
  322. package/dist/styles/queue.css +48 -32
  323. package/dist/styles/radio.css +19 -12
  324. package/dist/styles/reasoning.css +2 -1
  325. package/dist/styles/recipes.css +207 -26
  326. package/dist/styles/resizable-side-panel.css +4 -10
  327. package/dist/styles/responsive-sidebar-shell.css +32 -34
  328. package/dist/styles/scroll-area.css +32 -15
  329. package/dist/styles/search-field.css +21 -0
  330. package/dist/styles/select.css +19 -12
  331. package/dist/styles/slider.css +25 -29
  332. package/dist/styles/sources.css +3 -11
  333. package/dist/styles/stepper.css +36 -26
  334. package/dist/styles/subagent-run.css +13 -71
  335. package/dist/styles/switch.css +32 -29
  336. package/dist/styles/tabs.css +79 -23
  337. package/dist/styles/task.css +11 -23
  338. package/dist/styles/test-results.css +29 -36
  339. package/dist/styles/theme-mode-control.css +8 -0
  340. package/dist/styles/think-execution-workbench.css +18 -15
  341. package/dist/styles/think-full-app.css +51 -100
  342. package/dist/styles/think-routine-library.css +51 -40
  343. package/dist/styles/think-thread-picker.css +207 -50
  344. package/dist/styles/toast.css +48 -34
  345. package/dist/styles/toggle-group.css +2 -36
  346. package/dist/styles/toggle.css +29 -5
  347. package/dist/styles/toolbar.css +25 -27
  348. package/dist/styles/tooltip.css +2 -32
  349. package/dist/styles/transition-surface.css +55 -0
  350. package/dist/styles/utilities.css +31 -0
  351. package/dist/styles/web-preview.css +0 -21
  352. package/dist/styles/workspace-explorer.css +104 -99
  353. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  354. package/dist/think-agent-Cip5KAPj.d.ts +7 -0
  355. package/dist/utils/codex-model-catalog.d.ts +4 -4
  356. package/dist/utils/mcp-server-catalog.d.ts +132 -0
  357. package/dist/utils/mcp-server-catalog.js +90 -0
  358. package/dist/utils/structured-code.d.ts +1 -1
  359. package/dist/workspace-path-L_KmjRjq.js +26 -0
  360. package/package.json +14 -9
  361. package/dist/Workspace-D39LxGvP.d.ts +0 -62
  362. package/dist/class-names-9UtZwb0J.js +0 -12
  363. package/dist/components/AppFrame.d.ts +0 -24
  364. package/dist/components/AppFrame.js +0 -25
  365. package/dist/components/Shell.d.ts +0 -163
  366. package/dist/components/Shell.js +0 -137
  367. package/dist/components/SubagentRun.d.ts +0 -86
  368. package/dist/components/SubagentRun.js +0 -108
  369. package/dist/styles/app-frame.css +0 -15
  370. package/dist/styles/shell.css +0 -122
  371. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -1,4 +1,4 @@
1
- import { Collapsible } from "./Collapsible.js";
1
+ import { t as Collapsible } from "../Collapsible-N64ASIQr.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/TestResults.d.ts
@@ -101,8 +101,7 @@ declare function TestResultsContent({
101
101
  }: TestResultsContentProps & {
102
102
  ref?: React.Ref<HTMLDivElement>;
103
103
  }): React.JSX.Element;
104
- interface TestSuiteProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "className" | "unstyled"> {
105
- className?: string;
104
+ interface TestSuiteProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "unstyled"> {
106
105
  name: string;
107
106
  status: TestStatusValue;
108
107
  }
@@ -117,9 +116,7 @@ declare function TestSuite({
117
116
  }: TestSuiteProps & {
118
117
  ref?: React.Ref<HTMLDivElement>;
119
118
  }): React.JSX.Element;
120
- type TestSuiteNameProps = Omit<React.ComponentProps<typeof Collapsible.Trigger>, "className" | "unstyled"> & {
121
- className?: string;
122
- };
119
+ type TestSuiteNameProps = Omit<React.ComponentProps<typeof Collapsible.Trigger>, "unstyled"> & {};
123
120
  declare function TestSuiteName({
124
121
  className,
125
122
  children,
@@ -144,9 +141,7 @@ declare function TestSuiteStats({
144
141
  }: TestSuiteStatsProps & {
145
142
  ref?: React.Ref<HTMLDivElement>;
146
143
  }): React.JSX.Element;
147
- type TestSuiteContentProps = Omit<React.ComponentProps<typeof Collapsible.Panel>, "className" | "unstyled"> & {
148
- className?: string;
149
- };
144
+ type TestSuiteContentProps = Omit<React.ComponentProps<typeof Collapsible.Panel>, "unstyled"> & {};
150
145
  declare function TestSuiteContent({
151
146
  className,
152
147
  children,
@@ -1,6 +1,6 @@
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
1
2
  import { Collapsible } from "./Collapsible.js";
2
- import { t as cx } from "../class-names-9UtZwb0J.js";
3
- import { B as SpinnerIcon, Y as XIcon, l as ChevronRightIcon, o as CheckIcon } from "../icons-CpfUer49.js";
3
+ import { $ as XIcon, G as SpinnerIcon, f as ChevronRightIcon, l as CheckIcon } from "../icons-CQJ-aMnI.js";
4
4
  import { Badge } from "./Badge.js";
5
5
  import * as React from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -45,6 +45,7 @@ const TestResultsContext = React.createContext({});
45
45
  function TestResults({ className, summary, children, ref, ...props }) {
46
46
  const overall = summary && summary.failed > 0 ? "failed" : "passed";
47
47
  const contextValue = React.useMemo(() => ({ summary }), [summary]);
48
+ const isComposable = hasComposableTestResultsChildren(children);
48
49
  return /* @__PURE__ */ jsx(TestResultsContext.Provider, {
49
50
  value: contextValue,
50
51
  children: /* @__PURE__ */ jsx("div", {
@@ -52,7 +53,8 @@ function TestResults({ className, summary, children, ref, ...props }) {
52
53
  className: cx("test-results", className),
53
54
  "data-status": overall,
54
55
  ...props,
55
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TestResultsHeader, { children: [/* @__PURE__ */ jsx(TestResultsSummary, {}), /* @__PURE__ */ jsx(TestResultsProgress, {})] }), /* @__PURE__ */ jsx(TestResultsContent, {})] })
56
+ "data-recipe": "framed-panel",
57
+ children: isComposable ? children : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(TestResultsHeader, { children: [/* @__PURE__ */ jsx(TestResultsSummary, {}), /* @__PURE__ */ jsx(TestResultsProgress, {})] }), /* @__PURE__ */ jsx(TestResultsContent, { children })] })
56
58
  })
57
59
  });
58
60
  }
@@ -84,7 +86,6 @@ function TestResultsSummary({ className, children, ref, ...props }) {
84
86
  ...props,
85
87
  children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Badge, {
86
88
  color: STATUS_COLOR[overall],
87
- className: "test-results__overall",
88
89
  children: overall === "passed" ? "All tests passed" : `${summary.failed} failed`
89
90
  }), /* @__PURE__ */ jsxs("span", {
90
91
  className: "test-results__stats",
@@ -128,13 +129,14 @@ function TestResultsProgress({ className, children, ref, ...props }) {
128
129
  "aria-valuenow": summary.passed,
129
130
  "aria-valuetext": `${summary.passed}/${summary.total} tests passed, ${summary.failed} failed`,
130
131
  className: "test-results__progress-track",
132
+ "data-slot": "progress-track",
131
133
  role: "progressbar",
132
134
  children: [/* @__PURE__ */ jsx("div", {
133
135
  className: "test-results__progress-segment test-results__progress-segment--passed",
134
- style: { width: `${passedPercent}%` }
136
+ style: { inlineSize: `${passedPercent}%` }
135
137
  }), /* @__PURE__ */ jsx("div", {
136
138
  className: "test-results__progress-segment test-results__progress-segment--failed",
137
- style: { width: `${failedPercent}%` }
139
+ style: { inlineSize: `${failedPercent}%` }
138
140
  })]
139
141
  }), /* @__PURE__ */ jsxs("span", {
140
142
  className: "test-results__progress-label",
@@ -157,6 +159,9 @@ function TestResultsContent({ className, children, ref, ...props }) {
157
159
  children
158
160
  });
159
161
  }
162
+ function hasComposableTestResultsChildren(children) {
163
+ return React.Children.toArray(children).some((child) => React.isValidElement(child) && (child.type === TestResultsHeader || child.type === TestResultsSummary || child.type === TestResultsProgress || child.type === TestResultsContent));
164
+ }
160
165
  const TestSuiteContext = React.createContext({
161
166
  name: "",
162
167
  status: "passed"
@@ -1,4 +1,4 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
2
  import "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region src/components/Textarea.tsx
@@ -1,4 +1,4 @@
1
- import { A as MoonIcon, W as SunIcon, k as MonitorIcon } from "../icons-CpfUer49.js";
1
+ import { J as SunIcon, N as MonitorIcon, P as MoonIcon } from "../icons-CQJ-aMnI.js";
2
2
  import { Radio, RadioGroup } from "./RadioGroup.js";
3
3
  import { useTheme } from "./ThemeProvider.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,24 +1,34 @@
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-ClxViuUM.js";
3
+ import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../AgentToolRunsContext-BVe4stgw.js";
4
+ import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
5
+ import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-D1xOrNrq.js";
6
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Bzot45kX.js";
7
+ import { n as ThinkChatValue } from "../ThinkChatContext-DrsZqdaO.js";
8
+ import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-DFIcG9UX.js";
2
9
  import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-BV5qgFgI.js";
3
10
  import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-xWvRjRAC.js";
4
- import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
5
- import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-BPmu9a-c.js";
6
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-BFQnb2ct.js";
7
- import { n as ThinkChatValue } from "../ThinkChatContext-C3Eb1Xpi.js";
8
- import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-DOZkPwzu.js";
9
- import { a as useWorkspace, i as WorkspaceState, n as WorkspaceInfo, r as WorkspaceSource, t as UseWorkspaceOptions } from "../Workspace-D39LxGvP.js";
10
- import { WorkspaceExplorer, WorkspaceExplorerProps } from "./WorkspaceExplorer.js";
11
+ import { d as inferWorkspaceLanguage, i as WorkspaceFileState } from "../WorkspaceFile-CzyHnESE.js";
12
+ import { a as WorkspaceSource, c as workspaceBinaryFileQueryOptions, d as workspaceFileStatQueryOptions, f as workspaceInfoQueryOptions, i as WorkspaceQueryKey, l as workspaceDirectoryQueryOptions, m as workspaceTextFileQueryOptions, n as WorkspaceFileReadTarget, o as WorkspaceState, p as workspaceQueryKey, r as WorkspaceInfo, s as useWorkspace, t as UseWorkspaceOptions, u as workspaceFileAssetQueryOptions } from "../Workspace-Jez8ffUj.js";
13
+ import { n as WorkspaceExplorerProps, t as WorkspaceExplorer } from "../WorkspaceExplorer-B9dQWNVK.js";
11
14
  import * as React from "react";
12
15
  import { UIMessage } from "ai";
13
16
  import { UseAgentOptions } from "agents/react";
17
+ import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
14
18
  import { PendingApproval, Think } from "@cloudflare/think";
15
19
  import { AgentStub } from "agents/client";
16
20
  import { UseVoiceInputReturn } from "@cloudflare/voice/react";
17
21
 
18
22
  //#region src/components/ThinkChat.d.ts
23
+ type ThinkPendingExecutionApprovalsQueryKey = readonly ["think", sourceKey: string, "pending-approvals"];
24
+ type ThinkPendingExecutionApprovalsQueryOptions = UndefinedInitialDataOptions<readonly PendingApproval[], Error, readonly PendingApproval[], ThinkPendingExecutionApprovalsQueryKey> & {
25
+ queryKey: DataTag<ThinkPendingExecutionApprovalsQueryKey, readonly PendingApproval[], Error>;
26
+ };
19
27
  interface ThinkChatProviderProps<State = unknown, MessageT extends UIMessage = UIMessage> {
20
28
  /** The `useAgentChat` value from `@cloudflare/think/react` that descendants read. */
21
29
  chat: ThinkChatValue<State, MessageT>;
30
+ /** Optional whole `useAgentToolEvents` result when the app owns the parent connection. */
31
+ agentTools?: AgentToolEventsValue<MessageT["parts"][number]>;
22
32
  children: React.ReactNode;
23
33
  }
24
34
  interface ThinkChatRootProps<State = unknown> {
@@ -26,9 +36,14 @@ interface ThinkChatRootProps<State = unknown> {
26
36
  agent: string | UseAgentOptions<State>;
27
37
  /** Instance name (e.g. a session or room id). Wins over `agent.name`. */
28
38
  name?: string;
39
+ /**
40
+ * Stable, non-secret identity for the remote Think agent. Include endpoint,
41
+ * account or tenant scope, and agent path so sources cannot share cached data.
42
+ */
43
+ sourceKey: string;
29
44
  children: React.ReactNode;
30
45
  }
31
- interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends ThinkChatActivityRendererOptions {
46
+ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends ThinkChatActivityRendererOptions<MessageT> {
32
47
  className?: string;
33
48
  /** Disable the composer (e.g. while the agent is unreachable). */
34
49
  disabled?: boolean;
@@ -38,12 +53,6 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
38
53
  emptyState?: React.ReactNode;
39
54
  /** Extra controls rendered inside the composer, next to the send button. */
40
55
  composerTools?: React.ReactNode;
41
- /** Keep submitting composed follow-ups through `chat.sendMessage()` while busy. */
42
- allowSubmitWhileBusy?: AgentChatProps<MessageT>["allowSubmitWhileBusy"];
43
- /** Authoritative queued messages rendered outside the transcript. */
44
- queuedMessages?: AgentChatProps<MessageT>["queuedMessages"];
45
- onSteerQueuedMessage?: AgentChatProps<MessageT>["onSteerQueuedMessage"];
46
- onRemoveQueuedMessage?: AgentChatProps<MessageT>["onRemoveQueuedMessage"];
47
56
  /** Host-owned slash-command catalog and selection policy. */
48
57
  slashCommands?: AgentChatProps<MessageT>["slashCommands"];
49
58
  /** Controlled MCP catalog revealed by `@`; selections become composer references. */
@@ -95,7 +104,9 @@ interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends
95
104
  */
96
105
  contextWindow?: AgentChatProps<MessageT>["contextWindow"];
97
106
  }
98
- declare function useThinkPendingApprovals(stub: AgentStub<Think>, refreshKey: unknown): {
107
+ /** Shared pending-approval options for components and TanStack Router loaders. */
108
+ declare function thinkPendingExecutionApprovalsQueryOptions(stub: AgentStub<Think>, sourceKey: string): ThinkPendingExecutionApprovalsQueryOptions;
109
+ declare function useThinkPendingExecutionApprovals(stub: AgentStub<Think>, sourceKey: string, refreshSignal?: unknown): {
99
110
  pendingApprovals: readonly PendingApproval[];
100
111
  refreshPendingApprovals: () => Promise<void>;
101
112
  };
@@ -105,24 +116,33 @@ declare function useThinkPendingApprovals(stub: AgentStub<Think>, refreshKey: un
105
116
  * stream with agent work folded into collapsed Activity blocks.
106
117
  */
107
118
  declare function ThinkChatProvider<State = unknown, MessageT extends UIMessage = UIMessage>({
119
+ agentTools,
108
120
  chat,
109
121
  children
110
122
  }: ThinkChatProviderProps<State, MessageT>): React.JSX.Element;
111
123
  /**
112
124
  * Batteries-included root: connects to the named Think agent (upstream's
113
125
  * `useAgent` + `useAgentChat`) and provides the live chat to everything
114
- * inside. If the app already owns the chat hook, use `ThinkChat.Provider`.
126
+ * inside. Render it beneath the app's `QueryClientProvider`. If the app
127
+ * already owns the chat hook, use `ThinkChat.Provider`.
115
128
  *
116
129
  * @example
117
130
  * ```tsx
118
- * <ThinkChat.Root agent="my-agent" name="session-1">
119
- * <ThinkChat.Messages />
120
- * </ThinkChat.Root>
131
+ * <QueryClientProvider client={queryClient}>
132
+ * <ThinkChat.Root
133
+ * agent="my-agent"
134
+ * name="session-1"
135
+ * sourceKey="api.example.com:account:acme:agent:session-1"
136
+ * >
137
+ * <ThinkChat.Messages />
138
+ * </ThinkChat.Root>
139
+ * </QueryClientProvider>
121
140
  * ```
122
141
  */
123
142
  declare function ThinkChatRoot<State = unknown, MessageT extends UIMessage = UIMessage>({
124
143
  agent: agentOption,
125
144
  name,
145
+ sourceKey,
126
146
  children
127
147
  }: ThinkChatRootProps<State>): React.JSX.Element;
128
148
  /**
@@ -136,8 +156,10 @@ declare function ThinkChatRoot<State = unknown, MessageT extends UIMessage = UIM
136
156
  * card) — see README "App-specific tools" and the Custom Tool Panel story.
137
157
  */
138
158
  declare function ThinkChatMessages<State = unknown, MessageT extends UIMessage = UIMessage>({
159
+ composerHeader,
139
160
  renderPart,
140
161
  excludeTools,
162
+ renderAgentToolRunLink,
141
163
  toolRenderers,
142
164
  thinkStub,
143
165
  onExecutionSettled,
@@ -180,8 +202,9 @@ declare const ThinkChat: {
180
202
  Root: typeof ThinkChatRoot;
181
203
  Messages: typeof ThinkChatMessages;
182
204
  Activity: typeof ThinkChatActivity;
183
- renderActivityPart: (context: AgentChatRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
205
+ RecoveryNotice: typeof ThinkRecoveryNotice;
206
+ renderActivityPart: (context: AgentMessageRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
184
207
  createActivityRenderer: typeof createThinkChatActivityRenderer;
185
208
  };
186
209
  //#endregion
187
- export { BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useThinkPendingApprovals, useWorkspace };
210
+ export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -1,10 +1,12 @@
1
1
  import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
2
+ import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
2
3
  import { BrowserLiveView } from "./BrowserLiveView.js";
3
- import { BrowserReplay } from "./BrowserReplay.js";
4
+ import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
4
5
  import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
5
6
  import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
6
- import { a as useThinkChat, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkPendingApprovals, r as ThinkChatProvider, t as ThinkChat } from "../ThinkChat-CzC-zNGA.js";
7
- import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
8
- import { useWorkspace } from "./Workspace.js";
7
+ import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
8
+ import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-15EhfvYJ.js";
9
+ import { BrowserReplay } from "./BrowserReplay.js";
10
+ import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
9
11
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
10
- export { BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useThinkPendingApprovals, useWorkspace };
12
+ export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryOptions, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
@@ -1,4 +1,4 @@
1
1
  import { S as isThinkChatActivityPart } from "../ThinkChatToolParts-CSzVwMXf.js";
2
- import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-BPmu9a-c.js";
3
- import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-BFQnb2ct.js";
2
+ import { l as describeThinkChatActivityPart } from "../ThinkChatActivitySummary-D1xOrNrq.js";
3
+ import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-Bzot45kX.js";
4
4
  export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
@@ -1,11 +1,13 @@
1
1
  import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "./Activity.js";
2
2
  import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
3
3
  import { isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartWorking, isSessionContextToolPart, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
4
+ import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
5
+ import { SubagentRunList } from "./SubagentRunList.js";
4
6
  import { useOptionalThinkChatContext } from "./ThinkChatContext.js";
5
7
  import { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSessionContextPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel } from "./ThinkChatToolPanels.js";
6
8
  import { activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
7
- import "react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
+ import * as React from "react";
10
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
11
  import { getToolName, isReasoningUIPart, isToolUIPart } from "ai";
10
12
  //#region src/components/ThinkChatActivity.tsx
11
13
  function activityPartIcon(part) {
@@ -103,14 +105,28 @@ function ThinkChatActivityStep({ text, part, toolRenderers }) {
103
105
  children: text
104
106
  });
105
107
  }
106
- function ThinkChatActivityGroup({ message, parts, isTrailing, toolRenderers }) {
108
+ function ThinkChatActivityGroup({ message, parts, renderAgentToolRunLink, isTrailing, toolRenderers }) {
107
109
  const chat = useOptionalThinkChatContext();
108
110
  const chatStillWorking = isTrailing && Boolean(chat?.isStreaming) && chat?.messages.at(-1)?.id === message.id;
109
- return /* @__PURE__ */ jsx(ThinkChatActivity, {
111
+ const agentTools = useOptionalAgentToolRuns();
112
+ const runs = React.useMemo(() => {
113
+ if (!agentTools || !renderAgentToolRunLink) return [];
114
+ return parts.flatMap((part) => isToolUIPart(part) ? agentTools.getRunsForToolCall(part.toolCallId) : []);
115
+ }, [
116
+ agentTools,
117
+ parts,
118
+ renderAgentToolRunLink
119
+ ]);
120
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ThinkChatActivity, {
110
121
  parts,
111
122
  isStreaming: parts.some(isPartWorking) || chatStillWorking,
112
123
  toolRenderers
113
- });
124
+ }), runs.length && renderAgentToolRunLink ? /* @__PURE__ */ jsx(SubagentRunList, {
125
+ className: "subagent-run__list--adjacent",
126
+ "aria-label": "Delegated agent runs",
127
+ runs,
128
+ renderRunLink: renderAgentToolRunLink
129
+ }) : null] });
114
130
  }
115
131
  /**
116
132
  * Builds a renderPart handler that folds every run of consecutive activity
@@ -119,7 +135,7 @@ function ThinkChatActivityGroup({ message, parts, isTrailing, toolRenderers }) {
119
135
  * state. Excluded tools split the run and return undefined so your own
120
136
  * renderPart (or AgentChat's generic activity row) takes over for them.
121
137
  */
122
- function createThinkChatActivityRenderer({ excludeTools, toolRenderers } = {}) {
138
+ function createThinkChatActivityRenderer({ excludeTools, renderAgentToolRunLink, toolRenderers } = {}) {
123
139
  const excluded = excludeTools?.length ? new Set(excludeTools) : void 0;
124
140
  const isActivity = (part) => isThinkChatActivityPart(part, excluded);
125
141
  return (context) => {
@@ -134,7 +150,8 @@ function createThinkChatActivityRenderer({ excludeTools, toolRenderers } = {}) {
134
150
  message,
135
151
  parts: message.parts.slice(start, end + 1),
136
152
  isTrailing: end === message.parts.length - 1,
137
- toolRenderers
153
+ toolRenderers,
154
+ renderAgentToolRunLink
138
155
  });
139
156
  };
140
157
  }
@@ -1,2 +1,2 @@
1
- import { a as activityPartIconKind, c as deriveThinkChatToolLifecycleHeader, i as ThinkChatToolLifecycleSnapshot, l as describeThinkChatActivityPart, n as ThinkChatToolDescriber, o as activityPartUrl, r as ThinkChatToolDescribers, s as deriveThinkChatActivityHeader, t as ThinkChatActivityHeader, u as summarizeActivitySteps } from "../ThinkChatActivitySummary-BPmu9a-c.js";
1
+ import { a as activityPartIconKind, c as deriveThinkChatToolLifecycleHeader, i as ThinkChatToolLifecycleSnapshot, l as describeThinkChatActivityPart, n as ThinkChatToolDescriber, o as activityPartUrl, r as ThinkChatToolDescribers, s as deriveThinkChatActivityHeader, t as ThinkChatActivityHeader, u as summarizeActivitySteps } from "../ThinkChatActivitySummary-D1xOrNrq.js";
2
2
  export { ThinkChatActivityHeader, ThinkChatToolDescriber, ThinkChatToolDescribers, ThinkChatToolLifecycleSnapshot, activityPartIconKind, activityPartUrl, deriveThinkChatActivityHeader, deriveThinkChatToolLifecycleHeader, describeThinkChatActivityPart, summarizeActivitySteps };
@@ -1,5 +1,5 @@
1
1
  import { displayUrl, getToolDisplayName, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
2
- import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
2
+ import { t as summarizeToolInput } from "../summarize-tool-input-CqTcGRYy.js";
3
3
  import { getToolName, isReasoningUIPart, isToolUIPart } from "ai";
4
4
  //#region src/components/ThinkChatActivitySummary.ts
5
5
  const ACTIVITY_HEADER_LABEL_MAX_LENGTH = 240;
@@ -310,6 +310,7 @@ function summarizeActivitySteps(parts) {
310
310
  if (browses > 0) segments.push("used the browser");
311
311
  if (codeRuns > 0) segments.push("ran code");
312
312
  if (commands > 0) segments.push(commands === 1 ? "ran a command" : `ran ${commands} commands`);
313
+ const includedSegments = new Set(segments);
313
314
  for (const segment of [
314
315
  "edited files",
315
316
  "searched code",
@@ -318,8 +319,11 @@ function summarizeActivitySteps(parts) {
318
319
  "ran a command",
319
320
  "read files",
320
321
  "used a tool"
321
- ]) if (genericSegments.has(segment)) segments.push(segment);
322
- for (const segment of genericSegments) if (!segments.includes(segment)) segments.push(segment);
322
+ ]) if (genericSegments.has(segment)) {
323
+ segments.push(segment);
324
+ includedSegments.add(segment);
325
+ }
326
+ for (const segment of genericSegments) if (!includedSegments.has(segment)) segments.push(segment);
323
327
  if (segments.length === 0) return "Worked";
324
328
  const top = segments.slice(0, 3);
325
329
  const joined = top.length === 1 ? top[0] : `${top.slice(0, -1).join(", ")} and ${top.at(-1)}`;
@@ -1,2 +1,2 @@
1
- import { i as useThinkChatContext, n as ThinkChatValue, r as useOptionalThinkChatContext, t as ThinkChatContext } from "../ThinkChatContext-C3Eb1Xpi.js";
1
+ import { i as useThinkChatContext, n as ThinkChatValue, r as useOptionalThinkChatContext, t as ThinkChatContext } from "../ThinkChatContext-DrsZqdaO.js";
2
2
  export { ThinkChatContext, ThinkChatValue, useOptionalThinkChatContext, useThinkChatContext };
@@ -1,8 +1,9 @@
1
1
  import { ActivityOutput, ActivityPanel } from "./Activity.js";
2
- import { Tabs } from "./Tabs.js";
3
2
  import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
4
- import { t as CodeBlock } from "../CodeBlock-BmB4Xaqq.js";
3
+ import { Tabs } from "./Tabs.js";
4
+ import { t as CodeBlock } from "../CodeBlock-Bfp5PAg3.js";
5
5
  import { BrowserLiveView } from "./BrowserLiveView.js";
6
+ import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
6
7
  import * as React from "react";
7
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
9
  import { getToolName } from "ai";
@@ -15,11 +16,6 @@ function renderDeniedPanel(label, reason) {
15
16
  error: true
16
17
  });
17
18
  }
18
- function numberLines(content, from = 1) {
19
- const lines = content.split("\n");
20
- const width = String(from + lines.length - 1).length;
21
- return lines.map((line, i) => `${String(from + i).padStart(width)} ${line}`).join("\n");
22
- }
23
19
  function prefixLines(text, prefix) {
24
20
  return text.split("\n").map((line) => `${prefix}${line}`).join("\n");
25
21
  }
@@ -58,11 +54,19 @@ function ThinkChatWorkspacePanel({ part }) {
58
54
  return /* @__PURE__ */ jsx(ActivityPanel, { label });
59
55
  }
60
56
  case "tool-write": {
57
+ const path = part.input?.path ?? "file";
58
+ const content = part.input?.content;
61
59
  const output = part.state === "output-available" ? part.output : void 0;
62
60
  return /* @__PURE__ */ jsx(ActivityPanel, {
63
- label: part.input?.path ?? "file",
64
- text: part.input?.content ? numberLines(part.input.content) : void 0,
65
- status: output ? `${output.lines} lines written` : void 0
61
+ label: path,
62
+ status: output ? `${output.lines} lines written` : void 0,
63
+ children: content !== void 0 ? /* @__PURE__ */ jsx(CodeBlock, {
64
+ className: "activity__code-block",
65
+ code: content,
66
+ isStreaming: part.state === "input-streaming",
67
+ language: inferWorkspaceLanguage(path),
68
+ showLineNumbers: true
69
+ }) : null
66
70
  });
67
71
  }
68
72
  case "tool-edit": {
@@ -402,19 +406,25 @@ function ThinkChatBrowserPanel({ part }) {
402
406
  children: [
403
407
  /* @__PURE__ */ jsxs(Tabs.List, {
404
408
  variant: "line",
405
- children: [/* @__PURE__ */ jsx(Tabs.Tab, {
406
- value: "browser",
407
- children: "Preview"
408
- }), /* @__PURE__ */ jsx(Tabs.Tab, {
409
- value: "code",
410
- children: "Code"
411
- })]
409
+ children: [
410
+ /* @__PURE__ */ jsx(Tabs.Tab, {
411
+ value: "browser",
412
+ children: "Preview"
413
+ }),
414
+ /* @__PURE__ */ jsx(Tabs.Tab, {
415
+ value: "code",
416
+ children: "Code"
417
+ }),
418
+ /* @__PURE__ */ jsx(Tabs.Indicator, {})
419
+ ]
412
420
  }),
413
421
  /* @__PURE__ */ jsx(Tabs.Panel, {
422
+ className: "activity__browser-panel",
414
423
  value: "browser",
415
424
  children: browserView
416
425
  }),
417
426
  /* @__PURE__ */ jsx(Tabs.Panel, {
427
+ className: "activity__browser-panel",
418
428
  value: "code",
419
429
  children: codeView
420
430
  })
@@ -1,5 +1,5 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { G as TerminalIcon, L as RefreshIcon, S as InfoIcon, Y as XIcon, o as CheckIcon, t as ArrowDownIcon, v as FileIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { $ as XIcon, E as InfoIcon, H as RefreshIcon, Y as TerminalIcon, l as CheckIcon, n as ArrowDownIcon, x as FileIcon } from "../icons-CQJ-aMnI.js";
3
3
  import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "./Activity.js";
4
4
  import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
5
5
  import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
@@ -1,5 +1,5 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { B as SpinnerIcon, M as PauseIcon, S as InfoIcon, Y as XIcon, o as CheckIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { $ as XIcon, E as InfoIcon, G as SpinnerIcon, L as PauseIcon, l as CheckIcon } from "../icons-CQJ-aMnI.js";
3
3
  import { Tooltip } from "./Tooltip.js";
4
4
  import { formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone } from "./ThinkExecutionRun.js";
5
5
  import "react";
@@ -1,20 +1,41 @@
1
1
  import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
2
2
  import * as React from "react";
3
- import { Think } from "@cloudflare/think";
3
+ import { DataTag, UndefinedInitialDataOptions } from "@tanstack/react-query";
4
+ import { Think, ThinkSubmissionInspection } from "@cloudflare/think";
4
5
  import { AgentStub } from "agents/client";
6
+ import { WorkflowPage } from "agents/workflows";
5
7
 
6
8
  //#region src/components/ThinkExecutionWorkbench.d.ts
7
9
  interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
8
10
  /** Agents SDK client stub for a Think agent; this UI calls native submission/workflow methods. */
9
11
  source: AgentStub<Think>;
12
+ /**
13
+ * Stable, serializable identity for the remote Think agent. It must change
14
+ * when `source` points at a different agent and must not contain credentials.
15
+ */
16
+ sourceKey: string;
10
17
  title?: React.ReactNode;
11
18
  backButton?: React.ReactNode;
12
19
  pageSize?: number;
13
- /** Whole native execution selected by a parent-owned route or product record. */
14
- selectedRun?: ThinkExecutionRun | null;
15
- /** Receives the fully inspected native execution after a user selects a row. */
16
- onSelectedRunChange?: (run: ThinkExecutionRun) => void;
20
+ /** Whole native execution selected by the application route. */
21
+ selectedRun: ThinkExecutionRun | null;
22
+ /** Returns an application-authored TanStack Router Link for the run. */
23
+ renderRunLink: (run: ThinkExecutionRun) => React.ReactElement;
17
24
  }
25
+ interface ThinkExecutionRunsData {
26
+ submissions: readonly ThinkSubmissionInspection[];
27
+ workflows: WorkflowPage;
28
+ }
29
+ type ThinkExecutionRunsQueryKey = readonly ["think", sourceKey: string, "execution-runs", {
30
+ readonly limit: number;
31
+ }];
32
+ type ThinkExecutionRunsQueryOptions = UndefinedInitialDataOptions<ThinkExecutionRunsData, Error, ThinkExecutionRunsData, ThinkExecutionRunsQueryKey> & {
33
+ queryKey: DataTag<ThinkExecutionRunsQueryKey, ThinkExecutionRunsData, Error>;
34
+ };
35
+ /**
36
+ * Shared list options for component reads and TanStack Router loaders.
37
+ */
38
+ declare function thinkExecutionRunsQueryOptions(source: AgentStub<Think>, sourceKey: string, pageSize?: number): ThinkExecutionRunsQueryOptions;
18
39
  /**
19
40
  * Unified execution history for native Think submissions and Agents workflows.
20
41
  * The workbench reads and acts through the whole upstream agent stub; it does
@@ -23,15 +44,16 @@ interface ThinkExecutionWorkbenchProps extends Omit<React.HTMLAttributes<HTMLDiv
23
44
  declare function ThinkExecutionWorkbench({
24
45
  backButton,
25
46
  className,
26
- onSelectedRunChange,
27
47
  pageSize,
28
48
  ref,
29
- selectedRun: controlledSelectedRun,
49
+ renderRunLink,
50
+ selectedRun,
30
51
  source,
52
+ sourceKey,
31
53
  title,
32
54
  ...props
33
55
  }: ThinkExecutionWorkbenchProps & {
34
56
  ref?: React.Ref<HTMLDivElement>;
35
57
  }): React.JSX.Element;
36
58
  //#endregion
37
- export { ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps };
59
+ export { ThinkExecutionRunsData, ThinkExecutionRunsQueryKey, ThinkExecutionRunsQueryOptions, ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps, thinkExecutionRunsQueryOptions };