@mcp-b/react-components 0.47.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 (274) 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-DMHZiw86.js → CodeBlock-g8sADidM.js} +7 -7
  7. package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
  8. package/dist/{FileTree-BHebfvkK.js → FileTree-H8mMg4rV.js} +20 -29
  9. package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
  10. package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
  11. package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
  12. package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
  13. package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
  14. package/dist/Separator-CzhtLYE1.d.ts +41 -0
  15. package/dist/Toolbar-CGY004u0.d.ts +155 -0
  16. package/dist/{Workspace-C_zHq9KZ.d.ts → Workspace-HzGrWDX3.d.ts} +14 -3
  17. package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
  18. package/dist/{WorkspaceFileView-ChIJz-fl.js → WorkspaceFileView-DYPtRVpM.js} +4 -3
  19. package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
  20. package/dist/{WorkspaceMessageResponse-Dg_aNpoj.js → WorkspaceMessageResponse-CUJk9_P5.js} +6 -3
  21. package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
  22. package/dist/components/agents-sdk/AgentChat.js +525 -670
  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 +1 -1
  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 +21 -13
  29. package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
  30. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
  31. package/dist/components/agents-sdk/BrowserRunPanel.js +31 -30
  32. package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
  33. package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
  34. package/dist/components/agents-sdk/ManagerOffice.d.ts +115 -85
  35. package/dist/components/agents-sdk/ManagerOffice.js +545 -1154
  36. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
  37. package/dist/components/agents-sdk/McpConnectionRequest.js +3 -2
  38. package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
  39. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
  40. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -2
  41. package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
  42. package/dist/components/agents-sdk/McpServerIcon.js +25 -0
  43. package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
  44. package/dist/components/agents-sdk/McpServerPicker.js +2 -1
  45. package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
  46. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  47. package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
  48. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  49. package/dist/components/agents-sdk/PromptInputCommands.js +1 -2
  50. package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
  51. package/dist/components/agents-sdk/SessionCompaction.js +2 -2
  52. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
  53. package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
  54. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
  55. package/dist/components/agents-sdk/SubagentRunIndicator.js +18 -23
  56. package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
  57. package/dist/components/agents-sdk/SubagentRunList.js +4 -2
  58. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
  59. package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
  60. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
  61. package/dist/components/agents-sdk/SubagentRunSelector.js +4 -2
  62. package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
  63. package/dist/components/agents-sdk/ThinkChat.js +233 -2
  64. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
  65. package/dist/components/agents-sdk/ThinkChatActivity.js +17 -9
  66. package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
  67. package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
  68. package/dist/components/agents-sdk/ThinkChatToolPanels.js +23 -18
  69. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  70. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  71. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
  72. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +158 -101
  73. package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
  74. package/dist/components/agents-sdk/ThinkFullApp.js +71 -285
  75. package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
  76. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
  77. package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
  78. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
  79. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +16 -14
  80. package/dist/components/agents-sdk/ThinkRoutineDetail.js +12 -12
  81. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
  82. package/dist/components/agents-sdk/ThinkRoutineForm.js +11 -11
  83. package/dist/components/agents-sdk/ThinkRoutineRuns.js +6 -6
  84. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
  85. package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
  86. package/dist/components/agents-sdk/Workspace.d.ts +2 -2
  87. package/dist/components/agents-sdk/Workspace.js +20 -23
  88. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  89. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  90. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +3 -2
  91. package/dist/components/agents-sdk/WorkspaceConcept.js +3 -3
  92. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +15 -10
  93. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +43 -40
  94. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +31 -31
  95. package/dist/components/agents-sdk/WorkspaceExecution.js +115 -192
  96. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
  97. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
  98. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  99. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  100. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  101. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  102. package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
  103. package/dist/components/agents-sdk/WorkspaceLive.js +33 -5
  104. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
  105. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  106. package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
  107. package/dist/components/agents-sdk/WorkspaceMountManager.js +5 -8
  108. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
  109. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
  110. package/dist/components/agents-sdk/WorkspaceProject.d.ts +44 -15
  111. package/dist/components/agents-sdk/WorkspaceProject.js +74 -51
  112. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
  113. package/dist/components/agents-sdk/WorkspaceUserScript.js +5 -2
  114. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  115. package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
  116. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
  117. package/dist/components/ai-sdk/AgentChatStartScreen.js +63 -42
  118. package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
  119. package/dist/components/ai-sdk/Approval.d.ts +1 -1
  120. package/dist/components/ai-sdk/Artifact.d.ts +2 -2
  121. package/dist/components/ai-sdk/Artifact.js +2 -2
  122. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  123. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  124. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  125. package/dist/components/ai-sdk/ComposerLink.js +1 -2
  126. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +16 -1
  127. package/dist/components/ai-sdk/ConnectedAppCards.js +69 -94
  128. package/dist/components/ai-sdk/Context.d.ts +7 -3
  129. package/dist/components/ai-sdk/Context.js +7 -17
  130. package/dist/components/ai-sdk/Conversation.d.ts +2 -2
  131. package/dist/components/ai-sdk/Correspondent.d.ts +2 -0
  132. package/dist/components/ai-sdk/Correspondent.js +145 -0
  133. package/dist/components/ai-sdk/Goal.d.ts +3 -3
  134. package/dist/components/ai-sdk/Goal.js +2 -2
  135. package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
  136. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  137. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  138. package/dist/components/ai-sdk/Message.d.ts +2 -2
  139. package/dist/components/ai-sdk/Message.js +11 -2
  140. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  141. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
  142. package/dist/components/ai-sdk/MessageScrollerVirtual.js +38 -4
  143. package/dist/components/ai-sdk/Plan.d.ts +1 -1
  144. package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
  145. package/dist/components/ai-sdk/PromptInput.js +170 -226
  146. package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
  147. package/dist/components/ai-sdk/Queue.d.ts +28 -5
  148. package/dist/components/ai-sdk/Queue.js +19 -4
  149. package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
  150. package/dist/components/ai-sdk/Reasoning.js +4 -4
  151. package/dist/components/ai-sdk/Sources.d.ts +1 -1
  152. package/dist/components/ai-sdk/Task.d.ts +1 -1
  153. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
  154. package/dist/components/extension/CodexModelSelector.d.ts +5 -0
  155. package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
  156. package/dist/components/extension/ConversationTabPicker.js +1 -1
  157. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  158. package/dist/components/foundations/AppIcon.d.ts +3 -2
  159. package/dist/components/foundations/Autocomplete.js +6 -1
  160. package/dist/components/foundations/Avatar.d.ts +1 -121
  161. package/dist/components/foundations/Button.d.ts +1 -1
  162. package/dist/components/foundations/Card.d.ts +22 -27
  163. package/dist/components/foundations/Card.js +51 -32
  164. package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
  165. package/dist/components/foundations/Collapsible.d.ts +1 -1
  166. package/dist/components/foundations/Combobox.js +6 -1
  167. package/dist/components/foundations/Dialog.d.ts +106 -1
  168. package/dist/components/foundations/EmptyState.d.ts +1 -1
  169. package/dist/components/foundations/Field.d.ts +2 -1
  170. package/dist/components/foundations/Fieldset.d.ts +1 -1
  171. package/dist/components/foundations/Form.d.ts +4 -4
  172. package/dist/components/foundations/IconButton.d.ts +1 -1
  173. package/dist/components/foundations/Label.d.ts +1 -1
  174. package/dist/components/foundations/LinkButton.d.ts +2 -2
  175. package/dist/components/foundations/Meter.d.ts +1 -1
  176. package/dist/components/foundations/NumberField.d.ts +1 -1
  177. package/dist/components/foundations/ScrollArea.d.ts +1 -1
  178. package/dist/components/foundations/SearchField.d.ts +1 -1
  179. package/dist/components/foundations/Select.js +6 -1
  180. package/dist/components/foundations/Separator.d.ts +1 -40
  181. package/dist/components/foundations/Stepper.d.ts +1 -1
  182. package/dist/components/foundations/Textarea.d.ts +1 -1
  183. package/dist/components/foundations/Toast.d.ts +5 -1
  184. package/dist/components/foundations/Toggle.d.ts +70 -1
  185. package/dist/components/foundations/ToggleGroup.d.ts +3 -2
  186. package/dist/components/foundations/Toolbar.d.ts +1 -151
  187. package/dist/components/foundations/TransitionSurface.d.ts +1 -1
  188. package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
  189. package/dist/components/general-purpose/ActionGuide.js +4 -18
  190. package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
  191. package/dist/components/general-purpose/Commit.d.ts +2 -2
  192. package/dist/components/general-purpose/Commit.js +1 -1
  193. package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
  194. package/dist/components/general-purpose/FileTree.d.ts +1 -7
  195. package/dist/components/general-purpose/FileTree.js +1 -1
  196. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  197. package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
  198. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  199. package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
  200. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
  201. package/dist/components/general-purpose/ResponsiveSidebarShell.js +119 -101
  202. package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
  203. package/dist/components/general-purpose/SettingsFormDialog.js +40 -70
  204. package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
  205. package/dist/components/general-purpose/SetupChecklist.js +76 -1
  206. package/dist/components/general-purpose/Terminal.d.ts +3 -3
  207. package/dist/components/general-purpose/Terminal.js +10 -5
  208. package/dist/components/general-purpose/TestResults.d.ts +23 -11
  209. package/dist/components/general-purpose/TestResults.js +48 -50
  210. package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
  211. package/dist/components/general-purpose/WebPreview.d.ts +29 -4
  212. package/dist/components/general-purpose/WebPreview.js +37 -12
  213. package/dist/components/nanites/AgentConnection.js +1 -1
  214. package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
  215. package/dist/components/nanites/AgentToolDetail.js +20 -41
  216. package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
  217. package/dist/mcp-server-mAErsxHU.js +27 -0
  218. package/dist/styles/activity.css +1 -96
  219. package/dist/styles/agent-chat.css +75 -102
  220. package/dist/styles/agent-tool-detail.css +0 -16
  221. package/dist/styles/base.css +3 -3
  222. package/dist/styles/browser-run-panel.css +1 -15
  223. package/dist/styles/button.css +7 -1
  224. package/dist/styles/code-block.css +12 -0
  225. package/dist/styles/composition-motion.css +0 -2
  226. package/dist/styles/correspondent.css +73 -0
  227. package/dist/styles/employee-chrome.css +43 -0
  228. package/dist/styles/file-tree.css +5 -0
  229. package/dist/styles/index.css +5 -2
  230. package/dist/styles/manager-office.css +380 -1086
  231. package/dist/styles/message.css +2 -10
  232. package/dist/styles/queue.css +71 -0
  233. package/dist/styles/subagent-run.css +122 -6
  234. package/dist/styles/test-results.css +2 -5
  235. package/dist/styles/think-chat-activity.css +13 -0
  236. package/dist/styles/think-chat-tool-panels.css +81 -0
  237. package/dist/styles/think-execution-workbench.css +2 -8
  238. package/dist/styles/think-full-app.css +42 -251
  239. package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
  240. package/dist/styles/web-preview.css +15 -1
  241. package/dist/utils/mcp-server-catalog.d.ts +1112 -2
  242. package/dist/utils/mcp-server-catalog.js +28 -9
  243. package/dist/utils/structured-code.d.ts +1 -1
  244. package/dist/{workspace-assets-CxpEHsac.js → workspace-assets-Bg7XhPsk.js} +16 -2
  245. package/package.json +7 -3
  246. package/dist/AgentChat-BLmQghkt.d.ts +0 -327
  247. package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
  248. package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
  249. package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
  250. package/dist/Dialog-B_FhRWaz.d.ts +0 -107
  251. package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
  252. package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
  253. package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
  254. package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
  255. package/dist/SetupChecklist-CwRjIDH4.js +0 -77
  256. package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
  257. package/dist/ThinkChat-DLDta57t.js +0 -332
  258. package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
  259. package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
  260. package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
  261. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
  262. package/dist/Toggle-DLrIf5YH.d.ts +0 -69
  263. package/dist/WorkspaceLive-DLGhtIly.d.ts +0 -49
  264. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
  265. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
  266. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
  267. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
  268. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
  269. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
  270. package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
  271. package/dist/mcp-server-7NR24ASj.js +0 -69
  272. package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
  273. package/dist/styles/think-sidepanel.css +0 -78
  274. package/dist/think-agent-Cip5KAPj.d.ts +0 -7
@@ -1,4 +1,4 @@
1
- import { o as McpServerCard } from "../../mcp-server-catalog-C_g7C-9o.js";
1
+ import { McpServerCard } from "../../utils/mcp-server-catalog.js";
2
2
  import * as React from "react";
3
3
  import { DynamicToolUIPart, ToolUIPart } from "ai";
4
4
  import { MCPServersState } from "agents";
@@ -20,10 +20,10 @@ interface McpConnectionRequestBaseProps extends Omit<React.HTMLAttributes<HTMLDi
20
20
  onDecline?: () => void | Promise<void>;
21
21
  }
22
22
  type McpConnectionRequestProps = (McpConnectionRequestBaseProps & {
23
- /** A live authorization outcome must identify its assigned Agents MCP entry. */outcome: "authorization-required";
23
+ /** A live authorization outcome must identify its assigned Agents MCP entry. */outcome: "authorization-required"; /** Agents MCP entry assigned to this authorization request. */
24
24
  serverId: string;
25
25
  }) | (McpConnectionRequestBaseProps & {
26
- /** App-validated terminal outcome, or omitted while the request is active. */outcome?: Exclude<McpConnectionRequestOutcome, "authorization-required">;
26
+ /** App-validated terminal outcome, or omitted while the request is active. */outcome?: Exclude<McpConnectionRequestOutcome, "authorization-required">; /** Unused unless the outcome requires authorization. */
27
27
  serverId?: never;
28
28
  });
29
29
  /**
@@ -32,7 +32,7 @@ type McpConnectionRequestProps = (McpConnectionRequestBaseProps & {
32
32
  * same `onConnect` seam instead of introducing recovery operations.
33
33
  */
34
34
  declare function McpConnectionRequest(props: McpConnectionRequestProps & {
35
- ref?: React.Ref<HTMLDivElement>;
35
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
36
36
  }): React.JSX.Element;
37
37
  //#endregion
38
38
  export { McpConnectionRequest, McpConnectionRequestOutcome, McpConnectionRequestProps };
@@ -2,9 +2,10 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
2
  import { K as SpinnerIcon, d as CheckIcon, et as WarningIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
5
- import { r as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-7NR24ASj.js";
6
- import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
5
+ import { McpServerIcon } from "./McpServerIcon.js";
7
6
  import { DescriptionList } from "../foundations/DescriptionList.js";
7
+ import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
8
+ import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
8
9
  import * as React from "react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  import { getToolPartState } from "@cloudflare/think/react";
@@ -1,2 +1,39 @@
1
- import { n as McpConnectorFormProps, r as McpConnectorFormValues, t as McpConnectorForm } from "../../McpConnectorForm-CeYNY0MI.js";
1
+ import { McpServerSetupAuth, McpServerSetupAuthFieldName } from "../../utils/mcp-server-catalog.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/agents-sdk/McpConnectorForm.d.ts
5
+ type CredentialFieldName = Exclude<McpServerSetupAuthFieldName, "redirectUrl">;
6
+ type McpConnectorFormValues = Readonly<Partial<Record<CredentialFieldName, string>> & {
7
+ readonly name: string;
8
+ readonly url: string;
9
+ }>;
10
+ type McpConnectorFormProps = Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "status"> & {
11
+ /** Authentication metadata that decides which credential fields render. */readonly auth?: McpServerSetupAuth; /** Initial connector values. Publisher client credentials remain app-owned. */
12
+ readonly defaults?: Partial<McpConnectorFormValues>; /** Optional pattern used to validate the MCP name field. */
13
+ readonly namePattern?: string; /** Keep a catalog-owned MCP name and URL visible but immutable. */
14
+ readonly readOnlyServer?: boolean; /** Read-only redirect URL shown for manual OAuth client setup. */
15
+ readonly redirectUrl?: string; /** Inline connection status announced politely to assistive tech. */
16
+ readonly status?: React.ReactNode; /** Label for the submit button. */
17
+ readonly submitLabel?: string; /** Label shown while submit is pending. */
18
+ readonly submittingLabel?: string; /** Called with normalized connector values after native form validation passes. */
19
+ readonly onSubmit: (values: McpConnectorFormValues) => void | Promise<void>;
20
+ };
21
+ /** Collects MCP connector settings and optional credentials with native form validation. */
22
+ declare function McpConnectorForm({
23
+ auth,
24
+ className,
25
+ defaults,
26
+ namePattern,
27
+ readOnlyServer,
28
+ redirectUrl,
29
+ status,
30
+ submitLabel,
31
+ submittingLabel,
32
+ onSubmit,
33
+ ref,
34
+ ...props
35
+ }: McpConnectorFormProps & {
36
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLFormElement>;
37
+ }): React.JSX.Element;
38
+ //#endregion
2
39
  export { McpConnectorForm, McpConnectorFormProps, McpConnectorFormValues };
@@ -1,2 +1,94 @@
1
- import { a as McpPluginDetailsDialogProps, i as McpPluginDetailsDialog, n as McpPluginCatalogProps, r as McpPluginDetails, t as McpPluginCatalog } from "../../McpPluginCatalog-3qWu8oK1.js";
1
+ import { McpServerCard } from "../../utils/mcp-server-catalog.js";
2
+ import { McpConnectorFormValues } from "./McpConnectorForm.js";
3
+ import { DialogProps } from "../foundations/Dialog.js";
4
+ import * as React from "react";
5
+ import { MCPServersState } from "agents";
6
+
7
+ //#region src/components/agents-sdk/McpPluginCatalog.d.ts
8
+ /** Optional plugin-specific copy layered over the canonical MCP server card. */
9
+ interface McpPluginDetails {
10
+ developerName?: string;
11
+ marketplaceName?: string;
12
+ longDescription?: string;
13
+ capabilities?: readonly string[];
14
+ skills?: readonly string[];
15
+ }
16
+ interface McpPluginCatalogProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
17
+ /** Canonical connector cards. The directory does not create a second plugin registry. */
18
+ servers: readonly McpServerCard[];
19
+ /** Upstream Agents MCP state used to project connected and recovery states. */
20
+ mcp?: MCPServersState;
21
+ /** Optional plugin metadata keyed by the canonical server ID. */
22
+ detailsByServerId?: Readonly<Record<string, McpPluginDetails | undefined>>;
23
+ /** Server IDs promoted into the Featured section, in display order. */
24
+ featuredServerIds?: readonly string[];
25
+ /** Host product name paired with the plugin in the connection dialog. */
26
+ brandName?: string;
27
+ /** Host product mark paired with the plugin in the connection dialog. */
28
+ brandLogo?: React.ReactNode;
29
+ /** Product-authored trust and data-sharing copy. Pass null to omit it. */
30
+ disclosure?: React.ReactNode;
31
+ /** Starts or recovers the existing MCP connection path. */
32
+ onConnect?: (server: McpServerCard) => void | Promise<void>;
33
+ /** Removes the exact upstream MCP entry. */
34
+ onDisconnect?: (serverId: string) => void | Promise<void>;
35
+ /**
36
+ * Connects a user-supplied MCP server. Providing it puts the "Custom
37
+ * plugin" action in the bar, opening the shared connector setup dialog.
38
+ */
39
+ onAddCustom?: (values: McpConnectorFormValues) => void | Promise<void>;
40
+ /** Accessible name only — the hosting tab or icon is the visible title. */
41
+ heading?: React.ReactNode;
42
+ /** Accessible label and placeholder for the plugin filter. */
43
+ searchLabel?: string;
44
+ /** Content shown when no plugins match the current filter. */
45
+ emptyMessage?: React.ReactNode;
46
+ }
47
+ interface McpPluginDetailsDialogProps {
48
+ /** Selected canonical server card. Passing null closes the dialog. */
49
+ server: McpServerCard | null;
50
+ details?: McpPluginDetails;
51
+ mcp?: MCPServersState;
52
+ brandName?: string;
53
+ brandLogo?: React.ReactNode;
54
+ disclosure?: React.ReactNode;
55
+ onConnect?: (server: McpServerCard) => void | Promise<void>;
56
+ onDisconnect?: (serverId: string) => void | Promise<void>;
57
+ onOpenChange: NonNullable<DialogProps["onOpenChange"]>;
58
+ }
59
+ /**
60
+ * Searchable plugin directory backed by the same MCP cards and live Agents
61
+ * state as {@link McpServerPicker}. Selecting a row opens the shared details
62
+ * dialog; connecting still delegates to the host's existing MCP/OAuth path.
63
+ */
64
+ declare function McpPluginCatalog({
65
+ servers,
66
+ mcp,
67
+ detailsByServerId,
68
+ featuredServerIds,
69
+ brandName,
70
+ brandLogo,
71
+ disclosure,
72
+ onConnect,
73
+ onDisconnect,
74
+ onAddCustom,
75
+ heading,
76
+ searchLabel,
77
+ emptyMessage,
78
+ className,
79
+ ...props
80
+ }: McpPluginCatalogProps): React.JSX.Element;
81
+ /** Reference-derived plugin detail surface without a parallel install state. */
82
+ declare function McpPluginDetailsDialog({
83
+ server,
84
+ details,
85
+ mcp,
86
+ brandName,
87
+ brandLogo,
88
+ disclosure,
89
+ onConnect,
90
+ onDisconnect,
91
+ onOpenChange
92
+ }: McpPluginDetailsDialogProps): React.JSX.Element;
93
+ //#endregion
2
94
  export { McpPluginCatalog, McpPluginCatalogProps, McpPluginDetails, McpPluginDetailsDialog, McpPluginDetailsDialogProps };
@@ -6,10 +6,11 @@ import { IconButton } from "../foundations/IconButton.js";
6
6
  import { Dialog } from "../foundations/Dialog.js";
7
7
  import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
8
8
  import { AppIcon } from "../foundations/AppIcon.js";
9
- import { r as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-7NR24ASj.js";
9
+ import { McpServerIcon } from "./McpServerIcon.js";
10
+ import { SearchField } from "../foundations/SearchField.js";
10
11
  import { Separator } from "../foundations/Separator.js";
11
12
  import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
12
- import { SearchField } from "../foundations/SearchField.js";
13
+ import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
13
14
  import { McpServerSetupDialog } from "./McpServerPicker.js";
14
15
  import * as React from "react";
15
16
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,17 @@
1
+ import { McpServerCard } from "../../utils/mcp-server-catalog.js";
2
+ import { AppIconSize, AppIconVariant } from "../foundations/AppIcon.js";
3
+
4
+ //#region src/components/agents-sdk/McpServerIcon.d.ts
5
+ interface McpServerIconProps {
6
+ server: McpServerCard;
7
+ size?: AppIconSize;
8
+ variant?: AppIconVariant;
9
+ }
10
+ /** Catalog-backed MCP identity mark. The owning control supplies its accessible name. */
11
+ declare function McpServerIcon({
12
+ server,
13
+ size,
14
+ variant
15
+ }: McpServerIconProps): import("react").JSX.Element;
16
+ //#endregion
17
+ export { McpServerIcon, McpServerIconProps };
@@ -0,0 +1,25 @@
1
+ import { findCatalogMcpServerCard, getMcpServerIconSrc } from "../../utils/mcp-server-catalog.js";
2
+ import { AppIcon } from "../foundations/AppIcon.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/agents-sdk/McpServerIcon.tsx
5
+ /** Catalog-backed MCP identity mark. The owning control supplies its accessible name. */
6
+ function McpServerIcon({ server, size = "lg", variant }) {
7
+ const resolved = server.icon == null ? findCatalogMcpServerCard({
8
+ id: server.id,
9
+ name: server.name,
10
+ url: server.url
11
+ }) ?? server : server;
12
+ const src = getMcpServerIconSrc(resolved);
13
+ return /* @__PURE__ */ jsxs(AppIcon.Root, {
14
+ size,
15
+ variant,
16
+ "aria-hidden": "true",
17
+ children: [src ? /* @__PURE__ */ jsx(AppIcon.Image, {
18
+ alt: "",
19
+ fit: "contain",
20
+ src
21
+ }, src) : null, /* @__PURE__ */ jsx(AppIcon.Fallback, { children: resolved.name.slice(0, 1) })]
22
+ });
23
+ }
24
+ //#endregion
25
+ export { McpServerIcon };
@@ -1,7 +1,7 @@
1
1
  import { s as MenuItemProps, t as Menu } from "../../Menu-yb6QXWA3.js";
2
- import { o as McpServerCard } from "../../mcp-server-catalog-C_g7C-9o.js";
3
- import { n as McpConnectorFormProps } from "../../McpConnectorForm-CeYNY0MI.js";
4
- import { l as DialogProps } from "../../Dialog-B_FhRWaz.js";
2
+ import { McpServerCard } from "../../utils/mcp-server-catalog.js";
3
+ import { McpConnectorFormProps } from "./McpConnectorForm.js";
4
+ import { DialogProps } from "../foundations/Dialog.js";
5
5
  import * as React from "react";
6
6
  import { MCPServersState } from "agents";
7
7
 
@@ -17,6 +17,7 @@ interface McpServerPickerProps {
17
17
  onDisconnect?: (serverId: string) => void | Promise<void>;
18
18
  /** App-owned connection actions shown before the server catalog. */
19
19
  actions?: readonly McpServerPickerActionItem[];
20
+ /** Visible heading for the app-owned actions group. */
20
21
  actionsLabel?: React.ReactNode;
21
22
  /** Offset from the plus trigger to the menu, useful for prompt composers. */
22
23
  sideOffset?: number;
@@ -3,9 +3,10 @@ import { K as SpinnerIcon, N as MinusIcon, d as CheckIcon, et as WarningIcon } f
3
3
  import { buttonVariants } from "../foundations/Button.js";
4
4
  import { Dialog } from "../foundations/Dialog.js";
5
5
  import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
6
- import { r as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-7NR24ASj.js";
7
6
  import { Menu } from "../foundations/Menu.js";
8
7
  import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
8
+ import { McpServerIcon } from "./McpServerIcon.js";
9
+ import { t as getMcpServerProjection } from "../../mcp-server-mAErsxHU.js";
9
10
  import { McpConnectorForm } from "./McpConnectorForm.js";
10
11
  import * as React from "react";
11
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { r as ButtonProps } from "../../Button-CZt3yywF.js";
2
- import { l as DialogProps } from "../../Dialog-B_FhRWaz.js";
3
- import { SeparatorProps } from "../foundations/Separator.js";
1
+ import { r as ButtonProps } from "../../Button-DjONW5UW.js";
2
+ import { DialogProps } from "../foundations/Dialog.js";
3
+ import { n as SeparatorProps } from "../../Separator-CzhtLYE1.js";
4
4
  import * as React from "react";
5
5
  import Cloudflare from "cloudflare";
6
6
  import { AiModelsSearchObject } from "@cloudflare/workers-types";
@@ -110,7 +110,7 @@ declare function ModelSelector({
110
110
  ref,
111
111
  ...props
112
112
  }: ModelSelectorProps & {
113
- ref?: React.Ref<HTMLDivElement>;
113
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
114
114
  }): React.JSX.Element;
115
115
  declare function CloudflareModelSelector({
116
116
  models,
@@ -3,11 +3,11 @@ import { U as SearchIcon, f as ChevronDownIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { Dialog } from "../foundations/Dialog.js";
5
5
  import { c as titleCase } from "../../format-COCyV98Z.js";
6
- import { Separator } from "../foundations/Separator.js";
7
- import { EmptyState } from "../foundations/EmptyState.js";
8
- import { ScrollArea } from "../foundations/ScrollArea.js";
9
6
  import { Autocomplete } from "../foundations/Autocomplete.js";
7
+ import { ScrollArea } from "../foundations/ScrollArea.js";
8
+ import { EmptyState } from "../foundations/EmptyState.js";
10
9
  import { t as ProviderLogo } from "../../provider-logos-DWYY8wNz.js";
10
+ import { Separator } from "../foundations/Separator.js";
11
11
  import * as React from "react";
12
12
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
13
  import { createPortal } from "react-dom";
@@ -1,44 +1,2 @@
1
- import * as React from "react";
2
- import { ChatAddToolApproveResponseFunction, DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
3
- import { PendingApproval, Think } from "@cloudflare/think";
4
- import { AgentStub } from "agents/client";
5
-
6
- //#region src/components/agents-sdk/PromptInputApproval.d.ts
7
- /** The id a response must carry: the approval id, or the paused run's executionId. */
8
- declare function getApprovalRequestId(part: ToolUIPart | DynamicToolUIPart): string | undefined;
9
- /** Component-local identity: paused executions can ask for multiple approvals. */
10
- declare function getApprovalStateKey(part: ToolUIPart | DynamicToolUIPart): string | undefined;
11
- /** Derives pending tool approvals straight from the messages — no app-owned shapes. */
12
- declare function getPendingToolApprovals(messages: readonly UIMessage[], {
13
- pausedExecutions
14
- }?: {
15
- pausedExecutions?: boolean;
16
- }): Array<ToolUIPart | DynamicToolUIPart>;
17
- interface PromptInputApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
18
- part?: ToolUIPart | DynamicToolUIPart;
19
- approval?: PendingApproval;
20
- onRespond?: ChatAddToolApproveResponseFunction;
21
- thinkStub?: AgentStub<Think>;
22
- onExecutionSettled?: () => void | Promise<void>;
23
- onSkip?: () => void;
24
- question?: React.ReactNode;
25
- count?: number;
26
- }
27
- /** Adapts AI SDK and Think approval states into the prompt-input approval surface. */
28
- declare function PromptInputApproval({
29
- part,
30
- approval: durableApproval,
31
- onRespond,
32
- thinkStub,
33
- onExecutionSettled,
34
- onSkip,
35
- question,
36
- count,
37
- className,
38
- ref,
39
- ...props
40
- }: PromptInputApprovalProps & {
41
- ref?: React.Ref<HTMLDivElement>;
42
- }): React.JSX.Element | null;
43
- //#endregion
1
+ import { a as getPendingToolApprovals, i as getApprovalStateKey, n as PromptInputApprovalProps, r as getApprovalRequestId, t as PromptInputApproval } from "../../PromptInputApproval-D2hpn54U.js";
44
2
  export { PromptInputApproval, PromptInputApprovalProps, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals };
@@ -1,4 +1,4 @@
1
- import { D as PromptInputCommandDefinition } from "../../PromptInput-DtJHyp0S.js";
1
+ import { D as PromptInputCommandDefinition } from "../../PromptInput-C4Mofitz.js";
2
2
  import { ConversationTabPickerItem } from "../extension/ConversationTabPicker.js";
3
3
  import { MCPServersState } from "agents";
4
4
  import { SkillDescriptor } from "agents/skills";
@@ -1,7 +1,6 @@
1
1
  import { composerLinkHref } from "../../utils/composer-link.js";
2
- import { getMcpServerIconSrc } from "../../utils/mcp-server-catalog.js";
2
+ import { findCatalogMcpServerCard, getMcpServerIconSrc } from "../../utils/mcp-server-catalog.js";
3
3
  import { A as McpIcon, c as BoxIcon } from "../../icons-cuEtsgj9.js";
4
- import { n as findCatalogMcpServerCard } from "../../mcp-server-7NR24ASj.js";
5
4
  import { jsx } from "react/jsx-runtime";
6
5
  //#region src/components/agents-sdk/PromptInputCommands.tsx
7
6
  function mcpServerCommandIcon(server) {
@@ -1,2 +1,89 @@
1
- import { a as UseSessionCompactionOptions, c as parseSessionStatusFrame, i as SessionStatusPhase, l as useSessionCompaction, n as SessionFrameSource, o as UseSessionCompactionResult, r as SessionStatusFrame, s as parseSessionErrorFrame, t as SessionCompactionSize } from "../../SessionCompaction-CmTJFpzj.js";
1
+ import { ChatStatus, UIMessage } from "ai";
2
+
3
+ //#region src/components/agents-sdk/SessionCompaction.d.ts
4
+ type SessionStatusPhase = "idle" | "compacting";
5
+ interface SessionStatusFrame {
6
+ phase: SessionStatusPhase;
7
+ /** Present on the idle frame that follows a successful compaction. */
8
+ compacted: boolean;
9
+ /**
10
+ * Session's own estimate for the history this frame describes, or null when
11
+ * the frame omits it or carries a non-finite value. Not provider-reported
12
+ * usage — never render it as an exact token count, and never feed it to the
13
+ * `Context` ring, which reads `metadata.usage`.
14
+ */
15
+ tokenEstimate: number | null;
16
+ /**
17
+ * The same estimate taken before the compaction this frame reports, from its
18
+ * `compacted` payload. Null on every other frame. Both numbers come from one
19
+ * estimator over one history, so their difference is a meaningful size even
20
+ * though neither is exact.
21
+ */
22
+ tokensBefore: number | null;
23
+ }
24
+ /**
25
+ * Parse a raw websocket payload as a `cf_agent_session` status frame.
26
+ * Returns null for every other frame on the connection.
27
+ */
28
+ declare function parseSessionStatusFrame(data: unknown): SessionStatusFrame | null;
29
+ /**
30
+ * Parse a raw websocket payload as a `cf_agent_session_error` frame,
31
+ * returning its error text. Null for every other frame on the connection.
32
+ */
33
+ declare function parseSessionErrorFrame(data: unknown): string | null;
34
+ /** The message-frame surface of a `useAgent` connection. */
35
+ interface SessionFrameSource {
36
+ addEventListener(type: "message", listener: (event: MessageEvent) => void): void;
37
+ removeEventListener(type: "message", listener: (event: MessageEvent) => void): void;
38
+ }
39
+ interface UseSessionCompactionOptions<MessageT extends UIMessage> {
40
+ /** The conversation agent's `useAgent` connection. */
41
+ agent: SessionFrameSource;
42
+ /** The conversation's `useAgentChat` value (status + local view setter). */
43
+ chat: {
44
+ status: ChatStatus;
45
+ setMessages: (messages: MessageT[]) => void;
46
+ };
47
+ /** Server read used to reload the transcript after a compaction lands. */
48
+ getMessages: () => Promise<MessageT[]>;
49
+ }
50
+ /**
51
+ * How much a landed compaction shortened the history, per Session's own
52
+ * estimator. A UI may show the difference as an approximate size; it must not
53
+ * present either number as exact usage.
54
+ */
55
+ interface SessionCompactionSize {
56
+ tokensBefore: number;
57
+ tokensAfter: number;
58
+ }
59
+ interface UseSessionCompactionResult {
60
+ compacting: boolean;
61
+ /**
62
+ * Size of the compaction that landed most recently on this connection, or
63
+ * null when none has landed or the frames carried no usable estimates. A new
64
+ * object per compaction, so a consumer can dismiss one acknowledgement by
65
+ * identity and still show the next. Cleared when the next compaction starts.
66
+ */
67
+ lastCompaction: SessionCompactionSize | null;
68
+ /**
69
+ * Set when the post-compaction transcript reload rejected — the local view
70
+ * is stale relative to the server until a retry succeeds. Surface it
71
+ * ("Transcript may be out of date"); the hook retries on the next status
72
+ * transition to `"ready"`.
73
+ */
74
+ reloadError: unknown;
75
+ /**
76
+ * Error text from the last `cf_agent_session_error` frame — the only signal
77
+ * a user who ran /compact gets when the server-side compaction itself fails
78
+ * (the phase just flips back to idle with no `compacted` payload). Cleared
79
+ * when the next compaction starts.
80
+ */
81
+ sessionError: string | null;
82
+ }
83
+ declare function useSessionCompaction<MessageT extends UIMessage>({
84
+ agent,
85
+ chat,
86
+ getMessages
87
+ }: UseSessionCompactionOptions<MessageT>): UseSessionCompactionResult;
88
+ //#endregion
2
89
  export { SessionCompactionSize, SessionFrameSource, SessionStatusFrame, SessionStatusPhase, UseSessionCompactionOptions, UseSessionCompactionResult, parseSessionErrorFrame, parseSessionStatusFrame, useSessionCompaction };
@@ -15,8 +15,8 @@ import * as React from "react";
15
15
  * the end of the turn when one is streaming, so a mid-turn proactive
16
16
  * compaction never clobbers streamed state.
17
17
  *
18
- * The composer half is AgentChat's built-in `/compact` entry: pass the
19
- * app's compaction callable as its `onCompact` prop.
18
+ * Compose the command with `useAgentChatCompaction`: supply the app's
19
+ * compaction callable, then place its command and notice explicitly.
20
20
  *
21
21
  * This module is the "local adapter … documented runtime-only mirror" that
22
22
  * docs/think-session-ui.md calls for: upstream exports no payload types or
@@ -1,6 +1,35 @@
1
+ import { n as AgentToolRunValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
1
2
  import * as React from "react";
2
3
 
3
4
  //#region src/components/agents-sdk/SubagentRunDetails.d.ts
5
+ interface SubagentRunMetadataProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
6
+ run: AgentToolRunValue;
7
+ /** Product-owned milestone payloads stay whole; the default displays their names. */
8
+ renderMilestone?: (milestone: NonNullable<AgentToolRunValue["milestones"]>[number]) => React.ReactNode;
9
+ }
10
+ /** Full retained evidence, without a connection, transcript provider or second app bar. */
11
+ declare function SubagentRunMetadata({
12
+ run,
13
+ renderMilestone,
14
+ className,
15
+ ...props
16
+ }: SubagentRunMetadataProps): React.JSX.Element;
17
+ interface SubagentRunReportProps {
18
+ run: AgentToolRunValue;
19
+ renderMilestone?: SubagentRunMetadataProps["renderMilestone"];
20
+ className?: string;
21
+ }
22
+ /**
23
+ * The run's retained report and progress as a disclosure above its transcript
24
+ * on the employee run route. Open state is keyed by run through the enclosing
25
+ * ExpansionStateProvider (the panel's `reportDisclosures` store), so a report
26
+ * collapsed once stays collapsed across drill-in navigation.
27
+ */
28
+ declare function SubagentRunReport({
29
+ run,
30
+ renderMilestone,
31
+ className
32
+ }: SubagentRunReportProps): React.JSX.Element;
4
33
  interface SubagentRunProgressProps extends React.HTMLAttributes<HTMLDivElement> {
5
34
  /** Human-readable current action or phase. */
6
35
  label: string;
@@ -33,4 +62,4 @@ declare function SubagentRunMilestone({
33
62
  ref?: React.Ref<HTMLLIElement>;
34
63
  }): React.JSX.Element;
35
64
  //#endregion
36
- export { SubagentRunMilestone, SubagentRunMilestoneProps, SubagentRunMilestones, SubagentRunMilestonesProps, SubagentRunProgress, SubagentRunProgressProps };
65
+ export { SubagentRunMetadata, SubagentRunMetadataProps, SubagentRunMilestone, SubagentRunMilestoneProps, SubagentRunMilestones, SubagentRunMilestonesProps, SubagentRunProgress, SubagentRunProgressProps, SubagentRunReport, SubagentRunReportProps };
@@ -1,9 +1,65 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { Collapsible } from "../foundations/Collapsible.js";
3
+ import { useExpansionState } from "../ai-sdk/ExpansionState.js";
2
4
  import { n as clamp } from "../../format-COCyV98Z.js";
3
5
  import { Progress } from "../foundations/Progress.js";
4
6
  import * as React from "react";
5
7
  import { jsx, jsxs } from "react/jsx-runtime";
6
8
  //#region src/components/agents-sdk/SubagentRunDetails.tsx
9
+ /** Full retained evidence, without a connection, transcript provider or second app bar. */
10
+ function SubagentRunMetadata({ run, renderMilestone, className, ...props }) {
11
+ const progressLabel = run.progress?.message ?? run.progress?.phase;
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ className: cx("subagent-run__metadata", className),
14
+ ...props,
15
+ children: [
16
+ progressLabel ? /* @__PURE__ */ jsx(SubagentRunProgress, {
17
+ label: progressLabel,
18
+ value: run.progress?.fraction
19
+ }) : null,
20
+ run.milestones?.length ? /* @__PURE__ */ jsx(SubagentRunMilestones, {
21
+ "aria-label": "Run milestones",
22
+ children: run.milestones.map((milestone) => /* @__PURE__ */ jsx(SubagentRunMilestone, { children: renderMilestone ? renderMilestone(milestone) : milestone.name }, milestone.sequence))
23
+ }) : null,
24
+ run.childStillRunning !== false && (run.status === "interrupted" || run.status === "aborted") ? /* @__PURE__ */ jsx("p", {
25
+ role: "status",
26
+ children: "The child may still be running."
27
+ }) : null,
28
+ run.error ? /* @__PURE__ */ jsx("p", {
29
+ role: "alert",
30
+ children: run.error
31
+ }) : null,
32
+ run.summary ? /* @__PURE__ */ jsx("p", { children: run.summary }) : null
33
+ ]
34
+ });
35
+ }
36
+ /**
37
+ * The run's retained report and progress as a disclosure above its transcript
38
+ * on the employee run route. Open state is keyed by run through the enclosing
39
+ * ExpansionStateProvider (the panel's `reportDisclosures` store), so a report
40
+ * collapsed once stays collapsed across drill-in navigation.
41
+ */
42
+ function SubagentRunReport({ run, renderMilestone, className }) {
43
+ const [open, setOpen] = useExpansionState(`run-report:${run.runId}`, true);
44
+ return /* @__PURE__ */ jsxs(Collapsible.Root, {
45
+ "data-slot": "subagent-run-report",
46
+ className: cx("subagent-run__report", className),
47
+ open,
48
+ onOpenChange: setOpen,
49
+ unstyled: true,
50
+ children: [/* @__PURE__ */ jsx(Collapsible.Trigger, {
51
+ className: "subagent-run__report-trigger",
52
+ unstyled: true,
53
+ children: "Run report and progress"
54
+ }), /* @__PURE__ */ jsx(Collapsible.Panel, {
55
+ unstyled: true,
56
+ children: /* @__PURE__ */ jsx(SubagentRunMetadata, {
57
+ run,
58
+ renderMilestone
59
+ })
60
+ })]
61
+ });
62
+ }
7
63
  function SubagentRunProgress({ className, label, value, ref, ...props }) {
8
64
  const labelId = React.useId();
9
65
  const percent = value === void 0 ? null : Math.round(clamp(value, 0, 1) * 100);
@@ -39,4 +95,4 @@ function SubagentRunMilestone({ className, ref, ...props }) {
39
95
  });
40
96
  }
41
97
  //#endregion
42
- export { SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress };
98
+ export { SubagentRunMetadata, SubagentRunMilestone, SubagentRunMilestones, SubagentRunProgress, SubagentRunReport };
@@ -1,8 +1,9 @@
1
+ import { n as AgentToolRunValue } from "../../AgentToolRunsContext-GMe_hSnD.js";
1
2
  import * as React from "react";
2
- import { AgentToolRunPart, AgentToolRunState } from "agents/agent-tools";
3
+ import { AgentToolRunPart } from "agents/agent-tools";
3
4
 
4
5
  //#region src/components/agents-sdk/SubagentRunIndicator.d.ts
5
- declare function getSubagentRunName(run: AgentToolRunState): string;
6
+ declare function getSubagentRunName(run: AgentToolRunValue): string;
6
7
  /**
7
8
  * One line of status for a retained run, derived from upstream's whole
8
9
  * record: the latest progress report or streamed text while it runs, the
@@ -11,10 +12,10 @@ declare function getSubagentRunName(run: AgentToolRunState): string;
11
12
  * source is cut in one place here, because a host's progress message, error,
12
13
  * and report are all unbounded prose.
13
14
  */
14
- declare function getSubagentRunStatusText(run: AgentToolRunState): string;
15
+ declare function getSubagentRunStatusText(run: AgentToolRunValue): string;
15
16
  interface SubagentRunIndicatorProps<Part extends AgentToolRunPart = AgentToolRunPart> extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
16
17
  /** Complete retained-run state returned by `useAgentToolEvents()`. */
17
- run: AgentToolRunState<Part>;
18
+ run: AgentToolRunValue<Part>;
18
19
  }
19
20
  /** Decorative status mark derived from a whole upstream retained-run record. */
20
21
  declare function SubagentRunIndicator<Part extends AgentToolRunPart = AgentToolRunPart>({
@@ -26,15 +27,14 @@ declare function SubagentRunIndicator<Part extends AgentToolRunPart = AgentToolR
26
27
  ref?: React.Ref<HTMLSpanElement>;
27
28
  }): React.JSX.Element;
28
29
  /**
29
- * How a run labels itself anywhere it appears: its Nanite, its name over its
30
- * live status line, and its status mark. The selector chip and the drill-in's
31
- * top bar share this so what a person clicks and what they land on read the
32
- * same. The caller owns the surrounding row (a link, a bar title).
30
+ * How a run labels itself anywhere it appears: one status mark followed by its
31
+ * name and live status line. The selector and drill-in bar share this so what a
32
+ * person clicks and what they land on read the same.
33
33
  */
34
34
  declare function SubagentRunLabel<Part extends AgentToolRunPart = AgentToolRunPart>({
35
35
  run
36
36
  }: {
37
- /** Complete retained-run state returned by `useAgentToolEvents()`. */run: AgentToolRunState<Part>;
37
+ /** Complete retained-run state returned by `useAgentToolEvents()`. */run: AgentToolRunValue<Part>;
38
38
  }): React.JSX.Element;
39
39
  //#endregion
40
40
  export { SubagentRunIndicator, SubagentRunIndicatorProps, SubagentRunLabel, getSubagentRunName, getSubagentRunStatusText };