@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,42 +1,119 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { G as TerminalIcon, s as ChevronDownIcon, v as FileIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-BiMDVpUo.js";
2
+ import { Y as TerminalIcon, u as ChevronDownIcon, x as FileIcon } from "../icons-CQJ-aMnI.js";
3
3
  import { Button } from "./Button.js";
4
- import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-DIPbXrUM.js";
4
+ import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-BYYeTQLf.js";
5
5
  import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
6
6
  import { AppTopBar } from "./AppTopBar.js";
7
- import { ResizableSidePanel } from "./ResizableSidePanel.js";
8
- import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-CzC-zNGA.js";
7
+ import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../ThinkChat-15EhfvYJ.js";
9
8
  import { useWorkspace } from "./Workspace.js";
10
9
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
10
+ import { ResizableSidePanel } from "./ResizableSidePanel.js";
11
11
  import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
12
12
  import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
13
13
  import { ThinkThreadStatusIndicators } from "./ThinkThreadPicker.js";
14
14
  import { ThinkThreadShell } from "./ThinkThreadShell.js";
15
15
  import * as React from "react";
16
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ import { useAgentToolEvents } from "agents/react";
18
+ import { flushSync } from "react-dom";
19
+ //#region src/components/_internal/view-transitions.ts
20
+ let documentScopeSequence = 0;
21
+ let restoreActiveDocumentScope = null;
22
+ function motionIsReduced() {
23
+ if (typeof document === "undefined") return true;
24
+ if (document.documentElement.dataset.motion === "reduce") return true;
25
+ return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
26
+ }
27
+ function isReactTestEnvironment() {
28
+ return globalThis.IS_REACT_ACT_ENVIRONMENT;
29
+ }
30
+ function scopeDocumentTransition(scope) {
31
+ if (!(scope instanceof HTMLElement || scope instanceof SVGElement)) return null;
32
+ restoreActiveDocumentScope?.();
33
+ const rootStyle = document.documentElement.style;
34
+ const scopeStyle = scope.style;
35
+ const rootValue = rootStyle.getPropertyValue("view-transition-name");
36
+ const rootPriority = rootStyle.getPropertyPriority("view-transition-name");
37
+ const scopeValue = scopeStyle.getPropertyValue("view-transition-name");
38
+ const scopePriority = scopeStyle.getPropertyPriority("view-transition-name");
39
+ rootStyle.setProperty("view-transition-name", "none", "important");
40
+ scopeStyle.setProperty("view-transition-name", `sigvelo-transition-scope-${++documentScopeSequence}`, "important");
41
+ let active = true;
42
+ const restore = () => {
43
+ if (!active) return;
44
+ active = false;
45
+ if (rootValue) rootStyle.setProperty("view-transition-name", rootValue, rootPriority);
46
+ else rootStyle.removeProperty("view-transition-name");
47
+ if (scopeValue) scopeStyle.setProperty("view-transition-name", scopeValue, scopePriority);
48
+ else scopeStyle.removeProperty("view-transition-name");
49
+ if (restoreActiveDocumentScope === restore) restoreActiveDocumentScope = null;
50
+ };
51
+ restoreActiveDocumentScope = restore;
52
+ return restore;
53
+ }
54
+ /**
55
+ * Runs one synchronous React update inside the narrowest supported native view
56
+ * transition. Unsupported and reduced-motion environments commit immediately.
57
+ */
58
+ function runViewTransition({ scope, update }) {
59
+ let committed = false;
60
+ const commitOnce = () => {
61
+ if (committed) return;
62
+ committed = true;
63
+ flushSync(update);
64
+ };
65
+ if (typeof document === "undefined" || motionIsReduced() || isReactTestEnvironment()) {
66
+ commitOnce();
67
+ return null;
68
+ }
69
+ const scopedHost = scope;
70
+ const documentHost = document;
71
+ const useScopedHost = typeof scopedHost?.startViewTransition === "function";
72
+ const host = useScopedHost ? scopedHost : typeof documentHost.startViewTransition === "function" ? documentHost : null;
73
+ if (!host?.startViewTransition) {
74
+ commitOnce();
75
+ return null;
76
+ }
77
+ const restoreDocumentScope = useScopedHost ? null : scopeDocumentTransition(scope);
78
+ try {
79
+ const transition = host.startViewTransition(commitOnce);
80
+ if (restoreDocumentScope) transition.finished.finally(restoreDocumentScope).catch(() => void 0);
81
+ return transition;
82
+ } catch {
83
+ restoreDocumentScope?.();
84
+ commitOnce();
85
+ return null;
86
+ }
87
+ }
88
+ //#endregion
17
89
  //#region src/components/ThinkFullApp.tsx
18
90
  const workbenchPanelDefaultWidth = 340;
19
91
  const workbenchPanelMinWidth = 300;
20
92
  const workbenchPanelMaxWidth = 600;
21
93
  const workbenchPanelKeyboardStep = 24;
22
- function WorkspacePanel({ config, workbenchNavigation }) {
94
+ function WorkspacePanel({ config }) {
95
+ const selectedPath = config.navigation.current.destination.kind === "file" ? config.navigation.current.destination.path : null;
23
96
  return /* @__PURE__ */ jsx(WorkspaceExplorer, {
24
97
  className: "think-full-app__workbench",
25
98
  workspace: useWorkspace({
26
99
  source: config.source,
100
+ sourceKey: config.sourceKey,
27
101
  root: config.root,
102
+ selectedPath,
28
103
  resolveFileAsset: config.resolveFileAsset,
29
104
  maxInlineAssetBytes: config.maxInlineAssetBytes
30
105
  }),
31
106
  navigation: config.navigation,
32
- leading: workbenchNavigation || config.leading ? /* @__PURE__ */ jsxs(Fragment, { children: [workbenchNavigation, config.leading] }) : void 0,
107
+ leading: config.leading,
33
108
  actions: config.actions
34
109
  });
35
110
  }
36
111
  /** Combines ThinkChat with an optional resizable workbench shell. */
37
- function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, messages, mobileView, onMobileViewChange, onSelectedExecutionRunChange, onThreadSidebarOpenChange, onWorkbenchViewChange, ref, selectedExecutionRun, showExecutionWorkbench = true, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
112
+ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchViewChange, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun, showAgentTools = true, showExecutionWorkbench = true, showMobileViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
38
113
  const appRef = React.useRef(null);
39
- const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
114
+ const viewScopeRef = React.useRef(null);
115
+ const workbenchPanelRef = React.useRef(null);
116
+ const approvals = useThinkPendingExecutionApprovals(agent.stub, sourceKey, `${chat.messages.length}:${chat.status}`);
40
117
  const resolvedMessages = React.useMemo(() => {
41
118
  const approvalProps = resolveThinkApprovalProps({
42
119
  thinkStub: messages?.thinkStub,
@@ -59,6 +136,28 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
59
136
  ]);
60
137
  const [innerMobileView, setInnerMobileView] = React.useState(defaultMobileView ?? "chat");
61
138
  const [innerWorkbenchView, setInnerWorkbenchView] = React.useState(defaultWorkbenchView ?? "files");
139
+ const agentTools = useAgentToolEvents({ agent });
140
+ const agentIdentity = JSON.stringify(agent.path);
141
+ const requestedMobileView = mobileView ?? innerMobileView;
142
+ const requestedWorkbenchView = workbenchView ?? innerWorkbenchView;
143
+ const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
144
+ React.useEffect(() => {
145
+ resetAgentTools();
146
+ }, [agentIdentity]);
147
+ const setWorkbenchView = React.useCallback((next) => {
148
+ if (workbenchView === void 0) setInnerWorkbenchView(next);
149
+ onWorkbenchViewChange?.(next);
150
+ }, [onWorkbenchViewChange, workbenchView]);
151
+ const setMobileView = React.useCallback((next) => {
152
+ if (mobileView === void 0) setInnerMobileView(next);
153
+ onMobileViewChange?.(next);
154
+ }, [mobileView, onMobileViewChange]);
155
+ const updateAppView = React.useCallback((update) => {
156
+ return runViewTransition({
157
+ scope: viewScopeRef.current,
158
+ update
159
+ });
160
+ }, []);
62
161
  const panelContext = React.useMemo(() => ({
63
162
  agent,
64
163
  chat,
@@ -68,68 +167,53 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
68
167
  chat,
69
168
  workspace
70
169
  ]);
71
- const availableWorkbenchPanels = React.useMemo(() => {
72
- const builtInPanels = [];
73
- if (workspace !== void 0) builtInPanels.push({
74
- id: "files",
75
- label: "Files",
76
- icon: /* @__PURE__ */ jsx(FileIcon, {}),
77
- render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
78
- });
79
- if (showExecutionWorkbench) builtInPanels.push({
80
- id: "execution",
81
- label: "Execution",
82
- icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
83
- render: ({ agent }) => /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
84
- source: agent.stub,
85
- title: "Execution",
86
- selectedRun: selectedExecutionRun,
87
- onSelectedRunChange: onSelectedExecutionRunChange
88
- })
89
- });
90
- return workbenchPanels ? [...builtInPanels, ...workbenchPanels] : builtInPanels;
91
- }, [
92
- onSelectedExecutionRunChange,
93
- selectedExecutionRun,
94
- showExecutionWorkbench,
95
- workbenchPanels,
96
- workspace
97
- ]);
98
- const requestedMobileView = mobileView ?? innerMobileView;
99
- const requestedWorkbenchView = workbenchView ?? innerWorkbenchView;
170
+ const availableWorkbenchPanels = [];
171
+ if (workspace !== void 0) availableWorkbenchPanels.push({
172
+ id: "files",
173
+ label: "Files",
174
+ icon: /* @__PURE__ */ jsx(FileIcon, {}),
175
+ render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
176
+ });
177
+ if (showExecutionWorkbench) availableWorkbenchPanels.push({
178
+ id: "execution",
179
+ label: "Execution",
180
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
181
+ render: ({ agent }) => /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
182
+ source: agent.stub,
183
+ sourceKey,
184
+ title: "Execution",
185
+ selectedRun: selectedExecutionRun,
186
+ renderRunLink: renderExecutionRunLink
187
+ })
188
+ });
189
+ if (workbenchPanels) availableWorkbenchPanels.push(...workbenchPanels);
100
190
  const activePanel = availableWorkbenchPanels.find((panel) => panel.id === requestedWorkbenchView) ?? availableWorkbenchPanels[0];
101
191
  const activeWorkbenchView = activePanel?.id;
102
192
  const hasWorkbench = activePanel !== void 0;
103
193
  const activeMobileView = hasWorkbench ? requestedMobileView : "chat";
104
194
  const showWorkbenchViewSwitch = availableWorkbenchPanels.length > 1;
105
195
  const workbenchViews = availableWorkbenchPanels;
106
- const canEmbedWorkbenchNavigation = activeWorkbenchView === "files" || activeWorkbenchView === "execution";
107
- const hasApplicationChrome = Boolean(appBarActions || appBarLeading || appBarTitle || threadSidebar);
108
- const shouldRenderInlineAppBar = !threadSidebar && (hasApplicationChrome || hasWorkbench);
109
- const hasCompactAppBar = shouldRenderInlineAppBar && !hasApplicationChrome && canEmbedWorkbenchNavigation;
110
- const hasAppBarRow = shouldRenderInlineAppBar && !hasCompactAppBar;
111
- const setWorkbenchView = React.useCallback((next) => {
112
- if (workbenchView === void 0) setInnerWorkbenchView(next);
113
- onWorkbenchViewChange?.(next);
114
- }, [onWorkbenchViewChange, workbenchView]);
115
- const setMobileView = React.useCallback((next) => {
116
- if (mobileView === void 0) setInnerMobileView(next);
117
- onMobileViewChange?.(next);
118
- }, [mobileView, onMobileViewChange]);
119
- const workbenchNavigation = showWorkbenchViewSwitch ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
120
- className: "think-full-app__embedded-view-switch",
121
- views: workbenchViews,
122
- value: activeWorkbenchView,
123
- onValueChange: (next) => {
124
- if (next) setWorkbenchView(next);
125
- },
126
- "aria-label": "Workbench views"
127
- }) : null;
196
+ const shouldRenderInlineAppBar = !threadSidebar && (Boolean(appBarActions || appBarLeading || appBarTitle || threadSidebar) || hasWorkbench);
197
+ const hasAppBarRow = shouldRenderInlineAppBar;
198
+ const updateWorkbenchPanel = (next) => {
199
+ const activeElement = document.activeElement;
200
+ const restorePanelSwitchFocus = activeElement instanceof HTMLElement && workbenchPanelRef.current?.contains(activeElement);
201
+ const nextLabel = availableWorkbenchPanels.find((panel) => panel.id === next)?.label;
202
+ const restoreFocus = () => {
203
+ if (!restorePanelSwitchFocus || !nextLabel) return;
204
+ Array.from(workbenchPanelRef.current?.querySelectorAll("button") ?? []).find((button) => button.getAttribute("aria-label") === nextLabel)?.focus({ preventScroll: true });
205
+ };
206
+ const transition = runViewTransition({
207
+ scope: workbenchPanelRef.current,
208
+ update: () => setWorkbenchView(next)
209
+ });
210
+ if (transition) transition.updateCallbackDone.then(restoreFocus, restoreFocus);
211
+ else requestAnimationFrame(restoreFocus);
212
+ };
128
213
  const renderAppTopBar = (sidebarControls) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
129
214
  className: "think-full-app__app-bar",
130
215
  "aria-label": "Workbench controls",
131
216
  "data-mobile-view": activeMobileView,
132
- "data-compact-only": hasCompactAppBar ? "true" : void 0,
133
217
  children: [
134
218
  /* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarControls?.sidebarToggle, appBarLeading] }),
135
219
  appBarTitle || sidebarControls ? /* @__PURE__ */ jsxs(AppTopBar.Title, { children: [appBarTitle ? /* @__PURE__ */ jsx("span", {
@@ -141,6 +225,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
141
225
  color: "neutral",
142
226
  size: "sm",
143
227
  className: "think-full-app__thread-trigger",
228
+ "aria-label": "Threads",
144
229
  "aria-controls": sidebarControls.sidebarId,
145
230
  "aria-expanded": sidebarControls.sidebarOpen,
146
231
  onClick: (event) => sidebarControls.toggleSidebar(event.currentTarget),
@@ -155,27 +240,29 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
155
240
  }) : null] }) : null,
156
241
  /* @__PURE__ */ jsxs(AppTopBar.Trailing, { children: [
157
242
  appBarActions,
158
- showWorkbenchViewSwitch && activeWorkbenchView && !canEmbedWorkbenchNavigation ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
243
+ showWorkbenchViewSwitch && activeWorkbenchView ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
159
244
  className: "think-full-app__workbench-view-switch",
160
245
  views: workbenchViews,
161
246
  value: activeWorkbenchView,
162
247
  onValueChange: (next) => {
163
- if (next) setWorkbenchView(next);
248
+ if (next) updateWorkbenchPanel(next);
164
249
  },
165
250
  "aria-label": "Workbench views"
166
251
  }) : null,
167
- activePanel ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
252
+ activePanel && showMobileViewSwitch ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
168
253
  className: "think-full-app__mobile-view-switch",
169
254
  views: workbenchViews,
170
255
  value: activeMobileView === "workbench" ? activePanel.id : void 0,
171
256
  allowEmpty: true,
172
257
  onValueChange: (next) => {
173
- if (!next) {
174
- setMobileView("chat");
175
- return;
176
- }
177
- setWorkbenchView(next);
178
- setMobileView("workbench");
258
+ updateAppView(() => {
259
+ if (!next) {
260
+ setMobileView("chat");
261
+ return;
262
+ }
263
+ setWorkbenchView(next);
264
+ setMobileView("workbench");
265
+ });
179
266
  },
180
267
  "aria-label": "App views"
181
268
  }) : null
@@ -194,60 +281,48 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
194
281
  "data-has-thread-sidebar": threadSidebar ? "true" : "false",
195
282
  "data-has-workbench": hasWorkbench ? "true" : "false",
196
283
  "data-has-workbench-topbar": hasAppBarRow ? "true" : "false",
197
- "data-has-compact-app-bar": hasCompactAppBar ? "true" : "false",
198
284
  "data-mobile-view": activeMobileView,
199
285
  style,
200
286
  ...props,
201
287
  children: [
202
288
  shouldRenderInlineAppBar ? renderAppTopBar() : null,
203
- /* @__PURE__ */ jsx("section", {
204
- className: "think-full-app__chat-surface",
205
- "data-workspace-restoration-scope": "chat",
206
- "aria-label": "Chat",
207
- children: /* @__PURE__ */ jsx("div", {
208
- className: "think-full-app__chat",
209
- children: /* @__PURE__ */ jsxs("div", {
210
- className: "think-full-app__chat-inner",
211
- children: [/* @__PURE__ */ jsx(ThinkChat.Provider, {
212
- chat,
213
- children: /* @__PURE__ */ jsx(ThinkChat.Messages, { ...resolvedMessages })
214
- }), chat.error ? /* @__PURE__ */ jsxs("div", {
215
- className: "think-full-app__error",
216
- role: "alert",
217
- children: [chat.error.message, /* @__PURE__ */ jsx(Button, {
218
- type: "button",
219
- variant: "link",
220
- color: "neutral",
221
- size: "xs",
222
- className: "think-full-app__error-dismiss",
223
- onClick: () => chat.clearError(),
224
- children: "Dismiss"
225
- })]
226
- }) : null]
289
+ /* @__PURE__ */ jsxs("div", {
290
+ ref: viewScopeRef,
291
+ className: "think-full-app__view-scope",
292
+ children: [/* @__PURE__ */ jsx("section", {
293
+ className: "think-full-app__chat-surface",
294
+ "data-workspace-restoration-scope": "chat",
295
+ "aria-label": "Chat",
296
+ children: /* @__PURE__ */ jsx("div", {
297
+ className: "think-full-app__chat",
298
+ children: /* @__PURE__ */ jsx("div", {
299
+ className: "think-full-app__chat-inner",
300
+ children: /* @__PURE__ */ jsx(ThinkChat.Provider, {
301
+ chat,
302
+ agentTools,
303
+ children: /* @__PURE__ */ jsx(ThinkChat.Messages, {
304
+ ...resolvedMessages,
305
+ renderAgentToolRunLink: showAgentTools ? renderAgentToolRunLink : void 0
306
+ })
307
+ })
308
+ })
227
309
  })
228
- })
229
- }),
230
- activePanel ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }), /* @__PURE__ */ jsx("aside", {
231
- className: "think-full-app__aside",
232
- "aria-label": "Workbench",
233
- children: /* @__PURE__ */ jsx("div", {
234
- className: "think-full-app__workbench-slot",
310
+ }), activePanel ? /* @__PURE__ */ jsx("aside", {
311
+ className: "think-full-app__aside",
312
+ "aria-label": "Workbench",
235
313
  children: /* @__PURE__ */ jsx("div", {
236
- className: "think-full-app__workbench-panel",
237
- "data-view": activeWorkbenchView,
238
- children: activeWorkbenchView === "files" && workspace ? /* @__PURE__ */ jsx(WorkspacePanel, {
239
- config: workspace,
240
- workbenchNavigation
241
- }) : activeWorkbenchView === "execution" ? /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
242
- source: agent.stub,
243
- title: "Execution",
244
- backButton: workbenchNavigation,
245
- selectedRun: selectedExecutionRun,
246
- onSelectedRunChange: onSelectedExecutionRunChange
247
- }) : activePanel.render(panelContext)
314
+ className: "think-full-app__workbench-slot",
315
+ children: /* @__PURE__ */ jsx("div", {
316
+ ref: workbenchPanelRef,
317
+ className: "think-full-app__workbench-panel",
318
+ "data-view": activeWorkbenchView,
319
+ tabIndex: -1,
320
+ children: activePanel.render(panelContext)
321
+ })
248
322
  })
249
- })
250
- })] }) : null
323
+ }) : null]
324
+ }),
325
+ activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null
251
326
  ]
252
327
  });
253
328
  const app = workspace ? /* @__PURE__ */ jsx(WorkspaceNavigationProvider, {
@@ -269,6 +344,7 @@ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat,
269
344
  sidebarOpen: threadSidebarOpen,
270
345
  defaultSidebarOpen: defaultThreadSidebarOpen,
271
346
  onSidebarOpenChange: onThreadSidebarOpenChange,
347
+ "data-hide-app-bar-in-workbench": hideAppBarInWorkbench ? "" : void 0,
272
348
  topBar: (controls) => renderAppTopBar(controls),
273
349
  children: app
274
350
  });
@@ -1,4 +1,4 @@
1
- import { r as ToggleGroupProps } from "../ToggleGroup-8hPv-b69.js";
1
+ import { r as ToggleGroupProps } from "../ToggleGroup-DNd6cDJZ.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/ThinkFullAppViewSwitch.d.ts
@@ -1,4 +1,4 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
1
+ import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
2
2
  import { AppTopBar } from "./AppTopBar.js";
3
3
  import { ToggleGroup } from "./ToggleGroup.js";
4
4
  import "react";
@@ -11,7 +11,7 @@ import { jsx } from "react/jsx-runtime";
11
11
  */
12
12
  function ThinkFullAppViewSwitch({ allowEmpty = false, className, onValueChange, value, views, ...props }) {
13
13
  return /* @__PURE__ */ jsx(ToggleGroup.Root, {
14
- className: cx("think-full-app__view-switch", className),
14
+ className: mergeBaseClassName("think-full-app__view-switch", className),
15
15
  size: "sm",
16
16
  value: value ? [value] : [],
17
17
  onValueChange: (nextValue, eventDetails) => {
@@ -0,0 +1,60 @@
1
+ import * as React from "react";
2
+ import { DynamicToolUIPart, ToolUIPart } from "ai";
3
+ import { PendingApproval, Think } from "@cloudflare/think";
4
+ import { AgentStub } from "agents/client";
5
+ import { ProxyToolOutput } from "@cloudflare/codemode";
6
+
7
+ //#region src/components/ThinkPendingApproval.d.ts
8
+ type PausedExecution = Extract<ProxyToolOutput, {
9
+ status: "paused";
10
+ }>;
11
+ /** Structural match for any upstream tool binding of the Codemode execute runtime. */
12
+ declare function getPausedExecution(part: ToolUIPart | DynamicToolUIPart): PausedExecution | undefined;
13
+ interface SharedThinkApprovalProps {
14
+ thinkStub: AgentStub<Think>;
15
+ onSettled?: () => void | Promise<void>;
16
+ onSkip?: () => void;
17
+ count?: number;
18
+ question?: React.ReactNode;
19
+ }
20
+ interface ThinkPendingApprovalProps extends React.HTMLAttributes<HTMLDivElement>, SharedThinkApprovalProps {
21
+ /** Whole entry returned by Think `pendingApprovals()`. */
22
+ approval: PendingApproval;
23
+ }
24
+ /**
25
+ * Durable Think approval adapter. It renders the complete upstream descriptor
26
+ * and resolves only through the full Think stub's idempotent execution RPCs.
27
+ */
28
+ declare function ThinkPendingApproval({
29
+ approval,
30
+ className,
31
+ count,
32
+ onSettled,
33
+ onSkip,
34
+ question,
35
+ ref,
36
+ thinkStub,
37
+ ...props
38
+ }: ThinkPendingApprovalProps & {
39
+ ref?: React.Ref<HTMLDivElement>;
40
+ }): React.JSX.Element;
41
+ interface ThinkExecutionApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part">, SharedThinkApprovalProps {
42
+ /** Whole AI SDK tool part whose upstream Codemode output may be paused. */
43
+ part: ToolUIPart | DynamicToolUIPart;
44
+ }
45
+ /** Actionable adapter for Think's in-band paused Codemode execution output. */
46
+ declare function ThinkExecutionApproval({
47
+ className,
48
+ count,
49
+ onSettled,
50
+ onSkip,
51
+ part,
52
+ question,
53
+ ref,
54
+ thinkStub,
55
+ ...props
56
+ }: ThinkExecutionApprovalProps & {
57
+ ref?: React.Ref<HTMLDivElement>;
58
+ }): React.JSX.Element | null;
59
+ //#endregion
60
+ export { ThinkExecutionApproval, ThinkExecutionApprovalProps, ThinkPendingApproval, ThinkPendingApprovalProps, getPausedExecution };
@@ -0,0 +1,99 @@
1
+ import { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalPreview, ApprovalPreviewRow, ApprovalQuestion, formatApprovalValue } from "./Approval.js";
2
+ import "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { getToolName } from "ai";
5
+ import { getToolOutput } from "@cloudflare/think/react";
6
+ //#region src/components/ThinkPendingApproval.tsx
7
+ /** Structural match for any upstream tool binding of the Codemode execute runtime. */
8
+ function getPausedExecution(part) {
9
+ if (part.state !== "output-available") return void 0;
10
+ const output = getToolOutput(part);
11
+ return output?.status === "paused" && typeof output.executionId === "string" ? output : void 0;
12
+ }
13
+ function titleCase(value) {
14
+ return value.split("-").map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`).join(" ");
15
+ }
16
+ /**
17
+ * Durable Think approval adapter. It renders the complete upstream descriptor
18
+ * and resolves only through the full Think stub's idempotent execution RPCs.
19
+ */
20
+ function ThinkPendingApproval({ approval, className, count, onSettled, onSkip, question, ref, thinkStub, ...props }) {
21
+ const { descriptor } = approval;
22
+ const permissions = descriptor.permissions.length ? descriptor.permissions.join(", ") : "None requested";
23
+ const source = approval.source === "action" ? "Action" : "Codemode";
24
+ return /* @__PURE__ */ jsxs(Approval, {
25
+ ref,
26
+ className,
27
+ "aria-label": `Approve ${descriptor.action}`,
28
+ ...props,
29
+ children: [
30
+ /* @__PURE__ */ jsxs(ApprovalHeader, { children: [/* @__PURE__ */ jsx(ApprovalQuestion, { children: question ?? /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ "Do you want to allow ",
32
+ /* @__PURE__ */ jsx("code", { children: descriptor.summary }),
33
+ "?"
34
+ ] }) }), count && count > 1 ? /* @__PURE__ */ jsxs(ApprovalCount, { children: ["1 of ", count] }) : null] }),
35
+ /* @__PURE__ */ jsxs(ApprovalPreview, { children: [
36
+ /* @__PURE__ */ jsx(ApprovalPreviewRow, {
37
+ label: "source",
38
+ children: source
39
+ }),
40
+ /* @__PURE__ */ jsx(ApprovalPreviewRow, {
41
+ label: "kind",
42
+ children: titleCase(descriptor.kind)
43
+ }),
44
+ /* @__PURE__ */ jsx(ApprovalPreviewRow, {
45
+ label: "risk",
46
+ children: descriptor.risk ? titleCase(descriptor.risk) : "Not specified"
47
+ }),
48
+ /* @__PURE__ */ jsx(ApprovalPreviewRow, {
49
+ label: "permissions",
50
+ children: permissions
51
+ })
52
+ ] }),
53
+ descriptor.input !== void 0 ? /* @__PURE__ */ jsx(ApprovalInputPreview, { input: descriptor.input }) : null,
54
+ /* @__PURE__ */ jsx(ApprovalDecision, {
55
+ subject: descriptor.summary,
56
+ onSkip,
57
+ onDecision: async ({ approved, reason }) => {
58
+ try {
59
+ await (approved ? thinkStub.approveExecution(approval.executionId) : thinkStub.rejectExecution(approval.executionId, reason));
60
+ } finally {
61
+ await onSettled?.();
62
+ }
63
+ }
64
+ }, approval.executionId)
65
+ ]
66
+ });
67
+ }
68
+ /** Actionable adapter for Think's in-band paused Codemode execution output. */
69
+ function ThinkExecutionApproval({ className, count, onSettled, onSkip, part, question, ref, thinkStub, ...props }) {
70
+ const paused = getPausedExecution(part);
71
+ if (!paused) return null;
72
+ const toolName = part.title ?? getToolName(part);
73
+ return /* @__PURE__ */ jsxs(Approval, {
74
+ ref,
75
+ className,
76
+ "aria-label": `Approve ${toolName}`,
77
+ ...props,
78
+ children: [
79
+ /* @__PURE__ */ jsxs(ApprovalHeader, { children: [/* @__PURE__ */ jsx(ApprovalQuestion, { children: question ?? /* @__PURE__ */ jsx(Fragment, { children: "The agent's code is paused on these calls. Allow it to continue?" }) }), count && count > 1 ? /* @__PURE__ */ jsxs(ApprovalCount, { children: ["1 of ", count] }) : null] }),
80
+ /* @__PURE__ */ jsx(ApprovalPreview, { children: paused.pending.map((action) => /* @__PURE__ */ jsx(ApprovalPreviewRow, {
81
+ label: `${action.connector}.${action.method}`,
82
+ children: action.args === void 0 ? null : formatApprovalValue(action.args)
83
+ }, action.seq)) }),
84
+ /* @__PURE__ */ jsx(ApprovalDecision, {
85
+ subject: toolName,
86
+ onSkip,
87
+ onDecision: async ({ approved, reason }) => {
88
+ try {
89
+ await (approved ? thinkStub.approveExecution(paused.executionId) : thinkStub.rejectExecution(paused.executionId, reason));
90
+ } finally {
91
+ await onSettled?.();
92
+ }
93
+ }
94
+ }, `${paused.executionId}:${paused.pending[0]?.seq ?? "pending"}`)
95
+ ]
96
+ });
97
+ }
98
+ //#endregion
99
+ export { ThinkExecutionApproval, ThinkPendingApproval, getPausedExecution };
@@ -0,0 +1,2 @@
1
+ import { n as ThinkRecoveryNoticeProps, t as ThinkRecoveryNotice } from "../ThinkRecoveryNotice-DFIcG9UX.js";
2
+ export { ThinkRecoveryNotice, ThinkRecoveryNoticeProps };
@@ -0,0 +1,46 @@
1
+ import { TransitionSurface } from "./TransitionSurface.js";
2
+ import { AgentChatTurnError } from "./AgentChatTurnError.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/ThinkRecoveryNotice.tsx
5
+ function connectionReason(error) {
6
+ return error.reason.trim() || error.message.trim();
7
+ }
8
+ /**
9
+ * Native Think recovery, connection, and turn-error content for AgentChat's
10
+ * persistent polite notice region. Think exposes no recovery phase, progress,
11
+ * checkpoint, attempt count, or timeline to the browser, so this adapter does
12
+ * not claim those details.
13
+ */
14
+ function ThinkRecoveryNotice({ chat }) {
15
+ if (chat.isRecovering) return /* @__PURE__ */ jsx(TransitionSurface, {
16
+ "data-slot": "think-recovery-notice",
17
+ className: "think-recovery-notice",
18
+ children: "Recovering the interrupted response…"
19
+ }, "recovering");
20
+ if (chat.connectionError) {
21
+ const reason = connectionReason(chat.connectionError);
22
+ return /* @__PURE__ */ jsxs(TransitionSurface, {
23
+ "data-slot": "think-recovery-notice",
24
+ className: "think-recovery-notice",
25
+ "data-tone": "danger",
26
+ children: ["Connection lost", reason ? ` — ${reason}` : "."]
27
+ }, "connection-error");
28
+ }
29
+ if (chat.error) {
30
+ const retryMessageId = chat.messages.findLast((message) => message.role !== "system")?.id;
31
+ return /* @__PURE__ */ jsx(TransitionSurface, {
32
+ className: "think-recovery-notice",
33
+ children: /* @__PURE__ */ jsx(AgentChatTurnError, {
34
+ error: chat.error,
35
+ onDismiss: chat.clearError,
36
+ onRetry: retryMessageId ? () => {
37
+ chat.clearError();
38
+ chat.regenerate({ messageId: retryMessageId });
39
+ } : void 0
40
+ })
41
+ }, "turn-error");
42
+ }
43
+ return null;
44
+ }
45
+ //#endregion
46
+ export { ThinkRecoveryNotice };
@@ -1,5 +1,6 @@
1
1
  //#region src/components/ThinkRoutine.ts
2
2
  function getThinkRoutineNextRun(routine) {
3
+ if (!routine.enabled) return "Paused";
3
4
  return routine.schedule ? formatThinkExecutionDate(routine.schedule.time * 1e3, "Not scheduled") : "Pending reconciliation";
4
5
  }
5
6
  function formatThinkExecutionDate(value, fallback) {