@mcp-b/react-components 0.16.1 → 0.17.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 (284) hide show
  1. package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-CRuMi1Pb.d.ts} +4 -10
  2. package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
  3. package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
  4. package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Co1noLbC.js} +2 -2
  5. package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-Dnpr88ZQ.d.ts} +2 -2
  6. package/dist/Collapsible-N64ASIQr.d.ts +119 -0
  7. package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
  8. package/dist/{FileTree-CkVbIMWV.js → FileTree-B7bBsUyU.js} +7 -7
  9. package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
  10. package/dist/{Message-BkMdE3bS.js → Message-C4eYRogZ.js} +3 -3
  11. package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-BNrZlY_Y.js} +5 -5
  12. package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-OLfXPuHM.d.ts} +39 -67
  13. package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
  14. package/dist/{Select-BeEsefzh.d.ts → Select-CwSqP07Y.d.ts} +14 -42
  15. package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-9zddXDQo.d.ts} +5 -19
  16. package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-DInElus-.js} +53 -26
  17. package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-BgesTfZ4.d.ts} +12 -4
  18. package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
  19. package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
  20. package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-DaXpe1Lc.d.ts} +1 -1
  21. package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-yseEWkOC.d.ts} +3 -4
  22. package/dist/{Workspace-D39LxGvP.d.ts → Workspace-C9RFoxcu.d.ts} +1 -1
  23. package/dist/WorkspaceExplorer-sZewzT2O.d.ts +32 -0
  24. package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-C8UzuSH4.d.ts} +1 -1
  25. package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-DNdGAEiX.js} +5 -5
  26. package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-B1ykV1dS.js} +15 -29
  27. package/dist/class-names-Bk-QLWWI.js +11 -0
  28. package/dist/components/Accordion.d.ts +5 -15
  29. package/dist/components/Accordion.js +11 -10
  30. package/dist/components/Activity.d.ts +5 -10
  31. package/dist/components/Activity.js +2 -2
  32. package/dist/components/AgentActivity.js +1 -1
  33. package/dist/components/AgentActivityPreview.js +2 -2
  34. package/dist/components/AgentAttention.d.ts +1 -1
  35. package/dist/components/AgentAttention.js +1 -1
  36. package/dist/components/AgentChat.d.ts +2 -2
  37. package/dist/components/AgentChat.js +27 -164
  38. package/dist/components/AgentChatMessageEditor.js +1 -1
  39. package/dist/components/AgentConnection.js +4 -4
  40. package/dist/components/AgentMessageParts.d.ts +2 -0
  41. package/dist/components/AgentMessageParts.js +119 -0
  42. package/dist/components/AgentToolDetail.d.ts +55 -0
  43. package/dist/components/AgentToolDetail.js +98 -0
  44. package/dist/components/AgentToolRunsContext.d.ts +2 -0
  45. package/dist/components/AgentToolRunsContext.js +16 -0
  46. package/dist/components/AlertDialog.d.ts +7 -19
  47. package/dist/components/AlertDialog.js +21 -32
  48. package/dist/components/AppTopBar.d.ts +4 -1
  49. package/dist/components/AppTopBar.js +5 -5
  50. package/dist/components/Approval.d.ts +102 -0
  51. package/dist/components/Approval.js +227 -0
  52. package/dist/components/Artifact.d.ts +2 -4
  53. package/dist/components/Artifact.js +3 -3
  54. package/dist/components/Autocomplete.d.ts +11 -33
  55. package/dist/components/Autocomplete.js +23 -30
  56. package/dist/components/Avatar.d.ts +3 -11
  57. package/dist/components/Avatar.js +13 -12
  58. package/dist/components/BrowserLiveView.js +2 -2
  59. package/dist/components/BrowserReplay.js +2 -2
  60. package/dist/components/BrowserRunPanel.js +58 -78
  61. package/dist/components/Button.js +4 -9
  62. package/dist/components/ChainOfThought.d.ts +5 -11
  63. package/dist/components/ChainOfThought.js +3 -2
  64. package/dist/components/ChatGptSignInScreen.js +3 -3
  65. package/dist/components/Checkbox.d.ts +2 -4
  66. package/dist/components/Checkbox.js +6 -5
  67. package/dist/components/CheckboxGroup.d.ts +1 -3
  68. package/dist/components/CheckboxGroup.js +15 -14
  69. package/dist/components/Checkpoint.d.ts +64 -0
  70. package/dist/components/Checkpoint.js +63 -0
  71. package/dist/components/CodeBlock.d.ts +1 -1
  72. package/dist/components/CodeBlock.js +1 -1
  73. package/dist/components/CodexModelSelector.d.ts +1 -1
  74. package/dist/components/CodexModelSelector.js +2 -2
  75. package/dist/components/Collapsible.d.ts +1 -124
  76. package/dist/components/Collapsible.js +7 -10
  77. package/dist/components/Combobox.d.ts +1 -1
  78. package/dist/components/Combobox.js +23 -30
  79. package/dist/components/Commit.d.ts +5 -11
  80. package/dist/components/Commit.js +6 -5
  81. package/dist/components/Context.js +1 -1
  82. package/dist/components/ContextMenu.d.ts +21 -37
  83. package/dist/components/ContextMenu.js +34 -51
  84. package/dist/components/Conversation.d.ts +2 -4
  85. package/dist/components/Conversation.js +2 -2
  86. package/dist/components/DescriptionListParts.js +1 -1
  87. package/dist/components/Dialog.d.ts +6 -17
  88. package/dist/components/Dialog.js +17 -24
  89. package/dist/components/EnvironmentVariables.d.ts +1 -1
  90. package/dist/components/EnvironmentVariables.js +4 -3
  91. package/dist/components/Field.d.ts +17 -20
  92. package/dist/components/Field.js +16 -16
  93. package/dist/components/Fieldset.d.ts +2 -7
  94. package/dist/components/Fieldset.js +7 -6
  95. package/dist/components/FileTree.js +1 -1
  96. package/dist/components/Form.d.ts +1 -4
  97. package/dist/components/Form.js +3 -2
  98. package/dist/components/GithubMotionMark.js +1 -1
  99. package/dist/components/InlineCitation.d.ts +66 -0
  100. package/dist/components/InlineCitation.js +142 -0
  101. package/dist/components/Input.d.ts +1 -4
  102. package/dist/components/Input.js +3 -2
  103. package/dist/components/Marker.js +1 -1
  104. package/dist/components/McpConnectionRequest.js +2 -2
  105. package/dist/components/McpServerPicker.d.ts +1 -1
  106. package/dist/components/McpServerPicker.js +6 -5
  107. package/dist/components/Menu.d.ts +1 -1
  108. package/dist/components/Menu.js +33 -52
  109. package/dist/components/Menubar.d.ts +22 -43
  110. package/dist/components/Menubar.js +36 -53
  111. package/dist/components/Message.d.ts +3 -6
  112. package/dist/components/Message.js +1 -1
  113. package/dist/components/MessageScroller.d.ts +1 -1
  114. package/dist/components/MessageScroller.js +3 -3
  115. package/dist/components/Meter.d.ts +5 -20
  116. package/dist/components/Meter.js +11 -10
  117. package/dist/components/ModelSelector.d.ts +2 -6
  118. package/dist/components/ModelSelector.js +1 -1
  119. package/dist/components/NavigationMenu.d.ts +11 -33
  120. package/dist/components/NavigationMenu.js +23 -30
  121. package/dist/components/NumberField.d.ts +6 -24
  122. package/dist/components/NumberField.js +13 -12
  123. package/dist/components/Plan.d.ts +103 -0
  124. package/dist/components/Plan.js +113 -0
  125. package/dist/components/Popover.d.ts +9 -36
  126. package/dist/components/Popover.js +23 -34
  127. package/dist/components/PreviewCard.d.ts +6 -24
  128. package/dist/components/PreviewCard.js +13 -24
  129. package/dist/components/PricingBillingToggle.js +1 -1
  130. package/dist/components/PricingFAQ.js +1 -1
  131. package/dist/components/PricingPlanCard.js +3 -3
  132. package/dist/components/PricingUsageCalculator.js +2 -2
  133. package/dist/components/Progress.d.ts +3 -8
  134. package/dist/components/Progress.js +7 -10
  135. package/dist/components/PromptInput.d.ts +2 -2
  136. package/dist/components/PromptInput.js +52 -200
  137. package/dist/components/Queue.d.ts +6 -16
  138. package/dist/components/Queue.js +2 -2
  139. package/dist/components/RadioGroup.d.ts +3 -8
  140. package/dist/components/RadioGroup.js +7 -10
  141. package/dist/components/Reasoning.d.ts +4 -8
  142. package/dist/components/Reasoning.js +3 -3
  143. package/dist/components/ResizableSidePanel.js +2 -2
  144. package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
  145. package/dist/components/ResponsiveSidebarShell.js +4 -3
  146. package/dist/components/ScrollArea.d.ts +5 -20
  147. package/dist/components/ScrollArea.js +11 -10
  148. package/dist/components/Select.d.ts +1 -1
  149. package/dist/components/Select.js +32 -55
  150. package/dist/components/Separator.d.ts +1 -5
  151. package/dist/components/Separator.js +3 -6
  152. package/dist/components/Slider.d.ts +6 -19
  153. package/dist/components/Slider.js +15 -14
  154. package/dist/components/Sources.d.ts +4 -9
  155. package/dist/components/Sources.js +3 -2
  156. package/dist/components/Stepper.js +2 -2
  157. package/dist/components/SubagentRunDetails.js +1 -1
  158. package/dist/components/SubagentRunIndicator.js +2 -2
  159. package/dist/components/SubagentRunList.js +1 -2
  160. package/dist/components/SubagentRunSelector.d.ts +2 -11
  161. package/dist/components/SubagentRunSelector.js +16 -15
  162. package/dist/components/Switch.d.ts +2 -5
  163. package/dist/components/Switch.js +5 -8
  164. package/dist/components/Tabs.d.ts +2 -2
  165. package/dist/components/Tabs.js +10 -16
  166. package/dist/components/Task.d.ts +4 -9
  167. package/dist/components/Task.js +4 -3
  168. package/dist/components/Terminal.d.ts +2 -3
  169. package/dist/components/Terminal.js +3 -3
  170. package/dist/components/TestResults.d.ts +4 -9
  171. package/dist/components/TestResults.js +3 -2
  172. package/dist/components/Textarea.js +1 -1
  173. package/dist/components/ThemeModeControl.js +1 -1
  174. package/dist/components/ThinkChat.d.ts +21 -11
  175. package/dist/components/ThinkChat.js +5 -3
  176. package/dist/components/ThinkChatActivity.d.ts +1 -1
  177. package/dist/components/ThinkChatActivity.js +26 -7
  178. package/dist/components/ThinkChatContext.d.ts +1 -1
  179. package/dist/components/ThinkChatToolPanels.js +2 -2
  180. package/dist/components/ThinkExecutionDetail.js +2 -2
  181. package/dist/components/ThinkExecutionStatus.js +2 -2
  182. package/dist/components/ThinkExecutionWorkbench.js +2 -2
  183. package/dist/components/ThinkFullApp.d.ts +33 -9
  184. package/dist/components/ThinkFullApp.js +98 -69
  185. package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
  186. package/dist/components/ThinkFullAppViewSwitch.js +2 -2
  187. package/dist/components/ThinkPendingApproval.d.ts +60 -0
  188. package/dist/components/ThinkPendingApproval.js +99 -0
  189. package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
  190. package/dist/components/ThinkRecoveryNotice.js +40 -0
  191. package/dist/components/ThinkRoutine.js +1 -0
  192. package/dist/components/ThinkRoutineBrowser.js +6 -6
  193. package/dist/components/ThinkRoutineDetail.js +1 -1
  194. package/dist/components/ThinkRoutineForm.js +2 -2
  195. package/dist/components/ThinkRoutineLibrary.d.ts +9 -0
  196. package/dist/components/ThinkRoutineLibrary.js +67 -20
  197. package/dist/components/ThinkRoutineRuns.js +1 -1
  198. package/dist/components/ThinkThreadPicker.js +2 -2
  199. package/dist/components/ThinkThreadShell.d.ts +1 -1
  200. package/dist/components/Toast.d.ts +7 -28
  201. package/dist/components/Toast.js +15 -14
  202. package/dist/components/Toggle.d.ts +1 -1
  203. package/dist/components/Toggle.js +5 -5
  204. package/dist/components/ToggleGroup.d.ts +1 -1
  205. package/dist/components/ToggleGroup.js +8 -15
  206. package/dist/components/ToolApproval.d.ts +28 -0
  207. package/dist/components/ToolApproval.js +35 -0
  208. package/dist/components/ToolInvocation.d.ts +26 -0
  209. package/dist/components/ToolInvocation.js +72 -0
  210. package/dist/components/Toolbar.d.ts +6 -24
  211. package/dist/components/Toolbar.js +13 -12
  212. package/dist/components/Tooltip.d.ts +3 -9
  213. package/dist/components/Tooltip.js +7 -10
  214. package/dist/components/WebPreview.d.ts +1 -2
  215. package/dist/components/WebPreview.js +4 -3
  216. package/dist/components/Workspace.d.ts +1 -1
  217. package/dist/components/Workspace.js +5 -20
  218. package/dist/components/WorkspaceBrowser.d.ts +1 -1
  219. package/dist/components/WorkspaceBrowser.js +3 -3
  220. package/dist/components/WorkspaceExplorer.d.ts +3 -31
  221. package/dist/components/WorkspaceExplorer.js +3 -3
  222. package/dist/components/WorkspaceFile.d.ts +1 -1
  223. package/dist/components/WorkspaceFileView.d.ts +1 -1
  224. package/dist/components/WorkspaceFileView.js +1 -1
  225. package/dist/components/WorkspaceHeader.js +1 -1
  226. package/dist/components/WorkspaceLink.js +1 -1
  227. package/dist/components/icons.d.ts +2 -2
  228. package/dist/components/icons.js +2 -2
  229. package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-CQx3LQAC.d.ts} +1 -2
  230. package/dist/{copy-button-Dejn5heL.js → copy-button-cYsJBauI.js} +1 -1
  231. package/dist/{icons-CpfUer49.js → icons--FqCZEc3.js} +3 -2
  232. package/dist/{icons-GQd1xF4e.d.ts → icons-DpUqY8Mp.d.ts} +6 -1
  233. package/dist/styles/agent-activity-preview.css +4 -0
  234. package/dist/styles/agent-chat.css +0 -41
  235. package/dist/styles/agent-connection.css +0 -12
  236. package/dist/styles/agent-tool-detail.css +54 -0
  237. package/dist/styles/approval.css +172 -0
  238. package/dist/styles/artifact.css +0 -12
  239. package/dist/styles/browser-run-panel.css +5 -2
  240. package/dist/styles/chain-of-thought.css +0 -8
  241. package/dist/styles/checkpoint.css +58 -0
  242. package/dist/styles/combobox.css +1 -1
  243. package/dist/styles/commit.css +0 -21
  244. package/dist/styles/context-menu.css +0 -8
  245. package/dist/styles/environment-variables.css +0 -13
  246. package/dist/styles/file-tree.css +0 -16
  247. package/dist/styles/index.css +8 -4
  248. package/dist/styles/inline-citation.css +107 -0
  249. package/dist/styles/mcp-server-picker.css +0 -30
  250. package/dist/styles/menu.css +0 -29
  251. package/dist/styles/menubar.css +0 -8
  252. package/dist/styles/message-scroller.css +0 -12
  253. package/dist/styles/message.css +0 -12
  254. package/dist/styles/model-selector.css +0 -20
  255. package/dist/styles/plan.css +127 -0
  256. package/dist/styles/popover.css +0 -36
  257. package/dist/styles/prompt-input.css +2 -195
  258. package/dist/styles/recipes.css +114 -5
  259. package/dist/styles/responsive-sidebar-shell.css +16 -19
  260. package/dist/styles/sources.css +0 -8
  261. package/dist/styles/subagent-run.css +12 -70
  262. package/dist/styles/task.css +0 -16
  263. package/dist/styles/test-results.css +0 -13
  264. package/dist/styles/think-full-app.css +12 -38
  265. package/dist/styles/think-routine-library.css +12 -20
  266. package/dist/styles/think-thread-picker.css +15 -0
  267. package/dist/styles/toast.css +0 -7
  268. package/dist/styles/utilities.css +31 -0
  269. package/dist/styles/web-preview.css +0 -21
  270. package/dist/styles/workspace-explorer.css +5 -55
  271. package/dist/think-agent-Cip5KAPj.d.ts +7 -0
  272. package/dist/utils/codex-model-catalog.d.ts +4 -4
  273. package/dist/utils/structured-code.d.ts +1 -1
  274. package/dist/workspace-path-L_KmjRjq.js +26 -0
  275. package/package.json +3 -4
  276. package/dist/class-names-9UtZwb0J.js +0 -12
  277. package/dist/components/AppFrame.d.ts +0 -24
  278. package/dist/components/AppFrame.js +0 -25
  279. package/dist/components/Shell.d.ts +0 -163
  280. package/dist/components/Shell.js +0 -137
  281. package/dist/components/SubagentRun.d.ts +0 -86
  282. package/dist/components/SubagentRun.js +0 -108
  283. package/dist/styles/app-frame.css +0 -15
  284. package/dist/styles/shell.css +0 -122
@@ -1,20 +1,25 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { B as SpinnerIcon, P as PlayIcon, h as EllipsisIcon, n as ArrowLeftIcon, q as WarningIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-Bk-QLWWI.js";
2
+ import { F as PlayIcon, J as WarningIcon, V as SpinnerIcon, g as EllipsisIcon, n as ArrowLeftIcon } from "../icons--FqCZEc3.js";
3
+ import { Button } from "./Button.js";
3
4
  import { Menu } from "./Menu.js";
4
5
  import { AppTopBar } from "./AppTopBar.js";
6
+ import { AlertDialog } from "./AlertDialog.js";
5
7
  import { ResponsiveSidebarShell } from "./ResponsiveSidebarShell.js";
6
8
  import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
7
9
  import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
8
10
  import { ThinkRoutineForm } from "./ThinkRoutineForm.js";
9
11
  import * as React from "react";
10
- import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
13
  //#region src/components/ThinkRoutineLibrary.tsx
12
14
  function errorMessage(error) {
13
15
  return error instanceof Error ? error.message : String(error);
14
16
  }
15
- function RoutineTopBarActions({ busy, onDelete, onRun }) {
16
- if (!onRun && !onDelete) return null;
17
- return /* @__PURE__ */ jsxs(AppTopBar.Trailing, {
17
+ function RoutineTopBarActions({ busy, onDelete, onEdit, onRun, routineName }) {
18
+ const [deleteOpen, setDeleteOpen] = React.useState(false);
19
+ const moreActionsRef = React.useRef(null);
20
+ const hasMenu = Boolean(onEdit || onDelete);
21
+ if (!onRun && !hasMenu) return null;
22
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(AppTopBar.Trailing, {
18
23
  "aria-label": "Schedule actions",
19
24
  children: [onRun ? /* @__PURE__ */ jsx(AppTopBar.Button, {
20
25
  label: "Run schedule",
@@ -22,23 +27,52 @@ function RoutineTopBarActions({ busy, onDelete, onRun }) {
22
27
  disabled: busy,
23
28
  onClick: onRun,
24
29
  children: busy ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
25
- }) : null, onDelete ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
30
+ }) : null, hasMenu ? /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
26
31
  label: "More schedule actions",
27
32
  tooltip: "More actions",
28
33
  disabled: busy,
29
- render: /* @__PURE__ */ jsx(Menu.Trigger, { unstyled: true }),
34
+ render: /* @__PURE__ */ jsx(Menu.Trigger, {
35
+ ref: moreActionsRef,
36
+ unstyled: true
37
+ }),
30
38
  children: /* @__PURE__ */ jsx(EllipsisIcon, {})
31
39
  }), /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
32
40
  align: "end",
33
41
  sideOffset: 4,
34
- children: /* @__PURE__ */ jsx(Menu.Popup, { children: /* @__PURE__ */ jsx(Menu.Item, {
42
+ children: /* @__PURE__ */ jsxs(Menu.Popup, { children: [onEdit ? /* @__PURE__ */ jsx(Menu.Item, {
43
+ onClick: onEdit,
44
+ children: "Edit schedule"
45
+ }) : null, onDelete ? /* @__PURE__ */ jsx(Menu.Item, {
35
46
  variant: "destructive",
36
47
  disabled: busy,
37
- onClick: onDelete,
48
+ onClick: () => setDeleteOpen(true),
38
49
  children: "Delete schedule"
39
- }) })
50
+ }) : null] })
40
51
  }) })] }) : null]
41
- });
52
+ }), onDelete ? /* @__PURE__ */ jsx(AlertDialog.Root, {
53
+ open: deleteOpen,
54
+ onOpenChange: setDeleteOpen,
55
+ children: /* @__PURE__ */ jsxs(AlertDialog.Portal, { children: [/* @__PURE__ */ jsx(AlertDialog.Backdrop, {}), /* @__PURE__ */ jsx(AlertDialog.Viewport, { children: /* @__PURE__ */ jsxs(AlertDialog.Popup, {
56
+ finalFocus: moreActionsRef,
57
+ children: [
58
+ /* @__PURE__ */ jsxs(AlertDialog.Title, { children: [
59
+ "Delete ",
60
+ routineName,
61
+ "?"
62
+ ] }),
63
+ /* @__PURE__ */ jsx(AlertDialog.Description, { children: "This permanently deletes the schedule and stops its future runs." }),
64
+ /* @__PURE__ */ jsxs(AlertDialog.Footer, { children: [/* @__PURE__ */ jsx(AlertDialog.Close, {
65
+ disabled: busy,
66
+ children: "Cancel"
67
+ }), /* @__PURE__ */ jsx(AlertDialog.Close, {
68
+ variant: "destructive",
69
+ disabled: busy,
70
+ onClick: onDelete,
71
+ children: "Delete schedule"
72
+ })] })
73
+ ]
74
+ }) })] })
75
+ }) : null] });
42
76
  }
43
77
  /**
44
78
  * Full-page, cross-agent routine library. This intentionally does not live in
@@ -48,7 +82,7 @@ function RoutineTopBarActions({ busy, onDelete, onRun }) {
48
82
  * `ThinkRoutineRuns`, and `ThinkRoutineForm`; consumers may also use those
49
83
  * surfaces independently.
50
84
  */
51
- function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRoutine, onDeleteRoutine, onRoutineEnabledChange, onRunRoutine, onRunSelect, onSelectedRoutineIdChange, owners, renderRoutineDetail, schedules, ref, routines, selectedRoutineId, ...props }) {
85
+ function ThinkRoutineLibrary({ appBarLeading, className, defaultSelectedRoutineId, onCreateRoutine, onCreateRoutineRequest, onDeleteRoutine, onEditRoutine, onRoutineEnabledChange, onRunRoutine, onRunSelect, onSelectedRoutineIdChange, owners, renderRoutineDetail, schedules, ref, routines, selectedRoutineId, ...props }) {
52
86
  const [view, setView] = React.useState("library");
53
87
  const [innerSelectedId, setInnerSelectedId] = React.useState(defaultSelectedRoutineId ?? routines[0]?.id ?? "");
54
88
  const [busy, setBusy] = React.useState(false);
@@ -56,6 +90,7 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
56
90
  const [error, setError] = React.useState(null);
57
91
  const activeId = selectedRoutineId ?? innerSelectedId;
58
92
  const selectedRoutine = routines.find((routine) => routine.id === activeId) ?? (selectedRoutineId === void 0 ? routines[0] : void 0);
93
+ const requestCreate = onCreateRoutineRequest ?? (onCreateRoutine ? () => setView("create") : void 0);
59
94
  const selectRoutine = (id) => {
60
95
  if (selectedRoutineId === void 0) setInnerSelectedId(id);
61
96
  onSelectedRoutineIdChange?.(id);
@@ -92,11 +127,11 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
92
127
  }) : null,
93
128
  /* @__PURE__ */ jsxs(AppTopBar.Root, {
94
129
  "aria-label": "Schedule editor controls",
95
- children: [/* @__PURE__ */ jsx(AppTopBar.Leading, { children: /* @__PURE__ */ jsx(AppTopBar.Button, {
130
+ children: [/* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [/* @__PURE__ */ jsx(AppTopBar.Button, {
96
131
  label: "Back to schedules",
97
132
  onClick: () => setView("library"),
98
133
  children: /* @__PURE__ */ jsx(ArrowLeftIcon, {})
99
- }) }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "New schedule" })]
134
+ }), appBarLeading] }), /* @__PURE__ */ jsx(AppTopBar.Title, { children: "New schedule" })]
100
135
  }),
101
136
  /* @__PURE__ */ jsx(ThinkRoutineForm, {
102
137
  busy,
@@ -111,7 +146,7 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
111
146
  }
112
147
  }),
113
148
  /* @__PURE__ */ jsx("div", {
114
- className: "think-routine-library__status",
149
+ className: "think-routine-library__status sigvelo-visually-hidden",
115
150
  role: "status",
116
151
  "aria-atomic": "true",
117
152
  children: announcement
@@ -136,11 +171,13 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
136
171
  topBar: ({ sidebarToggle }) => /* @__PURE__ */ jsxs(AppTopBar.Root, {
137
172
  "aria-label": "Schedule controls",
138
173
  children: [
139
- /* @__PURE__ */ jsx(AppTopBar.Leading, { children: sidebarToggle }),
174
+ /* @__PURE__ */ jsxs(AppTopBar.Leading, { children: [sidebarToggle, appBarLeading] }),
140
175
  /* @__PURE__ */ jsx(AppTopBar.Title, { children: selectedRoutine?.name ?? "Schedules" }),
141
176
  /* @__PURE__ */ jsx(RoutineTopBarActions, {
142
177
  busy,
178
+ routineName: selectedRoutine?.name ?? "schedule",
143
179
  onRun: selectedRoutine && onRunRoutine ? () => void perform(() => onRunRoutine(selectedRoutine), `Started ${selectedRoutine.name}.`) : void 0,
180
+ onEdit: selectedRoutine && onEditRoutine ? () => onEditRoutine(selectedRoutine) : void 0,
144
181
  onDelete: selectedRoutine && onDeleteRoutine ? () => void perform(() => onDeleteRoutine(selectedRoutine), `Deleted ${selectedRoutine.name}.`) : void 0
145
182
  })
146
183
  ]
@@ -148,7 +185,7 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
148
185
  sidebar: ({ closeSidebarOnCompact }) => /* @__PURE__ */ jsx(ThinkRoutineBrowser, {
149
186
  routines,
150
187
  selectedRoutineId: selectedRoutine?.id,
151
- onCreateRoutine: onCreateRoutine ? () => setView("create") : void 0,
188
+ onCreateRoutine: requestCreate,
152
189
  onSelectedRoutineIdChange: (id) => {
153
190
  selectRoutine(id);
154
191
  closeSidebarOnCompact();
@@ -161,12 +198,22 @@ function ThinkRoutineLibrary({ className, defaultSelectedRoutineId, onCreateRout
161
198
  defaultDetail: /* @__PURE__ */ jsx(ThinkRoutineDetail, { ...detailProps })
162
199
  }) : /* @__PURE__ */ jsx(ThinkRoutineDetail, { ...detailProps }) }, detailProps.routine.id) : /* @__PURE__ */ jsxs("div", {
163
200
  className: "think-routine-library__empty-detail",
164
- children: [/* @__PURE__ */ jsx("h1", { children: routines.length ? "Schedule unavailable" : "No schedules yet" }), /* @__PURE__ */ jsx("p", { children: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts." })]
201
+ children: [
202
+ /* @__PURE__ */ jsx("h1", { children: routines.length ? "Schedule unavailable" : "No schedules yet" }),
203
+ /* @__PURE__ */ jsx("p", { children: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts." }),
204
+ !routines.length && requestCreate ? /* @__PURE__ */ jsx(Button, {
205
+ className: "think-routine-library__empty-action",
206
+ type: "button",
207
+ color: "primary",
208
+ onClick: requestCreate,
209
+ children: "Create schedule"
210
+ }) : null
211
+ ]
165
212
  })
166
213
  })
167
214
  }),
168
215
  /* @__PURE__ */ jsx("div", {
169
- className: "think-routine-library__status",
216
+ className: "think-routine-library__status sigvelo-visually-hidden",
170
217
  role: "status",
171
218
  "aria-atomic": "true",
172
219
  children: announcement
@@ -1,4 +1,4 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
1
+ import { t as cx } from "../class-names-Bk-QLWWI.js";
2
2
  import { Button } from "./Button.js";
3
3
  import { Badge } from "./Badge.js";
4
4
  import { formatThinkExecutionShortTimestamp, getThinkExecutionRunId, getThinkExecutionRunStatus, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
@@ -1,5 +1,5 @@
1
- import { t as cx } from "../class-names-9UtZwb0J.js";
2
- import { B as SpinnerIcon, F as PlusIcon, p as DotIcon, q as WarningIcon } from "../icons-CpfUer49.js";
1
+ import { t as cx } from "../class-names-Bk-QLWWI.js";
2
+ import { I as PlusIcon, J as WarningIcon, V as SpinnerIcon, m as DotIcon } from "../icons--FqCZEc3.js";
3
3
  import { Button } from "./Button.js";
4
4
  import { ScrollArea } from "./ScrollArea.js";
5
5
  import "react";
@@ -1,4 +1,4 @@
1
- import { t as ResponsiveSidebarShell } from "../ResponsiveSidebarShell-Dd9DCcBT.js";
1
+ import { t as ResponsiveSidebarShell } from "../ResponsiveSidebarShell-CsAh4NyL.js";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/components/ThinkThreadShell.d.ts
@@ -9,52 +9,31 @@ interface ToastProviderProps extends React.ComponentPropsWithoutRef<typeof Toast
9
9
  /**
10
10
  * Props for the Toast.Viewport component.
11
11
  */
12
- interface ToastViewportProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Viewport>, "className"> {
13
- /** Additional CSS class names */
14
- className?: string;
15
- }
12
+ interface ToastViewportProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Viewport> {}
16
13
  /**
17
14
  * Props for the Toast.Root component.
18
15
  */
19
- interface ToastRootProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Root>, "className"> {
20
- /** Additional CSS class names */
21
- className?: string;
22
- }
16
+ interface ToastRootProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Root> {}
23
17
  /**
24
18
  * Props for the Toast.Content component.
25
19
  */
26
- interface ToastContentProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Content>, "className"> {
27
- /** Additional CSS class names */
28
- className?: string;
29
- }
20
+ interface ToastContentProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Content> {}
30
21
  /**
31
22
  * Props for the Toast.Title component.
32
23
  */
33
- interface ToastTitleProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Title>, "className"> {
34
- /** Additional CSS class names */
35
- className?: string;
36
- }
24
+ interface ToastTitleProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Title> {}
37
25
  /**
38
26
  * Props for the Toast.Description component.
39
27
  */
40
- interface ToastDescriptionProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Description>, "className"> {
41
- /** Additional CSS class names */
42
- className?: string;
43
- }
28
+ interface ToastDescriptionProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Description> {}
44
29
  /**
45
30
  * Props for the Toast.Action component.
46
31
  */
47
- interface ToastActionProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Action>, "className"> {
48
- /** Additional CSS class names */
49
- className?: string;
50
- }
32
+ interface ToastActionProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Action> {}
51
33
  /**
52
34
  * Props for the Toast.Close component.
53
35
  */
54
- interface ToastCloseProps extends Omit<React.ComponentPropsWithoutRef<typeof Toast$1.Close>, "className"> {
55
- /** Additional CSS class names */
56
- className?: string;
57
- }
36
+ interface ToastCloseProps extends React.ComponentPropsWithoutRef<typeof Toast$1.Close> {}
58
37
  /**
59
38
  * Container for displaying toasts.
60
39
  */
@@ -1,3 +1,4 @@
1
+ import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
2
  import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Toast as Toast$1 } from "@base-ui/react/toast";
@@ -21,8 +22,8 @@ const ToastProvider = (props) => {
21
22
  /**
22
23
  * Container for displaying toasts.
23
24
  */
24
- function ToastViewport({ className = "", ref, ...props }) {
25
- const classes = ["toast__viewport", className].filter(Boolean).join(" ");
25
+ function ToastViewport({ className, ref, ...props }) {
26
+ const classes = mergeBaseClassName(["toast__viewport"].filter(Boolean).join(" "), className);
26
27
  return /* @__PURE__ */ jsx(Toast$1.Viewport, {
27
28
  ref,
28
29
  "data-slot": "toast-viewport",
@@ -33,8 +34,8 @@ function ToastViewport({ className = "", ref, ...props }) {
33
34
  /**
34
35
  * Individual toast wrapper.
35
36
  */
36
- function ToastRoot({ className = "", ref, ...props }) {
37
- const classes = ["toast", className].filter(Boolean).join(" ");
37
+ function ToastRoot({ className, ref, ...props }) {
38
+ const classes = mergeBaseClassName(["toast"].filter(Boolean).join(" "), className);
38
39
  return /* @__PURE__ */ jsx(Toast$1.Root, {
39
40
  ref,
40
41
  "data-slot": "toast",
@@ -45,8 +46,8 @@ function ToastRoot({ className = "", ref, ...props }) {
45
46
  /**
46
47
  * Container for the contents of a toast.
47
48
  */
48
- function ToastContent({ className = "", ref, ...props }) {
49
- const classes = ["toast__content", className].filter(Boolean).join(" ");
49
+ function ToastContent({ className, ref, ...props }) {
50
+ const classes = mergeBaseClassName(["toast__content"].filter(Boolean).join(" "), className);
50
51
  return /* @__PURE__ */ jsx(Toast$1.Content, {
51
52
  ref,
52
53
  "data-slot": "toast-content",
@@ -57,8 +58,8 @@ function ToastContent({ className = "", ref, ...props }) {
57
58
  /**
58
59
  * Title that labels the toast. Renders an `<h2>` element.
59
60
  */
60
- function ToastTitle({ className = "", ref, ...props }) {
61
- const classes = ["toast__title", className].filter(Boolean).join(" ");
61
+ function ToastTitle({ className, ref, ...props }) {
62
+ const classes = mergeBaseClassName(["toast__title"].filter(Boolean).join(" "), className);
62
63
  return /* @__PURE__ */ jsx(Toast$1.Title, {
63
64
  ref,
64
65
  "data-slot": "toast-title",
@@ -69,8 +70,8 @@ function ToastTitle({ className = "", ref, ...props }) {
69
70
  /**
70
71
  * Description text for the toast. Renders a `<p>` element.
71
72
  */
72
- function ToastDescription({ className = "", ref, ...props }) {
73
- const classes = ["toast__description", className].filter(Boolean).join(" ");
73
+ function ToastDescription({ className, ref, ...props }) {
74
+ const classes = mergeBaseClassName(["toast__description"].filter(Boolean).join(" "), className);
74
75
  return /* @__PURE__ */ jsx(Toast$1.Description, {
75
76
  ref,
76
77
  "data-slot": "toast-description",
@@ -81,8 +82,8 @@ function ToastDescription({ className = "", ref, ...props }) {
81
82
  /**
82
83
  * Action button within the toast.
83
84
  */
84
- function ToastAction({ className = "", ref, ...props }) {
85
- const classes = ["toast__action", className].filter(Boolean).join(" ");
85
+ function ToastAction({ className, ref, ...props }) {
86
+ const classes = mergeBaseClassName(["toast__action"].filter(Boolean).join(" "), className);
86
87
  return /* @__PURE__ */ jsx(Toast$1.Action, {
87
88
  ref,
88
89
  "data-slot": "toast-action",
@@ -93,8 +94,8 @@ function ToastAction({ className = "", ref, ...props }) {
93
94
  /**
94
95
  * Close button that dismisses the toast.
95
96
  */
96
- function ToastClose({ className = "", ref, ...props }) {
97
- const classes = ["toast__close", className].filter(Boolean).join(" ");
97
+ function ToastClose({ className, ref, ...props }) {
98
+ const classes = mergeBaseClassName(["toast__close"].filter(Boolean).join(" "), className);
98
99
  return /* @__PURE__ */ jsx(Toast$1.Close, {
99
100
  ref,
100
101
  "data-slot": "toast-close",
@@ -1,2 +1,2 @@
1
- import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-CAAlNl-M.js";
1
+ import { i as toggleVariants, n as ToggleProps, r as ToggleVariantsOptions, t as Toggle } from "../Toggle-DaXpe1Lc.js";
2
2
  export { Toggle, ToggleProps, ToggleVariantsOptions, toggleVariants };
@@ -1,3 +1,4 @@
1
+ import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
2
  import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Toggle as Toggle$1 } from "@base-ui/react/toggle";
@@ -50,15 +51,14 @@ function toggleVariants({ variant = "default", size = "default", className } = {
50
51
  *
51
52
  * @see {@link https://base-ui.com/react/components/toggle | Base UI Toggle}
52
53
  */
53
- function Toggle({ className = "", variant, size, ref, ...props }) {
54
+ function Toggle({ className, variant, size, ref, ...props }) {
54
55
  return /* @__PURE__ */ jsx(Toggle$1, {
55
56
  ref,
56
57
  "data-slot": "toggle",
57
- className: toggleVariants({
58
+ className: mergeBaseClassName(toggleVariants({
58
59
  variant,
59
- size,
60
- className
61
- }),
60
+ size
61
+ }), className),
62
62
  ...props
63
63
  });
64
64
  }
@@ -1,2 +1,2 @@
1
- import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-8hPv-b69.js";
1
+ import { n as ToggleGroupItemProps, r as ToggleGroupProps, t as ToggleGroup } from "../ToggleGroup-yseEWkOC.js";
2
2
  export { ToggleGroup, ToggleGroupItemProps, ToggleGroupProps };
@@ -1,3 +1,4 @@
1
+ import { n as mergeBaseClassName } from "../class-names-Bk-QLWWI.js";
1
2
  import { toggleVariants } from "./Toggle.js";
2
3
  import * as React from "react";
3
4
  import { jsx } from "react/jsx-runtime";
@@ -37,7 +38,7 @@ function normalizeSize(size) {
37
38
  *
38
39
  * @see {@link https://base-ui.com/react/components/toggle-group | Base UI Toggle Group}
39
40
  */
40
- function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", className = "", children, style, ref, ...props }) {
41
+ function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", className, children, style, ref, ...props }) {
41
42
  const normalizedSize = normalizeSize(size);
42
43
  const gap = `${spacing * .25}rem`;
43
44
  const groupStyle = typeof style === "function" ? (state) => ({
@@ -53,11 +54,7 @@ function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", classN
53
54
  "data-slot": "toggle-group",
54
55
  "data-spacing": spacing,
55
56
  "data-variant": variant,
56
- className: [
57
- "toggle-group",
58
- size !== "md" && `toggle-group--${size}`,
59
- className
60
- ].filter(Boolean).join(" "),
57
+ className: mergeBaseClassName(["toggle-group", size !== "md" && `toggle-group--${size}`].filter(Boolean).join(" "), className),
61
58
  style: groupStyle,
62
59
  ...props,
63
60
  children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {
@@ -73,18 +70,14 @@ function ToggleGroupRoot({ size = "md", spacing = 0, variant = "default", classN
73
70
  /**
74
71
  * A single toggle item within a ToggleGroup.
75
72
  */
76
- function ToggleGroupItem({ className = "", variant, size, ref, ...props }) {
73
+ function ToggleGroupItem({ className, variant, size, ref, ...props }) {
77
74
  const context = React.useContext(ToggleGroupContext);
78
75
  const itemVariant = variant ?? context.variant;
79
76
  const itemSize = size ?? context.size;
80
- const classes = [
81
- "toggle-group__item",
82
- toggleVariants({
83
- variant: itemVariant,
84
- size: itemSize
85
- }),
86
- className
87
- ].filter(Boolean).join(" ");
77
+ const classes = mergeBaseClassName(["toggle-group__item", toggleVariants({
78
+ variant: itemVariant,
79
+ size: itemSize
80
+ })].filter(Boolean).join(" "), className);
88
81
  return /* @__PURE__ */ jsx(Toggle, {
89
82
  ref,
90
83
  "data-size": itemSize,
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { ChatAddToolApproveResponseFunction, DynamicToolUIPart, ToolUIPart } from "ai";
3
+
4
+ //#region src/components/ToolApproval.d.ts
5
+ interface ToolApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
6
+ /** Whole upstream AI SDK tool part. Non-request states render nothing. */
7
+ part: ToolUIPart | DynamicToolUIPart;
8
+ /** Pass `addToolApprovalResponse` from the chat hook directly. */
9
+ onRespond: ChatAddToolApproveResponseFunction;
10
+ question?: React.ReactNode;
11
+ count?: number;
12
+ onSkip?: () => void;
13
+ }
14
+ /** Actionable adapter for an AI SDK `approval-requested` tool part. */
15
+ declare function ToolApproval({
16
+ className,
17
+ count,
18
+ onRespond,
19
+ onSkip,
20
+ part,
21
+ question,
22
+ ref,
23
+ ...props
24
+ }: ToolApprovalProps & {
25
+ ref?: React.Ref<HTMLDivElement>;
26
+ }): React.JSX.Element | null;
27
+ //#endregion
28
+ export { ToolApproval, ToolApprovalProps };
@@ -0,0 +1,35 @@
1
+ import { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalQuestion } from "./Approval.js";
2
+ import "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { getToolName } from "ai";
5
+ //#region src/components/ToolApproval.tsx
6
+ /** Actionable adapter for an AI SDK `approval-requested` tool part. */
7
+ function ToolApproval({ className, count, onRespond, onSkip, part, question, ref, ...props }) {
8
+ if (part.state !== "approval-requested") return null;
9
+ const toolName = part.title ?? getToolName(part);
10
+ return /* @__PURE__ */ jsxs(Approval, {
11
+ ref,
12
+ className,
13
+ "aria-label": `Approve ${toolName}`,
14
+ ...props,
15
+ children: [
16
+ /* @__PURE__ */ jsxs(ApprovalHeader, { children: [/* @__PURE__ */ jsx(ApprovalQuestion, { children: question ?? /* @__PURE__ */ jsxs(Fragment, { children: [
17
+ "Do you want to allow the agent to run ",
18
+ /* @__PURE__ */ jsx("code", { children: toolName }),
19
+ "?"
20
+ ] }) }), count && count > 1 ? /* @__PURE__ */ jsxs(ApprovalCount, { children: ["1 of ", count] }) : null] }),
21
+ /* @__PURE__ */ jsx(ApprovalInputPreview, { input: part.input }),
22
+ /* @__PURE__ */ jsx(ApprovalDecision, {
23
+ subject: toolName,
24
+ onSkip,
25
+ onDecision: ({ approved, reason }) => onRespond({
26
+ id: part.approval.id,
27
+ approved,
28
+ reason
29
+ })
30
+ }, part.approval.id)
31
+ ]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { ToolApproval };
@@ -0,0 +1,26 @@
1
+ import { DynamicToolUIPart, ToolUIPart } from "ai";
2
+
3
+ //#region src/components/ToolInvocation.d.ts
4
+ /** One whole static or dynamic AI SDK tool UI part. */
5
+ type ToolInvocationPart = ToolUIPart | DynamicToolUIPart;
6
+ interface ToolInvocationProps {
7
+ /** The whole upstream AI SDK tool part, kept intact across every tool state. */
8
+ part: ToolInvocationPart;
9
+ /** Render the existing Activity disclosure expanded initially. */
10
+ defaultOpen?: boolean;
11
+ }
12
+ /**
13
+ * Read-only generic disclosure for one upstream AI SDK tool invocation.
14
+ *
15
+ * The component derives its name, state, input, output, denial, and error
16
+ * presentation from the whole `ToolUIPart | DynamicToolUIPart`. Approval
17
+ * response controls belong to transport-aware adapters rather than this
18
+ * transcript renderer. ThinkChat may replace this fallback with richer panels
19
+ * for known workspace, browser, fetch, session, skill, and execute tools.
20
+ */
21
+ declare function ToolInvocation({
22
+ part,
23
+ defaultOpen
24
+ }: ToolInvocationProps): import("react").JSX.Element;
25
+ //#endregion
26
+ export { ToolInvocation, ToolInvocationPart, ToolInvocationProps };
@@ -0,0 +1,72 @@
1
+ import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
2
+ import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ThinkChatToolParts.js";
3
+ import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { getToolName } from "ai";
6
+ import { getToolInput, getToolOutput, getToolPartState } from "@cloudflare/think/react";
7
+ //#region src/components/ToolInvocation.tsx
8
+ function formatToolValue(value) {
9
+ if (value === void 0) return void 0;
10
+ return typeof value === "string" ? value : JSON.stringify(value, null, 2);
11
+ }
12
+ function describeToolPart(part) {
13
+ const name = getToolDisplayName(part);
14
+ let action;
15
+ switch (part.state) {
16
+ case "approval-requested":
17
+ action = `${name} awaiting approval`;
18
+ break;
19
+ case "approval-responded":
20
+ action = part.approval.approved ? `Running ${name}` : `${name} denied`;
21
+ break;
22
+ case "output-error":
23
+ action = `${name} failed`;
24
+ break;
25
+ case "output-denied":
26
+ action = `${name} denied`;
27
+ break;
28
+ case "output-available":
29
+ action = part.preliminary ? `Running ${name}` : `Ran ${name}`;
30
+ break;
31
+ case "input-streaming":
32
+ case "input-available":
33
+ action = `Running ${name}`;
34
+ break;
35
+ }
36
+ const detail = summarizeToolInput(getToolInput(part));
37
+ return detail ? `${action} · ${detail}` : action;
38
+ }
39
+ /**
40
+ * Read-only generic disclosure for one upstream AI SDK tool invocation.
41
+ *
42
+ * The component derives its name, state, input, output, denial, and error
43
+ * presentation from the whole `ToolUIPart | DynamicToolUIPart`. Approval
44
+ * response controls belong to transport-aware adapters rather than this
45
+ * transcript renderer. ThinkChat may replace this fallback with richer panels
46
+ * for known workspace, browser, fetch, session, skill, and execute tools.
47
+ */
48
+ function ToolInvocation({ part, defaultOpen }) {
49
+ const state = getToolPartState(part);
50
+ const failed = isToolPartFailed(part);
51
+ const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
52
+ const output = state === "error" ? part.errorText : state === "denied" ? deniedReason ?? "Denied" : formatToolValue(getToolOutput(part));
53
+ const inputStatus = part.state === "approval-requested" ? "awaiting approval" : part.state === "approval-responded" ? part.approval.approved ? "approved" : "denied" : void 0;
54
+ const outputStatus = state === "denied" ? "denied" : failed ? "error" : part.state === "output-available" && part.preliminary ? "preliminary" : void 0;
55
+ return /* @__PURE__ */ jsxs(Activity, {
56
+ isStreaming: isToolPartWorking(part),
57
+ defaultOpen,
58
+ children: [/* @__PURE__ */ jsx(ActivityTrigger, { label: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
59
+ label: part.title ?? getToolName(part),
60
+ text: formatToolValue(getToolInput(part)),
61
+ status: inputStatus,
62
+ error: inputStatus === "denied"
63
+ }), output !== void 0 ? /* @__PURE__ */ jsx(ActivityPanel, {
64
+ label: "output",
65
+ text: output,
66
+ status: outputStatus,
67
+ error: failed
68
+ }) : null] })]
69
+ });
70
+ }
71
+ //#endregion
72
+ export { ToolInvocation };
@@ -5,45 +5,27 @@ import { Toolbar as Toolbar$1 } from "@base-ui/react/toolbar";
5
5
  /**
6
6
  * Props for the Toolbar.Root component.
7
7
  */
8
- interface ToolbarRootProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Root>, "className"> {
9
- /** Additional CSS class names */
10
- className?: string;
11
- }
8
+ interface ToolbarRootProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Root> {}
12
9
  /**
13
10
  * Props for the Toolbar.Button component.
14
11
  */
15
- interface ToolbarButtonProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Button>, "className"> {
16
- /** Additional CSS class names */
17
- className?: string;
18
- }
12
+ interface ToolbarButtonProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Button> {}
19
13
  /**
20
14
  * Props for the Toolbar.Link component.
21
15
  */
22
- interface ToolbarLinkProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Link>, "className"> {
23
- /** Additional CSS class names */
24
- className?: string;
25
- }
16
+ interface ToolbarLinkProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Link> {}
26
17
  /**
27
18
  * Props for the Toolbar.Group component.
28
19
  */
29
- interface ToolbarGroupProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Group>, "className"> {
30
- /** Additional CSS class names */
31
- className?: string;
32
- }
20
+ interface ToolbarGroupProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Group> {}
33
21
  /**
34
22
  * Props for the Toolbar.Separator component.
35
23
  */
36
- interface ToolbarSeparatorProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Separator>, "className"> {
37
- /** Additional CSS class names */
38
- className?: string;
39
- }
24
+ interface ToolbarSeparatorProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Separator> {}
40
25
  /**
41
26
  * Props for the Toolbar.Input component.
42
27
  */
43
- interface ToolbarInputProps extends Omit<React.ComponentPropsWithoutRef<typeof Toolbar$1.Input>, "className"> {
44
- /** Additional CSS class names */
45
- className?: string;
46
- }
28
+ interface ToolbarInputProps extends React.ComponentPropsWithoutRef<typeof Toolbar$1.Input> {}
47
29
  /**
48
30
  * Container for grouping toolbar buttons and controls.
49
31
  *