@mcp-b/react-components 0.16.1 → 0.18.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 (371) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-ClxViuUM.d.ts} +4 -29
  3. package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
  4. package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
  5. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  6. package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Bfp5PAg3.js} +9 -6
  7. package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  8. package/dist/Collapsible-N64ASIQr.d.ts +119 -0
  9. package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
  10. package/dist/{FileTree-CkVbIMWV.js → FileTree-3zYtrddG.js} +46 -20
  11. package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
  12. package/dist/{Message-BkMdE3bS.js → Message-BXtmfc9Q.js} +13 -20
  13. package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-Cqw_qrUG.js} +18 -25
  14. package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-Bdh9pqlo.d.ts} +41 -71
  15. package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
  16. package/dist/{Select-BeEsefzh.d.ts → Select-B_13gg_J.d.ts} +16 -44
  17. package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-ColWK-XA.d.ts} +14 -20
  18. package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-15EhfvYJ.js} +123 -73
  19. package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +9 -4
  20. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  21. package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
  22. package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
  23. package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-JKZ43D5S.d.ts} +2 -2
  24. package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +4 -5
  25. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  26. package/dist/WorkspaceExplorer-B9dQWNVK.d.ts +32 -0
  27. package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  28. package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-C68Ub8S8.js} +121 -128
  29. package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-BYYeTQLf.js} +20 -55
  30. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  31. package/dist/class-names-BiMDVpUo.js +14 -0
  32. package/dist/components/Accordion.d.ts +5 -15
  33. package/dist/components/Accordion.js +16 -10
  34. package/dist/components/Activity.d.ts +5 -10
  35. package/dist/components/Activity.js +2 -2
  36. package/dist/components/AgentActivity.d.ts +1 -1
  37. package/dist/components/AgentActivity.js +4 -5
  38. package/dist/components/AgentActivityPreview.d.ts +9 -9
  39. package/dist/components/AgentActivityPreview.js +8 -12
  40. package/dist/components/AgentAttention.d.ts +2 -2
  41. package/dist/components/AgentAttention.js +1 -1
  42. package/dist/components/AgentChat.d.ts +2 -2
  43. package/dist/components/AgentChat.js +113 -218
  44. package/dist/components/AgentChatMessageEditor.js +3 -3
  45. package/dist/components/AgentChatTurnError.js +2 -2
  46. package/dist/components/AgentConnection.js +4 -4
  47. package/dist/components/AgentMessageParts.d.ts +2 -0
  48. package/dist/components/AgentMessageParts.js +119 -0
  49. package/dist/components/AgentToolDetail.d.ts +57 -0
  50. package/dist/components/AgentToolDetail.js +100 -0
  51. package/dist/components/AgentToolRunsContext.d.ts +2 -0
  52. package/dist/components/AgentToolRunsContext.js +16 -0
  53. package/dist/components/AlertDialog.d.ts +7 -19
  54. package/dist/components/AlertDialog.js +21 -32
  55. package/dist/components/AppTopBar.d.ts +28 -8
  56. package/dist/components/AppTopBar.js +36 -12
  57. package/dist/components/Approval.d.ts +102 -0
  58. package/dist/components/Approval.js +227 -0
  59. package/dist/components/Artifact.d.ts +3 -5
  60. package/dist/components/Artifact.js +7 -5
  61. package/dist/components/Autocomplete.d.ts +11 -33
  62. package/dist/components/Autocomplete.js +23 -30
  63. package/dist/components/Avatar.d.ts +4 -12
  64. package/dist/components/Avatar.js +13 -12
  65. package/dist/components/Badge.js +3 -0
  66. package/dist/components/BrowserLiveView.js +27 -12
  67. package/dist/components/BrowserReplay.js +4 -3
  68. package/dist/components/BrowserRunPanel.js +58 -78
  69. package/dist/components/Button.d.ts +1 -1
  70. package/dist/components/Button.js +14 -16
  71. package/dist/components/Card.d.ts +7 -8
  72. package/dist/components/Card.js +19 -10
  73. package/dist/components/ChainOfThought.d.ts +5 -11
  74. package/dist/components/ChainOfThought.js +3 -2
  75. package/dist/components/ChatGptSignInScreen.js +8 -8
  76. package/dist/components/Checkbox.d.ts +2 -4
  77. package/dist/components/Checkbox.js +6 -5
  78. package/dist/components/CheckboxGroup.d.ts +1 -3
  79. package/dist/components/CheckboxGroup.js +15 -14
  80. package/dist/components/Checkpoint.d.ts +64 -0
  81. package/dist/components/Checkpoint.js +63 -0
  82. package/dist/components/CodeBlock.d.ts +1 -1
  83. package/dist/components/CodeBlock.js +1 -1
  84. package/dist/components/CodexModelSelector.d.ts +1 -1
  85. package/dist/components/CodexModelSelector.js +2 -2
  86. package/dist/components/Collapsible.d.ts +1 -124
  87. package/dist/components/Collapsible.js +7 -10
  88. package/dist/components/Combobox.d.ts +1 -1
  89. package/dist/components/Combobox.js +23 -30
  90. package/dist/components/Commit.d.ts +5 -11
  91. package/dist/components/Commit.js +6 -5
  92. package/dist/components/Context.js +1 -1
  93. package/dist/components/ContextMenu.d.ts +21 -37
  94. package/dist/components/ContextMenu.js +34 -51
  95. package/dist/components/Conversation.d.ts +3 -5
  96. package/dist/components/Conversation.js +5 -4
  97. package/dist/components/DescriptionListParts.js +1 -1
  98. package/dist/components/Dialog.d.ts +6 -17
  99. package/dist/components/Dialog.js +17 -24
  100. package/dist/components/EnvironmentVariables.d.ts +1 -1
  101. package/dist/components/EnvironmentVariables.js +4 -3
  102. package/dist/components/Field.d.ts +17 -20
  103. package/dist/components/Field.js +20 -17
  104. package/dist/components/Fieldset.d.ts +2 -7
  105. package/dist/components/Fieldset.js +7 -6
  106. package/dist/components/FileTree.d.ts +6 -0
  107. package/dist/components/FileTree.js +1 -1
  108. package/dist/components/Form.d.ts +1 -4
  109. package/dist/components/Form.js +3 -2
  110. package/dist/components/GithubMotionMark.js +1 -1
  111. package/dist/components/IconButton.d.ts +2 -3
  112. package/dist/components/IconButton.js +2 -1
  113. package/dist/components/InlineCitation.d.ts +66 -0
  114. package/dist/components/InlineCitation.js +142 -0
  115. package/dist/components/Input.d.ts +1 -4
  116. package/dist/components/Input.js +3 -2
  117. package/dist/components/Marker.js +1 -1
  118. package/dist/components/McpConnectionRequest.js +2 -2
  119. package/dist/components/McpServerPicker.d.ts +1 -1
  120. package/dist/components/McpServerPicker.js +6 -5
  121. package/dist/components/MediaPreviewCard.d.ts +103 -0
  122. package/dist/components/MediaPreviewCard.js +193 -0
  123. package/dist/components/Menu.d.ts +1 -1
  124. package/dist/components/Menu.js +33 -52
  125. package/dist/components/Menubar.d.ts +22 -43
  126. package/dist/components/Menubar.js +36 -53
  127. package/dist/components/Message.d.ts +7 -7
  128. package/dist/components/Message.js +1 -1
  129. package/dist/components/MessageScroller.d.ts +2 -2
  130. package/dist/components/MessageScroller.js +6 -5
  131. package/dist/components/Meter.d.ts +5 -20
  132. package/dist/components/Meter.js +11 -10
  133. package/dist/components/ModelSelector.d.ts +6 -9
  134. package/dist/components/ModelSelector.js +1 -1
  135. package/dist/components/NavigationMenu.d.ts +11 -33
  136. package/dist/components/NavigationMenu.js +23 -30
  137. package/dist/components/NumberField.d.ts +6 -24
  138. package/dist/components/NumberField.js +13 -12
  139. package/dist/components/Plan.d.ts +103 -0
  140. package/dist/components/Plan.js +113 -0
  141. package/dist/components/Popover.d.ts +9 -36
  142. package/dist/components/Popover.js +23 -34
  143. package/dist/components/PreviewCard.d.ts +6 -24
  144. package/dist/components/PreviewCard.js +13 -24
  145. package/dist/components/PricingBillingToggle.js +1 -1
  146. package/dist/components/PricingFAQ.js +1 -1
  147. package/dist/components/PricingPage.js +2 -1
  148. package/dist/components/PricingPlanCard.js +5 -4
  149. package/dist/components/PricingUsageCalculator.js +3 -3
  150. package/dist/components/Progress.d.ts +3 -8
  151. package/dist/components/Progress.js +7 -10
  152. package/dist/components/PromptInput.d.ts +2 -2
  153. package/dist/components/PromptInput.js +83 -218
  154. package/dist/components/Queue.d.ts +7 -17
  155. package/dist/components/Queue.js +2 -3
  156. package/dist/components/RadioGroup.d.ts +3 -8
  157. package/dist/components/RadioGroup.js +7 -10
  158. package/dist/components/Reasoning.d.ts +4 -8
  159. package/dist/components/Reasoning.js +3 -6
  160. package/dist/components/ResizableSidePanel.js +2 -2
  161. package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
  162. package/dist/components/ResponsiveSidebarShell.js +18 -11
  163. package/dist/components/ScrollArea.d.ts +5 -20
  164. package/dist/components/ScrollArea.js +12 -10
  165. package/dist/components/SearchField.d.ts +43 -0
  166. package/dist/components/SearchField.js +52 -0
  167. package/dist/components/Select.d.ts +1 -1
  168. package/dist/components/Select.js +33 -57
  169. package/dist/components/Separator.d.ts +1 -5
  170. package/dist/components/Separator.js +3 -6
  171. package/dist/components/Slider.d.ts +6 -19
  172. package/dist/components/Slider.js +15 -14
  173. package/dist/components/Sources.d.ts +4 -9
  174. package/dist/components/Sources.js +3 -2
  175. package/dist/components/Stepper.js +16 -9
  176. package/dist/components/SubagentRunDetails.js +1 -1
  177. package/dist/components/SubagentRunIndicator.js +2 -2
  178. package/dist/components/SubagentRunList.d.ts +3 -5
  179. package/dist/components/SubagentRunList.js +3 -5
  180. package/dist/components/SubagentRunSelector.d.ts +9 -22
  181. package/dist/components/SubagentRunSelector.js +29 -31
  182. package/dist/components/Switch.d.ts +4 -7
  183. package/dist/components/Switch.js +6 -10
  184. package/dist/components/Tabs.d.ts +2 -2
  185. package/dist/components/Tabs.js +21 -18
  186. package/dist/components/Task.d.ts +4 -9
  187. package/dist/components/Task.js +4 -3
  188. package/dist/components/Terminal.d.ts +3 -4
  189. package/dist/components/Terminal.js +5 -4
  190. package/dist/components/TestResults.d.ts +4 -9
  191. package/dist/components/TestResults.js +11 -6
  192. package/dist/components/Textarea.js +1 -1
  193. package/dist/components/ThemeModeControl.js +1 -1
  194. package/dist/components/ThinkChat.d.ts +45 -22
  195. package/dist/components/ThinkChat.js +7 -5
  196. package/dist/components/ThinkChatActivity.d.ts +2 -2
  197. package/dist/components/ThinkChatActivity.js +24 -7
  198. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  199. package/dist/components/ThinkChatActivitySummary.js +7 -3
  200. package/dist/components/ThinkChatContext.d.ts +1 -1
  201. package/dist/components/ThinkChatToolPanels.js +27 -17
  202. package/dist/components/ThinkExecutionDetail.js +2 -2
  203. package/dist/components/ThinkExecutionStatus.js +2 -2
  204. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  205. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  206. package/dist/components/ThinkFullApp.d.ts +40 -15
  207. package/dist/components/ThinkFullApp.js +193 -117
  208. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  209. package/dist/components/ThinkFullAppViewSwitch.js +2 -2
  210. package/dist/components/ThinkPendingApproval.d.ts +60 -0
  211. package/dist/components/ThinkPendingApproval.js +99 -0
  212. package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
  213. package/dist/components/ThinkRecoveryNotice.js +46 -0
  214. package/dist/components/ThinkRoutine.js +1 -0
  215. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  216. package/dist/components/ThinkRoutineBrowser.js +37 -44
  217. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  218. package/dist/components/ThinkRoutineDetail.js +4 -4
  219. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  220. package/dist/components/ThinkRoutineForm.js +11 -10
  221. package/dist/components/ThinkRoutineLibrary.d.ts +27 -25
  222. package/dist/components/ThinkRoutineLibrary.js +104 -80
  223. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  224. package/dist/components/ThinkRoutineRuns.js +31 -24
  225. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  226. package/dist/components/ThinkThreadPicker.js +163 -39
  227. package/dist/components/ThinkThreadShell.d.ts +1 -1
  228. package/dist/components/Toast.d.ts +7 -28
  229. package/dist/components/Toast.js +15 -14
  230. package/dist/components/Toggle.d.ts +1 -1
  231. package/dist/components/Toggle.js +10 -8
  232. package/dist/components/ToggleGroup.d.ts +1 -1
  233. package/dist/components/ToggleGroup.js +21 -26
  234. package/dist/components/ToolApproval.d.ts +28 -0
  235. package/dist/components/ToolApproval.js +35 -0
  236. package/dist/components/ToolInvocation.d.ts +26 -0
  237. package/dist/components/ToolInvocation.js +72 -0
  238. package/dist/components/Toolbar.d.ts +6 -24
  239. package/dist/components/Toolbar.js +13 -12
  240. package/dist/components/Tooltip.d.ts +11 -10
  241. package/dist/components/Tooltip.js +17 -11
  242. package/dist/components/TransitionSurface.d.ts +27 -0
  243. package/dist/components/TransitionSurface.js +20 -0
  244. package/dist/components/WebPreview.d.ts +6 -7
  245. package/dist/components/WebPreview.js +70 -55
  246. package/dist/components/Workspace.d.ts +2 -2
  247. package/dist/components/Workspace.js +361 -346
  248. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  249. package/dist/components/WorkspaceBrowser.js +16 -26
  250. package/dist/components/WorkspaceExplorer.d.ts +5 -33
  251. package/dist/components/WorkspaceExplorer.js +19 -32
  252. package/dist/components/WorkspaceFile.d.ts +1 -1
  253. package/dist/components/WorkspaceFileView.d.ts +14 -2
  254. package/dist/components/WorkspaceFileView.js +1 -1
  255. package/dist/components/WorkspaceHeader.d.ts +0 -8
  256. package/dist/components/WorkspaceHeader.js +3 -15
  257. package/dist/components/WorkspaceLink.d.ts +1 -1
  258. package/dist/components/WorkspaceLink.js +1 -1
  259. package/dist/components/icons.d.ts +2 -2
  260. package/dist/components/icons.js +2 -2
  261. package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-D7aAYA-2.d.ts} +2 -3
  262. package/dist/{copy-button-Dejn5heL.js → copy-button-DeK6KXEV.js} +3 -2
  263. package/dist/{icons-CpfUer49.js → icons-CQJ-aMnI.js} +7 -3
  264. package/dist/{icons-GQd1xF4e.d.ts → icons-CYXmvKlJ.d.ts} +22 -2
  265. package/dist/navigation-link-Cob7KBlM.js +19 -0
  266. package/dist/styles/accordion.css +4 -19
  267. package/dist/styles/activity.css +48 -56
  268. package/dist/styles/agent-activity-preview.css +6 -0
  269. package/dist/styles/agent-chat.css +14 -63
  270. package/dist/styles/agent-connection.css +0 -12
  271. package/dist/styles/agent-tool-detail.css +54 -0
  272. package/dist/styles/alert-dialog.css +16 -18
  273. package/dist/styles/app-top-bar.css +17 -9
  274. package/dist/styles/approval.css +177 -0
  275. package/dist/styles/artifact.css +6 -18
  276. package/dist/styles/autocomplete.css +2 -1
  277. package/dist/styles/avatar.css +35 -30
  278. package/dist/styles/badge.css +10 -10
  279. package/dist/styles/base-ui-motion.css +94 -39
  280. package/dist/styles/browser-control-overlay.css +0 -1
  281. package/dist/styles/browser-live-view.css +39 -22
  282. package/dist/styles/browser-replay.css +1 -1
  283. package/dist/styles/browser-run-panel.css +13 -6
  284. package/dist/styles/button.css +36 -33
  285. package/dist/styles/card.css +5 -6
  286. package/dist/styles/chain-of-thought.css +22 -24
  287. package/dist/styles/checkbox.css +18 -5
  288. package/dist/styles/checkpoint.css +58 -0
  289. package/dist/styles/codex-model-selector.css +3 -7
  290. package/dist/styles/collapsible.css +10 -10
  291. package/dist/styles/combobox.css +4 -3
  292. package/dist/styles/commit.css +19 -39
  293. package/dist/styles/composition-motion.css +83 -0
  294. package/dist/styles/context-menu.css +3 -11
  295. package/dist/styles/context.css +11 -10
  296. package/dist/styles/conversation.css +18 -23
  297. package/dist/styles/dialog.css +15 -15
  298. package/dist/styles/environment-variables.css +0 -13
  299. package/dist/styles/field.css +32 -12
  300. package/dist/styles/file-tree.css +66 -22
  301. package/dist/styles/form.css +1 -1
  302. package/dist/styles/index.css +13 -4
  303. package/dist/styles/inline-citation.css +107 -0
  304. package/dist/styles/input.css +2 -2
  305. package/dist/styles/marker.css +14 -13
  306. package/dist/styles/mcp-server-picker.css +20 -47
  307. package/dist/styles/media-preview-card.css +160 -0
  308. package/dist/styles/menu.css +11 -40
  309. package/dist/styles/menubar.css +12 -19
  310. package/dist/styles/message-scroller.css +0 -12
  311. package/dist/styles/message.css +25 -31
  312. package/dist/styles/meter.css +2 -2
  313. package/dist/styles/model-selector.css +16 -34
  314. package/dist/styles/motion-reduction.css +29 -0
  315. package/dist/styles/navigation-menu.css +14 -30
  316. package/dist/styles/number-field.css +22 -4
  317. package/dist/styles/plan.css +132 -0
  318. package/dist/styles/popover.css +15 -52
  319. package/dist/styles/preview-card.css +2 -32
  320. package/dist/styles/progress.css +8 -3
  321. package/dist/styles/prompt-input.css +76 -269
  322. package/dist/styles/queue.css +48 -32
  323. package/dist/styles/radio.css +19 -12
  324. package/dist/styles/reasoning.css +2 -1
  325. package/dist/styles/recipes.css +207 -26
  326. package/dist/styles/resizable-side-panel.css +4 -10
  327. package/dist/styles/responsive-sidebar-shell.css +32 -34
  328. package/dist/styles/scroll-area.css +32 -15
  329. package/dist/styles/search-field.css +21 -0
  330. package/dist/styles/select.css +19 -12
  331. package/dist/styles/slider.css +25 -29
  332. package/dist/styles/sources.css +3 -11
  333. package/dist/styles/stepper.css +36 -26
  334. package/dist/styles/subagent-run.css +13 -71
  335. package/dist/styles/switch.css +32 -29
  336. package/dist/styles/tabs.css +79 -23
  337. package/dist/styles/task.css +11 -23
  338. package/dist/styles/test-results.css +29 -36
  339. package/dist/styles/theme-mode-control.css +8 -0
  340. package/dist/styles/think-execution-workbench.css +18 -15
  341. package/dist/styles/think-full-app.css +51 -100
  342. package/dist/styles/think-routine-library.css +51 -40
  343. package/dist/styles/think-thread-picker.css +207 -50
  344. package/dist/styles/toast.css +48 -34
  345. package/dist/styles/toggle-group.css +2 -36
  346. package/dist/styles/toggle.css +29 -5
  347. package/dist/styles/toolbar.css +25 -27
  348. package/dist/styles/tooltip.css +2 -32
  349. package/dist/styles/transition-surface.css +55 -0
  350. package/dist/styles/utilities.css +31 -0
  351. package/dist/styles/web-preview.css +0 -21
  352. package/dist/styles/workspace-explorer.css +104 -99
  353. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  354. package/dist/think-agent-Cip5KAPj.d.ts +7 -0
  355. package/dist/utils/codex-model-catalog.d.ts +4 -4
  356. package/dist/utils/mcp-server-catalog.d.ts +132 -0
  357. package/dist/utils/mcp-server-catalog.js +90 -0
  358. package/dist/utils/structured-code.d.ts +1 -1
  359. package/dist/workspace-path-L_KmjRjq.js +26 -0
  360. package/package.json +14 -9
  361. package/dist/Workspace-D39LxGvP.d.ts +0 -62
  362. package/dist/class-names-9UtZwb0J.js +0 -12
  363. package/dist/components/AppFrame.d.ts +0 -24
  364. package/dist/components/AppFrame.js +0 -25
  365. package/dist/components/Shell.d.ts +0 -163
  366. package/dist/components/Shell.js +0 -137
  367. package/dist/components/SubagentRun.d.ts +0 -86
  368. package/dist/components/SubagentRun.js +0 -108
  369. package/dist/styles/app-frame.css +0 -15
  370. package/dist/styles/shell.css +0 -122
  371. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -1,10 +1,12 @@
1
- import { g as EyeIcon, m as DownloadIcon, o as CheckIcon, q as WarningIcon, u as CodeIcon, w as MaximizeIcon } from "./icons-CpfUer49.js";
2
- import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DIPbXrUM.js";
3
- import { f as MessageResponse, m as createWorkspaceRehypePlugins } from "./Message-BkMdE3bS.js";
4
- import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-BmB4Xaqq.js";
1
+ import { $ as XIcon, O as MaximizeIcon, Z as WarningIcon, _ as DownloadIcon, l as CheckIcon, p as CodeIcon, y as EyeIcon } from "./icons-CQJ-aMnI.js";
2
+ import { t as NavigationLink } from "./navigation-link-Cob7KBlM.js";
3
+ import { buttonVariants } from "./components/Button.js";
4
+ import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-BYYeTQLf.js";
5
+ import { f as MessageResponse, m as createWorkspaceRehypePlugins } from "./Message-BXtmfc9Q.js";
6
+ import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Bfp5PAg3.js";
5
7
  import { AppTopBar } from "./components/AppTopBar.js";
6
- import { WorkspaceHeader } from "./components/WorkspaceHeader.js";
7
8
  import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/WorkspaceFile.js";
9
+ import { WorkspaceHeader } from "./components/WorkspaceHeader.js";
8
10
  import * as React from "react";
9
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
12
  import { defaultRehypePlugins } from "streamdown";
@@ -55,25 +57,14 @@ function resolveLightboxTheme(element) {
55
57
  /** Create component-owned object URLs for bytes and revoke them on replacement. */
56
58
  function useWorkspaceAssetUrl(asset, mimeType) {
57
59
  const [objectUrl, setObjectUrl] = React.useState(null);
58
- const assetTokensRef = React.useRef(/* @__PURE__ */ new WeakMap());
59
- const nextAssetTokenRef = React.useRef(0);
60
- let assetToken = null;
61
- if (asset?.kind === "data") {
62
- assetToken = assetTokensRef.current.get(asset) ?? null;
63
- if (assetToken === null) {
64
- assetToken = nextAssetTokenRef.current + 1;
65
- nextAssetTokenRef.current = assetToken;
66
- assetTokensRef.current.set(asset, assetToken);
67
- }
68
- }
69
60
  React.useEffect(() => {
70
- if (!asset || asset.kind !== "data" || assetToken === null) {
61
+ if (!asset || asset.kind !== "data") {
71
62
  setObjectUrl(null);
72
63
  return;
73
64
  }
74
65
  if (typeof URL === "undefined" || typeof URL.createObjectURL !== "function" || typeof Blob === "undefined") {
75
66
  setObjectUrl({
76
- token: assetToken,
67
+ asset,
77
68
  url: null,
78
69
  downloadUrl: null,
79
70
  error: "This browser cannot prepare a local preview."
@@ -87,7 +78,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
87
78
  url = URL.createObjectURL(previewBlob);
88
79
  downloadUrl = mimeType === SVG_MIME_TYPE ? URL.createObjectURL(new Blob([previewBlob], { type: "application/octet-stream" })) : url;
89
80
  setObjectUrl({
90
- token: assetToken,
81
+ asset,
91
82
  url,
92
83
  downloadUrl,
93
84
  error: null
@@ -96,7 +87,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
96
87
  if (url) URL.revokeObjectURL(url);
97
88
  if (downloadUrl && downloadUrl !== url) URL.revokeObjectURL(downloadUrl);
98
89
  setObjectUrl({
99
- token: assetToken,
90
+ asset,
100
91
  url: null,
101
92
  downloadUrl: null,
102
93
  error: "This file could not be prepared for preview."
@@ -107,11 +98,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
107
98
  if (url) URL.revokeObjectURL(url);
108
99
  if (downloadUrl && downloadUrl !== url) URL.revokeObjectURL(downloadUrl);
109
100
  };
110
- }, [
111
- asset,
112
- assetToken,
113
- mimeType
114
- ]);
101
+ }, [asset, mimeType]);
115
102
  if (!asset) return {
116
103
  url: null,
117
104
  downloadUrl: null,
@@ -125,7 +112,7 @@ function useWorkspaceAssetUrl(asset, mimeType) {
125
112
  error: url ? null : "The host returned an unsupported asset URL."
126
113
  };
127
114
  }
128
- if (assetToken === null || objectUrl?.token !== assetToken) return {
115
+ if (objectUrl?.asset !== asset) return {
129
116
  url: null,
130
117
  downloadUrl: null,
131
118
  error: null
@@ -221,12 +208,6 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
221
208
  const [loadFailed, setLoadFailed] = React.useState(false);
222
209
  const figureRef = React.useRef(null);
223
210
  const [lightboxTheme, setLightboxTheme] = React.useState();
224
- React.useEffect(() => {
225
- setDimensions(null);
226
- setHasLoaded(false);
227
- setLoadFailed(false);
228
- setOpen(false);
229
- }, [url]);
230
211
  const alt = asset.alt?.trim() || fileName;
231
212
  const slide = {
232
213
  src: url,
@@ -259,7 +240,6 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
259
240
  className: "workspace-explorer__image",
260
241
  src: url,
261
242
  alt,
262
- role: "img",
263
243
  width: dimensions?.width,
264
244
  height: dimensions?.height,
265
245
  onLoad: (event) => {
@@ -273,7 +253,7 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
273
253
  onError: () => setLoadFailed(true)
274
254
  })
275
255
  }), /* @__PURE__ */ jsx("div", {
276
- className: "workspace-explorer__visually-hidden",
256
+ className: "workspace-explorer__visually-hidden sigvelo-visually-hidden",
277
257
  role: "status",
278
258
  "aria-live": "polite",
279
259
  "aria-atomic": "true",
@@ -358,11 +338,6 @@ function WorkspaceAudioPreview({ asset, fileName, media, url }) {
358
338
  const [loadFailed, setLoadFailed] = React.useState(false);
359
339
  const tracks = safeTracks(asset.tracks);
360
340
  const transcriptUrl = safeAssetUrl(asset.transcriptUrl);
361
- React.useEffect(() => {
362
- setDuration(null);
363
- setMetadataLoaded(false);
364
- setLoadFailed(false);
365
- }, [url]);
366
341
  return /* @__PURE__ */ jsxs("figure", {
367
342
  className: "workspace-explorer__media-figure workspace-explorer__media-figure--audio",
368
343
  children: [/* @__PURE__ */ jsxs("div", {
@@ -417,12 +392,6 @@ function WorkspaceVideoPreview({ asset, fileName, media, url }) {
417
392
  const tracks = safeTracks(asset.tracks);
418
393
  const posterUrl = safeAssetUrl(asset.posterUrl) ?? void 0;
419
394
  const transcriptUrl = safeAssetUrl(asset.transcriptUrl);
420
- React.useEffect(() => {
421
- setDuration(null);
422
- setDimensions(null);
423
- setMetadataLoaded(false);
424
- setLoadFailed(false);
425
- }, [url]);
426
395
  return /* @__PURE__ */ jsxs("figure", {
427
396
  className: "workspace-explorer__media-figure workspace-explorer__media-figure--video",
428
397
  children: [/* @__PURE__ */ jsxs("div", {
@@ -484,15 +453,16 @@ function WorkspaceMediaPreview(props) {
484
453
  const { onScroll } = props;
485
454
  return /* @__PURE__ */ jsxs("div", {
486
455
  className: "workspace-explorer__media-scroll",
456
+ "data-workspace-file-content": "",
487
457
  "data-workspace-focus-target": "",
488
458
  "data-workspace-scroll": "",
489
459
  onScroll,
490
460
  tabIndex: -1,
491
461
  children: [
492
- props.media.kind === "image" ? /* @__PURE__ */ jsx(WorkspaceImagePreview, { ...props }) : null,
462
+ props.media.kind === "image" ? /* @__PURE__ */ jsx(WorkspaceImagePreview, { ...props }, props.url) : null,
493
463
  props.media.kind === "pdf" ? /* @__PURE__ */ jsx(WorkspacePdfPreview, { ...props }) : null,
494
- props.media.kind === "audio" ? /* @__PURE__ */ jsx(WorkspaceAudioPreview, { ...props }) : null,
495
- props.media.kind === "video" ? /* @__PURE__ */ jsx(WorkspaceVideoPreview, { ...props }) : null
464
+ props.media.kind === "audio" ? /* @__PURE__ */ jsx(WorkspaceAudioPreview, { ...props }, props.url) : null,
465
+ props.media.kind === "video" ? /* @__PURE__ */ jsx(WorkspaceVideoPreview, { ...props }, props.url) : null
496
466
  ]
497
467
  });
498
468
  }
@@ -513,9 +483,13 @@ function createWorkspaceHeading(tag, prefix) {
513
483
  });
514
484
  };
515
485
  }
516
- /** Full-boundary workspace file preview composed from CodeBlock and AppTopBar. */
517
- function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actions, onRefresh }) {
518
- const [markdownView, setMarkdownView] = React.useState("preview");
486
+ /** Workspace file preview composed from CodeBlock and AppTopBar. */
487
+ function WorkspaceFileView({ appearance = "contained", file, path, isLoading, isRefreshing, leading, actions, showSkillIdentity = true, onRefresh }) {
488
+ const [markdownViewState, setMarkdownViewState] = React.useState(() => ({
489
+ path,
490
+ view: "preview"
491
+ }));
492
+ const markdownView = markdownViewState.path === path ? markdownViewState.view : "preview";
519
493
  const isMarkdown = isWorkspaceMarkdownPath(path);
520
494
  const workspaceNavigation = useWorkspaceNavigationContext();
521
495
  const restoration = useWorkspaceNavigationRestoration();
@@ -527,11 +501,7 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
527
501
  const scrollRef = React.useRef(null);
528
502
  const handledFocusRequestRef = React.useRef(null);
529
503
  const headingPrefix = React.useId().replaceAll(":", "");
530
- const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [
531
- workspaceNavigation?.base.kind,
532
- workspaceNavigation?.base.path,
533
- workspaceNavigation?.root
534
- ]);
504
+ const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [workspaceNavigation]);
535
505
  const media = inferWorkspaceMedia(path, file?.asset?.mimeType ?? file?.info?.mimeType);
536
506
  const assetUrl = useWorkspaceAssetUrl(file?.asset, media?.mimeType ?? "application/octet-stream");
537
507
  const isPreparingAsset = Boolean(file?.asset && !assetUrl.url && !assetUrl.error);
@@ -546,9 +516,6 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
546
516
  h5: createWorkspaceHeading("h5", headingPrefix),
547
517
  h6: createWorkspaceHeading("h6", headingPrefix)
548
518
  }), [headingPrefix]);
549
- React.useEffect(() => {
550
- setMarkdownView("preview");
551
- }, [path]);
552
519
  React.useEffect(() => {
553
520
  if (!entryKey || isLoading || isPreparingAsset || !file) return;
554
521
  const focusRequest = JSON.stringify([
@@ -594,6 +561,19 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
594
561
  downloadUrl: assetUrl.downloadUrl,
595
562
  allowOpen: media?.mimeType !== "image/svg+xml"
596
563
  }) : null;
564
+ const closeAction = workspaceNavigation ? /* @__PURE__ */ jsx(NavigationLink, {
565
+ "aria-label": "Close file",
566
+ className: buttonVariants({
567
+ color: "neutral",
568
+ variant: "ghost",
569
+ size: "sm",
570
+ className: "workspace-explorer__file-close"
571
+ }),
572
+ "data-icon-only": "",
573
+ "data-slot": "button",
574
+ render: workspaceNavigation.navigation.renderLink({ kind: "files" }),
575
+ children: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
576
+ }) : null;
597
577
  const headerProps = {
598
578
  path,
599
579
  leading,
@@ -601,21 +581,15 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
601
581
  actions,
602
582
  assetActions,
603
583
  /* @__PURE__ */ jsx(AppTopBar.Button, {
604
- label: "Preview Markdown",
605
- "aria-pressed": markdownView === "preview",
606
- onClick: () => setMarkdownView("preview"),
607
- children: /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
608
- }),
609
- /* @__PURE__ */ jsx(AppTopBar.Button, {
610
- label: "View Markdown source",
611
- "aria-pressed": markdownView === "source",
612
- onClick: () => setMarkdownView("source"),
613
- children: /* @__PURE__ */ jsx(CodeIcon, { "aria-hidden": "true" })
584
+ label: markdownView === "preview" ? "View Markdown source" : "Preview Markdown",
585
+ onClick: () => setMarkdownViewState({
586
+ path,
587
+ view: markdownView === "preview" ? "source" : "preview"
588
+ }),
589
+ children: markdownView === "preview" ? /* @__PURE__ */ jsx(CodeIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
614
590
  })
615
591
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [actions, assetActions] }),
616
592
  isRefreshing,
617
- onBack: workspaceNavigation?.navigation.canGoBack ? () => workspaceNavigation.navigation.goBack() : void 0,
618
- onForward: workspaceNavigation?.navigation.canGoForward ? () => workspaceNavigation.navigation.goForward() : void 0,
619
593
  onRefresh
620
594
  };
621
595
  if (isLoading || !file || file.error || assetUrl.error || isPreparingAsset || file.asset && !media || !file.asset && (file.content === null || file.content.length === 0)) {
@@ -636,27 +610,38 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
636
610
  return /* @__PURE__ */ jsxs("div", {
637
611
  ref: fileViewRef,
638
612
  className: "workspace-explorer__file",
613
+ "data-appearance": appearance,
639
614
  "data-workspace-restoration-scope": "file",
640
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
641
- className: "workspace-explorer__empty",
642
- "data-workspace-focus-target": "",
643
- role,
644
- children: message
645
- })]
615
+ children: [
616
+ /* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
617
+ closeAction,
618
+ /* @__PURE__ */ jsx("div", {
619
+ className: "workspace-explorer__empty",
620
+ "data-workspace-file-content": "",
621
+ "data-workspace-focus-target": "",
622
+ role,
623
+ children: message
624
+ })
625
+ ]
646
626
  });
647
627
  }
648
628
  if (file.asset && media && assetUrl.url) return /* @__PURE__ */ jsxs("div", {
649
629
  ref: fileViewRef,
650
630
  className: "workspace-explorer__file",
631
+ "data-appearance": appearance,
651
632
  "data-workspace-restoration-scope": "file",
652
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx(WorkspaceMediaPreview, {
653
- asset: file.asset,
654
- fileName: file.name,
655
- media,
656
- url: assetUrl.url,
657
- downloadUrl: assetUrl.downloadUrl,
658
- onScroll: handleScroll
659
- })]
633
+ children: [
634
+ /* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
635
+ closeAction,
636
+ /* @__PURE__ */ jsx(WorkspaceMediaPreview, {
637
+ asset: file.asset,
638
+ fileName: file.name,
639
+ media,
640
+ url: assetUrl.url,
641
+ downloadUrl: assetUrl.downloadUrl,
642
+ onScroll: handleScroll
643
+ })
644
+ ]
660
645
  });
661
646
  if (file.content === null) return null;
662
647
  if (isMarkdown && markdownView === "preview") {
@@ -671,64 +656,72 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
671
656
  return /* @__PURE__ */ jsxs("div", {
672
657
  ref: fileViewRef,
673
658
  className: "workspace-explorer__file",
659
+ "data-appearance": appearance,
674
660
  "data-workspace-restoration-scope": "file",
675
- children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
676
- ref: scrollRef,
677
- className: "workspace-explorer__markdown-scroll",
678
- "data-workspace-scroll": "",
679
- onScroll: handleScroll,
680
- children: /* @__PURE__ */ jsxs("article", {
681
- className: "workspace-explorer__markdown",
682
- children: [skill ? /* @__PURE__ */ jsxs("header", {
683
- className: "workspace-explorer__skill",
684
- children: [
685
- /* @__PURE__ */ jsx("div", {
686
- className: "workspace-explorer__skill-kicker",
687
- children: "Agent Skill"
688
- }),
689
- skill.parsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
690
- /* @__PURE__ */ jsx("p", {
691
- className: "workspace-explorer__skill-name",
692
- children: skill.parsed.properties.name
693
- }),
694
- /* @__PURE__ */ jsx("p", {
695
- className: "workspace-explorer__skill-description",
696
- children: skill.parsed.properties.description
661
+ children: [
662
+ /* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }),
663
+ closeAction,
664
+ /* @__PURE__ */ jsx("div", {
665
+ ref: scrollRef,
666
+ className: "workspace-explorer__markdown-scroll",
667
+ "data-workspace-file-content": "",
668
+ "data-workspace-scroll": "",
669
+ onScroll: handleScroll,
670
+ children: /* @__PURE__ */ jsxs("article", {
671
+ className: "workspace-explorer__markdown",
672
+ children: [skill ? /* @__PURE__ */ jsxs("header", {
673
+ className: "workspace-explorer__skill",
674
+ "data-skill-identity": showSkillIdentity ? "" : void 0,
675
+ children: [
676
+ showSkillIdentity ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
677
+ className: "workspace-explorer__skill-kicker",
678
+ children: "Agent Skill"
679
+ }), skill.parsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
680
+ /* @__PURE__ */ jsx("p", {
681
+ className: "workspace-explorer__skill-name",
682
+ children: skill.parsed.properties.name
683
+ }),
684
+ /* @__PURE__ */ jsx("p", {
685
+ className: "workspace-explorer__skill-description",
686
+ children: skill.parsed.properties.description
687
+ }),
688
+ /* @__PURE__ */ jsxs("dl", {
689
+ className: "workspace-explorer__skill-metadata",
690
+ children: [skill.parsed.properties.compatibility ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Compatibility" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.compatibility })] }) : null, skill.parsed.properties.allowedTools ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Allowed tools" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.allowedTools })] }) : null]
691
+ })
692
+ ] }) : null] }) : null,
693
+ /* @__PURE__ */ jsxs("div", {
694
+ className: "workspace-explorer__skill-status",
695
+ "data-invalid": skill.validationErrors.length > 0 ? "" : void 0,
696
+ children: [skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), skill.validationErrors.length > 0 ? `${skill.validationErrors.length.toLocaleString()} validation ${skill.validationErrors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
697
697
  }),
698
- /* @__PURE__ */ jsxs("dl", {
699
- className: "workspace-explorer__skill-metadata",
700
- children: [skill.parsed.properties.compatibility ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Compatibility" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.compatibility })] }) : null, skill.parsed.properties.allowedTools ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Allowed tools" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.allowedTools })] }) : null]
701
- })
702
- ] }) : null,
703
- /* @__PURE__ */ jsxs("div", {
704
- className: "workspace-explorer__skill-status",
705
- "data-invalid": skill.validationErrors.length > 0 ? "" : void 0,
706
- children: [skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), skill.validationErrors.length > 0 ? `${skill.validationErrors.length.toLocaleString()} validation ${skill.validationErrors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
707
- }),
708
- skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx("ul", {
709
- className: "workspace-explorer__skill-errors",
710
- children: skill.validationErrors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
711
- }) : null
712
- ]
713
- }) : null, response]
698
+ skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx("ul", {
699
+ className: "workspace-explorer__skill-errors",
700
+ children: skill.validationErrors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
701
+ }) : null
702
+ ]
703
+ }) : null, response]
704
+ })
714
705
  })
715
- })]
706
+ ]
716
707
  });
717
708
  }
718
- return /* @__PURE__ */ jsx("div", {
709
+ return /* @__PURE__ */ jsxs("div", {
719
710
  ref: fileViewRef,
720
711
  className: "workspace-explorer__file",
712
+ "data-appearance": appearance,
721
713
  "data-workspace-restoration-scope": "file",
722
- children: /* @__PURE__ */ jsxs(CodeBlock, {
714
+ children: [closeAction, /* @__PURE__ */ jsxs(CodeBlock, {
723
715
  className: "workspace-explorer__code",
724
716
  code: file.content,
717
+ "data-workspace-file-content": "",
725
718
  "data-workspace-focus-target": "",
726
719
  language: inferWorkspaceLanguage(file.path),
727
720
  showLineNumbers: true,
728
721
  children: [/* @__PURE__ */ jsx(WorkspaceHeader, {
729
722
  ...headerProps,
730
723
  copyAction: /* @__PURE__ */ jsx(CodeBlockCopyButton, {
731
- size: "icon-sm",
724
+ size: "sm",
732
725
  nativeButton: true,
733
726
  render: /* @__PURE__ */ jsx(AppTopBar.Control, {})
734
727
  })
@@ -737,7 +730,7 @@ function WorkspaceFileView({ file, path, isLoading, isRefreshing, leading, actio
737
730
  onScroll: handleScroll,
738
731
  children: /* @__PURE__ */ jsx(CodeBlockContent, {})
739
732
  })]
740
- })
733
+ })]
741
734
  });
742
735
  }
743
736
  //#endregion
@@ -1,4 +1,6 @@
1
- import { t as cx } from "./class-names-9UtZwb0J.js";
1
+ import { t as cx } from "./class-names-BiMDVpUo.js";
2
+ import { t as NavigationLink } from "./navigation-link-Cob7KBlM.js";
3
+ import { n as isWorkspacePathWithinRoot, t as canonicalizeAbsoluteWorkspacePath } from "./workspace-path-L_KmjRjq.js";
2
4
  import * as React from "react";
3
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
6
  //#region src/components/_internal/workspace-navigation-context.tsx
@@ -92,7 +94,6 @@ function useRequiredWorkspaceNavigationRestoration() {
92
94
  }
93
95
  //#endregion
94
96
  //#region src/components/WorkspaceLink.tsx
95
- const WORKSPACE_URL_ORIGIN = "https://workspace.invalid";
96
97
  const EXTERNAL_PROTOCOLS = /* @__PURE__ */ new Set([
97
98
  "http:",
98
99
  "https:",
@@ -120,24 +121,9 @@ function decodeUrlPart(value) {
120
121
  return null;
121
122
  }
122
123
  }
123
- function canonicalizeAbsolutePath(path) {
124
- if (!path.startsWith("/") || hasInvalidPathCharacter(path)) return null;
125
- const segments = [];
126
- for (const segment of path.split("/")) {
127
- if (!segment || segment === ".") continue;
128
- if (segment === "..") segments.pop();
129
- else segments.push(segment);
130
- }
131
- return `/${segments.join("/")}`;
132
- }
133
- function normalizeRoot(root) {
134
- if (!root || hasInvalidPathCharacter(root)) return null;
135
- const pathname = canonicalizeAbsolutePath(root);
136
- if (!pathname) return null;
137
- return pathname === "/" ? pathname : pathname.replace(/\/+$/, "");
138
- }
139
- function isWithinRoot(path, root) {
140
- return root === "/" || path === root || path.startsWith(`${root}/`);
124
+ function canonicalizeWorkspaceLinkPath(path) {
125
+ if (hasInvalidPathCharacter(path)) return null;
126
+ return canonicalizeAbsoluteWorkspacePath(path);
141
127
  }
142
128
  function getPathSegments(path) {
143
129
  return path === "/" ? [] : path.slice(1).split("/");
@@ -188,10 +174,10 @@ function getExternalDestination(href) {
188
174
  }
189
175
  /** Resolve a Markdown link to a validated workspace file, external URL, or unavailable target. */
190
176
  function resolveWorkspaceLink({ href, root, base }) {
191
- const normalizedRoot = normalizeRoot(root);
192
- const normalizedBase = canonicalizeAbsolutePath(base.path);
177
+ const normalizedRoot = canonicalizeWorkspaceLinkPath(root);
178
+ const normalizedBase = canonicalizeWorkspaceLinkPath(base.path);
193
179
  const trimmedHref = href.trim();
194
- if (!normalizedRoot || !normalizedBase || !isWithinRoot(normalizedBase, normalizedRoot) || !trimmedHref || hasInvalidPathCharacter(href)) return invalid(href, "invalid-path");
180
+ if (!normalizedRoot || !normalizedBase || !isWorkspacePathWithinRoot(normalizedBase, normalizedRoot) || !trimmedHref || hasInvalidPathCharacter(href)) return invalid(href, "invalid-path");
195
181
  if (trimmedHref.startsWith("//")) return getExternalDestination(trimmedHref);
196
182
  if (URL_SCHEME.test(trimmedHref)) return getExternalDestination(trimmedHref);
197
183
  if (trimmedHref.startsWith("#") && base.kind === "directory") return invalid(href, "fragment-without-file");
@@ -204,26 +190,13 @@ function resolveWorkspaceLink({ href, root, base }) {
204
190
  if (rawFragment !== null && rawFragment !== "" && fragment === null || fragment !== null && hasInvalidPathCharacter(fragment)) return invalid(href, "invalid-path");
205
191
  const localPath = resolveLocalPath(rawPath, normalizedRoot, base, normalizedBase);
206
192
  if ("reason" in localPath) return invalid(href, localPath.reason);
207
- if (!isWithinRoot(localPath.path, normalizedRoot)) return invalid(href, "outside-workspace");
193
+ if (!isWorkspacePathWithinRoot(localPath.path, normalizedRoot)) return invalid(href, "outside-workspace");
208
194
  return {
209
195
  kind: "file",
210
196
  path: localPath.path,
211
197
  fragment
212
198
  };
213
199
  }
214
- function getAdapterHref(navigation, destination) {
215
- try {
216
- const rawHref = navigation.createHref(destination);
217
- if (hasInvalidPathCharacter(rawHref)) return null;
218
- const href = rawHref.trim();
219
- if (!href) return null;
220
- const protocol = new URL(href, WORKSPACE_URL_ORIGIN).protocol.toLowerCase();
221
- if (UNSAFE_PROTOCOLS.has(protocol)) return null;
222
- return href;
223
- } catch {
224
- return null;
225
- }
226
- }
227
200
  function WorkspaceNavigationProvider({ children, root, base, navigation }) {
228
201
  return /* @__PURE__ */ jsx(WorkspaceNavigationContext, {
229
202
  value: React.useMemo(() => ({
@@ -231,8 +204,7 @@ function WorkspaceNavigationProvider({ children, root, base, navigation }) {
231
204
  base,
232
205
  navigation
233
206
  }), [
234
- base.kind,
235
- base.path,
207
+ base,
236
208
  navigation,
237
209
  root
238
210
  ]),
@@ -250,9 +222,9 @@ function UnavailableWorkspaceLink({ children, className }) {
250
222
  "aria-hidden": "true",
251
223
  children: "↛"
252
224
  }),
253
- /* @__PURE__ */ jsx("span", {
254
- className: "workspace-link__visually-hidden",
255
- children: " (link unavailable)"
225
+ /* @__PURE__ */ jsxs("span", {
226
+ className: "workspace-link__visually-hidden sigvelo-visually-hidden",
227
+ children: [" ", "(link unavailable)"]
256
228
  })
257
229
  ]
258
230
  });
@@ -298,34 +270,27 @@ function WorkspaceFileLink({ children, className, download, href = "", node: _no
298
270
  className: "workspace-link__external-mark",
299
271
  "aria-hidden": "true",
300
272
  children: "↗"
301
- }), /* @__PURE__ */ jsx("span", {
302
- className: "workspace-link__visually-hidden",
303
- children: " (opens in a new tab)"
273
+ }), /* @__PURE__ */ jsxs("span", {
274
+ className: "workspace-link__visually-hidden sigvelo-visually-hidden",
275
+ children: [" ", "(opens in a new tab)"]
304
276
  })] }) : null]
305
277
  });
306
278
  }
307
- const adapterHref = getAdapterHref(workspace.navigation, resolved);
308
- if (!adapterHref) return /* @__PURE__ */ jsx(UnavailableWorkspaceLink, {
309
- className,
310
- children
311
- });
312
279
  const handleClick = (event) => {
313
280
  onClick?.(event);
314
281
  const actualTarget = event.currentTarget.target.toLowerCase();
315
- if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.hasAttribute("download") || actualTarget !== "" && actualTarget !== "_self") return;
316
- event.preventDefault();
282
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.currentTarget.hasAttribute("download") || actualTarget !== "" && actualTarget !== "_self") return;
317
283
  const focusScope = event.currentTarget.closest("[data-workspace-restoration-scope]")?.dataset.workspaceRestorationScope;
318
284
  restoration?.recordFocus(workspace.navigation.current.key, resolved, focusScope);
319
- workspace.navigation.navigate(resolved);
320
285
  };
321
- return /* @__PURE__ */ jsx("a", {
286
+ return /* @__PURE__ */ jsx(NavigationLink, {
287
+ render: workspace.navigation.renderLink(resolved),
322
288
  className: cx("workspace-link workspace-link--file", className),
323
289
  "data-streamdown": "link",
324
290
  "data-workspace-link": "file",
325
291
  "data-workspace-destination-fragment": resolved.fragment ?? "",
326
292
  "data-workspace-path": resolved.path,
327
293
  download,
328
- href: adapterHref,
329
294
  onClick: handleClick,
330
295
  rel,
331
296
  target,
@@ -14,14 +14,11 @@ interface WorkspaceNavigationEntry {
14
14
  }
15
15
  interface WorkspaceNavigationAdapter {
16
16
  current: WorkspaceNavigationEntry;
17
- createHref(destination: WorkspaceDestination): string;
18
- navigate(destination: WorkspaceDestination, options?: {
19
- replace?: boolean;
20
- }): void;
21
- canGoBack: boolean;
22
- canGoForward: boolean;
23
- goBack(): void;
24
- goForward(): void;
17
+ /**
18
+ * Returns an application-owned anchor or router Link for this destination.
19
+ * The workspace merges its semantics and event handlers into this element.
20
+ */
21
+ renderLink(destination: WorkspaceDestination): React.ReactElement;
25
22
  }
26
23
  type WorkspaceLinkBase = {
27
24
  kind: "directory";
@@ -37,7 +34,7 @@ interface WorkspaceExternalDestination {
37
34
  interface WorkspaceInvalidDestination {
38
35
  kind: "invalid";
39
36
  href: string;
40
- reason: "fragment-without-file" | "invalid-adapter-href" | "invalid-path" | "outside-workspace" | "unsafe-protocol" | "unsupported-query";
37
+ reason: "fragment-without-file" | "invalid-path" | "outside-workspace" | "unsafe-protocol" | "unsupported-query";
41
38
  }
42
39
  type WorkspaceLinkResolution = Extract<WorkspaceDestination, {
43
40
  kind: "file";
@@ -0,0 +1,14 @@
1
+ //#region src/components/_internal/class-names.ts
2
+ function cx(...parts) {
3
+ if (parts.some((part) => typeof part === "function")) return (state) => parts.flatMap((part) => {
4
+ const value = typeof part === "function" ? part(state) : part;
5
+ return value ? [value] : [];
6
+ }).join(" ");
7
+ return parts.filter(Boolean).join(" ");
8
+ }
9
+ function mergeBaseClassName(stableClassName, className) {
10
+ if (typeof className === "function") return (state) => cx(stableClassName, className(state));
11
+ return cx(stableClassName, className);
12
+ }
13
+ //#endregion
14
+ export { mergeBaseClassName as n, cx as t };
@@ -2,21 +2,11 @@ import * as React from "react";
2
2
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
3
3
 
4
4
  //#region src/components/Accordion.d.ts
5
- interface AccordionProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Root>, "className"> {
6
- className?: string;
7
- }
8
- interface AccordionItemProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Item>, "className"> {
9
- className?: string;
10
- }
11
- interface AccordionTriggerProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Trigger>, "className"> {
12
- className?: string;
13
- }
14
- interface AccordionHeaderProps extends Omit<Accordion$1.Header.Props, "className"> {
15
- className?: string;
16
- }
17
- interface AccordionPanelProps extends Omit<React.ComponentPropsWithRef<typeof Accordion$1.Panel>, "className"> {
18
- className?: string;
19
- }
5
+ interface AccordionProps extends React.ComponentPropsWithRef<typeof Accordion$1.Root> {}
6
+ interface AccordionItemProps extends React.ComponentPropsWithRef<typeof Accordion$1.Item> {}
7
+ interface AccordionTriggerProps extends React.ComponentPropsWithRef<typeof Accordion$1.Trigger> {}
8
+ interface AccordionHeaderProps extends Accordion$1.Header.Props {}
9
+ interface AccordionPanelProps extends React.ComponentPropsWithRef<typeof Accordion$1.Panel> {}
20
10
  /**
21
11
  * An accordion component for showing collapsible content sections.
22
12
  *