@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
@@ -1,775 +0,0 @@
1
- import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { A as McpIcon, C as FolderIcon, G as SlackIcon, I as PaperclipIcon, K as SpinnerIcon, R as PencilIcon, S as FileIcon, T as InfoIcon, V as QueueIcon, Z as TerminalIcon, b as EyeIcon, c as BoxIcon, et as WarningIcon, g as DiscordIcon, o as ArrowUpRightIcon, q as SquareIcon, r as ArrowLeftIcon, y as EllipsisIcon } from "../../icons-CeGfXO21.js";
3
- import { Button } from "../foundations/Button.js";
4
- import { Tooltip } from "../foundations/Tooltip.js";
5
- import { Menu } from "../foundations/Menu.js";
6
- import { Dialog } from "../foundations/Dialog.js";
7
- import { Avatar } from "../foundations/Avatar.js";
8
- import { AppIcon } from "../foundations/AppIcon.js";
9
- import { n as findCatalogMcpServerCard, t as McpServerIcon } from "../../mcp-server-7NR24ASj.js";
10
- import { DescriptionList } from "../foundations/DescriptionList.js";
11
- import { ChatGptSignInScreen } from "../extension/ChatGptSignInScreen.js";
12
- import { EmptyState } from "../foundations/EmptyState.js";
13
- import { Switch } from "../foundations/Switch.js";
14
- import { useTheme } from "../foundations/ThemeProvider.js";
15
- import "../foundations/icons.js";
16
- import { ActionGuide } from "../general-purpose/ActionGuide.js";
17
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
18
- import { t as SetupChecklistAction } from "../../SetupChecklist-DeTU9YpW.js";
19
- import { NaniteMark } from "../nanites/NaniteScene.js";
20
- import { SubagentRunLabel } from "./SubagentRunIndicator.js";
21
- import { getThinkExecutionRunId } from "./ThinkExecutionRun.js";
22
- import { McpServerPickerAction, McpServerPickerItems } from "./McpServerPicker.js";
23
- import { ThinkThreadPicker, summarizeThinkThreads } from "./ThinkThreadPicker.js";
24
- import { ThinkFullApp } from "./ThinkFullApp.js";
25
- import { ThinkRoutineLibrary } from "./ThinkRoutineLibrary.js";
26
- import * as React from "react";
27
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
28
- //#region src/components/agents-sdk/ThinkSidepanel.tsx
29
- const EMPTY_THREADS = [];
30
- function AppearanceMenu() {
31
- const { preference, setPreference } = useTheme();
32
- return /* @__PURE__ */ jsxs(Menu.RadioGroup, {
33
- value: preference,
34
- onValueChange: (value) => {
35
- if (value === "light" || value === "dark" || value === "system") setPreference(value);
36
- },
37
- children: [
38
- /* @__PURE__ */ jsxs(Menu.RadioItem, {
39
- value: "light",
40
- children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Light"]
41
- }),
42
- /* @__PURE__ */ jsxs(Menu.RadioItem, {
43
- value: "dark",
44
- children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "Dark"]
45
- }),
46
- /* @__PURE__ */ jsxs(Menu.RadioItem, {
47
- value: "system",
48
- children: [/* @__PURE__ */ jsx(Menu.RadioItemIndicator, {}), "System"]
49
- })
50
- ]
51
- });
52
- }
53
- function MenuGroupLabel({ hint, label }) {
54
- return /* @__PURE__ */ jsxs(Menu.GroupLabel, {
55
- className: "think-sidepanel__menu-group-label",
56
- children: [label, /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, {
57
- render: /* @__PURE__ */ jsx("span", { className: "think-sidepanel__menu-hint" }),
58
- children: /* @__PURE__ */ jsx(InfoIcon, {})
59
- }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: hint }) }) })] })]
60
- });
61
- }
62
- /** Keep in lockstep with --sigvelo-layout-break-compact / the 56rem @container. */
63
- function compactBreakPx(el) {
64
- const raw = getComputedStyle(el).getPropertyValue("--sigvelo-layout-break-compact").trim();
65
- if (raw.endsWith("rem")) return Number.parseFloat(raw) * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
66
- const px = Number.parseFloat(raw);
67
- return Number.isFinite(px) ? px : 896;
68
- }
69
- function useCompactApp() {
70
- const ref = React.useRef(null);
71
- const [compact, setCompact] = React.useState(true);
72
- React.useLayoutEffect(() => {
73
- const el = ref.current;
74
- if (!el) return;
75
- const sync = () => {
76
- const next = el.getBoundingClientRect().width <= compactBreakPx(el);
77
- setCompact((current) => current === next ? current : next);
78
- };
79
- sync();
80
- if (typeof ResizeObserver === "undefined") return;
81
- const observer = new ResizeObserver(sync);
82
- observer.observe(el);
83
- return () => observer.disconnect();
84
- }, []);
85
- return [ref, compact];
86
- }
87
- function workbenchNavItems(workbenchPanels) {
88
- return [
89
- {
90
- id: "files",
91
- label: "Files",
92
- icon: /* @__PURE__ */ jsx(FileIcon, {})
93
- },
94
- {
95
- id: "plugins",
96
- label: "Plugins",
97
- icon: /* @__PURE__ */ jsx(BoxIcon, {})
98
- },
99
- ...workbenchPanels ?? []
100
- ];
101
- }
102
- function isWorkbenchView(view) {
103
- return view !== "chat" && view !== "schedules" && view !== "live";
104
- }
105
- function thinkFullAppView(view) {
106
- return view === "schedules" || view === "live" ? "chat" : view;
107
- }
108
- function WorkbenchLinks({ panels, renderLink, view }) {
109
- return /* @__PURE__ */ jsx(Fragment, { children: panels.map((panel) => /* @__PURE__ */ jsx(AppTopBar.Link, {
110
- label: panel.label,
111
- "aria-current": view === panel.id ? "page" : void 0,
112
- "data-pressed": view === panel.id ? "" : void 0,
113
- render: renderLink({
114
- kind: "view",
115
- view: panel.id
116
- }),
117
- children: panel.icon
118
- }, panel.id)) });
119
- }
120
- function OverflowMenu({ companion, follow, identityEmail, onIdentity, onModel, onSignOut, passkeyVault, renderLink, workbenchInMenu, workbenchNav }) {
121
- return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
122
- label: "More actions",
123
- tooltip: identityEmail ? `Signed in as ${identityEmail}` : void 0,
124
- render: /* @__PURE__ */ jsx(Menu.Trigger, {}),
125
- children: identityEmail ? /* @__PURE__ */ jsx(Avatar.Root, {
126
- size: "sm",
127
- children: /* @__PURE__ */ jsx(Avatar.Fallback, { children: identityEmail[0]?.toUpperCase() })
128
- }) : /* @__PURE__ */ jsx(EllipsisIcon, {})
129
- }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
130
- side: "bottom",
131
- align: "end",
132
- sideOffset: 4,
133
- children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [
134
- workbenchInMenu ? workbenchNav.map((panel) => /* @__PURE__ */ jsxs(Menu.Item, {
135
- render: renderLink({
136
- kind: "view",
137
- view: panel.id
138
- }),
139
- children: [panel.icon, panel.label]
140
- }, panel.id)) : null,
141
- /* @__PURE__ */ jsxs(Menu.Item, {
142
- render: renderLink({
143
- kind: "view",
144
- view: "schedules"
145
- }),
146
- children: [/* @__PURE__ */ jsx(QueueIcon, {}), "Routines"]
147
- }),
148
- follow ? /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
149
- checked: follow.followed,
150
- onCheckedChange: follow.onCheckedChange,
151
- children: [/* @__PURE__ */ jsx(EyeIcon, {}), "Follow this conversation"]
152
- }) : null,
153
- onIdentity ? /* @__PURE__ */ jsxs(Menu.Item, {
154
- onClick: onIdentity,
155
- children: [/* @__PURE__ */ jsx(InfoIcon, {}), "Identity"]
156
- }) : null,
157
- onModel ? /* @__PURE__ */ jsxs(Menu.Item, {
158
- onClick: onModel,
159
- children: [/* @__PURE__ */ jsx(TerminalIcon, {}), "Model"]
160
- }) : null,
161
- companion ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [
162
- /* @__PURE__ */ jsx(MenuGroupLabel, {
163
- label: "Companion app",
164
- hint: "Connecting lets this employee chat with the browser and watch it work from anywhere."
165
- }),
166
- /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
167
- className: "think-sidepanel__menu-switch-item",
168
- checked: companion.enabled,
169
- onCheckedChange: companion.setEnabled,
170
- children: ["Connect this browser", /* @__PURE__ */ jsx(Switch.Root, {
171
- "aria-hidden": true,
172
- readOnly: true,
173
- size: "sm",
174
- checked: companion.enabled,
175
- children: /* @__PURE__ */ jsx(Switch.Thumb, {})
176
- })]
177
- }),
178
- /* @__PURE__ */ jsxs(Menu.Item, {
179
- render: /* @__PURE__ */ jsx("a", {
180
- href: companion.origin,
181
- target: "_blank",
182
- rel: "noreferrer",
183
- "aria-label": companion.origin.replace(/^https?:\/\//, "")
184
- }),
185
- children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), companion.origin.replace(/^https?:\/\//, "")]
186
- })
187
- ] })] }) : null,
188
- passkeyVault ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(MenuGroupLabel, {
189
- label: "Passkeys",
190
- hint: "The employee saves and uses its own passkeys instead of the browser's."
191
- }), /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
192
- className: "think-sidepanel__menu-switch-item",
193
- checked: passkeyVault.enabled,
194
- onCheckedChange: passkeyVault.setEnabled,
195
- children: ["Use its own passkeys", /* @__PURE__ */ jsx(Switch.Root, {
196
- "aria-hidden": true,
197
- readOnly: true,
198
- size: "sm",
199
- checked: passkeyVault.enabled,
200
- children: /* @__PURE__ */ jsx(Switch.Thumb, {})
201
- })]
202
- })] })] }) : null,
203
- /* @__PURE__ */ jsx(Menu.Separator, {}),
204
- /* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: "Appearance" }), /* @__PURE__ */ jsx(AppearanceMenu, {})] }),
205
- onSignOut ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Menu.Separator, {}), /* @__PURE__ */ jsxs(Menu.Item, {
206
- onClick: onSignOut,
207
- children: [/* @__PURE__ */ jsx(ArrowUpRightIcon, {}), "Sign out"]
208
- })] }) : null
209
- ] })
210
- }) })] });
211
- }
212
- function GateScreen({ brand, connectingLabel, identity, modelSetup, status }) {
213
- if (status === "connecting") return /* @__PURE__ */ jsx("div", {
214
- className: "think-sidepanel__gate",
215
- role: "status",
216
- children: /* @__PURE__ */ jsx(EmptyState, {
217
- icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
218
- description: connectingLabel ?? "Connecting…"
219
- })
220
- });
221
- if (status === "offline") return /* @__PURE__ */ jsx("main", {
222
- className: "think-sidepanel__gate",
223
- role: "status",
224
- children: /* @__PURE__ */ jsx(EmptyState, {
225
- icon: /* @__PURE__ */ jsx(WarningIcon, {}),
226
- title: `${brand.name} is offline`,
227
- description: "Open the browser and turn the companion connection on. This screen reconnects on its own."
228
- })
229
- });
230
- if (status === "identity-blocked" && identity) return /* @__PURE__ */ jsxs("div", {
231
- className: "think-sidepanel__gate",
232
- role: "alert",
233
- children: [/* @__PURE__ */ jsx(EmptyState, {
234
- icon: /* @__PURE__ */ jsx(WarningIcon, {}),
235
- title: "Wrong browser profile",
236
- description: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", { children: [
237
- "This installation is assigned to ",
238
- /* @__PURE__ */ jsx("strong", { children: identity.assignedAccount }),
239
- ", but the live profile is ",
240
- /* @__PURE__ */ jsx("strong", { children: identity.liveProfile }),
241
- "."
242
- ] }), /* @__PURE__ */ jsx("p", { children: identity.managed ? "Open the assigned profile. Organization policy controls this assignment." : "Open the assigned profile, or remove the binding." })] })
243
- }), identity.managed || !identity.onUnbind ? null : /* @__PURE__ */ jsx(Button, {
244
- type: "button",
245
- variant: "ghost",
246
- color: "destructive",
247
- onClick: identity.onUnbind,
248
- children: "Remove binding"
249
- })]
250
- });
251
- if (status === "needs-model") return /* @__PURE__ */ jsx(ChatGptSignInScreen, {
252
- busy: modelSetup?.busy,
253
- error: modelSetup?.error,
254
- label: modelSetup?.label,
255
- title: `Meet ${brand.name}`,
256
- brandName: "SigVelo",
257
- brandLogo: brand.logo,
258
- onSignIn: modelSetup?.onSignIn,
259
- secondaryAction: modelSetup?.onCustomEndpoint ? {
260
- label: "Set up a custom model endpoint",
261
- onSelect: modelSetup.onCustomEndpoint
262
- } : void 0
263
- });
264
- return null;
265
- }
266
- function IdentityDialog({ identity, onOpenChange, open }) {
267
- return /* @__PURE__ */ jsx(Dialog.Root, {
268
- open,
269
- onOpenChange,
270
- children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Viewport, { children: /* @__PURE__ */ jsxs(Dialog.Popup, { children: [
271
- /* @__PURE__ */ jsxs(Dialog.Header, { children: [/* @__PURE__ */ jsx(Dialog.Title, { children: "Operating identity" }), /* @__PURE__ */ jsx(Dialog.Description, { children: "This employee operates the live browser profile as its own identity. Assigning the account keeps it from signing in with another profile." })] }),
272
- /* @__PURE__ */ jsxs(DescriptionList.Root, {
273
- variant: "divided",
274
- children: [/* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Live profile" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: identity.liveProfile })] }), /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Assigned account" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: identity.managed ? `${identity.assignedAccount} (managed by your organization)` : identity.assignedAccount })] })]
275
- }),
276
- /* @__PURE__ */ jsx(Dialog.Footer, { children: identity.managed ? /* @__PURE__ */ jsx("p", { children: "Organization policy controls this binding." }) : identity.onUnbind && identity.assignedAccount ? /* @__PURE__ */ jsx(Button, {
277
- type: "button",
278
- variant: "ghost",
279
- color: "destructive",
280
- onClick: () => {
281
- Promise.resolve(identity.onUnbind?.()).then(() => onOpenChange(false));
282
- },
283
- children: "Remove binding"
284
- }) : /* @__PURE__ */ jsx(Button, {
285
- type: "button",
286
- color: "primary",
287
- disabled: !identity.canBind || !identity.onBind,
288
- onClick: () => {
289
- Promise.resolve(identity.onBind?.()).then(() => onOpenChange(false));
290
- },
291
- children: "Assign this profile"
292
- }) })
293
- ] }) })] })
294
- });
295
- }
296
- function CapabilityGuide({ brandName, start }) {
297
- const send = (text) => void start.onSubmit({
298
- text,
299
- files: []
300
- });
301
- return /* @__PURE__ */ jsx(ActionGuide, {
302
- title: `${brandName} can work across your browser.`,
303
- description: "They can act in signed-in tabs, keep workspace files, connect plugins, and run recurring work after this panel closes.",
304
- sections: [
305
- {
306
- id: "quick-browser-job",
307
- title: "Start with a quick browser job",
308
- layout: "compact",
309
- actions: [{
310
- id: "organize-tabs",
311
- icon: /* @__PURE__ */ jsx(BoxIcon, {}),
312
- label: "Organize this window’s tabs by task"
313
- }, {
314
- id: "close-duplicate-tabs",
315
- icon: /* @__PURE__ */ jsx(EyeIcon, {}),
316
- label: "Close duplicate tabs in this window"
317
- }]
318
- },
319
- {
320
- id: "ongoing-work",
321
- title: "Set up ongoing work",
322
- layout: "cards",
323
- actions: [
324
- {
325
- id: "create-routine",
326
- icon: /* @__PURE__ */ jsx(QueueIcon, {}),
327
- label: "Create a recurring task"
328
- },
329
- ...start.slack && !start.slack.configured ? [{
330
- id: "connect-slack",
331
- icon: /* @__PURE__ */ jsx(SlackIcon, {}),
332
- label: "Connect Slack"
333
- }] : [],
334
- ...start.discord && !start.discord.configured ? [{
335
- id: "connect-discord",
336
- icon: /* @__PURE__ */ jsx(DiscordIcon, {}),
337
- label: "Connect Discord"
338
- }] : [],
339
- ...start.onAttachFolder ? [{
340
- id: "attach-local-folder",
341
- icon: /* @__PURE__ */ jsx(FolderIcon, {}),
342
- label: "Attach a local folder"
343
- }] : [],
344
- {
345
- id: "connections",
346
- icon: /* @__PURE__ */ jsx(McpIcon, {}),
347
- label: start.hasConnectedApps ? "Use my connected apps" : "Connect another app"
348
- }
349
- ]
350
- },
351
- {
352
- id: "larger-workflow",
353
- title: "Build a larger workflow",
354
- layout: "list",
355
- actions: [
356
- {
357
- id: "automate-browser",
358
- icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
359
- label: "Automate work across signed-in tabs",
360
- variant: "ghost"
361
- },
362
- {
363
- id: "move-workspace-files",
364
- icon: /* @__PURE__ */ jsx(FolderIcon, {}),
365
- label: "Move files between a website and the workspace",
366
- variant: "ghost"
367
- },
368
- {
369
- id: "record-browser-workflow",
370
- icon: /* @__PURE__ */ jsx(EyeIcon, {}),
371
- label: "Record a browser workflow as an MP4",
372
- variant: "ghost"
373
- }
374
- ]
375
- }
376
- ],
377
- onAction: (action) => {
378
- switch (action.id) {
379
- case "organize-tabs": return send("Organize this window’s tabs by task.");
380
- case "close-duplicate-tabs": return send("Close duplicate tabs in this window.");
381
- case "create-routine": return send("Help me create a recurring task that runs on a schedule.");
382
- case "connect-slack": return start.slack?.onSelect();
383
- case "connect-discord": return start.discord?.onSelect();
384
- case "connections": return send(start.hasConnectedApps ? "Show me useful work I can do across my connected apps." : "Help me connect another app I use.");
385
- case "automate-browser": return send("Automate a workflow across my signed-in browser tabs.");
386
- case "move-workspace-files": return send("Move files between a signed-in website and the workspace.");
387
- case "record-browser-workflow": return send("Record a browser workflow as an MP4.");
388
- case "attach-local-folder": return start.onAttachFolder?.();
389
- }
390
- }
391
- });
392
- }
393
- function StartComposerTray({ plugins, renderLink, start }) {
394
- const hasPluginMenu = Boolean(plugins || start.slack || start.discord);
395
- return /* @__PURE__ */ jsxs(Fragment, { children: [
396
- start.personalization ? /* @__PURE__ */ jsx(SetupChecklistAction, {
397
- actionLabel: "Prompts",
398
- label: "Prompts",
399
- entries: start.personalization.entries,
400
- onSelect: start.personalization.onSelect
401
- }) : null,
402
- start.onAttachFolder ? /* @__PURE__ */ jsxs(Button, {
403
- type: "button",
404
- variant: "ghost",
405
- color: "neutral",
406
- size: "sm",
407
- disabled: start.attachFolderBusy,
408
- onClick: start.onAttachFolder,
409
- "aria-label": "Connect a local folder",
410
- children: [/* @__PURE__ */ jsx(PaperclipIcon, {}), /* @__PURE__ */ jsx("span", { children: "Connect a local folder" })]
411
- }) : null,
412
- hasPluginMenu ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Button, {
413
- type: "button",
414
- variant: "ghost",
415
- color: "neutral",
416
- size: "sm",
417
- render: /* @__PURE__ */ jsx(Menu.Trigger, { unstyled: true }),
418
- "aria-label": "Connect plugins",
419
- children: [/* @__PURE__ */ jsx("span", { children: "Connect plugins" }), /* @__PURE__ */ jsxs(AppIcon.Stack, {
420
- "aria-hidden": "true",
421
- children: [/* @__PURE__ */ jsx(AppIcon.Root, {
422
- size: "xs",
423
- variant: "surface",
424
- children: /* @__PURE__ */ jsx(SlackIcon, {})
425
- }), /* @__PURE__ */ jsx(AppIcon.Root, {
426
- size: "xs",
427
- variant: "surface",
428
- children: /* @__PURE__ */ jsx(DiscordIcon, {})
429
- })]
430
- })]
431
- }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
432
- side: "bottom",
433
- align: "start",
434
- sideOffset: 4,
435
- children: /* @__PURE__ */ jsxs(Menu.Popup, {
436
- "aria-label": "Plugins",
437
- "data-recipe": "wide-scroll-picker",
438
- children: [/* @__PURE__ */ jsx(McpServerPickerItems, {
439
- actions: [...start.discord ? [{
440
- id: "discord",
441
- icon: /* @__PURE__ */ jsx(DiscordIcon, {}),
442
- label: start.discord.configured ? "Discord" : "Connect Discord",
443
- description: start.discord.description ?? (start.discord.configured ? "Connected" : "Talk to this employee from Discord"),
444
- onSelect: start.discord.onSelect
445
- }] : [], ...start.slack ? [{
446
- id: "slack",
447
- icon: /* @__PURE__ */ jsx(SlackIcon, {}),
448
- label: start.slack.configured ? "Slack" : "Connect Slack",
449
- description: start.slack.description ?? (start.slack.configured ? "Connected" : "Talk to this employee from Slack"),
450
- onSelect: start.slack.onSelect
451
- }] : []],
452
- servers: plugins?.servers ?? [],
453
- mcp: plugins?.mcp,
454
- onConnect: plugins?.onConnect,
455
- onDisconnect: plugins?.onDisconnect
456
- }), /* @__PURE__ */ jsx(McpServerPickerAction, {
457
- icon: /* @__PURE__ */ jsx(BoxIcon, {}),
458
- label: "Browse plugins",
459
- description: plugins?.onConnect ? "Find and connect supported tools" : "See what this browser is connected to",
460
- render: renderLink({
461
- kind: "view",
462
- view: "plugins"
463
- })
464
- })]
465
- })
466
- }) })] }) : null
467
- ] });
468
- }
469
- function mentionSuggestionIcon(value) {
470
- const token = value.match(/^@([^\s]+)/)?.[1];
471
- const card = token ? findCatalogMcpServerCard({
472
- id: token,
473
- name: token
474
- }) : void 0;
475
- if (!card) return /* @__PURE__ */ jsx(McpIcon, {});
476
- return /* @__PURE__ */ jsx(McpServerIcon, {
477
- server: card,
478
- size: "xs"
479
- });
480
- }
481
- function startStarters(brandName, start, onShowGuide) {
482
- return {
483
- "aria-label": "Suggested prompts",
484
- items: [
485
- {
486
- id: "capability-guide",
487
- label: `See what ${brandName} can do`,
488
- icon: /* @__PURE__ */ jsx(InfoIcon, {}),
489
- muted: true
490
- },
491
- ...start.suggestionsError ? [{
492
- id: "retry-suggestions",
493
- label: "Try generating suggestions again",
494
- icon: /* @__PURE__ */ jsx(InfoIcon, {}),
495
- muted: true
496
- }] : [],
497
- ...start.suggestions?.map((suggestion, index) => ({
498
- id: `suggestion:${index}:${suggestion.value}:${suggestion.label}`,
499
- label: suggestion.label,
500
- icon: suggestion.value.startsWith("/") ? /* @__PURE__ */ jsx(BoxIcon, {}) : suggestion.value.startsWith("@") ? mentionSuggestionIcon(suggestion.value) : /* @__PURE__ */ jsx(EyeIcon, {})
501
- })) ?? []
502
- ],
503
- onSelect: (item) => {
504
- if (item.id === "capability-guide") {
505
- onShowGuide();
506
- return;
507
- }
508
- if (item.id === "retry-suggestions") {
509
- start.onRetrySuggestions?.();
510
- return;
511
- }
512
- const suggestion = start.suggestions?.find((candidate, index) => item.id === `suggestion:${index}:${candidate.value}:${candidate.label}`);
513
- if (suggestion) start.onSubmit({
514
- text: suggestion.value,
515
- files: []
516
- });
517
- }
518
- };
519
- }
520
- function BackToChat({ renderLink }) {
521
- return /* @__PURE__ */ jsx(AppTopBar.Link, {
522
- label: "Back to chat",
523
- render: renderLink({
524
- kind: "view",
525
- view: "chat"
526
- }),
527
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
528
- });
529
- }
530
- function employeeMessages({ agentRun, brandName, guideOpen, hasConversation, hostMessages, onShowGuide, plugins, renderLink, start }) {
531
- const onSubmit = hostMessages?.draft?.onSubmit ?? start?.onSubmit;
532
- const draft = hasConversation ? hostMessages?.draft : onSubmit ? {
533
- messages: hostMessages?.draft?.messages ?? [],
534
- onSubmit,
535
- status: hostMessages?.draft?.status
536
- } : hostMessages?.draft;
537
- return {
538
- placeholder: "How can I help you today?",
539
- approvalsEnabled: false,
540
- ...hostMessages,
541
- startScreen: start ? {
542
- lead: guideOpen ? /* @__PURE__ */ jsx(CapabilityGuide, {
543
- brandName,
544
- start
545
- }) : void 0,
546
- composerTray: /* @__PURE__ */ jsx(StartComposerTray, {
547
- plugins,
548
- renderLink,
549
- start
550
- }),
551
- starters: guideOpen ? void 0 : startStarters(brandName, start, onShowGuide)
552
- } : hostMessages?.startScreen,
553
- draft,
554
- showComposer: agentRun ? false : hostMessages?.showComposer
555
- };
556
- }
557
- /**
558
- * The drilled-in run's name over its live status line — the same label its
559
- * selector chip wears in the parent transcript, so what the person clicked
560
- * and what they land on read the same. Before the replay seeds the run there
561
- * is only the fact that it is a run.
562
- */
563
- function ThinkSidepanelRunTitle({ agentRun }) {
564
- return /* @__PURE__ */ jsx("span", {
565
- "data-slot": "think-sidepanel-run-title",
566
- className: "think-sidepanel__run-title",
567
- children: agentRun.state === "ready" ? /* @__PURE__ */ jsx(SubagentRunLabel, { run: agentRun.run }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(NaniteMark, {}), /* @__PURE__ */ jsx("span", {
568
- className: "sigvelo-truncate",
569
- children: "Delegated run"
570
- })] })
571
- });
572
- }
573
- /**
574
- * The employee side panel: icon-and-tooltip chrome, start screen, schedules,
575
- * conversation plus workbench. Hosts hydrate conversation, workspace,
576
- * plugins, workbenchPanels, and callables. Storybook is the place to iterate
577
- * the chrome.
578
- */
579
- function ThinkSidepanel({ agentRun, appBarLeading, brand, className, companion, connectingLabel, conversation, follow, identity, live, messages, modelSetup, onDeleteThread, onModel, onSignOut, passkeyVault, plugins, renderLink, schedules, sourceKey, start, status = "ready", thread, threads = EMPTY_THREADS, view, workbenchPanels, workspace, ...props }) {
580
- const [identityOpen, setIdentityOpen] = React.useState(false);
581
- const [guideOpen, setGuideOpen] = React.useState(false);
582
- const [rootRef, compact] = useCompactApp();
583
- const workbenchNav = workbenchNavItems(workbenchPanels);
584
- if (status !== "ready") return /* @__PURE__ */ jsx("div", {
585
- ref: rootRef,
586
- className: cx("think-sidepanel", className),
587
- "data-status": status,
588
- ...props,
589
- children: /* @__PURE__ */ jsx(GateScreen, {
590
- brand,
591
- connectingLabel,
592
- identity,
593
- modelSetup,
594
- status
595
- })
596
- });
597
- const overflow = /* @__PURE__ */ jsx(OverflowMenu, {
598
- companion,
599
- follow: thread && !agentRun ? follow : void 0,
600
- identityEmail: identity?.email,
601
- onIdentity: identity ? () => setIdentityOpen(true) : void 0,
602
- onModel,
603
- onSignOut,
604
- passkeyVault,
605
- renderLink,
606
- workbenchInMenu: compact,
607
- workbenchNav
608
- });
609
- const workspaceLinks = compact || agentRun ? void 0 : /* @__PURE__ */ jsx(WorkbenchLinks, {
610
- panels: workbenchNav,
611
- renderLink,
612
- view
613
- });
614
- const identityDialog = identity ? /* @__PURE__ */ jsx(IdentityDialog, {
615
- identity,
616
- open: identityOpen,
617
- onOpenChange: setIdentityOpen
618
- }) : null;
619
- const newThread = thread && !agentRun ? /* @__PURE__ */ jsx(AppTopBar.Link, {
620
- label: "New thread",
621
- render: renderLink({ kind: "new-thread" }),
622
- children: /* @__PURE__ */ jsx(PencilIcon, {})
623
- }) : void 0;
624
- const chatLeading = newThread || view === "chat" && appBarLeading ? /* @__PURE__ */ jsxs(Fragment, { children: [newThread, view === "chat" ? appBarLeading : null] }) : void 0;
625
- const workbenchLeading = isWorkbenchView(view) ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BackToChat, { renderLink }), appBarLeading] }) : chatLeading;
626
- const chatMessages = employeeMessages({
627
- agentRun,
628
- brandName: brand.name,
629
- guideOpen,
630
- hasConversation: Boolean(conversation),
631
- hostMessages: messages,
632
- onShowGuide: () => setGuideOpen(true),
633
- plugins,
634
- renderLink,
635
- start
636
- });
637
- if (view === "live") return /* @__PURE__ */ jsxs("div", {
638
- ref: rootRef,
639
- className: cx("think-sidepanel", className),
640
- "data-view": "live",
641
- ...props,
642
- children: [/* @__PURE__ */ jsxs("div", {
643
- className: "think-sidepanel__live",
644
- children: [/* @__PURE__ */ jsxs(AppTopBar.Root, {
645
- "aria-label": "Live view controls",
646
- children: [/* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(BackToChat, { renderLink }) }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "Live view" })]
647
- }), live]
648
- }), identityDialog]
649
- });
650
- if (view === "schedules") return /* @__PURE__ */ jsxs("div", {
651
- ref: rootRef,
652
- className: cx("think-sidepanel", className),
653
- "data-view": "schedules",
654
- ...props,
655
- children: [schedules?.editor ? /* @__PURE__ */ jsx("div", {
656
- className: "think-sidepanel__editor",
657
- children: schedules.editor
658
- }) : schedules ? /* @__PURE__ */ jsx(ThinkRoutineLibrary, {
659
- bar: {
660
- leading: /* @__PURE__ */ jsx(BackToChat, { renderLink }),
661
- actions: workspaceLinks,
662
- primary: overflow
663
- },
664
- routines: schedules.routines,
665
- showOwner: false,
666
- selectedRoutineId: schedules.selectedRoutineId,
667
- error: schedules.error,
668
- renderRoutineLink: (routine) => renderLink({
669
- kind: "routine",
670
- routineId: routine.id
671
- }),
672
- createRoutineLink: renderLink({ kind: "create-routine" }),
673
- renderEditRoutineLink: (routine) => renderLink({
674
- kind: "edit-routine",
675
- routineId: routine.id
676
- }),
677
- renderRunLink: (routine, run) => renderLink({
678
- kind: "routine-run",
679
- routineId: routine.id,
680
- runId: getThinkExecutionRunId(run)
681
- }),
682
- onRunRoutine: schedules.onRunRoutine,
683
- onRoutineEnabledChange: schedules.onRoutineEnabledChange,
684
- onDeleteRoutine: schedules.onDeleteRoutine
685
- }) : /* @__PURE__ */ jsx("div", {
686
- className: "think-sidepanel__gate",
687
- children: /* @__PURE__ */ jsx(EmptyState, {
688
- title: "Schedules",
689
- description: "No schedules to show."
690
- })
691
- }), identityDialog]
692
- });
693
- const workbenchView = thinkFullAppView(view);
694
- const cancelRun = agentRun?.state === "ready" && agentRun.run.status === "running" ? agentRun.onCancel : void 0;
695
- const backToThread = agentRun ? /* @__PURE__ */ jsx(AppTopBar.Link, {
696
- label: "Back to parent conversation",
697
- render: thread ? renderLink({
698
- kind: "thread",
699
- threadId: thread.id
700
- }) : renderLink({
701
- kind: "view",
702
- view: "chat"
703
- }),
704
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
705
- }) : null;
706
- if (agentRun?.state === "unavailable") return /* @__PURE__ */ jsxs("div", {
707
- ref: rootRef,
708
- className: cx("think-sidepanel", className),
709
- "data-view": view,
710
- ...props,
711
- children: [
712
- /* @__PURE__ */ jsxs(AppTopBar.Root, {
713
- "aria-label": "Delegated run controls",
714
- children: [
715
- /* @__PURE__ */ jsx(AppTopBar.Leading, { children: backToThread }),
716
- /* @__PURE__ */ jsx(AppTopBar.Title, { children: "Delegated run" }),
717
- /* @__PURE__ */ jsx(AppTopBar.Trailing, { children: overflow })
718
- ]
719
- }),
720
- /* @__PURE__ */ jsx("div", {
721
- className: "think-sidepanel__gate",
722
- role: "alert",
723
- children: /* @__PURE__ */ jsx(EmptyState, {
724
- icon: /* @__PURE__ */ jsx(WarningIcon, {}),
725
- title: "Run unavailable",
726
- description: "This delegated run is no longer available. Its report stays in the parent conversation."
727
- })
728
- }),
729
- identityDialog
730
- ]
731
- });
732
- return /* @__PURE__ */ jsxs("div", {
733
- ref: rootRef,
734
- className: cx("think-sidepanel", className),
735
- "data-view": view,
736
- ...props,
737
- children: [/* @__PURE__ */ jsx(ThinkFullApp, {
738
- conversation,
739
- renderAgentToolRunLink: (run) => renderLink({
740
- kind: "agent-run",
741
- runId: run.runId
742
- }),
743
- bar: {
744
- title: agentRun ? /* @__PURE__ */ jsx(ThinkSidepanelRunTitle, { agentRun }) : thread?.title ?? "New chat",
745
- leading: agentRun ? backToThread : workbenchLeading,
746
- actions: cancelRun ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
747
- label: "Cancel run",
748
- onClick: cancelRun,
749
- children: /* @__PURE__ */ jsx(SquareIcon, {})
750
- }), workspaceLinks] }) : workspaceLinks,
751
- primary: overflow,
752
- views: null
753
- },
754
- threadStatusSummary: agentRun ? void 0 : summarizeThinkThreads(threads),
755
- sourceKey,
756
- workspace: agentRun ? void 0 : workspace,
757
- plugins: agentRun ? void 0 : plugins,
758
- workbenchPanels: agentRun ? void 0 : workbenchPanels,
759
- view: workbenchView,
760
- threadSidebar: agentRun ? void 0 : ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkThreadPicker, {
761
- threads,
762
- renderThreadLink: (item) => renderLink({
763
- kind: "thread",
764
- threadId: item.id
765
- }),
766
- createThreadLink: renderLink({ kind: "new-thread" }),
767
- onSelect: closeSidebarOnCompact,
768
- onDelete: onDeleteThread
769
- }),
770
- messages: chatMessages
771
- }), identityDialog]
772
- });
773
- }
774
- //#endregion
775
- export { ThinkSidepanel };