@mcp-b/react-components 0.16.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentActivity-BNUNrP9O.d.ts → AgentActivity-D2SHSGFX.d.ts} +1 -1
- package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-ClxViuUM.d.ts} +4 -29
- package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
- package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
- package/dist/{Button-FX_hpqxm.d.ts → Button-DLGzHsjc.d.ts} +13 -7
- package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Bfp5PAg3.js} +9 -6
- package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-gV4kZeCI.d.ts} +2 -9
- package/dist/Collapsible-N64ASIQr.d.ts +119 -0
- package/dist/{Combobox-B9Fcd6q-.d.ts → Combobox-CYc37s5l.d.ts} +11 -33
- package/dist/{FileTree-CkVbIMWV.js → FileTree-3zYtrddG.js} +46 -20
- package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
- package/dist/{Message-BkMdE3bS.js → Message-BXtmfc9Q.js} +13 -20
- package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-Cqw_qrUG.js} +18 -25
- package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-Bdh9pqlo.d.ts} +41 -71
- package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
- package/dist/{Select-BeEsefzh.d.ts → Select-B_13gg_J.d.ts} +16 -44
- package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-ColWK-XA.d.ts} +14 -20
- package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-15EhfvYJ.js} +123 -73
- package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-Bzot45kX.d.ts} +9 -4
- package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts} +1 -1
- package/dist/{ThinkChatContext-C3Eb1Xpi.d.ts → ThinkChatContext-DrsZqdaO.d.ts} +1 -1
- package/dist/ThinkRecoveryNotice-DFIcG9UX.d.ts +19 -0
- package/dist/{Toggle-CAAlNl-M.d.ts → Toggle-JKZ43D5S.d.ts} +2 -2
- package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-DNd6cDJZ.d.ts} +4 -5
- package/dist/Workspace-Jez8ffUj.d.ts +274 -0
- package/dist/WorkspaceExplorer-B9dQWNVK.d.ts +32 -0
- package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-CzyHnESE.d.ts} +1 -1
- package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-C68Ub8S8.js} +121 -128
- package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-BYYeTQLf.js} +20 -55
- package/dist/{WorkspaceLink-DK1DWMHe.d.ts → WorkspaceLink-O-EBKUJ8.d.ts} +6 -9
- package/dist/class-names-BiMDVpUo.js +14 -0
- package/dist/components/Accordion.d.ts +5 -15
- package/dist/components/Accordion.js +16 -10
- package/dist/components/Activity.d.ts +5 -10
- package/dist/components/Activity.js +2 -2
- package/dist/components/AgentActivity.d.ts +1 -1
- package/dist/components/AgentActivity.js +4 -5
- package/dist/components/AgentActivityPreview.d.ts +9 -9
- package/dist/components/AgentActivityPreview.js +8 -12
- package/dist/components/AgentAttention.d.ts +2 -2
- package/dist/components/AgentAttention.js +1 -1
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +113 -218
- package/dist/components/AgentChatMessageEditor.js +3 -3
- package/dist/components/AgentChatTurnError.js +2 -2
- package/dist/components/AgentConnection.js +4 -4
- package/dist/components/AgentMessageParts.d.ts +2 -0
- package/dist/components/AgentMessageParts.js +119 -0
- package/dist/components/AgentToolDetail.d.ts +57 -0
- package/dist/components/AgentToolDetail.js +100 -0
- package/dist/components/AgentToolRunsContext.d.ts +2 -0
- package/dist/components/AgentToolRunsContext.js +16 -0
- package/dist/components/AlertDialog.d.ts +7 -19
- package/dist/components/AlertDialog.js +21 -32
- package/dist/components/AppTopBar.d.ts +28 -8
- package/dist/components/AppTopBar.js +36 -12
- package/dist/components/Approval.d.ts +102 -0
- package/dist/components/Approval.js +227 -0
- package/dist/components/Artifact.d.ts +3 -5
- package/dist/components/Artifact.js +7 -5
- package/dist/components/Autocomplete.d.ts +11 -33
- package/dist/components/Autocomplete.js +23 -30
- package/dist/components/Avatar.d.ts +4 -12
- package/dist/components/Avatar.js +13 -12
- package/dist/components/Badge.js +3 -0
- package/dist/components/BrowserLiveView.js +27 -12
- package/dist/components/BrowserReplay.js +4 -3
- package/dist/components/BrowserRunPanel.js +58 -78
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Button.js +14 -16
- package/dist/components/Card.d.ts +7 -8
- package/dist/components/Card.js +19 -10
- package/dist/components/ChainOfThought.d.ts +5 -11
- package/dist/components/ChainOfThought.js +3 -2
- package/dist/components/ChatGptSignInScreen.js +8 -8
- package/dist/components/Checkbox.d.ts +2 -4
- package/dist/components/Checkbox.js +6 -5
- package/dist/components/CheckboxGroup.d.ts +1 -3
- package/dist/components/CheckboxGroup.js +15 -14
- package/dist/components/Checkpoint.d.ts +64 -0
- package/dist/components/Checkpoint.js +63 -0
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.d.ts +1 -1
- package/dist/components/CodexModelSelector.js +2 -2
- package/dist/components/Collapsible.d.ts +1 -124
- package/dist/components/Collapsible.js +7 -10
- package/dist/components/Combobox.d.ts +1 -1
- package/dist/components/Combobox.js +23 -30
- package/dist/components/Commit.d.ts +5 -11
- package/dist/components/Commit.js +6 -5
- package/dist/components/Context.js +1 -1
- package/dist/components/ContextMenu.d.ts +21 -37
- package/dist/components/ContextMenu.js +34 -51
- package/dist/components/Conversation.d.ts +3 -5
- package/dist/components/Conversation.js +5 -4
- package/dist/components/DescriptionListParts.js +1 -1
- package/dist/components/Dialog.d.ts +6 -17
- package/dist/components/Dialog.js +17 -24
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +4 -3
- package/dist/components/Field.d.ts +17 -20
- package/dist/components/Field.js +20 -17
- package/dist/components/Fieldset.d.ts +2 -7
- package/dist/components/Fieldset.js +7 -6
- package/dist/components/FileTree.d.ts +6 -0
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Form.d.ts +1 -4
- package/dist/components/Form.js +3 -2
- package/dist/components/GithubMotionMark.js +1 -1
- package/dist/components/IconButton.d.ts +2 -3
- package/dist/components/IconButton.js +2 -1
- package/dist/components/InlineCitation.d.ts +66 -0
- package/dist/components/InlineCitation.js +142 -0
- package/dist/components/Input.d.ts +1 -4
- package/dist/components/Input.js +3 -2
- package/dist/components/Marker.js +1 -1
- package/dist/components/McpConnectionRequest.js +2 -2
- package/dist/components/McpServerPicker.d.ts +1 -1
- package/dist/components/McpServerPicker.js +6 -5
- package/dist/components/MediaPreviewCard.d.ts +103 -0
- package/dist/components/MediaPreviewCard.js +193 -0
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/Menu.js +33 -52
- package/dist/components/Menubar.d.ts +22 -43
- package/dist/components/Menubar.js +36 -53
- package/dist/components/Message.d.ts +7 -7
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +2 -2
- package/dist/components/MessageScroller.js +6 -5
- package/dist/components/Meter.d.ts +5 -20
- package/dist/components/Meter.js +11 -10
- package/dist/components/ModelSelector.d.ts +6 -9
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.d.ts +11 -33
- package/dist/components/NavigationMenu.js +23 -30
- package/dist/components/NumberField.d.ts +6 -24
- package/dist/components/NumberField.js +13 -12
- package/dist/components/Plan.d.ts +103 -0
- package/dist/components/Plan.js +113 -0
- package/dist/components/Popover.d.ts +9 -36
- package/dist/components/Popover.js +23 -34
- package/dist/components/PreviewCard.d.ts +6 -24
- package/dist/components/PreviewCard.js +13 -24
- package/dist/components/PricingBillingToggle.js +1 -1
- package/dist/components/PricingFAQ.js +1 -1
- package/dist/components/PricingPage.js +2 -1
- package/dist/components/PricingPlanCard.js +5 -4
- package/dist/components/PricingUsageCalculator.js +3 -3
- package/dist/components/Progress.d.ts +3 -8
- package/dist/components/Progress.js +7 -10
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +83 -218
- package/dist/components/Queue.d.ts +7 -17
- package/dist/components/Queue.js +2 -3
- package/dist/components/RadioGroup.d.ts +3 -8
- package/dist/components/RadioGroup.js +7 -10
- package/dist/components/Reasoning.d.ts +4 -8
- package/dist/components/Reasoning.js +3 -6
- package/dist/components/ResizableSidePanel.js +2 -2
- package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
- package/dist/components/ResponsiveSidebarShell.js +18 -11
- package/dist/components/ScrollArea.d.ts +5 -20
- package/dist/components/ScrollArea.js +12 -10
- package/dist/components/SearchField.d.ts +43 -0
- package/dist/components/SearchField.js +52 -0
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +33 -57
- package/dist/components/Separator.d.ts +1 -5
- package/dist/components/Separator.js +3 -6
- package/dist/components/Slider.d.ts +6 -19
- package/dist/components/Slider.js +15 -14
- package/dist/components/Sources.d.ts +4 -9
- package/dist/components/Sources.js +3 -2
- package/dist/components/Stepper.js +16 -9
- package/dist/components/SubagentRunDetails.js +1 -1
- package/dist/components/SubagentRunIndicator.js +2 -2
- package/dist/components/SubagentRunList.d.ts +3 -5
- package/dist/components/SubagentRunList.js +3 -5
- package/dist/components/SubagentRunSelector.d.ts +9 -22
- package/dist/components/SubagentRunSelector.js +29 -31
- package/dist/components/Switch.d.ts +4 -7
- package/dist/components/Switch.js +6 -10
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +21 -18
- package/dist/components/Task.d.ts +4 -9
- package/dist/components/Task.js +4 -3
- package/dist/components/Terminal.d.ts +3 -4
- package/dist/components/Terminal.js +5 -4
- package/dist/components/TestResults.d.ts +4 -9
- package/dist/components/TestResults.js +11 -6
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +45 -22
- package/dist/components/ThinkChat.js +7 -5
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +24 -7
- package/dist/components/ThinkChatActivitySummary.d.ts +1 -1
- package/dist/components/ThinkChatActivitySummary.js +7 -3
- package/dist/components/ThinkChatContext.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +27 -17
- package/dist/components/ThinkExecutionDetail.js +2 -2
- package/dist/components/ThinkExecutionStatus.js +2 -2
- package/dist/components/ThinkExecutionWorkbench.d.ts +30 -8
- package/dist/components/ThinkExecutionWorkbench.js +70 -134
- package/dist/components/ThinkFullApp.d.ts +40 -15
- package/dist/components/ThinkFullApp.js +193 -117
- package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/ThinkFullAppViewSwitch.js +2 -2
- package/dist/components/ThinkPendingApproval.d.ts +60 -0
- package/dist/components/ThinkPendingApproval.js +99 -0
- package/dist/components/ThinkRecoveryNotice.d.ts +2 -0
- package/dist/components/ThinkRecoveryNotice.js +46 -0
- package/dist/components/ThinkRoutine.js +1 -0
- package/dist/components/ThinkRoutineBrowser.d.ts +17 -9
- package/dist/components/ThinkRoutineBrowser.js +37 -44
- package/dist/components/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/ThinkRoutineDetail.js +4 -4
- package/dist/components/ThinkRoutineForm.d.ts +3 -2
- package/dist/components/ThinkRoutineForm.js +11 -10
- package/dist/components/ThinkRoutineLibrary.d.ts +27 -25
- package/dist/components/ThinkRoutineLibrary.js +104 -80
- package/dist/components/ThinkRoutineRuns.d.ts +3 -2
- package/dist/components/ThinkRoutineRuns.js +31 -24
- package/dist/components/ThinkThreadPicker.d.ts +17 -11
- package/dist/components/ThinkThreadPicker.js +163 -39
- package/dist/components/ThinkThreadShell.d.ts +1 -1
- package/dist/components/Toast.d.ts +7 -28
- package/dist/components/Toast.js +15 -14
- package/dist/components/Toggle.d.ts +1 -1
- package/dist/components/Toggle.js +10 -8
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +21 -26
- package/dist/components/ToolApproval.d.ts +28 -0
- package/dist/components/ToolApproval.js +35 -0
- package/dist/components/ToolInvocation.d.ts +26 -0
- package/dist/components/ToolInvocation.js +72 -0
- package/dist/components/Toolbar.d.ts +6 -24
- package/dist/components/Toolbar.js +13 -12
- package/dist/components/Tooltip.d.ts +11 -10
- package/dist/components/Tooltip.js +17 -11
- package/dist/components/TransitionSurface.d.ts +27 -0
- package/dist/components/TransitionSurface.js +20 -0
- package/dist/components/WebPreview.d.ts +6 -7
- package/dist/components/WebPreview.js +70 -55
- package/dist/components/Workspace.d.ts +2 -2
- package/dist/components/Workspace.js +361 -346
- package/dist/components/WorkspaceBrowser.d.ts +4 -7
- package/dist/components/WorkspaceBrowser.js +16 -26
- package/dist/components/WorkspaceExplorer.d.ts +5 -33
- package/dist/components/WorkspaceExplorer.js +19 -32
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +14 -2
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.d.ts +0 -8
- package/dist/components/WorkspaceHeader.js +3 -15
- package/dist/components/WorkspaceLink.d.ts +1 -1
- package/dist/components/WorkspaceLink.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-DtPMgN7e.d.ts → copy-button-D7aAYA-2.d.ts} +2 -3
- package/dist/{copy-button-Dejn5heL.js → copy-button-DeK6KXEV.js} +3 -2
- package/dist/{icons-CpfUer49.js → icons-CQJ-aMnI.js} +7 -3
- package/dist/{icons-GQd1xF4e.d.ts → icons-CYXmvKlJ.d.ts} +22 -2
- package/dist/navigation-link-Cob7KBlM.js +19 -0
- package/dist/styles/accordion.css +4 -19
- package/dist/styles/activity.css +48 -56
- package/dist/styles/agent-activity-preview.css +6 -0
- package/dist/styles/agent-chat.css +14 -63
- package/dist/styles/agent-connection.css +0 -12
- package/dist/styles/agent-tool-detail.css +54 -0
- package/dist/styles/alert-dialog.css +16 -18
- package/dist/styles/app-top-bar.css +17 -9
- package/dist/styles/approval.css +177 -0
- package/dist/styles/artifact.css +6 -18
- package/dist/styles/autocomplete.css +2 -1
- package/dist/styles/avatar.css +35 -30
- package/dist/styles/badge.css +10 -10
- package/dist/styles/base-ui-motion.css +94 -39
- package/dist/styles/browser-control-overlay.css +0 -1
- package/dist/styles/browser-live-view.css +39 -22
- package/dist/styles/browser-replay.css +1 -1
- package/dist/styles/browser-run-panel.css +13 -6
- package/dist/styles/button.css +36 -33
- package/dist/styles/card.css +5 -6
- package/dist/styles/chain-of-thought.css +22 -24
- package/dist/styles/checkbox.css +18 -5
- package/dist/styles/checkpoint.css +58 -0
- package/dist/styles/codex-model-selector.css +3 -7
- package/dist/styles/collapsible.css +10 -10
- package/dist/styles/combobox.css +4 -3
- package/dist/styles/commit.css +19 -39
- package/dist/styles/composition-motion.css +83 -0
- package/dist/styles/context-menu.css +3 -11
- package/dist/styles/context.css +11 -10
- package/dist/styles/conversation.css +18 -23
- package/dist/styles/dialog.css +15 -15
- package/dist/styles/environment-variables.css +0 -13
- package/dist/styles/field.css +32 -12
- package/dist/styles/file-tree.css +66 -22
- package/dist/styles/form.css +1 -1
- package/dist/styles/index.css +13 -4
- package/dist/styles/inline-citation.css +107 -0
- package/dist/styles/input.css +2 -2
- package/dist/styles/marker.css +14 -13
- package/dist/styles/mcp-server-picker.css +20 -47
- package/dist/styles/media-preview-card.css +160 -0
- package/dist/styles/menu.css +11 -40
- package/dist/styles/menubar.css +12 -19
- package/dist/styles/message-scroller.css +0 -12
- package/dist/styles/message.css +25 -31
- package/dist/styles/meter.css +2 -2
- package/dist/styles/model-selector.css +16 -34
- package/dist/styles/motion-reduction.css +29 -0
- package/dist/styles/navigation-menu.css +14 -30
- package/dist/styles/number-field.css +22 -4
- package/dist/styles/plan.css +132 -0
- package/dist/styles/popover.css +15 -52
- package/dist/styles/preview-card.css +2 -32
- package/dist/styles/progress.css +8 -3
- package/dist/styles/prompt-input.css +76 -269
- package/dist/styles/queue.css +48 -32
- package/dist/styles/radio.css +19 -12
- package/dist/styles/reasoning.css +2 -1
- package/dist/styles/recipes.css +207 -26
- package/dist/styles/resizable-side-panel.css +4 -10
- package/dist/styles/responsive-sidebar-shell.css +32 -34
- package/dist/styles/scroll-area.css +32 -15
- package/dist/styles/search-field.css +21 -0
- package/dist/styles/select.css +19 -12
- package/dist/styles/slider.css +25 -29
- package/dist/styles/sources.css +3 -11
- package/dist/styles/stepper.css +36 -26
- package/dist/styles/subagent-run.css +13 -71
- package/dist/styles/switch.css +32 -29
- package/dist/styles/tabs.css +79 -23
- package/dist/styles/task.css +11 -23
- package/dist/styles/test-results.css +29 -36
- package/dist/styles/theme-mode-control.css +8 -0
- package/dist/styles/think-execution-workbench.css +18 -15
- package/dist/styles/think-full-app.css +51 -100
- package/dist/styles/think-routine-library.css +51 -40
- package/dist/styles/think-thread-picker.css +207 -50
- package/dist/styles/toast.css +48 -34
- package/dist/styles/toggle-group.css +2 -36
- package/dist/styles/toggle.css +29 -5
- package/dist/styles/toolbar.css +25 -27
- package/dist/styles/tooltip.css +2 -32
- package/dist/styles/transition-surface.css +55 -0
- package/dist/styles/utilities.css +31 -0
- package/dist/styles/web-preview.css +0 -21
- package/dist/styles/workspace-explorer.css +104 -99
- package/dist/summarize-tool-input-CqTcGRYy.js +15 -0
- package/dist/think-agent-Cip5KAPj.d.ts +7 -0
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/mcp-server-catalog.d.ts +132 -0
- package/dist/utils/mcp-server-catalog.js +90 -0
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/workspace-path-L_KmjRjq.js +26 -0
- package/package.json +14 -9
- package/dist/Workspace-D39LxGvP.d.ts +0 -62
- package/dist/class-names-9UtZwb0J.js +0 -12
- package/dist/components/AppFrame.d.ts +0 -24
- package/dist/components/AppFrame.js +0 -25
- package/dist/components/Shell.d.ts +0 -163
- package/dist/components/Shell.js +0 -137
- package/dist/components/SubagentRun.d.ts +0 -86
- package/dist/components/SubagentRun.js +0 -108
- package/dist/styles/app-frame.css +0 -15
- package/dist/styles/shell.css +0 -122
- package/dist/summarize-tool-input-BUJsENSn.js +0 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { n as mergeBaseClassName, t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { $ as XIcon, B as PlusIcon, G as SpinnerIcon, I as PaperclipIcon, K as SquareIcon, N as MonitorIcon, Q as WrenchIcon, S as FolderIcon, Z as WarningIcon, a as ArrowUpIcon, j as MicrophoneIcon, l as CheckIcon, q as StopIcon, u as ChevronDownIcon, x as FileIcon } from "../icons-CQJ-aMnI.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip } from "./Tooltip.js";
|
|
5
5
|
import { t as AttachmentPreview } from "../attachment-preview-DIs50Q0h.js";
|
|
@@ -7,10 +7,12 @@ import { Menu } from "./Menu.js";
|
|
|
7
7
|
import { Combobox } from "./Combobox.js";
|
|
8
8
|
import { Select } from "./Select.js";
|
|
9
9
|
import { Tabs } from "./Tabs.js";
|
|
10
|
+
import { ThinkExecutionApproval, ThinkPendingApproval, getPausedExecution } from "./ThinkPendingApproval.js";
|
|
11
|
+
import { ToolApproval } from "./ToolApproval.js";
|
|
10
12
|
import * as React from "react";
|
|
11
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
+
import { isToolUIPart } from "ai";
|
|
15
|
+
import { getToolApproval } from "@cloudflare/think/react";
|
|
14
16
|
//#region src/components/PromptInput.tsx
|
|
15
17
|
const PromptInputController = React.createContext(null);
|
|
16
18
|
const LocalAttachmentsContext = React.createContext(null);
|
|
@@ -39,7 +41,9 @@ function PromptInputProvider({ initialInput = "", children }) {
|
|
|
39
41
|
const fileInputRef = React.useRef(null);
|
|
40
42
|
const openRef = React.useRef(() => {});
|
|
41
43
|
const attachmentsRef = React.useRef(attachmentFiles);
|
|
42
|
-
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
attachmentsRef.current = attachmentFiles;
|
|
46
|
+
}, [attachmentFiles]);
|
|
43
47
|
React.useEffect(() => () => {
|
|
44
48
|
revokeFileUrls(attachmentsRef.current);
|
|
45
49
|
}, []);
|
|
@@ -129,7 +133,9 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
129
133
|
const [localFiles, setLocalFiles] = React.useState([]);
|
|
130
134
|
const files = controller?.attachments.files ?? localFiles;
|
|
131
135
|
const filesRef = React.useRef(files);
|
|
132
|
-
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
filesRef.current = files;
|
|
138
|
+
}, [files]);
|
|
133
139
|
React.useImperativeHandle(ref, () => formRef.current, []);
|
|
134
140
|
React.useEffect(() => () => {
|
|
135
141
|
if (!usingProvider) revokeFileUrls(filesRef.current);
|
|
@@ -172,6 +178,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
172
178
|
maxFiles,
|
|
173
179
|
onError
|
|
174
180
|
]);
|
|
181
|
+
const addDroppedFiles = React.useEffectEvent(add);
|
|
175
182
|
const remove = React.useCallback((attachmentId) => {
|
|
176
183
|
if (controller) {
|
|
177
184
|
controller.attachments.remove(attachmentId);
|
|
@@ -211,7 +218,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
211
218
|
const onDrop = (event) => {
|
|
212
219
|
const dragEvent = event;
|
|
213
220
|
if (dragEvent.dataTransfer?.types.includes("Files")) dragEvent.preventDefault();
|
|
214
|
-
if (dragEvent.dataTransfer?.files?.length)
|
|
221
|
+
if (dragEvent.dataTransfer?.files?.length) addDroppedFiles(dragEvent.dataTransfer.files);
|
|
215
222
|
};
|
|
216
223
|
target.addEventListener("dragover", onDragOver);
|
|
217
224
|
target.addEventListener("drop", onDrop);
|
|
@@ -219,7 +226,7 @@ function PromptInput({ className, accept, multiple, globalDrop, syncHiddenInput,
|
|
|
219
226
|
target.removeEventListener("dragover", onDragOver);
|
|
220
227
|
target.removeEventListener("drop", onDrop);
|
|
221
228
|
};
|
|
222
|
-
}, [
|
|
229
|
+
}, [globalDrop]);
|
|
223
230
|
const attachmentsCtx = React.useMemo(() => ({
|
|
224
231
|
add,
|
|
225
232
|
clear: clearAttachments,
|
|
@@ -371,7 +378,7 @@ function PromptInputTextarea({ className, placeholder = "How can I help?", rows
|
|
|
371
378
|
const controller = useOptionalPromptInputController();
|
|
372
379
|
const attachments = usePromptInputAttachments();
|
|
373
380
|
const innerRef = React.useRef(null);
|
|
374
|
-
const
|
|
381
|
+
const isComposingRef = React.useRef(false);
|
|
375
382
|
React.useImperativeHandle(ref, () => innerRef.current, []);
|
|
376
383
|
const resize = React.useCallback(() => {
|
|
377
384
|
const el = innerRef.current;
|
|
@@ -404,17 +411,17 @@ function PromptInputTextarea({ className, placeholder = "How can I help?", rows
|
|
|
404
411
|
placeholder,
|
|
405
412
|
rows,
|
|
406
413
|
onCompositionEnd: (event) => {
|
|
407
|
-
|
|
414
|
+
isComposingRef.current = false;
|
|
408
415
|
onCompositionEnd?.(event);
|
|
409
416
|
},
|
|
410
417
|
onCompositionStart: (event) => {
|
|
411
|
-
|
|
418
|
+
isComposingRef.current = true;
|
|
412
419
|
onCompositionStart?.(event);
|
|
413
420
|
},
|
|
414
421
|
onKeyDown: (event) => {
|
|
415
422
|
onKeyDown?.(event);
|
|
416
423
|
if (event.defaultPrevented) return;
|
|
417
|
-
if (event.key === "Enter" && !event.shiftKey && !
|
|
424
|
+
if (event.key === "Enter" && !event.shiftKey && !isComposingRef.current && !event.nativeEvent.isComposing) {
|
|
418
425
|
event.preventDefault();
|
|
419
426
|
event.currentTarget.form?.requestSubmit();
|
|
420
427
|
}
|
|
@@ -446,8 +453,10 @@ function PromptInputTextarea({ className, placeholder = "How can I help?", rows
|
|
|
446
453
|
...controlledProps
|
|
447
454
|
});
|
|
448
455
|
}
|
|
449
|
-
function PromptInputButton({ className, tooltip, variant = "ghost", color = "neutral", size, children, "aria-label": ariaLabel, ref, ...props }) {
|
|
450
|
-
const
|
|
456
|
+
function PromptInputButton({ className, tooltip, variant = "ghost", color = "neutral", size, iconOnly, children, "aria-label": ariaLabel, ref, ...props }) {
|
|
457
|
+
const childCount = React.Children.count(children);
|
|
458
|
+
const resolvedSize = size ?? "sm";
|
|
459
|
+
const resolvedIconOnly = iconOnly ?? childCount <= 1;
|
|
451
460
|
const tooltipConfig = typeof tooltip === "string" ? { content: tooltip } : tooltip;
|
|
452
461
|
const fallbackLabel = ariaLabel ?? (typeof tooltipConfig?.content === "string" ? tooltipConfig.content : void 0);
|
|
453
462
|
const hasResponsiveLabel = Boolean(tooltipConfig && React.Children.count(children) > 1);
|
|
@@ -457,6 +466,7 @@ function PromptInputButton({ className, tooltip, variant = "ghost", color = "neu
|
|
|
457
466
|
variant,
|
|
458
467
|
color,
|
|
459
468
|
size: resolvedSize,
|
|
469
|
+
iconOnly: resolvedIconOnly,
|
|
460
470
|
className: cx("prompt-input__button", className),
|
|
461
471
|
"aria-label": fallbackLabel,
|
|
462
472
|
"data-responsive-label": hasResponsiveLabel || void 0,
|
|
@@ -591,7 +601,8 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
|
|
|
591
601
|
type: "button",
|
|
592
602
|
variant: "normal",
|
|
593
603
|
color: "neutral",
|
|
594
|
-
size: "
|
|
604
|
+
size: "sm",
|
|
605
|
+
iconOnly: true,
|
|
595
606
|
"aria-label": "Stop dictation",
|
|
596
607
|
onClick: () => voice.stop(),
|
|
597
608
|
children: /* @__PURE__ */ jsx(SquareIcon, { size: 12 })
|
|
@@ -600,7 +611,8 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
|
|
|
600
611
|
className: "prompt-input__recording-button",
|
|
601
612
|
type: "button",
|
|
602
613
|
color: "primary",
|
|
603
|
-
size: "
|
|
614
|
+
size: "sm",
|
|
615
|
+
iconOnly: true,
|
|
604
616
|
"aria-label": "Stop dictation and send",
|
|
605
617
|
onClick: () => {
|
|
606
618
|
submitAfterStopRef.current = true;
|
|
@@ -611,7 +623,7 @@ function PromptInputDictation({ voice, beforeStart, className, disabled, ref, ..
|
|
|
611
623
|
]
|
|
612
624
|
}) : null,
|
|
613
625
|
/* @__PURE__ */ jsx("span", {
|
|
614
|
-
className: "prompt-input__dictation-status",
|
|
626
|
+
className: "prompt-input__dictation-status sigvelo-visually-hidden",
|
|
615
627
|
role: "status",
|
|
616
628
|
"aria-live": "polite",
|
|
617
629
|
"aria-atomic": "true",
|
|
@@ -629,7 +641,9 @@ function PromptInputRecordingWaveform({ active, level }) {
|
|
|
629
641
|
const containerRef = React.useRef(null);
|
|
630
642
|
const historyRef = React.useRef([]);
|
|
631
643
|
const levelRef = React.useRef(level);
|
|
632
|
-
|
|
644
|
+
React.useEffect(() => {
|
|
645
|
+
levelRef.current = level;
|
|
646
|
+
}, [level]);
|
|
633
647
|
React.useEffect(() => {
|
|
634
648
|
const canvas = canvasRef.current;
|
|
635
649
|
const container = containerRef.current;
|
|
@@ -730,7 +744,7 @@ function PromptInputActionMenuContent({ anchor, positionMethod, side, sideOffset
|
|
|
730
744
|
collisionAvoidance,
|
|
731
745
|
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
732
746
|
tabIndex,
|
|
733
|
-
className:
|
|
747
|
+
className: mergeBaseClassName("prompt-input__action-menu", className),
|
|
734
748
|
...props,
|
|
735
749
|
children
|
|
736
750
|
})
|
|
@@ -738,7 +752,7 @@ function PromptInputActionMenuContent({ anchor, positionMethod, side, sideOffset
|
|
|
738
752
|
}
|
|
739
753
|
function PromptInputActionMenuItem({ className, ...props }) {
|
|
740
754
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
741
|
-
className:
|
|
755
|
+
className: mergeBaseClassName("prompt-input__action-menu-item", className),
|
|
742
756
|
...props
|
|
743
757
|
});
|
|
744
758
|
}
|
|
@@ -790,7 +804,7 @@ function PromptInputPermissionSelector({ value, onValueChange, question = "How s
|
|
|
790
804
|
const trigger = /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
791
805
|
unstyled: true,
|
|
792
806
|
render: /* @__PURE__ */ jsxs(PromptInputButton, {
|
|
793
|
-
size: "
|
|
807
|
+
size: "sm",
|
|
794
808
|
className: "prompt-input__permissions-trigger",
|
|
795
809
|
"data-mode": value,
|
|
796
810
|
"aria-label": selected.label,
|
|
@@ -841,9 +855,9 @@ function PromptInputPermissionSelector({ value, onValueChange, question = "How s
|
|
|
841
855
|
})
|
|
842
856
|
}) }) })] });
|
|
843
857
|
}
|
|
844
|
-
function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "
|
|
858
|
+
function PromptInputSubmit({ className, status = "ready", onStop, variant = "normal", color = "primary", size = "sm", onClick, children, label, hasContent = false, ref, ...props }) {
|
|
845
859
|
const isBusy = status === "submitted" || status === "streaming";
|
|
846
|
-
const isQueueing = isBusy &&
|
|
860
|
+
const isQueueing = isBusy && hasContent;
|
|
847
861
|
const isStopping = isBusy && !isQueueing;
|
|
848
862
|
const resolvedLabel = label ?? (isQueueing ? "Queue message" : defaultSubmitLabel(status));
|
|
849
863
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -852,6 +866,7 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
|
|
|
852
866
|
variant,
|
|
853
867
|
color,
|
|
854
868
|
size,
|
|
869
|
+
iconOnly: true,
|
|
855
870
|
className: cx("prompt-input__submit", className),
|
|
856
871
|
"data-status": status,
|
|
857
872
|
"aria-label": resolvedLabel,
|
|
@@ -867,11 +882,20 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
|
|
|
867
882
|
children: children ?? (isQueueing ? /* @__PURE__ */ jsx(ArrowUpIcon, {}) : defaultSubmitIcon(status))
|
|
868
883
|
});
|
|
869
884
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
885
|
+
/**
|
|
886
|
+
* Resolve Think execution approvals that do not use the AI SDK
|
|
887
|
+
* `approval-requested` part: paused codemode executions and durable-pause
|
|
888
|
+
* approvals from `pendingApprovals()`. Pass the whole upstream Think agent
|
|
889
|
+
* stub; the component calls its client-callable RPCs directly:
|
|
890
|
+
*
|
|
891
|
+
* ```tsx
|
|
892
|
+
* <PromptInputApproval part={part} thinkStub={agent.stub} />
|
|
893
|
+
* ```
|
|
894
|
+
*
|
|
895
|
+
* On approve, upstream resumes or runs the parked execution and auto-continues
|
|
896
|
+
* the chat. Both RPCs are idempotent, so a stale click resolves to "already
|
|
897
|
+
* handled".
|
|
898
|
+
*/
|
|
875
899
|
/** The id a response must carry: the approval id, or the paused run's executionId. */
|
|
876
900
|
function getApprovalRequestId(part) {
|
|
877
901
|
if (part.state === "approval-requested") return getToolApproval(part)?.id;
|
|
@@ -888,22 +912,13 @@ function getApprovalStateKey(part) {
|
|
|
888
912
|
/** Derives pending tool approvals straight from the messages — no app-owned shapes. */
|
|
889
913
|
function getPendingToolApprovals(messages, { pausedExecutions = false } = {}) {
|
|
890
914
|
const pending = [];
|
|
891
|
-
messages.forEach((message
|
|
892
|
-
message.parts.forEach((part
|
|
893
|
-
if (isToolUIPart(part) && (part.state === "approval-requested" || pausedExecutions && getPausedExecution(part))) pending.push(
|
|
894
|
-
message,
|
|
895
|
-
messageIndex,
|
|
896
|
-
part,
|
|
897
|
-
partIndex
|
|
898
|
-
});
|
|
915
|
+
messages.forEach((message) => {
|
|
916
|
+
message.parts.forEach((part) => {
|
|
917
|
+
if (isToolUIPart(part) && (part.state === "approval-requested" || pausedExecutions && getPausedExecution(part))) pending.push(part);
|
|
899
918
|
});
|
|
900
919
|
});
|
|
901
920
|
return pending;
|
|
902
921
|
}
|
|
903
|
-
function formatApprovalValue(value) {
|
|
904
|
-
if (typeof value === "string") return value;
|
|
905
|
-
return JSON.stringify(value);
|
|
906
|
-
}
|
|
907
922
|
/**
|
|
908
923
|
* The composer's approval state: when a tool call awaits human approval the
|
|
909
924
|
* prompt input area becomes the confirmation. "Yes" approves on click; typing
|
|
@@ -912,183 +927,32 @@ function formatApprovalValue(value) {
|
|
|
912
927
|
* current selection — approve by default.
|
|
913
928
|
*/
|
|
914
929
|
function PromptInputApproval({ part, approval: durableApproval, onRespond, thinkStub, onExecutionSettled, onSkip, question, count, className, ref, ...props }) {
|
|
915
|
-
const
|
|
916
|
-
const [reason, setReason] = React.useState("");
|
|
917
|
-
const [busy, setBusy] = React.useState(false);
|
|
918
|
-
const yesRef = React.useRef(null);
|
|
919
|
-
const reasonRef = React.useRef(null);
|
|
920
|
-
const approval = part?.state === "approval-requested" ? part.approval : void 0;
|
|
921
|
-
const paused = part ? getPausedExecution(part) : void 0;
|
|
922
|
-
const approvalId = part ? getApprovalStateKey(part) : durableApproval?.executionId;
|
|
923
|
-
React.useEffect(() => {
|
|
924
|
-
setSelected("approve");
|
|
925
|
-
setReason("");
|
|
926
|
-
setBusy(false);
|
|
927
|
-
}, [approvalId]);
|
|
928
|
-
if (!part && !durableApproval) return null;
|
|
929
|
-
if (approval ? !onRespond : !(thinkStub && (paused || durableApproval))) return null;
|
|
930
|
-
const toolName = durableApproval?.descriptor.action ?? (part ? getToolName(part) : "action");
|
|
931
|
-
const respond = async (approved) => {
|
|
932
|
-
if (busy) return;
|
|
933
|
-
setBusy(true);
|
|
934
|
-
const trimmed = reason.trim();
|
|
935
|
-
const denyReason = !approved && trimmed ? trimmed : void 0;
|
|
936
|
-
try {
|
|
937
|
-
if (approval) await onRespond?.({
|
|
938
|
-
id: approval.id,
|
|
939
|
-
approved,
|
|
940
|
-
reason: denyReason
|
|
941
|
-
});
|
|
942
|
-
else if (paused && thinkStub) await (approved ? thinkStub.approveExecution(paused.executionId) : thinkStub.rejectExecution(paused.executionId, denyReason));
|
|
943
|
-
else if (durableApproval && thinkStub) await (approved ? thinkStub.approveExecution(durableApproval.executionId) : thinkStub.rejectExecution(durableApproval.executionId, denyReason));
|
|
944
|
-
} finally {
|
|
945
|
-
setBusy(false);
|
|
946
|
-
if (!approval) onExecutionSettled?.();
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
const submit = () => void respond(selected === "approve");
|
|
950
|
-
const input = durableApproval?.descriptor.input ?? (part ? getToolInput(part) : void 0);
|
|
951
|
-
const inputEntries = input && typeof input === "object" && !Array.isArray(input) ? Object.entries(input) : void 0;
|
|
952
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
953
|
-
ref,
|
|
954
|
-
role: "group",
|
|
955
|
-
"aria-label": `Approve ${toolName}`,
|
|
930
|
+
const shared = {
|
|
956
931
|
className: cx("prompt-input__approval", className),
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
}),
|
|
980
|
-
paused ? /* @__PURE__ */ jsx("div", {
|
|
981
|
-
className: "prompt-input__approval-preview",
|
|
982
|
-
children: paused.pending.map((action) => /* @__PURE__ */ jsxs("div", {
|
|
983
|
-
className: "prompt-input__approval-preview-row",
|
|
984
|
-
children: [
|
|
985
|
-
/* @__PURE__ */ jsxs("span", {
|
|
986
|
-
className: "prompt-input__approval-preview-key",
|
|
987
|
-
children: [
|
|
988
|
-
action.connector,
|
|
989
|
-
".",
|
|
990
|
-
action.method
|
|
991
|
-
]
|
|
992
|
-
}),
|
|
993
|
-
" ",
|
|
994
|
-
action.args === void 0 ? null : formatApprovalValue(action.args)
|
|
995
|
-
]
|
|
996
|
-
}, action.seq))
|
|
997
|
-
}) : input !== void 0 ? /* @__PURE__ */ jsx("div", {
|
|
998
|
-
className: "prompt-input__approval-preview",
|
|
999
|
-
children: inputEntries ? inputEntries.map(([key, value]) => /* @__PURE__ */ jsxs("div", {
|
|
1000
|
-
className: "prompt-input__approval-preview-row",
|
|
1001
|
-
children: [
|
|
1002
|
-
/* @__PURE__ */ jsx("span", {
|
|
1003
|
-
className: "prompt-input__approval-preview-key",
|
|
1004
|
-
children: key
|
|
1005
|
-
}),
|
|
1006
|
-
" ",
|
|
1007
|
-
formatApprovalValue(value)
|
|
1008
|
-
]
|
|
1009
|
-
}, key)) : /* @__PURE__ */ jsx("div", {
|
|
1010
|
-
className: "prompt-input__approval-preview-row",
|
|
1011
|
-
children: formatApprovalValue(input)
|
|
1012
|
-
})
|
|
1013
|
-
}) : null,
|
|
1014
|
-
/* @__PURE__ */ jsxs("div", {
|
|
1015
|
-
className: "prompt-input__approval-options",
|
|
1016
|
-
children: [/* @__PURE__ */ jsxs("button", {
|
|
1017
|
-
ref: yesRef,
|
|
1018
|
-
type: "button",
|
|
1019
|
-
className: "prompt-input__approval-option",
|
|
1020
|
-
"data-selected": selected === "approve" || void 0,
|
|
1021
|
-
disabled: busy,
|
|
1022
|
-
onClick: () => void respond(true),
|
|
1023
|
-
onFocus: () => setSelected("approve"),
|
|
1024
|
-
children: [
|
|
1025
|
-
/* @__PURE__ */ jsx("span", {
|
|
1026
|
-
className: "prompt-input__approval-key",
|
|
1027
|
-
children: "1"
|
|
1028
|
-
}),
|
|
1029
|
-
"Yes",
|
|
1030
|
-
/* @__PURE__ */ jsx("span", {
|
|
1031
|
-
className: "prompt-input__approval-arrows",
|
|
1032
|
-
"aria-hidden": "true",
|
|
1033
|
-
children: "↑↓"
|
|
1034
|
-
})
|
|
1035
|
-
]
|
|
1036
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
1037
|
-
className: "prompt-input__approval-option prompt-input__approval-deny",
|
|
1038
|
-
"data-selected": selected === "deny" || void 0,
|
|
1039
|
-
children: [
|
|
1040
|
-
/* @__PURE__ */ jsx("span", {
|
|
1041
|
-
className: "prompt-input__approval-key",
|
|
1042
|
-
"aria-hidden": "true",
|
|
1043
|
-
children: /* @__PURE__ */ jsx(PencilIcon, { size: 11 })
|
|
1044
|
-
}),
|
|
1045
|
-
/* @__PURE__ */ jsx("input", {
|
|
1046
|
-
ref: reasonRef,
|
|
1047
|
-
type: "text",
|
|
1048
|
-
className: "prompt-input__approval-reason",
|
|
1049
|
-
"aria-label": `Deny ${toolName} and tell the agent what to do differently`,
|
|
1050
|
-
placeholder: "No, and tell the agent what to do differently",
|
|
1051
|
-
value: reason,
|
|
1052
|
-
disabled: busy,
|
|
1053
|
-
onFocus: () => setSelected("deny"),
|
|
1054
|
-
onChange: (event) => {
|
|
1055
|
-
setSelected("deny");
|
|
1056
|
-
setReason(event.currentTarget.value);
|
|
1057
|
-
},
|
|
1058
|
-
onKeyDown: (event) => {
|
|
1059
|
-
if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
1060
|
-
event.preventDefault();
|
|
1061
|
-
respond(false);
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
}),
|
|
1065
|
-
onSkip ? /* @__PURE__ */ jsx(Button, {
|
|
1066
|
-
type: "button",
|
|
1067
|
-
size: "xs",
|
|
1068
|
-
variant: "ghost",
|
|
1069
|
-
color: "neutral",
|
|
1070
|
-
className: "prompt-input__approval-skip",
|
|
1071
|
-
disabled: busy,
|
|
1072
|
-
onClick: onSkip,
|
|
1073
|
-
children: "Skip"
|
|
1074
|
-
}) : null,
|
|
1075
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
1076
|
-
type: "button",
|
|
1077
|
-
size: "xs",
|
|
1078
|
-
color: "primary",
|
|
1079
|
-
className: "prompt-input__approval-submit",
|
|
1080
|
-
disabled: busy,
|
|
1081
|
-
onClick: submit,
|
|
1082
|
-
children: [selected === "approve" ? "Approve" : "Submit", /* @__PURE__ */ jsx("kbd", {
|
|
1083
|
-
className: "prompt-input__approval-kbd",
|
|
1084
|
-
children: "⏎"
|
|
1085
|
-
})]
|
|
1086
|
-
})
|
|
1087
|
-
]
|
|
1088
|
-
})]
|
|
1089
|
-
})
|
|
1090
|
-
]
|
|
932
|
+
count,
|
|
933
|
+
onSkip,
|
|
934
|
+
question,
|
|
935
|
+
ref,
|
|
936
|
+
...props
|
|
937
|
+
};
|
|
938
|
+
if (part?.state === "approval-requested" && onRespond) return /* @__PURE__ */ jsx(ToolApproval, {
|
|
939
|
+
...shared,
|
|
940
|
+
part,
|
|
941
|
+
onRespond
|
|
942
|
+
});
|
|
943
|
+
if (part && thinkStub && getPausedExecution(part)) return /* @__PURE__ */ jsx(ThinkExecutionApproval, {
|
|
944
|
+
...shared,
|
|
945
|
+
part,
|
|
946
|
+
thinkStub,
|
|
947
|
+
onSettled: onExecutionSettled
|
|
948
|
+
});
|
|
949
|
+
if (durableApproval && thinkStub) return /* @__PURE__ */ jsx(ThinkPendingApproval, {
|
|
950
|
+
...shared,
|
|
951
|
+
approval: durableApproval,
|
|
952
|
+
thinkStub,
|
|
953
|
+
onSettled: onExecutionSettled
|
|
1091
954
|
});
|
|
955
|
+
return null;
|
|
1092
956
|
}
|
|
1093
957
|
const PromptInputSelect = Select;
|
|
1094
958
|
const PromptInputHoverCardContext = React.createContext(null);
|
|
@@ -1169,7 +1033,7 @@ const PromptInputCommandInput = Combobox.Input;
|
|
|
1169
1033
|
function PromptInputCommandList({ className, ref, ...props }) {
|
|
1170
1034
|
return /* @__PURE__ */ jsx(Combobox.List, {
|
|
1171
1035
|
ref,
|
|
1172
|
-
className:
|
|
1036
|
+
className: mergeBaseClassName("prompt-input__command-list", className),
|
|
1173
1037
|
...props
|
|
1174
1038
|
});
|
|
1175
1039
|
}
|
|
@@ -1240,6 +1104,7 @@ function PromptInputCommandComposer({ commands, mentionCommands, value, onValueC
|
|
|
1240
1104
|
className: "prompt-input__command-positioner",
|
|
1241
1105
|
children: /* @__PURE__ */ jsxs(Combobox.Popup, {
|
|
1242
1106
|
className: "prompt-input__command-popup",
|
|
1107
|
+
"data-recipe": "composer-command-surface",
|
|
1243
1108
|
children: [/* @__PURE__ */ jsx(PromptInputCommandList, {
|
|
1244
1109
|
"data-command-trigger": trigger,
|
|
1245
1110
|
children: (group) => /* @__PURE__ */ jsxs(PromptInputCommandGroup, {
|
|
@@ -1288,7 +1153,7 @@ function PromptInputReferences({ references, onRemove, className, ref, ...props
|
|
|
1288
1153
|
type: "button",
|
|
1289
1154
|
variant: "ghost",
|
|
1290
1155
|
color: "primary",
|
|
1291
|
-
size: "
|
|
1156
|
+
size: "sm",
|
|
1292
1157
|
className: "prompt-input__reference",
|
|
1293
1158
|
"aria-label": `Remove ${reference.label}`,
|
|
1294
1159
|
onClick: () => onRemove(reference),
|
|
@@ -1317,7 +1182,7 @@ function PromptInputContextSelector({ items, value, onValueChange, categoryLabel
|
|
|
1317
1182
|
const trigger = /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
1318
1183
|
unstyled: true,
|
|
1319
1184
|
render: /* @__PURE__ */ jsxs(PromptInputButton, {
|
|
1320
|
-
size: "
|
|
1185
|
+
size: "sm",
|
|
1321
1186
|
className: "prompt-input__context-trigger",
|
|
1322
1187
|
"aria-label": `${categoryLabel}: ${fullLabel}`,
|
|
1323
1188
|
"data-unavailable": !selected || selected.unavailable || void 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Collapsible } from "
|
|
2
|
-
import { r as ButtonProps } from "../Button-
|
|
1
|
+
import { t as Collapsible } from "../Collapsible-N64ASIQr.js";
|
|
2
|
+
import { r as ButtonProps } from "../Button-DLGzHsjc.js";
|
|
3
3
|
import { ScrollArea } from "./ScrollArea.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
|
|
@@ -61,9 +61,7 @@ declare function Queue({
|
|
|
61
61
|
}: QueueProps & {
|
|
62
62
|
ref?: React.Ref<HTMLDivElement>;
|
|
63
63
|
}): React.JSX.Element;
|
|
64
|
-
interface QueueSectionProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "
|
|
65
|
-
className?: string;
|
|
66
|
-
}
|
|
64
|
+
interface QueueSectionProps extends Omit<React.ComponentProps<typeof Collapsible.Root>, "unstyled"> {}
|
|
67
65
|
/**
|
|
68
66
|
* A collapsible section within a Queue. Holds a trigger label and a list
|
|
69
67
|
* of QueueItem children.
|
|
@@ -76,9 +74,7 @@ declare function QueueSection({
|
|
|
76
74
|
}: QueueSectionProps & {
|
|
77
75
|
ref?: React.Ref<HTMLDivElement>;
|
|
78
76
|
}): React.JSX.Element;
|
|
79
|
-
interface QueueSectionTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "
|
|
80
|
-
className?: string;
|
|
81
|
-
}
|
|
77
|
+
interface QueueSectionTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "unstyled"> {}
|
|
82
78
|
declare function QueueSectionTrigger({
|
|
83
79
|
className,
|
|
84
80
|
children,
|
|
@@ -104,9 +100,7 @@ declare function QueueSectionLabel({
|
|
|
104
100
|
}: QueueSectionLabelProps & {
|
|
105
101
|
ref?: React.Ref<HTMLSpanElement>;
|
|
106
102
|
}): React.JSX.Element;
|
|
107
|
-
interface QueueListProps extends
|
|
108
|
-
className?: string;
|
|
109
|
-
}
|
|
103
|
+
interface QueueListProps extends React.ComponentProps<typeof ScrollArea.Root> {}
|
|
110
104
|
declare function QueueList({
|
|
111
105
|
className,
|
|
112
106
|
children,
|
|
@@ -115,9 +109,7 @@ declare function QueueList({
|
|
|
115
109
|
}: QueueListProps & {
|
|
116
110
|
ref?: React.Ref<HTMLDivElement>;
|
|
117
111
|
}): React.JSX.Element;
|
|
118
|
-
interface QueueSectionContentProps extends Omit<React.ComponentProps<typeof Collapsible.Panel>, "
|
|
119
|
-
className?: string;
|
|
120
|
-
}
|
|
112
|
+
interface QueueSectionContentProps extends Omit<React.ComponentProps<typeof Collapsible.Panel>, "unstyled"> {}
|
|
121
113
|
declare function QueueSectionContent({
|
|
122
114
|
className,
|
|
123
115
|
ref,
|
|
@@ -176,9 +168,7 @@ declare function QueueItemDescription({
|
|
|
176
168
|
ref?: React.Ref<HTMLParagraphElement>;
|
|
177
169
|
}): React.JSX.Element;
|
|
178
170
|
interface QueueItemActionsProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
179
|
-
interface QueueItemActionProps extends Omit<ButtonProps, "variant" | "color" | "size"
|
|
180
|
-
className?: string;
|
|
181
|
-
}
|
|
171
|
+
interface QueueItemActionProps extends Omit<ButtonProps, "variant" | "color" | "size"> {}
|
|
182
172
|
declare function QueueItemActions({
|
|
183
173
|
className,
|
|
184
174
|
children,
|
package/dist/components/Queue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
1
2
|
import { Collapsible } from "./Collapsible.js";
|
|
2
|
-
import {
|
|
3
|
-
import { l as ChevronRightIcon, o as CheckIcon, p as DotIcon, v as FileIcon } from "../icons-CpfUer49.js";
|
|
3
|
+
import { f as ChevronRightIcon, g as DotIcon, l as CheckIcon, x as FileIcon } from "../icons-CQJ-aMnI.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -90,7 +90,6 @@ function QueueSectionLabel({ className, children, count, label, icon, ref, ...pr
|
|
|
90
90
|
children !== void 0 && count !== void 0 ? /* @__PURE__ */ jsx(Badge, {
|
|
91
91
|
color: "neutral",
|
|
92
92
|
size: "sm",
|
|
93
|
-
className: "queue__section-count",
|
|
94
93
|
children: count
|
|
95
94
|
}) : null
|
|
96
95
|
]
|
|
@@ -3,20 +3,15 @@ import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
|
3
3
|
import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
4
4
|
|
|
5
5
|
//#region src/components/RadioGroup.d.ts
|
|
6
|
-
interface RadioGroupProps extends
|
|
7
|
-
className?: string;
|
|
6
|
+
interface RadioGroupProps extends React.ComponentPropsWithRef<typeof RadioGroup$1> {
|
|
8
7
|
/**
|
|
9
8
|
* The orientation of the radio group.
|
|
10
9
|
* @default 'vertical'
|
|
11
10
|
*/
|
|
12
11
|
orientation?: "horizontal" | "vertical";
|
|
13
12
|
}
|
|
14
|
-
interface RadioProps extends
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
interface RadioIndicatorProps extends Omit<React.ComponentPropsWithRef<typeof Radio$1.Indicator>, "className"> {
|
|
18
|
-
className?: string;
|
|
19
|
-
}
|
|
13
|
+
interface RadioProps extends React.ComponentPropsWithRef<typeof Radio$1.Root> {}
|
|
14
|
+
interface RadioIndicatorProps extends React.ComponentPropsWithRef<typeof Radio$1.Indicator> {}
|
|
20
15
|
/**
|
|
21
16
|
* A radio group component for selecting one option from a list.
|
|
22
17
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
1
2
|
import "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
@@ -26,23 +27,19 @@ import { Radio as Radio$1 } from "@base-ui/react/radio";
|
|
|
26
27
|
*
|
|
27
28
|
* @see {@link https://base-ui.com/react/components/radio-group | Base UI Radio Group}
|
|
28
29
|
*/
|
|
29
|
-
function RadioGroupRoot({ orientation = "vertical", className
|
|
30
|
+
function RadioGroupRoot({ orientation = "vertical", className, ref, ...props }) {
|
|
30
31
|
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
31
32
|
ref,
|
|
32
33
|
"data-slot": "radio-group",
|
|
33
|
-
className: [
|
|
34
|
-
"radio-group",
|
|
35
|
-
`radio-group--${orientation}`,
|
|
36
|
-
className
|
|
37
|
-
].filter(Boolean).join(" "),
|
|
34
|
+
className: mergeBaseClassName(["radio-group", `radio-group--${orientation}`].filter(Boolean).join(" "), className),
|
|
38
35
|
...props
|
|
39
36
|
});
|
|
40
37
|
}
|
|
41
38
|
/**
|
|
42
39
|
* A single radio button within a RadioGroup.
|
|
43
40
|
*/
|
|
44
|
-
function RadioRoot({ className
|
|
45
|
-
const classes = ["radio"
|
|
41
|
+
function RadioRoot({ className, ref, ...props }) {
|
|
42
|
+
const classes = mergeBaseClassName(["radio"].filter(Boolean).join(" "), className);
|
|
46
43
|
return /* @__PURE__ */ jsx(Radio$1.Root, {
|
|
47
44
|
ref,
|
|
48
45
|
"data-slot": "radio-group-item",
|
|
@@ -53,8 +50,8 @@ function RadioRoot({ className = "", ref, ...props }) {
|
|
|
53
50
|
/**
|
|
54
51
|
* The visual indicator for a Radio button.
|
|
55
52
|
*/
|
|
56
|
-
function RadioIndicator({ className
|
|
57
|
-
const classes = ["radio__indicator"
|
|
53
|
+
function RadioIndicator({ className, ref, ...props }) {
|
|
54
|
+
const classes = mergeBaseClassName(["radio__indicator"].filter(Boolean).join(" "), className);
|
|
58
55
|
return /* @__PURE__ */ jsx(Radio$1.Indicator, {
|
|
59
56
|
ref,
|
|
60
57
|
"data-slot": "radio-group-indicator",
|