@mcp-b/react-components 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/dist/AgentChatQueue-C_Jaw3Ia.d.ts +48 -0
  2. package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
  3. package/dist/Avatar-o2NO1fCG.d.ts +124 -0
  4. package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
  5. package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
  6. package/dist/{CodeBlock-DMHZiw86.js → CodeBlock-g8sADidM.js} +7 -7
  7. package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
  8. package/dist/{FileTree-BHebfvkK.js → FileTree-H8mMg4rV.js} +20 -29
  9. package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
  10. package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
  11. package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
  12. package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
  13. package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
  14. package/dist/Separator-CzhtLYE1.d.ts +41 -0
  15. package/dist/Toolbar-CGY004u0.d.ts +155 -0
  16. package/dist/{Workspace-C_zHq9KZ.d.ts → Workspace-HzGrWDX3.d.ts} +14 -3
  17. package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
  18. package/dist/{WorkspaceFileView-ChIJz-fl.js → WorkspaceFileView-DYPtRVpM.js} +4 -3
  19. package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
  20. package/dist/{WorkspaceMessageResponse-Dg_aNpoj.js → WorkspaceMessageResponse-CUJk9_P5.js} +6 -3
  21. package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
  22. package/dist/components/agents-sdk/AgentChat.js +525 -670
  23. package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
  24. package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
  25. package/dist/components/agents-sdk/AgentEvent.js +1 -1
  26. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
  27. package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
  28. package/dist/components/agents-sdk/BrowserLiveScreen.js +21 -13
  29. package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
  30. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
  31. package/dist/components/agents-sdk/BrowserRunPanel.js +31 -30
  32. package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
  33. package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
  34. package/dist/components/agents-sdk/ManagerOffice.d.ts +115 -85
  35. package/dist/components/agents-sdk/ManagerOffice.js +545 -1154
  36. package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
  37. package/dist/components/agents-sdk/McpConnectionRequest.js +3 -2
  38. package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
  39. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
  40. package/dist/components/agents-sdk/McpPluginCatalog.js +3 -2
  41. package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
  42. package/dist/components/agents-sdk/McpServerIcon.js +25 -0
  43. package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
  44. package/dist/components/agents-sdk/McpServerPicker.js +2 -1
  45. package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
  46. package/dist/components/agents-sdk/ModelSelector.js +3 -3
  47. package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
  48. package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
  49. package/dist/components/agents-sdk/PromptInputCommands.js +1 -2
  50. package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
  51. package/dist/components/agents-sdk/SessionCompaction.js +2 -2
  52. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
  53. package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
  54. package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
  55. package/dist/components/agents-sdk/SubagentRunIndicator.js +18 -23
  56. package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
  57. package/dist/components/agents-sdk/SubagentRunList.js +4 -2
  58. package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
  59. package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
  60. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
  61. package/dist/components/agents-sdk/SubagentRunSelector.js +4 -2
  62. package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
  63. package/dist/components/agents-sdk/ThinkChat.js +233 -2
  64. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
  65. package/dist/components/agents-sdk/ThinkChatActivity.js +17 -9
  66. package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
  67. package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
  68. package/dist/components/agents-sdk/ThinkChatToolPanels.js +23 -18
  69. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  70. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  71. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
  72. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +158 -101
  73. package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
  74. package/dist/components/agents-sdk/ThinkFullApp.js +71 -285
  75. package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
  76. package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
  77. package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
  78. package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
  79. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +16 -14
  80. package/dist/components/agents-sdk/ThinkRoutineDetail.js +12 -12
  81. package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
  82. package/dist/components/agents-sdk/ThinkRoutineForm.js +11 -11
  83. package/dist/components/agents-sdk/ThinkRoutineRuns.js +6 -6
  84. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
  85. package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
  86. package/dist/components/agents-sdk/Workspace.d.ts +2 -2
  87. package/dist/components/agents-sdk/Workspace.js +20 -23
  88. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  89. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  90. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +3 -2
  91. package/dist/components/agents-sdk/WorkspaceConcept.js +3 -3
  92. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +15 -10
  93. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +43 -40
  94. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +31 -31
  95. package/dist/components/agents-sdk/WorkspaceExecution.js +115 -192
  96. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
  97. package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
  98. package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
  99. package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
  100. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  101. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  102. package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
  103. package/dist/components/agents-sdk/WorkspaceLive.js +33 -5
  104. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
  105. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
  106. package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
  107. package/dist/components/agents-sdk/WorkspaceMountManager.js +5 -8
  108. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
  109. package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
  110. package/dist/components/agents-sdk/WorkspaceProject.d.ts +44 -15
  111. package/dist/components/agents-sdk/WorkspaceProject.js +74 -51
  112. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
  113. package/dist/components/agents-sdk/WorkspaceUserScript.js +5 -2
  114. package/dist/components/ai-sdk/Activity.d.ts +1 -1
  115. package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
  116. package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
  117. package/dist/components/ai-sdk/AgentChatStartScreen.js +63 -42
  118. package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
  119. package/dist/components/ai-sdk/Approval.d.ts +1 -1
  120. package/dist/components/ai-sdk/Artifact.d.ts +2 -2
  121. package/dist/components/ai-sdk/Artifact.js +2 -2
  122. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  123. package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
  124. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  125. package/dist/components/ai-sdk/ComposerLink.js +1 -2
  126. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +16 -1
  127. package/dist/components/ai-sdk/ConnectedAppCards.js +69 -94
  128. package/dist/components/ai-sdk/Context.d.ts +7 -3
  129. package/dist/components/ai-sdk/Context.js +7 -17
  130. package/dist/components/ai-sdk/Conversation.d.ts +2 -2
  131. package/dist/components/ai-sdk/Correspondent.d.ts +2 -0
  132. package/dist/components/ai-sdk/Correspondent.js +145 -0
  133. package/dist/components/ai-sdk/Goal.d.ts +3 -3
  134. package/dist/components/ai-sdk/Goal.js +2 -2
  135. package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
  136. package/dist/components/ai-sdk/InlineCitation.js +1 -1
  137. package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
  138. package/dist/components/ai-sdk/Message.d.ts +2 -2
  139. package/dist/components/ai-sdk/Message.js +11 -2
  140. package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
  141. package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
  142. package/dist/components/ai-sdk/MessageScrollerVirtual.js +38 -4
  143. package/dist/components/ai-sdk/Plan.d.ts +1 -1
  144. package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
  145. package/dist/components/ai-sdk/PromptInput.js +170 -226
  146. package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
  147. package/dist/components/ai-sdk/Queue.d.ts +28 -5
  148. package/dist/components/ai-sdk/Queue.js +19 -4
  149. package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
  150. package/dist/components/ai-sdk/Reasoning.js +4 -4
  151. package/dist/components/ai-sdk/Sources.d.ts +1 -1
  152. package/dist/components/ai-sdk/Task.d.ts +1 -1
  153. package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
  154. package/dist/components/extension/CodexModelSelector.d.ts +5 -0
  155. package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
  156. package/dist/components/extension/ConversationTabPicker.js +1 -1
  157. package/dist/components/foundations/AlertDialog.d.ts +1 -1
  158. package/dist/components/foundations/AppIcon.d.ts +3 -2
  159. package/dist/components/foundations/Autocomplete.js +6 -1
  160. package/dist/components/foundations/Avatar.d.ts +1 -121
  161. package/dist/components/foundations/Button.d.ts +1 -1
  162. package/dist/components/foundations/Card.d.ts +22 -27
  163. package/dist/components/foundations/Card.js +51 -32
  164. package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
  165. package/dist/components/foundations/Collapsible.d.ts +1 -1
  166. package/dist/components/foundations/Combobox.js +6 -1
  167. package/dist/components/foundations/Dialog.d.ts +106 -1
  168. package/dist/components/foundations/EmptyState.d.ts +1 -1
  169. package/dist/components/foundations/Field.d.ts +2 -1
  170. package/dist/components/foundations/Fieldset.d.ts +1 -1
  171. package/dist/components/foundations/Form.d.ts +4 -4
  172. package/dist/components/foundations/IconButton.d.ts +1 -1
  173. package/dist/components/foundations/Label.d.ts +1 -1
  174. package/dist/components/foundations/LinkButton.d.ts +2 -2
  175. package/dist/components/foundations/Meter.d.ts +1 -1
  176. package/dist/components/foundations/NumberField.d.ts +1 -1
  177. package/dist/components/foundations/ScrollArea.d.ts +1 -1
  178. package/dist/components/foundations/SearchField.d.ts +1 -1
  179. package/dist/components/foundations/Select.js +6 -1
  180. package/dist/components/foundations/Separator.d.ts +1 -40
  181. package/dist/components/foundations/Stepper.d.ts +1 -1
  182. package/dist/components/foundations/Textarea.d.ts +1 -1
  183. package/dist/components/foundations/Toast.d.ts +5 -1
  184. package/dist/components/foundations/Toggle.d.ts +70 -1
  185. package/dist/components/foundations/ToggleGroup.d.ts +3 -2
  186. package/dist/components/foundations/Toolbar.d.ts +1 -151
  187. package/dist/components/foundations/TransitionSurface.d.ts +1 -1
  188. package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
  189. package/dist/components/general-purpose/ActionGuide.js +4 -18
  190. package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
  191. package/dist/components/general-purpose/Commit.d.ts +2 -2
  192. package/dist/components/general-purpose/Commit.js +1 -1
  193. package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
  194. package/dist/components/general-purpose/FileTree.d.ts +1 -7
  195. package/dist/components/general-purpose/FileTree.js +1 -1
  196. package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
  197. package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
  198. package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
  199. package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
  200. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
  201. package/dist/components/general-purpose/ResponsiveSidebarShell.js +119 -101
  202. package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
  203. package/dist/components/general-purpose/SettingsFormDialog.js +40 -70
  204. package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
  205. package/dist/components/general-purpose/SetupChecklist.js +76 -1
  206. package/dist/components/general-purpose/Terminal.d.ts +3 -3
  207. package/dist/components/general-purpose/Terminal.js +10 -5
  208. package/dist/components/general-purpose/TestResults.d.ts +23 -11
  209. package/dist/components/general-purpose/TestResults.js +48 -50
  210. package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
  211. package/dist/components/general-purpose/WebPreview.d.ts +29 -4
  212. package/dist/components/general-purpose/WebPreview.js +37 -12
  213. package/dist/components/nanites/AgentConnection.js +1 -1
  214. package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
  215. package/dist/components/nanites/AgentToolDetail.js +20 -41
  216. package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
  217. package/dist/mcp-server-mAErsxHU.js +27 -0
  218. package/dist/styles/activity.css +1 -96
  219. package/dist/styles/agent-chat.css +75 -102
  220. package/dist/styles/agent-tool-detail.css +0 -16
  221. package/dist/styles/base.css +3 -3
  222. package/dist/styles/browser-run-panel.css +1 -15
  223. package/dist/styles/button.css +7 -1
  224. package/dist/styles/code-block.css +12 -0
  225. package/dist/styles/composition-motion.css +0 -2
  226. package/dist/styles/correspondent.css +73 -0
  227. package/dist/styles/employee-chrome.css +43 -0
  228. package/dist/styles/file-tree.css +5 -0
  229. package/dist/styles/index.css +5 -2
  230. package/dist/styles/manager-office.css +380 -1086
  231. package/dist/styles/message.css +2 -10
  232. package/dist/styles/queue.css +71 -0
  233. package/dist/styles/subagent-run.css +122 -6
  234. package/dist/styles/test-results.css +2 -5
  235. package/dist/styles/think-chat-activity.css +13 -0
  236. package/dist/styles/think-chat-tool-panels.css +81 -0
  237. package/dist/styles/think-execution-workbench.css +2 -8
  238. package/dist/styles/think-full-app.css +42 -251
  239. package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
  240. package/dist/styles/web-preview.css +15 -1
  241. package/dist/utils/mcp-server-catalog.d.ts +1112 -2
  242. package/dist/utils/mcp-server-catalog.js +28 -9
  243. package/dist/utils/structured-code.d.ts +1 -1
  244. package/dist/{workspace-assets-CxpEHsac.js → workspace-assets-Bg7XhPsk.js} +16 -2
  245. package/package.json +7 -3
  246. package/dist/AgentChat-BLmQghkt.d.ts +0 -327
  247. package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
  248. package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
  249. package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
  250. package/dist/Dialog-B_FhRWaz.d.ts +0 -107
  251. package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
  252. package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
  253. package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
  254. package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
  255. package/dist/SetupChecklist-CwRjIDH4.js +0 -77
  256. package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
  257. package/dist/ThinkChat-DLDta57t.js +0 -332
  258. package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
  259. package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
  260. package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
  261. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
  262. package/dist/Toggle-DLrIf5YH.d.ts +0 -69
  263. package/dist/WorkspaceLive-DLGhtIly.d.ts +0 -49
  264. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
  265. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
  266. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
  267. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
  268. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
  269. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
  270. package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
  271. package/dist/mcp-server-7NR24ASj.js +0 -69
  272. package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
  273. package/dist/styles/think-sidepanel.css +0 -78
  274. package/dist/think-agent-Cip5KAPj.d.ts +0 -7
@@ -1,5 +1,5 @@
1
- import { workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix } from "./Workspace.js";
2
- import { invalidateWorkspaceConceptQueries } from "./WorkspaceConcept.js";
1
+ import { refreshWorkspaceFileQueries, workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix, workspaceFileQueryKey, workspaceInfoQueryKey } from "./Workspace.js";
2
+ import { invalidateWorkspaceConceptQueries, workspacePathsOverlap } from "./WorkspaceConcept.js";
3
3
  import * as React from "react";
4
4
  import { useQueryClient } from "@tanstack/react-query";
5
5
  //#region src/components/agents-sdk/WorkspaceLive.ts
@@ -11,6 +11,22 @@ function workspaceDirname(path) {
11
11
  function invalidateWorkspaceDirectories(queryClient, sourceKey, directories, root) {
12
12
  for (const directory of directories) queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryKey(sourceKey, root, directory) });
13
13
  }
14
+ async function invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths) {
15
+ queryClient.invalidateQueries({
16
+ queryKey: workspaceInfoQueryKey(sourceKey, root),
17
+ exact: true
18
+ });
19
+ if (!source || !selectedPath || paths && !paths.some((path) => workspacePathsOverlap(selectedPath, path))) return;
20
+ await queryClient.cancelQueries({ queryKey: workspaceFileQueryKey(sourceKey, root, selectedPath) });
21
+ await refreshWorkspaceFileQueries(queryClient, {
22
+ source,
23
+ sourceKey,
24
+ root,
25
+ selectedPath,
26
+ resolveFileAsset,
27
+ maxInlineAssetBytes
28
+ }).catch(() => {});
29
+ }
14
30
  /**
15
31
  * Synchronize external workspace freshness with the design system's Query
16
32
  * resources. This is the one external-system effect: native observer events
@@ -18,15 +34,25 @@ function invalidateWorkspaceDirectories(queryClient, sourceKey, directories, roo
18
34
  * stable query keys. Hosts only supply events; neither layer adds another
19
35
  * watcher.
20
36
  */
21
- function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
37
+ function useWorkspaceLiveQueries({ changes, maxInlineAssetBytes, resolveFileAsset, selectedPath, source, sourceKey, root, revision }) {
22
38
  const queryClient = useQueryClient();
39
+ const refreshResources = React.useEffectEvent((paths) => {
40
+ if (!sourceKey) return;
41
+ invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths);
42
+ });
23
43
  const previousRevisionRef = React.useRef(void 0);
24
44
  React.useEffect(() => {
25
45
  if (!sourceKey || revision === void 0) return;
26
46
  const previous = previousRevisionRef.current;
27
- previousRevisionRef.current = revision;
28
- if (revision === previous) return;
47
+ previousRevisionRef.current = {
48
+ sourceKey,
49
+ root,
50
+ revision
51
+ };
52
+ if (previous?.sourceKey === sourceKey && previous.root === root && previous.revision === revision) return;
53
+ queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
29
54
  invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
55
+ refreshResources();
30
56
  }, [
31
57
  queryClient,
32
58
  revision,
@@ -50,6 +76,7 @@ function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
50
76
  pendingPaths.clear();
51
77
  queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
52
78
  invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
79
+ refreshResources();
53
80
  return;
54
81
  }
55
82
  invalidateWorkspaceDirectories(queryClient, sourceKey, pendingDirectories, root);
@@ -57,6 +84,7 @@ function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
57
84
  pendingDirectories.clear();
58
85
  pendingPaths.clear();
59
86
  invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, paths);
87
+ refreshResources(paths);
60
88
  };
61
89
  const unsubscribe = changes.subscribe((change) => {
62
90
  if (change.type === "unknown") refreshAll = true;
@@ -1,2 +1,48 @@
1
- import { a as WorkspaceMessageResponseProps, i as WorkspaceMessageResponse, n as WorkspaceFileRenderer, r as WorkspaceFileRendererProvider, t as WorkspaceFileRenderInput } from "../../WorkspaceMessageResponse-kJYU8Onj.js";
1
+ import { O as MessageResponseProps } from "../../Message-DyaTBiV7.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/agents-sdk/WorkspaceMessageResponse.d.ts
5
+ interface WorkspaceFileRenderInput {
6
+ label: string;
7
+ path: string;
8
+ /** Shared workspace link element; hosts pass it through to the preview unchanged. */
9
+ sourceLink: React.ReactElement;
10
+ }
11
+ /**
12
+ * Host callback for one standalone workspace file link in an assistant
13
+ * paragraph. Return a node to replace the link, or `null` to keep it.
14
+ */
15
+ type WorkspaceFileRenderer = (file: WorkspaceFileRenderInput) => React.ReactNode;
16
+ /**
17
+ * Ambient workspace-file renderer for every `WorkspaceMessageResponse` below,
18
+ * and the only way to supply one. The value is read inside the promoted
19
+ * paragraph, not by the response component, so a host handing down a fresh
20
+ * callback every render re-renders only the paragraphs — the memoized Markdown
21
+ * pipeline is untouched and promoted cards keep their state.
22
+ * `ThinkChat.MessageContent` provides it from its `renderWorkspaceFile` prop; hosts
23
+ * composing `WorkspaceMessageResponse` directly provide it once at their
24
+ * conversation root.
25
+ */
26
+ declare function WorkspaceFileRendererProvider({
27
+ children,
28
+ renderWorkspaceFile
29
+ }: {
30
+ children: React.ReactNode;
31
+ renderWorkspaceFile: WorkspaceFileRenderer | undefined;
32
+ }): React.JSX.Element;
33
+ interface WorkspaceMessageResponseProps extends MessageResponseProps {
34
+ /**
35
+ * Whether standalone workspace file links may be promoted. `ThinkChat`
36
+ * passes `false` for user messages: user links remain ordinary navigation.
37
+ */
38
+ promoteWorkspaceFiles?: boolean;
39
+ }
40
+ /** Adds workspace-aware Markdown links when rendered inside a workspace provider. */
41
+ declare const WorkspaceMessageResponse: React.MemoExoticComponent<({
42
+ components,
43
+ rehypePlugins,
44
+ promoteWorkspaceFiles,
45
+ ...props
46
+ }: WorkspaceMessageResponseProps) => React.JSX.Element>;
47
+ //#endregion
2
48
  export { WorkspaceFileRenderInput, WorkspaceFileRenderer, WorkspaceFileRendererProvider, WorkspaceMessageResponse, WorkspaceMessageResponseProps };
@@ -1,2 +1,2 @@
1
- import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-Dg_aNpoj.js";
1
+ import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-CUJk9_P5.js";
2
2
  export { WorkspaceFileRendererProvider, WorkspaceMessageResponse };
@@ -15,7 +15,8 @@ interface WorkspaceMountManagerProps {
15
15
  onAdd: () => void;
16
16
  onReconnect: (mount: WorkspaceMountItem) => void;
17
17
  onRemove: (mount: WorkspaceMountItem) => void;
18
- triggerLabel?: string;
18
+ /** Caller-owned button, including its accessible name and optional toolbar composition. */
19
+ trigger: React.ReactElement;
19
20
  }
20
21
  /** Controlled local-mount presentation; native handles and persistence stay in the host. */
21
22
  declare function WorkspaceMountManager({
@@ -26,7 +27,7 @@ declare function WorkspaceMountManager({
26
27
  onAdd,
27
28
  onReconnect,
28
29
  onRemove,
29
- triggerLabel
30
+ trigger
30
31
  }: WorkspaceMountManagerProps): React.JSX.Element;
31
32
  //#endregion
32
33
  export { WorkspaceMountItem, WorkspaceMountManager, WorkspaceMountManagerProps, WorkspaceMountPermission };
@@ -1,19 +1,16 @@
1
- import { I as PaperclipIcon } from "../../icons-cuEtsgj9.js";
2
1
  import { Button } from "../foundations/Button.js";
3
- import { Popover } from "../foundations/Popover.js";
4
2
  import { EmptyState } from "../foundations/EmptyState.js";
5
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
3
+ import { Popover } from "../foundations/Popover.js";
6
4
  import { Card, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
7
5
  import "react";
8
6
  import { jsx, jsxs } from "react/jsx-runtime";
9
7
  //#region src/components/agents-sdk/WorkspaceMountManager.tsx
10
8
  /** Controlled local-mount presentation; native handles and persistence stay in the host. */
11
- function WorkspaceMountManager({ mounts, adding = false, busyMountId = null, error, onAdd, onReconnect, onRemove, triggerLabel = "Attach local folders" }) {
9
+ function WorkspaceMountManager({ mounts, adding = false, busyMountId = null, error, onAdd, onReconnect, onRemove, trigger }) {
12
10
  const busy = adding || busyMountId !== null;
13
- return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
14
- label: triggerLabel,
15
- render: /* @__PURE__ */ jsx(Popover.Trigger, { unstyled: true }),
16
- children: /* @__PURE__ */ jsx(PaperclipIcon, {})
11
+ return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(Popover.Trigger, {
12
+ render: trigger,
13
+ unstyled: true
17
14
  }), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
18
15
  side: "bottom",
19
16
  align: "end",
@@ -0,0 +1,38 @@
1
+ import { n as WorkspaceDestination } from "../../WorkspaceLink-Bh9-Jo1r.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/agents-sdk/WorkspaceNavigationRestoration.d.ts
5
+ interface WorkspaceNavigationRestoration {
6
+ focusDestination?: WorkspaceDestination;
7
+ focusScope?: string;
8
+ scrollTop?: number;
9
+ }
10
+ interface WorkspaceNavigationRestorationContextValue {
11
+ get(entryKey: string): WorkspaceNavigationRestoration | undefined;
12
+ recordFocus(entryKey: string, destination: WorkspaceDestination, scope?: string): void;
13
+ recordScroll(entryKey: string, scrollTop: number): void;
14
+ }
15
+ /**
16
+ * Owns entry-keyed presentation state unless an ancestor already provides it.
17
+ * This lets a full application share restoration between chat and files while
18
+ * keeping a standalone WorkspaceExplorer self-contained.
19
+ */
20
+ declare function WorkspaceNavigationRestorationBoundary({
21
+ children
22
+ }: {
23
+ children: React.ReactNode;
24
+ }): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
25
+ /** Restores a link in a named surface, including when that surface renders asynchronously. */
26
+ declare function WorkspaceNavigationFocusRestorer({
27
+ entryKey,
28
+ rootRef,
29
+ scope
30
+ }: {
31
+ entryKey: string;
32
+ rootRef: React.RefObject<HTMLElement | null>;
33
+ scope: string;
34
+ }): null;
35
+ declare function useWorkspaceNavigationRestoration(): WorkspaceNavigationRestorationContextValue | null;
36
+ declare function useRequiredWorkspaceNavigationRestoration(): WorkspaceNavigationRestorationContextValue;
37
+ //#endregion
38
+ export { WorkspaceNavigationFocusRestorer, WorkspaceNavigationRestoration, WorkspaceNavigationRestorationBoundary, WorkspaceNavigationRestorationContextValue, useRequiredWorkspaceNavigationRestoration, useWorkspaceNavigationRestoration };
@@ -0,0 +1,86 @@
1
+ import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/agents-sdk/WorkspaceNavigationRestoration.tsx
4
+ const WorkspaceNavigationRestorationContext = React.createContext(null);
5
+ /**
6
+ * Owns entry-keyed presentation state unless an ancestor already provides it.
7
+ * This lets a full application share restoration between chat and files while
8
+ * keeping a standalone WorkspaceExplorer self-contained.
9
+ */
10
+ function WorkspaceNavigationRestorationBoundary({ children }) {
11
+ const parent = React.use(WorkspaceNavigationRestorationContext);
12
+ const restorationsRef = React.useRef(/* @__PURE__ */ new Map());
13
+ const localValue = React.useMemo(() => ({
14
+ get: (entryKey) => restorationsRef.current.get(entryKey),
15
+ recordFocus: (entryKey, destination, scope) => {
16
+ const current = restorationsRef.current.get(entryKey);
17
+ restorationsRef.current.set(entryKey, {
18
+ ...current,
19
+ focusDestination: destination,
20
+ focusScope: scope
21
+ });
22
+ },
23
+ recordScroll: (entryKey, scrollTop) => {
24
+ const current = restorationsRef.current.get(entryKey);
25
+ restorationsRef.current.set(entryKey, {
26
+ ...current,
27
+ scrollTop
28
+ });
29
+ }
30
+ }), []);
31
+ if (parent) return children;
32
+ return /* @__PURE__ */ jsx(WorkspaceNavigationRestorationContext, {
33
+ value: localValue,
34
+ children
35
+ });
36
+ }
37
+ function findDestinationLink(root, destination) {
38
+ if (destination.kind !== "file") return null;
39
+ return [...root.querySelectorAll("[data-workspace-link=\"file\"]")].find((candidate) => candidate.dataset.workspacePath === destination.path && (candidate.dataset.workspaceDestinationFragment || null) === destination.fragment) ?? null;
40
+ }
41
+ /** Restores a link in a named surface, including when that surface renders asynchronously. */
42
+ function WorkspaceNavigationFocusRestorer({ entryKey, rootRef, scope }) {
43
+ const restoration = useWorkspaceNavigationRestoration();
44
+ const handledEntryRef = React.useRef(null);
45
+ React.useEffect(() => {
46
+ if (handledEntryRef.current === entryKey) return;
47
+ const saved = restoration?.get(entryKey);
48
+ if (!saved?.focusDestination || saved.focusScope !== scope) return;
49
+ const focusDestination = saved.focusDestination;
50
+ const root = rootRef.current;
51
+ if (!root) return;
52
+ const restore = () => {
53
+ const surface = [...root.matches("[data-workspace-restoration-scope]") ? [root] : [], ...root.querySelectorAll("[data-workspace-restoration-scope]")].find((candidate) => candidate.dataset.workspaceRestorationScope === scope);
54
+ const target = surface ? findDestinationLink(surface, focusDestination) : null;
55
+ if (!target) return false;
56
+ target.focus({ preventScroll: true });
57
+ handledEntryRef.current = entryKey;
58
+ return true;
59
+ };
60
+ if (restore()) return;
61
+ const observer = new MutationObserver(() => {
62
+ if (restore()) observer.disconnect();
63
+ });
64
+ observer.observe(root, {
65
+ childList: true,
66
+ subtree: true
67
+ });
68
+ return () => observer.disconnect();
69
+ }, [
70
+ entryKey,
71
+ restoration,
72
+ rootRef,
73
+ scope
74
+ ]);
75
+ return null;
76
+ }
77
+ function useWorkspaceNavigationRestoration() {
78
+ return React.use(WorkspaceNavigationRestorationContext);
79
+ }
80
+ function useRequiredWorkspaceNavigationRestoration() {
81
+ const restoration = useWorkspaceNavigationRestoration();
82
+ if (!restoration) throw new Error("Workspace navigation restoration is unavailable outside its boundary.");
83
+ return restoration;
84
+ }
85
+ //#endregion
86
+ export { WorkspaceNavigationFocusRestorer, WorkspaceNavigationRestorationBoundary, useRequiredWorkspaceNavigationRestoration, useWorkspaceNavigationRestoration };
@@ -1,4 +1,3 @@
1
- import { ThinkFullAppPanel } from "./ThinkFullApp.js";
2
1
  import { WorkspaceConceptQueryOptions } from "./WorkspaceConcept.js";
3
2
  import { CardProps } from "../foundations/Card.js";
4
3
  import * as React from "react";
@@ -8,7 +7,22 @@ type WorkspaceProjectThreadOrigin = "user" | "routine" | "messenger";
8
7
  interface WorkspaceProjectFile {
9
8
  path: string;
10
9
  label: string;
11
- onOpen?: () => void;
10
+ }
11
+ type WorkspaceProjectSectionItem = {
12
+ kind: "file";
13
+ path: string;
14
+ label: string;
15
+ } | {
16
+ kind: "link";
17
+ href: string;
18
+ label: string;
19
+ } | {
20
+ kind: "text";
21
+ label: string;
22
+ };
23
+ interface WorkspaceProjectSection {
24
+ label: string;
25
+ items: readonly WorkspaceProjectSectionItem[];
12
26
  }
13
27
  interface WorkspaceProjectThread {
14
28
  id: string;
@@ -16,7 +30,6 @@ interface WorkspaceProjectThread {
16
30
  origin: WorkspaceProjectThreadOrigin;
17
31
  /** Channel or origin mark. Messenger threads pass a brand favicon. */
18
32
  icon?: React.ReactNode;
19
- onOpen?: () => void;
20
33
  }
21
34
  interface WorkspaceProject {
22
35
  /** Workspace path of PROJECT.md — directories are not addressable. */
@@ -26,7 +39,29 @@ interface WorkspaceProject {
26
39
  /** Brand mark. Defaults to `FolderIcon`. */
27
40
  icon?: React.ReactNode;
28
41
  files?: readonly WorkspaceProjectFile[];
42
+ /** Explicit groups authored under `## Working set` in PROJECT.md. */
43
+ sections?: readonly WorkspaceProjectSection[];
29
44
  threads?: readonly WorkspaceProjectThread[];
45
+ }
46
+ type WorkspaceProjectOpenable = {
47
+ onOpen?: () => void;
48
+ };
49
+ type WorkspaceProjectFileView = WorkspaceProjectFile & WorkspaceProjectOpenable;
50
+ type WorkspaceProjectSectionItemView = (Extract<WorkspaceProjectSectionItem, {
51
+ kind: "file";
52
+ }> & WorkspaceProjectOpenable) | Exclude<WorkspaceProjectSectionItem, {
53
+ kind: "file";
54
+ }>;
55
+ interface WorkspaceProjectSectionView {
56
+ label: string;
57
+ items: readonly WorkspaceProjectSectionItemView[];
58
+ }
59
+ type WorkspaceProjectThreadView = WorkspaceProjectThread & WorkspaceProjectOpenable;
60
+ /** Data-only project projection hydrated with card actions outside Query. */
61
+ interface WorkspaceProjectView extends Omit<WorkspaceProject, "files" | "sections" | "threads"> {
62
+ files?: readonly WorkspaceProjectFileView[];
63
+ sections?: readonly WorkspaceProjectSectionView[];
64
+ threads?: readonly WorkspaceProjectThreadView[];
30
65
  onOpen?: () => void;
31
66
  onDelete?: () => void | Promise<void>;
32
67
  }
@@ -38,7 +73,7 @@ interface WorkspaceProjectSource {
38
73
  onDelete?: (path: string) => void | Promise<void>;
39
74
  }
40
75
  interface WorkspaceProjectCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
41
- project: WorkspaceProject;
76
+ project: WorkspaceProjectView;
42
77
  }
43
78
  interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps, "project"> {
44
79
  path: string;
@@ -46,10 +81,8 @@ interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps,
46
81
  fallback?: React.ReactNode;
47
82
  }
48
83
  interface WorkspaceProjectsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
49
- projects: readonly WorkspaceProject[];
50
- /** Query failure to show instead of the empty state. Loaded projects win. */
51
- error?: string;
52
- onRetry?: () => void;
84
+ /** Shared workspace query and host actions, also used by inline project cards. */
85
+ source: WorkspaceProjectSource;
53
86
  }
54
87
  declare function WorkspaceProjectCard({
55
88
  className,
@@ -79,15 +112,11 @@ declare function useWorkspaceProjects(source: WorkspaceProjectSource): readonly
79
112
  */
80
113
  declare function WorkspaceProjectsPanel({
81
114
  className,
82
- error,
83
- projects,
84
- onRetry,
115
+ source,
85
116
  ref,
86
117
  ...props
87
118
  }: WorkspaceProjectsPanelProps & {
88
- ref?: React.Ref<HTMLElement>;
119
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLElement>;
89
120
  }): React.JSX.Element;
90
- /** Canonical workbench descriptor; hosts supply only the source adapter. */
91
- declare function workspaceProjectsPanel(source: WorkspaceProjectSource): ThinkFullAppPanel;
92
121
  //#endregion
93
- export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects, workspaceProjectsPanel };
122
+ export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectFileView, WorkspaceProjectSection, WorkspaceProjectSectionItem, WorkspaceProjectSectionItemView, WorkspaceProjectSectionView, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectThreadView, WorkspaceProjectView, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects };
@@ -1,12 +1,13 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { $ as UserIcon, C as FolderIcon, S as FileIcon, j as MessageSquareIcon, u as CalendarIcon } from "../../icons-cuEtsgj9.js";
2
+ import { $ as UserIcon, C as FolderIcon, D as LinkIcon, K as SpinnerIcon, S as FileIcon, j as MessageSquareIcon, u as CalendarIcon } from "../../icons-cuEtsgj9.js";
3
3
  import { Button } from "../foundations/Button.js";
4
4
  import { IconButton } from "../foundations/IconButton.js";
5
5
  import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
6
6
  import { EmptyState } from "../foundations/EmptyState.js";
7
+ import { LinkButton } from "../foundations/LinkButton.js";
7
8
  import { DescriptionList } from "../foundations/DescriptionList.js";
8
9
  import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
9
- import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink } from "../../workspace-assets-CxpEHsac.js";
10
+ import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
10
11
  import * as React from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
12
13
  import { useQuery } from "@tanstack/react-query";
@@ -51,30 +52,55 @@ function LinkList({ items }) {
51
52
  });
52
53
  }
53
54
  function ProjectDetails({ project }) {
54
- const files = (project.files ?? []).filter((file) => !file.path.endsWith("/PROJECT.md"));
55
+ const referencedFiles = new Set((project.sections ?? []).flatMap(({ items }) => items.flatMap((item) => item.kind === "file" ? [item.path] : [])));
56
+ const files = (project.files ?? []).filter((file) => !file.path.endsWith("/PROJECT.md") && !referencedFiles.has(file.path));
57
+ const sections = (project.sections ?? []).filter(({ items }) => items.length > 0);
55
58
  const threads = project.threads ?? [];
56
- if (files.length === 0 && threads.length === 0) return null;
59
+ if (files.length === 0 && sections.length === 0 && threads.length === 0) return null;
57
60
  return /* @__PURE__ */ jsxs(DescriptionList.Root, {
58
61
  align: "start",
59
62
  variant: "divided",
60
- children: [files.length > 0 ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Contents" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
61
- className: "sigvelo-cluster",
62
- children: files.map((file) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
63
- value: file.path,
64
- label: file.label,
65
- hint: file.path,
66
- onOpen: file.onOpen
67
- }, file.path))
68
- }) })] }) : null, ORIGIN_ORDER.map((origin) => {
69
- const grouped = threads.filter((thread) => thread.origin === origin);
70
- if (grouped.length === 0) return null;
71
- return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: ORIGIN_LABEL[origin] }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx(LinkList, { items: grouped.map((thread) => ({
72
- key: thread.id,
73
- label: thread.title,
74
- icon: thread.icon ?? ORIGIN_ICON[origin],
75
- onOpen: thread.onOpen
76
- })) }) })] }, origin);
77
- })]
63
+ children: [
64
+ sections.map((section) => /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: section.label }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
65
+ className: "sigvelo-cluster",
66
+ children: section.items.map((item) => item.kind === "file" ? /* @__PURE__ */ jsx(WorkspaceComposerLink, {
67
+ value: item.path,
68
+ label: item.label,
69
+ hint: item.path,
70
+ onOpen: item.onOpen
71
+ }, `${item.kind}:${item.path}`) : item.kind === "link" ? /* @__PURE__ */ jsxs(LinkButton, {
72
+ href: item.href,
73
+ target: "_blank",
74
+ rel: "noreferrer",
75
+ variant: "link",
76
+ color: "neutral",
77
+ size: "xs",
78
+ children: [/* @__PURE__ */ jsx(FaviconMark, {
79
+ href: item.href,
80
+ fallback: /* @__PURE__ */ jsx(LinkIcon, {})
81
+ }), item.label]
82
+ }, `${item.kind}:${item.href}`) : /* @__PURE__ */ jsx("span", { children: item.label }, `${item.kind}:${item.label}`))
83
+ }) })] }, section.label)),
84
+ files.length > 0 ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Contents" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
85
+ className: "sigvelo-cluster",
86
+ children: files.map((file) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
87
+ value: file.path,
88
+ label: file.label,
89
+ hint: file.path,
90
+ onOpen: file.onOpen
91
+ }, file.path))
92
+ }) })] }) : null,
93
+ ORIGIN_ORDER.map((origin) => {
94
+ const grouped = threads.filter((thread) => thread.origin === origin);
95
+ if (grouped.length === 0) return null;
96
+ return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: ORIGIN_LABEL[origin] }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx(LinkList, { items: grouped.map((thread) => ({
97
+ key: thread.id,
98
+ label: thread.title,
99
+ icon: thread.icon ?? ORIGIN_ICON[origin],
100
+ onOpen: thread.onOpen
101
+ })) }) })] }, origin);
102
+ })
103
+ ]
78
104
  });
79
105
  }
80
106
  function WorkspaceProjectCard({ className, project, ref, ...props }) {
@@ -93,7 +119,10 @@ function WorkspaceProjectCard({ className, project, ref, ...props }) {
93
119
  /* @__PURE__ */ jsxs(CardTitle, {
94
120
  id: titleId,
95
121
  className: "connected-app-card__title",
96
- render: /* @__PURE__ */ jsx("h3", {}),
122
+ render: (props) => /* @__PURE__ */ jsx("h3", {
123
+ ...props,
124
+ children: props.children
125
+ }),
97
126
  children: [/* @__PURE__ */ jsx("span", {
98
127
  className: "connected-app-card__icon",
99
128
  "aria-hidden": "true",
@@ -126,7 +155,7 @@ function WorkspaceProjectFileCard({ fallback = null, path, source, ...props }) {
126
155
  return project ? /* @__PURE__ */ jsx(WorkspaceProjectCard, {
127
156
  ...props,
128
157
  project: projectWithSource(project, source)
129
- }) : fallback;
158
+ }, JSON.stringify(source.queryOptions.queryKey)) : fallback;
130
159
  }
131
160
  /** Design-system-owned project query shared by panels, cards, and composer context. */
132
161
  function useWorkspaceProjects(source) {
@@ -137,7 +166,9 @@ function useWorkspaceProjects(source) {
137
166
  * query failure with nothing loaded renders as a quiet inline error, never as
138
167
  * an empty library.
139
168
  */
140
- function WorkspaceProjectsPanel({ className, error, projects, onRetry, ref, ...props }) {
169
+ function WorkspaceProjectsPanel({ className, source, ref, ...props }) {
170
+ const query = useQuery(source.queryOptions);
171
+ const projects = query.data ?? [];
141
172
  return /* @__PURE__ */ jsx("section", {
142
173
  ref,
143
174
  "data-slot": "workspace-projects-panel",
@@ -146,23 +177,26 @@ function WorkspaceProjectsPanel({ className, error, projects, onRetry, ref, ...p
146
177
  "aria-label": props["aria-label"] ?? "Projects",
147
178
  children: projects.length > 0 ? /* @__PURE__ */ jsx("ul", {
148
179
  className: "sigvelo-stack-list sigvelo-stack",
149
- children: projects.map((project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectCard, { project }) }, project.path))
150
- }) : error !== void 0 ? /* @__PURE__ */ jsx(EmptyState, {
180
+ children: projects.map((project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectCard, { project: projectWithSource(project, source) }) }, project.path))
181
+ }) : query.error ? /* @__PURE__ */ jsx(EmptyState, {
151
182
  icon: /* @__PURE__ */ jsx(FolderIcon, {}),
152
183
  title: "Projects unavailable",
153
- description: error,
154
- children: onRetry ? /* @__PURE__ */ jsx(Button, {
184
+ description: formatErrorMessage(query.error),
185
+ children: /* @__PURE__ */ jsx(Button, {
155
186
  size: "sm",
156
187
  variant: "outline",
157
188
  color: "neutral",
158
- onClick: onRetry,
189
+ onClick: () => void query.refetch(),
159
190
  children: "Retry"
160
- }) : null
191
+ })
192
+ }) : query.isPending ? /* @__PURE__ */ jsx(EmptyState, {
193
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
194
+ title: "Loading projects"
161
195
  }) : /* @__PURE__ */ jsx(EmptyState, {
162
196
  icon: /* @__PURE__ */ jsx(FolderIcon, {}),
163
197
  title: "No projects"
164
198
  })
165
- });
199
+ }, JSON.stringify(source.queryOptions.queryKey));
166
200
  }
167
201
  function projectWithSource(project, source) {
168
202
  return {
@@ -171,6 +205,13 @@ function projectWithSource(project, source) {
171
205
  ...file,
172
206
  onOpen: source.onOpenFile ? () => source.onOpenFile?.(file.path) : void 0
173
207
  })),
208
+ sections: project.sections?.map((section) => ({
209
+ ...section,
210
+ items: section.items.map((item) => item.kind === "file" ? {
211
+ ...item,
212
+ onOpen: source.onOpenFile ? () => source.onOpenFile?.(item.path) : void 0
213
+ } : item)
214
+ })),
174
215
  threads: project.threads?.map((thread) => ({
175
216
  ...thread,
176
217
  onOpen: source.onOpenThread ? () => source.onOpenThread?.(thread.id) : void 0
@@ -179,23 +220,5 @@ function projectWithSource(project, source) {
179
220
  onDelete: source.onDelete ? () => source.onDelete?.(project.path) : void 0
180
221
  };
181
222
  }
182
- function WorkspaceProjectSourcePanel({ source }) {
183
- const query = useQuery(source.queryOptions);
184
- return /* @__PURE__ */ jsx(WorkspaceProjectsPanel, {
185
- projects: (query.data ?? []).map((project) => projectWithSource(project, source)),
186
- error: query.isError ? formatErrorMessage(query.error) : void 0,
187
- onRetry: query.isError ? () => void query.refetch() : void 0,
188
- "aria-busy": query.isFetching || void 0
189
- });
190
- }
191
- /** Canonical workbench descriptor; hosts supply only the source adapter. */
192
- function workspaceProjectsPanel(source) {
193
- return {
194
- id: "projects",
195
- label: "Projects",
196
- icon: /* @__PURE__ */ jsx(FolderIcon, {}),
197
- render: () => /* @__PURE__ */ jsx(WorkspaceProjectSourcePanel, { source })
198
- };
199
- }
200
223
  //#endregion
201
- export { WorkspaceProjectCard, WorkspaceProjectFileCard, WorkspaceProjectsPanel, useWorkspaceProjects, workspaceProjectsPanel };
224
+ export { WorkspaceProjectCard, WorkspaceProjectFileCard, WorkspaceProjectsPanel, useWorkspaceProjects };
@@ -41,7 +41,7 @@ declare function WorkspaceUserScriptsPanel({
41
41
  scripts,
42
42
  ...props
43
43
  }: WorkspaceUserScriptsPanelProps & {
44
- ref?: React.Ref<HTMLElement>;
44
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLElement>;
45
45
  }): React.JSX.Element;
46
46
  //#endregion
47
47
  export { WorkspaceUserScript, WorkspaceUserScriptCard, WorkspaceUserScriptCardProps, WorkspaceUserScriptsPanel, WorkspaceUserScriptsPanelProps };
@@ -5,7 +5,7 @@ import { EmptyState } from "../foundations/EmptyState.js";
5
5
  import { DescriptionList } from "../foundations/DescriptionList.js";
6
6
  import { Switch } from "../foundations/Switch.js";
7
7
  import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
8
- import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-CxpEHsac.js";
8
+ import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
9
9
  import * as React from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/components/agents-sdk/WorkspaceUserScript.tsx
@@ -93,7 +93,10 @@ function WorkspaceUserScriptCard({ className, script, ref, ...props }) {
93
93
  /* @__PURE__ */ jsxs(CardTitle, {
94
94
  id: titleId,
95
95
  className: "connected-app-card__title",
96
- render: /* @__PURE__ */ jsx("h3", {}),
96
+ render: (props) => /* @__PURE__ */ jsx("h3", {
97
+ ...props,
98
+ children: props.children
99
+ }),
97
100
  children: [/* @__PURE__ */ jsx("span", {
98
101
  className: "connected-app-card__icon",
99
102
  "aria-hidden": "true",
@@ -43,7 +43,7 @@ declare function Activity({
43
43
  ref,
44
44
  ...props
45
45
  }: ActivityProps & {
46
- ref?: React.Ref<HTMLDivElement>;
46
+ /** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
47
47
  }): React.JSX.Element;
48
48
  interface ActivityTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "unstyled" | "children"> {
49
49
  /** The action being taken. Defaults to "Working…". */