@mcp-b/react-components 0.17.0 → 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 (292) hide show
  1. package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
  2. package/dist/{AgentChat-CRuMi1Pb.d.ts → AgentChat-ClxViuUM.d.ts} +1 -20
  3. package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
  4. package/dist/{CodeBlock-Co1noLbC.js → CodeBlock-Bfp5PAg3.js} +9 -6
  5. package/dist/{CodeBlock-Dnpr88ZQ.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
  6. package/dist/{FileTree-B7bBsUyU.js → FileTree-3zYtrddG.js} +42 -16
  7. package/dist/{Message-C4eYRogZ.js → Message-BXtmfc9Q.js} +13 -20
  8. package/dist/{ModelSelector-BNrZlY_Y.js → ModelSelector-Cqw_qrUG.js} +15 -22
  9. package/dist/{PromptInput-OLfXPuHM.d.ts → PromptInput-Bdh9pqlo.d.ts} +4 -6
  10. package/dist/{Select-CwSqP07Y.d.ts → Select-B_13gg_J.d.ts} +2 -2
  11. package/dist/{Tabs-9zddXDQo.d.ts → Tabs-ColWK-XA.d.ts} +10 -2
  12. package/dist/{ThinkChat-DInElus-.js → ThinkChat-15EhfvYJ.js} +84 -61
  13. package/dist/{ThinkChatActivity-BgesTfZ4.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +4 -7
  14. package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
  15. package/dist/{Toggle-DaXpe1Lc.d.ts → Toggle-JKZ43D5S.d.ts} +1 -1
  16. package/dist/{ToggleGroup-yseEWkOC.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +2 -2
  17. package/dist/Workspace-Jez8ffUj.d.ts +274 -0
  18. package/dist/{WorkspaceExplorer-sZewzT2O.d.ts → WorkspaceExplorer-B9dQWNVK.d.ts} +2 -2
  19. package/dist/{WorkspaceFile-C8UzuSH4.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
  20. package/dist/{WorkspaceFileView-DNdGAEiX.js → WorkspaceFileView-C68Ub8S8.js} +120 -127
  21. package/dist/{WorkspaceLink-B1ykV1dS.js → WorkspaceLink-BYYeTQLf.js} +6 -27
  22. package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
  23. package/dist/{class-names-Bk-QLWWI.js → class-names-BiMDVpUo.js} +4 -1
  24. package/dist/components/Accordion.js +7 -2
  25. package/dist/components/Activity.js +2 -2
  26. package/dist/components/AgentActivity.d.ts +1 -1
  27. package/dist/components/AgentActivity.js +4 -5
  28. package/dist/components/AgentActivityPreview.d.ts +9 -9
  29. package/dist/components/AgentActivityPreview.js +8 -12
  30. package/dist/components/AgentAttention.d.ts +1 -1
  31. package/dist/components/AgentAttention.js +1 -1
  32. package/dist/components/AgentChat.d.ts +1 -1
  33. package/dist/components/AgentChat.js +94 -62
  34. package/dist/components/AgentChatMessageEditor.js +2 -2
  35. package/dist/components/AgentChatTurnError.js +2 -2
  36. package/dist/components/AgentConnection.js +3 -3
  37. package/dist/components/AgentMessageParts.js +1 -1
  38. package/dist/components/AgentToolDetail.d.ts +6 -4
  39. package/dist/components/AgentToolDetail.js +12 -10
  40. package/dist/components/AlertDialog.js +1 -1
  41. package/dist/components/AppTopBar.d.ts +24 -7
  42. package/dist/components/AppTopBar.js +32 -8
  43. package/dist/components/Approval.js +4 -4
  44. package/dist/components/Artifact.d.ts +1 -1
  45. package/dist/components/Artifact.js +6 -4
  46. package/dist/components/Autocomplete.js +1 -1
  47. package/dist/components/Avatar.d.ts +1 -1
  48. package/dist/components/Avatar.js +2 -2
  49. package/dist/components/Badge.js +3 -0
  50. package/dist/components/BrowserLiveView.js +27 -12
  51. package/dist/components/BrowserReplay.js +4 -3
  52. package/dist/components/BrowserRunPanel.js +5 -5
  53. package/dist/components/Button.d.ts +1 -1
  54. package/dist/components/Button.js +14 -11
  55. package/dist/components/Card.d.ts +7 -8
  56. package/dist/components/Card.js +19 -10
  57. package/dist/components/ChainOfThought.d.ts +1 -1
  58. package/dist/components/ChainOfThought.js +2 -2
  59. package/dist/components/ChatGptSignInScreen.js +8 -8
  60. package/dist/components/Checkbox.js +2 -2
  61. package/dist/components/CheckboxGroup.js +1 -1
  62. package/dist/components/Checkpoint.js +2 -2
  63. package/dist/components/CodeBlock.d.ts +1 -1
  64. package/dist/components/CodeBlock.js +1 -1
  65. package/dist/components/CodexModelSelector.js +2 -2
  66. package/dist/components/Collapsible.js +2 -2
  67. package/dist/components/Combobox.js +1 -1
  68. package/dist/components/Commit.d.ts +1 -1
  69. package/dist/components/Commit.js +3 -3
  70. package/dist/components/Context.js +1 -1
  71. package/dist/components/ContextMenu.js +2 -2
  72. package/dist/components/Conversation.d.ts +1 -1
  73. package/dist/components/Conversation.js +5 -4
  74. package/dist/components/DescriptionListParts.js +1 -1
  75. package/dist/components/Dialog.js +1 -1
  76. package/dist/components/EnvironmentVariables.d.ts +1 -1
  77. package/dist/components/EnvironmentVariables.js +3 -3
  78. package/dist/components/Field.js +5 -2
  79. package/dist/components/Fieldset.js +1 -1
  80. package/dist/components/FileTree.d.ts +6 -0
  81. package/dist/components/FileTree.js +1 -1
  82. package/dist/components/Form.js +1 -1
  83. package/dist/components/GithubMotionMark.js +1 -1
  84. package/dist/components/IconButton.d.ts +2 -3
  85. package/dist/components/IconButton.js +2 -1
  86. package/dist/components/InlineCitation.js +1 -1
  87. package/dist/components/Input.js +1 -1
  88. package/dist/components/Marker.js +1 -1
  89. package/dist/components/McpConnectionRequest.js +2 -2
  90. package/dist/components/McpServerPicker.js +2 -2
  91. package/dist/components/MediaPreviewCard.d.ts +103 -0
  92. package/dist/components/MediaPreviewCard.js +193 -0
  93. package/dist/components/Menu.js +1 -1
  94. package/dist/components/Menubar.js +2 -2
  95. package/dist/components/Message.d.ts +4 -1
  96. package/dist/components/Message.js +1 -1
  97. package/dist/components/MessageScroller.d.ts +1 -1
  98. package/dist/components/MessageScroller.js +5 -4
  99. package/dist/components/Meter.js +1 -1
  100. package/dist/components/ModelSelector.d.ts +4 -3
  101. package/dist/components/ModelSelector.js +1 -1
  102. package/dist/components/NavigationMenu.js +1 -1
  103. package/dist/components/NumberField.js +1 -1
  104. package/dist/components/Plan.js +2 -2
  105. package/dist/components/Popover.js +1 -1
  106. package/dist/components/PreviewCard.js +1 -1
  107. package/dist/components/PricingBillingToggle.js +1 -1
  108. package/dist/components/PricingFAQ.js +1 -1
  109. package/dist/components/PricingPage.js +2 -1
  110. package/dist/components/PricingPlanCard.js +4 -3
  111. package/dist/components/PricingUsageCalculator.js +2 -2
  112. package/dist/components/Progress.js +1 -1
  113. package/dist/components/PromptInput.d.ts +1 -1
  114. package/dist/components/PromptInput.js +33 -20
  115. package/dist/components/Queue.d.ts +1 -1
  116. package/dist/components/Queue.js +2 -3
  117. package/dist/components/RadioGroup.js +1 -1
  118. package/dist/components/Reasoning.js +3 -6
  119. package/dist/components/ResizableSidePanel.js +1 -1
  120. package/dist/components/ResponsiveSidebarShell.js +16 -10
  121. package/dist/components/ScrollArea.js +2 -1
  122. package/dist/components/SearchField.d.ts +43 -0
  123. package/dist/components/SearchField.js +52 -0
  124. package/dist/components/Select.d.ts +1 -1
  125. package/dist/components/Select.js +5 -6
  126. package/dist/components/Separator.js +1 -1
  127. package/dist/components/Slider.js +1 -1
  128. package/dist/components/Sources.js +2 -2
  129. package/dist/components/Stepper.js +16 -9
  130. package/dist/components/SubagentRunDetails.js +1 -1
  131. package/dist/components/SubagentRunIndicator.js +2 -2
  132. package/dist/components/SubagentRunList.d.ts +3 -5
  133. package/dist/components/SubagentRunList.js +3 -4
  134. package/dist/components/SubagentRunSelector.d.ts +8 -12
  135. package/dist/components/SubagentRunSelector.js +17 -20
  136. package/dist/components/Switch.d.ts +2 -2
  137. package/dist/components/Switch.js +4 -5
  138. package/dist/components/Tabs.d.ts +2 -2
  139. package/dist/components/Tabs.js +12 -3
  140. package/dist/components/Task.js +2 -2
  141. package/dist/components/Terminal.d.ts +2 -2
  142. package/dist/components/Terminal.js +5 -4
  143. package/dist/components/TestResults.js +10 -6
  144. package/dist/components/Textarea.js +1 -1
  145. package/dist/components/ThemeModeControl.js +1 -1
  146. package/dist/components/ThinkChat.d.ts +33 -20
  147. package/dist/components/ThinkChat.js +4 -4
  148. package/dist/components/ThinkChatActivity.d.ts +2 -2
  149. package/dist/components/ThinkChatActivity.js +8 -10
  150. package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
  151. package/dist/components/ThinkChatActivitySummary.js +7 -3
  152. package/dist/components/ThinkChatToolPanels.js +26 -16
  153. package/dist/components/ThinkExecutionDetail.js +2 -2
  154. package/dist/components/ThinkExecutionStatus.js +2 -2
  155. package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
  156. package/dist/components/ThinkExecutionWorkbench.js +70 -134
  157. package/dist/components/ThinkFullApp.d.ts +36 -35
  158. package/dist/components/ThinkFullApp.js +156 -109
  159. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  160. package/dist/components/ThinkFullAppViewSwitch.js +1 -1
  161. package/dist/components/ThinkRecoveryNotice.js +18 -12
  162. package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
  163. package/dist/components/ThinkRoutineBrowser.js +33 -40
  164. package/dist/components/ThinkRoutineDetail.d.ts +5 -2
  165. package/dist/components/ThinkRoutineDetail.js +4 -4
  166. package/dist/components/ThinkRoutineForm.d.ts +3 -2
  167. package/dist/components/ThinkRoutineForm.js +11 -10
  168. package/dist/components/ThinkRoutineLibrary.d.ts +24 -31
  169. package/dist/components/ThinkRoutineLibrary.js +57 -80
  170. package/dist/components/ThinkRoutineRuns.d.ts +3 -2
  171. package/dist/components/ThinkRoutineRuns.js +31 -24
  172. package/dist/components/ThinkThreadPicker.d.ts +17 -11
  173. package/dist/components/ThinkThreadPicker.js +163 -39
  174. package/dist/components/Toast.js +1 -1
  175. package/dist/components/Toggle.d.ts +1 -1
  176. package/dist/components/Toggle.js +9 -7
  177. package/dist/components/ToggleGroup.d.ts +1 -1
  178. package/dist/components/ToggleGroup.js +15 -13
  179. package/dist/components/ToolInvocation.js +1 -1
  180. package/dist/components/Toolbar.js +1 -1
  181. package/dist/components/Tooltip.d.ts +8 -1
  182. package/dist/components/Tooltip.js +11 -2
  183. package/dist/components/TransitionSurface.d.ts +27 -0
  184. package/dist/components/TransitionSurface.js +20 -0
  185. package/dist/components/WebPreview.d.ts +5 -5
  186. package/dist/components/WebPreview.js +68 -54
  187. package/dist/components/Workspace.d.ts +2 -2
  188. package/dist/components/Workspace.js +358 -328
  189. package/dist/components/WorkspaceBrowser.d.ts +4 -7
  190. package/dist/components/WorkspaceBrowser.js +15 -25
  191. package/dist/components/WorkspaceExplorer.d.ts +5 -5
  192. package/dist/components/WorkspaceExplorer.js +19 -32
  193. package/dist/components/WorkspaceFile.d.ts +1 -1
  194. package/dist/components/WorkspaceFileView.d.ts +14 -2
  195. package/dist/components/WorkspaceFileView.js +1 -1
  196. package/dist/components/WorkspaceHeader.d.ts +0 -8
  197. package/dist/components/WorkspaceHeader.js +3 -15
  198. package/dist/components/WorkspaceLink.d.ts +1 -1
  199. package/dist/components/WorkspaceLink.js +1 -1
  200. package/dist/components/icons.d.ts +2 -2
  201. package/dist/components/icons.js +2 -2
  202. package/dist/{copy-button-CQx3LQAC.d.ts → copy-button-D7aAYA-2.d.ts} +1 -1
  203. package/dist/{copy-button-cYsJBauI.js → copy-button-DeK6KXEV.js} +3 -2
  204. package/dist/{icons--FqCZEc3.js → icons-CQJ-aMnI.js} +6 -3
  205. package/dist/{icons-DpUqY8Mp.d.ts → icons-CYXmvKlJ.d.ts} +17 -2
  206. package/dist/navigation-link-Cob7KBlM.js +19 -0
  207. package/dist/styles/accordion.css +4 -19
  208. package/dist/styles/activity.css +48 -56
  209. package/dist/styles/agent-activity-preview.css +2 -0
  210. package/dist/styles/agent-chat.css +14 -22
  211. package/dist/styles/alert-dialog.css +16 -18
  212. package/dist/styles/app-top-bar.css +17 -9
  213. package/dist/styles/approval.css +11 -6
  214. package/dist/styles/artifact.css +6 -6
  215. package/dist/styles/autocomplete.css +2 -1
  216. package/dist/styles/avatar.css +35 -30
  217. package/dist/styles/badge.css +10 -10
  218. package/dist/styles/base-ui-motion.css +94 -39
  219. package/dist/styles/browser-control-overlay.css +0 -1
  220. package/dist/styles/browser-live-view.css +39 -22
  221. package/dist/styles/browser-replay.css +1 -1
  222. package/dist/styles/browser-run-panel.css +8 -4
  223. package/dist/styles/button.css +36 -33
  224. package/dist/styles/card.css +5 -6
  225. package/dist/styles/chain-of-thought.css +22 -16
  226. package/dist/styles/checkbox.css +18 -5
  227. package/dist/styles/codex-model-selector.css +3 -7
  228. package/dist/styles/collapsible.css +10 -10
  229. package/dist/styles/combobox.css +3 -2
  230. package/dist/styles/commit.css +19 -18
  231. package/dist/styles/composition-motion.css +83 -0
  232. package/dist/styles/context-menu.css +3 -3
  233. package/dist/styles/context.css +11 -10
  234. package/dist/styles/conversation.css +18 -23
  235. package/dist/styles/dialog.css +15 -15
  236. package/dist/styles/field.css +32 -12
  237. package/dist/styles/file-tree.css +69 -9
  238. package/dist/styles/form.css +1 -1
  239. package/dist/styles/index.css +5 -0
  240. package/dist/styles/input.css +2 -2
  241. package/dist/styles/marker.css +14 -13
  242. package/dist/styles/mcp-server-picker.css +20 -17
  243. package/dist/styles/media-preview-card.css +160 -0
  244. package/dist/styles/menu.css +11 -11
  245. package/dist/styles/menubar.css +12 -11
  246. package/dist/styles/message.css +27 -21
  247. package/dist/styles/meter.css +2 -2
  248. package/dist/styles/model-selector.css +16 -14
  249. package/dist/styles/motion-reduction.css +29 -0
  250. package/dist/styles/navigation-menu.css +14 -30
  251. package/dist/styles/number-field.css +22 -4
  252. package/dist/styles/plan.css +5 -0
  253. package/dist/styles/popover.css +15 -16
  254. package/dist/styles/preview-card.css +2 -32
  255. package/dist/styles/progress.css +8 -3
  256. package/dist/styles/prompt-input.css +75 -75
  257. package/dist/styles/queue.css +48 -32
  258. package/dist/styles/radio.css +19 -12
  259. package/dist/styles/reasoning.css +2 -1
  260. package/dist/styles/recipes.css +109 -37
  261. package/dist/styles/resizable-side-panel.css +4 -10
  262. package/dist/styles/responsive-sidebar-shell.css +16 -15
  263. package/dist/styles/scroll-area.css +32 -15
  264. package/dist/styles/search-field.css +21 -0
  265. package/dist/styles/select.css +19 -12
  266. package/dist/styles/slider.css +25 -29
  267. package/dist/styles/sources.css +3 -3
  268. package/dist/styles/stepper.css +36 -26
  269. package/dist/styles/subagent-run.css +1 -1
  270. package/dist/styles/switch.css +32 -29
  271. package/dist/styles/tabs.css +79 -23
  272. package/dist/styles/task.css +13 -9
  273. package/dist/styles/test-results.css +29 -23
  274. package/dist/styles/theme-mode-control.css +8 -0
  275. package/dist/styles/think-execution-workbench.css +18 -15
  276. package/dist/styles/think-full-app.css +45 -68
  277. package/dist/styles/think-routine-library.css +43 -24
  278. package/dist/styles/think-thread-picker.css +193 -51
  279. package/dist/styles/toast.css +48 -27
  280. package/dist/styles/toggle-group.css +2 -36
  281. package/dist/styles/toggle.css +29 -5
  282. package/dist/styles/toolbar.css +25 -27
  283. package/dist/styles/tooltip.css +2 -32
  284. package/dist/styles/transition-surface.css +55 -0
  285. package/dist/styles/workspace-explorer.css +99 -44
  286. package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
  287. package/dist/utils/mcp-server-catalog.d.ts +132 -0
  288. package/dist/utils/mcp-server-catalog.js +90 -0
  289. package/dist/utils/structured-code.d.ts +1 -1
  290. package/package.json +13 -7
  291. package/dist/Workspace-C9RFoxcu.d.ts +0 -62
  292. package/dist/summarize-tool-input-BUJsENSn.js +0 -12
@@ -8,6 +8,7 @@ import * as React from "react";
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useAgentChat } from "@cloudflare/think/react";
10
10
  import { useAgent, useAgentToolEvents } from "agents/react";
11
+ import { queryOptions, useQuery, useQueryClient } from "@tanstack/react-query";
11
12
  //#region src/components/_internal/think-approvals.ts
12
13
  /**
13
14
  * Ambient approvals belong to their stub. An explicit different stub may only
@@ -23,54 +24,69 @@ function resolveThinkApprovalProps(overrides, ambient) {
23
24
  }
24
25
  //#endregion
25
26
  //#region src/components/ThinkChat.tsx
27
+ const EMPTY_PENDING_APPROVALS = [];
26
28
  function toAgentChatStatus(chat) {
27
29
  if (chat.status === "submitted") return "submitted";
28
30
  if (chat.isStreaming || chat.isRecovering) return "streaming";
29
31
  return chat.status ?? "ready";
30
32
  }
31
- function useThinkPendingApprovals(stub, refreshKey) {
32
- const requestIdRef = React.useRef(0);
33
- const [state, setState] = React.useState(() => ({
34
- source: stub,
35
- pendingApprovals: []
36
- }));
37
- const refresh = React.useCallback(async () => {
38
- const requestId = ++requestIdRef.current;
39
- try {
40
- const pendingApprovals = await stub.pendingApprovals();
41
- if (requestId !== requestIdRef.current) return;
42
- setState({
43
- source: stub,
44
- pendingApprovals
45
- });
46
- } catch {
47
- if (requestId !== requestIdRef.current) return;
48
- setState({
49
- source: stub,
50
- pendingApprovals: []
51
- });
52
- }
53
- }, [stub]);
54
- React.useEffect(() => {
55
- requestIdRef.current += 1;
56
- setState((current) => current.source === stub ? current : {
57
- source: stub,
58
- pendingApprovals: []
59
- });
60
- refresh();
61
- return () => {
62
- requestIdRef.current += 1;
33
+ function thinkPendingExecutionApprovalsQueryKey(sourceKey) {
34
+ return [
35
+ "think",
36
+ sourceKey,
37
+ "pending-approvals"
38
+ ];
39
+ }
40
+ /** Shared pending-approval options for components and TanStack Router loaders. */
41
+ function thinkPendingExecutionApprovalsQueryOptions(stub, sourceKey) {
42
+ return queryOptions({
43
+ queryKey: thinkPendingExecutionApprovalsQueryKey(sourceKey),
44
+ queryFn: () => stub.pendingApprovals(),
45
+ staleTime: 5e3
46
+ });
47
+ }
48
+ function useThinkPendingExecutionApprovals(stub, sourceKey, refreshSignal) {
49
+ const queryClient = useQueryClient();
50
+ const approvalsQuery = useQuery(thinkPendingExecutionApprovalsQueryOptions(stub, sourceKey));
51
+ const refreshState = React.useRef({
52
+ sourceKey,
53
+ observedSignal: refreshSignal,
54
+ pending: false
55
+ });
56
+ const refetch = React.useEffectEvent(() => approvalsQuery.refetch());
57
+ const refreshPendingApprovals = React.useCallback(async () => {
58
+ const filters = {
59
+ queryKey: thinkPendingExecutionApprovalsQueryKey(sourceKey),
60
+ exact: true
63
61
  };
62
+ await queryClient.cancelQueries(filters);
63
+ await queryClient.invalidateQueries(filters);
64
+ }, [queryClient, sourceKey]);
65
+ React.useEffect(() => {
66
+ if (refreshState.current.sourceKey !== sourceKey) {
67
+ refreshState.current = {
68
+ sourceKey,
69
+ observedSignal: refreshSignal,
70
+ pending: false
71
+ };
72
+ return;
73
+ }
74
+ if (!Object.is(refreshState.current.observedSignal, refreshSignal)) {
75
+ refreshState.current.observedSignal = refreshSignal;
76
+ refreshState.current.pending = true;
77
+ }
78
+ if (approvalsQuery.isFetching || !refreshState.current.pending) return;
79
+ refreshState.current.pending = false;
80
+ refetch();
64
81
  }, [
65
- refresh,
66
- refreshKey,
67
- stub
82
+ approvalsQuery.isFetching,
83
+ refreshSignal,
84
+ sourceKey
68
85
  ]);
69
- const pendingApprovals = state.source === stub ? state.pendingApprovals : [];
70
86
  return React.useMemo(() => ({
71
- pendingApprovals,
72
- refreshPendingApprovals: refresh
73
- }), [pendingApprovals, refresh]);
87
+ pendingApprovals: approvalsQuery.data ?? EMPTY_PENDING_APPROVALS,
88
+ refreshPendingApprovals
89
+ }), [approvalsQuery.data, refreshPendingApprovals]);
74
90
  }
75
91
  /**
76
92
  * Chat UI for Cloudflare Think agents. Provide a `useAgentChat` value (or let
@@ -90,16 +106,23 @@ function ThinkChatProvider({ agentTools, chat, children }) {
90
106
  /**
91
107
  * Batteries-included root: connects to the named Think agent (upstream's
92
108
  * `useAgent` + `useAgentChat`) and provides the live chat to everything
93
- * inside. If the app already owns the chat hook, use `ThinkChat.Provider`.
109
+ * inside. Render it beneath the app's `QueryClientProvider`. If the app
110
+ * already owns the chat hook, use `ThinkChat.Provider`.
94
111
  *
95
112
  * @example
96
113
  * ```tsx
97
- * <ThinkChat.Root agent="my-agent" name="session-1">
98
- * <ThinkChat.Messages />
99
- * </ThinkChat.Root>
114
+ * <QueryClientProvider client={queryClient}>
115
+ * <ThinkChat.Root
116
+ * agent="my-agent"
117
+ * name="session-1"
118
+ * sourceKey="api.example.com:account:acme:agent:session-1"
119
+ * >
120
+ * <ThinkChat.Messages />
121
+ * </ThinkChat.Root>
122
+ * </QueryClientProvider>
100
123
  * ```
101
124
  */
102
- function ThinkChatRoot({ agent: agentOption, name, children }) {
125
+ function ThinkChatRoot({ agent: agentOption, name, sourceKey, children }) {
103
126
  const agent = useAgent(typeof agentOption === "string" ? {
104
127
  agent: agentOption,
105
128
  name
@@ -110,19 +133,21 @@ function ThinkChatRoot({ agent: agentOption, name, children }) {
110
133
  const chat = useAgentChat({ agent });
111
134
  const agentTools = useAgentToolEvents({ agent });
112
135
  const agentIdentity = JSON.stringify(agent.path);
113
- const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
136
+ const approvals = useThinkPendingExecutionApprovals(agent.stub, sourceKey, `${chat.messages.length}:${chat.status}`);
137
+ const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
114
138
  React.useEffect(() => {
115
- agentTools.resetLocalState();
139
+ resetAgentTools();
116
140
  }, [agentIdentity]);
141
+ const approvalsContext = React.useMemo(() => ({
142
+ ...approvals,
143
+ thinkStub: agent.stub
144
+ }), [agent.stub, approvals]);
117
145
  return /* @__PURE__ */ jsx(AgentToolRunsProvider, {
118
146
  agentTools,
119
147
  children: /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
120
148
  value: chat,
121
149
  children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
122
- value: {
123
- ...approvals,
124
- thinkStub: agent.stub
125
- },
150
+ value: approvalsContext,
126
151
  children
127
152
  })
128
153
  })
@@ -139,7 +164,7 @@ const ThinkChatApprovalsContext = React.createContext(null);
139
164
  * inside the log) or `excludeTools` + your own `renderPart` (standalone
140
165
  * card) — see README "App-specific tools" and the Custom Tool Panel story.
141
166
  */
142
- function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentToolRunSelect, selectedAgentToolRunId, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
167
+ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAgentToolRunLink, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
143
168
  const chat = useThinkChatContext("ThinkChat.Messages");
144
169
  const agentTools = useOptionalAgentToolRuns();
145
170
  const approvals = React.useContext(ThinkChatApprovalsContext);
@@ -155,13 +180,11 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentTo
155
180
  });
156
181
  const defaultRenderPart = React.useMemo(() => createThinkChatActivityRenderer({
157
182
  excludeTools,
158
- onAgentToolRunSelect,
159
- selectedAgentToolRunId,
183
+ renderAgentToolRunLink,
160
184
  toolRenderers
161
185
  }), [
162
186
  excludeTools,
163
- onAgentToolRunSelect,
164
- selectedAgentToolRunId,
187
+ renderAgentToolRunLink,
165
188
  toolRenderers
166
189
  ]);
167
190
  const resolvedRenderPart = React.useMemo(() => renderPart ? (context) => {
@@ -176,8 +199,8 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentTo
176
199
  return custom === void 0 ? renderBuiltIn() : custom;
177
200
  } : defaultRenderPart, [defaultRenderPart, renderPart]);
178
201
  const defaultNotice = /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat });
179
- const backgroundRuns = onAgentToolRunSelect ? agentTools?.unboundRuns : void 0;
180
- const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length ? /* @__PURE__ */ jsxs("div", {
202
+ const backgroundRuns = renderAgentToolRunLink ? agentTools?.unboundRuns : void 0;
203
+ const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length && renderAgentToolRunLink ? /* @__PURE__ */ jsxs("div", {
181
204
  className: "subagent-run__tray",
182
205
  "data-slot": "background-agent-runs",
183
206
  children: [/* @__PURE__ */ jsx("span", {
@@ -186,8 +209,7 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentTo
186
209
  }), /* @__PURE__ */ jsx(SubagentRunList, {
187
210
  "aria-label": "Background agent runs",
188
211
  runs: backgroundRuns,
189
- selectedRunId: selectedAgentToolRunId,
190
- onSelect: onAgentToolRunSelect
212
+ renderRunLink: renderAgentToolRunLink
191
213
  })]
192
214
  }) : null] }) : void 0;
193
215
  return /* @__PURE__ */ jsx(AgentChat, {
@@ -205,7 +227,8 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentTo
205
227
  onRegenerate: (messageId) => void chat.regenerate({ messageId }),
206
228
  onSubmit: ({ text, files, references }) => {
207
229
  const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
208
- if (prompt || files.length) return chat.sendMessage({
230
+ if (!prompt && !files.length) return;
231
+ return chat.sendMessage({
209
232
  text: prompt,
210
233
  files
211
234
  });
@@ -236,4 +259,4 @@ const ThinkChat = {
236
259
  createActivityRenderer: createThinkChatActivityRenderer
237
260
  };
238
261
  //#endregion
239
- export { useThinkChat as a, ThinkChatRoot as i, ThinkChatMessages as n, useThinkPendingApprovals as o, ThinkChatProvider as r, resolveThinkApprovalProps as s, ThinkChat as t };
262
+ export { thinkPendingExecutionApprovalsQueryOptions as a, resolveThinkApprovalProps as c, ThinkChatRoot as i, ThinkChatMessages as n, useThinkChat as o, ThinkChatProvider as r, useThinkPendingExecutionApprovals as s, ThinkChat as t };
@@ -1,5 +1,5 @@
1
1
  import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
2
- import { r as AgentChatProps } from "./AgentChat-CRuMi1Pb.js";
2
+ import { r as AgentChatProps } from "./AgentChat-ClxViuUM.js";
3
3
  import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
4
4
  import * as React from "react";
5
5
  import { DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
@@ -28,10 +28,8 @@ interface ThinkChatActivityRendererOptions<MessageT extends UIMessage = UIMessag
28
28
  excludeTools?: readonly string[];
29
29
  /** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
30
30
  toolRenderers?: ThinkChatToolRenderers;
31
- /** Selected retained child shown in an adjacent detail surface. */
32
- selectedAgentToolRunId?: string | null;
33
- /** Opens a whole upstream retained run in the host-owned detail surface. */
34
- onAgentToolRunSelect?: (run: AgentToolRunState<MessageT["parts"][number]>) => void;
31
+ /** App-authored TanStack Router Link for each retained child destination. */
32
+ renderAgentToolRunLink?: (run: AgentToolRunState<MessageT["parts"][number]>) => React.ReactElement;
35
33
  }
36
34
  interface ThinkChatActivityProps {
37
35
  /** Render with the log expanded. */
@@ -64,8 +62,7 @@ declare function ThinkChatActivity({
64
62
  */
65
63
  declare function createThinkChatActivityRenderer<MessageT extends UIMessage = UIMessage>({
66
64
  excludeTools,
67
- onAgentToolRunSelect,
68
- selectedAgentToolRunId,
65
+ renderAgentToolRunLink,
69
66
  toolRenderers
70
67
  }?: ThinkChatActivityRendererOptions<MessageT>): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
71
68
  /** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
@@ -1,4 +1,4 @@
1
- import { i as AgentActivityIconKind, s as AgentActivitySummary } from "./AgentActivity-BNUNrP9O.js";
1
+ import { i as AgentActivityIconKind, s as AgentActivitySummary } from "./AgentActivity-D2SHSGFX.js";
2
2
  import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
3
3
  import { DynamicToolUIPart, ToolUIPart } from "ai";
4
4
 
@@ -4,7 +4,7 @@ import { Toggle } from "@base-ui/react/toggle";
4
4
  //#region src/components/Toggle.d.ts
5
5
  interface ToggleVariantsOptions {
6
6
  variant?: "default" | "outline" | null;
7
- size?: "default" | "sm" | "lg" | null;
7
+ size?: "sm" | "md" | "lg" | null;
8
8
  className?: string;
9
9
  }
10
10
  /**
@@ -1,10 +1,10 @@
1
- import { r as ToggleVariantsOptions } from "./Toggle-DaXpe1Lc.js";
1
+ import { r as ToggleVariantsOptions } from "./Toggle-JKZ43D5S.js";
2
2
  import * as React from "react";
3
3
  import { ToggleGroup } from "@base-ui/react/toggle-group";
4
4
  import { Toggle } from "@base-ui/react/toggle";
5
5
 
6
6
  //#region src/components/ToggleGroup.d.ts
7
- type ToggleGroupSize = ToggleVariantsOptions["size"] | "md";
7
+ type ToggleGroupSize = ToggleVariantsOptions["size"];
8
8
  interface ToggleGroupProps extends React.ComponentPropsWithRef<typeof ToggleGroup> {
9
9
  variant?: ToggleVariantsOptions["variant"];
10
10
  /**
@@ -0,0 +1,274 @@
1
+ import { a as WorkspaceMediaInfo, i as WorkspaceFileState, r as WorkspaceFileAssetResolver, t as WorkspaceFileAsset } from "./WorkspaceFile-CzyHnESE.js";
2
+ import { WorkspaceLike } from "@cloudflare/think";
3
+ import { FileInfo, Workspace } from "@cloudflare/shell";
4
+
5
+ //#region src/components/Workspace.d.ts
6
+ /** Workspace summary, as returned by `Workspace.getWorkspaceInfo()` upstream. */
7
+ type WorkspaceInfo = Awaited<ReturnType<Workspace["getWorkspaceInfo"]>>;
8
+ /** Whole upstream workspace shapes, accepted without narrowing or mirroring. */
9
+ type WorkspaceSource = Workspace | WorkspaceLike;
10
+ interface UseWorkspaceOptions {
11
+ /** Must be referentially stable (memoize in the app). */
12
+ source: WorkspaceSource;
13
+ /**
14
+ * Stable, non-secret identity for the endpoint/account/tenant/workspace
15
+ * behind `source`. Change it whenever that backing workspace changes.
16
+ */
17
+ sourceKey: string;
18
+ /** Root directory to list first. Defaults to "/". */
19
+ root?: string;
20
+ /** Route-owned selected file path. */
21
+ selectedPath: string | null;
22
+ /** Called when a non-link browser asks the app to select a file. */
23
+ onSelectedPathChange?: (path: string | null) => void;
24
+ /**
25
+ * Optional host adapter called before text/binary reads. Return `null` for
26
+ * ordinary text files and prefer signed/range-friendly URLs for large media.
27
+ * The configured root scopes navigation; hosts must enforce authorization
28
+ * atomically when resolving assets across a trust boundary.
29
+ * Keep this resolver semantically stable for a given `sourceKey`; function
30
+ * identity is intentionally excluded from serializable query keys.
31
+ */
32
+ resolveFileAsset?: WorkspaceFileAssetResolver;
33
+ /** Maximum size for the built-in buffered-byte fallback. Defaults to 32 MiB. */
34
+ maxInlineAssetBytes?: number;
35
+ }
36
+ interface WorkspaceState {
37
+ root: string;
38
+ /** Loaded directory listings, keyed by directory path. */
39
+ entriesByDirectory: Readonly<Record<string, readonly FileInfo[]>>;
40
+ /** Every loaded entry, keyed by its path. */
41
+ entryByPath: ReadonlyMap<string, FileInfo>;
42
+ expandedPaths: ReadonlySet<string>;
43
+ /** Update expansion; newly expanded directories load lazily. */
44
+ setExpandedPaths: (next: Set<string>) => void;
45
+ selectedPath: string | null;
46
+ /** Ask the route owner to select a file. */
47
+ selectFile: (path: string | null) => void;
48
+ /** The selected file once its read settles; null while loading. */
49
+ selectedFile: WorkspaceFileState | null;
50
+ /** Initial root/info load or explicit refresh in flight. */
51
+ isLoading: boolean;
52
+ /** Directory and file paths with a query in flight. */
53
+ loadingPaths: ReadonlySet<string>;
54
+ /** Root/directory listing failure. Per-file read errors live on the file state. */
55
+ error: string | null;
56
+ /** Workspace summary, when the source provides `getWorkspaceInfo`. */
57
+ info: WorkspaceInfo | null;
58
+ /** Reload the root, every expanded directory, and the selected file. */
59
+ refresh: () => void;
60
+ }
61
+ interface WorkspaceFileReadTarget {
62
+ requestedPath: string;
63
+ readPath: string;
64
+ info: FileInfo;
65
+ media: WorkspaceMediaInfo | null;
66
+ }
67
+ /**
68
+ * Source/root prefix for cache inspection, cancellation, or removal.
69
+ * Do not broadly invalidate this prefix: active file queries must refresh in
70
+ * stat → resolver → content order. Use a resource option key or `refresh()`.
71
+ */
72
+ declare function workspaceQueryKey(sourceKey: string, root: string): readonly ["workspace", string, string];
73
+ type WorkspaceQueryKey = ReturnType<typeof workspaceQueryKey>;
74
+ /** Shared directory options for workspace components and route loaders. */
75
+ declare function workspaceDirectoryQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, path: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<readonly FileInfo[], Error, readonly FileInfo[], readonly ["workspace", string, string, "directory", string]>, "queryFn"> & {
76
+ queryFn?: import("@tanstack/react-query").QueryFunction<readonly FileInfo[], readonly ["workspace", string, string, "directory", string], never> | undefined;
77
+ } & {
78
+ queryKey: readonly ["workspace", string, string, "directory", string] & {
79
+ [dataTagSymbol]: readonly FileInfo[];
80
+ [dataTagErrorSymbol]: Error;
81
+ };
82
+ };
83
+ /** Shared workspace-summary options for workspace components and route loaders. */
84
+ declare function workspaceInfoQueryOptions(source: WorkspaceSource, sourceKey: string, root: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
85
+ fileCount: number;
86
+ directoryCount: number;
87
+ totalBytes: number;
88
+ r2FileCount: number;
89
+ } | null, Error, {
90
+ fileCount: number;
91
+ directoryCount: number;
92
+ totalBytes: number;
93
+ r2FileCount: number;
94
+ } | null, readonly ["workspace", string, string, "info"]>, "queryFn"> & {
95
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
96
+ fileCount: number;
97
+ directoryCount: number;
98
+ totalBytes: number;
99
+ r2FileCount: number;
100
+ } | null, readonly ["workspace", string, string, "info"], never> | undefined;
101
+ } & {
102
+ queryKey: readonly ["workspace", string, string, "info"] & {
103
+ [dataTagSymbol]: {
104
+ fileCount: number;
105
+ directoryCount: number;
106
+ totalBytes: number;
107
+ r2FileCount: number;
108
+ } | null;
109
+ [dataTagErrorSymbol]: Error;
110
+ };
111
+ };
112
+ /** Re-stat and validate a requested path before any resolver or file read. */
113
+ declare function workspaceFileStatQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, requestedPath: string): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<WorkspaceFileReadTarget, Error, WorkspaceFileReadTarget, readonly ["workspace", string, string, "file", string, "stat"]>, "queryFn"> & {
114
+ queryFn?: import("@tanstack/react-query").QueryFunction<WorkspaceFileReadTarget, readonly ["workspace", string, string, "file", string, "stat"], never> | undefined;
115
+ } & {
116
+ queryKey: readonly ["workspace", string, string, "file", string, "stat"] & {
117
+ [dataTagSymbol]: WorkspaceFileReadTarget;
118
+ [dataTagErrorSymbol]: Error;
119
+ };
120
+ };
121
+ /** Optional host asset resolution, scoped to the current stat result. */
122
+ declare function workspaceFileAssetQueryOptions(sourceKey: string, root: string, target: WorkspaceFileReadTarget, resolveFileAsset: WorkspaceFileAssetResolver): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
123
+ asset: WorkspaceFileAsset;
124
+ media: WorkspaceMediaInfo;
125
+ } | null, Error, {
126
+ asset: WorkspaceFileAsset;
127
+ media: WorkspaceMediaInfo;
128
+ } | null, readonly ["workspace", string, string, "file", string, "asset", {
129
+ readonly path: string;
130
+ readonly name: string;
131
+ readonly type: import("@cloudflare/shell").EntryType;
132
+ readonly mimeType: string;
133
+ readonly size: number;
134
+ readonly createdAt: number;
135
+ readonly updatedAt: number;
136
+ readonly target: string | null;
137
+ }]>, "queryFn"> & {
138
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
139
+ asset: WorkspaceFileAsset;
140
+ media: WorkspaceMediaInfo;
141
+ } | null, readonly ["workspace", string, string, "file", string, "asset", {
142
+ readonly path: string;
143
+ readonly name: string;
144
+ readonly type: import("@cloudflare/shell").EntryType;
145
+ readonly mimeType: string;
146
+ readonly size: number;
147
+ readonly createdAt: number;
148
+ readonly updatedAt: number;
149
+ readonly target: string | null;
150
+ }], never> | undefined;
151
+ } & {
152
+ queryKey: readonly ["workspace", string, string, "file", string, "asset", {
153
+ readonly path: string;
154
+ readonly name: string;
155
+ readonly type: import("@cloudflare/shell").EntryType;
156
+ readonly mimeType: string;
157
+ readonly size: number;
158
+ readonly createdAt: number;
159
+ readonly updatedAt: number;
160
+ readonly target: string | null;
161
+ }] & {
162
+ [dataTagSymbol]: {
163
+ asset: WorkspaceFileAsset;
164
+ media: WorkspaceMediaInfo;
165
+ } | null;
166
+ [dataTagErrorSymbol]: Error;
167
+ };
168
+ };
169
+ /** Cached text read options, scoped to the validated stat result. */
170
+ declare function workspaceTextFileQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, target: WorkspaceFileReadTarget): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<string | null, Error, string | null, readonly ["workspace", string, string, "file", string, "text", {
171
+ readonly path: string;
172
+ readonly name: string;
173
+ readonly type: import("@cloudflare/shell").EntryType;
174
+ readonly mimeType: string;
175
+ readonly size: number;
176
+ readonly createdAt: number;
177
+ readonly updatedAt: number;
178
+ readonly target: string | null;
179
+ }]>, "queryFn"> & {
180
+ queryFn?: import("@tanstack/react-query").QueryFunction<string | null, readonly ["workspace", string, string, "file", string, "text", {
181
+ readonly path: string;
182
+ readonly name: string;
183
+ readonly type: import("@cloudflare/shell").EntryType;
184
+ readonly mimeType: string;
185
+ readonly size: number;
186
+ readonly createdAt: number;
187
+ readonly updatedAt: number;
188
+ readonly target: string | null;
189
+ }], never> | undefined;
190
+ } & {
191
+ queryKey: readonly ["workspace", string, string, "file", string, "text", {
192
+ readonly path: string;
193
+ readonly name: string;
194
+ readonly type: import("@cloudflare/shell").EntryType;
195
+ readonly mimeType: string;
196
+ readonly size: number;
197
+ readonly createdAt: number;
198
+ readonly updatedAt: number;
199
+ readonly target: string | null;
200
+ }] & {
201
+ [dataTagSymbol]: string | null;
202
+ [dataTagErrorSymbol]: Error;
203
+ };
204
+ };
205
+ /** Active-file-only buffered asset options, scoped to the validated stat result. */
206
+ declare function workspaceBinaryFileQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, target: WorkspaceFileReadTarget, maxInlineAssetBytes: number): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
207
+ asset: WorkspaceFileAsset;
208
+ media: WorkspaceMediaInfo;
209
+ } | null, Error, {
210
+ asset: WorkspaceFileAsset;
211
+ media: WorkspaceMediaInfo;
212
+ } | null, readonly ["workspace", string, string, "file", string, "bytes", {
213
+ readonly path: string;
214
+ readonly name: string;
215
+ readonly type: import("@cloudflare/shell").EntryType;
216
+ readonly mimeType: string;
217
+ readonly size: number;
218
+ readonly createdAt: number;
219
+ readonly updatedAt: number;
220
+ readonly target: string | null;
221
+ }, {
222
+ readonly maxInlineAssetBytes: number;
223
+ }]>, "queryFn"> & {
224
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
225
+ asset: WorkspaceFileAsset;
226
+ media: WorkspaceMediaInfo;
227
+ } | null, readonly ["workspace", string, string, "file", string, "bytes", {
228
+ readonly path: string;
229
+ readonly name: string;
230
+ readonly type: import("@cloudflare/shell").EntryType;
231
+ readonly mimeType: string;
232
+ readonly size: number;
233
+ readonly createdAt: number;
234
+ readonly updatedAt: number;
235
+ readonly target: string | null;
236
+ }, {
237
+ readonly maxInlineAssetBytes: number;
238
+ }], never> | undefined;
239
+ } & {
240
+ queryKey: readonly ["workspace", string, string, "file", string, "bytes", {
241
+ readonly path: string;
242
+ readonly name: string;
243
+ readonly type: import("@cloudflare/shell").EntryType;
244
+ readonly mimeType: string;
245
+ readonly size: number;
246
+ readonly createdAt: number;
247
+ readonly updatedAt: number;
248
+ readonly target: string | null;
249
+ }, {
250
+ readonly maxInlineAssetBytes: number;
251
+ }] & {
252
+ [dataTagSymbol]: {
253
+ asset: WorkspaceFileAsset;
254
+ media: WorkspaceMediaInfo;
255
+ } | null;
256
+ [dataTagErrorSymbol]: Error;
257
+ };
258
+ };
259
+ /**
260
+ * Headless state for browsing a Think workspace. TanStack Query owns remote
261
+ * directory, metadata, resolver, text, and byte lifecycles; the route owns
262
+ * selection, while this hook only keeps local tree expansion state.
263
+ */
264
+ declare function useWorkspace({
265
+ source,
266
+ sourceKey,
267
+ root,
268
+ selectedPath,
269
+ onSelectedPathChange,
270
+ resolveFileAsset,
271
+ maxInlineAssetBytes
272
+ }: UseWorkspaceOptions): WorkspaceState;
273
+ //#endregion
274
+ export { WorkspaceSource as a, workspaceBinaryFileQueryOptions as c, workspaceFileStatQueryOptions as d, workspaceInfoQueryOptions as f, WorkspaceQueryKey as i, workspaceDirectoryQueryOptions as l, workspaceTextFileQueryOptions as m, WorkspaceFileReadTarget as n, WorkspaceState as o, workspaceQueryKey as p, WorkspaceInfo as r, useWorkspace as s, UseWorkspaceOptions as t, workspaceFileAssetQueryOptions as u };
@@ -1,5 +1,5 @@
1
- import { l as WorkspaceNavigationAdapter } from "./WorkspaceLink-DK1DWMHe.js";
2
- import { i as WorkspaceState } from "./Workspace-C9RFoxcu.js";
1
+ import { l as WorkspaceNavigationAdapter } from "./WorkspaceLink-O-EBKUJ8.js";
2
+ import { o as WorkspaceState } from "./Workspace-Jez8ffUj.js";
3
3
  import * as React from "react";
4
4
 
5
5
  //#region src/components/WorkspaceExplorer.d.ts
@@ -1,4 +1,4 @@
1
- import { A as CodeBlockLanguage } from "./CodeBlock-Dnpr88ZQ.js";
1
+ import { A as CodeBlockLanguage } from "./CodeBlock-gV4kZeCI.js";
2
2
  import { SkillParseResult } from "agent-skills-ts-sdk";
3
3
  import { FileInfo } from "@cloudflare/shell";
4
4