@mcp-b/react-components 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentChat-CrlpbvQJ.d.ts → AgentChat-CRuMi1Pb.d.ts} +4 -10
- package/dist/AgentMessageParts-CyD2UB3V.d.ts +46 -0
- package/dist/AgentToolRunsContext-BVe4stgw.d.ts +21 -0
- package/dist/{CodeBlock-BmB4Xaqq.js → CodeBlock-Co1noLbC.js} +2 -2
- package/dist/{CodeBlock-BRajW4QU.d.ts → CodeBlock-Dnpr88ZQ.d.ts} +2 -2
- 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-B7bBsUyU.js} +7 -7
- package/dist/{Menu-Bgu-ufb5.d.ts → Menu-L6MZm-7N.d.ts} +15 -56
- package/dist/{Message-BkMdE3bS.js → Message-C4eYRogZ.js} +3 -3
- package/dist/{ModelSelector-SlJNgwKY.js → ModelSelector-BNrZlY_Y.js} +5 -5
- package/dist/{PromptInput-BWTuXMOD.d.ts → PromptInput-OLfXPuHM.d.ts} +39 -67
- package/dist/{ResponsiveSidebarShell-Dd9DCcBT.d.ts → ResponsiveSidebarShell-CsAh4NyL.d.ts} +1 -0
- package/dist/{Select-BeEsefzh.d.ts → Select-CwSqP07Y.d.ts} +14 -42
- package/dist/{Tabs-3Zc4tb9D.d.ts → Tabs-9zddXDQo.d.ts} +5 -19
- package/dist/{ThinkChat-CzC-zNGA.js → ThinkChat-DInElus-.js} +53 -26
- package/dist/{ThinkChatActivity-BFQnb2ct.d.ts → ThinkChatActivity-BgesTfZ4.d.ts} +12 -4
- 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-DaXpe1Lc.d.ts} +1 -1
- package/dist/{ToggleGroup-8hPv-b69.d.ts → ToggleGroup-yseEWkOC.d.ts} +3 -4
- package/dist/{Workspace-D39LxGvP.d.ts → Workspace-C9RFoxcu.d.ts} +1 -1
- package/dist/WorkspaceExplorer-sZewzT2O.d.ts +32 -0
- package/dist/{WorkspaceFile-DOZkPwzu.d.ts → WorkspaceFile-C8UzuSH4.d.ts} +1 -1
- package/dist/{WorkspaceFileView-rSN_yT0L.js → WorkspaceFileView-DNdGAEiX.js} +5 -5
- package/dist/{WorkspaceLink-DIPbXrUM.js → WorkspaceLink-B1ykV1dS.js} +15 -29
- package/dist/class-names-Bk-QLWWI.js +11 -0
- package/dist/components/Accordion.d.ts +5 -15
- package/dist/components/Accordion.js +11 -10
- package/dist/components/Activity.d.ts +5 -10
- package/dist/components/Activity.js +2 -2
- package/dist/components/AgentActivity.js +1 -1
- package/dist/components/AgentActivityPreview.js +2 -2
- package/dist/components/AgentAttention.d.ts +1 -1
- package/dist/components/AgentAttention.js +1 -1
- package/dist/components/AgentChat.d.ts +2 -2
- package/dist/components/AgentChat.js +27 -164
- package/dist/components/AgentChatMessageEditor.js +1 -1
- 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 +55 -0
- package/dist/components/AgentToolDetail.js +98 -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 +4 -1
- package/dist/components/AppTopBar.js +5 -5
- package/dist/components/Approval.d.ts +102 -0
- package/dist/components/Approval.js +227 -0
- package/dist/components/Artifact.d.ts +2 -4
- package/dist/components/Artifact.js +3 -3
- package/dist/components/Autocomplete.d.ts +11 -33
- package/dist/components/Autocomplete.js +23 -30
- package/dist/components/Avatar.d.ts +3 -11
- package/dist/components/Avatar.js +13 -12
- package/dist/components/BrowserLiveView.js +2 -2
- package/dist/components/BrowserReplay.js +2 -2
- package/dist/components/BrowserRunPanel.js +58 -78
- package/dist/components/Button.js +4 -9
- package/dist/components/ChainOfThought.d.ts +5 -11
- package/dist/components/ChainOfThought.js +3 -2
- package/dist/components/ChatGptSignInScreen.js +3 -3
- 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 +2 -4
- package/dist/components/Conversation.js +2 -2
- 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 +16 -16
- package/dist/components/Fieldset.d.ts +2 -7
- package/dist/components/Fieldset.js +7 -6
- 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/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/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 +3 -6
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +3 -3
- package/dist/components/Meter.d.ts +5 -20
- package/dist/components/Meter.js +11 -10
- package/dist/components/ModelSelector.d.ts +2 -6
- 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/PricingPlanCard.js +3 -3
- package/dist/components/PricingUsageCalculator.js +2 -2
- 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 +52 -200
- package/dist/components/Queue.d.ts +6 -16
- package/dist/components/Queue.js +2 -2
- 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 -3
- package/dist/components/ResizableSidePanel.js +2 -2
- package/dist/components/ResponsiveSidebarShell.d.ts +1 -1
- package/dist/components/ResponsiveSidebarShell.js +4 -3
- package/dist/components/ScrollArea.d.ts +5 -20
- package/dist/components/ScrollArea.js +11 -10
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Select.js +32 -55
- 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 +2 -2
- package/dist/components/SubagentRunDetails.js +1 -1
- package/dist/components/SubagentRunIndicator.js +2 -2
- package/dist/components/SubagentRunList.js +1 -2
- package/dist/components/SubagentRunSelector.d.ts +2 -11
- package/dist/components/SubagentRunSelector.js +16 -15
- package/dist/components/Switch.d.ts +2 -5
- package/dist/components/Switch.js +5 -8
- package/dist/components/Tabs.d.ts +2 -2
- package/dist/components/Tabs.js +10 -16
- package/dist/components/Task.d.ts +4 -9
- package/dist/components/Task.js +4 -3
- package/dist/components/Terminal.d.ts +2 -3
- package/dist/components/Terminal.js +3 -3
- package/dist/components/TestResults.d.ts +4 -9
- package/dist/components/TestResults.js +3 -2
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +21 -11
- package/dist/components/ThinkChat.js +5 -3
- package/dist/components/ThinkChatActivity.d.ts +1 -1
- package/dist/components/ThinkChatActivity.js +26 -7
- package/dist/components/ThinkChatContext.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +2 -2
- package/dist/components/ThinkExecutionDetail.js +2 -2
- package/dist/components/ThinkExecutionStatus.js +2 -2
- package/dist/components/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/ThinkFullApp.d.ts +33 -9
- package/dist/components/ThinkFullApp.js +98 -69
- 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 +40 -0
- package/dist/components/ThinkRoutine.js +1 -0
- package/dist/components/ThinkRoutineBrowser.js +6 -6
- package/dist/components/ThinkRoutineDetail.js +1 -1
- package/dist/components/ThinkRoutineForm.js +2 -2
- package/dist/components/ThinkRoutineLibrary.d.ts +9 -0
- package/dist/components/ThinkRoutineLibrary.js +67 -20
- package/dist/components/ThinkRoutineRuns.js +1 -1
- package/dist/components/ThinkThreadPicker.js +2 -2
- 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 +5 -5
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +8 -15
- 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 +3 -9
- package/dist/components/Tooltip.js +7 -10
- package/dist/components/WebPreview.d.ts +1 -2
- package/dist/components/WebPreview.js +4 -3
- package/dist/components/Workspace.d.ts +1 -1
- package/dist/components/Workspace.js +5 -20
- package/dist/components/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/WorkspaceBrowser.js +3 -3
- package/dist/components/WorkspaceExplorer.d.ts +3 -31
- package/dist/components/WorkspaceExplorer.js +3 -3
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +1 -1
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.js +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-CQx3LQAC.d.ts} +1 -2
- package/dist/{copy-button-Dejn5heL.js → copy-button-cYsJBauI.js} +1 -1
- package/dist/{icons-CpfUer49.js → icons--FqCZEc3.js} +3 -2
- package/dist/{icons-GQd1xF4e.d.ts → icons-DpUqY8Mp.d.ts} +6 -1
- package/dist/styles/agent-activity-preview.css +4 -0
- package/dist/styles/agent-chat.css +0 -41
- package/dist/styles/agent-connection.css +0 -12
- package/dist/styles/agent-tool-detail.css +54 -0
- package/dist/styles/approval.css +172 -0
- package/dist/styles/artifact.css +0 -12
- package/dist/styles/browser-run-panel.css +5 -2
- package/dist/styles/chain-of-thought.css +0 -8
- package/dist/styles/checkpoint.css +58 -0
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/commit.css +0 -21
- package/dist/styles/context-menu.css +0 -8
- package/dist/styles/environment-variables.css +0 -13
- package/dist/styles/file-tree.css +0 -16
- package/dist/styles/index.css +8 -4
- package/dist/styles/inline-citation.css +107 -0
- package/dist/styles/mcp-server-picker.css +0 -30
- package/dist/styles/menu.css +0 -29
- package/dist/styles/menubar.css +0 -8
- package/dist/styles/message-scroller.css +0 -12
- package/dist/styles/message.css +0 -12
- package/dist/styles/model-selector.css +0 -20
- package/dist/styles/plan.css +127 -0
- package/dist/styles/popover.css +0 -36
- package/dist/styles/prompt-input.css +2 -195
- package/dist/styles/recipes.css +114 -5
- package/dist/styles/responsive-sidebar-shell.css +16 -19
- package/dist/styles/sources.css +0 -8
- package/dist/styles/subagent-run.css +12 -70
- package/dist/styles/task.css +0 -16
- package/dist/styles/test-results.css +0 -13
- package/dist/styles/think-full-app.css +12 -38
- package/dist/styles/think-routine-library.css +12 -20
- package/dist/styles/think-thread-picker.css +15 -0
- package/dist/styles/toast.css +0 -7
- package/dist/styles/utilities.css +31 -0
- package/dist/styles/web-preview.css +0 -21
- package/dist/styles/workspace-explorer.css +5 -55
- package/dist/think-agent-Cip5KAPj.d.ts +7 -0
- package/dist/utils/codex-model-catalog.d.ts +4 -4
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/workspace-path-L_KmjRjq.js +26 -0
- package/package.json +3 -4
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as ButtonProps } from "./Button-FX_hpqxm.js";
|
|
2
|
-
import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, g as SelectScrollUpArrowProps, h as SelectScrollDownArrowProps, i as SelectGroupProps, l as SelectLabelProps, m as SelectProps, n as SelectBackdropProps, o as SelectItemIndicatorProps, p as SelectPositionerProps, r as SelectGroupLabelProps, s as SelectItemProps, t as Select, u as SelectListProps, v as SelectTriggerProps, y as SelectValueProps } from "./Select-
|
|
3
|
-
import { i as TabsListProps, n as TabProps, r as Tabs, t as TabPanelProps } from "./Tabs-
|
|
4
|
-
import { t as Combobox } from "./Combobox-
|
|
5
|
-
import { d as MenuProps, s as MenuItemProps, t as Menu } from "./Menu-
|
|
2
|
+
import { _ as SelectSeparatorProps, a as SelectIconProps, c as SelectItemTextProps, d as SelectPopupProps, g as SelectScrollUpArrowProps, h as SelectScrollDownArrowProps, i as SelectGroupProps, l as SelectLabelProps, m as SelectProps, n as SelectBackdropProps, o as SelectItemIndicatorProps, p as SelectPositionerProps, r as SelectGroupLabelProps, s as SelectItemProps, t as Select, u as SelectListProps, v as SelectTriggerProps, y as SelectValueProps } from "./Select-CwSqP07Y.js";
|
|
3
|
+
import { i as TabsListProps, n as TabProps, r as Tabs, t as TabPanelProps } from "./Tabs-9zddXDQo.js";
|
|
4
|
+
import { t as Combobox } from "./Combobox-CYc37s5l.js";
|
|
5
|
+
import { d as MenuProps, s as MenuItemProps, t as Menu } from "./Menu-L6MZm-7N.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { ChatAddToolApproveResponseFunction, ChatStatus, DynamicToolUIPart, FileUIPart, ToolUIPart, UIMessage } from "ai";
|
|
8
8
|
import { PendingApproval, Think } from "@cloudflare/think";
|
|
@@ -216,8 +216,7 @@ type PromptInputButtonTooltip = string | {
|
|
|
216
216
|
side?: TooltipSide;
|
|
217
217
|
};
|
|
218
218
|
type PromptInputTooltipConfig = Exclude<PromptInputButtonTooltip, string>;
|
|
219
|
-
interface PromptInputButtonProps extends Omit<ButtonProps, "children"
|
|
220
|
-
className?: string;
|
|
219
|
+
interface PromptInputButtonProps extends Omit<ButtonProps, "children"> {
|
|
221
220
|
tooltip?: PromptInputButtonTooltip;
|
|
222
221
|
children?: React.ReactNode;
|
|
223
222
|
}
|
|
@@ -331,8 +330,7 @@ declare function PromptInputPermissionSelector({
|
|
|
331
330
|
onValueChange,
|
|
332
331
|
question
|
|
333
332
|
}: PromptInputPermissionSelectorProps): React.JSX.Element;
|
|
334
|
-
interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "
|
|
335
|
-
className?: string;
|
|
333
|
+
interface PromptInputSubmitProps extends Omit<ButtonProps, "children" | "type"> {
|
|
336
334
|
status?: ChatStatus;
|
|
337
335
|
onStop?: () => void;
|
|
338
336
|
children?: React.ReactNode;
|
|
@@ -359,22 +357,30 @@ declare function PromptInputSubmit({
|
|
|
359
357
|
}: PromptInputSubmitProps & {
|
|
360
358
|
ref?: React.Ref<HTMLButtonElement>;
|
|
361
359
|
}): React.JSX.Element;
|
|
360
|
+
/**
|
|
361
|
+
* Resolve Think execution approvals that do not use the AI SDK
|
|
362
|
+
* `approval-requested` part: paused codemode executions and durable-pause
|
|
363
|
+
* approvals from `pendingApprovals()`. Pass the whole upstream Think agent
|
|
364
|
+
* stub; the component calls its client-callable RPCs directly:
|
|
365
|
+
*
|
|
366
|
+
* ```tsx
|
|
367
|
+
* <PromptInputApproval part={part} thinkStub={agent.stub} />
|
|
368
|
+
* ```
|
|
369
|
+
*
|
|
370
|
+
* On approve, upstream resumes or runs the parked execution and auto-continues
|
|
371
|
+
* the chat. Both RPCs are idempotent, so a stale click resolves to "already
|
|
372
|
+
* handled".
|
|
373
|
+
*/
|
|
362
374
|
/** The id a response must carry: the approval id, or the paused run's executionId. */
|
|
363
375
|
declare function getApprovalRequestId(part: ToolUIPart | DynamicToolUIPart): string | undefined;
|
|
364
376
|
/** Component-local identity: paused executions can ask for multiple approvals. */
|
|
365
377
|
declare function getApprovalStateKey(part: ToolUIPart | DynamicToolUIPart): string | undefined;
|
|
366
|
-
interface PendingToolApproval<MessageT extends UIMessage = UIMessage> {
|
|
367
|
-
message: MessageT;
|
|
368
|
-
messageIndex: number;
|
|
369
|
-
part: ToolUIPart | DynamicToolUIPart;
|
|
370
|
-
partIndex: number;
|
|
371
|
-
}
|
|
372
378
|
/** Derives pending tool approvals straight from the messages — no app-owned shapes. */
|
|
373
|
-
declare function getPendingToolApprovals
|
|
379
|
+
declare function getPendingToolApprovals(messages: readonly UIMessage[], {
|
|
374
380
|
pausedExecutions
|
|
375
381
|
}?: {
|
|
376
382
|
pausedExecutions?: boolean;
|
|
377
|
-
}): Array<
|
|
383
|
+
}): Array<ToolUIPart | DynamicToolUIPart>;
|
|
378
384
|
interface PromptInputApprovalProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "part"> {
|
|
379
385
|
/**
|
|
380
386
|
* The `approval-requested` tool part — or a paused codemode execution —
|
|
@@ -464,8 +470,6 @@ declare const PromptInputSelect: {
|
|
|
464
470
|
ref,
|
|
465
471
|
...props
|
|
466
472
|
}: SelectPositionerProps & {
|
|
467
|
-
className?: string;
|
|
468
|
-
} & {
|
|
469
473
|
ref?: React.Ref<HTMLDivElement>;
|
|
470
474
|
}) => React.JSX.Element;
|
|
471
475
|
Popup: ({
|
|
@@ -620,27 +624,21 @@ declare const PromptInputCommand: {
|
|
|
620
624
|
className,
|
|
621
625
|
ref,
|
|
622
626
|
...props
|
|
623
|
-
}:
|
|
624
|
-
className?: string;
|
|
625
|
-
} & {
|
|
627
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput> & {
|
|
626
628
|
ref?: React.Ref<HTMLInputElement>;
|
|
627
629
|
}) => React.JSX.Element;
|
|
628
630
|
Trigger: ({
|
|
629
631
|
className,
|
|
630
632
|
ref,
|
|
631
633
|
...props
|
|
632
|
-
}:
|
|
633
|
-
className?: string;
|
|
634
|
-
} & {
|
|
634
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxTrigger> & {
|
|
635
635
|
ref?: React.Ref<HTMLButtonElement>;
|
|
636
636
|
}) => React.JSX.Element;
|
|
637
637
|
Clear: ({
|
|
638
638
|
className,
|
|
639
639
|
ref,
|
|
640
640
|
...props
|
|
641
|
-
}:
|
|
642
|
-
className?: string;
|
|
643
|
-
} & {
|
|
641
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxClear> & {
|
|
644
642
|
ref?: React.Ref<HTMLButtonElement>;
|
|
645
643
|
}) => React.JSX.Element;
|
|
646
644
|
Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AutocompletePortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -648,9 +646,7 @@ declare const PromptInputCommand: {
|
|
|
648
646
|
className,
|
|
649
647
|
ref,
|
|
650
648
|
...props
|
|
651
|
-
}:
|
|
652
|
-
className?: string;
|
|
653
|
-
} & {
|
|
649
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPositioner> & {
|
|
654
650
|
ref?: React.Ref<HTMLDivElement>;
|
|
655
651
|
}) => React.JSX.Element;
|
|
656
652
|
Popup: ({
|
|
@@ -658,63 +654,49 @@ declare const PromptInputCommand: {
|
|
|
658
654
|
tabIndex,
|
|
659
655
|
ref,
|
|
660
656
|
...props
|
|
661
|
-
}:
|
|
662
|
-
className?: string;
|
|
663
|
-
} & {
|
|
657
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxPopup> & {
|
|
664
658
|
ref?: React.Ref<HTMLDivElement>;
|
|
665
659
|
}) => React.JSX.Element;
|
|
666
660
|
List: ({
|
|
667
661
|
className,
|
|
668
662
|
ref,
|
|
669
663
|
...props
|
|
670
|
-
}:
|
|
671
|
-
className?: string;
|
|
672
|
-
} & {
|
|
664
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxList> & {
|
|
673
665
|
ref?: React.Ref<HTMLDivElement>;
|
|
674
666
|
}) => React.JSX.Element;
|
|
675
667
|
Item: ({
|
|
676
668
|
className,
|
|
677
669
|
ref,
|
|
678
670
|
...props
|
|
679
|
-
}:
|
|
680
|
-
className?: string;
|
|
681
|
-
} & {
|
|
671
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem> & {
|
|
682
672
|
ref?: React.Ref<HTMLDivElement>;
|
|
683
673
|
}) => React.JSX.Element;
|
|
684
674
|
ItemIndicator: ({
|
|
685
675
|
className,
|
|
686
676
|
ref,
|
|
687
677
|
...props
|
|
688
|
-
}:
|
|
689
|
-
className?: string;
|
|
690
|
-
} & {
|
|
678
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItemIndicator> & {
|
|
691
679
|
ref?: React.Ref<HTMLSpanElement>;
|
|
692
680
|
}) => React.JSX.Element;
|
|
693
681
|
Empty: ({
|
|
694
682
|
className,
|
|
695
683
|
ref,
|
|
696
684
|
...props
|
|
697
|
-
}:
|
|
698
|
-
className?: string;
|
|
699
|
-
} & {
|
|
685
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty> & {
|
|
700
686
|
ref?: React.Ref<HTMLDivElement>;
|
|
701
687
|
}) => React.JSX.Element;
|
|
702
688
|
Group: ({
|
|
703
689
|
className,
|
|
704
690
|
ref,
|
|
705
691
|
...props
|
|
706
|
-
}:
|
|
707
|
-
className?: string;
|
|
708
|
-
} & {
|
|
692
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup> & {
|
|
709
693
|
ref?: React.Ref<HTMLDivElement>;
|
|
710
694
|
}) => React.JSX.Element;
|
|
711
695
|
GroupLabel: ({
|
|
712
696
|
className,
|
|
713
697
|
ref,
|
|
714
698
|
...props
|
|
715
|
-
}:
|
|
716
|
-
className?: string;
|
|
717
|
-
} & {
|
|
699
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel> & {
|
|
718
700
|
ref?: React.Ref<HTMLDivElement>;
|
|
719
701
|
}) => React.JSX.Element;
|
|
720
702
|
Value: typeof import("@base-ui/react").ComboboxValue;
|
|
@@ -728,9 +710,7 @@ declare const PromptInputCommandInput: ({
|
|
|
728
710
|
className,
|
|
729
711
|
ref,
|
|
730
712
|
...props
|
|
731
|
-
}:
|
|
732
|
-
className?: string;
|
|
733
|
-
} & {
|
|
713
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxInput> & {
|
|
734
714
|
ref?: React.Ref<HTMLInputElement>;
|
|
735
715
|
}) => React.JSX.Element;
|
|
736
716
|
type PromptInputCommandListProps = React.ComponentPropsWithoutRef<typeof Combobox.List>;
|
|
@@ -746,9 +726,7 @@ declare const PromptInputCommandEmpty: ({
|
|
|
746
726
|
className,
|
|
747
727
|
ref,
|
|
748
728
|
...props
|
|
749
|
-
}:
|
|
750
|
-
className?: string;
|
|
751
|
-
} & {
|
|
729
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxEmpty> & {
|
|
752
730
|
ref?: React.Ref<HTMLDivElement>;
|
|
753
731
|
}) => React.JSX.Element;
|
|
754
732
|
type PromptInputCommandGroupProps = React.ComponentPropsWithoutRef<typeof Combobox.Group>;
|
|
@@ -756,9 +734,7 @@ declare const PromptInputCommandGroup: ({
|
|
|
756
734
|
className,
|
|
757
735
|
ref,
|
|
758
736
|
...props
|
|
759
|
-
}:
|
|
760
|
-
className?: string;
|
|
761
|
-
} & {
|
|
737
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroup> & {
|
|
762
738
|
ref?: React.Ref<HTMLDivElement>;
|
|
763
739
|
}) => React.JSX.Element;
|
|
764
740
|
type PromptInputCommandGroupLabelProps = React.ComponentPropsWithoutRef<typeof Combobox.GroupLabel>;
|
|
@@ -766,9 +742,7 @@ declare const PromptInputCommandGroupLabel: ({
|
|
|
766
742
|
className,
|
|
767
743
|
ref,
|
|
768
744
|
...props
|
|
769
|
-
}:
|
|
770
|
-
className?: string;
|
|
771
|
-
} & {
|
|
745
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxGroupLabel> & {
|
|
772
746
|
ref?: React.Ref<HTMLDivElement>;
|
|
773
747
|
}) => React.JSX.Element;
|
|
774
748
|
type PromptInputCommandItemProps = React.ComponentPropsWithoutRef<typeof Combobox.Item>;
|
|
@@ -776,9 +750,7 @@ declare const PromptInputCommandItem: ({
|
|
|
776
750
|
className,
|
|
777
751
|
ref,
|
|
778
752
|
...props
|
|
779
|
-
}:
|
|
780
|
-
className?: string;
|
|
781
|
-
} & {
|
|
753
|
+
}: React.ComponentPropsWithRef<typeof import("@base-ui/react").ComboboxItem> & {
|
|
782
754
|
ref?: React.Ref<HTMLDivElement>;
|
|
783
755
|
}) => React.JSX.Element;
|
|
784
756
|
type PromptInputCommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Combobox.Separator>;
|
|
@@ -878,4 +850,4 @@ declare function PromptInputContextSelector({
|
|
|
878
850
|
action
|
|
879
851
|
}: PromptInputContextSelectorProps): React.JSX.Element;
|
|
880
852
|
//#endregion
|
|
881
|
-
export {
|
|
853
|
+
export { PromptInputDictationProps as $, PromptInputCommandDefinition as A, PromptInputTabProps as At, PromptInputCommandItemProps as B, getApprovalRequestId as Bt, PromptInputBodyProps as C, PromptInputTab as Ct, PromptInputCommand as D, PromptInputTabItemProps as Dt, PromptInputButtonTooltip as E, PromptInputTabItem as Et, PromptInputCommandGroupLabelProps as F, PromptInputTools as Ft, PromptInputCommandSeparatorProps as G, useProviderAttachments as Gt, PromptInputCommandListProps as H, getPendingToolApprovals as Ht, PromptInputCommandGroupProps as I, PromptInputToolsProps as It, PromptInputContextItem as J, PromptInputCommandTrigger as K, PromptInputCommandInput as L, PromptInputTooltipConfig as Lt, PromptInputCommandEmptyProps as M, PromptInputTabsListProps as Mt, PromptInputCommandGroup as N, PromptInputTextarea as Nt, PromptInputCommandComposer as O, PromptInputTabLabel as Ot, PromptInputCommandGroupLabel as P, PromptInputTextareaProps as Pt, PromptInputDictation as Q, PromptInputCommandInputProps as R, TextInputContext as Rt, PromptInputBody as S, PromptInputSubmitProps as St, PromptInputButtonProps as T, PromptInputTabBodyProps as Tt, PromptInputCommandProps as U, usePromptInputAttachments as Ut, PromptInputCommandList as V, getApprovalStateKey as Vt, PromptInputCommandSeparator as W, usePromptInputController as Wt, PromptInputContextSelectorProps as X, PromptInputContextSelector as Y, PromptInputControllerProps as Z, PromptInputApprovalProps as _, PromptInputReferences as _t, PromptInputActionAddAttachmentsProps as a, PromptInputHoverCardContent as at, PromptInputAttachments as b, PromptInputSelectProps as bt, PromptInputActionMenu as c, PromptInputHoverCardTrigger as ct, PromptInputActionMenuItem as d, PromptInputPermissionSelector as dt, PromptInputFooter as et, PromptInputActionMenuItemProps as f, PromptInputPermissionSelectorProps as ft, PromptInputApproval as g, PromptInputReference as gt, PromptInputActionMenuTriggerProps as h, PromptInputProviderProps as ht, PromptInputActionAddAttachments as i, PromptInputHoverCard as it, PromptInputCommandEmpty as j, PromptInputTabsList as jt, PromptInputCommandComposerProps as k, PromptInputTabLabelProps as kt, PromptInputActionMenuContent as l, PromptInputHoverCardTriggerProps as lt, PromptInputActionMenuTrigger as m, PromptInputProvider as mt, PermissionMode as n, PromptInputHeader as nt, PromptInputActionAddScreenshot as o, PromptInputHoverCardContentProps as ot, PromptInputActionMenuProps as p, PromptInputProps as pt, PromptInputContextAction as q, PromptInput as r, PromptInputHeaderProps as rt, PromptInputActionAddScreenshotProps as s, PromptInputHoverCardProps as st, AttachmentsContext as t, PromptInputFooterProps as tt, PromptInputActionMenuContentProps as u, PromptInputMessage as ut, PromptInputAttachment as v, PromptInputReferencesProps as vt, PromptInputButton as w, PromptInputTabBody as wt, PromptInputAttachmentsProps as x, PromptInputSubmit as xt, PromptInputAttachmentProps as y, PromptInputSelect as yt, PromptInputCommandItem as z, TooltipSide as zt };
|
|
@@ -44,6 +44,7 @@ interface ResponsiveSidebarShellProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
44
44
|
/**
|
|
45
45
|
* Responsive master-detail shell with a resizable desktop sidebar and a compact
|
|
46
46
|
* floating sidebar that leaves the main content in place as a dismiss target.
|
|
47
|
+
* The root exposes `data-sidebar-open="true" | "false"` as its public styling hook.
|
|
47
48
|
*/
|
|
48
49
|
declare function ResponsiveSidebarShell({
|
|
49
50
|
sidebar,
|
|
@@ -3,11 +3,8 @@ 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
10
|
* @default 'default'
|
|
@@ -18,45 +15,22 @@ 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,18 @@ 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 {}
|
|
31
17
|
/**
|
|
32
18
|
* A tabs component for organizing content into separate views.
|
|
33
19
|
*
|
|
@@ -84,4 +70,4 @@ declare const Tabs$1: {
|
|
|
84
70
|
Panel: typeof TabPanel;
|
|
85
71
|
};
|
|
86
72
|
//#endregion
|
|
87
|
-
export {
|
|
73
|
+
export { TabsProps as a, TabsListProps as i, TabProps as n, Tabs$1 as r, TabPanelProps as t };
|
|
@@ -1,11 +1,13 @@
|
|
|
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";
|
|
9
11
|
//#region src/components/_internal/think-approvals.ts
|
|
10
12
|
/**
|
|
11
13
|
* Ambient approvals belong to their stub. An explicit different stub may only
|
|
@@ -75,11 +77,15 @@ function useThinkPendingApprovals(stub, refreshKey) {
|
|
|
75
77
|
* `ThinkChat.Root` create one) and `ThinkChat.Messages` renders the message
|
|
76
78
|
* stream with agent work folded into collapsed Activity blocks.
|
|
77
79
|
*/
|
|
78
|
-
function ThinkChatProvider({ chat, children }) {
|
|
79
|
-
|
|
80
|
+
function ThinkChatProvider({ agentTools, chat, children }) {
|
|
81
|
+
const chatProvider = /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
|
|
80
82
|
value: chat,
|
|
81
83
|
children
|
|
82
84
|
});
|
|
85
|
+
return agentTools ? /* @__PURE__ */ jsx(AgentToolRunsProvider, {
|
|
86
|
+
agentTools,
|
|
87
|
+
children: chatProvider
|
|
88
|
+
}) : chatProvider;
|
|
83
89
|
}
|
|
84
90
|
/**
|
|
85
91
|
* Batteries-included root: connects to the named Think agent (upstream's
|
|
@@ -102,15 +108,23 @@ function ThinkChatRoot({ agent: agentOption, name, children }) {
|
|
|
102
108
|
name: name ?? agentOption.name
|
|
103
109
|
});
|
|
104
110
|
const chat = useAgentChat({ agent });
|
|
111
|
+
const agentTools = useAgentToolEvents({ agent });
|
|
112
|
+
const agentIdentity = JSON.stringify(agent.path);
|
|
105
113
|
const approvals = useThinkPendingApprovals(agent.stub, `${chat.messages.length}:${chat.status}`);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
children
|
|
114
|
+
React.useEffect(() => {
|
|
115
|
+
agentTools.resetLocalState();
|
|
116
|
+
}, [agentIdentity]);
|
|
117
|
+
return /* @__PURE__ */ jsx(AgentToolRunsProvider, {
|
|
118
|
+
agentTools,
|
|
119
|
+
children: /* @__PURE__ */ jsx(ThinkChatContext.Provider, {
|
|
120
|
+
value: chat,
|
|
121
|
+
children: /* @__PURE__ */ jsx(ThinkChatApprovalsContext.Provider, {
|
|
122
|
+
value: {
|
|
123
|
+
...approvals,
|
|
124
|
+
thinkStub: agent.stub
|
|
125
|
+
},
|
|
126
|
+
children
|
|
127
|
+
})
|
|
114
128
|
})
|
|
115
129
|
});
|
|
116
130
|
}
|
|
@@ -125,8 +139,9 @@ const ThinkChatApprovalsContext = React.createContext(null);
|
|
|
125
139
|
* inside the log) or `excludeTools` + your own `renderPart` (standalone
|
|
126
140
|
* card) — see README "App-specific tools" and the Custom Tool Panel story.
|
|
127
141
|
*/
|
|
128
|
-
function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
|
|
142
|
+
function ThinkChatMessages({ composerHeader, renderPart, excludeTools, onAgentToolRunSelect, selectedAgentToolRunId, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, ...props }) {
|
|
129
143
|
const chat = useThinkChatContext("ThinkChat.Messages");
|
|
144
|
+
const agentTools = useOptionalAgentToolRuns();
|
|
130
145
|
const approvals = React.useContext(ThinkChatApprovalsContext);
|
|
131
146
|
const status = toAgentChatStatus(chat);
|
|
132
147
|
const resolvedApprovals = resolveThinkApprovalProps({
|
|
@@ -140,8 +155,15 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
140
155
|
});
|
|
141
156
|
const defaultRenderPart = React.useMemo(() => createThinkChatActivityRenderer({
|
|
142
157
|
excludeTools,
|
|
158
|
+
onAgentToolRunSelect,
|
|
159
|
+
selectedAgentToolRunId,
|
|
143
160
|
toolRenderers
|
|
144
|
-
}), [
|
|
161
|
+
}), [
|
|
162
|
+
excludeTools,
|
|
163
|
+
onAgentToolRunSelect,
|
|
164
|
+
selectedAgentToolRunId,
|
|
165
|
+
toolRenderers
|
|
166
|
+
]);
|
|
145
167
|
const resolvedRenderPart = React.useMemo(() => renderPart ? (context) => {
|
|
146
168
|
const renderBuiltIn = () => {
|
|
147
169
|
const builtIn = defaultRenderPart(context);
|
|
@@ -153,18 +175,21 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
153
175
|
});
|
|
154
176
|
return custom === void 0 ? renderBuiltIn() : custom;
|
|
155
177
|
} : defaultRenderPart, [defaultRenderPart, renderPart]);
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
const defaultNotice = /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat });
|
|
179
|
+
const backgroundRuns = onAgentToolRunSelect ? agentTools?.unboundRuns : void 0;
|
|
180
|
+
const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length ? /* @__PURE__ */ jsxs("div", {
|
|
181
|
+
className: "subagent-run__tray",
|
|
182
|
+
"data-slot": "background-agent-runs",
|
|
183
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
184
|
+
className: "subagent-run__tray-label",
|
|
185
|
+
children: "Background agents"
|
|
186
|
+
}), /* @__PURE__ */ jsx(SubagentRunList, {
|
|
187
|
+
"aria-label": "Background agent runs",
|
|
188
|
+
runs: backgroundRuns,
|
|
189
|
+
selectedRunId: selectedAgentToolRunId,
|
|
190
|
+
onSelect: onAgentToolRunSelect
|
|
191
|
+
})]
|
|
192
|
+
}) : null] }) : void 0;
|
|
168
193
|
return /* @__PURE__ */ jsx(AgentChat, {
|
|
169
194
|
...props,
|
|
170
195
|
renderPart: resolvedRenderPart,
|
|
@@ -176,6 +201,7 @@ function ThinkChatMessages({ renderPart, excludeTools, toolRenderers, thinkStub,
|
|
|
176
201
|
onExecutionSettled: resolvedApprovals.onExecutionSettled,
|
|
177
202
|
pendingApprovals: resolvedApprovals.pendingApprovals,
|
|
178
203
|
notice: notice ?? defaultNotice,
|
|
204
|
+
composerHeader: resolvedComposerHeader,
|
|
179
205
|
onRegenerate: (messageId) => void chat.regenerate({ messageId }),
|
|
180
206
|
onSubmit: ({ text, files, references }) => {
|
|
181
207
|
const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
@@ -205,6 +231,7 @@ const ThinkChat = {
|
|
|
205
231
|
Root: ThinkChatRoot,
|
|
206
232
|
Messages: ThinkChatMessages,
|
|
207
233
|
Activity: ThinkChatActivity,
|
|
234
|
+
RecoveryNotice: ThinkRecoveryNotice,
|
|
208
235
|
renderActivityPart: renderThinkChatActivityPart,
|
|
209
236
|
createActivityRenderer: createThinkChatActivityRenderer
|
|
210
237
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as AgentMessageRenderPartContext } from "./AgentMessageParts-CyD2UB3V.js";
|
|
2
|
+
import { r as AgentChatProps } from "./AgentChat-CRuMi1Pb.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,10 @@ 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
|
+
/** Selected retained child shown in an adjacent detail surface. */
|
|
32
|
+
selectedAgentToolRunId?: string | null;
|
|
33
|
+
/** Opens a whole upstream retained run in the host-owned detail surface. */
|
|
34
|
+
onAgentToolRunSelect?: (run: AgentToolRunState<MessageT["parts"][number]>) => void;
|
|
29
35
|
}
|
|
30
36
|
interface ThinkChatActivityProps {
|
|
31
37
|
/** Render with the log expanded. */
|
|
@@ -58,9 +64,11 @@ declare function ThinkChatActivity({
|
|
|
58
64
|
*/
|
|
59
65
|
declare function createThinkChatActivityRenderer<MessageT extends UIMessage = UIMessage>({
|
|
60
66
|
excludeTools,
|
|
67
|
+
onAgentToolRunSelect,
|
|
68
|
+
selectedAgentToolRunId,
|
|
61
69
|
toolRenderers
|
|
62
|
-
}?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
|
|
70
|
+
}?: ThinkChatActivityRendererOptions<MessageT>): NonNullable<AgentChatProps<MessageT>["renderPart"]>;
|
|
63
71
|
/** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
|
|
64
|
-
declare const renderThinkChatActivityPart: (context:
|
|
72
|
+
declare const renderThinkChatActivityPart: (context: AgentMessageRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
|
|
65
73
|
//#endregion
|
|
66
74
|
export { ThinkChatToolRenderers as a, ThinkChatToolRenderer as i, ThinkChatActivityProps as n, createThinkChatActivityRenderer as o, ThinkChatActivityRendererOptions as r, renderThinkChatActivityPart as s, ThinkChatActivity as t };
|
|
@@ -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 };
|
|
@@ -10,7 +10,7 @@ interface ToggleVariantsOptions {
|
|
|
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-DaXpe1Lc.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
7
|
type ToggleGroupSize = ToggleVariantsOptions["size"] | "md";
|
|
8
|
-
interface ToggleGroupProps extends
|
|
9
|
-
className?: string;
|
|
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
|
*
|