@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,6 +1,7 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { L as RefreshIcon, h as EllipsisIcon } from "../icons-CpfUer49.js";
3
- import { Button } from "./Button.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { H as RefreshIcon, v as EllipsisIcon } from "../icons-CQJ-aMnI.js";
3
+ import { t as NavigationLink } from "../navigation-link-Cob7KBlM.js";
4
+ import { Button, buttonVariants } from "./Button.js";
4
5
  import { Tooltip } from "./Tooltip.js";
5
6
  import { Menu } from "./Menu.js";
6
7
  import { AppTopBar } from "./AppTopBar.js";
@@ -9,6 +10,7 @@ import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
9
10
  import { ThinkExecutionDetail } from "./ThinkExecutionDetail.js";
10
11
  import * as React from "react";
11
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
+ import { queryOptions, useMutation, useQuery } from "@tanstack/react-query";
12
14
  //#region src/components/ThinkExecutionWorkbench.tsx
13
15
  const executionPanelPageSize = 20;
14
16
  function getErrorMessage(error) {
@@ -17,6 +19,13 @@ function getErrorMessage(error) {
17
19
  function isSubmissionCancelable(status) {
18
20
  return status === "pending" || status === "running";
19
21
  }
22
+ function thinkExecutionRunsScopeQueryKey(sourceKey) {
23
+ return [
24
+ "think",
25
+ sourceKey,
26
+ "execution-runs"
27
+ ];
28
+ }
20
29
  function RunActions({ busy, onAction, run, source }) {
21
30
  const id = getThinkExecutionRunId(run);
22
31
  const statusTone = getThinkExecutionRunStatusTone(run);
@@ -28,7 +37,8 @@ function RunActions({ busy, onAction, run, source }) {
28
37
  type: "button",
29
38
  variant: "ghost",
30
39
  color: "neutral",
31
- size: "icon-xs",
40
+ size: "sm",
41
+ iconOnly: true,
32
42
  className: "think-execution-workbench__run-actions",
33
43
  "aria-label": `Actions for ${kind} ${id}`,
34
44
  disabled: busy,
@@ -91,129 +101,51 @@ function RunActions({ busy, onAction, run, source }) {
91
101
  }) })] });
92
102
  }
93
103
  /**
104
+ * Shared list options for component reads and TanStack Router loaders.
105
+ */
106
+ function thinkExecutionRunsQueryOptions(source, sourceKey, pageSize = executionPanelPageSize) {
107
+ return queryOptions({
108
+ queryKey: [...thinkExecutionRunsScopeQueryKey(sourceKey), { limit: pageSize }],
109
+ queryFn: async () => {
110
+ const [submissions, workflows] = await Promise.all([source.listSubmissions({ limit: pageSize }), source.getWorkflows({
111
+ limit: pageSize,
112
+ orderBy: "desc"
113
+ })]);
114
+ return {
115
+ submissions,
116
+ workflows
117
+ };
118
+ },
119
+ staleTime: 5e3
120
+ });
121
+ }
122
+ /**
94
123
  * Unified execution history for native Think submissions and Agents workflows.
95
124
  * The workbench reads and acts through the whole upstream agent stub; it does
96
125
  * not normalize execution records or own workflow authoring.
97
126
  */
98
- function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, pageSize = executionPanelPageSize, ref, selectedRun: controlledSelectedRun, source, title = "Execution", ...props }) {
127
+ function ThinkExecutionWorkbench({ backButton, className, pageSize = executionPanelPageSize, ref, renderRunLink, selectedRun, source, sourceKey, title = "Execution", ...props }) {
99
128
  const runsId = React.useId();
100
- const activeSourceRef = React.useRef(source);
101
- const sourceGenerationRef = React.useRef(0);
102
- const operationSequenceRef = React.useRef(0);
103
- const [busyAction, setBusyAction] = React.useState("refresh");
104
- const [error, setError] = React.useState(null);
105
- const [executionData, setExecutionData] = React.useState(null);
106
- const [selection, setSelection] = React.useState(null);
107
- const activeExecutionData = executionData?.source === source ? executionData : null;
108
- const innerSelectedRun = selection?.source === source ? selection.run : null;
109
- const selectedRun = controlledSelectedRun === void 0 ? innerSelectedRun : controlledSelectedRun;
110
- const runs = React.useMemo(() => [...activeExecutionData?.submissions ?? [], ...activeExecutionData?.workflows.workflows ?? []].sort((first, second) => Number(second.createdAt) - Number(first.createdAt)), [activeExecutionData]);
111
- const isCurrentOperation = React.useCallback((operation) => activeSourceRef.current === operation.source && sourceGenerationRef.current === operation.generation && operationSequenceRef.current === operation.sequence, []);
112
- const beginOperation = React.useCallback(() => {
113
- if (activeSourceRef.current !== source) return null;
114
- return {
115
- generation: sourceGenerationRef.current,
116
- sequence: ++operationSequenceRef.current,
129
+ const runsOptions = thinkExecutionRunsQueryOptions(source, sourceKey, pageSize);
130
+ const runsQueryKey = thinkExecutionRunsScopeQueryKey(sourceKey);
131
+ const runsQuery = useQuery(runsOptions);
132
+ const actionMutation = useMutation({
133
+ mutationFn: ({ action }) => action(),
134
+ onSuccess: (_result, action, _onMutateResult, context) => context.client.invalidateQueries({ queryKey: action.runsQueryKey })
135
+ });
136
+ const currentAction = actionMutation.variables?.source === source ? actionMutation.variables : null;
137
+ const actionIsPending = currentAction !== null && actionMutation.isPending;
138
+ const busyAction = actionIsPending ? currentAction.key : runsQuery.isFetching ? "refresh" : null;
139
+ const error = currentAction && actionMutation.isError ? actionMutation.error : runsQuery.error;
140
+ const runs = React.useMemo(() => [...runsQuery.data?.submissions ?? [], ...runsQuery.data?.workflows.workflows ?? []].sort((first, second) => Number(second.createdAt) - Number(first.createdAt)), [runsQuery.data]);
141
+ const runAction = (key, action) => {
142
+ actionMutation.mutate({
143
+ action,
144
+ key,
145
+ runsQueryKey,
117
146
  source
118
- };
119
- }, [source]);
120
- const loadData = React.useCallback(async (operation) => {
121
- const [nextSubmissions, nextWorkflows] = await Promise.all([operation.source.listSubmissions({ limit: pageSize }), operation.source.getWorkflows({
122
- limit: pageSize,
123
- orderBy: "desc"
124
- })]);
125
- if (!isCurrentOperation(operation)) return;
126
- setExecutionData({
127
- source: operation.source,
128
- submissions: nextSubmissions,
129
- workflows: nextWorkflows
130
- });
131
- }, [isCurrentOperation, pageSize]);
132
- const refresh = React.useCallback(async () => {
133
- const operation = beginOperation();
134
- if (!operation) return;
135
- setBusyAction("refresh");
136
- setError(null);
137
- try {
138
- await loadData(operation);
139
- } catch (nextError) {
140
- if (!isCurrentOperation(operation)) return;
141
- setError(getErrorMessage(nextError));
142
- } finally {
143
- if (isCurrentOperation(operation)) setBusyAction(null);
144
- }
145
- }, [
146
- beginOperation,
147
- isCurrentOperation,
148
- loadData
149
- ]);
150
- const runAction = React.useCallback(async (key, action) => {
151
- const operation = beginOperation();
152
- if (!operation) return;
153
- setBusyAction(key);
154
- setError(null);
155
- try {
156
- await action(operation);
157
- if (!isCurrentOperation(operation)) return;
158
- await loadData(operation);
159
- } catch (nextError) {
160
- if (!isCurrentOperation(operation)) return;
161
- setError(getErrorMessage(nextError));
162
- } finally {
163
- if (isCurrentOperation(operation)) setBusyAction(null);
164
- }
165
- }, [
166
- beginOperation,
167
- isCurrentOperation,
168
- loadData
169
- ]);
170
- const selectRun = React.useCallback((run) => {
171
- const kind = isThinkSubmissionRun(run) ? "submission" : "workflow";
172
- runAction(`select-${kind}:${getThinkExecutionRunId(run)}`, async (operation) => {
173
- if (isThinkSubmissionRun(run)) {
174
- const inspection = await operation.source.inspectSubmission(run.submissionId);
175
- if (!isCurrentOperation(operation)) return;
176
- const selected = inspection ?? run;
177
- if (controlledSelectedRun === void 0) setSelection({
178
- source: operation.source,
179
- run: selected
180
- });
181
- onSelectedRunChange?.(selected);
182
- return;
183
- }
184
- const workflow = await operation.source.getWorkflow(run.workflowId);
185
- if (!isCurrentOperation(operation)) return;
186
- const selected = workflow ?? run;
187
- if (controlledSelectedRun === void 0) setSelection({
188
- source: operation.source,
189
- run: selected
190
- });
191
- onSelectedRunChange?.(selected);
192
147
  });
193
- }, [
194
- controlledSelectedRun,
195
- isCurrentOperation,
196
- onSelectedRunChange,
197
- runAction
198
- ]);
199
- React.useLayoutEffect(() => {
200
- activeSourceRef.current = source;
201
- sourceGenerationRef.current += 1;
202
- operationSequenceRef.current += 1;
203
- setExecutionData(null);
204
- setSelection(null);
205
- setBusyAction("refresh");
206
- setError(null);
207
- return () => {
208
- if (activeSourceRef.current === source) {
209
- sourceGenerationRef.current += 1;
210
- operationSequenceRef.current += 1;
211
- }
212
- };
213
- }, [source]);
214
- React.useEffect(() => {
215
- refresh();
216
- }, [refresh]);
148
+ };
217
149
  return /* @__PURE__ */ jsxs("div", {
218
150
  ref,
219
151
  className: cx("think-execution-workbench", className),
@@ -231,7 +163,10 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
231
163
  /* @__PURE__ */ jsx(AppTopBar.Trailing, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
232
164
  label: "Refresh runs",
233
165
  disabled: busyAction !== null,
234
- onClick: () => void refresh(),
166
+ onClick: () => {
167
+ actionMutation.reset();
168
+ runsQuery.refetch();
169
+ },
235
170
  children: /* @__PURE__ */ jsx(RefreshIcon, {})
236
171
  }) })
237
172
  ]
@@ -239,7 +174,7 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
239
174
  error ? /* @__PURE__ */ jsx("div", {
240
175
  className: "think-execution-workbench__error",
241
176
  role: "alert",
242
- children: error
177
+ children: getErrorMessage(error)
243
178
  }) : null,
244
179
  /* @__PURE__ */ jsxs("div", {
245
180
  className: "think-execution-workbench__content",
@@ -253,7 +188,7 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
253
188
  id: runsId,
254
189
  children: "Runs"
255
190
  })
256
- }), busyAction === "refresh" && runs.length === 0 ? /* @__PURE__ */ jsx("p", {
191
+ }), runsQuery.isPending && runs.length === 0 ? /* @__PURE__ */ jsx("p", {
257
192
  className: "think-execution-workbench__empty",
258
193
  role: "status",
259
194
  children: "Loading runs..."
@@ -269,16 +204,17 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
269
204
  const selected = isSameThinkExecutionRun(selectedRun, run);
270
205
  return /* @__PURE__ */ jsxs("li", {
271
206
  "data-selected": selected || void 0,
272
- children: [/* @__PURE__ */ jsxs(Button, {
273
- type: "button",
274
- variant: "ghost",
275
- color: "neutral",
276
- size: "sm",
277
- className: "think-execution-workbench__run",
207
+ children: [/* @__PURE__ */ jsxs(NavigationLink, {
208
+ render: renderRunLink(run),
209
+ "data-slot": "button",
210
+ className: buttonVariants({
211
+ variant: "ghost",
212
+ color: "neutral",
213
+ size: "sm",
214
+ className: "think-execution-workbench__run"
215
+ }),
278
216
  "aria-label": getThinkExecutionRunAccessibleName(run),
279
217
  "aria-current": selected ? "page" : void 0,
280
- disabled: busyAction !== null,
281
- onClick: () => selectRun(run),
282
218
  children: [/* @__PURE__ */ jsx(ThinkExecutionStatus, {
283
219
  run,
284
220
  className: "think-execution-workbench__icon"
@@ -296,10 +232,10 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
296
232
  })]
297
233
  })]
298
234
  }), /* @__PURE__ */ jsx(RunActions, {
299
- busy: busyAction !== null,
235
+ busy: actionIsPending,
300
236
  run,
301
237
  source,
302
- onAction: (key, action) => void runAction(key, () => action())
238
+ onAction: runAction
303
239
  })]
304
240
  }, `${kind}:${id}`);
305
241
  })
@@ -314,4 +250,4 @@ function ThinkExecutionWorkbench({ backButton, className, onSelectedRunChange, p
314
250
  });
315
251
  }
316
252
  //#endregion
317
- export { ThinkExecutionWorkbench };
253
+ export { ThinkExecutionWorkbench, thinkExecutionRunsQueryOptions };
@@ -1,27 +1,29 @@
1
- import { l as WorkspaceNavigationAdapter } from "../WorkspaceLink-DK1DWMHe.js";
2
- import { r as WorkspaceFileAssetResolver } from "../WorkspaceFile-DOZkPwzu.js";
3
- import { r as WorkspaceSource } from "../Workspace-D39LxGvP.js";
1
+ import { l as WorkspaceNavigationAdapter } from "../WorkspaceLink-O-EBKUJ8.js";
2
+ import { r as WorkspaceFileAssetResolver } from "../WorkspaceFile-CzyHnESE.js";
3
+ import { a as WorkspaceSource } from "../Workspace-Jez8ffUj.js";
4
4
  import { ThinkChatMessagesProps } from "./ThinkChat.js";
5
+ import { t as ThinkAgent } from "../think-agent-Cip5KAPj.js";
5
6
  import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
7
+ import { ThinkExecutionWorkbenchProps } from "./ThinkExecutionWorkbench.js";
6
8
  import { ThinkFullAppView } from "./ThinkFullAppViewSwitch.js";
7
9
  import { ThinkThreadStatusSummary } from "./ThinkThreadPicker.js";
8
10
  import { ThinkThreadShell } from "./ThinkThreadShell.js";
9
11
  import * as React from "react";
10
- import { useAgentChat } from "@cloudflare/think/react";
11
12
  import { UIMessage } from "ai";
13
+ import { useAgentChat } from "@cloudflare/think/react";
12
14
  import { useAgent } from "agents/react";
13
- import { Think } from "@cloudflare/think";
14
15
 
15
- //#region src/components/_internal/think-agent.d.ts
16
- /** Shared complete Think specialization for stateful React agent hooks. */
17
- type ThinkAgent<State = unknown> = Think<object, State>;
18
- //#endregion
19
16
  //#region src/components/ThinkFullApp.d.ts
20
17
  type ThinkFullAppMobileView = "chat" | "workbench";
21
18
  type ThinkFullAppAgent<State = unknown> = ThinkAgent<State>;
22
19
  type ThinkFullAppWorkbenchView = "files" | "execution" | (string & {});
23
20
  interface ThinkFullAppWorkspaceConfig {
24
21
  source: WorkspaceSource;
22
+ /**
23
+ * Stable, non-secret identity for this workspace backend. It is independent
24
+ * of the app's agent `sourceKey` when files come from a parent/shared source.
25
+ */
26
+ sourceKey: string;
25
27
  root?: string;
26
28
  navigation: WorkspaceNavigationAdapter;
27
29
  resolveFileAsset?: WorkspaceFileAssetResolver;
@@ -57,14 +59,29 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
57
59
  threadStatusSummary?: ThinkThreadStatusSummary;
58
60
  /** Whether to include the built-in Execution workbench. Defaults to true. */
59
61
  showExecutionWorkbench?: boolean;
60
- /** Whole native execution selected by a parent-owned record. */
61
- selectedExecutionRun?: ThinkExecutionRun | null;
62
- /** Receives the whole native execution selected in the workbench. */
63
- onSelectedExecutionRunChange?: (run: ThinkExecutionRun) => void;
62
+ /** Whether narrow layouts render the built-in chat/workbench switch. Defaults to true. */
63
+ showMobileViewSwitch?: boolean;
64
+ /** Hide the thread app bar when a narrow workbench supplies its own navigation. */
65
+ hideAppBarInWorkbench?: boolean;
66
+ /** Whole native execution selected by the application route. */
67
+ selectedExecutionRun: ThinkExecutionRun | null;
68
+ /**
69
+ * Stable, non-secret identity for the remote Think agent used by approvals
70
+ * and execution queries. Include endpoint, account or tenant scope, and
71
+ * agent path so two sources cannot share cached data. The optional workspace
72
+ * has its own source identity.
73
+ */
74
+ sourceKey: string;
75
+ /** Returns an application-authored TanStack Router Link for an execution. */
76
+ renderExecutionRunLink: ThinkExecutionWorkbenchProps["renderRunLink"];
64
77
  /** Message rendering labels and approval overrides for ThinkChat. */
65
78
  messages?: ThinkChatMessagesProps<MessageT>;
66
79
  /** Extra workbench panels appended after the built-in Files and Execution panels. */
67
80
  workbenchPanels?: readonly ThinkFullAppPanel<AgentT, State, MessageT>[];
81
+ /** Show retained Agent Tool runs from the parent connection. Defaults to true. */
82
+ showAgentTools?: boolean;
83
+ /** Returns an application-authored TanStack Router Link for a retained child run. */
84
+ renderAgentToolRunLink: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
68
85
  /**
69
86
  * Optional parent-owned thread picker/sidebar rendered beside the selected child app.
70
87
  * Use the render form to close the compact drawer after selecting a thread.
@@ -82,7 +99,10 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
82
99
  defaultMobileView?: ThinkFullAppMobileView;
83
100
  /** Called when narrow layouts switch between chat and the workbench. */
84
101
  onMobileViewChange?: (view: ThinkFullAppMobileView) => void;
85
- /** Selected workbench lane. Use this when the parent app stores the lane in route state. */
102
+ /**
103
+ * Selected workbench lane for controlled, ephemeral panel UI.
104
+ * Apps that make lanes durable should derive this value from validated route search state.
105
+ */
86
106
  workbenchView?: ThinkFullAppWorkbenchView;
87
107
  /** Initial workbench lane when `workbenchView` is uncontrolled. */
88
108
  defaultWorkbenchView?: ThinkFullAppWorkbenchView;
@@ -100,15 +120,20 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
100
120
  defaultMobileView,
101
121
  defaultWorkbenchView,
102
122
  defaultThreadSidebarOpen,
123
+ hideAppBarInWorkbench,
103
124
  messages,
104
125
  mobileView,
105
126
  onMobileViewChange,
106
- onSelectedExecutionRunChange,
107
127
  onThreadSidebarOpenChange,
108
128
  onWorkbenchViewChange,
109
129
  ref,
130
+ renderAgentToolRunLink,
131
+ renderExecutionRunLink,
110
132
  selectedExecutionRun,
133
+ showAgentTools,
111
134
  showExecutionWorkbench,
135
+ showMobileViewSwitch,
136
+ sourceKey,
112
137
  style,
113
138
  threadSidebar,
114
139
  threadSidebarOpen,