@mcp-b/react-components 0.60.0 → 0.62.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 (366) hide show
  1. package/dist/{AgentActivity-DSObWhDU.d.ts → AgentActivity-DptCj8XQ.d.ts} +2 -2
  2. package/dist/{AgentChatQueue-CGR4hd7D.d.ts → AgentChatQueue-DG2rGyCI.d.ts} +1 -1
  3. package/dist/AgentToolRunsContext-Br3jZ6Up.d.ts +74 -0
  4. package/dist/{Button-ClRxb8tM.d.ts → Button-DIn-0P-0.d.ts} +4 -5
  5. package/dist/{Card-BPkXIkBz.d.ts → Card-DkGZ3jKQ.d.ts} +7 -1
  6. package/dist/{CodeBlock-DYp5V_4O.d.ts → CodeBlock-BTkag9ms.d.ts} +1 -1
  7. package/dist/{CodeBlock-B4K656LO.js → CodeBlock-CNvOYR0Q.js} +1 -1
  8. package/dist/{EmployeeChrome-QSki0QT4.d.ts → EmployeeChrome-D5x4EM9y.d.ts} +19 -35
  9. package/dist/{ExecutionBoard-DHfMvKlB.d.ts → ExecutionBoard-DvPGdn4F.d.ts} +2 -2
  10. package/dist/{ExecutionResult-Wd1sKAvD.js → ExecutionResult-DmC21cll.js} +4 -4
  11. package/dist/{FileTree-BpCJuvji.js → FileTree-H31EVRv_.js} +1 -1
  12. package/dist/{IconButton-43ggXEuf.d.ts → IconButton-FWsa9562.d.ts} +1 -1
  13. package/dist/{ManagerOffice-BaHSBcSF.js → ManagerOffice-B3X3iZV9.js} +27 -34
  14. package/dist/{McpConnectorForm-D4bY-lm_.d.ts → McpConnectorForm-BLsQt_er.d.ts} +1 -1
  15. package/dist/{McpPluginCatalog-2FZDLCeK.d.ts → McpPluginCatalog-SQNOytXQ.d.ts} +2 -2
  16. package/dist/{Message-CwCqa90H.d.ts → Message-BUedRDN1.d.ts} +2 -2
  17. package/dist/{MessageScrollerVirtual-DVQeEkNy.d.ts → MessageScrollerVirtual-DxL6XKq9.d.ts} +1 -1
  18. package/dist/{PromptInput-C3adKglc.d.ts → PromptInput-Dbe6WgWA.d.ts} +1 -1
  19. package/dist/{ResponsiveSidebarShell-DzBGlRJF.d.ts → ResponsiveSidebarShell-DSAMNDdg.d.ts} +1 -1
  20. package/dist/{SetupChecklist-BNK2XFaI.js → SetupChecklist-Wo4akaSG.js} +2 -2
  21. package/dist/{ThinkChatActivity-C4_hPEmb.d.ts → ThinkChatActivity-zZaSsbC-.d.ts} +7 -3
  22. package/dist/{ThinkChatActivitySummary-ChJ8Iu2T.d.ts → ThinkChatActivitySummary-8MO1VjAJ.d.ts} +1 -1
  23. package/dist/{ThinkExecutionRun-CPeYVneQ.d.ts → ThinkExecutionRun-DJ2TFDmZ.d.ts} +1 -1
  24. package/dist/ThinkSchedule-CSuDGrZ9.d.ts +34 -0
  25. package/dist/{Workspace-iCkXvQRJ.d.ts → Workspace-42LA9Zrb.d.ts} +1 -1
  26. package/dist/WorkspaceAutomation-CMvICi-p.d.ts +215 -0
  27. package/dist/{WorkspaceConcept-ByaG-kBq.d.ts → WorkspaceConcept-BjrgGE1w.d.ts} +2 -3
  28. package/dist/{WorkspaceFile-DkIZKoK6.d.ts → WorkspaceFile-nK2n0i4S.d.ts} +1 -1
  29. package/dist/{WorkspaceFileView-5SHsjamf.js → WorkspaceFileView-BWI_AJlV.js} +8 -8
  30. package/dist/{WorkspaceLink-Buo6gKj2.d.ts → WorkspaceLink-C8HH2fMT.d.ts} +1 -0
  31. package/dist/{WorkspaceMessageResponse-DnsdpaGU.js → WorkspaceMessageResponse-BZ-_I18b.js} +3 -7
  32. package/dist/agent-tool-runs-DsOp_X2y.js +133 -0
  33. package/dist/assets/chrome.svg +1 -0
  34. package/dist/assets/plugins/plugin-github.svg +8 -0
  35. package/dist/assets/plugins/plugin-gmail.svg +1 -0
  36. package/dist/assets/plugins/plugin-google-drive.svg +1 -0
  37. package/dist/assets/plugins/plugin-google.svg +1 -0
  38. package/dist/assets/plugins/plugin-linear.svg +1 -0
  39. package/dist/assets/plugins/plugin-notion.svg +25 -0
  40. package/dist/assets/plugins/plugin-salesforce.svg +31 -0
  41. package/dist/assets/plugins/plugin-slack.svg +6 -0
  42. package/dist/chatgpt-sign-in-button-DNchrZHs.js +32 -0
  43. package/dist/{codex-model-catalog-CFEGgUAj.d.ts → codex-model-catalog-18yO7dln.d.ts} +8 -8
  44. package/dist/components/agents-sdk/AgentActivity.d.ts +1 -1
  45. package/dist/components/agents-sdk/AgentActivity.js +5 -4
  46. package/dist/components/agents-sdk/AgentChat.d.ts +4 -4
  47. package/dist/components/agents-sdk/AgentChat.js +8 -8
  48. package/dist/components/agents-sdk/AgentChatQueue.d.ts +1 -1
  49. package/dist/components/agents-sdk/AgentEvent.js +5 -5
  50. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
  51. package/dist/components/agents-sdk/AgentToolRunsContext.js +78 -8
  52. package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
  53. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  54. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  55. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  56. package/dist/components/agents-sdk/EmployeeApp.d.ts +4 -3
  57. package/dist/components/agents-sdk/EmployeeApp.js +2 -2
  58. package/dist/components/agents-sdk/EmployeeChat.d.ts +9 -2
  59. package/dist/components/agents-sdk/EmployeeChat.js +15 -11
  60. package/dist/components/agents-sdk/EmployeeChrome.d.ts +2 -2
  61. package/dist/components/agents-sdk/EmployeeChrome.js +53 -35
  62. package/dist/components/agents-sdk/EmployeeSchedules.d.ts +10 -10
  63. package/dist/components/agents-sdk/EmployeeSchedules.js +39 -39
  64. package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +3 -3
  65. package/dist/components/agents-sdk/EmployeeStartScreen.js +4 -4
  66. package/dist/components/agents-sdk/ExecutionBoard.d.ts +1 -1
  67. package/dist/components/agents-sdk/ExecutionBoard.js +7 -33
  68. package/dist/components/agents-sdk/ManagerAccountActions.js +2 -2
  69. package/dist/components/agents-sdk/ManagerOffice.d.ts +10 -14
  70. package/dist/components/agents-sdk/ManagerOffice.js +1 -1
  71. package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
  72. package/dist/components/agents-sdk/ManagerOfficeScreens.js +3 -3
  73. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +1 -1
  74. package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
  75. package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -1
  76. package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
  77. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
  78. package/dist/components/agents-sdk/McpPluginCatalog.js +4 -4
  79. package/dist/components/agents-sdk/McpServerIcon.d.ts +1 -1
  80. package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
  81. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  82. package/dist/components/agents-sdk/ModelEndpointDialog.js +1 -1
  83. package/dist/components/agents-sdk/ModelSelector.d.ts +2 -2
  84. package/dist/components/agents-sdk/ModelSelector.js +7 -6
  85. package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
  86. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  87. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  88. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +4 -2
  89. package/dist/components/agents-sdk/SubagentRunIndicator.js +4 -3
  90. package/dist/components/agents-sdk/SubagentRunLanes.d.ts +38 -0
  91. package/dist/components/agents-sdk/SubagentRunLanes.js +160 -0
  92. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +3 -28
  93. package/dist/components/agents-sdk/SubagentRunPanel.js +145 -190
  94. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +1 -1
  95. package/dist/components/agents-sdk/SubagentRunSelector.js +1 -1
  96. package/dist/components/agents-sdk/ThinkChat.d.ts +4 -7
  97. package/dist/components/agents-sdk/ThinkChat.js +5 -8
  98. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  99. package/dist/components/agents-sdk/ThinkChatActivity.js +27 -26
  100. package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
  101. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +28 -28
  102. package/dist/components/agents-sdk/ThinkChatToolPanels.js +13 -28
  103. package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +1 -1
  104. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  105. package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +1 -1
  106. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  107. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  108. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -16
  109. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +4 -4
  110. package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
  111. package/dist/components/agents-sdk/ThinkSchedule.d.ts +2 -0
  112. package/dist/components/agents-sdk/ThinkSchedule.js +9 -0
  113. package/dist/components/agents-sdk/ThinkScheduleActions.d.ts +42 -0
  114. package/dist/components/agents-sdk/{ThinkRoutineActions.js → ThinkScheduleActions.js} +35 -35
  115. package/dist/components/agents-sdk/ThinkScheduleBrowser.d.ts +24 -0
  116. package/dist/components/agents-sdk/{ThinkRoutineBrowser.js → ThinkScheduleBrowser.js} +47 -45
  117. package/dist/components/agents-sdk/ThinkScheduleDetail.d.ts +19 -0
  118. package/dist/components/agents-sdk/ThinkScheduleDetail.js +139 -0
  119. package/dist/components/agents-sdk/ThinkScheduleForm.d.ts +58 -0
  120. package/dist/components/agents-sdk/ThinkScheduleForm.js +686 -0
  121. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  122. package/dist/components/agents-sdk/WorkbenchBack.d.ts +1 -1
  123. package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
  124. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  125. package/dist/components/agents-sdk/Workspace.js +1 -1
  126. package/dist/components/agents-sdk/WorkspaceAutomation.d.ts +2 -0
  127. package/dist/components/agents-sdk/WorkspaceAutomation.js +791 -0
  128. package/dist/components/agents-sdk/WorkspaceAutomationTable.d.ts +2 -0
  129. package/dist/components/agents-sdk/{WorkspaceExecutionTable.js → WorkspaceAutomationTable.js} +45 -65
  130. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  131. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  132. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +2 -2
  133. package/dist/components/agents-sdk/WorkspaceConcept.js +1 -1
  134. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +28 -8
  135. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +104 -254
  136. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +2 -2
  137. package/dist/components/agents-sdk/WorkspaceExplorer.js +4 -4
  138. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  139. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  140. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  141. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  142. package/dist/components/agents-sdk/WorkspaceLink.d.ts +3 -2
  143. package/dist/components/agents-sdk/WorkspaceLink.js +2 -1
  144. package/dist/components/agents-sdk/WorkspaceLive.d.ts +13 -6
  145. package/dist/components/agents-sdk/WorkspaceLive.js +2 -0
  146. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +37 -2
  147. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  148. package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
  149. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +1 -1
  150. package/dist/components/agents-sdk/WorkspacePerson.d.ts +30 -0
  151. package/dist/components/agents-sdk/WorkspacePerson.js +100 -0
  152. package/dist/components/agents-sdk/WorkspaceProject.d.ts +24 -60
  153. package/dist/components/agents-sdk/WorkspaceProject.js +82 -184
  154. package/dist/components/ai-sdk/Activity.js +1 -1
  155. package/dist/components/ai-sdk/AgentAttention.d.ts +1 -1
  156. package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
  157. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +2 -2
  158. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  159. package/dist/components/ai-sdk/Approval.js +2 -2
  160. package/dist/components/ai-sdk/Artifact.d.ts +1 -1
  161. package/dist/components/ai-sdk/Artifact.js +2 -2
  162. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  163. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  164. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  165. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  166. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  167. package/dist/components/ai-sdk/ComposerLink.js +1 -1
  168. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +51 -63
  169. package/dist/components/ai-sdk/ConnectedAppCards.js +42 -365
  170. package/dist/components/ai-sdk/Context.js +1 -1
  171. package/dist/components/ai-sdk/Conversation.d.ts +1 -1
  172. package/dist/components/ai-sdk/Conversation.js +3 -3
  173. package/dist/components/ai-sdk/Goal.js +1 -1
  174. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  175. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  176. package/dist/components/ai-sdk/Message.d.ts +1 -1
  177. package/dist/components/ai-sdk/Message.js +12 -4
  178. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  179. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  180. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +1 -1
  181. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  182. package/dist/components/ai-sdk/Plan.js +1 -1
  183. package/dist/components/ai-sdk/PromptInput.d.ts +1 -1
  184. package/dist/components/ai-sdk/PromptInput.js +6 -6
  185. package/dist/components/ai-sdk/Queue.d.ts +1 -1
  186. package/dist/components/ai-sdk/Queue.js +1 -1
  187. package/dist/components/ai-sdk/Reasoning.js +1 -1
  188. package/dist/components/ai-sdk/Sources.js +1 -1
  189. package/dist/components/ai-sdk/Task.js +1 -1
  190. package/dist/components/extension/ChatGptSignInScreen.d.ts +17 -4
  191. package/dist/components/extension/ChatGptSignInScreen.js +32 -32
  192. package/dist/components/extension/CodexModelSelector.d.ts +1 -1
  193. package/dist/components/extension/CodexModelSelector.js +2 -2
  194. package/dist/components/extension/ConversationTabPicker.js +2 -2
  195. package/dist/components/extension/FirstRunSetup.d.ts +117 -0
  196. package/dist/components/extension/FirstRunSetup.js +1175 -0
  197. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  198. package/dist/components/foundations/AppIcon.d.ts +5 -2
  199. package/dist/components/foundations/Button.d.ts +1 -1
  200. package/dist/components/foundations/Button.js +1 -1
  201. package/dist/components/foundations/Card.d.ts +1 -1
  202. package/dist/components/foundations/Card.js +2 -2
  203. package/dist/components/foundations/Checkbox.js +1 -1
  204. package/dist/components/foundations/Collapsible.js +1 -1
  205. package/dist/components/foundations/ContextMenu.js +1 -1
  206. package/dist/components/foundations/DescriptionList.d.ts +3 -1
  207. package/dist/components/foundations/DescriptionList.js +2 -1
  208. package/dist/components/foundations/IconButton.d.ts +1 -1
  209. package/dist/components/foundations/LinkButton.d.ts +1 -1
  210. package/dist/components/foundations/Menubar.js +1 -1
  211. package/dist/components/foundations/Popover.js +1 -1
  212. package/dist/components/foundations/SearchField.js +1 -1
  213. package/dist/components/foundations/Select.js +1 -1
  214. package/dist/components/foundations/Stepper.js +1 -1
  215. package/dist/components/foundations/Toast.js +1 -1
  216. package/dist/components/foundations/Toggle.d.ts +2 -4
  217. package/dist/components/foundations/Toggle.js +3 -7
  218. package/dist/components/foundations/ToggleGroup.d.ts +3 -5
  219. package/dist/components/foundations/ToggleGroup.js +5 -17
  220. package/dist/components/foundations/icons.d.ts +2 -2
  221. package/dist/components/foundations/icons.js +2 -2
  222. package/dist/components/general-purpose/AccountSignInDialog.js +1 -1
  223. package/dist/components/general-purpose/ActionGuide.d.ts +1 -1
  224. package/dist/components/general-purpose/Commit.d.ts +1 -1
  225. package/dist/components/general-purpose/Commit.js +2 -2
  226. package/dist/components/general-purpose/EnvironmentVariables.d.ts +1 -1
  227. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  228. package/dist/components/general-purpose/FileTree.js +1 -1
  229. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  230. package/dist/components/general-purpose/PricingPlanCard.js +3 -3
  231. package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
  232. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
  233. package/dist/components/general-purpose/ResponsiveSidebarShell.js +2 -2
  234. package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
  235. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  236. package/dist/components/general-purpose/Terminal.d.ts +2 -2
  237. package/dist/components/general-purpose/Terminal.js +2 -2
  238. package/dist/components/general-purpose/TestResults.js +1 -1
  239. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  240. package/dist/components/general-purpose/WebPreview.d.ts +1 -1
  241. package/dist/components/general-purpose/WebPreview.js +1 -1
  242. package/dist/components/nanites/AgentConnection.js +3 -3
  243. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  244. package/dist/components/nanites/AgentToolDetail.js +4 -4
  245. package/dist/connected-app-drafts-B9i69bkj.js +283 -0
  246. package/dist/{copy-button-BIfY5M-D.d.ts → copy-button-B09hHWd1.d.ts} +1 -1
  247. package/dist/{copy-button-BsmxSSeD.js → copy-button-z20VEXRF.js} +1 -1
  248. package/dist/{execution-result-DWVmm-bL.js → execution-result-DAuW4VWv.js} +30 -2
  249. package/dist/{icons-Dj6id76o.d.ts → icons-CReP3qYl.d.ts} +7 -1
  250. package/dist/{icons-Cn3vWZRs.js → icons-Yp99gmMC.js} +9 -3
  251. package/dist/{mcp-server-catalog-kaMWaSAL.d.ts → mcp-server-catalog-Di4N46H9.d.ts} +9 -3
  252. package/dist/navigation-link-zK6z8Gn3.d.ts +18 -0
  253. package/dist/scheduled-table-source-NZR1vFc_.js +38 -0
  254. package/dist/styles/accessibility.css +22 -9
  255. package/dist/styles/accordion.css +2 -2
  256. package/dist/styles/activity-header.css +14 -11
  257. package/dist/styles/activity.css +6 -13
  258. package/dist/styles/agent-attention.css +0 -23
  259. package/dist/styles/agent-chat.css +8 -3
  260. package/dist/styles/agent-connection.css +2 -2
  261. package/dist/styles/app-icon.css +7 -0
  262. package/dist/styles/app-top-bar.css +3 -11
  263. package/dist/styles/approval.css +2 -2
  264. package/dist/styles/base.css +3 -1
  265. package/dist/styles/browser-live-screen.css +3 -1
  266. package/dist/styles/browser-run-panel.css +2 -2
  267. package/dist/styles/button.css +13 -44
  268. package/dist/styles/card.css +42 -5
  269. package/dist/styles/chain-of-thought.css +2 -8
  270. package/dist/styles/chatgpt-sign-in-screen.css +91 -83
  271. package/dist/styles/checkbox-group.css +2 -1
  272. package/dist/styles/checkbox.css +4 -6
  273. package/dist/styles/code-block.css +2 -1
  274. package/dist/styles/codex-model-selector.css +2 -2
  275. package/dist/styles/collapsible.css +2 -2
  276. package/dist/styles/color-contrast.test.ts +1 -0
  277. package/dist/styles/combobox.css +5 -9
  278. package/dist/styles/commit.css +2 -7
  279. package/dist/styles/composer-link.css +0 -10
  280. package/dist/styles/connected-app-card.css +32 -32
  281. package/dist/styles/context-menu.css +2 -2
  282. package/dist/styles/description-list.css +14 -0
  283. package/dist/styles/execution-board.css +1 -1
  284. package/dist/styles/execution-result.css +161 -0
  285. package/dist/styles/file-tree.css +5 -9
  286. package/dist/styles/first-run-setup.css +751 -0
  287. package/dist/styles/index.css +5 -2
  288. package/dist/styles/inline-citation.css +2 -10
  289. package/dist/styles/manager-office.css +16 -43
  290. package/dist/styles/marker.css +2 -2
  291. package/dist/styles/media-preview-card.css +2 -7
  292. package/dist/styles/message-scroller.css +3 -2
  293. package/dist/styles/model-selector.css +19 -15
  294. package/dist/styles/navigation-menu.css +4 -4
  295. package/dist/styles/number-field.css +2 -3
  296. package/dist/styles/preview-card.css +2 -2
  297. package/dist/styles/prompt-input.css +5 -15
  298. package/dist/styles/queue.css +2 -7
  299. package/dist/styles/radio.css +4 -6
  300. package/dist/styles/recipes.css +25 -52
  301. package/dist/styles/resizable-side-panel.css +3 -2
  302. package/dist/styles/responsive-sidebar-shell.css +1 -6
  303. package/dist/styles/scroll-area.css +3 -2
  304. package/dist/styles/scrollbars.css +2 -0
  305. package/dist/styles/search-field.css +1 -2
  306. package/dist/styles/slider.css +4 -5
  307. package/dist/styles/sources.css +2 -7
  308. package/dist/styles/stepper.css +4 -4
  309. package/dist/styles/streamdown.css +8 -1
  310. package/dist/styles/subagent-run.css +123 -12
  311. package/dist/styles/switch.css +4 -7
  312. package/dist/styles/tabs.css +5 -4
  313. package/dist/styles/task.css +2 -7
  314. package/dist/styles/test-results.css +2 -7
  315. package/dist/styles/theme-mode-control.css +0 -6
  316. package/dist/styles/think-chat-activity.css +0 -8
  317. package/dist/styles/think-execution-status.css +1 -1
  318. package/dist/styles/think-execution-workbench.css +3 -3
  319. package/dist/styles/think-full-app.css +3 -2
  320. package/dist/styles/{think-routine.css → think-schedule.css} +64 -80
  321. package/dist/styles/toggle-group.css +9 -6
  322. package/dist/styles/toggle.css +23 -15
  323. package/dist/styles/toolbar.css +0 -6
  324. package/dist/styles/workspace-automation.css +233 -0
  325. package/dist/styles/workspace-concepts.css +18 -412
  326. package/dist/styles/workspace-entity-card.css +146 -0
  327. package/dist/styles/workspace-explorer.css +4 -3
  328. package/dist/utils/codex-model-catalog.d.ts +1 -1
  329. package/dist/utils/mcp-server-catalog.d.ts +2 -2
  330. package/dist/utils/mcp-server-catalog.js +108 -21
  331. package/dist/utils/structured-code.d.ts +1 -1
  332. package/dist/{workspace-assets-RD6IhOyh.js → workspace-assets-Dq5toMQc.js} +34 -38
  333. package/dist/workspace-concept-panel-CxZfmFkP.js +66 -0
  334. package/dist/workspace-concept-panel-KpMmznB_.d.ts +21 -0
  335. package/dist/{workspace-delete-CrNGUuBp.js → workspace-delete-CoB0l6ZU.js} +2 -1
  336. package/dist/workspace-entity-card-2TC3RPKh.d.ts +7 -0
  337. package/dist/workspace-entity-card-B1aV-jBj.js +61 -0
  338. package/dist/workspace-person-BSgvRjZE.d.ts +24 -0
  339. package/dist/workspace-person-BVkYb3dv.js +116 -0
  340. package/package.json +2 -2
  341. package/dist/AgentToolRunsContext-DniwGn96.d.ts +0 -18
  342. package/dist/Correspondent-ANkZHGEa.d.ts +0 -60
  343. package/dist/ThinkRoutine-DoZjbzyn.d.ts +0 -41
  344. package/dist/WorkspaceConceptPanel-D21iRsWm.js +0 -23
  345. package/dist/WorkspaceExecutionTable-DNhj6YDX.d.ts +0 -239
  346. package/dist/WorkspaceMessageResponse-D8FGgIQU.d.ts +0 -39
  347. package/dist/components/agents-sdk/SubagentRunList.d.ts +0 -17
  348. package/dist/components/agents-sdk/SubagentRunList.js +0 -26
  349. package/dist/components/agents-sdk/ThinkRoutine.d.ts +0 -2
  350. package/dist/components/agents-sdk/ThinkRoutine.js +0 -9
  351. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +0 -42
  352. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +0 -25
  353. package/dist/components/agents-sdk/ThinkRoutineDetail.d.ts +0 -19
  354. package/dist/components/agents-sdk/ThinkRoutineDetail.js +0 -97
  355. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +0 -59
  356. package/dist/components/agents-sdk/ThinkRoutineForm.js +0 -744
  357. package/dist/components/agents-sdk/ThinkRoutineRuns.d.ts +0 -15
  358. package/dist/components/agents-sdk/ThinkRoutineRuns.js +0 -52
  359. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +0 -2
  360. package/dist/components/agents-sdk/WorkspaceExecution.js +0 -843
  361. package/dist/components/agents-sdk/WorkspaceExecutionTable.d.ts +0 -2
  362. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +0 -36
  363. package/dist/components/agents-sdk/WorkspaceUserScript.js +0 -153
  364. package/dist/components/ai-sdk/Correspondent.d.ts +0 -2
  365. package/dist/components/ai-sdk/Correspondent.js +0 -145
  366. package/dist/styles/correspondent.css +0 -73
@@ -0,0 +1,791 @@
1
+ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { C as FileIcon, E as InfoIcon, K as QueueIcon, Q as SplitIcon, U as PlayIcon, Z as SpinnerIcon, d as CheckIcon, et as StopIcon, r as ArrowLeftIcon, u as CalendarIcon } from "../../icons-Yp99gmMC.js";
3
+ import { Field } from "../foundations/Field.js";
4
+ import { Form } from "../foundations/Form.js";
5
+ import { Tabs } from "../foundations/Tabs.js";
6
+ import { IconButton } from "../foundations/IconButton.js";
7
+ import { a as formatErrorMessage, r as firstLine } from "../../format-CWaZEp5o.js";
8
+ import { n as mergeRefs } from "../../merge-refs-DAh6reu8.js";
9
+ import { DescriptionList } from "../foundations/DescriptionList.js";
10
+ import { Input } from "../foundations/Input.js";
11
+ import { a as httpUrl, i as WorkspaceComposerLink, r as OutboundLink, t as FaviconMark } from "../../workspace-assets-Dq5toMQc.js";
12
+ import { t as WorkspaceEntityCard } from "../../workspace-entity-card-B1aV-jBj.js";
13
+ import { a as executionResultSummary, n as executionErrorSummary } from "../../execution-result-DAuW4VWv.js";
14
+ import { t as ExecutionResult } from "../../ExecutionResult-DmC21cll.js";
15
+ import { EmptyState } from "../foundations/EmptyState.js";
16
+ import { AppTopBar } from "../general-purpose/AppTopBar.js";
17
+ import { ResponsiveSidebarAppBar } from "../general-purpose/ResponsiveSidebarShell.js";
18
+ import { n as useConceptEntry, t as WorkspaceConceptPanel } from "../../workspace-concept-panel-CxZfmFkP.js";
19
+ import { t as WorkspaceDeleteControl } from "../../workspace-delete-CoB0l6ZU.js";
20
+ import { Checkbox } from "../foundations/Checkbox.js";
21
+ import { ExecutionBoard } from "./ExecutionBoard.js";
22
+ import { WorkspaceAutomationTable } from "./WorkspaceAutomationTable.js";
23
+ import * as React from "react";
24
+ import { createElement } from "react";
25
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
26
+ import { hashKey, useMutation, useMutationState, useQuery } from "@tanstack/react-query";
27
+ //#region src/components/agents-sdk/WorkspaceAutomation.tsx
28
+ /** The Automations destination in the workbench navigation; the panel's heading and mark. */
29
+ const automationsWorkbenchItem = {
30
+ id: "automations",
31
+ label: "Automations",
32
+ description: "Run saved automations and follow their progress.",
33
+ icon: /* @__PURE__ */ jsx(QueueIcon, {})
34
+ };
35
+ function draftFrom(parameters) {
36
+ return Object.fromEntries(parameters.flatMap((parameter) => parameter.value === void 0 ? [] : [[parameter.name, parameter.type === "boolean" ? Boolean(parameter.value) : String(parameter.value)]]));
37
+ }
38
+ /**
39
+ * Values for one run. Empty and untouched fields stay absent so module
40
+ * defaults work. Schema types improve the input but never gate execution.
41
+ */
42
+ function collectRunParameters(parameters, draft) {
43
+ const collected = [];
44
+ for (const parameter of parameters) {
45
+ if (parameter.type === "boolean") {
46
+ if (Object.hasOwn(draft, parameter.name)) collected.push({
47
+ ...parameter,
48
+ value: Boolean(draft[parameter.name])
49
+ });
50
+ continue;
51
+ }
52
+ const raw = draft[parameter.name];
53
+ const text = (typeof raw === "string" ? raw : String(raw ?? "")).trim();
54
+ if (text === "") continue;
55
+ if (parameter.type === "number") {
56
+ const numeric = Number(text);
57
+ collected.push({
58
+ ...parameter,
59
+ value: Number.isFinite(numeric) ? numeric : text
60
+ });
61
+ continue;
62
+ }
63
+ collected.push({
64
+ ...parameter,
65
+ value: text
66
+ });
67
+ }
68
+ return collected;
69
+ }
70
+ function snapshotValue(parameter) {
71
+ if (parameter.value === void 0) return "";
72
+ if (parameter.type === "boolean") return parameter.value ? "Yes" : "No";
73
+ return String(parameter.value);
74
+ }
75
+ /** Distinct sites the automation's steps link to, one per host. */
76
+ function automationApps(graph) {
77
+ const apps = /* @__PURE__ */ new Map();
78
+ for (const node of graph?.nodes ?? []) for (const link of node.links ?? []) {
79
+ const href = httpUrl(link.href);
80
+ if (!href) continue;
81
+ const host = new URL(href).hostname;
82
+ if (!apps.has(host)) apps.set(host, {
83
+ ...link,
84
+ href
85
+ });
86
+ }
87
+ return [...apps.values()];
88
+ }
89
+ function AutomationApps({ apps, compact = false }) {
90
+ if (apps.length === 0) return null;
91
+ return /* @__PURE__ */ jsx("div", {
92
+ className: "workspace-automation-apps",
93
+ "aria-label": "Apps used",
94
+ children: apps.map((app) => /* @__PURE__ */ jsx(OutboundLink, {
95
+ href: app.href,
96
+ compact,
97
+ title: compact ? app.label : void 0,
98
+ children: app.label
99
+ }, app.href))
100
+ });
101
+ }
102
+ function missingRequiredInput(parameters, draft) {
103
+ return parameters.some((parameter) => parameter.required && (draft[parameter.name] === void 0 || draft[parameter.name] === ""));
104
+ }
105
+ /** The automation's inputs, folded open while a required one is empty. Read-only without `setDraft`. */
106
+ function RunOptions({ className, draft, parameters, setDraft }) {
107
+ const [open, setOpen] = React.useState(() => missingRequiredInput(parameters, draft));
108
+ const fieldId = React.useId();
109
+ const editing = setDraft != null;
110
+ const visibleParameters = editing ? parameters : parameters.filter((parameter) => snapshotValue(parameter) !== "");
111
+ return /* @__PURE__ */ jsxs("details", {
112
+ className,
113
+ open,
114
+ onToggle: (event) => setOpen(event.currentTarget.open),
115
+ children: [/* @__PURE__ */ jsx("summary", { children: "Run options" }), visibleParameters.length > 0 ? /* @__PURE__ */ jsx(DescriptionList.Root, {
116
+ align: "start",
117
+ variant: "divided",
118
+ children: visibleParameters.map((parameter) => {
119
+ const { name } = parameter;
120
+ const id = `${fieldId}-${name}`;
121
+ const help = [parameter.description, editing && parameter.required ? "Required." : void 0].filter(Boolean).join(" ");
122
+ const href = parameter.type === "string" ? httpUrl(String(editing ? draft[name] ?? parameter.value : parameter.value)) : void 0;
123
+ return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [
124
+ /* @__PURE__ */ jsxs(DescriptionList.Term, { children: [href && !editing ? /* @__PURE__ */ jsx(FaviconMark, { href }) : null, editing && parameter.type !== "boolean" ? /* @__PURE__ */ jsx("label", {
125
+ htmlFor: id,
126
+ children: parameter.label
127
+ }) : /* @__PURE__ */ jsx("span", {
128
+ id: parameter.type === "boolean" ? id : void 0,
129
+ children: parameter.label
130
+ })] }),
131
+ /* @__PURE__ */ jsx(DescriptionList.Details, { children: editing && parameter.type === "boolean" ? /* @__PURE__ */ jsx(Checkbox.Root, {
132
+ checked: draft[name] === true,
133
+ indeterminate: draft[name] === void 0,
134
+ "aria-labelledby": id,
135
+ "aria-describedby": help ? `${id}-description` : void 0,
136
+ onCheckedChange: (checked) => {
137
+ if (typeof checked === "boolean") setDraft((current) => ({
138
+ ...current,
139
+ [name]: checked
140
+ }));
141
+ },
142
+ children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
143
+ }) : editing ? /* @__PURE__ */ jsx(Input, {
144
+ id,
145
+ name,
146
+ "aria-describedby": help ? `${id}-description` : void 0,
147
+ type: href ? "url" : void 0,
148
+ value: String(draft[name] ?? ""),
149
+ autoComplete: "off",
150
+ inputMode: parameter.type === "number" ? "decimal" : void 0,
151
+ onChange: (event) => {
152
+ const { value } = event.currentTarget;
153
+ setDraft((current) => ({
154
+ ...current,
155
+ [name]: value
156
+ }));
157
+ }
158
+ }) : snapshotValue(parameter) }),
159
+ help ? /* @__PURE__ */ jsx(DescriptionList.Details, {
160
+ id: `${id}-description`,
161
+ className: "workspace-automation-field__hint",
162
+ children: help
163
+ }) : null
164
+ ] }, name);
165
+ })
166
+ }) : null]
167
+ });
168
+ }
169
+ function FileLinks({ files, onOpen }) {
170
+ return /* @__PURE__ */ jsx("div", {
171
+ className: "sigvelo-cluster",
172
+ children: files.map((file) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
173
+ value: file.path,
174
+ label: file.label,
175
+ onOpen: onOpen ? () => onOpen(file.path) : void 0
176
+ }, file.path))
177
+ });
178
+ }
179
+ function AutomationActions({ busy, canQuickRun, automation, onStop, running, source, stopping }) {
180
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
181
+ running && source.onStop ? /* @__PURE__ */ jsx(IconButton, {
182
+ label: "Stop run",
183
+ size: "xs",
184
+ variant: "ghost",
185
+ color: "neutral",
186
+ onClick: onStop,
187
+ disabled: stopping,
188
+ children: /* @__PURE__ */ jsx(StopIcon, {})
189
+ }) : source.onRun && canQuickRun ? /* @__PURE__ */ jsx(IconButton, {
190
+ type: "submit",
191
+ label: `Run now: ${automation.name}`,
192
+ tooltip: "Run",
193
+ size: "xs",
194
+ variant: "ghost",
195
+ color: "neutral",
196
+ disabled: busy,
197
+ children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
198
+ }) : null,
199
+ source.onSchedule && !source.onOpen ? /* @__PURE__ */ jsx(IconButton, {
200
+ label: `Schedule ${automation.name}`,
201
+ tooltip: "Schedule",
202
+ size: "xs",
203
+ variant: "ghost",
204
+ color: "neutral",
205
+ onClick: () => source.onSchedule?.(automation.path),
206
+ children: /* @__PURE__ */ jsx(CalendarIcon, {})
207
+ }) : null,
208
+ source.onDelete ? /* @__PURE__ */ jsx(WorkspaceDeleteControl, {
209
+ name: automation.name,
210
+ onDelete: () => source.onDelete?.(automation.path)
211
+ }) : null
212
+ ] });
213
+ }
214
+ function automationFormKey(automation) {
215
+ return `${automation.path}:${JSON.stringify(automation.parameters)}`;
216
+ }
217
+ function useAutomationSession(automation, source) {
218
+ const { path } = automation;
219
+ const trace = source.trace?.path === path ? source.trace : void 0;
220
+ const mutationKey = [
221
+ ...source.queryOptions.queryKey,
222
+ "run",
223
+ path
224
+ ];
225
+ const runs = useMutationState({
226
+ filters: {
227
+ mutationKey,
228
+ exact: true
229
+ },
230
+ select: (mutation) => mutation.state
231
+ });
232
+ const [draft, setDraft] = React.useState(() => draftFrom(runs.at(-1)?.variables ?? automation.parameters));
233
+ const formKey = automationFormKey(automation);
234
+ const [seenFormKey, setSeenFormKey] = React.useState(formKey);
235
+ if (formKey !== seenFormKey) {
236
+ setSeenFormKey(formKey);
237
+ setDraft(draftFrom(automation.parameters));
238
+ }
239
+ const runMutation = useMutation({
240
+ mutationKey,
241
+ onMutate: () => trace?.executionId,
242
+ mutationFn: async (parameters) => {
243
+ if (!source.onRun) throw new Error("Running is no longer available.");
244
+ source.onOpen?.(path);
245
+ const args = Object.fromEntries(parameters.flatMap(({ name, value }) => value === void 0 ? [] : [[name, value]]));
246
+ return source.onRun({
247
+ path,
248
+ args
249
+ });
250
+ }
251
+ });
252
+ const latestRun = runs.at(-1) ?? runMutation;
253
+ const busy = runMutation.isPending || latestRun.status === "pending" || trace?.status === "running";
254
+ const stopMutation = useMutation({
255
+ onMutate: () => trace?.executionId,
256
+ mutationFn: async () => trace ? source.onStop?.(trace.executionId) : void 0
257
+ });
258
+ const superseded = trace !== void 0 && latestRun.status !== "pending" && trace.executionId !== latestRun.context && trace.executionId !== latestRun.data?.executionId;
259
+ const error = (stopMutation.context === trace?.executionId ? stopMutation.error : null) ?? (superseded ? null : latestRun.error);
260
+ return {
261
+ trace,
262
+ draft,
263
+ setDraft,
264
+ runMutation,
265
+ stopMutation,
266
+ busy,
267
+ errorMessage: error ? executionErrorSummary(formatErrorMessage(error)) : "",
268
+ outcome: !superseded && latestRun.status === "success" ? latestRun.data : void 0,
269
+ runStatus: latestRun.status
270
+ };
271
+ }
272
+ function automationCardStatus(trace, busy, hasError, hasOutcome) {
273
+ if (busy) return "Running";
274
+ if (hasError) return "Failed";
275
+ if (trace?.status === "aborted") return "Stopped";
276
+ if (trace?.status === "interrupted") return "Interrupted";
277
+ return hasOutcome ? "Completed" : void 0;
278
+ }
279
+ /** What a card shows under its name, or null when it has nothing to show. */
280
+ function automationCardDetail(automation, { onOpen, onRun }, { trace, busy, errorMessage, outcome }) {
281
+ const completed = outcome != null || trace?.status === "completed";
282
+ const error = errorMessage || (trace?.error ? firstLine(executionErrorSummary(trace.error)) : "");
283
+ const apps = automationApps(trace?.graph ?? automation.graph);
284
+ const status = automationCardStatus(trace, busy, Boolean(error), completed);
285
+ const file = outcome?.files[0] ?? automation.runs?.[0];
286
+ const result = onOpen ? void 0 : outcome?.result ?? trace?.result;
287
+ const options = onRun != null && !onOpen && automation.parameters.length > 0;
288
+ const meta = apps.length > 0 || status != null || file != null;
289
+ return meta || result != null || options || error ? {
290
+ completed,
291
+ error,
292
+ apps,
293
+ status,
294
+ file,
295
+ result,
296
+ options,
297
+ meta
298
+ } : null;
299
+ }
300
+ function AutomationCardDetail({ completed, error, apps, status, file, result, options, meta, automation, session: { busy, draft, setDraft }, onOpen }) {
301
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
302
+ meta ? /* @__PURE__ */ jsxs("div", {
303
+ className: "workspace-automation-card__meta",
304
+ children: [
305
+ /* @__PURE__ */ jsx(AutomationApps, {
306
+ apps,
307
+ compact: true
308
+ }),
309
+ status ? /* @__PURE__ */ jsxs("span", {
310
+ className: "workspace-automation-status",
311
+ role: "status",
312
+ "aria-atomic": "true",
313
+ children: [busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : completed && !error ? /* @__PURE__ */ jsx(CheckIcon, {}) : null, status]
314
+ }) : null,
315
+ file ? /* @__PURE__ */ jsx(FileLinks, {
316
+ files: [file],
317
+ onOpen
318
+ }) : null
319
+ ]
320
+ }) : null,
321
+ result != null ? /* @__PURE__ */ jsx("p", {
322
+ className: "workspace-automation-card__summary sigvelo-truncate",
323
+ children: firstLine(executionResultSummary(result))
324
+ }) : null,
325
+ options ? /* @__PURE__ */ jsx(RunOptions, {
326
+ className: "workspace-automation-card__options",
327
+ draft,
328
+ parameters: automation.parameters,
329
+ setDraft
330
+ }, automationFormKey(automation)) : null,
331
+ error ? /* @__PURE__ */ jsx(Field.Errors, { errors: [error] }) : null
332
+ ] });
333
+ }
334
+ /**
335
+ * Library and inline card. The name opens the workbench; without one the card
336
+ * runs in place, with its inputs folded under Run options.
337
+ */
338
+ function AutomationCard({ className, automation, source, ...props }) {
339
+ const session = useAutomationSession(automation, source);
340
+ const { trace, draft, runMutation, stopMutation, busy } = session;
341
+ const { onOpen, onRun } = source;
342
+ const detail = automationCardDetail(automation, source, session);
343
+ const card = /* @__PURE__ */ jsx(WorkspaceEntityCard, {
344
+ ...props,
345
+ "data-slot": "workspace-automation-card",
346
+ className: cx("workspace-automation-card", className),
347
+ icon: automation.icon ?? /* @__PURE__ */ jsx(QueueIcon, {}),
348
+ name: automation.name,
349
+ onOpen: onOpen ? () => onOpen(automation.path) : void 0,
350
+ meta: automation.description,
351
+ actions: /* @__PURE__ */ jsx(AutomationActions, {
352
+ busy,
353
+ canQuickRun: !onOpen || !missingRequiredInput(automation.parameters, draft),
354
+ automation,
355
+ onStop: () => stopMutation.mutate(),
356
+ running: trace?.status === "running",
357
+ source,
358
+ stopping: stopMutation.isPending
359
+ }),
360
+ detail: detail ? /* @__PURE__ */ jsx(AutomationCardDetail, {
361
+ ...detail,
362
+ automation,
363
+ session,
364
+ onOpen
365
+ }) : void 0
366
+ });
367
+ return onRun ? /* @__PURE__ */ jsx(Form, {
368
+ noValidate: true,
369
+ onSubmit: (event) => {
370
+ event.preventDefault();
371
+ if (!busy) {
372
+ stopMutation.reset();
373
+ runMutation.mutate(collectRunParameters(automation.parameters, draft));
374
+ }
375
+ },
376
+ children: card
377
+ }) : card;
378
+ }
379
+ /** Compact inline card for one queried automation. */
380
+ function WorkspaceAutomationFile({ fallback = null, path, source, ...props }) {
381
+ const automation = useConceptEntry(source, path);
382
+ return automation ? /* @__PURE__ */ createElement(AutomationCard, {
383
+ ...props,
384
+ key: `${hashKey(source.queryOptions.queryKey)}:${path}`,
385
+ automation,
386
+ source
387
+ }) : fallback;
388
+ }
389
+ /**
390
+ * The library's entries: saved automations, plus the live table run and the
391
+ * live trace when no saved automation owns them.
392
+ */
393
+ function automationEntries(automations, source) {
394
+ const entries = automations.map((automation) => ({
395
+ automation,
396
+ source
397
+ }));
398
+ const { queryOptions, tableExecution, trace, onOpen, onStop } = source;
399
+ if (tableExecution && !entries.some(({ automation }) => automation.path === tableExecution.invocation.path)) entries.unshift({
400
+ automation: {
401
+ path: tableExecution.invocation.path,
402
+ name: tableExecution.name,
403
+ parameters: []
404
+ },
405
+ source
406
+ });
407
+ if (trace && !entries.some(({ automation }) => automation.path === trace.path)) entries.unshift({
408
+ automation: {
409
+ path: trace.path,
410
+ name: "Current automation",
411
+ parameters: []
412
+ },
413
+ source: {
414
+ queryOptions,
415
+ trace,
416
+ onOpen,
417
+ onStop
418
+ }
419
+ });
420
+ return entries;
421
+ }
422
+ /** The routed selection: a saved run, a library entry, or a path still loading. */
423
+ function selectedEntry(entries, source, selectedPath, selectedTrace) {
424
+ const { queryOptions } = source;
425
+ if (selectedTrace) {
426
+ const saved = entries.find(({ automation }) => automation.path === selectedTrace.path);
427
+ return saved ? {
428
+ automation: saved.automation,
429
+ source: {
430
+ ...saved.source,
431
+ trace: selectedTrace,
432
+ tableExecution: void 0,
433
+ onStop: void 0
434
+ }
435
+ } : {
436
+ automation: {
437
+ path: selectedTrace.path,
438
+ name: "Saved automation run",
439
+ parameters: []
440
+ },
441
+ source: {
442
+ queryOptions,
443
+ trace: selectedTrace
444
+ }
445
+ };
446
+ }
447
+ if (!selectedPath) return void 0;
448
+ return entries.find(({ automation }) => automation.path === selectedPath) ?? {
449
+ automation: {
450
+ path: selectedPath,
451
+ name: "Automation",
452
+ parameters: []
453
+ },
454
+ source: { queryOptions }
455
+ };
456
+ }
457
+ /**
458
+ * Route-owned automation workbench: compact library cards or one selected
459
+ * automation. A query failure with nothing loaded is an error, never an empty
460
+ * library.
461
+ */
462
+ function WorkspaceAutomationsPanel({ className, source, selectedPath, selectedTrace, selectedGraph, onBack, ref, ...props }) {
463
+ const entries = automationEntries(useQuery(source.queryOptions).data ?? [], source);
464
+ const selected = selectedEntry(entries, source, selectedPath, selectedTrace);
465
+ const panelRef = React.useRef(null);
466
+ const focusedControl = React.useRef(null);
467
+ const sourceKey = hashKey(source.queryOptions.queryKey);
468
+ const selectionKey = `${sourceKey}:${selectedPath ?? selected?.automation.path ?? ""}`;
469
+ React.useLayoutEffect(() => {
470
+ const previous = focusedControl.current;
471
+ if (!previous || previous.isConnected) return;
472
+ focusedControl.current = null;
473
+ if (document.activeElement === document.body) panelRef.current?.focus({ preventScroll: true });
474
+ }, [selectionKey]);
475
+ const mergedPanelRef = React.useMemo(() => mergeRefs(ref, panelRef), [ref]);
476
+ const panelProps = {
477
+ ...props,
478
+ ref: mergedPanelRef,
479
+ tabIndex: props.tabIndex ?? -1,
480
+ onFocusCapture: (event) => {
481
+ focusedControl.current = event.target;
482
+ props.onFocusCapture?.(event);
483
+ },
484
+ onBlurCapture: (event) => {
485
+ focusedControl.current = null;
486
+ props.onBlurCapture?.(event);
487
+ }
488
+ };
489
+ if (selected) return /* @__PURE__ */ createElement(WorkspaceAutomationWorkbench, {
490
+ ...panelProps,
491
+ key: selectionKey,
492
+ className,
493
+ automation: {
494
+ ...selected.automation,
495
+ graph: selectedGraph ?? selected.automation.graph
496
+ },
497
+ source: selected.source,
498
+ onBack
499
+ });
500
+ return /* @__PURE__ */ jsx(WorkspaceConceptPanel, {
501
+ "data-slot": "workspace-automations-panel",
502
+ className,
503
+ ...panelProps,
504
+ item: automationsWorkbenchItem,
505
+ emptyDescription: "Ask your assistant to save an automation to find it here.",
506
+ queryOptions: source.queryOptions,
507
+ children: () => entries.map((entry) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(AutomationCard, {
508
+ flat: true,
509
+ ...entry
510
+ }) }, entry.automation.path))
511
+ }, sourceKey);
512
+ }
513
+ function WorkbenchResult({ trace, runnable, graph, busy, completed, errorMessage }) {
514
+ if (completed) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("p", {
515
+ className: "workspace-automation-status",
516
+ children: [/* @__PURE__ */ jsx(CheckIcon, {}), busy ? "Previous result" : "Completed"]
517
+ }), /* @__PURE__ */ jsx(ExecutionResult, { result: completed.result })] });
518
+ const traceError = trace?.error ? executionErrorSummary(trace.error) : "";
519
+ if (errorMessage || traceError) return /* @__PURE__ */ jsx(EmptyState, {
520
+ icon: /* @__PURE__ */ jsx(InfoIcon, {}),
521
+ title: "This run could not finish",
522
+ description: traceError || errorMessage
523
+ });
524
+ if (trace?.status === "aborted" || trace?.status === "interrupted") return /* @__PURE__ */ jsx(EmptyState, {
525
+ icon: /* @__PURE__ */ jsx(StopIcon, {}),
526
+ title: trace.status === "aborted" ? "Run stopped" : "Run interrupted"
527
+ });
528
+ if (!graph && !runnable) return /* @__PURE__ */ jsx(EmptyState, {
529
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
530
+ title: "Loading automation"
531
+ });
532
+ return busy ? /* @__PURE__ */ jsx(EmptyState, {
533
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
534
+ title: "Running automation",
535
+ description: "Follow the run in Steps."
536
+ }) : /* @__PURE__ */ jsx(EmptyState, {
537
+ icon: /* @__PURE__ */ jsx(PlayIcon, {}),
538
+ title: "Not run yet",
539
+ description: "Run this automation to see its results here."
540
+ });
541
+ }
542
+ function WorkbenchRunAction({ automation, source, running, tableMode, busy, stopping, onStop, formId }) {
543
+ if (tableMode) return null;
544
+ if (running && source.onStop) return /* @__PURE__ */ jsx(AppTopBar.Button, {
545
+ label: "Stop run",
546
+ onClick: onStop,
547
+ disabled: stopping,
548
+ children: stopping ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(StopIcon, {})
549
+ });
550
+ if (!source.onRun) return null;
551
+ return /* @__PURE__ */ jsx(AppTopBar.Button, {
552
+ type: "submit",
553
+ form: formId,
554
+ label: `Run now: ${automation.name}`,
555
+ disabled: busy,
556
+ children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
557
+ });
558
+ }
559
+ function WorkbenchHeader({ automation, source, running, tableRunning, onBack, tableMode, onToggleTable, busy, stopping, onStop, formId }) {
560
+ return /* @__PURE__ */ jsx(ResponsiveSidebarAppBar, {
561
+ label: "Automation controls",
562
+ className: "workspace-concept-panel__header",
563
+ title: automation.name,
564
+ titleRender: (props) => /* @__PURE__ */ jsx("h2", {
565
+ ...props,
566
+ children: props.children
567
+ }),
568
+ leading: onBack ? /* @__PURE__ */ jsx(AppTopBar.Button, {
569
+ label: "Back to automations",
570
+ onClick: onBack,
571
+ children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
572
+ }) : void 0,
573
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
574
+ source.onRunTable ? /* @__PURE__ */ jsx(AppTopBar.Button, {
575
+ label: tableMode ? "Single run" : "Run on a table",
576
+ disabled: busy || tableRunning,
577
+ onClick: onToggleTable,
578
+ children: /* @__PURE__ */ jsx(QueueIcon, {})
579
+ }) : null,
580
+ source.onSchedule && !tableMode ? /* @__PURE__ */ jsx(AppTopBar.Button, {
581
+ label: `Schedule ${automation.name}`,
582
+ onClick: () => source.onSchedule?.(automation.path),
583
+ children: /* @__PURE__ */ jsx(CalendarIcon, {})
584
+ }) : null,
585
+ /* @__PURE__ */ jsx(WorkbenchRunAction, {
586
+ automation,
587
+ source,
588
+ running,
589
+ tableMode,
590
+ busy,
591
+ stopping,
592
+ onStop,
593
+ formId
594
+ })
595
+ ] })
596
+ });
597
+ }
598
+ function WorkbenchSingleRun({ automation, source, trace, graph, draft, setDraft, tab, setTab, busy, completed, errorMessage, outcome }) {
599
+ return /* @__PURE__ */ jsxs("div", {
600
+ className: "workspace-automation-workbench__content",
601
+ children: [automation.parameters.length > 0 ? /* @__PURE__ */ jsx(RunOptions, {
602
+ className: "workspace-automation-workbench__inputs",
603
+ draft,
604
+ parameters: automation.parameters,
605
+ setDraft: source.onRun ? setDraft : void 0
606
+ }, automationFormKey(automation)) : null, /* @__PURE__ */ jsxs(Tabs.Root, {
607
+ value: tab,
608
+ onValueChange: (value) => setTab(String(value)),
609
+ className: "workspace-automation-workbench__tabs",
610
+ children: [
611
+ /* @__PURE__ */ jsxs(Tabs.List, {
612
+ variant: "line",
613
+ "aria-label": "Automation view",
614
+ className: "workspace-automation-workbench__tab-list",
615
+ children: [/* @__PURE__ */ jsxs(Tabs.Tab, {
616
+ value: "results",
617
+ className: "workspace-automation-workbench__tab",
618
+ children: [/* @__PURE__ */ jsx(FileIcon, {}), "Results"]
619
+ }), /* @__PURE__ */ jsxs(Tabs.Tab, {
620
+ value: "steps",
621
+ className: "workspace-automation-workbench__tab",
622
+ children: [/* @__PURE__ */ jsx(SplitIcon, {}), "Steps"]
623
+ })]
624
+ }),
625
+ /* @__PURE__ */ jsxs(Tabs.Panel, {
626
+ value: "results",
627
+ className: "workspace-automation-workbench__results",
628
+ children: [
629
+ /* @__PURE__ */ jsx(WorkbenchResult, {
630
+ trace,
631
+ runnable: source.onRun != null,
632
+ graph,
633
+ busy,
634
+ completed,
635
+ errorMessage
636
+ }),
637
+ outcome?.files.length ? /* @__PURE__ */ jsx(FileLinks, {
638
+ files: outcome.files,
639
+ onOpen: source.onOpen
640
+ }) : null,
641
+ automation.runs?.length ? /* @__PURE__ */ jsxs("details", {
642
+ className: "workspace-automation-workbench__history",
643
+ children: [/* @__PURE__ */ jsx("summary", { children: "Saved runs" }), /* @__PURE__ */ jsx(FileLinks, {
644
+ files: automation.runs,
645
+ onOpen: source.onOpen
646
+ })]
647
+ }) : null
648
+ ]
649
+ }),
650
+ /* @__PURE__ */ jsx(Tabs.Panel, {
651
+ value: "steps",
652
+ className: "workspace-automation-workbench__steps",
653
+ children: graph ? /* @__PURE__ */ jsx(ExecutionBoard, {
654
+ className: "workspace-automation-workbench__board",
655
+ graph,
656
+ trace,
657
+ showResults: false
658
+ }) : /* @__PURE__ */ jsx(EmptyState, {
659
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
660
+ title: "Loading automation steps"
661
+ })
662
+ })
663
+ ]
664
+ })]
665
+ });
666
+ }
667
+ function useWorkbenchTabs(trace, runStatus, busy) {
668
+ const [tab, setTab] = React.useState(busy ? "steps" : "results");
669
+ const [seenRunStatus, setSeenRunStatus] = React.useState(runStatus);
670
+ if (runStatus !== seenRunStatus) {
671
+ setSeenRunStatus(runStatus);
672
+ if (runStatus === "pending") setTab("steps");
673
+ }
674
+ const [seenTrace, setSeenTrace] = React.useState(() => ({
675
+ executionId: trace?.executionId,
676
+ status: trace?.status
677
+ }));
678
+ if (seenTrace.executionId !== trace?.executionId || seenTrace.status !== trace?.status) {
679
+ setSeenTrace({
680
+ executionId: trace?.executionId,
681
+ status: trace?.status
682
+ });
683
+ if (trace?.status === "running") setTab("steps");
684
+ }
685
+ return [tab, setTab];
686
+ }
687
+ /** Each newly attached table run reopens table mode; the user can still leave it. */
688
+ function useTableMode(tableExecution) {
689
+ const [tableMode, setTableMode] = React.useState(Boolean(tableExecution));
690
+ const [seenTablePath, setSeenTablePath] = React.useState(tableExecution?.path);
691
+ if (tableExecution?.path !== seenTablePath) {
692
+ setSeenTablePath(tableExecution?.path);
693
+ if (tableExecution) setTableMode(true);
694
+ }
695
+ return [tableMode, setTableMode];
696
+ }
697
+ /** Keeps the last completed result inspectable while its replacement is running. */
698
+ function useVisibleCompleted(outcome, trace, busy) {
699
+ const completed = outcome ?? (trace?.status === "completed" ? trace : void 0);
700
+ const [lastCompleted, setLastCompleted] = React.useState(completed);
701
+ if (completed && completed !== lastCompleted) setLastCompleted(completed);
702
+ return busy ? lastCompleted : completed;
703
+ }
704
+ function WorkspaceAutomationWorkbench({ automation, source, onBack, className, ref, ...props }) {
705
+ const { trace, draft, setDraft, runMutation, stopMutation, busy, errorMessage, outcome, runStatus } = useAutomationSession(automation, source);
706
+ const formId = React.useId();
707
+ const graph = trace?.graph ?? automation.graph;
708
+ const tableExecution = source.tableExecution?.invocation.path === automation.path ? source.tableExecution : void 0;
709
+ const [tableMode, setTableMode] = useTableMode(tableExecution);
710
+ const [tab, setTab] = useWorkbenchTabs(trace, runStatus, busy);
711
+ const visibleCompleted = useVisibleCompleted(outcome, trace, busy);
712
+ const tableValues = new Map(collectRunParameters(automation.parameters, draft).map(({ name, value }) => [name, value]));
713
+ return /* @__PURE__ */ jsx("section", {
714
+ ...props,
715
+ ref,
716
+ "aria-label": props["aria-label"] ?? automationsWorkbenchItem.label,
717
+ "data-slot": "workspace-automations-panel",
718
+ className: cx("workspace-concept-panel workspace-automation-workbench", className),
719
+ children: /* @__PURE__ */ jsxs(Form, {
720
+ id: formId,
721
+ noValidate: true,
722
+ onSubmit: (event) => {
723
+ event.preventDefault();
724
+ if (!tableMode && !busy && source.onRun) {
725
+ stopMutation.reset();
726
+ setTab("steps");
727
+ runMutation.mutate(collectRunParameters(automation.parameters, draft));
728
+ }
729
+ },
730
+ children: [
731
+ /* @__PURE__ */ jsx(WorkbenchHeader, {
732
+ automation,
733
+ source,
734
+ running: trace?.status === "running",
735
+ tableRunning: tableExecution?.status === "running",
736
+ formId,
737
+ onBack,
738
+ tableMode,
739
+ onToggleTable: () => setTableMode((current) => !current),
740
+ busy,
741
+ stopping: stopMutation.isPending,
742
+ onStop: () => stopMutation.mutate()
743
+ }),
744
+ automation.description ? /* @__PURE__ */ jsx("p", {
745
+ className: "workspace-automation-workbench__description",
746
+ children: automation.description
747
+ }) : null,
748
+ /* @__PURE__ */ jsx(AutomationApps, { apps: automationApps(graph) }),
749
+ !tableMode && errorMessage ? /* @__PURE__ */ jsx(Field.Errors, { errors: [errorMessage] }) : null,
750
+ /* @__PURE__ */ jsx("span", {
751
+ className: "sigvelo-visually-hidden",
752
+ role: "status",
753
+ "aria-atomic": "true",
754
+ children: busy && trace?.status !== "running" ? "Starting run" : ""
755
+ }),
756
+ tableMode ? /* @__PURE__ */ jsx(WorkspaceAutomationTable, {
757
+ path: automation.path,
758
+ parameters: automation.parameters.map((parameter) => ({
759
+ ...parameter,
760
+ value: tableValues.get(parameter.name)
761
+ })),
762
+ execution: tableExecution,
763
+ trace,
764
+ graph,
765
+ onLoadTable: source.onLoadTable,
766
+ onRequestTableSource: source.onRequestTableSource,
767
+ onPrepareTable: source.onPrepareTable,
768
+ onRunTable: source.onRunTable,
769
+ onStopTable: source.onStopTable,
770
+ onLoadTableTrace: source.onLoadTableTrace,
771
+ onScheduleTable: source.onScheduleTable
772
+ }) : /* @__PURE__ */ jsx(WorkbenchSingleRun, {
773
+ automation,
774
+ source,
775
+ trace,
776
+ graph,
777
+ draft,
778
+ setDraft,
779
+ tab,
780
+ setTab,
781
+ busy,
782
+ completed: visibleCompleted,
783
+ errorMessage,
784
+ outcome
785
+ })
786
+ ]
787
+ })
788
+ });
789
+ }
790
+ //#endregion
791
+ export { WorkspaceAutomationFile, WorkspaceAutomationsPanel, automationsWorkbenchItem };