@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
|
@@ -3,60 +3,34 @@ import { Select } from "@base-ui/react/select";
|
|
|
3
3
|
|
|
4
4
|
//#region src/components/Select.d.ts
|
|
5
5
|
type SelectProps<Value = unknown> = Select.Root.Props<Value>;
|
|
6
|
-
interface SelectLabelProps extends
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
interface SelectTriggerProps extends Omit<Select.Trigger.Props, "className"> {
|
|
10
|
-
className?: string;
|
|
6
|
+
interface SelectLabelProps extends Select.Label.Props {}
|
|
7
|
+
interface SelectTriggerProps extends Select.Trigger.Props {
|
|
11
8
|
/**
|
|
12
9
|
* The size of the select trigger.
|
|
13
|
-
* @default '
|
|
10
|
+
* @default 'sm'
|
|
14
11
|
*/
|
|
15
|
-
size?: "sm" | "md"
|
|
12
|
+
size?: "sm" | "md";
|
|
16
13
|
}
|
|
17
14
|
interface SelectValueProps extends Omit<Select.Value.Props, "children"> {
|
|
18
15
|
placeholder?: string;
|
|
19
16
|
children?: Select.Value.Props["children"];
|
|
20
17
|
}
|
|
21
|
-
interface SelectIconProps extends
|
|
22
|
-
className?: string;
|
|
23
|
-
}
|
|
18
|
+
interface SelectIconProps extends Select.Icon.Props {}
|
|
24
19
|
interface SelectPortalProps extends Select.Portal.Props {}
|
|
25
|
-
interface SelectBackdropProps extends
|
|
26
|
-
className?: string;
|
|
27
|
-
}
|
|
20
|
+
interface SelectBackdropProps extends Select.Backdrop.Props {}
|
|
28
21
|
interface SelectPositionerProps extends Select.Positioner.Props {}
|
|
29
|
-
interface SelectPopupProps extends
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
interface
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
interface SelectItemProps extends Omit<Select.Item.Props, "className"> {
|
|
36
|
-
className?: string;
|
|
37
|
-
}
|
|
38
|
-
interface SelectItemTextProps extends Omit<Select.ItemText.Props, "className"> {
|
|
39
|
-
className?: string;
|
|
40
|
-
}
|
|
41
|
-
interface SelectItemIndicatorProps extends Omit<Select.ItemIndicator.Props, "className"> {
|
|
42
|
-
className?: string;
|
|
43
|
-
}
|
|
44
|
-
interface SelectGroupProps extends Omit<Select.Group.Props, "className"> {
|
|
45
|
-
className?: string;
|
|
22
|
+
interface SelectPopupProps extends Select.Popup.Props {}
|
|
23
|
+
interface SelectListProps extends Select.List.Props {}
|
|
24
|
+
interface SelectItemProps extends Select.Item.Props {}
|
|
25
|
+
interface SelectItemTextProps extends Select.ItemText.Props {}
|
|
26
|
+
interface SelectItemIndicatorProps extends Select.ItemIndicator.Props {}
|
|
27
|
+
interface SelectGroupProps extends Select.Group.Props {
|
|
46
28
|
label?: string;
|
|
47
29
|
}
|
|
48
|
-
interface SelectGroupLabelProps extends
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
interface
|
|
52
|
-
className?: string;
|
|
53
|
-
}
|
|
54
|
-
interface SelectScrollUpArrowProps extends Omit<Select.ScrollUpArrow.Props, "className"> {
|
|
55
|
-
className?: string;
|
|
56
|
-
}
|
|
57
|
-
interface SelectScrollDownArrowProps extends Omit<Select.ScrollDownArrow.Props, "className"> {
|
|
58
|
-
className?: string;
|
|
59
|
-
}
|
|
30
|
+
interface SelectGroupLabelProps extends Select.GroupLabel.Props {}
|
|
31
|
+
interface SelectSeparatorProps extends Select.Separator.Props {}
|
|
32
|
+
interface SelectScrollUpArrowProps extends Select.ScrollUpArrow.Props {}
|
|
33
|
+
interface SelectScrollDownArrowProps extends Select.ScrollDownArrow.Props {}
|
|
60
34
|
/**
|
|
61
35
|
* A select component for choosing from a list of options.
|
|
62
36
|
*
|
|
@@ -122,8 +96,6 @@ declare function SelectPositioner({
|
|
|
122
96
|
ref,
|
|
123
97
|
...props
|
|
124
98
|
}: SelectPositionerProps & {
|
|
125
|
-
className?: string;
|
|
126
|
-
} & {
|
|
127
99
|
ref?: React.Ref<HTMLDivElement>;
|
|
128
100
|
}): React.JSX.Element;
|
|
129
101
|
declare function SelectPopup({
|
|
@@ -2,32 +2,19 @@ import * as React from "react";
|
|
|
2
2
|
import { Tabs } from "@base-ui/react/tabs";
|
|
3
3
|
|
|
4
4
|
//#region src/components/Tabs.d.ts
|
|
5
|
-
interface TabsProps extends
|
|
6
|
-
className?: string;
|
|
5
|
+
interface TabsProps extends Tabs.Root.Props {
|
|
7
6
|
/**
|
|
8
7
|
* The visual style variant.
|
|
9
8
|
* @default 'default'
|
|
10
9
|
*/
|
|
11
10
|
variant?: "default" | "bordered";
|
|
12
11
|
}
|
|
13
|
-
interface TabsListProps extends
|
|
14
|
-
className?: string;
|
|
12
|
+
interface TabsListProps extends Tabs.List.Props {
|
|
15
13
|
variant?: "default" | "line" | null;
|
|
16
14
|
}
|
|
17
|
-
interface TabProps extends
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
interface TabPanelProps extends Omit<Tabs.Panel.Props, "className"> {
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
interface TabsListVariantsOptions {
|
|
24
|
-
variant?: "default" | "line" | null;
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
|
-
declare function tabsListVariants({
|
|
28
|
-
variant,
|
|
29
|
-
className
|
|
30
|
-
}?: TabsListVariantsOptions): string;
|
|
15
|
+
interface TabProps extends Tabs.Tab.Props {}
|
|
16
|
+
interface TabPanelProps extends Tabs.Panel.Props {}
|
|
17
|
+
interface TabsIndicatorProps extends Tabs.Indicator.Props {}
|
|
31
18
|
/**
|
|
32
19
|
* A tabs component for organizing content into separate views.
|
|
33
20
|
*
|
|
@@ -69,6 +56,13 @@ declare function Tab({
|
|
|
69
56
|
}: TabProps & {
|
|
70
57
|
ref?: React.Ref<HTMLButtonElement>;
|
|
71
58
|
}): React.JSX.Element;
|
|
59
|
+
declare function TabsIndicator({
|
|
60
|
+
className,
|
|
61
|
+
ref,
|
|
62
|
+
...props
|
|
63
|
+
}: TabsIndicatorProps & {
|
|
64
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
65
|
+
}): React.JSX.Element;
|
|
72
66
|
declare function TabPanel({
|
|
73
67
|
className,
|
|
74
68
|
ref,
|
|
@@ -80,8 +74,8 @@ declare const Tabs$1: {
|
|
|
80
74
|
Root: typeof TabsRoot;
|
|
81
75
|
List: typeof TabsList;
|
|
82
76
|
Tab: typeof Tab;
|
|
83
|
-
Indicator:
|
|
77
|
+
Indicator: typeof TabsIndicator;
|
|
84
78
|
Panel: typeof TabPanel;
|
|
85
79
|
};
|
|
86
80
|
//#endregion
|
|
87
|
-
export {
|
|
81
|
+
export { TabsListProps as a, TabsIndicatorProps as i, TabProps as n, TabsProps as o, Tabs$1 as r, TabPanelProps as t };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { AgentChat } from "./components/AgentChat.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./components/AgentToolRunsContext.js";
|
|
3
|
+
import { SubagentRunList } from "./components/SubagentRunList.js";
|
|
3
4
|
import { ThinkChatContext, useThinkChatContext } from "./components/ThinkChatContext.js";
|
|
4
5
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/ThinkChatActivity.js";
|
|
6
|
+
import { ThinkRecoveryNotice } from "./components/ThinkRecoveryNotice.js";
|
|
5
7
|
import * as React from "react";
|
|
6
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
9
|
import { useAgentChat } from "@cloudflare/think/react";
|
|
8
|
-
import { useAgent } from "agents/react";
|
|
10
|
+
import { useAgent, useAgentToolEvents } from "agents/react";
|
|
11
|
+
import { queryOptions, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
12
|
//#region src/components/_internal/think-approvals.ts
|
|
10
13
|
/**
|
|
11
14
|
* Ambient approvals belong to their stub. An explicit different stub may only
|
|
@@ -21,79 +24,105 @@ function resolveThinkApprovalProps(overrides, ambient) {
|
|
|
21
24
|
}
|
|
22
25
|
//#endregion
|
|
23
26
|
//#region src/components/ThinkChat.tsx
|
|
27
|
+
const EMPTY_PENDING_APPROVALS = [];
|
|
24
28
|
function toAgentChatStatus(chat) {
|
|
25
29
|
if (chat.status === "submitted") return "submitted";
|
|
26
30
|
if (chat.isStreaming || chat.isRecovering) return "streaming";
|
|
27
31
|
return chat.status ?? "ready";
|
|
28
32
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
React.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
refresh();
|
|
59
|
-
return () => {
|
|
60
|
-
requestIdRef.current += 1;
|
|
33
|
+
function thinkPendingExecutionApprovalsQueryKey(sourceKey) {
|
|
34
|
+
return [
|
|
35
|
+
"think",
|
|
36
|
+
sourceKey,
|
|
37
|
+
"pending-approvals"
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/** Shared pending-approval options for components and TanStack Router loaders. */
|
|
41
|
+
function thinkPendingExecutionApprovalsQueryOptions(stub, sourceKey) {
|
|
42
|
+
return queryOptions({
|
|
43
|
+
queryKey: thinkPendingExecutionApprovalsQueryKey(sourceKey),
|
|
44
|
+
queryFn: () => stub.pendingApprovals(),
|
|
45
|
+
staleTime: 5e3
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function useThinkPendingExecutionApprovals(stub, sourceKey, refreshSignal) {
|
|
49
|
+
const queryClient = useQueryClient();
|
|
50
|
+
const approvalsQuery = useQuery(thinkPendingExecutionApprovalsQueryOptions(stub, sourceKey));
|
|
51
|
+
const refreshState = React.useRef({
|
|
52
|
+
sourceKey,
|
|
53
|
+
observedSignal: refreshSignal,
|
|
54
|
+
pending: false
|
|
55
|
+
});
|
|
56
|
+
const refetch = React.useEffectEvent(() => approvalsQuery.refetch());
|
|
57
|
+
const refreshPendingApprovals = React.useCallback(async () => {
|
|
58
|
+
const filters = {
|
|
59
|
+
queryKey: thinkPendingExecutionApprovalsQueryKey(sourceKey),
|
|
60
|
+
exact: true
|
|
61
61
|
};
|
|
62
|
+
await queryClient.cancelQueries(filters);
|
|
63
|
+
await queryClient.invalidateQueries(filters);
|
|
64
|
+
}, [queryClient, sourceKey]);
|
|
65
|
+
React.useEffect(() => {
|
|
66
|
+
if (refreshState.current.sourceKey !== sourceKey) {
|
|
67
|
+
refreshState.current = {
|
|
68
|
+
sourceKey,
|
|
69
|
+
observedSignal: refreshSignal,
|
|
70
|
+
pending: false
|
|
71
|
+
};
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!Object.is(refreshState.current.observedSignal, refreshSignal)) {
|
|
75
|
+
refreshState.current.observedSignal = refreshSignal;
|
|
76
|
+
refreshState.current.pending = true;
|
|
77
|
+
}
|
|
78
|
+
if (approvalsQuery.isFetching || !refreshState.current.pending) return;
|
|
79
|
+
refreshState.current.pending = false;
|
|
80
|
+
refetch();
|
|
62
81
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
approvalsQuery.isFetching,
|
|
83
|
+
refreshSignal,
|
|
84
|
+
sourceKey
|
|
66
85
|
]);
|
|
67
|
-
const pendingApprovals = state.source === stub ? state.pendingApprovals : [];
|
|
68
86
|
return React.useMemo(() => ({
|
|
69
|
-
pendingApprovals,
|
|
70
|
-
refreshPendingApprovals
|
|
71
|
-
}), [
|
|
87
|
+
pendingApprovals: approvalsQuery.data ?? EMPTY_PENDING_APPROVALS,
|
|
88
|
+
refreshPendingApprovals
|
|
89
|
+
}), [approvalsQuery.data, refreshPendingApprovals]);
|
|
72
90
|
}
|
|
73
91
|
/**
|
|
74
92
|
* Chat UI for Cloudflare Think agents. Provide a `useAgentChat` value (or let
|
|
75
93
|
* `ThinkChat.Root` create one) and `ThinkChat.Messages` renders the message
|
|
76
94
|
* stream with agent work folded into collapsed Activity blocks.
|
|
77
95
|
*/
|
|
78
|
-
function ThinkChatProvider({ chat, children }) {
|
|
79
|
-
|
|
96
|
+
function ThinkChatProvider({ agentTools, chat, children }) {
|
|
97
|
+
const chatProvider = /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
|
|
80
98
|
value: chat,
|
|
81
99
|
children
|
|
82
100
|
});
|
|
101
|
+
return agentTools ? /* @__PURE__ */ jsx(AgentToolRunsProvider, {
|
|
102
|
+
agentTools,
|
|
103
|
+
children: chatProvider
|
|
104
|
+
}) : chatProvider;
|
|
83
105
|
}
|
|
84
106
|
/**
|
|
85
107
|
* Batteries-included root: connects to the named Think agent (upstream's
|
|
86
108
|
* `useAgent` + `useAgentChat`) and provides the live chat to everything
|
|
87
|
-
* inside.
|
|
109
|
+
* inside. Render it beneath the app's `QueryClientProvider`. If the app
|
|
110
|
+
* already owns the chat hook, use `ThinkChat.Provider`.
|
|
88
111
|
*
|
|
89
112
|
* @example
|
|
90
113
|
* ```tsx
|
|
91
|
-
* <
|
|
92
|
-
* <ThinkChat.
|
|
93
|
-
*
|
|
114
|
+
* <QueryClientProvider client={queryClient}>
|
|
115
|
+
* <ThinkChat.Root
|
|
116
|
+
* agent="my-agent"
|
|
117
|
+
* name="session-1"
|
|
118
|
+
* sourceKey="api.example.com:account:acme:agent:session-1"
|
|
119
|
+
* >
|
|
120
|
+
* <ThinkChat.Messages />
|
|
121
|
+
* </ThinkChat.Root>
|
|
122
|
+
* </QueryClientProvider>
|
|
94
123
|
* ```
|
|
95
124
|
*/
|
|
96
|
-
function ThinkChatRoot({ agent: agentOption, name, children }) {
|
|
125
|
+
function ThinkChatRoot({ agent: agentOption, name, sourceKey, children }) {
|
|
97
126
|
const agent = useAgent(typeof agentOption === "string" ? {
|
|
98
127
|
agent: agentOption,
|
|
99
128
|
name
|
|
@@ -102,15 +131,25 @@ function ThinkChatRoot({ agent: agentOption, name, children }) {
|
|
|
102
131
|
name: name ?? agentOption.name
|
|
103
132
|
});
|
|
104
133
|
const chat = useAgentChat({ agent });
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
134
|
+
const agentTools = useAgentToolEvents({ agent });
|
|
135
|
+
const agentIdentity = JSON.stringify(agent.path);
|
|
136
|
+
const approvals = useThinkPendingExecutionApprovals(agent.stub, sourceKey, `${chat.messages.length}:${chat.status}`);
|
|
137
|
+
const resetAgentTools = React.useEffectEvent(() => agentTools.resetLocalState());
|
|
138
|
+
React.useEffect(() => {
|
|
139
|
+
resetAgentTools();
|
|
140
|
+
}, [agentIdentity]);
|
|
141
|
+
const approvalsContext = React.useMemo(() => ({
|
|
142
|
+
...approvals,
|
|
143
|
+
thinkStub: agent.stub
|
|
144
|
+
}), [agent.stub, approvals]);
|
|
145
|
+
return /* @__PURE__ */ jsx(AgentToolRunsProvider, {
|
|
146
|
+
agentTools,
|
|
147
|
+
children: /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
|
|
148
|
+
value: chat,
|
|
149
|
+
children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
|
|
150
|
+
value: approvalsContext,
|
|
151
|
+
children
|
|
152
|
+
})
|
|
114
153
|
})
|
|
115
154
|
});
|
|
116
155
|
}
|
|
@@ -125,8 +164,9 @@ const ThinkChatApprovalsContext = React.createContext(null);
|
|
|
125
164
|
* inside the log) or `excludeTools` + your own `renderPart` (standalone
|
|
126
165
|
* card) — see README "App-specific tools" and the Custom Tool Panel story.
|
|
127
166
|
*/
|
|
128
|
-
function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
|
|
167
|
+
function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAgentToolRunLink, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
|
|
129
168
|
const chat = useThinkChatContext("ThinkChat.Messages");
|
|
169
|
+
const agentTools = useOptionalAgentToolRuns();
|
|
130
170
|
const approvals = React.useContext(ThinkChatApprovalsContext);
|
|
131
171
|
const status = toAgentChatStatus(chat);
|
|
132
172
|
const resolvedApprovals = resolveThinkApprovalProps({
|
|
@@ -140,8 +180,13 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
140
180
|
});
|
|
141
181
|
const defaultRenderPart = React.useMemo(() => createThinkChatActivityRenderer({
|
|
142
182
|
excludeTools,
|
|
183
|
+
renderAgentToolRunLink,
|
|
184
|
+
toolRenderers
|
|
185
|
+
}), [
|
|
186
|
+
excludeTools,
|
|
187
|
+
renderAgentToolRunLink,
|
|
143
188
|
toolRenderers
|
|
144
|
-
|
|
189
|
+
]);
|
|
145
190
|
const resolvedRenderPart = React.useMemo(() => renderPart ? (context) => {
|
|
146
191
|
const renderBuiltIn = () => {
|
|
147
192
|
const builtIn = defaultRenderPart(context);
|
|
@@ -153,18 +198,20 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
153
198
|
});
|
|
154
199
|
return custom === void 0 ? renderBuiltIn() : custom;
|
|
155
200
|
} : defaultRenderPart, [defaultRenderPart, renderPart]);
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
const defaultNotice = /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat });
|
|
202
|
+
const backgroundRuns = renderAgentToolRunLink ? agentTools?.unboundRuns : void 0;
|
|
203
|
+
const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length && renderAgentToolRunLink ? /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
className: "subagent-run__tray",
|
|
205
|
+
"data-slot": "background-agent-runs",
|
|
206
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
207
|
+
className: "subagent-run__tray-label",
|
|
208
|
+
children: "Background agents"
|
|
209
|
+
}), /* @__PURE__ */ jsx(SubagentRunList, {
|
|
210
|
+
"aria-label": "Background agent runs",
|
|
211
|
+
runs: backgroundRuns,
|
|
212
|
+
renderRunLink: renderAgentToolRunLink
|
|
213
|
+
})]
|
|
214
|
+
}) : null] }) : void 0;
|
|
168
215
|
return /* @__PURE__ */ jsx(AgentChat, {
|
|
169
216
|
...props,
|
|
170
217
|
renderPart: resolvedRenderPart,
|
|
@@ -176,10 +223,12 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
176
223
|
onExecutionSettled: resolvedApprovals.onExecutionSettled,
|
|
177
224
|
pendingApprovals: resolvedApprovals.pendingApprovals,
|
|
178
225
|
notice: notice ?? defaultNotice,
|
|
226
|
+
composerHeader: resolvedComposerHeader,
|
|
179
227
|
onRegenerate: (messageId) => void chat.regenerate({ messageId }),
|
|
180
228
|
onSubmit: ({ text, files, references }) => {
|
|
181
229
|
const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
182
|
-
if (prompt
|
|
230
|
+
if (!prompt && !files.length) return;
|
|
231
|
+
return chat.sendMessage({
|
|
183
232
|
text: prompt,
|
|
184
233
|
files
|
|
185
234
|
});
|
|
@@ -205,8 +254,9 @@ const ThinkChat = {
|
|
|
205
254
|
Root: ThinkChatRoot,
|
|
206
255
|
Messages: ThinkChatMessages,
|
|
207
256
|
Activity: ThinkChatActivity,
|
|
257
|
+
RecoveryNotice: ThinkRecoveryNotice,
|
|
208
258
|
renderActivityPart: renderThinkChatActivityPart,
|
|
209
259
|
createActivityRenderer: createThinkChatActivityRenderer
|
|
210
260
|
};
|
|
211
261
|
//#endregion
|
|
212
|
-
export {
|
|
262
|
+
export { thinkPendingExecutionApprovalsQueryOptions as a, resolveThinkApprovalProps as c, ThinkChatRoot as i, ThinkChatMessages as n, useThinkChat as o, ThinkChatProvider as r, useThinkPendingExecutionApprovals as s, ThinkChat as t };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
|
|
2
|
+
import { r as AgentChatProps } from "./AgentChat-ClxViuUM.js";
|
|
2
3
|
import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { DynamicToolUIPart, ToolUIPart, UIMessage } from "ai";
|
|
6
|
+
import { AgentToolRunState } from "agents/agent-tools";
|
|
5
7
|
|
|
6
8
|
//#region src/components/ThinkChatActivity.d.ts
|
|
7
9
|
/**
|
|
@@ -16,7 +18,7 @@ interface ThinkChatToolRenderer {
|
|
|
16
18
|
panel?: (part: ToolUIPart | DynamicToolUIPart) => React.ReactNode;
|
|
17
19
|
}
|
|
18
20
|
type ThinkChatToolRenderers = Record<string, ThinkChatToolRenderer>;
|
|
19
|
-
interface ThinkChatActivityRendererOptions {
|
|
21
|
+
interface ThinkChatActivityRendererOptions<MessageT extends UIMessage = UIMessage> {
|
|
20
22
|
/**
|
|
21
23
|
* Tool names to keep out of activity folding entirely — the run splits
|
|
22
24
|
* around them and they fall through to your own renderPart / AgentChat's
|
|
@@ -26,6 +28,8 @@ interface ThinkChatActivityRendererOptions {
|
|
|
26
28
|
excludeTools?: readonly string[];
|
|
27
29
|
/** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
|
|
28
30
|
toolRenderers?: ThinkChatToolRenderers;
|
|
31
|
+
/** App-authored TanStack Router Link for each retained child destination. */
|
|
32
|
+
renderAgentToolRunLink?: (run: AgentToolRunState<MessageT["parts"][number]>) => React.ReactElement;
|
|
29
33
|
}
|
|
30
34
|
interface ThinkChatActivityProps {
|
|
31
35
|
/** Render with the log expanded. */
|
|
@@ -58,9 +62,10 @@ declare function ThinkChatActivity({
|
|
|
58
62
|
*/
|
|
59
63
|
declare function createThinkChatActivityRenderer<MessageT extends UIMessage = UIMessage>({
|
|
60
64
|
excludeTools,
|
|
65
|
+
renderAgentToolRunLink,
|
|
61
66
|
toolRenderers
|
|
62
|
-
}?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
|
|
67
|
+
}?: ThinkChatActivityRendererOptions<MessageT>): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
|
|
63
68
|
/** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
|
|
64
|
-
declare const renderThinkChatActivityPart: (context:
|
|
69
|
+
declare const renderThinkChatActivityPart: (context: AgentMessageRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
|
|
65
70
|
//#endregion
|
|
66
71
|
export { ThinkChatToolRenderers as a, ThinkChatToolRenderer as i, ThinkChatActivityProps as n, createThinkChatActivityRenderer as o, ThinkChatActivityRendererOptions as r, renderThinkChatActivityPart as s, ThinkChatActivity as t };
|
package/dist/{ThinkChatActivitySummary-BPmu9a-c.d.ts → ThinkChatActivitySummary-D1xOrNrq.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as AgentActivityIconKind, s as AgentActivitySummary } from "./AgentActivity-
|
|
1
|
+
import { i as AgentActivityIconKind, s as AgentActivitySummary } from "./AgentActivity-D2SHSGFX.js";
|
|
2
2
|
import { l as ThinkChatPart } from "./ThinkChatToolParts-CSzVwMXf.js";
|
|
3
3
|
import { DynamicToolUIPart, ToolUIPart } from "ai";
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useAgentChat } from "@cloudflare/think/react";
|
|
3
2
|
import { UIMessage } from "ai";
|
|
3
|
+
import { useAgentChat } from "@cloudflare/think/react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ThinkChatContext.d.ts
|
|
6
6
|
/** The complete upstream Think chat hook value, preserving app state and message extensions. */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { n as ThinkChatValue } from "./ThinkChatContext-DrsZqdaO.js";
|
|
2
|
+
import { UIMessage } from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/components/ThinkRecoveryNotice.d.ts
|
|
5
|
+
interface ThinkRecoveryNoticeProps<State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
6
|
+
/** The complete `useAgentChat` value from `@cloudflare/think/react`. */
|
|
7
|
+
chat: ThinkChatValue<State, MessageT>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Native Think recovery, connection, and turn-error content for AgentChat's
|
|
11
|
+
* persistent polite notice region. Think exposes no recovery phase, progress,
|
|
12
|
+
* checkpoint, attempt count, or timeline to the browser, so this adapter does
|
|
13
|
+
* not claim those details.
|
|
14
|
+
*/
|
|
15
|
+
declare function ThinkRecoveryNotice<State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
16
|
+
chat
|
|
17
|
+
}: ThinkRecoveryNoticeProps<State, MessageT>): import("react").JSX.Element | null;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ThinkRecoveryNoticeProps as n, ThinkRecoveryNotice as t };
|
|
@@ -4,13 +4,13 @@ import { Toggle } from "@base-ui/react/toggle";
|
|
|
4
4
|
//#region src/components/Toggle.d.ts
|
|
5
5
|
interface ToggleVariantsOptions {
|
|
6
6
|
variant?: "default" | "outline" | null;
|
|
7
|
-
size?: "
|
|
7
|
+
size?: "sm" | "md" | "lg" | null;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Props for the Toggle component.
|
|
12
12
|
*/
|
|
13
|
-
interface ToggleProps extends
|
|
13
|
+
interface ToggleProps extends React.ComponentPropsWithoutRef<typeof Toggle>, Omit<ToggleVariantsOptions, "className"> {}
|
|
14
14
|
declare function toggleVariants({
|
|
15
15
|
variant,
|
|
16
16
|
size,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { r as ToggleVariantsOptions } from "./Toggle-
|
|
1
|
+
import { r as ToggleVariantsOptions } from "./Toggle-JKZ43D5S.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { ToggleGroup } from "@base-ui/react/toggle-group";
|
|
4
4
|
import { Toggle } from "@base-ui/react/toggle";
|
|
5
5
|
|
|
6
6
|
//#region src/components/ToggleGroup.d.ts
|
|
7
|
-
type ToggleGroupSize = ToggleVariantsOptions["size"]
|
|
8
|
-
interface ToggleGroupProps extends
|
|
9
|
-
className?: string;
|
|
7
|
+
type ToggleGroupSize = ToggleVariantsOptions["size"];
|
|
8
|
+
interface ToggleGroupProps extends React.ComponentPropsWithRef<typeof ToggleGroup> {
|
|
10
9
|
variant?: ToggleVariantsOptions["variant"];
|
|
11
10
|
/**
|
|
12
11
|
* The size of the toggle group.
|
|
@@ -15,7 +14,7 @@ interface ToggleGroupProps extends Omit<React.ComponentPropsWithRef<typeof Toggl
|
|
|
15
14
|
size?: ToggleGroupSize;
|
|
16
15
|
spacing?: number;
|
|
17
16
|
}
|
|
18
|
-
interface ToggleGroupItemProps extends
|
|
17
|
+
interface ToggleGroupItemProps extends React.ComponentPropsWithRef<typeof Toggle>, Omit<ToggleVariantsOptions, "className"> {}
|
|
19
18
|
/**
|
|
20
19
|
* A toggle group component for selecting one or multiple options.
|
|
21
20
|
*
|