@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,25 +1,38 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { B as PlusIcon, F as MoveToFrontIcon, H as RefreshIcon, R as PencilIcon, V as QueueIcon, X as TrashIcon } from "../icons-CQJ-aMnI.js";
|
|
3
|
+
import { n as MessageAction, r as MessageActions, t as Message } from "../Message-BXtmfc9Q.js";
|
|
4
|
+
import { AgentMessageParts } from "./AgentMessageParts.js";
|
|
4
5
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "./Context.js";
|
|
5
6
|
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
6
7
|
import { ConversationEmptyState } from "./Conversation.js";
|
|
7
|
-
import { d as MessageContent, f as MessageResponse, i as MessageAttachment, n as MessageAction, r as MessageActions, t as Message } from "../Message-BkMdE3bS.js";
|
|
8
8
|
import { AgentChatMessageEditor } from "./AgentChatMessageEditor.js";
|
|
9
9
|
import { Marker, MarkerContent } from "./Marker.js";
|
|
10
10
|
import { Menu } from "./Menu.js";
|
|
11
|
+
import { TransitionSurface } from "./TransitionSurface.js";
|
|
11
12
|
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments } from "./PromptInput.js";
|
|
12
|
-
import {
|
|
13
|
-
import { Source, Sources, SourcesContent, SourcesTrigger } from "./Sources.js";
|
|
14
|
-
import { getToolDisplayName, isToolPartFailed, isToolPartWorking } from "./ThinkChatToolParts.js";
|
|
15
|
-
import { t as CopyButton } from "../copy-button-Dejn5heL.js";
|
|
16
|
-
import { t as summarizeToolInput } from "../summarize-tool-input-BUJsENSn.js";
|
|
13
|
+
import { t as CopyButton } from "../copy-button-DeK6KXEV.js";
|
|
17
14
|
import * as React from "react";
|
|
18
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
16
|
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
20
|
-
import {
|
|
21
|
-
import { isFileUIPart, isReasoningUIPart, isTextUIPart, isToolUIPart } from "ai";
|
|
17
|
+
import { isReasoningUIPart, isTextUIPart } from "ai";
|
|
22
18
|
//#region src/components/AgentChat.tsx
|
|
19
|
+
/**
|
|
20
|
+
* Agents exports this helper from `agents/sessions` after cloudflare/agents#1896;
|
|
21
|
+
* the current 0.17.4 release still publishes it from the experimental path.
|
|
22
|
+
* It checks the canonical `compaction_` id prefix used when Session history
|
|
23
|
+
* materializes a summary overlay. `UIMessage` is structurally compatible with
|
|
24
|
+
* the `SessionMessage` fields it reads, so use the upstream helper directly
|
|
25
|
+
* instead of duplicating the prefix contract locally.
|
|
26
|
+
*/
|
|
27
|
+
function observeAgentChatComposer(element) {
|
|
28
|
+
if (!element || typeof ResizeObserver === "undefined") return;
|
|
29
|
+
const root = element.parentElement;
|
|
30
|
+
const observer = new ResizeObserver(() => {
|
|
31
|
+
root?.style.setProperty("--agent-chat-composer-size", `${element.offsetHeight}px`);
|
|
32
|
+
});
|
|
33
|
+
observer.observe(element);
|
|
34
|
+
return () => observer.disconnect();
|
|
35
|
+
}
|
|
23
36
|
const EMPTY_PENDING_APPROVALS = [];
|
|
24
37
|
const EMPTY_SKIPPED_APPROVAL_IDS = [];
|
|
25
38
|
function createApprovalSessionState(thinkStub) {
|
|
@@ -45,74 +58,19 @@ function AgentChatAddMenu({ children }) {
|
|
|
45
58
|
sideOffset: 12,
|
|
46
59
|
collisionPadding: 8,
|
|
47
60
|
className: "agent-chat__add-menu",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
children: "Add"
|
|
51
|
-
}), /* @__PURE__ */ jsx(PromptInputActionAddAttachments, {})] }), children]
|
|
61
|
+
"data-recipe": "composer-command-surface wide-scroll-picker",
|
|
62
|
+
children: [/* @__PURE__ */ jsxs(Menu.Group, { children: [/* @__PURE__ */ jsx(Menu.GroupLabel, { children: "Add" }), /* @__PURE__ */ jsx(PromptInputActionAddAttachments, {})] }), children]
|
|
52
63
|
})] });
|
|
53
64
|
}
|
|
54
|
-
function AgentChatSubmitAction({ status, onStop,
|
|
65
|
+
function AgentChatSubmitAction({ status, onStop, disabled, hasDraft }) {
|
|
55
66
|
const attachments = usePromptInputAttachments();
|
|
56
67
|
return /* @__PURE__ */ jsx(PromptInputSubmit, {
|
|
57
68
|
status,
|
|
58
69
|
onStop,
|
|
59
|
-
allowSubmitWhileBusy,
|
|
60
70
|
hasContent: hasDraft || attachments.files.length > 0,
|
|
61
71
|
disabled
|
|
62
72
|
});
|
|
63
73
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Per-message row-size compaction marker from `AIChatAgent` persistence.
|
|
66
|
-
*
|
|
67
|
-
* This is distinct from Session history compaction overlays. When a single
|
|
68
|
-
* SQLite row approaches the Workers/SQLite size limit, Agents compacts large
|
|
69
|
-
* tool outputs and, if necessary, truncates text before persistence. The
|
|
70
|
-
* message remains in place and receives metadata keys documented by Agents:
|
|
71
|
-
* `compactedToolOutputs` lists tool-call ids whose outputs were summarized;
|
|
72
|
-
* `compactedTextParts` lists text-part indexes that were truncated. The UI
|
|
73
|
-
* reads those keys structurally because they are persisted metadata rather than
|
|
74
|
-
* exported AI SDK part variants, then adds a local visual note while preserving
|
|
75
|
-
* the original `UIMessage` and part shapes.
|
|
76
|
-
*
|
|
77
|
-
* @see https://github.com/cloudflare/agents/blob/main/docs/agents/chat-agents.md#row-size-protection
|
|
78
|
-
*/
|
|
79
|
-
function isCompactedPart(message, part, partIndex) {
|
|
80
|
-
const metadata = message.metadata;
|
|
81
|
-
if (isTextUIPart(part)) return Array.isArray(metadata?.compactedTextParts) && metadata.compactedTextParts.includes(partIndex);
|
|
82
|
-
if (isToolUIPart(part)) return Array.isArray(metadata?.compactedToolOutputs) && metadata.compactedToolOutputs.includes(part.toolCallId);
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
function getPartKey(part, partIndex) {
|
|
86
|
-
if (isToolUIPart(part)) return part.toolCallId;
|
|
87
|
-
if ("id" in part && typeof part.id === "string") return `${part.type}-${part.id}`;
|
|
88
|
-
return `${part.type}-${partIndex}`;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* AI SDK exports concrete source part types but no public source-part guard.
|
|
92
|
-
* Keep these local guards as exact discriminant checks, matching
|
|
93
|
-
* `ai/src/ui/ui-messages.ts` and `ai/src/ui/process-ui-message-stream.ts`.
|
|
94
|
-
* If AI SDK exports source or step guards later, replace these wrappers rather
|
|
95
|
-
* than widening the local transcript contract.
|
|
96
|
-
*/
|
|
97
|
-
function isSourceUrlPart(part) {
|
|
98
|
-
return part?.type === "source-url";
|
|
99
|
-
}
|
|
100
|
-
function isSourceDocumentPart(part) {
|
|
101
|
-
return part?.type === "source-document";
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Session compaction overlay marker from Agents Sessions.
|
|
105
|
-
*
|
|
106
|
-
* Agents exports `isCompactionMessage` from `agents/sessions`; it checks the canonical `compaction_`
|
|
107
|
-
* id prefix used when `Session.getHistory()` materializes a summary overlay.
|
|
108
|
-
* `UIMessage` is structurally compatible with the fields the helper reads, so
|
|
109
|
-
* keep this wrapper instead of duplicating the prefix test locally. The
|
|
110
|
-
* runtime import above stays on the deprecated compatibility path until this
|
|
111
|
-
* package raises its Agents dependency floor to the graduating release.
|
|
112
|
-
*/
|
|
113
|
-
function isCompactionMessage$1(message) {
|
|
114
|
-
return isCompactionMessage(message);
|
|
115
|
-
}
|
|
116
74
|
function getMessageText(message) {
|
|
117
75
|
return message.parts.filter((part) => isTextUIPart(part) || isReasoningUIPart(part)).map((part) => part.text).join("");
|
|
118
76
|
}
|
|
@@ -129,13 +87,12 @@ function AgentChatAssistantActions({ message, responseNumber, showCopy, showRetr
|
|
|
129
87
|
label: `Copy response ${responseNumber}`,
|
|
130
88
|
tooltip: "Copy response",
|
|
131
89
|
text: copyText,
|
|
132
|
-
size: "
|
|
90
|
+
size: "sm",
|
|
133
91
|
onCopy: () => onCopyStatus(`Response ${responseNumber} copied.`),
|
|
134
92
|
onError: () => onCopyStatus(`Could not copy response ${responseNumber}. Try again.`)
|
|
135
93
|
}) : null, showRetry && onRegenerate ? /* @__PURE__ */ jsx(MessageAction, {
|
|
136
94
|
label: "Retry",
|
|
137
95
|
tooltip: "Regenerate response",
|
|
138
|
-
size: "icon-lg",
|
|
139
96
|
onClick: () => onRegenerate(message.id),
|
|
140
97
|
children: /* @__PURE__ */ jsx(RefreshIcon, { size: 14 })
|
|
141
98
|
}) : null]
|
|
@@ -146,86 +103,18 @@ function getEditableUserText(message) {
|
|
|
146
103
|
const part = message.parts[0];
|
|
147
104
|
return isTextUIPart(part) && part.text.trim() ? part.text : void 0;
|
|
148
105
|
}
|
|
149
|
-
function formatSourceTitle(part) {
|
|
150
|
-
if (part.title) return part.title;
|
|
151
|
-
if (part.type === "source-document") return part.filename ?? part.mediaType;
|
|
152
|
-
try {
|
|
153
|
-
return new URL(part.url).hostname.replace(/^www\./, "");
|
|
154
|
-
} catch {
|
|
155
|
-
return part.url;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function renderSources(parts) {
|
|
159
|
-
return /* @__PURE__ */ jsxs(Sources, { children: [/* @__PURE__ */ jsx(SourcesTrigger, { count: parts.length }), /* @__PURE__ */ jsx(SourcesContent, { children: parts.map((part) => part.type === "source-url" ? /* @__PURE__ */ jsx(Source, {
|
|
160
|
-
href: part.url,
|
|
161
|
-
title: formatSourceTitle(part)
|
|
162
|
-
}, part.sourceId) : /* @__PURE__ */ jsx(Source, {
|
|
163
|
-
title: formatSourceTitle(part),
|
|
164
|
-
description: part.filename ?? part.mediaType
|
|
165
|
-
}, part.sourceId)) })] });
|
|
166
|
-
}
|
|
167
|
-
function getSourceRun(parts, start) {
|
|
168
|
-
const sources = [];
|
|
169
|
-
for (let index = start; index < parts.length; index++) {
|
|
170
|
-
const candidate = parts[index];
|
|
171
|
-
if (!isSourceUrlPart(candidate) && !isSourceDocumentPart(candidate)) break;
|
|
172
|
-
sources.push(candidate);
|
|
173
|
-
}
|
|
174
|
-
return sources;
|
|
175
|
-
}
|
|
176
|
-
function describeToolPart(part) {
|
|
177
|
-
const name = getToolDisplayName(part);
|
|
178
|
-
const verb = isToolPartFailed(part) ? `${name} failed` : isToolPartWorking(part) ? `Running ${name}` : `Ran ${name}`;
|
|
179
|
-
const detail = summarizeToolInput(getToolInput(part));
|
|
180
|
-
return detail ? `${verb} · ${detail}` : verb;
|
|
181
|
-
}
|
|
182
|
-
function formatToolValue(value) {
|
|
183
|
-
if (value === void 0) return void 0;
|
|
184
|
-
return typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
185
|
-
}
|
|
186
|
-
function renderToolActivity(part) {
|
|
187
|
-
const state = getToolPartState(part);
|
|
188
|
-
const failed = isToolPartFailed(part);
|
|
189
|
-
const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
|
|
190
|
-
const output = state === "error" ? part.errorText : state === "denied" ? deniedReason ?? "Denied" : formatToolValue(getToolOutput(part));
|
|
191
|
-
return /* @__PURE__ */ jsxs(Activity, {
|
|
192
|
-
isStreaming: isToolPartWorking(part),
|
|
193
|
-
children: [/* @__PURE__ */ jsx(ActivityTrigger, { label: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
|
|
194
|
-
label: getToolDisplayName(part),
|
|
195
|
-
text: formatToolValue(getToolInput(part))
|
|
196
|
-
}), output ? /* @__PURE__ */ jsx(ActivityPanel, {
|
|
197
|
-
label: "output",
|
|
198
|
-
text: output,
|
|
199
|
-
status: state === "denied" ? "denied" : failed ? "error" : void 0,
|
|
200
|
-
error: failed
|
|
201
|
-
}) : null] })]
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
function renderDefaultPart(message, part, partIndex, isLastMessage, status) {
|
|
205
|
-
if (isTextUIPart(part) && part.text) return /* @__PURE__ */ jsx(MessageResponse, { children: part.text });
|
|
206
|
-
if (isFileUIPart(part)) return /* @__PURE__ */ jsx(MessageAttachment, { part });
|
|
207
|
-
if (isReasoningUIPart(part)) {
|
|
208
|
-
if (partIndex !== message.parts.findIndex(isReasoningUIPart)) return null;
|
|
209
|
-
const reasoningText = message.parts.filter(isReasoningUIPart).map((reasoningPart) => reasoningPart.text).join("\n\n");
|
|
210
|
-
if (!reasoningText) return null;
|
|
211
|
-
const lastPart = message.parts.at(-1);
|
|
212
|
-
return /* @__PURE__ */ jsxs(Reasoning, {
|
|
213
|
-
isStreaming: isLastMessage && status === "streaming" && lastPart !== void 0 && isReasoningUIPart(lastPart) && lastPart.state === "streaming",
|
|
214
|
-
children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children: reasoningText })]
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
if (isToolUIPart(part)) return renderToolActivity(part);
|
|
218
|
-
return null;
|
|
219
|
-
}
|
|
220
106
|
/**
|
|
221
107
|
* Low-level transcript/composer surface used by `ThinkChat`: props in, no
|
|
222
108
|
* transport. Product code that talks to a Cloudflare Think agent should render
|
|
223
109
|
* `ThinkChat`; use this directly only for plain AI SDK or read-only messages.
|
|
224
110
|
*/
|
|
225
|
-
function AgentChat({ className, messages,
|
|
111
|
+
function AgentChat({ className, messages, status = "ready", onSubmit, showComposer = onSubmit !== void 0, onStop, placeholder = "Ask anything...", disabled, emptyState, composerHeader, composerTools, slashCommands, mentionCommands, contextSelector, composerEndTools, voiceInput, beforeVoiceStart, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, permissionModeControl, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, ref }) {
|
|
226
112
|
const [copyAnnouncement, setCopyAnnouncement] = React.useState("");
|
|
227
113
|
const [composerDraft, setComposerDraft] = React.useState("");
|
|
228
114
|
const [composerReferences, setComposerReferences] = React.useState([]);
|
|
115
|
+
const [pendingPrompts, setPendingPrompts] = React.useState([]);
|
|
116
|
+
const busy = status === "submitted" || status === "streaming";
|
|
117
|
+
const wasBusy = React.useRef(busy);
|
|
229
118
|
const addComposerReference = React.useCallback((reference) => {
|
|
230
119
|
setComposerReferences((current) => current.some((item) => item.id === reference.id && item.trigger === reference.trigger) ? current : [...current, reference]);
|
|
231
120
|
}, []);
|
|
@@ -245,14 +134,35 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
245
134
|
if (copyAnnouncementTimer.current !== null) window.clearTimeout(copyAnnouncementTimer.current);
|
|
246
135
|
}, []);
|
|
247
136
|
const handleSubmit = React.useCallback((message) => {
|
|
248
|
-
const
|
|
137
|
+
const prompt = {
|
|
249
138
|
...message,
|
|
250
139
|
...composerReferences.length ? { references: composerReferences } : {}
|
|
251
|
-
}
|
|
140
|
+
};
|
|
141
|
+
const submission = busy || pendingPrompts.length ? setPendingPrompts((current) => [...current, {
|
|
142
|
+
id: crypto.randomUUID(),
|
|
143
|
+
message: prompt
|
|
144
|
+
}]) : onSubmit?.(prompt);
|
|
252
145
|
setComposerDraft("");
|
|
253
146
|
setComposerReferences([]);
|
|
254
147
|
return submission;
|
|
255
|
-
}, [
|
|
148
|
+
}, [
|
|
149
|
+
busy,
|
|
150
|
+
composerReferences,
|
|
151
|
+
onSubmit,
|
|
152
|
+
pendingPrompts.length
|
|
153
|
+
]);
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
const becameReady = wasBusy.current && !busy;
|
|
156
|
+
wasBusy.current = busy;
|
|
157
|
+
const next = pendingPrompts[0];
|
|
158
|
+
if (!becameReady || !next || !onSubmit) return;
|
|
159
|
+
setPendingPrompts((current) => current.slice(1));
|
|
160
|
+
onSubmit(next.message);
|
|
161
|
+
}, [
|
|
162
|
+
busy,
|
|
163
|
+
onSubmit,
|
|
164
|
+
pendingPrompts
|
|
165
|
+
]);
|
|
256
166
|
const selectComposerCommand = React.useCallback((command, trigger) => {
|
|
257
167
|
const reference = {
|
|
258
168
|
id: command.id,
|
|
@@ -302,16 +212,34 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
302
212
|
React.useLayoutEffect(() => {
|
|
303
213
|
setApprovalSession((previous) => previous.thinkStub === thinkStub ? previous : createApprovalSessionState(thinkStub));
|
|
304
214
|
}, [thinkStub]);
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
215
|
+
const skippedApprovalIdSet = React.useMemo(() => new Set(skippedApprovalIds), [skippedApprovalIds]);
|
|
216
|
+
const pendingApprovalItems = React.useMemo(() => {
|
|
217
|
+
return [...getPendingToolApprovals(messages, { pausedExecutions: Boolean(thinkStub) }).filter((part) => {
|
|
218
|
+
if (part.state === "approval-requested" && !onApprovalResponse) return false;
|
|
219
|
+
const id = getApprovalStateKey(part);
|
|
220
|
+
return Boolean(id) && !skippedApprovalIdSet.has(id);
|
|
221
|
+
}).map((part) => ({ part })), ...thinkStub ? durableApprovals.filter((approval) => approval.source === "action" && !skippedApprovalIdSet.has(approval.executionId)).map((approval) => ({ approval })) : []];
|
|
222
|
+
}, [
|
|
223
|
+
durableApprovals,
|
|
224
|
+
messages,
|
|
225
|
+
onApprovalResponse,
|
|
226
|
+
skippedApprovalIdSet,
|
|
227
|
+
thinkStub
|
|
228
|
+
]);
|
|
310
229
|
const approvalsWired = Boolean(onApprovalResponse || thinkStub);
|
|
311
230
|
const autoApprovedIds = React.useRef({
|
|
312
231
|
thinkStub,
|
|
313
232
|
ids: /* @__PURE__ */ new Set()
|
|
314
233
|
});
|
|
234
|
+
const respondToApproval = React.useEffectEvent((id) => {
|
|
235
|
+
onApprovalResponse?.({
|
|
236
|
+
id,
|
|
237
|
+
approved: true
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
const notifyExecutionSettled = React.useEffectEvent(() => {
|
|
241
|
+
onExecutionSettled?.();
|
|
242
|
+
});
|
|
315
243
|
React.useLayoutEffect(() => {
|
|
316
244
|
if (autoApprovedIds.current.thinkStub === thinkStub) return;
|
|
317
245
|
autoApprovedIds.current = {
|
|
@@ -326,36 +254,28 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
326
254
|
const key = "part" in item ? getApprovalStateKey(item.part) : item.approval.executionId;
|
|
327
255
|
if (!id || !key || autoApprovedIds.current.ids.has(key)) continue;
|
|
328
256
|
autoApprovedIds.current.ids.add(key);
|
|
329
|
-
if ("part" in item && item.part.state === "approval-requested")
|
|
330
|
-
id,
|
|
331
|
-
approved: true
|
|
332
|
-
});
|
|
257
|
+
if ("part" in item && item.part.state === "approval-requested") respondToApproval(id);
|
|
333
258
|
else if (thinkStub) thinkStub.approveExecution(id).finally(() => {
|
|
334
|
-
|
|
259
|
+
notifyExecutionSettled();
|
|
335
260
|
});
|
|
336
261
|
}
|
|
337
262
|
}, [
|
|
263
|
+
pendingApprovalItems,
|
|
338
264
|
permissionMode,
|
|
339
265
|
permissionModeControl,
|
|
340
|
-
|
|
341
|
-
durableApprovals,
|
|
342
|
-
onApprovalResponse,
|
|
343
|
-
thinkStub,
|
|
344
|
-
onExecutionSettled
|
|
266
|
+
thinkStub
|
|
345
267
|
]);
|
|
346
268
|
const pendingApproval = !permissionModeControl && permissionMode === "bypass" ? void 0 : pendingApprovalItems[0];
|
|
347
269
|
const contextUsage = contextWindow ? getContextUsage(messages) : void 0;
|
|
348
|
-
const
|
|
349
|
-
const transcriptMessages = queuedMessageIds.size ? messages.filter((message) => !queuedMessageIds.has(message.id)) : messages;
|
|
350
|
-
const newestAssistantIndex = transcriptMessages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage$1(message));
|
|
270
|
+
const newestAssistantIndex = messages.findLastIndex((message) => message.role === "assistant" && !isCompactionMessage(message));
|
|
351
271
|
const lastAssistantIndex = onRegenerate && status !== "streaming" && status !== "submitted" ? newestAssistantIndex : -1;
|
|
352
|
-
const lastUserIndex = onEditAndResend && !disabled && status !== "streaming" && status !== "submitted" ?
|
|
272
|
+
const lastUserIndex = onEditAndResend && !disabled && status !== "streaming" && status !== "submitted" ? messages.findLastIndex((message) => message.role === "user") : -1;
|
|
353
273
|
const [editingMessageId, setEditingMessageId] = React.useState();
|
|
354
274
|
const restoreEditFocus = React.useRef(false);
|
|
355
275
|
const editButtonRef = React.useRef(null);
|
|
356
276
|
let assistantResponseCount = 0;
|
|
357
|
-
const assistantResponseNumbers =
|
|
358
|
-
if (message.role !== "assistant" || isCompactionMessage
|
|
277
|
+
const assistantResponseNumbers = messages.map((message) => {
|
|
278
|
+
if (message.role !== "assistant" || isCompactionMessage(message)) return 0;
|
|
359
279
|
assistantResponseCount += 1;
|
|
360
280
|
return assistantResponseCount;
|
|
361
281
|
});
|
|
@@ -364,22 +284,14 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
364
284
|
editButtonRef.current?.focus();
|
|
365
285
|
restoreEditFocus.current = false;
|
|
366
286
|
}, [editingMessageId]);
|
|
367
|
-
|
|
368
|
-
if (!el || typeof ResizeObserver === "undefined") return;
|
|
369
|
-
const root = el.parentElement;
|
|
370
|
-
const observer = new ResizeObserver(() => {
|
|
371
|
-
root?.style.setProperty("--agent-chat-composer-size", `${el.offsetHeight}px`);
|
|
372
|
-
});
|
|
373
|
-
observer.observe(el);
|
|
374
|
-
return () => observer.disconnect();
|
|
375
|
-
};
|
|
376
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
287
|
+
return /* @__PURE__ */ jsxs(TransitionSurface, {
|
|
377
288
|
ref,
|
|
289
|
+
variant: "fade",
|
|
378
290
|
className: cx("agent-chat", className),
|
|
379
291
|
"data-composer-hidden": showComposer ? void 0 : "",
|
|
380
292
|
children: [
|
|
381
293
|
/* @__PURE__ */ jsx("span", {
|
|
382
|
-
className: "message__copy-status",
|
|
294
|
+
className: "message__copy-status sigvelo-visually-hidden",
|
|
383
295
|
role: "status",
|
|
384
296
|
"aria-atomic": "true",
|
|
385
297
|
children: copyAnnouncement
|
|
@@ -392,16 +304,16 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
392
304
|
children: [/* @__PURE__ */ jsx(MessageScrollerViewport, { children: /* @__PURE__ */ jsxs(MessageScrollerContent, {
|
|
393
305
|
"aria-busy": status === "streaming" || status === "submitted",
|
|
394
306
|
className: "agent-chat__transcript-content",
|
|
395
|
-
children: [
|
|
396
|
-
className: "
|
|
307
|
+
children: [messages.length === 0 ? /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
308
|
+
className: "conversation__empty-row",
|
|
397
309
|
children: emptyState ?? /* @__PURE__ */ jsx(ConversationEmptyState, {
|
|
398
310
|
title: "Start a conversation",
|
|
399
311
|
description: "Ask the agent to inspect, plan, or build."
|
|
400
312
|
})
|
|
401
|
-
}) : null,
|
|
313
|
+
}) : null, messages.map((message, messageIndex) => /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
402
314
|
messageId: message.id,
|
|
403
315
|
scrollAnchor: message.role === "user",
|
|
404
|
-
children: isCompactionMessage
|
|
316
|
+
children: isCompactionMessage(message) ? /* @__PURE__ */ jsx(Marker, {
|
|
405
317
|
variant: "separator",
|
|
406
318
|
children: /* @__PURE__ */ jsx(MarkerContent, { children: getMessageText(message) || "Conversation compacted" })
|
|
407
319
|
}) : /* @__PURE__ */ jsx(Message, {
|
|
@@ -419,25 +331,10 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
419
331
|
setEditingMessageId(void 0);
|
|
420
332
|
}
|
|
421
333
|
}, message.id) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
part,
|
|
427
|
-
partIndex,
|
|
428
|
-
defaultRender
|
|
429
|
-
});
|
|
430
|
-
if (isSourceUrlPart(part) || isSourceDocumentPart(part)) {
|
|
431
|
-
if (custom !== void 0) return custom ? /* @__PURE__ */ jsx(MessageContent, { children: custom }, getPartKey(part, partIndex)) : null;
|
|
432
|
-
const previous = message.parts[partIndex - 1];
|
|
433
|
-
if (isSourceUrlPart(previous) || isSourceDocumentPart(previous)) return null;
|
|
434
|
-
return /* @__PURE__ */ jsx(MessageContent, { children: renderSources(getSourceRun(message.parts, partIndex)) }, getPartKey(part, partIndex));
|
|
435
|
-
}
|
|
436
|
-
const rendered = custom === void 0 ? defaultRender() : custom;
|
|
437
|
-
return rendered ? /* @__PURE__ */ jsxs(MessageContent, { children: [rendered, isCompactedPart(message, part, partIndex) ? /* @__PURE__ */ jsx("div", {
|
|
438
|
-
className: "message__compacted",
|
|
439
|
-
children: "Output truncated for storage"
|
|
440
|
-
}) : null] }, getPartKey(part, partIndex)) : null;
|
|
334
|
+
/* @__PURE__ */ jsx(AgentMessageParts, {
|
|
335
|
+
message,
|
|
336
|
+
status: messageIndex === messages.length - 1 ? status : "ready",
|
|
337
|
+
renderPart
|
|
441
338
|
}),
|
|
442
339
|
renderMessageAfter?.({
|
|
443
340
|
message,
|
|
@@ -449,7 +346,6 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
449
346
|
ref: editButtonRef,
|
|
450
347
|
label: "Edit message",
|
|
451
348
|
tooltip: "Edit and resend",
|
|
452
|
-
size: "icon-lg",
|
|
453
349
|
onClick: () => {
|
|
454
350
|
restoreEditFocus.current = false;
|
|
455
351
|
setEditingMessageId(message.id);
|
|
@@ -471,12 +367,12 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
471
367
|
}) }), /* @__PURE__ */ jsx(MessageScrollerButton, {
|
|
472
368
|
"aria-label": "Scroll to latest",
|
|
473
369
|
className: "agent-chat__scroll-button",
|
|
474
|
-
size: "
|
|
370
|
+
size: "sm"
|
|
475
371
|
})]
|
|
476
372
|
})
|
|
477
373
|
}),
|
|
478
374
|
showComposer ? /* @__PURE__ */ jsxs("div", {
|
|
479
|
-
ref:
|
|
375
|
+
ref: observeAgentChatComposer,
|
|
480
376
|
className: "agent-chat__composer",
|
|
481
377
|
children: [
|
|
482
378
|
/* @__PURE__ */ jsx("div", {
|
|
@@ -485,13 +381,13 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
485
381
|
"aria-atomic": "true",
|
|
486
382
|
children: notice
|
|
487
383
|
}),
|
|
488
|
-
|
|
384
|
+
pendingPrompts.length ? /* @__PURE__ */ jsx("section", {
|
|
489
385
|
className: "agent-chat__queued",
|
|
490
386
|
"aria-label": "Queued messages",
|
|
491
387
|
children: /* @__PURE__ */ jsx("ul", {
|
|
492
388
|
className: "agent-chat__queued-list",
|
|
493
|
-
children:
|
|
494
|
-
const messageText =
|
|
389
|
+
children: pendingPrompts.map((pending) => {
|
|
390
|
+
const messageText = pending.message.text || "Queued message";
|
|
495
391
|
return /* @__PURE__ */ jsxs("li", {
|
|
496
392
|
className: "agent-chat__queued-message",
|
|
497
393
|
children: [
|
|
@@ -501,25 +397,25 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
501
397
|
children: /* @__PURE__ */ jsx(QueueIcon, {})
|
|
502
398
|
}),
|
|
503
399
|
/* @__PURE__ */ jsx("span", {
|
|
504
|
-
className: "agent-chat__queued-text",
|
|
400
|
+
className: "agent-chat__queued-text sigvelo-truncate",
|
|
505
401
|
children: messageText
|
|
506
402
|
}),
|
|
507
|
-
|
|
403
|
+
/* @__PURE__ */ jsxs("button", {
|
|
508
404
|
type: "button",
|
|
509
405
|
className: "agent-chat__queued-action",
|
|
510
|
-
"aria-label": `
|
|
511
|
-
onClick: () =>
|
|
512
|
-
children: [/* @__PURE__ */ jsx(
|
|
513
|
-
})
|
|
514
|
-
|
|
406
|
+
"aria-label": `Move queued message to front: ${messageText}`,
|
|
407
|
+
onClick: () => setPendingPrompts((current) => [pending, ...current.filter((item) => item !== pending)]),
|
|
408
|
+
children: [/* @__PURE__ */ jsx(MoveToFrontIcon, {}), "Move to front"]
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ jsx("button", {
|
|
515
411
|
type: "button",
|
|
516
412
|
className: "agent-chat__queued-action agent-chat__queued-remove",
|
|
517
413
|
"aria-label": `Remove queued message: ${messageText}`,
|
|
518
|
-
onClick: () =>
|
|
414
|
+
onClick: () => setPendingPrompts((current) => current.filter((item) => item !== pending)),
|
|
519
415
|
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
520
|
-
})
|
|
416
|
+
})
|
|
521
417
|
]
|
|
522
|
-
},
|
|
418
|
+
}, pending.id);
|
|
523
419
|
})
|
|
524
420
|
})
|
|
525
421
|
}) : null,
|
|
@@ -589,7 +485,6 @@ function AgentChat({ className, messages, queuedMessages = [], onSteerQueuedMess
|
|
|
589
485
|
/* @__PURE__ */ jsx(AgentChatSubmitAction, {
|
|
590
486
|
status,
|
|
591
487
|
onStop,
|
|
592
|
-
allowSubmitWhileBusy: Boolean(allowSubmitWhileBusy),
|
|
593
488
|
disabled,
|
|
594
489
|
hasDraft: Boolean(composerDraft.trim() || composerReferences.length)
|
|
595
490
|
})
|
|
@@ -66,7 +66,7 @@ function AgentChatMessageEditor({ message, originalText, onCancel, onSubmit, onS
|
|
|
66
66
|
onCancel();
|
|
67
67
|
}
|
|
68
68
|
}),
|
|
69
|
-
error ? /* @__PURE__ */ jsx(Field.
|
|
69
|
+
error ? /* @__PURE__ */ jsx(Field.Errors, { errors: [error] }) : null
|
|
70
70
|
]
|
|
71
71
|
}), /* @__PURE__ */ jsxs("div", {
|
|
72
72
|
className: "message__edit-actions",
|
|
@@ -74,14 +74,14 @@ function AgentChatMessageEditor({ message, originalText, onCancel, onSubmit, onS
|
|
|
74
74
|
type: "button",
|
|
75
75
|
variant: "outline",
|
|
76
76
|
color: "neutral",
|
|
77
|
-
size: "
|
|
77
|
+
size: "sm",
|
|
78
78
|
disabled: isSubmitting,
|
|
79
79
|
onClick: onCancel,
|
|
80
80
|
children: "Cancel"
|
|
81
81
|
}), /* @__PURE__ */ jsx(Button, {
|
|
82
82
|
type: "submit",
|
|
83
83
|
color: "primary",
|
|
84
|
-
size: "
|
|
84
|
+
size: "sm",
|
|
85
85
|
disabled: !canSubmit,
|
|
86
86
|
children: isSubmitting ? "Resending…" : "Send"
|
|
87
87
|
})]
|
|
@@ -23,13 +23,13 @@ function AgentChatTurnError({ error, onDismiss, onRetry }) {
|
|
|
23
23
|
type: "button",
|
|
24
24
|
variant: "ghost",
|
|
25
25
|
color: "neutral",
|
|
26
|
-
size: "
|
|
26
|
+
size: "sm",
|
|
27
27
|
onClick: onDismiss,
|
|
28
28
|
children: "Dismiss"
|
|
29
29
|
}), onRetry ? /* @__PURE__ */ jsx(Button, {
|
|
30
30
|
type: "button",
|
|
31
31
|
color: "primary",
|
|
32
|
-
size: "
|
|
32
|
+
size: "sm",
|
|
33
33
|
onClick: onRetry,
|
|
34
34
|
children: "Try again"
|
|
35
35
|
}) : null]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as cx } from "../class-names-
|
|
2
|
-
import {
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { D as LinkIcon } from "../icons-CQJ-aMnI.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Popover } from "./Popover.js";
|
|
5
5
|
import { Field } from "./Field.js";
|
|
6
6
|
import { Form } from "./Form.js";
|
|
7
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-
|
|
7
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-Bfp5PAg3.js";
|
|
8
8
|
import { CUSTOM_MCP_SERVER_CARD } from "../utils/mcp-server-catalog.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -131,7 +131,7 @@ function AgentConnectionPanel({ className, commands: commandsProp, defaultTarget
|
|
|
131
131
|
/* @__PURE__ */ jsxs("fieldset", {
|
|
132
132
|
className: "agent-connect__targets",
|
|
133
133
|
children: [/* @__PURE__ */ jsx("legend", {
|
|
134
|
-
className: "agent-connect__legend",
|
|
134
|
+
className: "agent-connect__legend sigvelo-visually-hidden",
|
|
135
135
|
children: "Agent connection target"
|
|
136
136
|
}), commands.map((command) => /* @__PURE__ */ jsx(Button, {
|
|
137
137
|
variant: "ghost",
|