@mcp-b/react-components 0.59.2 → 0.61.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 (363) 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-Bs_Z03eC.js → CodeBlock-CNvOYR0Q.js} +1 -1
  8. package/dist/{EmployeeChrome-QSki0QT4.d.ts → EmployeeChrome-D3IgFX22.d.ts} +12 -34
  9. package/dist/{ExecutionBoard-DHfMvKlB.d.ts → ExecutionBoard-DvPGdn4F.d.ts} +2 -2
  10. package/dist/{ExecutionResult-BSZsUbrL.js → ExecutionResult-DmC21cll.js} +4 -4
  11. package/dist/{FileTree-DyLBn7O_.js → FileTree-H31EVRv_.js} +1 -1
  12. package/dist/{IconButton-43ggXEuf.d.ts → IconButton-FWsa9562.d.ts} +1 -1
  13. package/dist/{ManagerOffice-BxBKEb_j.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-CKQ-mKYt.js → SetupChecklist-Wo4akaSG.js} +1 -1
  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-5S834QKW.d.ts +34 -0
  25. package/dist/{Workspace-iCkXvQRJ.d.ts → Workspace-42LA9Zrb.d.ts} +1 -1
  26. package/dist/WorkspaceAutomation-B2Pdz_SU.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-CsWwQA1U.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-CReSIBpd.d.ts → codex-model-catalog-CFEGgUAj.d.ts} +68 -20
  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 +1 -1
  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 +2 -2
  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 +1 -1
  58. package/dist/components/agents-sdk/EmployeeChat.d.ts +9 -2
  59. package/dist/components/agents-sdk/EmployeeChat.js +13 -9
  60. package/dist/components/agents-sdk/EmployeeChrome.d.ts +2 -2
  61. package/dist/components/agents-sdk/EmployeeChrome.js +42 -30
  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 +3 -3
  66. package/dist/components/agents-sdk/ExecutionBoard.d.ts +1 -1
  67. package/dist/components/agents-sdk/ExecutionBoard.js +6 -32
  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 +3 -3
  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/PromptInputCommands.d.ts +1 -1
  86. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  87. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +4 -2
  88. package/dist/components/agents-sdk/SubagentRunIndicator.js +4 -3
  89. package/dist/components/agents-sdk/SubagentRunLanes.d.ts +38 -0
  90. package/dist/components/agents-sdk/SubagentRunLanes.js +160 -0
  91. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +3 -28
  92. package/dist/components/agents-sdk/SubagentRunPanel.js +143 -188
  93. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +1 -1
  94. package/dist/components/agents-sdk/ThinkChat.d.ts +4 -7
  95. package/dist/components/agents-sdk/ThinkChat.js +5 -8
  96. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  97. package/dist/components/agents-sdk/ThinkChatActivity.js +27 -26
  98. package/dist/components/agents-sdk/ThinkChatActivitySummary.d.ts +1 -1
  99. package/dist/components/agents-sdk/ThinkChatActivitySummary.js +28 -28
  100. package/dist/components/agents-sdk/ThinkChatToolPanels.js +12 -27
  101. package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +1 -1
  102. package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
  103. package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +1 -1
  104. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  105. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  106. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +3 -16
  107. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
  108. package/dist/components/agents-sdk/ThinkSchedule.d.ts +2 -0
  109. package/dist/components/agents-sdk/ThinkSchedule.js +9 -0
  110. package/dist/components/agents-sdk/ThinkScheduleActions.d.ts +42 -0
  111. package/dist/components/agents-sdk/{ThinkRoutineActions.js → ThinkScheduleActions.js} +35 -35
  112. package/dist/components/agents-sdk/ThinkScheduleBrowser.d.ts +24 -0
  113. package/dist/components/agents-sdk/{ThinkRoutineBrowser.js → ThinkScheduleBrowser.js} +46 -44
  114. package/dist/components/agents-sdk/ThinkScheduleDetail.d.ts +19 -0
  115. package/dist/components/agents-sdk/ThinkScheduleDetail.js +139 -0
  116. package/dist/components/agents-sdk/ThinkScheduleForm.d.ts +58 -0
  117. package/dist/components/agents-sdk/ThinkScheduleForm.js +686 -0
  118. package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -3
  119. package/dist/components/agents-sdk/WorkbenchBack.d.ts +1 -1
  120. package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
  121. package/dist/components/agents-sdk/Workspace.d.ts +1 -1
  122. package/dist/components/agents-sdk/Workspace.js +1 -1
  123. package/dist/components/agents-sdk/WorkspaceAutomation.d.ts +2 -0
  124. package/dist/components/agents-sdk/WorkspaceAutomation.js +791 -0
  125. package/dist/components/agents-sdk/WorkspaceAutomationTable.d.ts +2 -0
  126. package/dist/components/agents-sdk/{WorkspaceExecutionTable.js → WorkspaceAutomationTable.js} +45 -65
  127. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  128. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  129. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +2 -2
  130. package/dist/components/agents-sdk/WorkspaceConcept.js +1 -1
  131. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +28 -8
  132. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +104 -254
  133. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +2 -2
  134. package/dist/components/agents-sdk/WorkspaceExplorer.js +4 -4
  135. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  136. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  137. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  138. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  139. package/dist/components/agents-sdk/WorkspaceLink.d.ts +3 -2
  140. package/dist/components/agents-sdk/WorkspaceLink.js +2 -1
  141. package/dist/components/agents-sdk/WorkspaceLive.d.ts +13 -6
  142. package/dist/components/agents-sdk/WorkspaceLive.js +2 -0
  143. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +37 -2
  144. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  145. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +1 -1
  146. package/dist/components/agents-sdk/WorkspacePerson.d.ts +30 -0
  147. package/dist/components/agents-sdk/WorkspacePerson.js +100 -0
  148. package/dist/components/agents-sdk/WorkspaceProject.d.ts +24 -60
  149. package/dist/components/agents-sdk/WorkspaceProject.js +82 -184
  150. package/dist/components/ai-sdk/Activity.js +1 -1
  151. package/dist/components/ai-sdk/AgentAttention.d.ts +1 -1
  152. package/dist/components/ai-sdk/AgentChatMessageEditor.js +1 -1
  153. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +2 -2
  154. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  155. package/dist/components/ai-sdk/Approval.js +2 -2
  156. package/dist/components/ai-sdk/Artifact.d.ts +1 -1
  157. package/dist/components/ai-sdk/Artifact.js +2 -2
  158. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  159. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  160. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  161. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  162. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  163. package/dist/components/ai-sdk/ComposerLink.js +1 -1
  164. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +51 -63
  165. package/dist/components/ai-sdk/ConnectedAppCards.js +42 -365
  166. package/dist/components/ai-sdk/Context.js +2 -2
  167. package/dist/components/ai-sdk/Conversation.d.ts +1 -1
  168. package/dist/components/ai-sdk/Conversation.js +3 -3
  169. package/dist/components/ai-sdk/Goal.js +2 -2
  170. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  171. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  172. package/dist/components/ai-sdk/Message.d.ts +1 -1
  173. package/dist/components/ai-sdk/Message.js +13 -5
  174. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  175. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  176. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +1 -1
  177. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  178. package/dist/components/ai-sdk/Plan.js +1 -1
  179. package/dist/components/ai-sdk/PromptInput.d.ts +1 -1
  180. package/dist/components/ai-sdk/PromptInput.js +4 -4
  181. package/dist/components/ai-sdk/Queue.d.ts +1 -1
  182. package/dist/components/ai-sdk/Queue.js +2 -2
  183. package/dist/components/ai-sdk/Reasoning.js +1 -1
  184. package/dist/components/ai-sdk/Sources.js +1 -1
  185. package/dist/components/ai-sdk/Task.js +1 -1
  186. package/dist/components/ai-sdk/ToolInvocation.js +1 -1
  187. package/dist/components/extension/ChatGptSignInScreen.d.ts +17 -4
  188. package/dist/components/extension/ChatGptSignInScreen.js +32 -32
  189. package/dist/components/extension/CodexModelSelector.d.ts +1 -1
  190. package/dist/components/extension/CodexModelSelector.js +1 -1
  191. package/dist/components/extension/ConversationTabPicker.js +1 -1
  192. package/dist/components/extension/FirstRunSetup.d.ts +117 -0
  193. package/dist/components/extension/FirstRunSetup.js +1175 -0
  194. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  195. package/dist/components/foundations/AppIcon.d.ts +5 -2
  196. package/dist/components/foundations/Button.d.ts +1 -1
  197. package/dist/components/foundations/Button.js +2 -2
  198. package/dist/components/foundations/Card.d.ts +1 -1
  199. package/dist/components/foundations/Card.js +2 -2
  200. package/dist/components/foundations/Checkbox.js +1 -1
  201. package/dist/components/foundations/Collapsible.js +1 -1
  202. package/dist/components/foundations/ContextMenu.js +1 -1
  203. package/dist/components/foundations/DescriptionList.d.ts +3 -1
  204. package/dist/components/foundations/DescriptionList.js +2 -1
  205. package/dist/components/foundations/IconButton.d.ts +1 -1
  206. package/dist/components/foundations/LinkButton.d.ts +1 -1
  207. package/dist/components/foundations/Menubar.js +1 -1
  208. package/dist/components/foundations/Popover.js +1 -1
  209. package/dist/components/foundations/SearchField.js +1 -1
  210. package/dist/components/foundations/Select.js +1 -1
  211. package/dist/components/foundations/Stepper.js +1 -1
  212. package/dist/components/foundations/Toast.js +1 -1
  213. package/dist/components/foundations/Toggle.d.ts +2 -4
  214. package/dist/components/foundations/Toggle.js +3 -7
  215. package/dist/components/foundations/ToggleGroup.d.ts +2 -4
  216. package/dist/components/foundations/ToggleGroup.js +4 -16
  217. package/dist/components/foundations/icons.d.ts +2 -2
  218. package/dist/components/foundations/icons.js +2 -2
  219. package/dist/components/general-purpose/ActionGuide.d.ts +1 -1
  220. package/dist/components/general-purpose/Commit.d.ts +1 -1
  221. package/dist/components/general-purpose/Commit.js +3 -3
  222. package/dist/components/general-purpose/EnvironmentVariables.d.ts +1 -1
  223. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  224. package/dist/components/general-purpose/FileTree.js +1 -1
  225. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  226. package/dist/components/general-purpose/PricingPlanCard.js +2 -2
  227. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  228. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -1
  229. package/dist/components/general-purpose/ResponsiveSidebarShell.js +2 -2
  230. package/dist/components/general-purpose/SettingsFormDialog.js +1 -1
  231. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  232. package/dist/components/general-purpose/Terminal.d.ts +2 -2
  233. package/dist/components/general-purpose/Terminal.js +2 -2
  234. package/dist/components/general-purpose/TestResults.js +1 -1
  235. package/dist/components/general-purpose/ThemeModeControl.js +2 -2
  236. package/dist/components/general-purpose/WebPreview.d.ts +1 -1
  237. package/dist/components/general-purpose/WebPreview.js +1 -1
  238. package/dist/components/nanites/AgentConnection.js +3 -3
  239. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  240. package/dist/components/nanites/AgentToolDetail.js +3 -3
  241. package/dist/connected-app-drafts-B9i69bkj.js +283 -0
  242. package/dist/{copy-button-BIfY5M-D.d.ts → copy-button-B09hHWd1.d.ts} +1 -1
  243. package/dist/{copy-button-M4sAp9xS.js → copy-button-z20VEXRF.js} +1 -1
  244. package/dist/{execution-result-DWVmm-bL.js → execution-result-DAuW4VWv.js} +30 -2
  245. package/dist/{icons-Dj6id76o.d.ts → icons-CReP3qYl.d.ts} +7 -1
  246. package/dist/{icons-DvlrWt54.js → icons-Yp99gmMC.js} +8 -2
  247. package/dist/{mcp-server-catalog-kaMWaSAL.d.ts → mcp-server-catalog-Di4N46H9.d.ts} +9 -3
  248. package/dist/navigation-link-zK6z8Gn3.d.ts +18 -0
  249. package/dist/scheduled-table-source-NZR1vFc_.js +38 -0
  250. package/dist/styles/accessibility.css +22 -9
  251. package/dist/styles/accordion.css +2 -2
  252. package/dist/styles/activity-header.css +14 -11
  253. package/dist/styles/activity.css +6 -13
  254. package/dist/styles/agent-attention.css +0 -23
  255. package/dist/styles/agent-chat.css +8 -3
  256. package/dist/styles/agent-connection.css +2 -2
  257. package/dist/styles/app-icon.css +7 -0
  258. package/dist/styles/app-top-bar.css +3 -11
  259. package/dist/styles/approval.css +2 -2
  260. package/dist/styles/base.css +3 -1
  261. package/dist/styles/browser-live-screen.css +3 -1
  262. package/dist/styles/browser-run-panel.css +2 -2
  263. package/dist/styles/button.css +13 -44
  264. package/dist/styles/card.css +42 -5
  265. package/dist/styles/chain-of-thought.css +2 -8
  266. package/dist/styles/chatgpt-sign-in-screen.css +91 -83
  267. package/dist/styles/checkbox-group.css +2 -1
  268. package/dist/styles/checkbox.css +4 -6
  269. package/dist/styles/code-block.css +2 -1
  270. package/dist/styles/codex-model-selector.css +2 -2
  271. package/dist/styles/collapsible.css +2 -2
  272. package/dist/styles/color-contrast.test.ts +1 -0
  273. package/dist/styles/combobox.css +5 -9
  274. package/dist/styles/commit.css +2 -7
  275. package/dist/styles/composer-link.css +0 -10
  276. package/dist/styles/connected-app-card.css +32 -32
  277. package/dist/styles/context-menu.css +2 -2
  278. package/dist/styles/description-list.css +14 -0
  279. package/dist/styles/execution-board.css +1 -1
  280. package/dist/styles/execution-result.css +161 -0
  281. package/dist/styles/file-tree.css +5 -9
  282. package/dist/styles/first-run-setup.css +751 -0
  283. package/dist/styles/index.css +5 -2
  284. package/dist/styles/inline-citation.css +2 -10
  285. package/dist/styles/manager-office.css +16 -43
  286. package/dist/styles/marker.css +2 -2
  287. package/dist/styles/media-preview-card.css +2 -7
  288. package/dist/styles/message-scroller.css +3 -2
  289. package/dist/styles/model-selector.css +19 -15
  290. package/dist/styles/navigation-menu.css +4 -4
  291. package/dist/styles/number-field.css +2 -3
  292. package/dist/styles/preview-card.css +2 -2
  293. package/dist/styles/prompt-input.css +5 -15
  294. package/dist/styles/queue.css +2 -7
  295. package/dist/styles/radio.css +4 -6
  296. package/dist/styles/recipes.css +25 -52
  297. package/dist/styles/resizable-side-panel.css +3 -2
  298. package/dist/styles/responsive-sidebar-shell.css +1 -6
  299. package/dist/styles/scroll-area.css +3 -2
  300. package/dist/styles/scrollbars.css +2 -0
  301. package/dist/styles/search-field.css +1 -2
  302. package/dist/styles/slider.css +4 -5
  303. package/dist/styles/sources.css +2 -7
  304. package/dist/styles/stepper.css +4 -4
  305. package/dist/styles/streamdown.css +8 -1
  306. package/dist/styles/subagent-run.css +123 -12
  307. package/dist/styles/switch.css +4 -7
  308. package/dist/styles/tabs.css +5 -4
  309. package/dist/styles/task.css +2 -7
  310. package/dist/styles/test-results.css +2 -7
  311. package/dist/styles/theme-mode-control.css +0 -6
  312. package/dist/styles/think-chat-activity.css +0 -8
  313. package/dist/styles/think-execution-status.css +1 -1
  314. package/dist/styles/think-execution-workbench.css +3 -3
  315. package/dist/styles/think-full-app.css +3 -2
  316. package/dist/styles/{think-routine.css → think-schedule.css} +64 -80
  317. package/dist/styles/toggle-group.css +9 -6
  318. package/dist/styles/toggle.css +23 -15
  319. package/dist/styles/toolbar.css +0 -6
  320. package/dist/styles/workspace-automation.css +233 -0
  321. package/dist/styles/workspace-concepts.css +18 -412
  322. package/dist/styles/workspace-entity-card.css +146 -0
  323. package/dist/styles/workspace-explorer.css +4 -3
  324. package/dist/utils/codex-model-catalog.d.ts +1 -1
  325. package/dist/utils/codex-model-catalog.js +51 -19
  326. package/dist/utils/mcp-server-catalog.d.ts +2 -2
  327. package/dist/utils/mcp-server-catalog.js +108 -21
  328. package/dist/utils/structured-code.d.ts +1 -1
  329. package/dist/{workspace-assets-DVn0d-fN.js → workspace-assets-Dq5toMQc.js} +34 -38
  330. package/dist/workspace-concept-panel-CxZfmFkP.js +66 -0
  331. package/dist/workspace-concept-panel-CxuqDi4m.d.ts +21 -0
  332. package/dist/{workspace-delete-CMY1kPkq.js → workspace-delete-CoB0l6ZU.js} +2 -1
  333. package/dist/workspace-entity-card-2TC3RPKh.d.ts +7 -0
  334. package/dist/workspace-entity-card-B1aV-jBj.js +61 -0
  335. package/dist/workspace-person-BSgvRjZE.d.ts +24 -0
  336. package/dist/workspace-person-BVkYb3dv.js +116 -0
  337. package/package.json +28 -28
  338. package/dist/AgentToolRunsContext-DniwGn96.d.ts +0 -18
  339. package/dist/Correspondent-ANkZHGEa.d.ts +0 -60
  340. package/dist/ThinkRoutine-DoZjbzyn.d.ts +0 -41
  341. package/dist/WorkspaceConceptPanel-D21iRsWm.js +0 -23
  342. package/dist/WorkspaceExecutionTable-DNhj6YDX.d.ts +0 -239
  343. package/dist/WorkspaceMessageResponse-D8FGgIQU.d.ts +0 -39
  344. package/dist/components/agents-sdk/SubagentRunList.d.ts +0 -17
  345. package/dist/components/agents-sdk/SubagentRunList.js +0 -26
  346. package/dist/components/agents-sdk/ThinkRoutine.d.ts +0 -2
  347. package/dist/components/agents-sdk/ThinkRoutine.js +0 -9
  348. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +0 -42
  349. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +0 -25
  350. package/dist/components/agents-sdk/ThinkRoutineDetail.d.ts +0 -19
  351. package/dist/components/agents-sdk/ThinkRoutineDetail.js +0 -97
  352. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +0 -59
  353. package/dist/components/agents-sdk/ThinkRoutineForm.js +0 -744
  354. package/dist/components/agents-sdk/ThinkRoutineRuns.d.ts +0 -15
  355. package/dist/components/agents-sdk/ThinkRoutineRuns.js +0 -52
  356. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +0 -2
  357. package/dist/components/agents-sdk/WorkspaceExecution.js +0 -843
  358. package/dist/components/agents-sdk/WorkspaceExecutionTable.d.ts +0 -2
  359. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +0 -36
  360. package/dist/components/agents-sdk/WorkspaceUserScript.js +0 -153
  361. package/dist/components/ai-sdk/Correspondent.d.ts +0 -2
  362. package/dist/components/ai-sdk/Correspondent.js +0 -145
  363. package/dist/styles/correspondent.css +0 -73
@@ -0,0 +1,38 @@
1
+ import { r as AgentToolRunValue } from "../../AgentToolRunsContext-Br3jZ6Up.js";
2
+ import * as React from "react";
3
+ import { UIMessage } from "ai";
4
+ import { AgentToolRunPart } from "agents/agent-tools";
5
+ //#region src/components/agents-sdk/SubagentRunLanes.d.ts
6
+ export interface SubagentRunLanesProps<Part extends AgentToolRunPart = UIMessage["parts"][number]> {
7
+ /**
8
+ * Complete retained runs returned by `useAgentToolEvents()`, passed whole.
9
+ * Each run becomes one lane, placed by its upstream `order`.
10
+ */
11
+ runs: readonly AgentToolRunValue<Part>[];
12
+ /**
13
+ * App-authored TanStack Router Link to the run's own surface. Rendered as
14
+ * the lane's "View report" link, named "View {run name} report".
15
+ */
16
+ renderRunLink: (run: AgentToolRunValue<Part>) => React.ReactElement;
17
+ }
18
+ /**
19
+ * The transcript's record of delegated work: one quiet lane per run the turn
20
+ * handed off, live while the child works — status mark and name, the child's
21
+ * latest progress line, then the report's headline or the failure — and a
22
+ * link to the run's report.
23
+ *
24
+ * Lanes stack in a narrow column such as a side panel and sit up to three
25
+ * across when the column has room. Inside an `AgentToolRunsProvider` given
26
+ * `onStopRun`, a run that may still execute gets its own Stop beside its
27
+ * link — the same command, pending state, and failure as its row in
28
+ * `SubagentRunPanel`; otherwise a lane is a pure record. Lanes are never a
29
+ * live region.
30
+ *
31
+ * Lanes on the list's first frame are history and stay still. To have a live
32
+ * dispatch arrive with motion, mount the lanes while the dispatching turn
33
+ * streams, before its runs exist: with no runs they render nothing.
34
+ * `ThinkChat.MessageContent` does this under each activity group when given
35
+ * `renderAgentToolRunLink`.
36
+ */
37
+ export declare function SubagentRunLanes<Part extends AgentToolRunPart = UIMessage["parts"][number]>({ runs, renderRunLink }: SubagentRunLanesProps<Part>): React.JSX.Element | null;
38
+ //#endregion
@@ -0,0 +1,160 @@
1
+ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { Button, buttonVariants } from "../foundations/Button.js";
3
+ import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
4
+ import { a as runStopOffered, c as useRunOpen, d as useRunsStore, l as useRunStop } from "../../agent-tool-runs-DsOp_X2y.js";
5
+ import { SubagentRunIndicator, getSubagentRunName, getSubagentRunStatusText } from "./SubagentRunIndicator.js";
6
+ import * as React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/agents-sdk/SubagentRunLanes.tsx
9
+ /**
10
+ * Lanes present on the first frame are history and stay still; lanes that
11
+ * arrive afterwards are live work and enter with the shared presence motion.
12
+ * Readiness waits two frames so the first frame's styles are computed before
13
+ * `[data-content-ready]` enables the transition, even when React flushes this
14
+ * effect before paint (a render caused by a click).
15
+ */
16
+ function useArrivalsReady() {
17
+ const [ready, setReady] = React.useState(false);
18
+ React.useEffect(() => {
19
+ let frame = requestAnimationFrame(() => {
20
+ frame = requestAnimationFrame(() => setReady(true));
21
+ });
22
+ return () => cancelAnimationFrame(frame);
23
+ }, []);
24
+ return ready;
25
+ }
26
+ function SubagentRunLaneView({ run, renderRunLink }) {
27
+ const store = useRunsStore();
28
+ const stop = useRunStop(run.runId);
29
+ const runOpen = useRunOpen();
30
+ const stoppable = runStopOffered(run, stop);
31
+ const name = getSubagentRunName(run);
32
+ const live = run.status === "starting" || run.status === "running";
33
+ const linkRef = React.useRef(null);
34
+ const stopFocused = React.useRef(false);
35
+ React.useLayoutEffect(() => {
36
+ if (stoppable || !stopFocused.current) return;
37
+ stopFocused.current = false;
38
+ if (document.activeElement === document.body) linkRef.current?.focus({ preventScroll: true });
39
+ }, [stoppable]);
40
+ React.useEffect(() => {
41
+ const returnFocus = store?.returnFocus;
42
+ const claim = returnFocus?.current;
43
+ if (!returnFocus || runOpen || claim?.to !== "lane" || claim.runId !== run.runId) return;
44
+ let frame = requestAnimationFrame(() => {
45
+ frame = requestAnimationFrame(() => {
46
+ if (returnFocus.current !== claim) return;
47
+ returnFocus.current = null;
48
+ if (document.activeElement === document.body) linkRef.current?.focus({ preventScroll: true });
49
+ });
50
+ });
51
+ return () => cancelAnimationFrame(frame);
52
+ }, [
53
+ store,
54
+ runOpen,
55
+ run.runId
56
+ ]);
57
+ return /* @__PURE__ */ jsxs("li", {
58
+ className: "subagent-run-lanes__lane",
59
+ "data-run-id": run.runId,
60
+ "data-status": run.status,
61
+ "data-live": live || void 0,
62
+ children: [
63
+ /* @__PURE__ */ jsxs("p", {
64
+ className: "subagent-run-lanes__header",
65
+ children: [/* @__PURE__ */ jsx(SubagentRunIndicator, { run }), /* @__PURE__ */ jsx("span", {
66
+ className: "subagent-run__title sigvelo-truncate",
67
+ children: name
68
+ })]
69
+ }),
70
+ /* @__PURE__ */ jsx("p", {
71
+ className: cx("subagent-run__status subagent-run-lanes__status", live ? "sigvelo-truncate" : "sigvelo-line-clamp"),
72
+ children: getSubagentRunStatusText(run)
73
+ }),
74
+ stop?.error ? /* @__PURE__ */ jsx("p", {
75
+ className: "subagent-run-lanes__error",
76
+ role: "alert",
77
+ children: stop.error
78
+ }) : null,
79
+ /* @__PURE__ */ jsxs("div", {
80
+ className: "subagent-run-lanes__actions",
81
+ children: [/* @__PURE__ */ jsx(NavigationLink, {
82
+ ref: linkRef,
83
+ render: renderRunLink(run),
84
+ "data-slot": "subagent-run-lane-link",
85
+ className: buttonVariants({
86
+ variant: "ghost",
87
+ color: "neutral",
88
+ size: "xs"
89
+ }),
90
+ "aria-label": `View ${name} report`,
91
+ onClick: (event) => {
92
+ if (store && isPlainPrimaryLinkActivation(event)) store.returnFocus.current = {
93
+ to: "lane",
94
+ runId: run.runId
95
+ };
96
+ },
97
+ children: "View report"
98
+ }), store && stop && stoppable ? /* @__PURE__ */ jsx(Button, {
99
+ size: "xs",
100
+ variant: "ghost",
101
+ color: "neutral",
102
+ disabled: stop.pending,
103
+ focusableWhenDisabled: true,
104
+ "aria-busy": stop.pending,
105
+ "aria-label": `Stop ${name}`,
106
+ onFocus: () => {
107
+ stopFocused.current = true;
108
+ },
109
+ onBlur: () => {
110
+ stopFocused.current = false;
111
+ },
112
+ onClick: () => {
113
+ store.stopRun(run.runId).catch(() => void 0);
114
+ },
115
+ children: stop.pending ? "Stopping…" : "Stop"
116
+ }) : null]
117
+ })
118
+ ]
119
+ });
120
+ }
121
+ const SubagentRunLane = React.memo(SubagentRunLaneView);
122
+ /**
123
+ * The transcript's record of delegated work: one quiet lane per run the turn
124
+ * handed off, live while the child works — status mark and name, the child's
125
+ * latest progress line, then the report's headline or the failure — and a
126
+ * link to the run's report.
127
+ *
128
+ * Lanes stack in a narrow column such as a side panel and sit up to three
129
+ * across when the column has room. Inside an `AgentToolRunsProvider` given
130
+ * `onStopRun`, a run that may still execute gets its own Stop beside its
131
+ * link — the same command, pending state, and failure as its row in
132
+ * `SubagentRunPanel`; otherwise a lane is a pure record. Lanes are never a
133
+ * live region.
134
+ *
135
+ * Lanes on the list's first frame are history and stay still. To have a live
136
+ * dispatch arrive with motion, mount the lanes while the dispatching turn
137
+ * streams, before its runs exist: with no runs they render nothing.
138
+ * `ThinkChat.MessageContent` does this under each activity group when given
139
+ * `renderAgentToolRunLink`.
140
+ */
141
+ function SubagentRunLanes({ runs, renderRunLink }) {
142
+ const arrivalsReady = useArrivalsReady();
143
+ if (runs.length === 0) return null;
144
+ return /* @__PURE__ */ jsx("div", {
145
+ className: "subagent-run-lanes",
146
+ "data-slot": "subagent-run-lanes",
147
+ children: /* @__PURE__ */ jsx("ul", {
148
+ className: "subagent-run-lanes__list",
149
+ role: "list",
150
+ "aria-label": "Delegated runs",
151
+ "data-content-ready": arrivalsReady ? "" : void 0,
152
+ children: runs.toSorted((a, b) => a.order - b.order).map((run) => /* @__PURE__ */ jsx(SubagentRunLane, {
153
+ run,
154
+ renderRunLink
155
+ }, run.runId))
156
+ })
157
+ });
158
+ }
159
+ //#endregion
160
+ export { SubagentRunLanes };
@@ -1,39 +1,14 @@
1
- import { n as AgentToolRunValue, t as AgentToolEventsValue } from "../../AgentToolRunsContext-DniwGn96.js";
1
+ import { r as AgentToolRunValue } from "../../AgentToolRunsContext-Br3jZ6Up.js";
2
2
  import * as React from "react";
3
- import { AgentToolRunPart } from "agents/agent-tools";
4
3
  //#region src/components/agents-sdk/SubagentRunPanel.d.ts
5
- interface CommandState {
6
- pending: boolean;
7
- error?: string;
8
- }
9
- export interface SubagentRunPanelProviderProps {
10
- /** Conversation identity; changing it resets transient controls without remounting children. */
11
- scopeKey: string;
12
- /** The one upstream event-hook value from the parent connection. */
13
- agentTools: AgentToolEventsValue<AgentToolRunPart>;
14
- selectedRunId?: string;
15
- parentRunning: boolean;
16
- onStopCurrentWork: () => Promise<void>;
17
- onStopRun: (runId: string) => Promise<void>;
18
- children: React.ReactNode;
19
- }
20
- interface SubagentRunPanelValue extends Pick<SubagentRunPanelProviderProps, "agentTools" | "selectedRunId" | "parentRunning"> {
21
- /** Set while a run is open, so coming back lands on the pill that led there. */
22
- restoreFocus: React.RefObject<boolean>;
23
- commands: Readonly<Record<string, CommandState>>;
24
- stopCurrentWork: () => Promise<void>;
25
- stopRun: (runId: string) => Promise<void>;
26
- }
27
- /** A thread's transient Stop commands and focus return; run facts remain in the SDK value. */
28
- export declare function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentRunning, onStopCurrentWork, onStopRun, children }: SubagentRunPanelProviderProps): React.JSX.Element;
29
- export declare function useOptionalSubagentRunPanel(): SubagentRunPanelValue | null;
30
4
  export interface SubagentRunPanelProps {
31
5
  renderRunLink: (run: AgentToolRunValue) => React.ReactElement;
32
6
  }
33
7
  /**
34
8
  * Parent-scoped delegated work, collapsed to one pill above the composer — the
35
9
  * shipped Codex "N background agents" row. The runs open in a popover on
36
- * demand, so the dock never grows with the roster.
10
+ * demand, so the dock never grows with the roster. Renders inside an
11
+ * `AgentToolRunsProvider` once the parent has a run.
37
12
  */
38
13
  export declare function SubagentRunPanel({ renderRunLink }: SubagentRunPanelProps): React.JSX.Element | null;
39
14
  //#endregion
@@ -1,9 +1,10 @@
1
+ import { $ as SquareIcon, Z as SpinnerIcon } from "../../icons-Yp99gmMC.js";
1
2
  import { buttonVariants } from "../foundations/Button.js";
2
- import { J as SquareIcon, K as SpinnerIcon } from "../../icons-DvlrWt54.js";
3
3
  import { Tooltip } from "../foundations/Tooltip.js";
4
4
  import { IconButton } from "../foundations/IconButton.js";
5
5
  import { Popover } from "../foundations/Popover.js";
6
6
  import { Queue, QueueItem, QueueItemActions, QueueItemContent, QueueItemDescription, QueueList } from "../ai-sdk/Queue.js";
7
+ import { a as runStopOffered, c as useRunOpen, d as useRunsStore, n as IDLE, u as useRunsSelector } from "../../agent-tool-runs-DsOp_X2y.js";
7
8
  import { SubagentRunIndicator, getSubagentRunName } from "./SubagentRunIndicator.js";
8
9
  import { useOptionalAgentChatQueue } from "./AgentChatQueue.js";
9
10
  import { AgentChatNotice } from "./AgentChat.js";
@@ -12,120 +13,37 @@ import * as React from "react";
12
13
  import { jsx, jsxs } from "react/jsx-runtime";
13
14
  import { agentToolRunMayExecute } from "agents/react";
14
15
  //#region src/components/agents-sdk/SubagentRunPanel.tsx
15
- const IDLE = { pending: false };
16
- const SubagentRunPanelContext = React.createContext(null);
17
- function createPanelState(scopeKey, selectedRunId) {
18
- return {
19
- scopeKey,
20
- commands: {},
21
- inFlight: /* @__PURE__ */ new Map(),
22
- restoreFocus: { current: Boolean(selectedRunId) }
23
- };
24
- }
25
- /** A thread's transient Stop commands and focus return; run facts remain in the SDK value. */
26
- function SubagentRunPanelProvider({ scopeKey, agentTools, selectedRunId, parentRunning, onStopCurrentWork, onStopRun, children }) {
27
- const [state, setState] = React.useState(() => createPanelState(scopeKey, selectedRunId));
28
- if (state.scopeKey !== scopeKey) setState(createPanelState(scopeKey, selectedRunId));
29
- const { commands, inFlight, restoreFocus } = state;
30
- React.useLayoutEffect(() => {
31
- if (selectedRunId) restoreFocus.current = true;
32
- }, [restoreFocus, selectedRunId]);
33
- const execute = React.useCallback((key, command) => {
34
- const pending = inFlight.get(key);
35
- if (pending) return pending;
36
- const setCommand = (command) => setState((current) => current.inFlight === inFlight ? {
37
- ...current,
38
- commands: {
39
- ...current.commands,
40
- [key]: command
41
- }
42
- } : current);
43
- setCommand({ pending: true });
44
- const operation = Promise.resolve().then(command).then(() => setCommand(IDLE), (cause) => {
45
- const error = cause instanceof Error ? cause.message : "Stop could not be confirmed. Try again.";
46
- setCommand({
47
- pending: false,
48
- error
49
- });
50
- throw cause;
51
- }).finally(() => inFlight.delete(key));
52
- inFlight.set(key, operation);
53
- return operation;
54
- }, [inFlight]);
55
- const stopCurrentWork = React.useCallback(() => execute("current-work", onStopCurrentWork), [execute, onStopCurrentWork]);
56
- const stopRun = React.useCallback((id) => execute(id, () => onStopRun(id)), [execute, onStopRun]);
57
- const value = React.useMemo(() => ({
58
- agentTools,
59
- selectedRunId,
60
- parentRunning,
61
- restoreFocus,
62
- commands,
63
- stopCurrentWork,
64
- stopRun
65
- }), [
66
- agentTools,
67
- selectedRunId,
68
- parentRunning,
69
- restoreFocus,
70
- commands,
71
- stopCurrentWork,
72
- stopRun
73
- ]);
74
- return /* @__PURE__ */ jsx(SubagentRunPanelContext.Provider, {
75
- value,
76
- children
77
- });
78
- }
79
- function useOptionalSubagentRunPanel() {
80
- return React.useContext(SubagentRunPanelContext);
81
- }
82
16
  /** Runs that may still execute lead; each group keeps dispatch order. */
83
- function sortSubagentRuns(panel) {
84
- return Object.values(panel.agentTools.runsById).sort((a, b) => Number(!agentToolRunMayExecute(a)) - Number(!agentToolRunMayExecute(b)) || a.order - b.order);
17
+ function sortSubagentRuns(runsById) {
18
+ return Object.values(runsById).sort((a, b) => Number(!agentToolRunMayExecute(a)) - Number(!agentToolRunMayExecute(b)) || a.order - b.order);
85
19
  }
86
- function useSubagentRunFocus(panel, runs) {
87
- const triggerRef = React.useRef(null);
88
- const rootRef = React.useRef(null);
89
- const focusedControl = React.useRef(null);
90
- const [focusedOrder, setFocusedOrder] = React.useState(null);
91
- const ranks = focusedOrder ? new Map(focusedOrder.map((id, index) => [id, index])) : null;
92
- const ordered = ranks ? runs.toSorted((a, b) => (ranks.get(a.runId) ?? Infinity) - (ranks.get(b.runId) ?? Infinity)) : runs;
93
- React.useLayoutEffect(() => {
94
- const previous = focusedControl.current;
95
- const root = rootRef.current;
96
- if (!previous || previous.element.isConnected || !root || document.activeElement !== document.body) return;
97
- (Array.from(root.querySelectorAll("[data-run-id]")).find((element) => element.dataset.runId === previous.runId)?.querySelector("a") ?? root).focus({ preventScroll: true });
98
- });
99
- React.useEffect(() => {
100
- if (panel.selectedRunId || !panel.restoreFocus.current) return;
101
- triggerRef.current?.focus({ preventScroll: true });
102
- panel.restoreFocus.current = false;
103
- }, [panel.restoreFocus, panel.selectedRunId]);
104
- const onFocusCapture = (event) => {
105
- focusedControl.current = {
106
- element: event.target,
107
- runId: event.target.closest("[data-run-id]")?.dataset.runId
108
- };
109
- if (!focusedOrder && event.target.closest("[data-run-id]")) setFocusedOrder(ordered.map((run) => run.runId));
110
- };
111
- const onBlurCapture = (event) => {
112
- if (!event.currentTarget.contains(event.relatedTarget)) {
113
- focusedControl.current = null;
114
- setFocusedOrder(null);
115
- }
116
- };
20
+ function countLabel(active, finished) {
21
+ return [active && `${active} active`, finished && `${finished} finished`].filter(Boolean).join(", ");
22
+ }
23
+ function selectPill(state) {
24
+ const runs = sortSubagentRuns(state.agentTools.runsById);
25
+ const lead = runs.find((run) => run.status !== "completed") ?? runs[0];
26
+ if (!lead) return null;
117
27
  return {
118
- triggerRef,
119
- rootRef,
120
- ordered,
121
- onFocusCapture,
122
- onBlurCapture
28
+ total: runs.length,
29
+ active: runs.filter(agentToolRunMayExecute).length,
30
+ lead
123
31
  };
124
32
  }
125
- function SubagentRunStopAll({ panel, active }) {
33
+ function samePill(a, b) {
34
+ return a === b || !!a && !!b && a.total === b.total && a.active === b.active && a.lead.runId === b.lead.runId && a.lead.status === b.lead.status && a.lead.childStillRunning === b.lead.childStillRunning;
35
+ }
36
+ const NO_RUNS = {};
37
+ const selectRunsById = (state) => state.agentTools.runsById;
38
+ const selectStops = (state) => state.onStopRun ? state.stops : null;
39
+ const selectSelectedRunId = (state) => state.selectedRunId;
40
+ const selectCollection = (state) => state.agentTools.collection;
41
+ const selectCurrentWork = (state) => state.onStopCurrentWork ? state.stops["current-work"] ?? IDLE : null;
42
+ function SubagentRunStopAll({ active }) {
43
+ const store = useRunsStore();
126
44
  const queue = useOptionalAgentChatQueue();
127
- const stop = panel.commands["current-work"] ?? IDLE;
128
- if (active < 2 && !stop.error && !stop.pending) return null;
45
+ const stop = useRunsSelector(selectCurrentWork, null);
46
+ if (!store || !stop || active < 2 && !stop.error && !stop.pending) return null;
129
47
  return /* @__PURE__ */ jsx("div", {
130
48
  className: "subagent-run__menu-header",
131
49
  children: /* @__PURE__ */ jsx(IconButton, {
@@ -139,58 +57,147 @@ function SubagentRunStopAll({ panel, active }) {
139
57
  "aria-busy": stop.pending,
140
58
  onClick: () => {
141
59
  queue?.hold();
142
- panel.stopCurrentWork().catch(() => void 0);
60
+ store.stopCurrentWork().catch(() => void 0);
143
61
  },
144
62
  children: stop.pending ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(SquareIcon, {})
145
63
  })
146
64
  });
147
65
  }
148
- function SubagentRunRow({ panel, run, renderRunLink }) {
149
- const command = panel.commands[run.runId] ?? IDLE;
150
- const actionable = agentToolRunMayExecute(run) || command.error || command.pending;
66
+ function SubagentRunRowView({ run, stop, selected, renderRunLink }) {
67
+ const store = useRunsStore();
151
68
  return /* @__PURE__ */ jsxs(QueueItem, {
152
69
  "data-run-id": run.runId,
153
70
  children: [/* @__PURE__ */ jsxs(QueueItemContent, { children: [/* @__PURE__ */ jsx(SubagentRunSelector, {
154
71
  run,
155
72
  render: renderRunLink(run),
156
73
  surface: "plain",
157
- "aria-current": run.runId === panel.selectedRunId ? "page" : void 0
158
- }), command.error ? /* @__PURE__ */ jsx(QueueItemDescription, {
74
+ "aria-current": selected ? "page" : void 0
75
+ }), stop?.error ? /* @__PURE__ */ jsx(QueueItemDescription, {
159
76
  role: "alert",
160
- children: command.error
161
- }) : null] }), actionable ? /* @__PURE__ */ jsx(QueueItemActions, {
77
+ children: stop.error
78
+ }) : null] }), store && stop && runStopOffered(run, stop) ? /* @__PURE__ */ jsx(QueueItemActions, {
162
79
  persistent: true,
163
80
  children: /* @__PURE__ */ jsx(IconButton, {
164
81
  label: `Stop ${getSubagentRunName(run)}`,
165
- tooltip: command.pending ? "Stopping…" : void 0,
82
+ tooltip: stop.pending ? "Stopping…" : void 0,
166
83
  size: "xs",
167
84
  variant: "ghost",
168
85
  color: "neutral",
169
- disabled: command.pending,
86
+ disabled: stop.pending,
170
87
  focusableWhenDisabled: true,
171
- "aria-busy": command.pending,
88
+ "aria-busy": stop.pending,
172
89
  onClick: () => {
173
- panel.stopRun(run.runId).catch(() => void 0);
90
+ store.stopRun(run.runId).catch(() => void 0);
174
91
  },
175
- children: command.pending ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(SquareIcon, {})
92
+ children: stop.pending ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(SquareIcon, {})
176
93
  })
177
94
  }) : null]
178
95
  });
179
96
  }
180
- function SubagentRunPanelContent({ panel, renderRunLink }) {
181
- const runs = sortSubagentRuns(panel);
182
- const focus = useSubagentRunFocus(panel, runs);
183
- const stop = panel.commands["current-work"] ?? IDLE;
97
+ const SubagentRunRow = React.memo(SubagentRunRowView);
98
+ /** The open list. Mounted only while open, so the closed pill never follows every chunk. */
99
+ function SubagentRunMenu({ renderRunLink }) {
100
+ const runs = sortSubagentRuns(useRunsSelector(selectRunsById, NO_RUNS));
101
+ const stops = useRunsSelector(selectStops, null);
102
+ const selectedRunId = useRunsSelector(selectSelectedRunId, void 0);
103
+ const collection = useRunsSelector(selectCollection, null);
104
+ const stop = useRunsSelector(selectCurrentWork, null);
105
+ const rootRef = React.useRef(null);
106
+ const focusedControl = React.useRef(null);
107
+ const [focusedOrder, setFocusedOrder] = React.useState(null);
108
+ const ranks = focusedOrder ? new Map(focusedOrder.map((id, index) => [id, index])) : null;
109
+ const ordered = ranks ? runs.toSorted((a, b) => (ranks.get(a.runId) ?? Infinity) - (ranks.get(b.runId) ?? Infinity)) : runs;
110
+ React.useLayoutEffect(() => {
111
+ const previous = focusedControl.current;
112
+ const root = rootRef.current;
113
+ if (!previous || previous.element.isConnected || !root || document.activeElement !== document.body) return;
114
+ (Array.from(root.querySelectorAll("[data-run-id]")).find((element) => element.dataset.runId === previous.runId)?.querySelector("a") ?? root).focus({ preventScroll: true });
115
+ });
116
+ return /* @__PURE__ */ jsxs(Popover.Popup, {
117
+ ref: rootRef,
118
+ "aria-label": "Delegated work",
119
+ className: "subagent-run__menu",
120
+ initialFocus: (openType) => openType === "keyboard" ? rootRef.current?.querySelector("[data-run-id] a") ?? true : rootRef.current,
121
+ onFocusCapture: (event) => {
122
+ focusedControl.current = {
123
+ element: event.target,
124
+ runId: event.target.closest("[data-run-id]")?.dataset.runId
125
+ };
126
+ if (!focusedOrder && event.target.closest("[data-run-id]")) setFocusedOrder(ordered.map((run) => run.runId));
127
+ },
128
+ onBlurCapture: (event) => {
129
+ if (!event.currentTarget.contains(event.relatedTarget)) {
130
+ focusedControl.current = null;
131
+ setFocusedOrder(null);
132
+ }
133
+ },
134
+ children: [
135
+ /* @__PURE__ */ jsx(SubagentRunStopAll, { active: runs.filter(agentToolRunMayExecute).length }),
136
+ /* @__PURE__ */ jsxs("div", {
137
+ className: "subagent-run__notices",
138
+ children: [
139
+ stop?.error ? /* @__PURE__ */ jsx(AgentChatNotice, {
140
+ "data-tone": "danger",
141
+ role: "alert",
142
+ children: stop.error
143
+ }) : null,
144
+ collection?.status === "loading" ? /* @__PURE__ */ jsx(AgentChatNotice, { children: collection.stale ? "Reconnecting. Last known runs are shown." : "Loading delegated work…" }) : null,
145
+ collection?.status === "error" ? /* @__PURE__ */ jsx(AgentChatNotice, {
146
+ "data-tone": "danger",
147
+ role: "alert",
148
+ children: collection.error ?? "Could not refresh delegated work. Last known runs are retained."
149
+ }) : null
150
+ ]
151
+ }),
152
+ /* @__PURE__ */ jsx(Queue, {
153
+ density: "compact",
154
+ children: /* @__PURE__ */ jsx(QueueList, {
155
+ "aria-label": "Delegated work runs",
156
+ children: ordered.map((run) => /* @__PURE__ */ jsx(SubagentRunRow, {
157
+ run,
158
+ stop: stops ? stops[run.runId] ?? IDLE : null,
159
+ selected: run.runId === selectedRunId,
160
+ renderRunLink
161
+ }, run.runId))
162
+ })
163
+ })
164
+ ]
165
+ });
166
+ }
167
+ /**
168
+ * Parent-scoped delegated work, collapsed to one pill above the composer — the
169
+ * shipped Codex "N background agents" row. The runs open in a popover on
170
+ * demand, so the dock never grows with the roster. Renders inside an
171
+ * `AgentToolRunsProvider` once the parent has a run.
172
+ */
173
+ function SubagentRunPanel({ renderRunLink }) {
174
+ const store = useRunsStore();
175
+ const pill = useRunsSelector(selectPill, null, samePill);
176
+ const runOpen = useRunOpen();
177
+ const triggerRef = React.useRef(null);
184
178
  const [open, setOpen] = React.useState(false);
185
- const lead = runs.find((run) => run.status !== "completed") ?? runs[0];
186
- if (!lead) {
179
+ React.useEffect(() => {
180
+ const returnFocus = store?.returnFocus;
181
+ const claim = returnFocus?.current;
182
+ if (!returnFocus || runOpen || !claim) return;
183
+ const takeFocus = () => {
184
+ if (returnFocus.current !== claim) return;
185
+ returnFocus.current = null;
186
+ if (claim.to === "pill" || document.activeElement === document.body) triggerRef.current?.focus({ preventScroll: true });
187
+ };
188
+ if (claim.to === "pill") return takeFocus();
189
+ let frame = requestAnimationFrame(() => {
190
+ frame = requestAnimationFrame(() => {
191
+ frame = requestAnimationFrame(takeFocus);
192
+ });
193
+ });
194
+ return () => cancelAnimationFrame(frame);
195
+ }, [store, runOpen]);
196
+ if (!pill) {
187
197
  if (open) setOpen(false);
188
198
  return null;
189
199
  }
190
- const active = runs.filter(agentToolRunMayExecute).length;
191
- const finished = runs.length - active;
192
- const counts = [active && `${active} active`, finished && `${finished} finished`].filter(Boolean).join(", ");
193
- const { collection } = panel.agentTools;
200
+ const counts = countLabel(pill.active, pill.total - pill.active);
194
201
  return /* @__PURE__ */ jsx("div", {
195
202
  className: "subagent-run__dock",
196
203
  "data-subagent-run-panel": "",
@@ -202,7 +209,7 @@ function SubagentRunPanelContent({ panel, renderRunLink }) {
202
209
  children: [/* @__PURE__ */ jsxs(Tooltip.Trigger, {
203
210
  render: /* @__PURE__ */ jsx(Popover.Trigger, {
204
211
  unstyled: true,
205
- ref: focus.triggerRef,
212
+ ref: triggerRef,
206
213
  "data-slot": "subagent-run-panel-trigger",
207
214
  className: buttonVariants({
208
215
  variant: "surface",
@@ -212,7 +219,7 @@ function SubagentRunPanelContent({ panel, renderRunLink }) {
212
219
  }),
213
220
  "aria-description": counts
214
221
  }),
215
- children: [/* @__PURE__ */ jsx(SubagentRunIndicator, { run: lead }), runs.length === 1 ? "1 agent" : `${runs.length} agents`]
222
+ children: [/* @__PURE__ */ jsx(SubagentRunIndicator, { run: pill.lead }), pill.total === 1 ? "1 agent" : `${pill.total} agents`]
216
223
  }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
217
224
  side: "top",
218
225
  sideOffset: 6,
@@ -222,62 +229,10 @@ function SubagentRunPanelContent({ panel, renderRunLink }) {
222
229
  side: "top",
223
230
  align: "center",
224
231
  sideOffset: 8,
225
- children: /* @__PURE__ */ jsxs(Popover.Popup, {
226
- ref: focus.rootRef,
227
- "aria-label": "Delegated work",
228
- className: "subagent-run__menu",
229
- initialFocus: (openType) => openType === "keyboard" ? focus.rootRef.current?.querySelector("[data-run-id] a") ?? true : focus.rootRef.current,
230
- onFocusCapture: focus.onFocusCapture,
231
- onBlurCapture: focus.onBlurCapture,
232
- children: [
233
- /* @__PURE__ */ jsx(SubagentRunStopAll, {
234
- panel,
235
- active
236
- }),
237
- /* @__PURE__ */ jsxs("div", {
238
- className: "subagent-run__notices",
239
- children: [
240
- stop.error ? /* @__PURE__ */ jsx(AgentChatNotice, {
241
- "data-tone": "danger",
242
- role: "alert",
243
- children: stop.error
244
- }) : null,
245
- collection.status === "loading" ? /* @__PURE__ */ jsx(AgentChatNotice, { children: collection.stale ? "Reconnecting. Last known runs are shown." : "Loading delegated work…" }) : null,
246
- collection.status === "error" ? /* @__PURE__ */ jsx(AgentChatNotice, {
247
- "data-tone": "danger",
248
- role: "alert",
249
- children: collection.error ?? "Could not refresh delegated work. Last known runs are retained."
250
- }) : null
251
- ]
252
- }),
253
- /* @__PURE__ */ jsx(Queue, {
254
- density: "compact",
255
- children: /* @__PURE__ */ jsx(QueueList, {
256
- "aria-label": "Delegated work runs",
257
- children: focus.ordered.map((run) => /* @__PURE__ */ jsx(SubagentRunRow, {
258
- panel,
259
- run,
260
- renderRunLink
261
- }, run.runId))
262
- })
263
- })
264
- ]
265
- })
232
+ children: /* @__PURE__ */ jsx(SubagentRunMenu, { renderRunLink })
266
233
  }) })]
267
234
  })
268
235
  });
269
236
  }
270
- /**
271
- * Parent-scoped delegated work, collapsed to one pill above the composer — the
272
- * shipped Codex "N background agents" row. The runs open in a popover on
273
- * demand, so the dock never grows with the roster.
274
- */
275
- function SubagentRunPanel({ renderRunLink }) {
276
- const panel = useOptionalSubagentRunPanel();
277
- return panel ? /* @__PURE__ */ jsx(SubagentRunPanelContent, {
278
- panel,
279
- renderRunLink
280
- }) : null;
281
- }
282
237
  //#endregion
283
- export { SubagentRunPanel, SubagentRunPanelProvider, useOptionalSubagentRunPanel };
238
+ export { SubagentRunPanel };
@@ -1,4 +1,4 @@
1
- import { n as AgentToolRunValue } from "../../AgentToolRunsContext-DniwGn96.js";
1
+ import { r as AgentToolRunValue } from "../../AgentToolRunsContext-Br3jZ6Up.js";
2
2
  import * as React from "react";
3
3
  import { UIMessage } from "ai";
4
4
  import { AgentToolRunPart } from "agents/agent-tools";