@mcp-b/react-components 0.48.0 → 0.49.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 (299) hide show
  1. package/dist/AgentChatQueue-C_Jaw3Ia.d.ts +48 -0
  2. package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
  3. package/dist/Avatar-o2NO1fCG.d.ts +124 -0
  4. package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
  5. package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
  6. package/dist/{CodeBlock-BSJl682D.js → CodeBlock-g8sADidM.js} +8 -8
  7. package/dist/{FileTree-DvE0hNZu.js → FileTree-H8mMg4rV.js} +21 -30
  8. package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
  9. package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
  10. package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
  11. package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
  12. package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
  13. package/dist/Separator-CzhtLYE1.d.ts +41 -0
  14. package/dist/Toolbar-CGY004u0.d.ts +155 -0
  15. package/dist/{Workspace-LIoU30n7.d.ts → Workspace-HzGrWDX3.d.ts} +1 -1
  16. package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
  17. package/dist/{WorkspaceFileView-C_WnYm-a.js → WorkspaceFileView-DYPtRVpM.js} +5 -4
  18. package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
  19. package/dist/{WorkspaceMessageResponse-BqOezptB.js → WorkspaceMessageResponse-CUJk9_P5.js} +2 -2
  20. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  21. package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
  22. package/dist/components/agents-sdk/AgentChat.js +527 -672
  23. package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
  24. package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
  25. package/dist/components/agents-sdk/AgentEvent.js +2 -2
  26. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
  27. package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
  28. package/dist/components/agents-sdk/BrowserLiveScreen.js +22 -14
  29. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  30. package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
  31. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  32. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
  33. package/dist/components/agents-sdk/BrowserRunPanel.js +32 -31
  34. package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
  35. package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
  36. package/dist/components/agents-sdk/ManagerOffice.d.ts +79 -40
  37. package/dist/components/agents-sdk/ManagerOffice.js +291 -281
  38. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
  39. package/dist/components/agents-sdk/McpConnectionRequest.js +4 -3
  40. package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
  41. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  42. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
  43. package/dist/components/agents-sdk/McpPluginCatalog.js +5 -4
  44. package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
  45. package/dist/components/agents-sdk/McpServerIcon.js +25 -0
  46. package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
  47. package/dist/components/agents-sdk/McpServerPicker.js +4 -3
  48. package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
  49. package/dist/components/agents-sdk/ModelSelector.js +4 -4
  50. package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
  51. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  52. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  53. package/dist/components/agents-sdk/PromptInputCommands.js +2 -3
  54. package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
  55. package/dist/components/agents-sdk/SessionCompaction.js +2 -2
  56. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
  57. package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
  58. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
  59. package/dist/components/agents-sdk/SubagentRunIndicator.js +19 -24
  60. package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
  61. package/dist/components/agents-sdk/SubagentRunList.js +4 -2
  62. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
  63. package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
  64. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
  65. package/dist/components/agents-sdk/SubagentRunSelector.js +5 -3
  66. package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
  67. package/dist/components/agents-sdk/ThinkChat.js +233 -2
  68. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
  69. package/dist/components/agents-sdk/ThinkChatActivity.js +18 -10
  70. package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
  71. package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
  72. package/dist/components/agents-sdk/ThinkChatToolPanels.js +24 -19
  73. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  74. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  75. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  76. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
  77. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +159 -102
  78. package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
  79. package/dist/components/agents-sdk/ThinkFullApp.js +71 -290
  80. package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
  81. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  82. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
  83. package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
  84. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
  85. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +17 -15
  86. package/dist/components/agents-sdk/ThinkRoutineDetail.js +11 -11
  87. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
  88. package/dist/components/agents-sdk/ThinkRoutineForm.js +14 -14
  89. package/dist/components/agents-sdk/ThinkRoutineRuns.js +7 -7
  90. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
  91. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  92. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  93. package/dist/components/agents-sdk/Workspace.js +7 -13
  94. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  95. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  96. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +1 -1
  97. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +10 -1
  98. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +10 -7
  99. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +5 -14
  100. package/dist/components/agents-sdk/WorkspaceExecution.js +24 -38
  101. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
  102. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
  103. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  104. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  105. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  106. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  107. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  108. package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
  109. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
  110. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  111. package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
  112. package/dist/components/agents-sdk/WorkspaceMountManager.js +6 -9
  113. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
  114. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
  115. package/dist/components/agents-sdk/WorkspaceProject.d.ts +5 -14
  116. package/dist/components/agents-sdk/WorkspaceProject.js +21 -35
  117. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
  118. package/dist/components/agents-sdk/WorkspaceUserScript.js +8 -5
  119. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  120. package/dist/components/ai-sdk/Activity.js +1 -1
  121. package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
  122. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
  123. package/dist/components/ai-sdk/AgentChatStartScreen.js +64 -43
  124. package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
  125. package/dist/components/ai-sdk/Approval.d.ts +1 -1
  126. package/dist/components/ai-sdk/Approval.js +2 -2
  127. package/dist/components/ai-sdk/Artifact.d.ts +2 -2
  128. package/dist/components/ai-sdk/Artifact.js +1 -1
  129. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  130. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  131. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  132. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  133. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  134. package/dist/components/ai-sdk/ComposerLink.js +2 -3
  135. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +9 -1
  136. package/dist/components/ai-sdk/ConnectedAppCards.js +28 -21
  137. package/dist/components/ai-sdk/Context.d.ts +7 -3
  138. package/dist/components/ai-sdk/Context.js +7 -17
  139. package/dist/components/ai-sdk/Conversation.d.ts +2 -2
  140. package/dist/components/ai-sdk/Conversation.js +1 -1
  141. package/dist/components/ai-sdk/Goal.d.ts +3 -3
  142. package/dist/components/ai-sdk/Goal.js +3 -3
  143. package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
  144. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  145. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  146. package/dist/components/ai-sdk/Message.d.ts +2 -2
  147. package/dist/components/ai-sdk/Message.js +12 -3
  148. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  149. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  150. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
  151. package/dist/components/ai-sdk/MessageScrollerVirtual.js +39 -5
  152. package/dist/components/ai-sdk/Plan.d.ts +1 -1
  153. package/dist/components/ai-sdk/Plan.js +1 -1
  154. package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
  155. package/dist/components/ai-sdk/PromptInput.js +175 -231
  156. package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
  157. package/dist/components/ai-sdk/Queue.d.ts +28 -5
  158. package/dist/components/ai-sdk/Queue.js +20 -5
  159. package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
  160. package/dist/components/ai-sdk/Reasoning.js +5 -5
  161. package/dist/components/ai-sdk/Sources.d.ts +1 -1
  162. package/dist/components/ai-sdk/Sources.js +1 -1
  163. package/dist/components/ai-sdk/Task.d.ts +1 -1
  164. package/dist/components/ai-sdk/Task.js +1 -1
  165. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
  166. package/dist/components/extension/ChatGptSignInScreen.js +1 -1
  167. package/dist/components/extension/CodexModelSelector.d.ts +5 -0
  168. package/dist/components/extension/CodexModelSelector.js +2 -2
  169. package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
  170. package/dist/components/extension/ConversationTabPicker.js +2 -2
  171. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  172. package/dist/components/foundations/AppIcon.d.ts +3 -2
  173. package/dist/components/foundations/Autocomplete.js +6 -1
  174. package/dist/components/foundations/Avatar.d.ts +1 -121
  175. package/dist/components/foundations/Button.d.ts +1 -1
  176. package/dist/components/foundations/Card.d.ts +22 -27
  177. package/dist/components/foundations/Card.js +51 -32
  178. package/dist/components/foundations/Checkbox.js +1 -1
  179. package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
  180. package/dist/components/foundations/Collapsible.d.ts +1 -1
  181. package/dist/components/foundations/Collapsible.js +1 -1
  182. package/dist/components/foundations/Combobox.js +6 -1
  183. package/dist/components/foundations/ContextMenu.js +1 -1
  184. package/dist/components/foundations/Dialog.d.ts +106 -1
  185. package/dist/components/foundations/EmptyState.d.ts +1 -1
  186. package/dist/components/foundations/Field.d.ts +2 -1
  187. package/dist/components/foundations/Fieldset.d.ts +1 -1
  188. package/dist/components/foundations/Form.d.ts +4 -4
  189. package/dist/components/foundations/IconButton.d.ts +1 -1
  190. package/dist/components/foundations/Label.d.ts +1 -1
  191. package/dist/components/foundations/LinkButton.d.ts +2 -2
  192. package/dist/components/foundations/Menubar.js +1 -1
  193. package/dist/components/foundations/Meter.d.ts +1 -1
  194. package/dist/components/foundations/NumberField.d.ts +1 -1
  195. package/dist/components/foundations/ScrollArea.d.ts +1 -1
  196. package/dist/components/foundations/SearchField.d.ts +1 -1
  197. package/dist/components/foundations/SearchField.js +1 -1
  198. package/dist/components/foundations/Select.js +7 -2
  199. package/dist/components/foundations/Separator.d.ts +1 -40
  200. package/dist/components/foundations/Stepper.d.ts +1 -1
  201. package/dist/components/foundations/Stepper.js +1 -1
  202. package/dist/components/foundations/Textarea.d.ts +1 -1
  203. package/dist/components/foundations/Toast.d.ts +5 -1
  204. package/dist/components/foundations/Toast.js +1 -1
  205. package/dist/components/foundations/Toggle.d.ts +70 -1
  206. package/dist/components/foundations/ToggleGroup.d.ts +4 -3
  207. package/dist/components/foundations/ToggleGroup.js +1 -1
  208. package/dist/components/foundations/Toolbar.d.ts +1 -151
  209. package/dist/components/foundations/TransitionSurface.d.ts +1 -1
  210. package/dist/components/foundations/icons.js +1 -1
  211. package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
  212. package/dist/components/general-purpose/ActionGuide.js +4 -18
  213. package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
  214. package/dist/components/general-purpose/Commit.d.ts +2 -2
  215. package/dist/components/general-purpose/Commit.js +2 -2
  216. package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
  217. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  218. package/dist/components/general-purpose/FileTree.d.ts +1 -7
  219. package/dist/components/general-purpose/FileTree.js +1 -1
  220. package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
  221. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  222. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  223. package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
  224. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
  225. package/dist/components/general-purpose/ResponsiveSidebarShell.js +120 -102
  226. package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
  227. package/dist/components/general-purpose/SettingsFormDialog.js +42 -72
  228. package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
  229. package/dist/components/general-purpose/SetupChecklist.js +76 -1
  230. package/dist/components/general-purpose/Terminal.d.ts +3 -3
  231. package/dist/components/general-purpose/Terminal.js +11 -6
  232. package/dist/components/general-purpose/TestResults.d.ts +23 -11
  233. package/dist/components/general-purpose/TestResults.js +49 -51
  234. package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
  235. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  236. package/dist/components/general-purpose/WebPreview.d.ts +29 -4
  237. package/dist/components/general-purpose/WebPreview.js +39 -14
  238. package/dist/components/nanites/AgentConnection.js +2 -2
  239. package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
  240. package/dist/components/nanites/AgentToolDetail.js +21 -42
  241. package/dist/{copy-button-Dk2vRe9j.js → copy-button-CSDuDfdP.js} +1 -1
  242. package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
  243. package/dist/mcp-server-mAErsxHU.js +27 -0
  244. package/dist/styles/activity.css +1 -96
  245. package/dist/styles/agent-chat.css +75 -102
  246. package/dist/styles/agent-tool-detail.css +0 -16
  247. package/dist/styles/base.css +1 -1
  248. package/dist/styles/browser-run-panel.css +1 -15
  249. package/dist/styles/button.css +7 -1
  250. package/dist/styles/code-block.css +12 -0
  251. package/dist/styles/composition-motion.css +0 -2
  252. package/dist/styles/employee-chrome.css +43 -0
  253. package/dist/styles/file-tree.css +5 -0
  254. package/dist/styles/index.css +4 -2
  255. package/dist/styles/message.css +2 -10
  256. package/dist/styles/queue.css +71 -0
  257. package/dist/styles/subagent-run.css +122 -6
  258. package/dist/styles/test-results.css +2 -5
  259. package/dist/styles/think-chat-activity.css +13 -0
  260. package/dist/styles/think-chat-tool-panels.css +81 -0
  261. package/dist/styles/think-execution-workbench.css +2 -8
  262. package/dist/styles/think-full-app.css +42 -251
  263. package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
  264. package/dist/styles/web-preview.css +15 -1
  265. package/dist/utils/mcp-server-catalog.d.ts +1112 -2
  266. package/dist/utils/mcp-server-catalog.js +28 -9
  267. package/dist/utils/structured-code.d.ts +1 -1
  268. package/dist/{workspace-assets-GqsCYxqT.js → workspace-assets-Bg7XhPsk.js} +2 -2
  269. package/package.json +7 -3
  270. package/dist/AgentChat-BLmQghkt.d.ts +0 -327
  271. package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
  272. package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
  273. package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
  274. package/dist/Dialog-B_FhRWaz.d.ts +0 -107
  275. package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
  276. package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
  277. package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
  278. package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
  279. package/dist/SetupChecklist-DeTU9YpW.js +0 -77
  280. package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
  281. package/dist/ThinkChat-DiI6hhDP.js +0 -332
  282. package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
  283. package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
  284. package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
  285. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
  286. package/dist/Toggle-DLrIf5YH.d.ts +0 -69
  287. package/dist/WorkspaceLive-DfjH1Ypm.d.ts +0 -61
  288. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
  289. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
  290. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
  291. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
  292. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
  293. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
  294. package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
  295. package/dist/mcp-server-7NR24ASj.js +0 -69
  296. package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
  297. package/dist/styles/think-sidepanel.css +0 -78
  298. package/dist/think-agent-Cip5KAPj.d.ts +0 -7
  299. package/dist/{icons-CeGfXO21.js → icons-cuEtsgj9.js} +1 -1
@@ -4,9 +4,10 @@ import { siAirtable, siAsana, siAtlassian, siCalendly, siCloudflare, siDatadog,
4
4
  /**
5
5
  * Read the complete state emitted by the pinned Agents runtime.
6
6
  *
7
- * Agents 0.19.0 can return `not-connected` from `getMcpServers()` even though
8
- * that value is missing from its exported `MCPServer["state"]` declaration.
9
- * Keep the unavoidable compatibility assertion at this one SDK boundary.
7
+ * Published Agents 0.21.0 can return `not-connected` from `getMcpServers()`
8
+ * even though its exported `MCPServer["state"]` declaration omits that value.
9
+ * Keep the type correction at this SDK boundary until the declaration matches
10
+ * the runtime; this does not support an older application input shape.
10
11
  */
11
12
  function getMcpServerRuntimeState(server) {
12
13
  return server.state;
@@ -153,11 +154,29 @@ const CUSTOM_MCP_SERVER_CARD = {
153
154
  }
154
155
  };
155
156
  function getMcpServerIconSrc(server) {
156
- if (typeof server.icon === "string") return server.icon;
157
- if (server.icon?.src) return server.icon.src;
158
- const bundled = bundledSimpleIcon(server);
159
- if (bundled) return bundled;
160
- return inferFaviconUrl(server.url);
157
+ return server.icon ?? bundledSimpleIcon(server) ?? inferFaviconUrl(server.url);
158
+ }
159
+ /** Match a live MCP entry or channel name to a catalog card that already has a brand mark. */
160
+ function findCatalogMcpServerCard(query) {
161
+ const id = query.id?.trim().toLowerCase();
162
+ const name = query.name?.trim().toLowerCase();
163
+ let hostname;
164
+ if (query.url) try {
165
+ hostname = new URL(query.url).hostname;
166
+ } catch {
167
+ hostname = void 0;
168
+ }
169
+ return DEFAULT_MCP_SERVER_CARDS.find((candidate) => {
170
+ if (!candidate.url) return false;
171
+ if (id && candidate.id === id) return true;
172
+ if (name && (candidate.name.toLowerCase() === name || candidate.id === name)) return true;
173
+ if (!hostname) return false;
174
+ try {
175
+ return new URL(candidate.url).hostname === hostname;
176
+ } catch {
177
+ return false;
178
+ }
179
+ });
161
180
  }
162
181
  /** Remote MCP servers whose OAuth metadata exposes a registration_endpoint. */
163
182
  const DCR_MCP_SERVER_CARDS = [
@@ -940,4 +959,4 @@ const DEFAULT_MCP_SERVER_CARDS = [
940
959
  } : server;
941
960
  });
942
961
  //#endregion
943
- export { CUSTOM_MCP_SERVER_CARD, DCR_MCP_SERVER_CARDS, DEFAULT_MCP_SERVER_CARDS, MANUAL_MCP_SERVER_CARDS, MCP_SERVER_SETUP_AUTH, getMcpServerEntry, getMcpServerIconSrc, getMcpServerRuntimeState };
962
+ export { CUSTOM_MCP_SERVER_CARD, DCR_MCP_SERVER_CARDS, DEFAULT_MCP_SERVER_CARDS, MANUAL_MCP_SERVER_CARDS, MCP_SERVER_SETUP_AUTH, findCatalogMcpServerCard, getMcpServerEntry, getMcpServerIconSrc, getMcpServerRuntimeState };
@@ -1,4 +1,4 @@
1
- import { O as CodeBlockLanguage } from "../CodeBlock-C380GD5t.js";
1
+ import { O as CodeBlockLanguage } from "../CodeBlock--r6GS8YV.js";
2
2
 
3
3
  //#region src/utils/structured-code.d.ts
4
4
  interface StructuredCodeDisplay {
@@ -1,11 +1,11 @@
1
1
  import { composerLinkHref } from "./utils/composer-link.js";
2
2
  import { canRequestFavicon, inferFaviconUrl } from "./utils/favicon.js";
3
- import { Q as TrashIcon, S as FileIcon } from "./icons-CeGfXO21.js";
3
+ import { Q as TrashIcon, S as FileIcon } from "./icons-cuEtsgj9.js";
4
4
  import { Button } from "./components/foundations/Button.js";
5
5
  import { Tooltip } from "./components/foundations/Tooltip.js";
6
6
  import { IconButton } from "./components/foundations/IconButton.js";
7
- import { AppIcon } from "./components/foundations/AppIcon.js";
8
7
  import { ComposerLink } from "./components/ai-sdk/ComposerLink.js";
8
+ import { AppIcon } from "./components/foundations/AppIcon.js";
9
9
  import { AlertDialog } from "./components/foundations/AlertDialog.js";
10
10
  import * as React from "react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-b/react-components",
3
- "version": "0.48.0",
3
+ "version": "0.49.0",
4
4
  "description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
5
5
  "homepage": "https://design-system.sigvelo.com",
6
6
  "bugs": {
@@ -54,7 +54,7 @@
54
54
  "streamdown": "^2.5.0",
55
55
  "unist-util-visit": "^5.1.0",
56
56
  "yet-another-react-lightbox": "^3.32.2",
57
- "@mcp-b/design-tokens": "0.48.0"
57
+ "@mcp-b/design-tokens": "0.49.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@ai-sdk/react": "^3.0.249",
@@ -65,6 +65,7 @@
65
65
  "@cloudflare/workers-types": "^5.20260811.1",
66
66
  "@storybook/addon-a11y": "^10.5.7",
67
67
  "@storybook/addon-docs": "^10.5.7",
68
+ "@storybook/addon-mcp": "0.7.0",
68
69
  "@storybook/addon-vitest": "^10.5.7",
69
70
  "@storybook/tanstack-react": "^10.5.7",
70
71
  "@tanstack/react-form": "^1.33.4",
@@ -82,10 +83,12 @@
82
83
  "agents": "^0.21.0",
83
84
  "ai": "^6.0.247",
84
85
  "cloudflare": "^7.0.0",
86
+ "oversight-lint": "0.7.1",
85
87
  "playwright": "~1.61.1",
86
88
  "react": "19.3.0-canary-711c445b-20260722",
87
89
  "react-dom": "19.3.0-canary-711c445b-20260722",
88
90
  "storybook": "^10.5.7",
91
+ "storybook-addon-oversight": "0.7.0",
89
92
  "typescript": "^6.0.3",
90
93
  "vite": "npm:@voidzero-dev/vite-plus-core@0.2.4",
91
94
  "vite-plus": "0.2.4",
@@ -143,6 +146,7 @@
143
146
  "test": "vp test",
144
147
  "check": "vp check",
145
148
  "storybook": "storybook dev -p 6011",
146
- "build-storybook": "storybook build && node ../../scripts/audit-storybook-manifest.mjs --write-imports"
149
+ "build-storybook": "storybook build && node ../../scripts/audit-storybook-manifest.mjs --write-imports && vp run audit:storybook-oversight",
150
+ "audit:storybook-oversight": "oversight storybook-static/manifests/components.json --expected-extractor react-component-meta --max-warnings 0"
147
151
  }
148
152
  }
@@ -1,327 +0,0 @@
1
- import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-C7L-Mv9U.js";
2
- import { n as AgentChatStartScreenProps } from "./AgentChatStartScreen-Bkv7Avni.js";
3
- import { D as PromptInputCommandDefinition, F as PromptInputDictationProps, K as PromptInputMessage, M as PromptInputContextSelectorProps, Q as PromptInputReference, n as PermissionMode } from "./PromptInput-DtJHyp0S.js";
4
- import * as React from "react";
5
- import { ChatAddToolApproveResponseFunction, ChatStatus, UIMessage } from "ai";
6
- import { PendingApproval, Think } from "@cloudflare/think";
7
- import { AgentStub } from "agents/client";
8
- import { UseVoiceInputReturn } from "@cloudflare/voice/react";
9
-
10
- //#region src/components/agents-sdk/AgentChat.d.ts
11
- /**
12
- * The affordance for a compaction that is running right now, for the `notice`
13
- * slot. Exported because Think's session frames report the same state from
14
- * outside this component's own `/compact` lifecycle, and one running
15
- * compaction must not read two ways.
16
- */
17
- declare const compactingNotice: React.JSX.Element;
18
- interface AgentChatRenderMessageContext<MessageT extends UIMessage = UIMessage> {
19
- message: MessageT;
20
- messageIndex: number;
21
- }
22
- interface AgentChatProps<MessageT extends UIMessage = UIMessage> {
23
- className?: string;
24
- /**
25
- * AI SDK `UIMessage`s to render, oldest first.
26
- *
27
- * `AgentChat` intentionally renders the upstream message objects in place:
28
- * it does not normalize them into a local transcript model. That keeps AI SDK
29
- * parts such as `text`, `reasoning`, `file`, `data-*`, `tool-*`,
30
- * `source-url`, `source-document`, and `step-start` aligned with the types
31
- * exported from `ai`. Cloudflare Think also returns these same UI messages through
32
- * `useAgentChat`, with Agents session storage applying compaction overlays to
33
- * reads before they reach the hook.
34
- *
35
- * Backend setup for compaction is owned by Think/Agents, not this component:
36
- * configure the agent session with `Session.create(this).onCompaction(...)
37
- * .compactAfter(...)`. Agents' Sessions docs describe that `getHistory()`
38
- * replaces a compacted range with a synthetic message whose id starts with
39
- * `compaction_`; this component uses Agents' exported
40
- * `isCompactionMessage` helper to render that synthetic message as a quiet
41
- * separator. Think's context-overflow recovery is a separate opt-in layer:
42
- * set `contextOverflow` and `classifyChatError` on the Think agent if the
43
- * backend should compact and retry/proactively guard a too-large in-flight
44
- * turn.
45
- *
46
- * @example Think session compaction setup
47
- * ```ts
48
- * import { Think, defaultContextOverflowClassifier } from "@cloudflare/think";
49
- * import { Session, createCompactFunction } from "agents/sessions";
50
- * import { generateText } from "ai";
51
- *
52
- * export class MyAgent extends Think<Env> {
53
- * override configureSession(session: Session) {
54
- * return session
55
- * .onCompaction(
56
- * createCompactFunction({
57
- * summarize: async (prompt) =>
58
- * (await generateText({ model: this.env.MODEL, prompt })).text,
59
- * protectHead: 3,
60
- * tailTokenBudget: 20_000,
61
- * }),
62
- * )
63
- * .compactAfter(100_000);
64
- * }
65
- *
66
- * override contextOverflow = {
67
- * reactive: true,
68
- * proactive: { maxInputTokens: 200_000 },
69
- * };
70
- * override classifyChatError = defaultContextOverflowClassifier;
71
- * }
72
- * ```
73
- *
74
- * @see https://github.com/cloudflare/agents/blob/main/docs/agents/sessions.md#compaction
75
- * @see https://github.com/cloudflare/agents/blob/main/docs/think/index.md#context-window-overflow-recovery
76
- */
77
- messages: readonly MessageT[];
78
- /** Drives the composer's send/stop affordance and streaming indicators. */
79
- status?: ChatStatus;
80
- /** Called with the composed message when the user submits. Omit for a read-only transcript. */
81
- onSubmit?: (message: PromptInputMessage) => void | Promise<void>;
82
- /** Show the prompt composer. Defaults to whether `onSubmit` is provided. */
83
- showComposer?: boolean;
84
- /** Called when the user hits stop while `status` is streaming/submitted. */
85
- onStop?: () => void;
86
- /**
87
- * Called when a submission lands in the pending queue instead of going out
88
- * (the composer was busy). Hosts with an autonomous continuation mode (goal
89
- * mode) pause it here: a user who queues a message expects it to run next,
90
- * not to race the loop's own next turn.
91
- */
92
- onPromptQueued?: () => void;
93
- placeholder?: string;
94
- disabled?: boolean;
95
- /** Rendered in place of the transcript while `messages` is empty. */
96
- emptyState?: React.ReactNode;
97
- /**
98
- * Renders the transcript region as loading and holds the composer inert.
99
- * This is the transcript of a conversation that exists and has not arrived —
100
- * distinct from `emptyState`, which describes one that has no messages — so
101
- * it also withholds the start screen's invitation to begin a first turn.
102
- *
103
- * A host's Suspense fallback uses it to keep the surrounding shell mounted
104
- * and interactive: a transcript read that never resolves then leaves every
105
- * exit reachable instead of replacing the app with a spinner.
106
- */
107
- loading?: boolean;
108
- /**
109
- * First-turn composition that places the live composer between a welcoming
110
- * heading and app-authored starter descriptors. It is the default when
111
- * messages are empty and no legacy `emptyState` is supplied. Pass `false` to
112
- * retain the transcript-style empty row.
113
- */
114
- startScreen?: Omit<AgentChatStartScreenProps, "composer" | "className" | "aria-labelledby"> | false;
115
- /** Extra controls rendered in the composer toolbar. */
116
- composerTools?: React.ReactNode;
117
- /** Controlled slash-command catalog and host-owned selection policy. */
118
- slashCommands?: {
119
- items: readonly PromptInputCommandDefinition[];
120
- onSelect?: (command: PromptInputCommandDefinition, draft: AgentChatComposerDraft) => void;
121
- };
122
- /**
123
- * Manual session compaction. When set, a built-in `/compact` entry leads the
124
- * slash menu whenever no turn is submitted or streaming; selecting it runs
125
- * this action immediately — no reference chip, no submitted text — bypassing
126
- * `slashCommands.onSelect`. The entry is withheld while busy so a
127
- * maintenance call never queues behind an active turn.
128
- *
129
- * The resolved `compacted` boolean is the outcome, and every outcome renders
130
- * in the composer's status notice region: pending shows synchronously,
131
- * `true` acknowledges completion, `false` explains that nothing was eligible
132
- * (Session's valid no-op), and a rejection keeps the retryable failure
133
- * notice. A host `notice` supersedes the local copy, so a precise Session
134
- * error is never relabelled as benign. The status half (live "compacting"
135
- * phase, post-compaction transcript reload) is `useSessionCompaction` in
136
- * `SessionCompaction` — wire both for full HITL.
137
- */
138
- onCompact?: () => Promise<{
139
- compacted: boolean;
140
- }>;
141
- /** Controlled MCP or tab catalog revealed by `@`; selections become composer links. */
142
- mentionCommands?: {
143
- items: readonly PromptInputCommandDefinition[];
144
- onSelect?: (command: PromptInputCommandDefinition, draft: AgentChatComposerDraft) => void;
145
- };
146
- /** Controlled folder or working-context picker rendered beside permission controls. */
147
- contextSelector?: PromptInputContextSelectorProps;
148
- /** Extra controls rendered at the trailing edge, before dictation and submit. */
149
- composerEndTools?: React.ReactNode;
150
- /** Whole upstream voice-input hook result used by the built-in dictation recorder. */
151
- voiceInput?: UseVoiceInputReturn;
152
- /** Host prerequisite run before the built-in recorder calls `voiceInput.start()`. */
153
- beforeVoiceStart?: PromptInputDictationProps["beforeStart"];
154
- /**
155
- * Rendered in the prompt-composer header before attachments and the text
156
- * field. Use it to compose a compact Activity, task state, or app-specific
157
- * context summary into the composer without recreating PromptInput's form.
158
- */
159
- composerHeader?: React.ReactNode;
160
- /**
161
- * Rendered in the tray docked above the composer, sharing the surface that
162
- * holds queued messages. Use it for compact persistent context such as the
163
- * `Goal` banner — one capped row, details behind hover or a popover.
164
- */
165
- composerTray?: React.ReactNode;
166
- /** Extra rows rendered in the built-in plus menu after files. */
167
- composerAddMenuItems?: React.ReactNode;
168
- /**
169
- * Transient status rendered between the transcript and the composer —
170
- * e.g. "Reconnecting…". `ThinkChat.Messages` fills this from the
171
- * hook's `isRecovering`/`connectionError` automatically.
172
- */
173
- notice?: React.ReactNode;
174
- /**
175
- * When set, the last assistant message gets a Retry action that calls this
176
- * with its message id — pass to the AI SDK's `regenerate({ messageId })`.
177
- */
178
- onRegenerate?: (messageId: string) => void;
179
- /**
180
- * Called after the user confirms an edit to the newest text-only user
181
- * message. The callback owns the durable backend branch and resend; this
182
- * component keeps only the unsaved draft and pending/error UI locally.
183
- *
184
- * Think deliberately disables `setMessages` synchronization, so product
185
- * code should wire this to a callable method on its agent rather than to the
186
- * AI SDK's local `setMessages` helper. The whole upstream message is passed
187
- * through so apps retain their `UIMessage` metadata and data-part types.
188
- */
189
- onEditAndResend?: (input: {
190
- message: MessageT;
191
- text: string;
192
- }) => void | Promise<void>;
193
- /**
194
- * Pass `addToolApprovalResponse` from `useAgentChat`/`useChat` directly.
195
- * When set and a tool call awaits approval, the composer becomes the
196
- * confirmation.
197
- */
198
- onApprovalResponse?: ChatAddToolApproveResponseFunction;
199
- /** Whole upstream Think stub used to resolve paused and durable execution approvals. */
200
- thinkStub?: AgentStub<Think>;
201
- /** Disable approval scanning, automatic responses, cards, and composer controls. */
202
- approvalsEnabled?: boolean;
203
- /** Parent-owned approval policy. Omit to keep AgentChat's session-local mode. */
204
- permissionModeControl?: PermissionModeControl;
205
- /** Called after a Think approve/reject RPC settles, including when it rejects. */
206
- onExecutionSettled?: () => void | Promise<void>;
207
- /** Think durable-pause approvals from `pendingApprovals()`, rendered when `thinkStub` is set. */
208
- pendingApprovals?: readonly PendingApproval[];
209
- /**
210
- * When set, a Context ring in the composer footer shows how much of the
211
- * model's window the conversation occupies. Used tokens come from the
212
- * newest message carrying `metadata.usage` (the AI SDK `messageMetadata`
213
- * convention; Think merges it into message metadata as turns finish).
214
- */
215
- contextWindow?: {
216
- maxTokens: number;
217
- modelId?: string;
218
- };
219
- /**
220
- * Override rendering per part; return `undefined` to fall back to the default
221
- * AI SDK/Think-aware part UI.
222
- *
223
- * The default renderer uses upstream helpers where available:
224
- * `isTextUIPart`, `isReasoningUIPart`, `isFileUIPart`, `isToolUIPart`,
225
- * `getToolName`, and Think's `getToolPartState`/input/output accessors. It
226
- * also renders native AI SDK `source-url`/`source-document` parts as a single
227
- * grouped `Sources` block when they appear consecutively, consolidates native
228
- * reasoning parts into one disclosure, and treats `step-start` as a silent
229
- * structural boundary. App-defined `data-*` parts stay whole and should be
230
- * narrowed with AI SDK's `isDataUIPart` inside this callback. If you override source rendering,
231
- * return a React node for every source part you want to show; returning
232
- * `undefined` lets `AgentChat` keep the upstream-shaped source-run grouping.
233
- */
234
- renderPart?: (context: AgentMessageRenderPartContext<MessageT>) => React.ReactNode | undefined;
235
- /** Rendered after each message's parts — for actions, citations, and the like. */
236
- renderMessageAfter?: (context: AgentChatRenderMessageContext<MessageT>) => React.ReactNode;
237
- /**
238
- * Per-message policy for the built-in assistant copy/retry toolbar. Use this
239
- * for deterministic interactive data messages whose visible UI already owns
240
- * its actions, while preserving a hidden model-visible text companion.
241
- */
242
- showAssistantActions?: (context: AgentChatRenderMessageContext<MessageT>) => boolean;
243
- }
244
- interface AgentChatComposerDraft {
245
- value: string;
246
- references: readonly PromptInputReference[];
247
- setValue: (value: string) => void;
248
- clear: () => void;
249
- addReference: (reference: PromptInputReference) => void;
250
- removeReference: (reference: PromptInputReference) => void;
251
- }
252
- interface PermissionModeControl {
253
- value: PermissionMode;
254
- onChange: (mode: PermissionMode) => void | Promise<void>;
255
- }
256
- /**
257
- * Low-level transcript/composer surface used by `ThinkChat`: props in, no
258
- * transport. Product code that talks to a Cloudflare Think agent should render
259
- * `ThinkChat`; use this directly only for plain AI SDK or read-only messages.
260
- *
261
- * The transcript is always windowed with TanStack Virtual (end-anchored,
262
- * follow-on-append): only the visible rows exist in the DOM, so hours-long
263
- * runs stay cheap. Consequences and the host-side contract:
264
- * - Every message needs a stable `id`; keys must survive prepends and stream
265
- * growth.
266
- * - Keep unchanged message objects referentially stable across updates.
267
- * Structured-cloning the array per delta over a worker/extension boundary
268
- * rebuilds every identity and defeats row memoization — clone once per
269
- * throttled batch instead.
270
- * - Throttle stream deltas before React state (AI SDK
271
- * `experimental_throttle: 50` or equivalent).
272
- * - Bound the data itself: windowing caps DOM size, not JS memory. Truncate
273
- * stored tool output at the buffer (~20k chars) and keep history
274
- * compaction on.
275
- * - Unmount the transcript to hide it; don't `display: none` it — hidden
276
- * rows measure 0 and corrupt the virtualizer's cached heights.
277
- * - Rows unmount off-screen: find-in-page only searches the window;
278
- * disclosure state persists via the built-in `ExpansionStateProvider`
279
- * (pass your own store via a wrapper to survive route remounts), but the
280
- * default `Reasoning` disclosure resets.
281
- * - The transcript is not a screen-reader live region (windowing would
282
- * announce re-inserted old rows as new); announce new messages from a
283
- * host-owned live region if that matters.
284
- */
285
- declare function AgentChat<MessageT extends UIMessage = UIMessage>({
286
- className,
287
- messages,
288
- status,
289
- onSubmit,
290
- showComposer,
291
- onStop,
292
- onPromptQueued,
293
- placeholder,
294
- disabled: composerDisabled,
295
- emptyState,
296
- loading,
297
- startScreen,
298
- composerHeader,
299
- composerTray,
300
- composerTools,
301
- slashCommands,
302
- onCompact,
303
- mentionCommands,
304
- contextSelector,
305
- composerEndTools,
306
- voiceInput,
307
- beforeVoiceStart,
308
- composerAddMenuItems,
309
- notice,
310
- onRegenerate,
311
- onEditAndResend,
312
- onApprovalResponse,
313
- thinkStub,
314
- approvalsEnabled,
315
- permissionModeControl,
316
- onExecutionSettled,
317
- pendingApprovals: durableApprovals,
318
- contextWindow,
319
- renderPart,
320
- renderMessageAfter,
321
- showAssistantActions,
322
- ref
323
- }: AgentChatProps<MessageT> & {
324
- ref?: React.Ref<HTMLDivElement>;
325
- }): React.JSX.Element;
326
- //#endregion
327
- export { PermissionModeControl as a, AgentChatRenderMessageContext as i, AgentChatComposerDraft as n, compactingNotice as o, AgentChatProps as r, AgentChat as t };
@@ -1,84 +0,0 @@
1
- import { r as ButtonProps } from "./Button-CZt3yywF.js";
2
- import * as React from "react";
3
-
4
- //#region src/components/ai-sdk/AgentChatStartScreen.d.ts
5
- interface AgentChatStarterItem {
6
- id: string;
7
- label: React.ReactNode;
8
- icon?: React.ReactNode;
9
- muted?: boolean;
10
- disabled?: boolean;
11
- /** Accessible label for this suggestion's optional dismiss action. */
12
- dismissLabel?: string;
13
- }
14
- interface AgentChatStarterListProps extends Omit<React.ComponentPropsWithoutRef<"ul">, "children" | "onDismiss" | "onSelect"> {
15
- /** Complete starter data from a host-owned suggestion query. */
16
- items: readonly AgentChatStarterItem[];
17
- onSelect: (item: AgentChatStarterItem) => void;
18
- /** Enables dismiss actions for items that provide `dismissLabel`. */
19
- onDismiss?: (item: AgentChatStarterItem) => void;
20
- }
21
- interface AgentChatStartScreenProps extends Omit<React.ComponentPropsWithoutRef<"section">, "children" | "title"> {
22
- /** The prompt that orients the user before their first message. */
23
- heading?: React.ReactNode;
24
- /** The one composer owned by `AgentChat`, placed between the heading and starters. */
25
- composer: React.ReactNode;
26
- /** App-authored content for the utility tray beneath the first-turn composer. */
27
- composerTray?: React.ReactNode;
28
- /**
29
- * Optional article below the composer. Replaces starters when present —
30
- * used for a first-turn capability guide.
31
- */
32
- lead?: React.ReactNode;
33
- /** Host-authored starter data and callables rendered below the composer. */
34
- starters?: AgentChatStarterListProps;
35
- }
36
- /**
37
- * Welcoming first-turn layout for `AgentChat` and `ThinkChat`.
38
- *
39
- * `AgentChat` normally creates this component through its `startScreen` prop so
40
- * the same live composer moves from the center of the empty view to the pinned
41
- * transcript position after the first message.
42
- */
43
- declare function AgentChatStartScreen({
44
- heading,
45
- composer,
46
- composerTray,
47
- lead,
48
- starters,
49
- className,
50
- "aria-label": ariaLabel,
51
- "aria-labelledby": ariaLabelledBy,
52
- ...props
53
- }: AgentChatStartScreenProps): React.JSX.Element;
54
- /** Semantic list for first-turn prompts below an `AgentChatStartScreen`. */
55
- declare function AgentChatStarterList({
56
- items,
57
- onSelect,
58
- onDismiss,
59
- className,
60
- ...props
61
- }: AgentChatStarterListProps): React.JSX.Element;
62
- interface AgentChatStarterProps extends Omit<ButtonProps, "color" | "iconOnly" | "size" | "variant"> {
63
- /** Decorative icon shown before the prompt label. */
64
- icon?: React.ReactNode;
65
- /** Render the prompt with quieter onboarding emphasis. */
66
- muted?: boolean;
67
- /** Optional independent action for removing a suggested prompt. */
68
- onDismiss?: React.MouseEventHandler<HTMLButtonElement>;
69
- /** Accessible name for the dismiss action. */
70
- dismissLabel?: string;
71
- }
72
- /** One full-width, keyboard-native starter prompt. */
73
- declare function AgentChatStarter({
74
- icon,
75
- muted,
76
- onDismiss,
77
- dismissLabel,
78
- children,
79
- className,
80
- type,
81
- ...props
82
- }: AgentChatStarterProps): React.JSX.Element;
83
- //#endregion
84
- export { AgentChatStarterList as a, AgentChatStarterItem as i, AgentChatStartScreenProps as n, AgentChatStarterListProps as o, AgentChatStarter as r, AgentChatStarterProps as s, AgentChatStartScreen as t };
@@ -1,46 +0,0 @@
1
- import * as React from "react";
2
- import { ChatStatus, UIMessage } from "ai";
3
-
4
- //#region src/components/ai-sdk/AgentMessageParts.d.ts
5
- type AgentMessagePart<MessageT extends UIMessage = UIMessage> = MessageT["parts"][number];
6
- interface AgentMessageRenderPartContext<MessageT extends UIMessage = UIMessage> {
7
- message: MessageT;
8
- part: AgentMessagePart<MessageT>;
9
- partIndex: number;
10
- defaultRender: () => React.ReactNode;
11
- }
12
- interface AgentMessagePartsProps<MessageT extends UIMessage = UIMessage> {
13
- /** The whole upstream AI SDK message whose parts should render in order. */
14
- message: MessageT;
15
- /** Drives native reasoning streaming UI. Settled messages default to `ready`. */
16
- status?: ChatStatus;
17
- /**
18
- * Override rendering per part. Return `undefined` to use the default renderer,
19
- * `null` to suppress the part, or call `defaultRender()` to compose the
20
- * built-in result into custom UI.
21
- *
22
- * The default renderer uses upstream helpers where available:
23
- * `isTextUIPart`, `isReasoningUIPart`, `isFileUIPart`, `isToolUIPart`,
24
- * `getToolName`, and the native AI SDK tool-part state fields. It
25
- * also renders native AI SDK `source-url`/`source-document` parts as a single
26
- * grouped `Sources` block when they appear consecutively, consolidates native
27
- * reasoning parts into one disclosure, and treats `step-start` as a silent
28
- * structural boundary. App-defined `data-*` parts stay whole and should be
29
- * narrowed with AI SDK's `isDataUIPart` inside this callback. If you override
30
- * source rendering, return a React node for every source part you want to
31
- * show; returning `undefined` keeps the upstream-shaped source-run grouping.
32
- */
33
- renderPart?: (context: AgentMessageRenderPartContext<MessageT>) => React.ReactNode | undefined;
34
- }
35
- /**
36
- * Renders the ordered parts of one whole AI SDK `UIMessage` without adding a
37
- * transcript, message wrapper, composer, or transport. Compose it inside
38
- * `Message` for read-only run previews and child-agent transcript rows.
39
- */
40
- declare function AgentMessageParts<MessageT extends UIMessage = UIMessage>({
41
- message,
42
- status,
43
- renderPart
44
- }: AgentMessagePartsProps<MessageT>): (React.JSX.Element | null)[];
45
- //#endregion
46
- export { AgentMessageRenderPartContext as i, AgentMessageParts as n, AgentMessagePartsProps as r, AgentMessagePart as t };
@@ -1,57 +0,0 @@
1
- import * as React from "react";
2
- import { UIMessage } from "ai";
3
- import { useAgentToolEvents } from "agents/react";
4
- import { AgentToolRunPart } from "agents/agent-tools";
5
-
6
- //#region src/components/agents-sdk/AgentToolRunsContext.d.ts
7
- /** The complete upstream retained-run hook result for one parent connection. */
8
- type AgentToolEventsValue<Part extends AgentToolRunPart = UIMessage["parts"][number]> = ReturnType<typeof useAgentToolEvents<Part>>;
9
- /** The live parent connection members the retained-run subscription reads. */
10
- type AgentToolEventSource = Parameters<typeof useAgentToolEvents>[0]["agent"] & {
11
- path: ReadonlyArray<{
12
- agent: string;
13
- name: string;
14
- }>;
15
- };
16
- /**
17
- * The one retained-run subscription for a parent connection: upstream
18
- * `useAgentToolEvents` scoped to the connection's source identity, so runs
19
- * from a previous thread cannot leak across a source swap. Call it beside the
20
- * `useAgent` call that owns the connection — the server replays retained runs
21
- * once per socket connect, so a later mount misses existing runs — and share
22
- * the one value with every surface that reads runs (the chat shell and a
23
- * run-detail route read the same projection, never two subscriptions).
24
- *
25
- * The subscription's listener attaches in a passive effect, after paint. A
26
- * host whose transport is in-process (the browser extension's port bridge)
27
- * can complete the connect and deliver the replay before that effect runs —
28
- * reliably so on a hot return from a drill-in. The fix lives in the Agents
29
- * SDK, not here: `useAgent` buffers `agent-tool-event` frames from socket
30
- * construction and `useAgentToolEvents` drains them when its listener
31
- * attaches (`_bufferAgentToolReplayFrame` is the seam for a non-`useAgent`
32
- * socket). As of agents 0.21.0 that is still the browser host's vendored
33
- * edit, not a published release; a host on the published package has to
34
- * buffer and re-dispatch the frames around its own socket before this hook
35
- * can see them. Network transports are not affected in practice: the round
36
- * trip loses to the effect flush.
37
- */
38
- declare function useSourceScopedAgentToolEvents<Part extends AgentToolRunPart = UIMessage["parts"][number]>(agent: AgentToolEventSource): {
39
- runsById: Record<string, import("agents").AgentToolRunState<Part>>;
40
- runsByToolCallId: Record<string, import("agents").AgentToolRunState<Part>[]>;
41
- unboundRuns: import("agents").AgentToolRunState<Part>[];
42
- getRunsForToolCall(toolCallId: string): import("agents").AgentToolRunState<Part>[];
43
- resetLocalState(): void;
44
- };
45
- interface AgentToolRunsProviderProps<Part extends AgentToolRunPart = UIMessage["parts"][number]> {
46
- /** Pass the whole `useAgentToolEvents({ agent })` result directly. */
47
- agentTools: AgentToolEventsValue<Part>;
48
- children: React.ReactNode;
49
- }
50
- /** Provides one parent connection's retained Agent Tool event projection. */
51
- declare function AgentToolRunsProvider<Part extends AgentToolRunPart = UIMessage["parts"][number]>({
52
- agentTools,
53
- children
54
- }: AgentToolRunsProviderProps<Part>): React.JSX.Element;
55
- declare function useOptionalAgentToolRuns<Part extends AgentToolRunPart = UIMessage["parts"][number]>(): AgentToolEventsValue<Part> | null;
56
- //#endregion
57
- export { useOptionalAgentToolRuns as a, AgentToolRunsProviderProps as i, AgentToolEventsValue as n, useSourceScopedAgentToolEvents as o, AgentToolRunsProvider as r, AgentToolEventSource as t };