@mcp-b/react-components 0.40.0 → 0.42.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 (228) hide show
  1. package/dist/{AgentChat-CVO7xyLC.d.ts → AgentChat-DVr2giwD.d.ts} +1 -1
  2. package/dist/{AgentToolRunsContext-BCVqCtJ1.d.ts → AgentToolRunsContext-daY67hFM.d.ts} +12 -0
  3. package/dist/{CodeBlock-CWk1FVtm.js → CodeBlock-BjELA-_s.js} +1 -1
  4. package/dist/{FileTree-xqHYBw4g.js → FileTree-DMYRdT6R.js} +1 -1
  5. package/dist/McpConnectorForm-MRm1r59e.d.ts +39 -0
  6. package/dist/{Message-DBsHHhcM.d.ts → Message-D_vCVEGB.d.ts} +20 -1
  7. package/dist/{ThinkChatActivity-D6-_5Phw.d.ts → ThinkChatActivity-CsDql-ER.d.ts} +4 -1
  8. package/dist/{ThinkExecutionRun-lYYgyeE1.d.ts → ThinkExecutionRun-k8bpyXqt.d.ts} +3 -3
  9. package/dist/{WorkspaceFileView-Lab3om3F.js → WorkspaceFileView-DwdXiKku.js} +17 -22
  10. package/dist/{WorkspaceMessageResponse-Cy28WGSz.d.ts → WorkspaceMessageResponse-D66ty4FO.d.ts} +1 -1
  11. package/dist/components/agents-sdk/AgentActivity.js +4 -3
  12. package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
  13. package/dist/components/agents-sdk/AgentChat.js +42 -18
  14. package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +1 -1
  15. package/dist/components/agents-sdk/AgentToolRunsContext.js +12 -0
  16. package/dist/components/agents-sdk/BrowserLiveScreen.d.ts +135 -0
  17. package/dist/components/agents-sdk/BrowserLiveScreen.js +637 -0
  18. package/dist/components/agents-sdk/BrowserLiveView.d.ts +2 -2
  19. package/dist/components/agents-sdk/BrowserLiveView.js +6 -9
  20. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  21. package/dist/components/agents-sdk/BrowserRunPanel.d.ts +1 -1
  22. package/dist/components/agents-sdk/BrowserRunPanel.js +8 -13
  23. package/dist/components/agents-sdk/ManagerOffice.d.ts +168 -0
  24. package/dist/components/agents-sdk/ManagerOffice.js +698 -0
  25. package/dist/components/agents-sdk/McpConnectionRequest.js +3 -3
  26. package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -38
  27. package/dist/components/agents-sdk/McpPluginCatalog.d.ts +8 -2
  28. package/dist/components/agents-sdk/McpPluginCatalog.js +82 -62
  29. package/dist/components/agents-sdk/McpServerPicker.d.ts +1 -1
  30. package/dist/components/agents-sdk/McpServerPicker.js +2 -2
  31. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  32. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  33. package/dist/components/agents-sdk/SubagentRunDetails.d.ts +1 -9
  34. package/dist/components/agents-sdk/SubagentRunDetails.js +1 -9
  35. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  36. package/dist/components/agents-sdk/SubagentRunSelector.d.ts +4 -2
  37. package/dist/components/agents-sdk/SubagentRunSelector.js +7 -6
  38. package/dist/components/agents-sdk/ThinkChat.d.ts +4 -4
  39. package/dist/components/agents-sdk/ThinkChatActivity.d.ts +1 -1
  40. package/dist/components/agents-sdk/ThinkChatActivity.js +18 -4
  41. package/dist/components/agents-sdk/ThinkChatToolPanels.js +7 -3
  42. package/dist/components/agents-sdk/ThinkExecutionDetail.d.ts +1 -1
  43. package/dist/components/agents-sdk/ThinkExecutionDetail.js +45 -43
  44. package/dist/components/agents-sdk/ThinkExecutionRun.d.ts +2 -2
  45. package/dist/components/agents-sdk/ThinkExecutionRun.js +5 -6
  46. package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
  47. package/dist/components/agents-sdk/ThinkExecutionStatus.js +8 -12
  48. package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +8 -1
  49. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +43 -37
  50. package/dist/components/agents-sdk/ThinkFullApp.d.ts +42 -78
  51. package/dist/components/agents-sdk/ThinkFullApp.js +121 -202
  52. package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
  53. package/dist/components/agents-sdk/ThinkRoutine.d.ts +1 -1
  54. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
  55. package/dist/components/agents-sdk/ThinkRoutineDetail.js +4 -15
  56. package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
  57. package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +7 -6
  58. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +112 -140
  59. package/dist/components/agents-sdk/ThinkRoutineRuns.d.ts +1 -1
  60. package/dist/components/agents-sdk/ThinkRoutineRuns.js +3 -10
  61. package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -1
  62. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  63. package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -1
  64. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  65. package/dist/components/agents-sdk/WorkspaceHeader.js +2 -1
  66. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +1 -1
  67. package/dist/components/agents-sdk/WorkspaceMountManager.js +11 -11
  68. package/dist/components/ai-sdk/Activity.js +1 -1
  69. package/dist/components/ai-sdk/AgentAttention.d.ts +1 -1
  70. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  71. package/dist/components/ai-sdk/Approval.js +1 -1
  72. package/dist/components/ai-sdk/Artifact.js +1 -1
  73. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  74. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  75. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  76. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  77. package/dist/components/ai-sdk/Conversation.js +1 -1
  78. package/dist/components/ai-sdk/Goal.js +1 -1
  79. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  80. package/dist/components/ai-sdk/Message.d.ts +2 -2
  81. package/dist/components/ai-sdk/Message.js +25 -3
  82. package/dist/components/ai-sdk/MessageScroller.js +3 -2
  83. package/dist/components/ai-sdk/MessageScrollerVirtual.js +2 -1
  84. package/dist/components/ai-sdk/Plan.js +1 -1
  85. package/dist/components/ai-sdk/PromptInput.js +21 -15
  86. package/dist/components/ai-sdk/Queue.d.ts +4 -4
  87. package/dist/components/ai-sdk/Queue.js +6 -15
  88. package/dist/components/ai-sdk/Reasoning.js +1 -1
  89. package/dist/components/ai-sdk/Sources.js +1 -1
  90. package/dist/components/ai-sdk/Task.d.ts +2 -2
  91. package/dist/components/ai-sdk/Task.js +2 -2
  92. package/dist/components/extension/ChatGptSignInScreen.js +2 -1
  93. package/dist/components/extension/CodexModelSelector.js +1 -1
  94. package/dist/components/extension/ConversationTabPicker.js +1 -1
  95. package/dist/components/foundations/Avatar.d.ts +1 -10
  96. package/dist/components/foundations/Avatar.js +1 -10
  97. package/dist/components/foundations/Checkbox.js +1 -1
  98. package/dist/components/foundations/CheckboxGroup.js +1 -0
  99. package/dist/components/foundations/ContextMenu.js +1 -1
  100. package/dist/components/foundations/LinkButton.d.ts +12 -10
  101. package/dist/components/foundations/LinkButton.js +15 -11
  102. package/dist/components/foundations/Menubar.js +1 -1
  103. package/dist/components/foundations/SearchField.js +1 -1
  104. package/dist/components/foundations/Select.js +1 -1
  105. package/dist/components/foundations/Stepper.js +1 -1
  106. package/dist/components/foundations/Toast.js +1 -1
  107. package/dist/components/foundations/ToggleGroup.d.ts +79 -1
  108. package/dist/components/foundations/icons.d.ts +2 -2
  109. package/dist/components/foundations/icons.js +2 -2
  110. package/dist/components/general-purpose/AppFrame.js +1 -0
  111. package/dist/components/general-purpose/AppTopBar.d.ts +6 -0
  112. package/dist/components/general-purpose/AppTopBar.js +2 -1
  113. package/dist/components/general-purpose/Commit.d.ts +2 -2
  114. package/dist/components/general-purpose/Commit.js +5 -13
  115. package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
  116. package/dist/components/general-purpose/EnvironmentVariables.js +4 -7
  117. package/dist/components/general-purpose/FileTree.js +1 -1
  118. package/dist/components/general-purpose/PricingBillingToggle.js +4 -9
  119. package/dist/components/general-purpose/PricingPlanCard.js +15 -14
  120. package/dist/components/general-purpose/ResizableSidePanel.d.ts +8 -0
  121. package/dist/components/general-purpose/ResizableSidePanel.js +3 -2
  122. package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +105 -2
  123. package/dist/components/general-purpose/ResponsiveSidebarShell.js +112 -56
  124. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  125. package/dist/components/general-purpose/Terminal.d.ts +1 -1
  126. package/dist/components/general-purpose/Terminal.js +4 -12
  127. package/dist/components/general-purpose/TestResults.d.ts +1 -1
  128. package/dist/components/general-purpose/TestResults.js +8 -21
  129. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  130. package/dist/components/general-purpose/WebPreview.d.ts +4 -1
  131. package/dist/components/general-purpose/WebPreview.js +6 -14
  132. package/dist/components/nanites/AgentConnection.js +2 -2
  133. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  134. package/dist/components/nanites/AgentToolDetail.js +6 -5
  135. package/dist/components/nanites/NaniteScene.js +11 -11
  136. package/dist/{copy-button-Bc7jsYv_.js → copy-button-lys9N_aI.js} +1 -1
  137. package/dist/{icons-DwgNir1Q.d.ts → icons-0corjfxR.d.ts} +1 -16
  138. package/dist/{icons-MmIXciMO.js → icons-CVFSeTJn.js} +2 -5
  139. package/dist/styles/accordion.css +1 -0
  140. package/dist/styles/action-guide.css +8 -7
  141. package/dist/styles/activity-header.css +13 -39
  142. package/dist/styles/activity.css +40 -55
  143. package/dist/styles/agent-attention.css +19 -19
  144. package/dist/styles/agent-chat.css +94 -42
  145. package/dist/styles/agent-connection.css +10 -4
  146. package/dist/styles/agent-tool-detail.css +5 -15
  147. package/dist/styles/alert-dialog.css +4 -4
  148. package/dist/styles/app-frame.css +1 -3
  149. package/dist/styles/app-icon.css +12 -18
  150. package/dist/styles/app-top-bar.css +31 -9
  151. package/dist/styles/approval.css +1 -0
  152. package/dist/styles/artifact.css +6 -6
  153. package/dist/styles/attachment-preview.css +5 -4
  154. package/dist/styles/avatar.css +6 -22
  155. package/dist/styles/base.css +2 -8
  156. package/dist/styles/browser-live-screen.css +38 -0
  157. package/dist/styles/browser-live-view.css +12 -4
  158. package/dist/styles/browser-replay.css +6 -6
  159. package/dist/styles/browser-run-panel.css +21 -18
  160. package/dist/styles/button.css +15 -6
  161. package/dist/styles/card.css +5 -5
  162. package/dist/styles/chatgpt-sign-in-screen.css +6 -6
  163. package/dist/styles/code-block.css +14 -13
  164. package/dist/styles/codex-model-selector.css +2 -0
  165. package/dist/styles/collapsible.css +1 -0
  166. package/dist/styles/commit.css +30 -7
  167. package/dist/styles/context.css +9 -9
  168. package/dist/styles/conversation-tab-picker.css +1 -1
  169. package/dist/styles/conversation.css +6 -8
  170. package/dist/styles/dialog.css +4 -4
  171. package/dist/styles/empty-state.css +3 -3
  172. package/dist/styles/environment-variables.css +12 -9
  173. package/dist/styles/field.css +2 -1
  174. package/dist/styles/fieldset.css +2 -2
  175. package/dist/styles/index.css +8 -7
  176. package/dist/styles/manager-office.css +480 -0
  177. package/dist/styles/mcp-plugin-catalog.css +44 -39
  178. package/dist/styles/mcp-server-picker.css +4 -4
  179. package/dist/styles/message-scroller.css +9 -11
  180. package/dist/styles/message.css +74 -28
  181. package/dist/styles/nanite-scene.css +9 -9
  182. package/dist/styles/navigation-menu.css +1 -0
  183. package/dist/styles/plan.css +13 -12
  184. package/dist/styles/pricing-page.css +37 -30
  185. package/dist/styles/prompt-input.css +26 -18
  186. package/dist/styles/queue.css +1 -0
  187. package/dist/styles/reasoning.css +1 -9
  188. package/dist/styles/recipes.css +29 -58
  189. package/dist/styles/responsive-sidebar-shell.css +107 -29
  190. package/dist/styles/separator.css +5 -5
  191. package/dist/styles/sources.css +4 -4
  192. package/dist/styles/stepper.css +1 -0
  193. package/dist/styles/streamdown.css +31 -21
  194. package/dist/styles/subagent-run.css +20 -3
  195. package/dist/styles/tabs.css +1 -0
  196. package/dist/styles/task.css +5 -17
  197. package/dist/styles/terminal.css +29 -10
  198. package/dist/styles/test-results.css +16 -7
  199. package/dist/styles/think-execution-status.css +10 -26
  200. package/dist/styles/think-execution-workbench.css +98 -108
  201. package/dist/styles/think-full-app.css +75 -225
  202. package/dist/styles/think-routine-library.css +26 -95
  203. package/dist/styles/think-thread-picker.css +17 -12
  204. package/dist/styles/transition-surface.css +7 -8
  205. package/dist/styles/utilities.css +75 -0
  206. package/dist/styles/web-preview.css +46 -22
  207. package/dist/styles/workspace-explorer.css +22 -44
  208. package/dist/styles/workspace-mount-manager.css +24 -2
  209. package/dist/utils/favicon.d.ts +6 -1
  210. package/dist/utils/favicon.js +18 -1
  211. package/package.json +37 -35
  212. package/dist/ResponsiveSidebarShell-DWjULskY.d.ts +0 -68
  213. package/dist/ToggleGroup-_pQMyHGM.d.ts +0 -80
  214. package/dist/components/agents-sdk/AgentActivityPreview.d.ts +0 -46
  215. package/dist/components/agents-sdk/AgentActivityPreview.js +0 -93
  216. package/dist/components/agents-sdk/ThinkThreadShell.d.ts +0 -38
  217. package/dist/components/agents-sdk/ThinkThreadShell.js +0 -27
  218. package/dist/components/foundations/Badge.d.ts +0 -62
  219. package/dist/components/foundations/Badge.js +0 -55
  220. package/dist/components/foundations/StatusPill.d.ts +0 -43
  221. package/dist/components/foundations/StatusPill.js +0 -35
  222. package/dist/components/general-purpose/Shell.d.ts +0 -149
  223. package/dist/components/general-purpose/Shell.js +0 -116
  224. package/dist/styles/agent-activity-preview-overlay.css +0 -169
  225. package/dist/styles/agent-activity-preview.css +0 -209
  226. package/dist/styles/badge.css +0 -120
  227. package/dist/styles/shell.css +0 -122
  228. package/dist/styles/status-pill.css +0 -39
@@ -1,28 +1,33 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { C as FileIcon, Y as SpinnerIcon, c as BoxIcon, et as TerminalIcon, f as ChevronDownIcon } from "../../icons-MmIXciMO.js";
3
- import { Button } from "../foundations/Button.js";
2
+ import { S as FileIcon, c as BoxIcon } from "../../icons-CVFSeTJn.js";
4
3
  import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
5
- import { ScrollArea } from "../foundations/ScrollArea.js";
6
- import { EmptyState } from "../foundations/EmptyState.js";
7
- import { AppTopBar } from "../general-purpose/AppTopBar.js";
8
4
  import { ResizableSidePanel } from "../general-purpose/ResizableSidePanel.js";
5
+ import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
9
6
  import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../../WorkspaceLink-DtH66bAY.js";
10
7
  import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-DkA4Wr71.js";
11
8
  import { McpPluginCatalog } from "./McpPluginCatalog.js";
12
- import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
13
9
  import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
14
10
  import { ThinkThreadStatusIndicators } from "./ThinkThreadPicker.js";
15
- import { ThinkThreadShell } from "./ThinkThreadShell.js";
16
11
  import { useWorkspace } from "./Workspace.js";
17
12
  import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
18
13
  import * as React from "react";
19
- import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
20
15
  //#region src/components/agents-sdk/ThinkFullApp.tsx
21
- const workbenchPanelDefaultWidth = 340;
22
- const workbenchPanelMinWidth = 300;
23
- const workbenchPanelMaxWidth = 600;
24
- const workbenchPanelKeyboardStep = 24;
25
- const workbenchPanelCollapseThreshold = 240;
16
+ /** Matches --sigvelo-layout-conversation (24.5rem). */
17
+ const conversationDefaultWidth = 392;
18
+ const conversationMinWidth = 320;
19
+ const conversationMaxWidth = 640;
20
+ const conversationKeyboardStep = 24;
21
+ /** Keep in lockstep with --sigvelo-layout-break-compact / the 56rem @container. */
22
+ function compactBreakPx(el) {
23
+ const raw = getComputedStyle(el).getPropertyValue("--sigvelo-layout-break-compact").trim();
24
+ if (raw.endsWith("rem")) return Number.parseFloat(raw) * Number.parseFloat(getComputedStyle(document.documentElement).fontSize);
25
+ const px = Number.parseFloat(raw);
26
+ return Number.isFinite(px) ? px : 896;
27
+ }
28
+ function isCompactApp(el) {
29
+ return el.getBoundingClientRect().width <= compactBreakPx(el);
30
+ }
26
31
  function WorkspacePanel({ config }) {
27
32
  const selectedPath = config.navigation.current.destination.kind === "file" ? config.navigation.current.destination.path : null;
28
33
  return /* @__PURE__ */ jsx(WorkspaceExplorer, {
@@ -40,12 +45,6 @@ function WorkspacePanel({ config }) {
40
45
  actions: config.actions
41
46
  });
42
47
  }
43
- function PluginsPanel({ config }) {
44
- return /* @__PURE__ */ jsxs(ScrollArea.Root, {
45
- className: "think-full-app__workbench",
46
- children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, { children: /* @__PURE__ */ jsx(ScrollArea.Content, { children: /* @__PURE__ */ jsx(McpPluginCatalog, { ...config }) }) }), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, { children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })]
47
- });
48
- }
49
48
  /**
50
49
  * Approval discovery and background-agent events need a live connection, so they
51
50
  * live here rather than in the shell, which also renders before there is one.
@@ -81,33 +80,40 @@ function ThinkFullAppThreadChat({ agent, agentTools, chat, messages, renderAgent
81
80
  })
82
81
  });
83
82
  }
84
- /** Combines ThinkChat with an optional resizable workbench shell. */
85
- function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, conversation, defaultMobileView, defaultWorkbenchOpen, defaultWorkbenchView, defaultThreadSidebarOpen, hideAppBarInWorkbench = false, messages, mobileView, onMobileViewChange, onThreadSidebarOpenChange, onWorkbenchOpenChange, onWorkbenchViewChange, plugins, ref, renderAgentToolRunLink, renderExecutionRunLink, selectedExecutionRun = null, showMobileViewSwitch = true, showWorkbenchViewSwitch = true, sourceKey, style, threadSidebar, threadSidebarOpen, threadStatusSummary, workbenchOpen, workbenchPanels, workbenchView, workspace, ...props }) {
86
- const agent = conversation?.agent;
83
+ /** Combines ThinkChat with a resizable workbench. Wide apps with a workspace
84
+ * open Files beside the conversation; compact (extension) widths stay on chat
85
+ * until a view is selected. */
86
+ function ThinkFullApp({ bar, className, conversation, defaultView: defaultViewProp, messages, onViewChange, plugins, ref, renderAgentToolRunLink, sourceKey, style, threadSidebar, threadStatusSummary, view, workbenchPanels, workspace, ...props }) {
87
87
  const appRef = React.useRef(null);
88
88
  const workbenchPanelRef = React.useRef(null);
89
89
  const pendingPanelFocusRef = React.useRef(null);
90
- const [innerMobileView, setInnerMobileView] = React.useState(defaultMobileView ?? "chat");
91
- const [innerWorkbenchView, setInnerWorkbenchView] = React.useState(defaultWorkbenchView ?? "files");
92
- const [innerWorkbenchOpen, setInnerWorkbenchOpen] = React.useState(defaultWorkbenchOpen ?? true);
93
- const requestedMobileView = mobileView ?? innerMobileView;
94
- const requestedWorkbenchView = workbenchView ?? innerWorkbenchView;
95
- const requestedWorkbenchOpen = workbenchOpen ?? innerWorkbenchOpen;
96
- const setWorkbenchView = React.useCallback((next) => {
97
- if (workbenchView === void 0) setInnerWorkbenchView(next);
98
- onWorkbenchViewChange?.(next);
99
- }, [onWorkbenchViewChange, workbenchView]);
100
- const setMobileView = React.useCallback((next) => {
101
- if (mobileView === void 0) setInnerMobileView(next);
102
- onMobileViewChange?.(next);
103
- }, [mobileView, onMobileViewChange]);
104
- const setWorkbenchOpen = React.useCallback((next) => {
105
- if (workbenchOpen === void 0) setInnerWorkbenchOpen(next);
106
- onWorkbenchOpenChange?.(next);
107
- }, [onWorkbenchOpenChange, workbenchOpen]);
108
- const updateAppView = React.useCallback((update) => {
109
- React.startTransition(update);
110
- }, []);
90
+ const [innerView, setInnerView] = React.useState(defaultViewProp ?? "chat");
91
+ const userChoseView = React.useRef(defaultViewProp !== void 0 || view !== void 0);
92
+ const requestedView = view ?? innerView;
93
+ const setView = React.useCallback((next) => {
94
+ userChoseView.current = true;
95
+ if (view === void 0) setInnerView(next);
96
+ onViewChange?.(next);
97
+ }, [onViewChange, view]);
98
+ React.useLayoutEffect(() => {
99
+ if (view !== void 0 || defaultViewProp !== void 0 || userChoseView.current) return;
100
+ if (workspace === void 0) return;
101
+ const el = appRef.current;
102
+ if (!el) return;
103
+ const syncViewToWidth = () => {
104
+ if (userChoseView.current) return;
105
+ const next = isCompactApp(el) ? "chat" : "files";
106
+ setInnerView((current) => current === next ? current : next);
107
+ };
108
+ syncViewToWidth();
109
+ const observer = new ResizeObserver(syncViewToWidth);
110
+ observer.observe(el);
111
+ return () => observer.disconnect();
112
+ }, [
113
+ defaultViewProp,
114
+ view,
115
+ workspace
116
+ ]);
111
117
  const availableWorkbenchPanels = [];
112
118
  if (workspace !== void 0) availableWorkbenchPanels.push({
113
119
  id: "files",
@@ -115,52 +121,24 @@ function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, co
115
121
  icon: /* @__PURE__ */ jsx(FileIcon, {}),
116
122
  render: () => /* @__PURE__ */ jsx(WorkspacePanel, { config: workspace })
117
123
  });
118
- if (renderExecutionRunLink && agent) availableWorkbenchPanels.push({
119
- id: "execution",
120
- label: "Execution",
121
- icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
122
- render: () => /* @__PURE__ */ jsx(React.Suspense, {
123
- fallback: /* @__PURE__ */ jsx("div", {
124
- className: "think-full-app__workbench think-full-app__workbench--loading",
125
- role: "status",
126
- children: /* @__PURE__ */ jsx(EmptyState, {
127
- icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
128
- description: "Loading execution"
129
- })
130
- }),
131
- children: /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
132
- source: agent.stub,
133
- sourceKey,
134
- title: "Execution",
135
- selectedRun: selectedExecutionRun,
136
- renderRunLink: renderExecutionRunLink
137
- })
138
- })
139
- });
140
124
  if (plugins) availableWorkbenchPanels.push({
141
125
  id: "plugins",
142
126
  label: "Plugins",
143
127
  icon: /* @__PURE__ */ jsx(BoxIcon, {}),
144
- render: () => /* @__PURE__ */ jsx(PluginsPanel, { config: plugins })
128
+ render: () => /* @__PURE__ */ jsx(McpPluginCatalog, { ...plugins })
145
129
  });
146
130
  if (workbenchPanels) availableWorkbenchPanels.push(...workbenchPanels);
147
- const selectedPanel = availableWorkbenchPanels.find((panel) => panel.id === requestedWorkbenchView) ?? availableWorkbenchPanels[0];
148
- const activePanel = requestedWorkbenchOpen ? selectedPanel : void 0;
149
- const activeWorkbenchView = activePanel?.id;
131
+ const activePanel = requestedView === "chat" ? void 0 : availableWorkbenchPanels.find((panel) => panel.id === requestedView);
150
132
  const hasWorkbench = activePanel !== void 0;
151
- const hasAvailableWorkbench = selectedPanel !== void 0;
152
- const activeMobileView = hasWorkbench ? requestedMobileView : "chat";
153
- const shouldShowWorkbenchViewSwitch = showWorkbenchViewSwitch && availableWorkbenchPanels.length > 0;
154
- const workbenchViews = availableWorkbenchPanels;
155
- const shouldRenderInlineAppBar = !threadSidebar && (Boolean(appBarActions || appBarLeading || appBarTitle || threadSidebar) || hasAvailableWorkbench);
156
- const hasAppBarRow = shouldRenderInlineAppBar;
133
+ const activeMobileView = hasWorkbench ? "workbench" : "chat";
134
+ const hasAppBarRow = Boolean(bar?.back || bar?.leading || bar?.compactLeading || bar?.title || bar?.actions || threadSidebar) || availableWorkbenchPanels.length > 0;
157
135
  React.useLayoutEffect(() => {
158
136
  const pendingFocus = pendingPanelFocusRef.current;
159
- if (!pendingFocus || pendingFocus.id !== activeWorkbenchView) return;
137
+ if (!pendingFocus || pendingFocus.id !== activePanel?.id) return;
160
138
  pendingPanelFocusRef.current = null;
161
139
  Array.from(workbenchPanelRef.current?.querySelectorAll("button") ?? []).find((button) => button.getAttribute("aria-label") === pendingFocus.label)?.focus({ preventScroll: true });
162
- }, [activeWorkbenchView]);
163
- const updateWorkbenchPanel = (next) => {
140
+ }, [activePanel?.id]);
141
+ const updateView = (next) => {
164
142
  const activeElement = document.activeElement;
165
143
  const restorePanelSwitchFocus = activeElement instanceof HTMLElement && workbenchPanelRef.current?.contains(activeElement);
166
144
  const nextLabel = availableWorkbenchPanels.find((panel) => panel.id === next)?.label;
@@ -168,137 +146,70 @@ function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, co
168
146
  id: next,
169
147
  label: nextLabel
170
148
  } : null;
171
- React.startTransition(() => setWorkbenchView(next));
149
+ React.startTransition(() => setView(next));
172
150
  };
173
- const renderAppTopBar = (sidebarControls) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
174
- className: "think-full-app__app-bar",
175
- "aria-label": "Workbench controls",
176
- "data-mobile-view": activeMobileView,
177
- children: [
178
- /* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarControls?.sidebarToggle, appBarLeading] }),
179
- appBarTitle || sidebarControls ? /* @__PURE__ */ jsxs(AppTopBar.Title, { children: [appBarTitle ? /* @__PURE__ */ jsx("span", {
180
- className: "think-full-app__app-title",
181
- children: appBarTitle
182
- }) : null, sidebarControls ? /* @__PURE__ */ jsxs(Button, {
183
- type: "button",
184
- variant: "ghost",
185
- color: "neutral",
186
- size: "sm",
187
- className: "think-full-app__thread-trigger",
188
- "aria-label": "Threads",
189
- "aria-controls": sidebarControls.sidebarId,
190
- "aria-expanded": sidebarControls.sidebarOpen,
191
- onClick: (event) => sidebarControls.toggleSidebar(event.currentTarget),
192
- children: [
193
- /* @__PURE__ */ jsx("span", {
194
- className: "think-full-app__thread-trigger-title sigvelo-truncate",
195
- children: appBarTitle ?? "Threads"
196
- }),
197
- threadStatusSummary ? /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: threadStatusSummary }) : null,
198
- /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": "true" })
199
- ]
200
- }) : null] }) : null,
201
- /* @__PURE__ */ jsxs(AppTopBar.Trailing, { children: [
202
- appBarActions,
203
- shouldShowWorkbenchViewSwitch && selectedPanel ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
204
- className: "think-full-app__workbench-view-switch",
205
- views: workbenchViews,
206
- value: activeWorkbenchView,
207
- allowEmpty: true,
208
- onValueChange: (next) => {
209
- updateAppView(() => {
210
- if (!next) {
211
- setWorkbenchOpen(false);
212
- return;
213
- }
214
- updateWorkbenchPanel(next);
215
- setWorkbenchOpen(true);
216
- });
217
- },
218
- "aria-label": "Workbench views"
219
- }) : null,
220
- selectedPanel && showMobileViewSwitch ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
221
- className: "think-full-app__mobile-view-switch",
222
- views: workbenchViews,
223
- value: activeMobileView === "workbench" ? activeWorkbenchView : void 0,
224
- allowEmpty: true,
225
- onValueChange: (next) => {
226
- updateAppView(() => {
227
- if (!next) {
228
- setMobileView("chat");
229
- return;
230
- }
231
- setWorkbenchView(next);
232
- setMobileView("workbench");
233
- });
234
- },
235
- "aria-label": "App views"
236
- }) : null
237
- ] })
238
- ]
239
- });
151
+ const viewSwitch = availableWorkbenchPanels.length ? /* @__PURE__ */ jsx(ThinkFullAppViewSwitch, {
152
+ views: availableWorkbenchPanels,
153
+ value: activePanel?.id,
154
+ allowEmpty: true,
155
+ "aria-label": "App views",
156
+ onValueChange: (next) => updateView(next ?? "chat")
157
+ }) : null;
158
+ const appBarActions = bar?.actions || viewSwitch ? /* @__PURE__ */ jsxs(Fragment, { children: [bar?.actions, viewSwitch] }) : void 0;
240
159
  const appContent = /* @__PURE__ */ jsxs(ResizableSidePanel.Root, {
241
160
  ref: mergeRefs(appRef, ref),
242
161
  className: cx("think-full-app", className),
243
162
  label: "workbench",
244
- side: "end",
245
- defaultSize: workbenchPanelDefaultWidth,
246
- minSize: workbenchPanelMinWidth,
247
- maxSize: workbenchPanelMaxWidth,
248
- keyboardStep: workbenchPanelKeyboardStep,
249
- collapseThreshold: workbenchPanelCollapseThreshold,
250
- onCollapse: () => setWorkbenchOpen(false),
251
- "data-has-thread-sidebar": threadSidebar ? "true" : "false",
163
+ side: "start",
164
+ sizeVariable: "--think-full-app-conversation-size",
165
+ defaultSize: conversationDefaultWidth,
166
+ minSize: conversationMinWidth,
167
+ maxSize: conversationMaxWidth,
168
+ keyboardStep: conversationKeyboardStep,
252
169
  "data-has-workbench": hasWorkbench ? "true" : "false",
253
- "data-has-workbench-topbar": hasAppBarRow ? "true" : "false",
254
170
  "data-mobile-view": activeMobileView,
255
171
  style,
256
172
  ...props,
257
- children: [
258
- shouldRenderInlineAppBar ? renderAppTopBar() : null,
259
- /* @__PURE__ */ jsxs("div", {
260
- className: "think-full-app__view-scope",
261
- "data-recipe": "application-plane",
262
- "data-mobile-view": activeMobileView,
263
- children: [/* @__PURE__ */ jsx("section", {
264
- className: "think-full-app__chat-surface",
265
- "data-workspace-restoration-scope": "chat",
266
- "aria-label": "Chat",
173
+ "data-recipe": "fill-host",
174
+ children: [/* @__PURE__ */ jsxs("div", {
175
+ className: "think-full-app__view-scope",
176
+ "data-mobile-view": activeMobileView,
177
+ children: [/* @__PURE__ */ jsx("section", {
178
+ className: "think-full-app__chat-surface",
179
+ "data-workspace-restoration-scope": "chat",
180
+ "aria-label": "Chat",
181
+ children: /* @__PURE__ */ jsx("div", {
182
+ className: "think-full-app__chat",
267
183
  children: /* @__PURE__ */ jsx("div", {
268
- className: "think-full-app__chat",
269
- children: /* @__PURE__ */ jsx("div", {
270
- className: "think-full-app__chat-inner",
271
- children: conversation ? /* @__PURE__ */ jsx(ThinkFullAppThreadChat, {
272
- ...conversation,
273
- messages,
274
- renderAgentToolRunLink,
275
- sourceKey
276
- }) : /* @__PURE__ */ jsx(ThinkChat.Messages, {
277
- ...messages,
278
- renderAgentToolRunLink
279
- })
184
+ className: "think-full-app__chat-inner",
185
+ children: conversation ? /* @__PURE__ */ jsx(ThinkFullAppThreadChat, {
186
+ ...conversation,
187
+ messages,
188
+ renderAgentToolRunLink,
189
+ sourceKey
190
+ }) : /* @__PURE__ */ jsx(ThinkChat.Messages, {
191
+ ...messages,
192
+ renderAgentToolRunLink
280
193
  })
281
194
  })
282
- }), activePanel ? /* @__PURE__ */ jsx("aside", {
283
- className: "think-full-app__aside",
284
- "aria-label": "Workbench",
285
- children: /* @__PURE__ */ jsx("div", {
286
- className: "think-full-app__workbench-slot",
287
- children: /* @__PURE__ */ jsx(React.ViewTransition, {
288
- default: "sigvelo-layout-transition",
289
- children: /* @__PURE__ */ jsx("div", {
290
- ref: workbenchPanelRef,
291
- className: "think-full-app__workbench-panel",
292
- "data-view": activeWorkbenchView,
293
- tabIndex: -1,
294
- children: activePanel.render()
295
- })
195
+ })
196
+ }), activePanel ? /* @__PURE__ */ jsx("aside", {
197
+ className: "think-full-app__aside",
198
+ "aria-label": "Workbench",
199
+ children: /* @__PURE__ */ jsx("div", {
200
+ className: "think-full-app__workbench-slot",
201
+ children: /* @__PURE__ */ jsx(React.ViewTransition, {
202
+ default: "sigvelo-layout-transition",
203
+ children: /* @__PURE__ */ jsx("div", {
204
+ ref: workbenchPanelRef,
205
+ className: "think-full-app__workbench-panel",
206
+ tabIndex: -1,
207
+ children: activePanel.render()
296
208
  })
297
209
  })
298
- }) : null]
299
- }),
300
- activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null
301
- ]
210
+ })
211
+ }) : null]
212
+ }), activePanel ? /* @__PURE__ */ jsx(ResizableSidePanel.Handle, { className: "think-full-app__resizer" }) : null]
302
213
  });
303
214
  const app = workspace ? /* @__PURE__ */ jsx(WorkspaceNavigationProvider, {
304
215
  root: workspace.root ?? "/",
@@ -313,14 +224,22 @@ function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, co
313
224
  scope: "chat"
314
225
  }), appContent] })
315
226
  }) : appContent;
316
- if (!threadSidebar) return app;
317
- return /* @__PURE__ */ jsx(ThinkThreadShell, {
227
+ return /* @__PURE__ */ jsx(ResponsiveSidebarShell, {
228
+ className: "think-full-app-shell",
318
229
  sidebar: threadSidebar,
319
- sidebarOpen: threadSidebarOpen,
320
- defaultSidebarOpen: defaultThreadSidebarOpen,
321
- onSidebarOpenChange: onThreadSidebarOpenChange,
322
- "data-hide-app-bar-in-workbench": hideAppBarInWorkbench ? "" : void 0,
323
- topBar: (controls) => renderAppTopBar(controls),
230
+ sidebarLabel: "threads",
231
+ showMainLabel: "Show selected thread",
232
+ bar: {
233
+ ...bar,
234
+ actions: appBarActions,
235
+ className: "think-full-app__app-bar",
236
+ label: "Workbench controls",
237
+ hidden: !hasAppBarRow,
238
+ compactTitleTrigger: threadSidebar ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
239
+ className: "sigvelo-truncate",
240
+ children: bar?.title ?? "Threads"
241
+ }), threadStatusSummary ? /* @__PURE__ */ jsx(ThinkThreadStatusIndicators, { summary: threadStatusSummary }) : null] }) : void 0
242
+ },
324
243
  children: app
325
244
  });
326
245
  }
@@ -1,4 +1,4 @@
1
- import { r as ToggleGroupProps } from "../../ToggleGroup-_pQMyHGM.js";
1
+ import { ToggleGroupProps } from "../foundations/ToggleGroup.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/agents-sdk/ThinkFullAppViewSwitch.d.ts
@@ -1,4 +1,4 @@
1
- import { t as ThinkExecutionRun } from "../../ThinkExecutionRun-lYYgyeE1.js";
1
+ import { t as ThinkExecutionRun } from "../../ThinkExecutionRun-k8bpyXqt.js";
2
2
  import { ThinkScheduledTask } from "@cloudflare/think";
3
3
  import { Schedule } from "agents";
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { U as PlusIcon } from "../../icons-MmIXciMO.js";
2
+ import { B as PlusIcon } from "../../icons-CVFSeTJn.js";
3
3
  import { buttonVariants } from "../foundations/Button.js";
4
4
  import { Tooltip } from "../foundations/Tooltip.js";
5
5
  import { t as capitalize } from "../../format-DB2mX9DA.js";
@@ -1,5 +1,4 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { Badge } from "../foundations/Badge.js";
3
2
  import { Switch } from "../foundations/Switch.js";
4
3
  import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
5
4
  import { ThinkRoutineRuns } from "./ThinkRoutineRuns.js";
@@ -25,20 +24,10 @@ function ThinkRoutineDetail({ busy = false, className, routine, showOwner = true
25
24
  className: "think-routine-library__detail-header",
26
25
  children: /* @__PURE__ */ jsxs("div", {
27
26
  className: "think-routine-library__detail-heading",
28
- children: [
29
- /* @__PURE__ */ jsx(Badge, {
30
- className: "think-routine-library__state",
31
- variant: "ghost",
32
- color: routine.enabled ? "success" : "neutral",
33
- size: "sm",
34
- children: routine.enabled ? "Active" : "Paused"
35
- }),
36
- /* @__PURE__ */ jsx("h1", {
37
- id: titleId,
38
- children: routine.name
39
- }),
40
- routine.description ? /* @__PURE__ */ jsx("p", { children: routine.description }) : null
41
- ]
27
+ children: [/* @__PURE__ */ jsx("h1", {
28
+ id: titleId,
29
+ children: routine.name
30
+ }), routine.description ? /* @__PURE__ */ jsx("p", { children: routine.description }) : null]
42
31
  })
43
32
  }),
44
33
  /* @__PURE__ */ jsxs("div", {
@@ -1,5 +1,5 @@
1
1
  import { t as cx } from "../../class-names-BiMDVpUo.js";
2
- import { Y as SpinnerIcon } from "../../icons-MmIXciMO.js";
2
+ import { K as SpinnerIcon } from "../../icons-CVFSeTJn.js";
3
3
  import { Button, buttonVariants } from "../foundations/Button.js";
4
4
  import { Field } from "../foundations/Field.js";
5
5
  import { Form } from "../foundations/Form.js";
@@ -1,3 +1,4 @@
1
+ import { AppBarSlots } from "../general-purpose/ResponsiveSidebarShell.js";
1
2
  import { ThinkRoutine, ThinkRoutineRunOf } from "./ThinkRoutine.js";
2
3
  import * as React from "react";
3
4
 
@@ -29,10 +30,11 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
29
30
  showOwner?: boolean;
30
31
  /** Host-owned catalog error shown above the library without replacing loaded routines. */
31
32
  error?: React.ReactNode;
32
- /** Product navigation rendered after the built-in schedule navigation control. */
33
- appBarLeading?: React.ReactNode;
34
- /** Product navigation rendered before the selected schedule actions. */
35
- appBarActions?: React.ReactNode;
33
+ /**
34
+ * Application bar slots. `title` defaults to the selected schedule's name;
35
+ * `actions` render before the built-in schedule actions.
36
+ */
37
+ bar?: AppBarSlots;
36
38
  /** Starts the selected routine immediately. */
37
39
  onRunRoutine?: (routine: TRoutine) => void | Promise<void>;
38
40
  /** Activates or pauses the selected app-owned routine. */
@@ -54,8 +56,7 @@ interface ThinkRoutineLibraryProps<TRoutine extends ThinkRoutine = ThinkRoutine>
54
56
  * route and may also use these surfaces independently.
55
57
  */
56
58
  declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutine>({
57
- appBarActions,
58
- appBarLeading,
59
+ bar,
59
60
  className,
60
61
  createRoutineLink,
61
62
  error: catalogError,