@mcp-b/react-components 0.14.2 → 0.16.1

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 (251) hide show
  1. package/dist/AgentActivity-BNUNrP9O.d.ts +36 -0
  2. package/dist/{AgentChat-DQkqt82e.d.ts → AgentChat-CrlpbvQJ.d.ts} +58 -6
  3. package/dist/{CodeBlock-DUh9WOGo.d.ts → CodeBlock-BRajW4QU.d.ts} +1 -1
  4. package/dist/{CodeBlock-BUFXG8HW.js → CodeBlock-BmB4Xaqq.js} +15 -4
  5. package/dist/{FileTree-mpEIcfzA.js → FileTree-CkVbIMWV.js} +82 -89
  6. package/dist/Message-BkMdE3bS.js +375 -0
  7. package/dist/{ModelSelector-CPCpFAUt.js → ModelSelector-SlJNgwKY.js} +2 -2
  8. package/dist/{PromptInput-ClNqBiIw.d.ts → PromptInput-BWTuXMOD.d.ts} +123 -5
  9. package/dist/ResponsiveSidebarShell-Dd9DCcBT.d.ts +67 -0
  10. package/dist/{Select-Dl_vF_Bt.d.ts → Select-BeEsefzh.d.ts} +12 -2
  11. package/dist/{ThinkChat-BPcehdbP.js → ThinkChat-CzC-zNGA.js} +24 -36
  12. package/dist/{ThinkChatActivity-BmwuIigx.d.ts → ThinkChatActivity-BFQnb2ct.d.ts} +3 -10
  13. package/dist/ThinkChatActivitySummary-BPmu9a-c.d.ts +39 -0
  14. package/dist/{ThinkChatToolParts-CDEjqS6A.d.ts → ThinkChatToolParts-CSzVwMXf.d.ts} +13 -3
  15. package/dist/ThinkExecutionRun-ChhWhOoU.d.ts +30 -0
  16. package/dist/Toggle-CAAlNl-M.d.ts +69 -0
  17. package/dist/ToggleGroup-8hPv-b69.d.ts +73 -0
  18. package/dist/Workspace-D39LxGvP.d.ts +62 -0
  19. package/dist/WorkspaceFile-DOZkPwzu.d.ts +106 -0
  20. package/dist/WorkspaceFileView-rSN_yT0L.js +744 -0
  21. package/dist/WorkspaceLink-DIPbXrUM.js +337 -0
  22. package/dist/WorkspaceLink-DK1DWMHe.d.ts +89 -0
  23. package/dist/components/Activity.d.ts +27 -1
  24. package/dist/components/Activity.js +33 -15
  25. package/dist/components/AgentActivity.d.ts +2 -0
  26. package/dist/components/AgentActivity.js +45 -0
  27. package/dist/components/AgentActivityPreview.d.ts +46 -0
  28. package/dist/components/AgentActivityPreview.js +94 -0
  29. package/dist/components/AgentAttention.d.ts +73 -0
  30. package/dist/components/AgentAttention.js +85 -0
  31. package/dist/components/AgentChat.d.ts +2 -2
  32. package/dist/components/AgentChat.js +224 -200
  33. package/dist/components/AgentChatMessageEditor.d.ts +29 -0
  34. package/dist/components/AgentChatMessageEditor.js +92 -0
  35. package/dist/components/AgentChatTurnError.d.ts +17 -0
  36. package/dist/components/AgentChatTurnError.js +40 -0
  37. package/dist/components/AgentConnection.d.ts +12 -17
  38. package/dist/components/AgentConnection.js +99 -91
  39. package/dist/components/AppFrame.d.ts +24 -0
  40. package/dist/components/AppFrame.js +25 -0
  41. package/dist/components/AppTopBar.d.ts +71 -0
  42. package/dist/components/AppTopBar.js +82 -0
  43. package/dist/components/Artifact.js +1 -1
  44. package/dist/components/BrowserLiveView.js +1 -1
  45. package/dist/components/BrowserReplay.js +1 -1
  46. package/dist/components/BrowserRunPanel.js +1 -1
  47. package/dist/components/Card.d.ts +3 -0
  48. package/dist/components/Card.js +2 -1
  49. package/dist/components/ChainOfThought.d.ts +1 -1
  50. package/dist/components/ChainOfThought.js +1 -1
  51. package/dist/components/ChatGptSignInScreen.js +2 -2
  52. package/dist/components/Checkbox.js +5 -13
  53. package/dist/components/CheckboxGroup.d.ts +58 -2
  54. package/dist/components/CheckboxGroup.js +59 -1
  55. package/dist/components/CodeBlock.d.ts +1 -1
  56. package/dist/components/CodeBlock.js +1 -1
  57. package/dist/components/CodexModelSelector.js +1 -1
  58. package/dist/components/Commit.js +2 -2
  59. package/dist/components/ContextMenu.js +1 -1
  60. package/dist/components/Conversation.js +1 -1
  61. package/dist/components/DescriptionList.d.ts +12 -0
  62. package/dist/components/DescriptionList.js +11 -0
  63. package/dist/components/DescriptionListParts.d.ts +37 -0
  64. package/dist/components/DescriptionListParts.js +35 -0
  65. package/dist/components/EnvironmentVariables.js +2 -2
  66. package/dist/components/Fieldset.d.ts +13 -1
  67. package/dist/components/Fieldset.js +11 -2
  68. package/dist/components/FileTree.js +1 -1
  69. package/dist/components/IconButton.d.ts +33 -0
  70. package/dist/components/IconButton.js +27 -0
  71. package/dist/components/McpConnectionRequest.d.ts +44 -0
  72. package/dist/components/McpConnectionRequest.js +122 -0
  73. package/dist/components/McpServerPicker.d.ts +48 -23
  74. package/dist/components/McpServerPicker.js +238 -189
  75. package/dist/components/Menubar.js +1 -1
  76. package/dist/components/Message.d.ts +1 -0
  77. package/dist/components/Message.js +1 -285
  78. package/dist/components/MessageScroller.js +1 -1
  79. package/dist/components/ModelSelector.js +1 -1
  80. package/dist/components/Pricing.d.ts +37 -0
  81. package/dist/components/Pricing.js +17 -0
  82. package/dist/components/PricingBillingToggle.d.ts +23 -0
  83. package/dist/components/PricingBillingToggle.js +86 -0
  84. package/dist/components/PricingConfirmationDialog.d.ts +25 -0
  85. package/dist/components/PricingConfirmationDialog.js +57 -0
  86. package/dist/components/PricingFAQ.d.ts +18 -0
  87. package/dist/components/PricingFAQ.js +27 -0
  88. package/dist/components/PricingPage.d.ts +2 -38
  89. package/dist/components/PricingPage.js +39 -359
  90. package/dist/components/PricingPlanCard.d.ts +22 -0
  91. package/dist/components/PricingPlanCard.js +109 -0
  92. package/dist/components/PricingUsageCalculator.d.ts +22 -0
  93. package/dist/components/PricingUsageCalculator.js +96 -0
  94. package/dist/components/PromptInput.d.ts +2 -2
  95. package/dist/components/PromptInput.js +210 -15
  96. package/dist/components/Queue.js +1 -1
  97. package/dist/components/Reasoning.d.ts +2 -1
  98. package/dist/components/Reasoning.js +14 -29
  99. package/dist/components/ResizableSidePanel.d.ts +57 -0
  100. package/dist/components/ResizableSidePanel.js +151 -0
  101. package/dist/components/ResponsiveSidebarShell.d.ts +2 -0
  102. package/dist/components/ResponsiveSidebarShell.js +129 -0
  103. package/dist/components/Select.d.ts +2 -2
  104. package/dist/components/Select.js +11 -2
  105. package/dist/components/Slider.d.ts +13 -1
  106. package/dist/components/Slider.js +11 -0
  107. package/dist/components/Sources.js +1 -1
  108. package/dist/components/Stepper.d.ts +4 -0
  109. package/dist/components/Stepper.js +5 -3
  110. package/dist/components/SubagentRun.d.ts +18 -19
  111. package/dist/components/SubagentRun.js +25 -18
  112. package/dist/components/SubagentRunIndicator.d.ts +22 -0
  113. package/dist/components/SubagentRunIndicator.js +33 -0
  114. package/dist/components/SubagentRunList.d.ts +25 -0
  115. package/dist/components/SubagentRunList.js +26 -0
  116. package/dist/components/SubagentRunSelector.d.ts +47 -0
  117. package/dist/components/SubagentRunSelector.js +55 -0
  118. package/dist/components/Task.js +1 -1
  119. package/dist/components/Terminal.js +2 -2
  120. package/dist/components/TestResults.js +1 -1
  121. package/dist/components/Textarea.d.ts +21 -0
  122. package/dist/components/Textarea.js +19 -0
  123. package/dist/components/ThemeModeControl.d.ts +24 -0
  124. package/dist/components/ThemeModeControl.js +52 -0
  125. package/dist/components/ThemeProvider.d.ts +38 -0
  126. package/dist/components/ThemeProvider.js +80 -0
  127. package/dist/components/ThinkChat.d.ts +29 -6
  128. package/dist/components/ThinkChat.js +7 -4
  129. package/dist/components/ThinkChatActivity.d.ts +3 -2
  130. package/dist/components/ThinkChatActivity.js +12 -318
  131. package/dist/components/ThinkChatActivitySummary.d.ts +2 -0
  132. package/dist/components/ThinkChatActivitySummary.js +421 -0
  133. package/dist/components/ThinkChatToolPanels.d.ts +7 -5
  134. package/dist/components/ThinkChatToolPanels.js +70 -8
  135. package/dist/components/ThinkChatToolParts.d.ts +2 -2
  136. package/dist/components/ThinkChatToolParts.js +36 -10
  137. package/dist/components/ThinkExecutionDetail.d.ts +20 -0
  138. package/dist/components/ThinkExecutionDetail.js +80 -0
  139. package/dist/components/ThinkExecutionRun.d.ts +2 -0
  140. package/dist/components/ThinkExecutionRun.js +72 -0
  141. package/dist/components/ThinkExecutionStatus.d.ts +22 -0
  142. package/dist/components/ThinkExecutionStatus.js +36 -0
  143. package/dist/components/ThinkExecutionWorkbench.d.ts +7 -0
  144. package/dist/components/ThinkExecutionWorkbench.js +69 -225
  145. package/dist/components/ThinkFullApp.d.ts +58 -14
  146. package/dist/components/ThinkFullApp.js +154 -160
  147. package/dist/components/ThinkFullAppViewSwitch.d.ts +31 -0
  148. package/dist/components/ThinkFullAppViewSwitch.js +34 -0
  149. package/dist/components/ThinkRoutine.d.ts +36 -0
  150. package/dist/components/ThinkRoutine.js +15 -0
  151. package/dist/components/ThinkRoutineBrowser.d.ts +25 -0
  152. package/dist/components/ThinkRoutineBrowser.js +156 -0
  153. package/dist/components/ThinkRoutineDetail.d.ts +24 -0
  154. package/dist/components/ThinkRoutineDetail.js +102 -0
  155. package/dist/components/ThinkRoutineForm.d.ts +32 -0
  156. package/dist/components/ThinkRoutineForm.js +151 -0
  157. package/dist/components/ThinkRoutineLibrary.d.ts +74 -0
  158. package/dist/components/ThinkRoutineLibrary.js +178 -0
  159. package/dist/components/ThinkRoutineRuns.d.ts +24 -0
  160. package/dist/components/ThinkRoutineRuns.js +68 -0
  161. package/dist/components/ThinkThreadPicker.d.ts +18 -1
  162. package/dist/components/ThinkThreadPicker.js +51 -5
  163. package/dist/components/ThinkThreadShell.d.ts +12 -9
  164. package/dist/components/ThinkThreadShell.js +17 -137
  165. package/dist/components/Toggle.d.ts +1 -68
  166. package/dist/components/ToggleGroup.d.ts +1 -72
  167. package/dist/components/Tooltip.d.ts +3 -1
  168. package/dist/components/Tooltip.js +4 -2
  169. package/dist/components/WebPreview.js +1 -1
  170. package/dist/components/Workspace.d.ts +2 -0
  171. package/dist/components/Workspace.js +424 -0
  172. package/dist/components/WorkspaceBrowser.d.ts +32 -0
  173. package/dist/components/WorkspaceBrowser.js +103 -0
  174. package/dist/components/WorkspaceExplorer.d.ts +12 -79
  175. package/dist/components/WorkspaceExplorer.js +116 -330
  176. package/dist/components/WorkspaceFile.d.ts +2 -0
  177. package/dist/components/WorkspaceFile.js +195 -0
  178. package/dist/components/WorkspaceFileView.d.ts +26 -0
  179. package/dist/components/WorkspaceFileView.js +2 -0
  180. package/dist/components/WorkspaceHeader.d.ts +35 -0
  181. package/dist/components/WorkspaceHeader.js +51 -0
  182. package/dist/components/WorkspaceLink.d.ts +2 -0
  183. package/dist/components/WorkspaceLink.js +2 -0
  184. package/dist/components/icons.d.ts +2 -2
  185. package/dist/components/icons.js +2 -2
  186. package/dist/{copy-button-DUMLYdsk.js → copy-button-Dejn5heL.js} +1 -1
  187. package/dist/icons-CpfUer49.js +85 -0
  188. package/dist/{icons-CUCz_Sft.d.ts → icons-GQd1xF4e.d.ts} +51 -1
  189. package/dist/styles/activity-header.css +75 -0
  190. package/dist/styles/activity.css +49 -63
  191. package/dist/styles/agent-activity-preview-overlay.css +80 -0
  192. package/dist/styles/agent-activity-preview.css +233 -0
  193. package/dist/styles/agent-attention.css +128 -0
  194. package/dist/styles/agent-chat.css +133 -4
  195. package/dist/styles/agent-connection.css +9 -9
  196. package/dist/styles/alert-dialog.css +11 -11
  197. package/dist/styles/app-frame.css +15 -0
  198. package/dist/styles/app-top-bar.css +102 -0
  199. package/dist/styles/avatar.css +0 -1
  200. package/dist/styles/browser-control-overlay.css +184 -0
  201. package/dist/styles/card.css +29 -8
  202. package/dist/styles/chain-of-thought.css +5 -5
  203. package/dist/styles/checkbox-group.css +69 -0
  204. package/dist/styles/codex-model-selector.css +3 -3
  205. package/dist/styles/combobox.css +2 -1
  206. package/dist/styles/context-menu.css +1 -1
  207. package/dist/styles/description-list.css +50 -0
  208. package/dist/styles/dialog.css +11 -11
  209. package/dist/styles/field.css +14 -14
  210. package/dist/styles/fieldset.css +15 -4
  211. package/dist/styles/index.css +14 -2
  212. package/dist/styles/mcp-connection-request.css +60 -0
  213. package/dist/styles/mcp-server-picker.css +96 -68
  214. package/dist/styles/menu.css +1 -1
  215. package/dist/styles/message.css +4 -43
  216. package/dist/styles/model-selector.css +18 -12
  217. package/dist/styles/popover.css +9 -9
  218. package/dist/styles/preview-card.css +1 -1
  219. package/dist/styles/pricing-page.css +21 -27
  220. package/dist/styles/prompt-input.css +225 -32
  221. package/dist/styles/reasoning.css +1 -55
  222. package/dist/styles/recipes.css +50 -24
  223. package/dist/styles/resizable-side-panel.css +66 -0
  224. package/dist/styles/responsive-sidebar-shell.css +169 -0
  225. package/dist/styles/select.css +13 -3
  226. package/dist/styles/sources.css +6 -6
  227. package/dist/styles/stepper.css +13 -0
  228. package/dist/styles/streamdown.css +0 -4
  229. package/dist/styles/subagent-run.css +59 -42
  230. package/dist/styles/task.css +17 -10
  231. package/dist/styles/test-results.css +17 -10
  232. package/dist/styles/textarea.css +20 -0
  233. package/dist/styles/theme-mode-control.css +72 -0
  234. package/dist/styles/think-execution-status.css +49 -0
  235. package/dist/styles/think-execution-workbench.css +16 -80
  236. package/dist/styles/think-full-app.css +143 -128
  237. package/dist/styles/think-routine-library.css +491 -0
  238. package/dist/styles/think-thread-picker.css +47 -3
  239. package/dist/styles/toast.css +6 -6
  240. package/dist/styles/toggle-group.css +7 -0
  241. package/dist/styles/tooltip.css +1 -1
  242. package/dist/styles/workspace-explorer.css +516 -64
  243. package/dist/utils/mcp-server-catalog.d.ts +82 -78
  244. package/dist/utils/mcp-server-catalog.js +64 -41
  245. package/dist/utils/structured-code.d.ts +1 -1
  246. package/dist/utils/theme.d.ts +22 -0
  247. package/dist/utils/theme.js +55 -0
  248. package/package.json +34 -28
  249. package/dist/icons-Ba9THQKz.js +0 -64
  250. package/dist/styles/think-resize-handle.css +0 -33
  251. package/dist/styles/think-thread-shell.css +0 -219
@@ -1,93 +1,41 @@
1
1
  import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { I as TerminalIcon, h as FileIcon, n as ArrowLeftIcon } from "../icons-Ba9THQKz.js";
3
- import { Separator } from "./Separator.js";
2
+ import { G as TerminalIcon, s as ChevronDownIcon, v as FileIcon } from "../icons-CpfUer49.js";
4
3
  import { Button } from "./Button.js";
5
- import { Tooltip } from "./Tooltip.js";
6
- import { ToggleGroup } from "./ToggleGroup.js";
7
- import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-BPcehdbP.js";
8
- import { WorkspaceExplorer, useWorkspace } from "./WorkspaceExplorer.js";
4
+ import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../WorkspaceLink-DIPbXrUM.js";
5
+ import { n as mergeRefs } from "../merge-refs-DF_7w2x_.js";
6
+ import { AppTopBar } from "./AppTopBar.js";
7
+ import { ResizableSidePanel } from "./ResizableSidePanel.js";
8
+ import { o as useThinkPendingApprovals, s as resolveThinkApprovalProps, t as ThinkChat } from "../ThinkChat-CzC-zNGA.js";
9
+ import { useWorkspace } from "./Workspace.js";
10
+ import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
9
11
  import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
12
+ import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
13
+ import { ThinkThreadStatusIndicators } from "./ThinkThreadPicker.js";
10
14
  import { ThinkThreadShell } from "./ThinkThreadShell.js";
11
15
  import * as React from "react";
12
- import { jsx, jsxs } from "react/jsx-runtime";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
13
17
  //#region src/components/ThinkFullApp.tsx
14
18
  const workbenchPanelDefaultWidth = 340;
15
19
  const workbenchPanelMinWidth = 300;
16
20
  const workbenchPanelMaxWidth = 600;
17
21
  const workbenchPanelKeyboardStep = 24;
18
- function clampWorkbenchPanelWidth(width) {
19
- return Math.min(workbenchPanelMaxWidth, Math.max(workbenchPanelMinWidth, width));
20
- }
21
- function beginWorkbenchPanelResize(event, current, apply) {
22
- event.preventDefault();
23
- const startX = event.clientX;
24
- const onMove = (move) => {
25
- apply(clampWorkbenchPanelWidth(current - (move.clientX - startX)));
26
- };
27
- const onUp = () => {
28
- window.removeEventListener("pointermove", onMove);
29
- window.removeEventListener("pointerup", onUp);
30
- window.removeEventListener("pointercancel", onUp);
31
- document.body.classList.remove("is-resizing-think-full-app");
32
- };
33
- document.body.classList.add("is-resizing-think-full-app");
34
- window.addEventListener("pointermove", onMove);
35
- window.addEventListener("pointerup", onUp);
36
- window.addEventListener("pointercancel", onUp);
37
- }
38
- function WorkbenchBackButton({ onBack }) {
39
- return /* @__PURE__ */ jsx(Button, {
40
- type: "button",
41
- variant: "ghost",
42
- color: "neutral",
43
- size: "icon-sm",
44
- className: "think-full-app__workspace-back",
45
- "aria-label": "Show chat",
46
- onClick: onBack,
47
- children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
48
- });
49
- }
50
- function WorkspacePanel({ source, root }) {
22
+ function WorkspacePanel({ config, workbenchNavigation }) {
51
23
  return /* @__PURE__ */ jsx(WorkspaceExplorer, {
52
24
  className: "think-full-app__workbench",
53
25
  workspace: useWorkspace({
54
- source,
55
- root
56
- })
57
- });
58
- }
59
- function WorkbenchViewItem({ children, label, value }) {
60
- return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [/* @__PURE__ */ jsx(Tooltip.Trigger, { render: /* @__PURE__ */ jsx(ToggleGroup.Item, {
61
- type: "button",
62
- className: "think-full-app__workbench-view-item",
63
- value,
64
- "aria-label": label,
65
- children
66
- }) }), /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, {
67
- side: "bottom",
68
- sideOffset: 6,
69
- children: /* @__PURE__ */ jsx(Tooltip.Popup, { children: label })
70
- }) })] });
71
- }
72
- function WorkbenchViewSwitch({ panels, value, onValueChange }) {
73
- return /* @__PURE__ */ jsx(ToggleGroup.Root, {
74
- className: "think-full-app__workbench-view-switch",
75
- size: "sm",
76
- value: [value],
77
- "aria-label": "Workbench views",
78
- onValueChange: (nextValue) => {
79
- const [next] = nextValue;
80
- if (next) onValueChange(next);
81
- },
82
- children: panels.map((panel) => /* @__PURE__ */ jsx(WorkbenchViewItem, {
83
- value: panel.id,
84
- label: panel.label,
85
- children: panel.icon
86
- }, panel.id))
26
+ source: config.source,
27
+ root: config.root,
28
+ resolveFileAsset: config.resolveFileAsset,
29
+ maxInlineAssetBytes: config.maxInlineAssetBytes
30
+ }),
31
+ navigation: config.navigation,
32
+ leading: workbenchNavigation || config.leading ? /* @__PURE__ */ jsxs(Fragment, { children: [workbenchNavigation, config.leading] }) : void 0,
33
+ actions: config.actions
87
34
  });
88
35
  }
89
36
  /** Combines ThinkChat with an optional resizable workbench shell. */
90
- function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThreadSidebarOpen, messages, onThreadSidebarOpenChange, onWorkbenchViewChange, ref, style, threadSidebar, threadSidebarOpen, workbenchPanels, workbenchView, workspace, workspaceRoot, ...props }) {
37
+ function ThinkFullApp({ agent, appBarActions, appBarLeading, appBarTitle, chat, className, defaultMobileView, defaultWorkbenchView, defaultThreadSidebarOpen, messages, mobileView, onMobileViewChange, onSelectedExecutionRunChange, onThreadSidebarOpenChange, onWorkbenchViewChange, ref, selectedExecutionRun, showExecutionWorkbench = true, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchPanels, workbenchView, workspace, ...props }) {
38
+ const appRef = React.useRef(null);
91
39
  const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
92
40
  const resolvedMessages = React.useMemo(() => {
93
41
  const approvalProps = resolveThinkApprovalProps({
@@ -109,20 +57,16 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
109
57
  approvals.refreshPendingApprovals,
110
58
  messages
111
59
  ]);
112
- const [mobileView, setMobileView] = React.useState("chat");
60
+ const [innerMobileView, setInnerMobileView] = React.useState(defaultMobileView ?? "chat");
113
61
  const [innerWorkbenchView, setInnerWorkbenchView] = React.useState(defaultWorkbenchView ?? "files");
114
- const [workbenchPanelWidth, setWorkbenchPanelWidth] = React.useState(workbenchPanelDefaultWidth);
115
- const hasWorkspace = workspace !== void 0;
116
62
  const panelContext = React.useMemo(() => ({
117
63
  agent,
118
64
  chat,
119
- workspace,
120
- workspaceRoot
65
+ workspace
121
66
  }), [
122
67
  agent,
123
68
  chat,
124
- workspace,
125
- workspaceRoot
69
+ workspace
126
70
  ]);
127
71
  const availableWorkbenchPanels = React.useMemo(() => {
128
72
  const builtInPanels = [];
@@ -130,82 +74,135 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
130
74
  id: "files",
131
75
  label: "Files",
132
76
  icon: /* @__PURE__ */ jsx(FileIcon, {}),
133
- render: () => /* @__PURE__ */ jsx(WorkspacePanel, {
134
- source: workspace,
135
- root: workspaceRoot
136
- })
77
+ render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
137
78
  });
138
- builtInPanels.push({
79
+ if (showExecutionWorkbench) builtInPanels.push({
139
80
  id: "execution",
140
81
  label: "Execution",
141
82
  icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
142
83
  render: ({ agent }) => /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
143
84
  source: agent.stub,
144
- title: "Execution"
85
+ title: "Execution",
86
+ selectedRun: selectedExecutionRun,
87
+ onSelectedRunChange: onSelectedExecutionRunChange
145
88
  })
146
89
  });
147
90
  return workbenchPanels ? [...builtInPanels, ...workbenchPanels] : builtInPanels;
148
91
  }, [
92
+ onSelectedExecutionRunChange,
93
+ selectedExecutionRun,
94
+ showExecutionWorkbench,
149
95
  workbenchPanels,
150
- workspace,
151
- workspaceRoot
96
+ workspace
152
97
  ]);
153
- const activeMobileView = mobileView === "workbench" ? "workbench" : "chat";
154
- const isMobileWorkbenchView = activeMobileView === "workbench";
98
+ const requestedMobileView = mobileView ?? innerMobileView;
155
99
  const requestedWorkbenchView = workbenchView ?? innerWorkbenchView;
156
100
  const activePanel = availableWorkbenchPanels.find((panel) => panel.id === requestedWorkbenchView) ?? availableWorkbenchPanels[0];
157
- const activeWorkbenchView = activePanel?.id ?? "execution";
158
- const mobileWorkbenchLabel = hasWorkspace && activeWorkbenchView === "files" ? "Show workbench" : `Show ${activePanel?.label.toLowerCase() ?? "workbench"}`;
101
+ const activeWorkbenchView = activePanel?.id;
102
+ const hasWorkbench = activePanel !== void 0;
103
+ const activeMobileView = hasWorkbench ? requestedMobileView : "chat";
159
104
  const showWorkbenchViewSwitch = availableWorkbenchPanels.length > 1;
160
- const showShellTopbar = showWorkbenchViewSwitch || isMobileWorkbenchView;
161
- const rootStyle = {
162
- ...style,
163
- "--think-full-app-workbench-w": `${workbenchPanelWidth}px`
164
- };
165
- const resizeWorkbenchPanelBy = (delta) => {
166
- setWorkbenchPanelWidth((current) => clampWorkbenchPanelWidth(current + delta));
167
- };
105
+ const workbenchViews = availableWorkbenchPanels;
106
+ const canEmbedWorkbenchNavigation = activeWorkbenchView === "files" || activeWorkbenchView === "execution";
107
+ const hasApplicationChrome = Boolean(appBarActions || appBarLeading || appBarTitle || threadSidebar);
108
+ const shouldRenderInlineAppBar = !threadSidebar && (hasApplicationChrome || hasWorkbench);
109
+ const hasCompactAppBar = shouldRenderInlineAppBar && !hasApplicationChrome && canEmbedWorkbenchNavigation;
110
+ const hasAppBarRow = shouldRenderInlineAppBar && !hasCompactAppBar;
168
111
  const setWorkbenchView = React.useCallback((next) => {
169
112
  if (workbenchView === void 0) setInnerWorkbenchView(next);
170
113
  onWorkbenchViewChange?.(next);
171
114
  }, [onWorkbenchViewChange, workbenchView]);
172
- const app = /* @__PURE__ */ jsxs("div", {
173
- ref,
115
+ const setMobileView = React.useCallback((next) => {
116
+ if (mobileView === void 0) setInnerMobileView(next);
117
+ onMobileViewChange?.(next);
118
+ }, [mobileView, onMobileViewChange]);
119
+ const workbenchNavigation = showWorkbenchViewSwitch ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
120
+ className: "think-full-app__embedded-view-switch",
121
+ views: workbenchViews,
122
+ value: activeWorkbenchView,
123
+ onValueChange: (next) => {
124
+ if (next) setWorkbenchView(next);
125
+ },
126
+ "aria-label": "Workbench views"
127
+ }) : null;
128
+ const renderAppTopBar = (sidebarControls) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
129
+ className: "think-full-app__app-bar",
130
+ "aria-label": "Workbench controls",
131
+ "data-mobile-view": activeMobileView,
132
+ "data-compact-only": hasCompactAppBar ? "true" : void 0,
133
+ children: [
134
+ /* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarControls?.sidebarToggle, appBarLeading] }),
135
+ appBarTitle || sidebarControls ? /* @__PURE__ */ jsxs(AppTopBar.Title, { children: [appBarTitle ? /* @__PURE__ */ jsx("span", {
136
+ className: "think-full-app__app-title",
137
+ children: appBarTitle
138
+ }) : null, sidebarControls ? /* @__PURE__ */ jsxs(Button, {
139
+ type: "button",
140
+ variant: "ghost",
141
+ color: "neutral",
142
+ size: "sm",
143
+ className: "think-full-app__thread-trigger",
144
+ "aria-controls": sidebarControls.sidebarId,
145
+ "aria-expanded": sidebarControls.sidebarOpen,
146
+ onClick: (event) => sidebarControls.toggleSidebar(event.currentTarget),
147
+ children: [
148
+ /* @__PURE__ */ jsx("span", {
149
+ className: "think-full-app__thread-trigger-title",
150
+ children: appBarTitle ?? "Threads"
151
+ }),
152
+ threadStatusSummary ? /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: threadStatusSummary }) : null,
153
+ /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })
154
+ ]
155
+ }) : null] }) : null,
156
+ /* @__PURE__ */ jsxs(AppTopBar.Trailing, { children: [
157
+ appBarActions,
158
+ showWorkbenchViewSwitch && activeWorkbenchView && !canEmbedWorkbenchNavigation ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
159
+ className: "think-full-app__workbench-view-switch",
160
+ views: workbenchViews,
161
+ value: activeWorkbenchView,
162
+ onValueChange: (next) => {
163
+ if (next) setWorkbenchView(next);
164
+ },
165
+ "aria-label": "Workbench views"
166
+ }) : null,
167
+ activePanel ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
168
+ className: "think-full-app__mobile-view-switch",
169
+ views: workbenchViews,
170
+ value: activeMobileView === "workbench" ? activePanel.id : void 0,
171
+ allowEmpty: true,
172
+ onValueChange: (next) => {
173
+ if (!next) {
174
+ setMobileView("chat");
175
+ return;
176
+ }
177
+ setWorkbenchView(next);
178
+ setMobileView("workbench");
179
+ },
180
+ "aria-label": "App views"
181
+ }) : null
182
+ ] })
183
+ ]
184
+ });
185
+ const appContent = /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
186
+ ref: mergeRefs(appRef, ref),
174
187
  className: cx("think-full-app", className),
188
+ label: "workbench",
189
+ side: "end",
190
+ defaultSize: workbenchPanelDefaultWidth,
191
+ minSize: workbenchPanelMinWidth,
192
+ maxSize: workbenchPanelMaxWidth,
193
+ keyboardStep: workbenchPanelKeyboardStep,
175
194
  "data-has-thread-sidebar": threadSidebar ? "true" : "false",
176
- "data-has-workbench-topbar": showWorkbenchViewSwitch ? "true" : "false",
195
+ "data-has-workbench": hasWorkbench ? "true" : "false",
196
+ "data-has-workbench-topbar": hasAppBarRow ? "true" : "false",
197
+ "data-has-compact-app-bar": hasCompactAppBar ? "true" : "false",
177
198
  "data-mobile-view": activeMobileView,
178
- style: rootStyle,
199
+ style,
179
200
  ...props,
180
201
  children: [
181
- showShellTopbar ? /* @__PURE__ */ jsxs("div", {
182
- className: "think-full-app__topbar",
183
- role: "toolbar",
184
- "aria-label": "Workbench controls",
185
- "data-mobile-only": showWorkbenchViewSwitch ? void 0 : "true",
186
- children: [/* @__PURE__ */ jsx(WorkbenchBackButton, { onBack: () => setMobileView("chat") }), showWorkbenchViewSwitch ? /* @__PURE__ */ jsx(WorkbenchViewSwitch, {
187
- panels: availableWorkbenchPanels,
188
- value: activeWorkbenchView,
189
- onValueChange: setWorkbenchView
190
- }) : null]
191
- }) : null,
192
- !isMobileWorkbenchView ? /* @__PURE__ */ jsx("div", {
193
- className: "think-full-app__mobile-header",
194
- role: "toolbar",
195
- "aria-label": "Workbench",
196
- children: /* @__PURE__ */ jsx(Button, {
197
- type: "button",
198
- variant: "ghost",
199
- color: "neutral",
200
- size: "icon-sm",
201
- className: "think-full-app__mobile-action",
202
- "aria-label": mobileWorkbenchLabel,
203
- onClick: () => setMobileView("workbench"),
204
- children: activePanel?.icon ?? /* @__PURE__ */ jsx(TerminalIcon, {})
205
- })
206
- }) : null,
202
+ shouldRenderInlineAppBar ? renderAppTopBar() : null,
207
203
  /* @__PURE__ */ jsx("section", {
208
204
  className: "think-full-app__chat-surface",
205
+ "data-workspace-restoration-scope": "chat",
209
206
  "aria-label": "Chat",
210
207
  children: /* @__PURE__ */ jsx("div", {
211
208
  className: "think-full-app__chat",
@@ -230,33 +227,7 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
230
227
  })
231
228
  })
232
229
  }),
233
- /* @__PURE__ */ jsx(Separator, {
234
- decorative: false,
235
- orientation: "vertical",
236
- tabIndex: 0,
237
- "aria-label": "Resize workbench panel",
238
- "aria-valuemin": workbenchPanelMinWidth,
239
- "aria-valuemax": workbenchPanelMaxWidth,
240
- "aria-valuenow": workbenchPanelWidth,
241
- className: "think-resize-handle think-full-app__resizer",
242
- onPointerDown: (event) => beginWorkbenchPanelResize(event, workbenchPanelWidth, setWorkbenchPanelWidth),
243
- onKeyDown: (event) => {
244
- if (event.key === "ArrowLeft") {
245
- event.preventDefault();
246
- resizeWorkbenchPanelBy(workbenchPanelKeyboardStep);
247
- } else if (event.key === "ArrowRight") {
248
- event.preventDefault();
249
- resizeWorkbenchPanelBy(-24);
250
- } else if (event.key === "Home") {
251
- event.preventDefault();
252
- setWorkbenchPanelWidth(workbenchPanelMinWidth);
253
- } else if (event.key === "End") {
254
- event.preventDefault();
255
- setWorkbenchPanelWidth(workbenchPanelMaxWidth);
256
- }
257
- }
258
- }),
259
- /* @__PURE__ */ jsx("aside", {
230
+ activePanel ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }), /* @__PURE__ */ jsx("aside", {
260
231
  className: "think-full-app__aside",
261
232
  "aria-label": "Workbench",
262
233
  children: /* @__PURE__ */ jsx("div", {
@@ -264,18 +235,41 @@ function ThinkFullApp({ agent, chat, className, defaultWorkbenchView, defaultThr
264
235
  children: /* @__PURE__ */ jsx("div", {
265
236
  className: "think-full-app__workbench-panel",
266
237
  "data-view": activeWorkbenchView,
267
- children: activePanel?.render(panelContext)
238
+ children: activeWorkbenchView === "files" && workspace ? /* @__PURE__ */ jsx(WorkspacePanel, {
239
+ config: workspace,
240
+ workbenchNavigation
241
+ }) : activeWorkbenchView === "execution" ? /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
242
+ source: agent.stub,
243
+ title: "Execution",
244
+ backButton: workbenchNavigation,
245
+ selectedRun: selectedExecutionRun,
246
+ onSelectedRunChange: onSelectedExecutionRunChange
247
+ }) : activePanel.render(panelContext)
268
248
  })
269
249
  })
270
- })
250
+ })] }) : null
271
251
  ]
272
252
  });
253
+ const app = workspace ? /* @__PURE__ */ jsx(WorkspaceNavigationProvider, {
254
+ root: workspace.root ?? "/",
255
+ base: {
256
+ kind: "directory",
257
+ path: workspace.root ?? "/"
258
+ },
259
+ navigation: workspace.navigation,
260
+ children: /* @__PURE__ */ jsxs(WorkspaceNavigationRestorationBoundary, { children: [/* @__PURE__ */ jsx(WorkspaceNavigationFocusRestorer, {
261
+ entryKey: workspace.navigation.current.key,
262
+ rootRef: appRef,
263
+ scope: "chat"
264
+ }), appContent] })
265
+ }) : appContent;
273
266
  if (!threadSidebar) return app;
274
267
  return /* @__PURE__ */ jsx(ThinkThreadShell, {
275
268
  sidebar: threadSidebar,
276
269
  sidebarOpen: threadSidebarOpen,
277
270
  defaultSidebarOpen: defaultThreadSidebarOpen,
278
271
  onSidebarOpenChange: onThreadSidebarOpenChange,
272
+ topBar: (controls) => renderAppTopBar(controls),
279
273
  children: app
280
274
  });
281
275
  }
@@ -0,0 +1,31 @@
1
+ import { r as ToggleGroupProps } from "../ToggleGroup-8hPv-b69.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/ThinkFullAppViewSwitch.d.ts
5
+ interface ThinkFullAppView {
6
+ id: string;
7
+ label: string;
8
+ icon: React.ReactNode;
9
+ }
10
+ interface ThinkFullAppViewSwitchProps extends Omit<ToggleGroupProps, "children" | "onValueChange" | "value"> {
11
+ views: readonly ThinkFullAppView[];
12
+ value?: string;
13
+ /** Whether pressing the selected view may clear the selection. */
14
+ allowEmpty?: boolean;
15
+ onValueChange: (value: string | undefined, eventDetails: Parameters<NonNullable<ToggleGroupProps["onValueChange"]>>[1]) => void;
16
+ }
17
+ /**
18
+ * Icon view picker shared by ThinkFullApp's wide workbench and compact app
19
+ * navigation. Base UI owns selection and roving focus; AppTopBar owns the
20
+ * toolbar control and tooltip presentation.
21
+ */
22
+ declare function ThinkFullAppViewSwitch({
23
+ allowEmpty,
24
+ className,
25
+ onValueChange,
26
+ value,
27
+ views,
28
+ ...props
29
+ }: ThinkFullAppViewSwitchProps): React.JSX.Element;
30
+ //#endregion
31
+ export { ThinkFullAppView, ThinkFullAppViewSwitch, ThinkFullAppViewSwitchProps };
@@ -0,0 +1,34 @@
1
+ import { t as cx } from "../class-names-9UtZwb0J.js";
2
+ import { AppTopBar } from "./AppTopBar.js";
3
+ import { ToggleGroup } from "./ToggleGroup.js";
4
+ import "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/ThinkFullAppViewSwitch.tsx
7
+ /**
8
+ * Icon view picker shared by ThinkFullApp's wide workbench and compact app
9
+ * navigation. Base UI owns selection and roving focus; AppTopBar owns the
10
+ * toolbar control and tooltip presentation.
11
+ */
12
+ function ThinkFullAppViewSwitch({ allowEmpty = false, className, onValueChange, value, views, ...props }) {
13
+ return /* @__PURE__ */ jsx(ToggleGroup.Root, {
14
+ className: cx("think-full-app__view-switch", className),
15
+ size: "sm",
16
+ value: value ? [value] : [],
17
+ onValueChange: (nextValue, eventDetails) => {
18
+ const [next] = nextValue;
19
+ if (next || allowEmpty) onValueChange(next, eventDetails);
20
+ },
21
+ ...props,
22
+ children: views.map((view) => /* @__PURE__ */ jsx(AppTopBar.Button, {
23
+ type: "button",
24
+ label: view.label,
25
+ render: /* @__PURE__ */ jsx(ToggleGroup.Item, {
26
+ type: "button",
27
+ value: view.id
28
+ }),
29
+ children: view.icon
30
+ }, view.id))
31
+ });
32
+ }
33
+ //#endregion
34
+ export { ThinkFullAppViewSwitch };
@@ -0,0 +1,36 @@
1
+ import { t as ThinkExecutionRun } from "../ThinkExecutionRun-ChhWhOoU.js";
2
+ import { ThinkScheduledTask } from "@cloudflare/think";
3
+ import { Schedule } from "agents";
4
+
5
+ //#region src/components/ThinkRoutine.d.ts
6
+ /** App-owned identity for the Think agent that owns a routine. */
7
+ interface ThinkRoutineOwner {
8
+ id: string;
9
+ name: string;
10
+ }
11
+ /**
12
+ * App-level routine descriptor. Scheduling and execution records remain whole
13
+ * upstream Think/Agents SDK values; only library identity and enabled state are
14
+ * app-owned because neither SDK provides a cross-agent routine catalog.
15
+ */
16
+ interface ThinkRoutine {
17
+ id: string;
18
+ name: string;
19
+ description?: string;
20
+ enabled: boolean;
21
+ owner: ThinkRoutineOwner;
22
+ task: ThinkScheduledTask;
23
+ schedule?: Schedule<unknown> | null;
24
+ runs: readonly ThinkExecutionRun[];
25
+ }
26
+ /** Preserves an app-enriched native execution type carried by a routine subtype. */
27
+ type ThinkRoutineRunOf<TRoutine extends ThinkRoutine = ThinkRoutine> = TRoutine["runs"][number];
28
+ interface ThinkRoutineCreateRequest {
29
+ name: string;
30
+ ownerId: string;
31
+ /** Whole upstream task, including prompt functions and handler tasks. */
32
+ task: ThinkScheduledTask;
33
+ }
34
+ declare function getThinkRoutineNextRun(routine: ThinkRoutine): string;
35
+ //#endregion
36
+ export { ThinkRoutine, ThinkRoutineCreateRequest, ThinkRoutineOwner, ThinkRoutineRunOf, getThinkRoutineNextRun };
@@ -0,0 +1,15 @@
1
+ //#region src/components/ThinkRoutine.ts
2
+ function getThinkRoutineNextRun(routine) {
3
+ return routine.schedule ? formatThinkExecutionDate(routine.schedule.time * 1e3, "Not scheduled") : "Pending reconciliation";
4
+ }
5
+ function formatThinkExecutionDate(value, fallback) {
6
+ const date = value instanceof Date ? value : new Date(value);
7
+ return Number.isNaN(date.getTime()) ? fallback : date.toLocaleString(void 0, {
8
+ month: "short",
9
+ day: "numeric",
10
+ hour: "numeric",
11
+ minute: "2-digit"
12
+ });
13
+ }
14
+ //#endregion
15
+ export { getThinkRoutineNextRun };
@@ -0,0 +1,25 @@
1
+ import { ThinkRoutine } from "./ThinkRoutine.js";
2
+ import * as React from "react";
3
+
4
+ //#region src/components/ThinkRoutineBrowser.d.ts
5
+ type ThinkRoutineFilter = "all" | "active" | "paused";
6
+ interface ThinkRoutineBrowserProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
7
+ routines: readonly ThinkRoutine[];
8
+ selectedRoutineId?: string;
9
+ onSelectedRoutineIdChange?: (routineId: string) => void;
10
+ onCreateRoutine?: () => void;
11
+ }
12
+ /** Searchable, filterable navigation for an app-owned collection of Think routines. */
13
+ declare function ThinkRoutineBrowser({
14
+ className,
15
+ routines,
16
+ selectedRoutineId,
17
+ onSelectedRoutineIdChange,
18
+ onCreateRoutine,
19
+ ref,
20
+ ...props
21
+ }: ThinkRoutineBrowserProps & {
22
+ ref?: React.Ref<HTMLElement>;
23
+ }): React.JSX.Element;
24
+ //#endregion
25
+ export { ThinkRoutineBrowser, ThinkRoutineBrowserProps, ThinkRoutineFilter };