@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
@@ -1,744 +0,0 @@
1
- import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { K as SpinnerIcon, T as InfoIcon, d as CheckIcon, f as ChevronDownIcon, r as ArrowLeftIcon, tt as WarningIcon } from "../../icons-Cn3vWZRs.js";
3
- import { Button } from "../foundations/Button.js";
4
- import { IconButton } from "../foundations/IconButton.js";
5
- import { a as formatErrorMessage } from "../../format-CWaZEp5o.js";
6
- import { Field } from "../foundations/Field.js";
7
- import { Form } from "../foundations/Form.js";
8
- import { Textarea } from "../foundations/Textarea.js";
9
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
10
- import { Fieldset } from "../foundations/Fieldset.js";
11
- import { Select } from "../foundations/Select.js";
12
- import { t as executionErrorSummary } from "../../execution-result-DWVmm-bL.js";
13
- import { a as httpUrl, t as FaviconMark } from "../../workspace-assets-RD6IhOyh.js";
14
- import { t as ExecutionResult } from "../../ExecutionResult-Wd1sKAvD.js";
15
- import { Checkbox } from "../foundations/Checkbox.js";
16
- import { CheckboxGroup } from "../foundations/CheckboxGroup.js";
17
- import { Combobox } from "../foundations/Combobox.js";
18
- import { NumberField } from "../foundations/NumberField.js";
19
- import * as React from "react";
20
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
- //#region src/components/agents-sdk/ThinkRoutineForm.tsx
22
- const SCHEDULE_KIND_OPTIONS = [
23
- {
24
- label: "At an interval",
25
- value: "interval"
26
- },
27
- {
28
- label: "Every day",
29
- value: "daily"
30
- },
31
- {
32
- label: "Every weekday",
33
- value: "weekdays"
34
- },
35
- {
36
- label: "Every week",
37
- value: "weekly"
38
- }
39
- ];
40
- const INTERVAL_UNIT_OPTIONS = [{
41
- label: "Minutes",
42
- value: "minute"
43
- }, {
44
- label: "Hours",
45
- value: "hour"
46
- }];
47
- const BROWSER_TIMEZONE = Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
48
- const WEEKDAYS = [
49
- {
50
- token: "mon",
51
- dayNumber: 1,
52
- label: "Monday"
53
- },
54
- {
55
- token: "tue",
56
- dayNumber: 2,
57
- label: "Tuesday"
58
- },
59
- {
60
- token: "wed",
61
- dayNumber: 3,
62
- label: "Wednesday"
63
- },
64
- {
65
- token: "thu",
66
- dayNumber: 4,
67
- label: "Thursday"
68
- },
69
- {
70
- token: "fri",
71
- dayNumber: 5,
72
- label: "Friday"
73
- },
74
- {
75
- token: "sat",
76
- dayNumber: 6,
77
- label: "Saturday"
78
- },
79
- {
80
- token: "sun",
81
- dayNumber: 0,
82
- label: "Sunday"
83
- }
84
- ];
85
- function scheduleKindOf(schedule) {
86
- if (schedule.kind === "interval") return "interval";
87
- if (schedule.days === "daily") return "daily";
88
- if (schedule.days === "weekday") return "weekdays";
89
- return "weekly";
90
- }
91
- function wallClockTime(schedule) {
92
- const pad = (value) => String(value).padStart(2, "0");
93
- return `${pad(schedule.hour)}:${pad(schedule.minute)}`;
94
- }
95
- function scheduleDefaults(schedule) {
96
- const intervalMs = schedule?.kind === "interval" ? schedule.intervalMs : void 0;
97
- const wallClock = schedule?.kind === "wall-clock" ? schedule : void 0;
98
- const selectedDays = wallClock?.days;
99
- return {
100
- kind: schedule ? scheduleKindOf(schedule) : "daily",
101
- intervalEvery: intervalMs === void 0 ? 1 : intervalMs % 36e5 === 0 ? intervalMs / 36e5 : intervalMs / 6e4,
102
- intervalUnit: intervalMs !== void 0 && intervalMs % 36e5 !== 0 ? "minute" : "hour",
103
- time: wallClock ? wallClockTime(wallClock) : "09:00",
104
- timezone: wallClock?.timezone ?? BROWSER_TIMEZONE,
105
- days: selectedDays && typeof selectedDays !== "string" ? WEEKDAYS.filter((day) => selectedDays.includes(day.dayNumber)).map((day) => day.token) : ["mon"]
106
- };
107
- }
108
- function serializeSchedule({ kind, intervalEvery, intervalUnit, time, timezone, days }) {
109
- if (kind === "interval") {
110
- if (intervalEvery === null || !Number.isSafeInteger(intervalEvery) || intervalEvery < 1) return null;
111
- return `every ${intervalEvery} ${intervalUnit}${intervalEvery === 1 ? "" : "s"}`;
112
- }
113
- if (kind === "weekly") {
114
- if (days.length === 0) return null;
115
- return `every week on ${WEEKDAYS.filter((day) => days.includes(day.token)).map((day) => day.token).join(",")} at ${time} in ${timezone}`;
116
- }
117
- if (kind === "weekdays") return `every weekday at ${time} in ${timezone}`;
118
- return `every day at ${time} in ${timezone}`;
119
- }
120
- function timezoneOptions() {
121
- return [.../* @__PURE__ */ new Set([
122
- BROWSER_TIMEZONE,
123
- "UTC",
124
- ...Intl.supportedValuesOf("timeZone")
125
- ])].sort((left, right) => left.localeCompare(right)).map((value) => ({
126
- label: value,
127
- value
128
- }));
129
- }
130
- const TIMEZONE_OPTIONS = timezoneOptions();
131
- function RoutineSelect({ disabled, description, label, name, onValueChange, options, value }) {
132
- return /* @__PURE__ */ jsx("div", {
133
- className: "think-routine__select-field",
134
- children: /* @__PURE__ */ jsxs(Select.Root, {
135
- disabled,
136
- name,
137
- items: options,
138
- value,
139
- onValueChange: (nextValue) => {
140
- if (typeof nextValue === "string") onValueChange(nextValue);
141
- },
142
- children: [
143
- /* @__PURE__ */ jsxs("div", {
144
- className: "think-routine__input-label",
145
- children: [/* @__PURE__ */ jsx(Select.Label, { children: label }), description ? /* @__PURE__ */ jsx(IconButton, {
146
- label: `About ${label}`,
147
- tooltip: description,
148
- variant: "ghost",
149
- color: "neutral",
150
- children: /* @__PURE__ */ jsx(InfoIcon, {})
151
- }) : null]
152
- }),
153
- /* @__PURE__ */ jsxs(Select.Trigger, { children: [/* @__PURE__ */ jsx(Select.Value, {}), /* @__PURE__ */ jsx(Select.Icon, {})] }),
154
- /* @__PURE__ */ jsx(Select.Portal, { children: /* @__PURE__ */ jsx(Select.Positioner, {
155
- sideOffset: 4,
156
- children: /* @__PURE__ */ jsx(Select.Popup, { children: /* @__PURE__ */ jsx(Select.List, { children: options.map((option) => /* @__PURE__ */ jsxs(Select.Item, {
157
- value: option.value,
158
- children: [/* @__PURE__ */ jsx(Select.ItemText, { children: option.label }), /* @__PURE__ */ jsx(Select.ItemIndicator, {})]
159
- }, option.value)) }) })
160
- }) })
161
- ]
162
- })
163
- });
164
- }
165
- function RoutineTableSource({ table, scripts }) {
166
- if (!table) return null;
167
- return /* @__PURE__ */ jsxs("div", {
168
- className: "think-routine__table-source",
169
- children: [
170
- /* @__PURE__ */ jsx("p", { children: "Run once for each table row" }),
171
- /* @__PURE__ */ jsx(RoutineTableOrigin, {
172
- table,
173
- scripts
174
- }),
175
- /* @__PURE__ */ jsx("p", {
176
- className: "think-routine__input-help",
177
- children: "script" in table.source ? "Reads current rows for each scheduled run" : "data" in table.source ? "Repeats these rows on schedule" : "Uses this saved file for each scheduled run"
178
- })
179
- ]
180
- });
181
- }
182
- function RoutineTableOrigin({ table, scripts }) {
183
- if ("data" in table.source && table.source.data.source) {
184
- const source = table.source.data.source;
185
- const href = source.href ? httpUrl(source.href) : void 0;
186
- return /* @__PURE__ */ jsxs("div", {
187
- className: "sigvelo-cluster",
188
- children: [/* @__PURE__ */ jsx(FaviconMark, { href }), href ? /* @__PURE__ */ jsx("a", {
189
- href,
190
- target: "_blank",
191
- rel: "noreferrer",
192
- children: source.label
193
- }) : source.label]
194
- });
195
- }
196
- if ("path" in table.source) return /* @__PURE__ */ jsx("p", { children: [/\.json$/iu.test(table.source.path) ? "Saved table" : table.source.path.split("/").at(-1), table.source.sheet].filter(Boolean).join(" · ") });
197
- if ("script" in table.source) {
198
- const path = table.source.script.path;
199
- return /* @__PURE__ */ jsx("p", { children: scripts.find((script) => script.path === path)?.name ?? "Connected table" });
200
- }
201
- return /* @__PURE__ */ jsx("p", { children: "Saved table" });
202
- }
203
- function RoutineScriptParameter({ parameter, value, setArgument }) {
204
- const help = [parameter.description, parameter.required ? "Required by the workflow." : void 0].filter(Boolean).join(" ");
205
- if (value !== void 0 && (typeof value === "object" || typeof value !== parameter.type)) return null;
206
- return /* @__PURE__ */ jsx(Field.Root, {
207
- name: parameter.name,
208
- children: /* @__PURE__ */ jsx(RoutineParameterControl, {
209
- parameter,
210
- value,
211
- help,
212
- setArgument
213
- })
214
- });
215
- }
216
- function RoutineParameterControl({ parameter, value, help, setArgument }) {
217
- if (parameter.type !== "boolean") return /* @__PURE__ */ jsx(RoutineValueParameter, {
218
- parameter,
219
- value,
220
- help,
221
- setArgument
222
- });
223
- return /* @__PURE__ */ jsx(RoutineSelect, {
224
- label: parameter.label,
225
- description: help || void 0,
226
- name: parameter.name,
227
- value: value === void 0 ? "" : String(value),
228
- options: [
229
- {
230
- label: parameter.required ? "Choose an option" : "Use workflow default",
231
- value: ""
232
- },
233
- {
234
- label: "Yes",
235
- value: "true"
236
- },
237
- {
238
- label: "No",
239
- value: "false"
240
- }
241
- ],
242
- onValueChange: (nextValue) => setArgument(parameter.name, nextValue === "" ? void 0 : nextValue === "true")
243
- });
244
- }
245
- function RoutineValueParameter({ parameter, value, help, setArgument }) {
246
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
247
- className: "think-routine__input-label",
248
- children: [/* @__PURE__ */ jsx(Field.Label, { children: parameter.label }), help ? /* @__PURE__ */ jsx(IconButton, {
249
- label: `About ${parameter.label}`,
250
- tooltip: help,
251
- variant: "ghost",
252
- color: "neutral",
253
- children: /* @__PURE__ */ jsx(InfoIcon, {})
254
- }) : null]
255
- }), /* @__PURE__ */ jsx(Field.Control, {
256
- name: parameter.name,
257
- type: parameter.type === "number" ? "number" : "text",
258
- step: parameter.type === "number" ? "any" : void 0,
259
- value: value === void 0 ? "" : String(value),
260
- autoComplete: "off",
261
- placeholder: parameter.required ? void 0 : "Use workflow default",
262
- onChange: (event) => {
263
- const nextValue = event.currentTarget.value;
264
- setArgument(parameter.name, nextValue === "" ? void 0 : parameter.type === "number" ? Number(nextValue) : nextValue);
265
- }
266
- })] });
267
- }
268
- function RoutineWeeklyDays({ days, setDays, daysError, setDaysError, daysDescriptionId, daysErrorId, firstDayRef }) {
269
- return /* @__PURE__ */ jsxs(Fieldset.Root, {
270
- variant: "plain",
271
- children: [
272
- /* @__PURE__ */ jsx(Fieldset.Legend, { children: "Days" }),
273
- /* @__PURE__ */ jsx(Fieldset.Description, {
274
- id: daysDescriptionId,
275
- children: "Select at least one day."
276
- }),
277
- /* @__PURE__ */ jsx(CheckboxGroup, {
278
- layout: "grid",
279
- value: days,
280
- "aria-describedby": `${daysDescriptionId}${daysError ? ` ${daysErrorId}` : ""}`,
281
- "aria-invalid": daysError || void 0,
282
- onValueChange: (nextDays) => {
283
- setDays(nextDays);
284
- if (nextDays.length > 0) setDaysError(false);
285
- },
286
- children: WEEKDAYS.map((day) => /* @__PURE__ */ jsxs(CheckboxGroup.Item, { children: [/* @__PURE__ */ jsx(CheckboxGroup.Icon, { children: /* @__PURE__ */ jsx(Checkbox.Root, {
287
- ref: day.token === "mon" ? firstDayRef : void 0,
288
- value: day.token,
289
- children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
290
- }) }), /* @__PURE__ */ jsx(CheckboxGroup.Content, { children: /* @__PURE__ */ jsx(CheckboxGroup.Title, { children: day.label }) })] }, day.token))
291
- }),
292
- daysError ? /* @__PURE__ */ jsx(Field.Errors, {
293
- id: daysErrorId,
294
- errors: ["Select at least one day."]
295
- }) : null
296
- ]
297
- });
298
- }
299
- function RoutineScriptFields({ scriptPath, setScriptPath, scriptsLoading, scriptsError, scripts, scriptOptions, table, selectedScript, scriptArgs, setArgument, retainedArgs }) {
300
- return /* @__PURE__ */ jsxs(Fragment, { children: [
301
- /* @__PURE__ */ jsx(RoutineSelect, {
302
- label: "Workflow",
303
- value: scriptPath,
304
- disabled: scriptsLoading,
305
- options: [{
306
- label: scriptsLoading ? "Loading workflows…" : "Choose a workflow",
307
- value: ""
308
- }, ...scriptOptions],
309
- onValueChange: setScriptPath
310
- }),
311
- scriptsError ? /* @__PURE__ */ jsx(Field.Errors, { errors: [executionErrorSummary(scriptsError)] }) : null,
312
- !scriptsLoading && !scriptsError && scripts.length === 0 ? /* @__PURE__ */ jsx("p", {
313
- className: "think-routine__input-help",
314
- children: "Ask Rook to create a workflow first."
315
- }) : null,
316
- /* @__PURE__ */ jsx(RoutineTableSource, {
317
- table,
318
- scripts
319
- }),
320
- selectedScript?.parameters.filter((parameter) => !table?.columns[parameter.name]).map((parameter) => /* @__PURE__ */ jsx(RoutineScriptParameter, {
321
- parameter,
322
- value: scriptArgs[parameter.name],
323
- setArgument
324
- }, parameter.name)),
325
- Object.keys(retainedArgs).length > 0 ? /* @__PURE__ */ jsxs("details", {
326
- className: "think-routine__saved-inputs",
327
- children: [
328
- /* @__PURE__ */ jsx("summary", { children: "Saved inputs" }),
329
- /* @__PURE__ */ jsx(ExecutionResult, {
330
- result: retainedArgs,
331
- showSummary: false
332
- }),
333
- /* @__PURE__ */ jsx("p", {
334
- className: "think-routine__input-help",
335
- children: "These inputs are preserved. Ask Rook to change them."
336
- })
337
- ]
338
- }) : null
339
- ] });
340
- }
341
- function useRoutineSchedule(initialSchedule) {
342
- const defaults = React.useMemo(() => scheduleDefaults(initialSchedule), [initialSchedule]);
343
- const [scheduleKind, setScheduleKind] = React.useState(defaults.kind);
344
- const [intervalEvery, setIntervalEvery] = React.useState(defaults.intervalEvery);
345
- const [intervalUnit, setIntervalUnit] = React.useState(defaults.intervalUnit);
346
- const [time, setTime] = React.useState(defaults.time);
347
- const [timezone, setTimezone] = React.useState(defaults.timezone);
348
- const [timezoneInput, setTimezoneInput] = React.useState(defaults.timezone);
349
- const [days, setDays] = React.useState(defaults.days);
350
- const [daysError, setDaysError] = React.useState(false);
351
- const [timezoneError, setTimezoneError] = React.useState(false);
352
- const timezoneLabelId = React.useId();
353
- const timezoneErrorId = React.useId();
354
- const intervalLabelId = React.useId();
355
- const daysDescriptionId = React.useId();
356
- const daysErrorId = React.useId();
357
- const firstDayRef = React.useRef(null);
358
- const timezoneInputRef = React.useRef(null);
359
- const availableTimezoneOptions = React.useMemo(() => TIMEZONE_OPTIONS.some((option) => option.value === timezone) ? TIMEZONE_OPTIONS : [...TIMEZONE_OPTIONS, {
360
- label: timezone,
361
- value: timezone
362
- }].sort((left, right) => left.value.localeCompare(right.value)), [timezone]);
363
- const selectedTimezone = React.useMemo(() => availableTimezoneOptions.find((option) => option.value === timezone) ?? {
364
- label: timezone,
365
- value: timezone
366
- }, [availableTimezoneOptions, timezone]);
367
- function value() {
368
- if (scheduleKind !== "interval" && timezoneInput !== selectedTimezone.label) {
369
- setTimezoneError(true);
370
- queueMicrotask(() => timezoneInputRef.current?.focus());
371
- return null;
372
- }
373
- if (scheduleKind === "weekly" && days.length === 0) {
374
- setDaysError(true);
375
- queueMicrotask(() => firstDayRef.current?.focus());
376
- return null;
377
- }
378
- const schedule = serializeSchedule({
379
- kind: scheduleKind,
380
- intervalEvery,
381
- intervalUnit,
382
- time,
383
- timezone,
384
- days
385
- });
386
- if (!schedule) return null;
387
- return schedule;
388
- }
389
- return {
390
- scheduleKind,
391
- setScheduleKind,
392
- intervalEvery,
393
- setIntervalEvery,
394
- intervalUnit,
395
- setIntervalUnit,
396
- time,
397
- setTime,
398
- setTimezone,
399
- timezoneInput,
400
- setTimezoneInput,
401
- days,
402
- setDays,
403
- daysError,
404
- setDaysError,
405
- timezoneError,
406
- setTimezoneError,
407
- timezoneLabelId,
408
- timezoneErrorId,
409
- intervalLabelId,
410
- daysDescriptionId,
411
- daysErrorId,
412
- firstDayRef,
413
- timezoneInputRef,
414
- availableTimezoneOptions,
415
- selectedTimezone,
416
- value
417
- };
418
- }
419
- function RoutineScheduleFields({ editor }) {
420
- const { scheduleKind, setScheduleKind, intervalEvery, setIntervalEvery, intervalUnit, setIntervalUnit, time, setTime, setTimezone, timezoneInput, setTimezoneInput, days, setDays, daysError, setDaysError, timezoneError, setTimezoneError, timezoneLabelId, timezoneErrorId, intervalLabelId, daysDescriptionId, daysErrorId, firstDayRef, timezoneInputRef, availableTimezoneOptions, selectedTimezone } = editor;
421
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RoutineSelect, {
422
- label: "Repeats",
423
- value: scheduleKind,
424
- options: SCHEDULE_KIND_OPTIONS,
425
- onValueChange: setScheduleKind
426
- }), scheduleKind === "interval" ? /* @__PURE__ */ jsxs("div", {
427
- className: "think-routine__form-row",
428
- children: [/* @__PURE__ */ jsxs(Field.Root, {
429
- name: "interval",
430
- children: [/* @__PURE__ */ jsx(Field.Label, {
431
- id: intervalLabelId,
432
- children: "Every"
433
- }), /* @__PURE__ */ jsx(NumberField.Root, {
434
- value: intervalEvery,
435
- min: 1,
436
- step: 1,
437
- onValueChange: setIntervalEvery,
438
- children: /* @__PURE__ */ jsxs(NumberField.Group, { children: [
439
- /* @__PURE__ */ jsx(NumberField.Decrement, {
440
- "aria-label": "Decrease interval",
441
- children: "−"
442
- }),
443
- /* @__PURE__ */ jsx(NumberField.Input, {
444
- name: "interval",
445
- required: true,
446
- "aria-labelledby": intervalLabelId
447
- }),
448
- /* @__PURE__ */ jsx(NumberField.Increment, {
449
- "aria-label": "Increase interval",
450
- children: "+"
451
- })
452
- ] })
453
- })]
454
- }), /* @__PURE__ */ jsx(RoutineSelect, {
455
- label: "Unit",
456
- value: intervalUnit,
457
- options: INTERVAL_UNIT_OPTIONS,
458
- onValueChange: setIntervalUnit
459
- })]
460
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [scheduleKind === "weekly" ? /* @__PURE__ */ jsx(RoutineWeeklyDays, {
461
- days,
462
- setDays,
463
- daysError,
464
- setDaysError,
465
- daysDescriptionId,
466
- daysErrorId,
467
- firstDayRef
468
- }) : null, /* @__PURE__ */ jsxs("div", {
469
- className: "think-routine__form-row",
470
- children: [/* @__PURE__ */ jsxs(Field.Root, {
471
- name: "time",
472
- children: [
473
- /* @__PURE__ */ jsx(Field.Label, { children: "Time" }),
474
- /* @__PURE__ */ jsx(Field.Control, {
475
- name: "time",
476
- type: "time",
477
- value: time,
478
- required: true,
479
- onChange: (event) => setTime(event.currentTarget.value)
480
- }),
481
- /* @__PURE__ */ jsx(Field.Error, {
482
- match: "valueMissing",
483
- children: "Time is required"
484
- })
485
- ]
486
- }), /* @__PURE__ */ jsxs(Field.Root, {
487
- name: "timezone",
488
- invalid: timezoneError,
489
- children: [
490
- /* @__PURE__ */ jsx(Field.Label, {
491
- id: timezoneLabelId,
492
- children: "Time zone"
493
- }),
494
- /* @__PURE__ */ jsxs(Combobox.Root, {
495
- items: availableTimezoneOptions,
496
- value: selectedTimezone,
497
- inputValue: timezoneInput,
498
- onInputValueChange: (nextInput) => {
499
- setTimezoneInput(nextInput);
500
- if (nextInput === selectedTimezone.label) setTimezoneError(false);
501
- },
502
- onValueChange: (option) => {
503
- if (!option) return;
504
- setTimezone(option.value);
505
- setTimezoneInput(option.label);
506
- setTimezoneError(false);
507
- },
508
- children: [/* @__PURE__ */ jsxs(Combobox.InputGroup, { children: [/* @__PURE__ */ jsx(Combobox.Input, {
509
- ref: timezoneInputRef,
510
- name: "timezone",
511
- required: true,
512
- "aria-invalid": timezoneError || void 0,
513
- "aria-labelledby": timezoneLabelId,
514
- "aria-describedby": timezoneError ? timezoneErrorId : void 0
515
- }), /* @__PURE__ */ jsx(Combobox.Trigger, {
516
- "aria-label": "Open time zone list",
517
- children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
518
- })] }), /* @__PURE__ */ jsx(Combobox.Portal, { children: /* @__PURE__ */ jsx(Combobox.Positioner, {
519
- sideOffset: 4,
520
- children: /* @__PURE__ */ jsxs(Combobox.Popup, { children: [/* @__PURE__ */ jsx(Combobox.List, { children: (option) => /* @__PURE__ */ jsxs(Combobox.Item, {
521
- value: option,
522
- children: [/* @__PURE__ */ jsx(Combobox.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) }), option.label]
523
- }, option.value) }), /* @__PURE__ */ jsx(Combobox.Empty, { children: "No matching time zones." })] })
524
- }) })]
525
- }),
526
- timezoneError ? /* @__PURE__ */ jsx(Field.Errors, {
527
- id: timezoneErrorId,
528
- errors: ["Select a valid time zone from the list."]
529
- }) : null
530
- ]
531
- })]
532
- })] })] });
533
- }
534
- function useRoutineTask(routine, initialScript, scripts) {
535
- const initialInvocation = routine ? "script" in routine.task ? routine.task.script : void 0 : initialScript;
536
- const initialPath = initialInvocation?.path ?? "";
537
- const [mode, setMode] = React.useState(initialPath ? "script" : "prompt");
538
- const [prompt, setPrompt] = React.useState(routine && "prompt" in routine.task ? routine.task.prompt : "");
539
- const [scriptPath, setScriptPath] = React.useState(initialPath);
540
- const [argumentsByPath, setArgumentsByPath] = React.useState(() => initialInvocation ? { [initialInvocation.path]: initialInvocation.args ?? {} } : {});
541
- const table = scriptPath === initialInvocation?.path ? initialInvocation.table : void 0;
542
- const selectedScript = scripts.find((script) => script.path === scriptPath);
543
- const scriptArgs = argumentsByPath[scriptPath] ?? {};
544
- const scriptOptions = scripts.map((script) => ({
545
- label: script.name,
546
- value: script.path
547
- }));
548
- if (scriptPath && !selectedScript) scriptOptions.unshift({
549
- label: "Saved workflow (unavailable)",
550
- value: scriptPath
551
- });
552
- const retainedArgs = Object.fromEntries(Object.entries(scriptArgs).filter(([name, value]) => !selectedScript?.parameters.some((parameter) => parameter.name === name && typeof value === parameter.type)));
553
- function setArgument(name, value) {
554
- setArgumentsByPath((current) => {
555
- const args = { ...current[scriptPath] };
556
- if (value === void 0) delete args[name];
557
- else args[name] = value;
558
- return {
559
- ...current,
560
- [scriptPath]: args
561
- };
562
- });
563
- }
564
- function value() {
565
- if (mode === "prompt") return prompt.trim() ? { prompt: prompt.trim() } : null;
566
- if (!scriptPath.trim()) return null;
567
- return { script: {
568
- path: scriptPath,
569
- args: scriptArgs,
570
- ...table ? { table } : {}
571
- } };
572
- }
573
- return {
574
- mode,
575
- setMode,
576
- prompt,
577
- setPrompt,
578
- scriptPath,
579
- setScriptPath,
580
- table,
581
- selectedScript,
582
- scriptArgs,
583
- scriptOptions,
584
- retainedArgs,
585
- setArgument,
586
- value
587
- };
588
- }
589
- function RoutineTaskFields({ task, scripts, scriptsLoading, scriptsError }) {
590
- const { mode, setMode, prompt, setPrompt, scriptPath, setScriptPath, table, selectedScript, scriptArgs, scriptOptions, retainedArgs, setArgument } = task;
591
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(RoutineSelect, {
592
- label: "Run",
593
- value: mode,
594
- onValueChange: setMode,
595
- options: [{
596
- label: "Agent instructions",
597
- value: "prompt"
598
- }, {
599
- label: "Saved workflow",
600
- value: "script"
601
- }]
602
- }), mode === "script" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RoutineScriptFields, {
603
- scriptPath,
604
- setScriptPath,
605
- scriptsLoading,
606
- scriptsError,
607
- scripts,
608
- scriptOptions,
609
- table,
610
- selectedScript,
611
- scriptArgs,
612
- setArgument,
613
- retainedArgs
614
- }) }) : /* @__PURE__ */ jsxs(Field.Root, {
615
- name: "prompt",
616
- children: [
617
- /* @__PURE__ */ jsx(Field.Label, { children: "Instructions" }),
618
- /* @__PURE__ */ jsx(Field.Control, {
619
- render: /* @__PURE__ */ jsx(Textarea, { rows: 8 }),
620
- name: "prompt",
621
- value: prompt,
622
- required: true,
623
- placeholder: "Review open pull requests, summarize blockers, and draft a concise project update.",
624
- onChange: (event) => setPrompt(event.currentTarget.value)
625
- }),
626
- /* @__PURE__ */ jsx(Field.Error, {
627
- match: "valueMissing",
628
- children: "Instructions are required"
629
- })
630
- ]
631
- })] });
632
- }
633
- /** Create/edit surface for scheduled instructions or a saved workflow. */
634
- function ThinkRoutineForm({ cancelLink, cancelLabel = "Back to schedules", className, routine, initialScript, scripts = [], scriptsLoading = false, scriptsError, onSubmit, ref, ...props }) {
635
- const initialSchedule = routine?.parsedSchedule;
636
- const editing = routine !== void 0;
637
- const [name, setName] = React.useState(routine?.name ?? "");
638
- const task = useRoutineTask(routine, initialScript, scripts);
639
- const scheduleEditor = useRoutineSchedule(initialSchedule);
640
- const [busy, setBusy] = React.useState(false);
641
- const [error, setError] = React.useState(null);
642
- function value() {
643
- if (!name.trim()) return null;
644
- const taskValue = task.value();
645
- if (!taskValue) return null;
646
- const schedule = scheduleEditor.value();
647
- if (!schedule) return null;
648
- return {
649
- name: name.trim(),
650
- ...taskValue,
651
- schedule
652
- };
653
- }
654
- async function submit(event) {
655
- event.preventDefault();
656
- const nextValue = value();
657
- if (!nextValue) return;
658
- setBusy(true);
659
- setError(null);
660
- try {
661
- await onSubmit(nextValue);
662
- } catch (nextError) {
663
- setError(executionErrorSummary(formatErrorMessage(nextError)));
664
- } finally {
665
- setBusy(false);
666
- }
667
- }
668
- return /* @__PURE__ */ jsxs("div", {
669
- ref,
670
- className: cx("think-routine__editor", className),
671
- ...props,
672
- children: [
673
- /* @__PURE__ */ jsxs(AppTopBar.Root, {
674
- "aria-label": "Schedule editor controls",
675
- children: [cancelLink ? /* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Link, {
676
- label: cancelLabel,
677
- render: cancelLink,
678
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
679
- }) }) : null, /* @__PURE__ */ jsx(AppTopBar.Title, { children: editing ? "Edit schedule" : "New schedule" })]
680
- }),
681
- error ? /* @__PURE__ */ jsxs("div", {
682
- className: "think-routine__editor-error",
683
- role: "alert",
684
- children: [/* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: error })]
685
- }) : null,
686
- /* @__PURE__ */ jsx("main", {
687
- className: "think-routine-form think-routine__create",
688
- "aria-label": editing ? "Edit schedule" : "New schedule",
689
- children: /* @__PURE__ */ jsxs(Form, {
690
- className: "think-routine__form",
691
- validationMode: "onBlur",
692
- onSubmit: submit,
693
- children: [/* @__PURE__ */ jsxs(Field.Group, { children: [
694
- /* @__PURE__ */ jsxs(Field.Root, {
695
- name: "name",
696
- children: [
697
- /* @__PURE__ */ jsx(Field.Label, { children: "Name" }),
698
- /* @__PURE__ */ jsx(Field.Control, {
699
- name: "name",
700
- value: name,
701
- required: true,
702
- autoComplete: "off",
703
- placeholder: "Weekly project review",
704
- onChange: (event) => setName(event.currentTarget.value)
705
- }),
706
- /* @__PURE__ */ jsx(Field.Error, {
707
- match: "valueMissing",
708
- children: "Name is required"
709
- })
710
- ]
711
- }),
712
- /* @__PURE__ */ jsx(RoutineTaskFields, {
713
- task,
714
- scripts,
715
- scriptsLoading,
716
- scriptsError
717
- }),
718
- /* @__PURE__ */ jsx(RoutineScheduleFields, { editor: scheduleEditor })
719
- ] }), /* @__PURE__ */ jsxs("footer", {
720
- className: "think-routine__form-actions",
721
- children: [cancelLink ? /* @__PURE__ */ jsx(Button, {
722
- variant: "ghost",
723
- color: "neutral",
724
- disabled: busy,
725
- nativeButton: false,
726
- render: cancelLink,
727
- children: "Cancel"
728
- }) : null, /* @__PURE__ */ jsxs(Button, {
729
- type: "submit",
730
- disabled: busy || task.mode === "script" && !task.scriptPath,
731
- children: [
732
- busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : null,
733
- " ",
734
- editing ? "Save changes" : "Create schedule"
735
- ]
736
- })]
737
- })]
738
- })
739
- })
740
- ]
741
- });
742
- }
743
- //#endregion
744
- export { ThinkRoutineForm };