@mcp-b/react-components 0.7.1 → 0.8.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/{CodeBlock-D9koxDA7.js → CodeBlock-XNQOupQ3.js} +1 -1
- package/dist/{FileTree-BdK93Uuu.js → FileTree-wMyZhhHO.js} +1 -1
- package/dist/{ModelSelector-MQvK-pNb.js → ModelSelector-9G_-GooI.js} +1 -1
- package/dist/{ThinkChatContext-CC94HL4u.d.ts → ThinkChatContext-BLAAb8J5.d.ts} +1 -1
- package/dist/components/Activity.js +1 -1
- package/dist/components/AgentChat.js +12 -7
- package/dist/components/AgentConnection.js +2 -2
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/Commit.js +1 -1
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.js +1 -1
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.js +1 -1
- package/dist/components/FileTree.js +1 -1
- package/dist/components/McpServerPicker.js +7 -5
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/PromptInput.js +6 -5
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +4 -3
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThinkChat.d.ts +6 -8
- package/dist/components/ThinkChatActivity.js +4 -3
- package/dist/components/ThinkChatContext.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +1 -1
- package/dist/components/ThinkChatToolParts.js +4 -4
- package/dist/components/ThinkExecutionWorkbench.d.ts +27 -0
- package/dist/components/ThinkExecutionWorkbench.js +450 -0
- package/dist/components/ThinkFullApp.d.ts +47 -9
- package/dist/components/ThinkFullApp.js +155 -72
- package/dist/components/ThinkThreadPicker.d.ts +88 -0
- package/dist/components/ThinkThreadPicker.js +282 -0
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceExplorer.js +5 -4
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-TVhDAroI.js → copy-button-C6JSKtFE.js} +1 -1
- package/dist/{icons-BRI54ATJ.d.ts → icons-CbjtbIJK.d.ts} +2 -1
- package/dist/{icons-BAlTbWWP.js → icons-D2Q5n5C1.js} +11 -1
- package/dist/styles/index.css +1 -0
- package/dist/styles/think-full-app.css +439 -26
- package/dist/styles/think-thread-picker.css +449 -0
- package/dist/utils/mcp-server-catalog.d.ts +5 -2
- package/package.json +7 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-9UtZwb0J.js";
|
|
2
2
|
import { Select, SelectContent, SelectItem, SelectList, SelectTrigger, SelectValue } from "./components/Select.js";
|
|
3
|
-
import { t as CopyButton } from "./copy-button-
|
|
3
|
+
import { t as CopyButton } from "./copy-button-C6JSKtFE.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { createHighlighter } from "shiki";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-9UtZwb0J.js";
|
|
2
|
-
import { _ as FolderOpenIcon, c as ChevronRightIcon, g as FolderIcon, h as FileIcon } from "./icons-
|
|
2
|
+
import { _ as FolderOpenIcon, c as ChevronRightIcon, g as FolderIcon, h as FileIcon } from "./icons-D2Q5n5C1.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/_internal/use-file-tree-nav.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-9UtZwb0J.js";
|
|
2
|
-
import { A as SearchIcon, o as ChevronDownIcon } from "./icons-
|
|
2
|
+
import { A as SearchIcon, o as ChevronDownIcon } from "./icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./components/Button.js";
|
|
4
4
|
import { Dialog, DialogBackdrop, DialogPopup, DialogPortal, DialogTitle, DialogTrigger } from "./components/Dialog.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { UIMessage } from "ai";
|
|
3
2
|
import { useAgentChat } from "@cloudflare/think/react";
|
|
3
|
+
import { UIMessage } from "ai";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ThinkChatContext.d.ts
|
|
6
6
|
type ThinkChatValue = ReturnType<typeof useAgentChat<unknown, UIMessage>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { c as ChevronRightIcon } from "../icons-
|
|
3
|
+
import { c as ChevronRightIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Activity.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { O as PlusIcon, k as RefreshIcon } from "../icons-
|
|
2
|
+
import { O as PlusIcon, k as RefreshIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Activity, ActivityContent, ActivityPanel, ActivityTrigger } from "./Activity.js";
|
|
4
4
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "./Context.js";
|
|
5
5
|
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
@@ -10,6 +10,7 @@ import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, Pr
|
|
|
10
10
|
import { Reasoning, ReasoningContent, ReasoningTrigger } from "./Reasoning.js";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { getToolInput, getToolOutput, getToolPartState } from "@cloudflare/think/react";
|
|
13
14
|
import { getToolName, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolUIPart } from "ai";
|
|
14
15
|
//#region src/components/AgentChat.tsx
|
|
15
16
|
const EMPTY_PENDING_APPROVALS = [];
|
|
@@ -52,15 +53,17 @@ function summarizeToolInput(input) {
|
|
|
52
53
|
return null;
|
|
53
54
|
}
|
|
54
55
|
function isToolPartWorking(part) {
|
|
55
|
-
|
|
56
|
+
const state = getToolPartState(part);
|
|
57
|
+
return state === "loading" || state === "streaming" || state === "waiting-approval";
|
|
56
58
|
}
|
|
57
59
|
function isToolPartFailed(part) {
|
|
58
|
-
|
|
60
|
+
const state = getToolPartState(part);
|
|
61
|
+
return state === "error" || state === "denied";
|
|
59
62
|
}
|
|
60
63
|
function describeToolPart(part) {
|
|
61
64
|
const name = getToolName(part);
|
|
62
65
|
const verb = isToolPartFailed(part) ? `${name} failed` : isToolPartWorking(part) ? `Running ${name}` : `Ran ${name}`;
|
|
63
|
-
const detail = summarizeToolInput(part
|
|
66
|
+
const detail = summarizeToolInput(getToolInput(part));
|
|
64
67
|
return detail ? `${verb} · ${detail}` : verb;
|
|
65
68
|
}
|
|
66
69
|
function formatToolValue(value) {
|
|
@@ -68,17 +71,19 @@ function formatToolValue(value) {
|
|
|
68
71
|
return typeof value === "string" ? value : JSON.stringify(value, null, 2);
|
|
69
72
|
}
|
|
70
73
|
function renderToolActivity(part) {
|
|
74
|
+
const state = getToolPartState(part);
|
|
71
75
|
const failed = isToolPartFailed(part);
|
|
72
|
-
const
|
|
76
|
+
const deniedReason = part.state === "output-denied" ? part.approval.reason : void 0;
|
|
77
|
+
const output = state === "error" ? part.errorText : state === "denied" ? deniedReason ?? "Denied" : formatToolValue(getToolOutput(part));
|
|
73
78
|
return /* @__PURE__ */ jsxs(Activity, {
|
|
74
79
|
isStreaming: isToolPartWorking(part),
|
|
75
80
|
children: [/* @__PURE__ */ jsx(ActivityTrigger, { label: describeToolPart(part) }), /* @__PURE__ */ jsxs(ActivityContent, { children: [/* @__PURE__ */ jsx(ActivityPanel, {
|
|
76
81
|
label: getToolName(part),
|
|
77
|
-
text: formatToolValue(part
|
|
82
|
+
text: formatToolValue(getToolInput(part))
|
|
78
83
|
}), output ? /* @__PURE__ */ jsx(ActivityPanel, {
|
|
79
84
|
label: "output",
|
|
80
85
|
text: output,
|
|
81
|
-
status:
|
|
86
|
+
status: state === "denied" ? "denied" : failed ? "error" : void 0,
|
|
82
87
|
error: failed
|
|
83
88
|
}) : null] })]
|
|
84
89
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { b as LinkIcon } from "../icons-
|
|
2
|
+
import { b as LinkIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Popover } from "./Popover.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-
|
|
5
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-XNQOupQ3.js";
|
|
6
6
|
import { Field } from "./Field.js";
|
|
7
7
|
import { Form } from "./Form.js";
|
|
8
8
|
import { DCR_MCP_SERVER_CARDS, MANUAL_MCP_SERVER_CARDS, getMcpServerIconSrc } from "../utils/mcp-server-catalog.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { L as XIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { M as SpinnerIcon, x as MaximizeIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Dialog, DialogContent, DialogTitle } from "./Dialog.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { D as PlayIcon, T as PauseIcon } from "../icons-
|
|
2
|
+
import { D as PlayIcon, T as PauseIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Slider, SliderControl, SliderIndicator, SliderThumb, SliderTrack } from "./Slider.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CollapsiblePanelProps, CollapsibleRootProps, CollapsibleTriggerProps } from "./Collapsible.js";
|
|
2
|
-
import { v as IconProps } from "../icons-
|
|
2
|
+
import { v as IconProps } from "../icons-CbjtbIJK.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ChainOfThought.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { M as SpinnerIcon, a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/ChainOfThought.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { M as SpinnerIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
|
-
import { l as ModelSelectorLogo } from "../ModelSelector-
|
|
4
|
+
import { l as ModelSelectorLogo } from "../ModelSelector-9G_-GooI.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/ChatGptSignInScreen.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CodeBlockCopyButton, c as CodeBlockLanguageSelector, d as CodeBlockLanguageSelectorTrigger, f as CodeBlockLanguageSelectorValue, h as CODE_BLOCK_LANGUAGES, i as CodeBlockContent, l as CodeBlockLanguageSelectorContent, m as highlightCode, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock, u as CodeBlockLanguageSelectorItem } from "../CodeBlock-
|
|
1
|
+
import { a as CodeBlockCopyButton, c as CodeBlockLanguageSelector, d as CodeBlockLanguageSelectorTrigger, f as CodeBlockLanguageSelectorValue, h as CODE_BLOCK_LANGUAGES, i as CodeBlockContent, l as CodeBlockLanguageSelectorContent, m as highlightCode, n as CodeBlockActions, o as CodeBlockFilename, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock, u as CodeBlockLanguageSelectorItem } from "../CodeBlock-XNQOupQ3.js";
|
|
2
2
|
export { CODE_BLOCK_LANGUAGES, CodeBlock, CodeBlockActions, CodeBlockContainer, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockHeader, CodeBlockLanguageSelector, CodeBlockLanguageSelectorContent, CodeBlockLanguageSelectorItem, CodeBlockLanguageSelectorTrigger, CodeBlockLanguageSelectorValue, CodeBlockTitle, highlightCode };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, l as CopyIcon } from "../icons-
|
|
3
|
+
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, l as CopyIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
6
6
|
import { Avatar } from "./Avatar.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-
|
|
1
|
+
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { d as DownloadIcon, t as ArrowDownIcon } from "../icons-
|
|
2
|
+
import { d as DownloadIcon, t as ArrowDownIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
5
5
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { a as CheckIcon, l as CopyIcon, m as EyeOffIcon, p as EyeIcon } from "../icons-
|
|
2
|
+
import { a as CheckIcon, l as CopyIcon, m as EyeOffIcon, p as EyeIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FileTreeIcon, i as FileTreeFolder, n as FileTreeActions, o as FileTreeName, r as FileTreeFile, t as FileTree } from "../FileTree-
|
|
1
|
+
import { a as FileTreeIcon, i as FileTreeFolder, n as FileTreeActions, o as FileTreeName, r as FileTreeFile, t as FileTree } from "../FileTree-wMyZhhHO.js";
|
|
2
2
|
export { FileTree, FileTreeActions, FileTreeFile, FileTreeFolder, FileTreeIcon, FileTreeName };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as WarningIcon, M as SpinnerIcon, O as PlusIcon, a as CheckIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
3
|
import { MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRoot, MenuShortcut, MenuTrigger } from "./Menu.js";
|
|
4
4
|
import { getMcpServerIconSrc } from "../utils/mcp-server-catalog.js";
|
|
@@ -53,8 +53,8 @@ function McpServerPickerItems({ servers, onConnect }) {
|
|
|
53
53
|
function McpServerPickerRow({ server, onConnect }) {
|
|
54
54
|
const descriptionId = React.useId();
|
|
55
55
|
const statusText = server.statusLabel ?? getStatusLabel(server.status);
|
|
56
|
-
const busy = server.status === "connecting" || server.status === "authenticating";
|
|
57
|
-
const disabled = busy || server.status === "ready";
|
|
56
|
+
const busy = server.status === "connecting" || server.status === "authenticating" || server.status === "discovering";
|
|
57
|
+
const disabled = busy || server.status === "ready" || server.status === "connected";
|
|
58
58
|
return /* @__PURE__ */ jsxs(MenuItem, {
|
|
59
59
|
className: "mcp-server-picker__row",
|
|
60
60
|
closeOnClick: false,
|
|
@@ -91,9 +91,9 @@ function McpServerPickerRow({ server, onConnect }) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
function StatusIcon({ status }) {
|
|
94
|
-
if (status === "ready") return /* @__PURE__ */ jsx(CheckIcon, { size: 14 });
|
|
94
|
+
if (status === "ready" || status === "connected") return /* @__PURE__ */ jsx(CheckIcon, { size: 14 });
|
|
95
95
|
if (status === "failed" || status === "needs-auth") return /* @__PURE__ */ jsx(WarningIcon, { size: 14 });
|
|
96
|
-
if (status === "connecting" || status === "authenticating") return /* @__PURE__ */ jsx(SpinnerIcon, {
|
|
96
|
+
if (status === "connecting" || status === "authenticating" || status === "discovering") return /* @__PURE__ */ jsx(SpinnerIcon, {
|
|
97
97
|
className: "mcp-server-picker__spinner",
|
|
98
98
|
size: 14
|
|
99
99
|
});
|
|
@@ -101,10 +101,12 @@ function StatusIcon({ status }) {
|
|
|
101
101
|
}
|
|
102
102
|
function getStatusLabel(status) {
|
|
103
103
|
if (status === "ready") return "Connected";
|
|
104
|
+
if (status === "connected") return "Connected";
|
|
104
105
|
if (status === "failed") return "Failed";
|
|
105
106
|
if (status === "needs-auth") return "Authorize";
|
|
106
107
|
if (status === "authenticating") return "Authenticating";
|
|
107
108
|
if (status === "connecting") return "Connecting";
|
|
109
|
+
if (status === "discovering") return "Discovering";
|
|
108
110
|
return "";
|
|
109
111
|
}
|
|
110
112
|
function renderIcon(server) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-
|
|
1
|
+
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Menu } from "@base-ui/react/menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { h as FileIcon, n as ArrowLeftIcon, r as ArrowRightIcon } from "../icons-
|
|
2
|
+
import { h as FileIcon, n as ArrowLeftIcon, r as ArrowRightIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { t as AttachmentPreview } from "../attachment-preview-ChtC3HiU.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { t as ArrowDownIcon } from "../icons-
|
|
2
|
+
import { t as ArrowDownIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ModelSelectorGroup, c as ModelSelectorList, d as ModelSelectorName, f as ModelSelectorSeparator, i as ModelSelectorEmpty, l as ModelSelectorLogo, m as ModelSelectorTrigger, n as ModelSelectorContent, o as ModelSelectorInput, p as ModelSelectorShortcut, r as ModelSelectorDialog, s as ModelSelectorItem, t as ModelSelector, u as ModelSelectorLogoGroup } from "../ModelSelector-
|
|
1
|
+
import { a as ModelSelectorGroup, c as ModelSelectorList, d as ModelSelectorName, f as ModelSelectorSeparator, i as ModelSelectorEmpty, l as ModelSelectorLogo, m as ModelSelectorTrigger, n as ModelSelectorContent, o as ModelSelectorInput, p as ModelSelectorShortcut, r as ModelSelectorDialog, s as ModelSelectorItem, t as ModelSelector, u as ModelSelectorLogoGroup } from "../ModelSelector-9G_-GooI.js";
|
|
2
2
|
export { ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorShortcut, ModelSelectorTrigger };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as ChevronDownIcon } from "../icons-
|
|
1
|
+
import { o as ChevronDownIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { C as MonitorIcon, E as PencilIcon,
|
|
2
|
+
import { C as MonitorIcon, E as PencilIcon, F as WarningIcon, L as XIcon, M as SpinnerIcon, N as SquareIcon, O as PlusIcon, h as FileIcon, i as ArrowUpIcon, o as ChevronDownIcon, w as PaperclipIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { t as AttachmentPreview } from "../attachment-preview-ChtC3HiU.js";
|
|
@@ -9,6 +9,7 @@ import { Select, SelectContent, SelectItem, SelectPortal, SelectPositioner, Sele
|
|
|
9
9
|
import { Tab, TabPanel, TabsList } from "./Tabs.js";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { getToolApproval, getToolInput, getToolOutput } from "@cloudflare/think/react";
|
|
12
13
|
import { getToolName, isToolUIPart } from "ai";
|
|
13
14
|
//#region src/components/PromptInput.tsx
|
|
14
15
|
const PromptInputContext = React.createContext(null);
|
|
@@ -659,17 +660,17 @@ function PromptInputSubmit({ className, status = "ready", onStop, variant = "nor
|
|
|
659
660
|
}
|
|
660
661
|
function getPausedExecution(part) {
|
|
661
662
|
if (part.state !== "output-available") return void 0;
|
|
662
|
-
const output = part
|
|
663
|
+
const output = getToolOutput(part);
|
|
663
664
|
return output?.status === "paused" && typeof output.executionId === "string" ? output : void 0;
|
|
664
665
|
}
|
|
665
666
|
/** The id a response must carry: the approval id, or the paused run's executionId. */
|
|
666
667
|
function getApprovalRequestId(part) {
|
|
667
|
-
if (part.state === "approval-requested") return part
|
|
668
|
+
if (part.state === "approval-requested") return getToolApproval(part)?.id;
|
|
668
669
|
return getPausedExecution(part)?.executionId;
|
|
669
670
|
}
|
|
670
671
|
/** Component-local identity: paused executions can ask for multiple approvals. */
|
|
671
672
|
function getApprovalStateKey(part) {
|
|
672
|
-
if (part.state === "approval-requested") return part
|
|
673
|
+
if (part.state === "approval-requested") return getToolApproval(part)?.id;
|
|
673
674
|
const paused = getPausedExecution(part);
|
|
674
675
|
if (!paused) return void 0;
|
|
675
676
|
const seq = paused.pending[0]?.seq;
|
|
@@ -736,7 +737,7 @@ function PromptInputApproval({ part, approval: durableApproval, onRespond, execu
|
|
|
736
737
|
}
|
|
737
738
|
};
|
|
738
739
|
const submit = () => void respond(selected === "approve");
|
|
739
|
-
const input = durableApproval?.descriptor.input ?? (part
|
|
740
|
+
const input = durableApproval?.descriptor.input ?? (part ? getToolInput(part) : void 0);
|
|
740
741
|
const inputEntries = input && typeof input === "object" && !Array.isArray(input) ? Object.entries(input) : void 0;
|
|
741
742
|
return /* @__PURE__ */ jsxs("div", {
|
|
742
743
|
ref,
|
package/dist/components/Queue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, u as DotIcon } from "../icons-
|
|
3
|
+
import { a as CheckIcon, c as ChevronRightIcon, h as FileIcon, u as DotIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
6
6
|
import { ScrollArea } from "./ScrollArea.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { c as ChevronRightIcon } from "../icons-
|
|
3
|
+
import { c as ChevronRightIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cjk } from "@streamdown/cjk";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CheckIcon, i as ArrowUpIcon, t as ArrowDownIcon } from "../icons-
|
|
1
|
+
import { a as CheckIcon, i as ArrowUpIcon, t as ArrowDownIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { b as LinkIcon, c as ChevronRightIcon } from "../icons-
|
|
3
|
+
import { b as LinkIcon, c as ChevronRightIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Sources.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { M as SpinnerIcon, a as CheckIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/Stepper.tsx
|
package/dist/components/Task.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import { A as SearchIcon, c as ChevronRightIcon, h as FileIcon } from "../icons-
|
|
3
|
+
import { A as SearchIcon, c as ChevronRightIcon, h as FileIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/Task.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { L as XIcon, P as TerminalIcon } from "../icons-D2Q5n5C1.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
|
-
import { t as CopyButton } from "../copy-button-
|
|
5
|
+
import { t as CopyButton } from "../copy-button-C6JSKtFE.js";
|
|
6
6
|
import { Badge } from "./Badge.js";
|
|
7
7
|
import { ScrollArea } from "./ScrollArea.js";
|
|
8
8
|
import * as React from "react";
|
|
@@ -165,7 +165,8 @@ function TerminalContent({ className, ref, ...props }) {
|
|
|
165
165
|
]);
|
|
166
166
|
const handleScroll = (e) => {
|
|
167
167
|
const target = e.currentTarget;
|
|
168
|
-
|
|
168
|
+
const atBottom = target.scrollHeight - target.scrollTop - target.clientHeight < 8;
|
|
169
|
+
setStickToBottom(atBottom);
|
|
169
170
|
};
|
|
170
171
|
return /* @__PURE__ */ jsxs(ScrollArea.Root, {
|
|
171
172
|
ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CollapsiblePanel, CollapsibleRoot, CollapsibleTrigger } from "./Collapsible.js";
|
|
2
2
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
3
|
-
import {
|
|
3
|
+
import { L as XIcon, M as SpinnerIcon, a as CheckIcon, c as ChevronRightIcon } from "../icons-D2Q5n5C1.js";
|
|
4
4
|
import { Badge } from "./Badge.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -4,21 +4,19 @@ import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveV
|
|
|
4
4
|
import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-6G-mnwcn.js";
|
|
5
5
|
import { _ as isThinkChatActivityPart } from "../ThinkChatToolParts-DnUiZgCC.js";
|
|
6
6
|
import { a as ThinkChatToolRenderers, c as renderThinkChatActivityPart, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as describeThinkChatActivityPart, t as ThinkChatActivity } from "../ThinkChatActivity-CeHzk6-K.js";
|
|
7
|
-
import { n as ThinkChatValue } from "../ThinkChatContext-
|
|
7
|
+
import { n as ThinkChatValue } from "../ThinkChatContext-BLAAb8J5.js";
|
|
8
8
|
import { FileInfo, UseWorkspaceOptions, WorkspaceExplorer, WorkspaceExplorerProps, WorkspaceFileState, WorkspaceInfo, WorkspaceSource, WorkspaceState, inferWorkspaceLanguage, useWorkspace } from "./WorkspaceExplorer.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { UIMessage } from "ai";
|
|
11
11
|
import { UseAgentOptions } from "agents/react";
|
|
12
|
-
import { PendingApproval } from "@cloudflare/think";
|
|
12
|
+
import { PendingApproval, Think } from "@cloudflare/think";
|
|
13
|
+
import { AgentStub } from "agents/client";
|
|
13
14
|
|
|
14
15
|
//#region src/components/ThinkChat.d.ts
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
approveExecution(executionId: string): Promise<unknown>;
|
|
18
|
-
rejectExecution(executionId: string, reason?: string): Promise<unknown>;
|
|
19
|
-
}
|
|
16
|
+
type ThinkAgent<State> = Think<object, State>;
|
|
17
|
+
type ThinkApprovalStub<State = unknown> = AgentStub<ThinkAgent<State>>;
|
|
20
18
|
interface ThinkChatProviderProps {
|
|
21
|
-
/** The `useAgentChat` value from
|
|
19
|
+
/** The `useAgentChat` value from `@cloudflare/think/react` that descendants read. */
|
|
22
20
|
chat: ThinkChatValue;
|
|
23
21
|
children: React.ReactNode;
|
|
24
22
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { A as SearchIcon, C as MonitorIcon, E as PencilIcon, F as
|
|
1
|
+
import { A as SearchIcon, C as MonitorIcon, E as PencilIcon, F as WarningIcon, I as WrenchIcon, P as TerminalIcon, b as LinkIcon, h as FileIcon, y as InfoIcon } from "../icons-D2Q5n5C1.js";
|
|
2
2
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "./Activity.js";
|
|
3
3
|
import { ThinkChatContext } from "./ThinkChatContext.js";
|
|
4
4
|
import { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSkillToolPart, isThinkChatActivityPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
|
|
5
5
|
import { ThinkChatBrowserPanel, ThinkChatExecutePanel, ThinkChatFetchPanel, ThinkChatSkillPanel, ThinkChatWorkspacePanel } from "./ThinkChatToolPanels.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { getToolInput, getToolOutput } from "@cloudflare/think/react";
|
|
8
9
|
import { getToolName, isReasoningUIPart, isToolUIPart } from "ai";
|
|
9
10
|
//#region src/components/ThinkChatActivity.tsx
|
|
10
11
|
function summarizeToolInput(input) {
|
|
@@ -114,13 +115,13 @@ function genericToolLabels(name, hasUrl) {
|
|
|
114
115
|
function describeGenericToolPart(part) {
|
|
115
116
|
const labels = genericToolLabels(getToolName(part), activityPartUrl(part) !== null);
|
|
116
117
|
const label = isPartFailed(part) ? labels.failed : isPartWorking(part) ? labels.working : labels.done;
|
|
117
|
-
const detail = summarizeToolInput(part
|
|
118
|
+
const detail = summarizeToolInput(getToolInput(part));
|
|
118
119
|
return detail ? `${label} · ${detail}` : label;
|
|
119
120
|
}
|
|
120
121
|
function activityPartUrl(part) {
|
|
121
122
|
if (isFetchToolPart(part)) return firstHttpUrl(part.input?.url ?? part.input?.path);
|
|
122
123
|
if (isBrowserToolPart(part) && part.type !== "tool-browser_execute") return firstHttpUrl(part.input?.url);
|
|
123
|
-
if (isToolUIPart(part) && !isExecuteToolPart(part)) return firstHttpUrl(part
|
|
124
|
+
if (isToolUIPart(part) && !isExecuteToolPart(part)) return firstHttpUrl(getToolInput(part)) ?? (part.state === "output-available" ? firstHttpUrl(getToolOutput(part)) : null);
|
|
124
125
|
return null;
|
|
125
126
|
}
|
|
126
127
|
function activityPartIconKind(part) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ThinkChatValue, r as useThinkChatContext, t as ThinkChatContext } from "../ThinkChatContext-
|
|
1
|
+
import { n as ThinkChatValue, r as useThinkChatContext, t as ThinkChatContext } from "../ThinkChatContext-BLAAb8J5.js";
|
|
2
2
|
export { ThinkChatContext, ThinkChatValue, useThinkChatContext };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActivityOutput, ActivityPanel } from "./Activity.js";
|
|
2
2
|
import { Tab, TabPanel, Tabs, TabsList } from "./Tabs.js";
|
|
3
|
-
import { t as CodeBlock } from "../CodeBlock-
|
|
3
|
+
import { t as CodeBlock } from "../CodeBlock-XNQOupQ3.js";
|
|
4
4
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
5
5
|
import { displayUrl } from "./ThinkChatToolParts.js";
|
|
6
6
|
import * as React from "react";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getStaticToolName, getToolName, isReasoningUIPart, isStaticToolUIPart, isToolUIPart } from "ai";
|
|
2
1
|
import { getToolPartState } from "@cloudflare/think/react";
|
|
2
|
+
import { getStaticToolName, getToolName, isReasoningUIPart, isStaticToolUIPart, isToolUIPart } from "ai";
|
|
3
3
|
//#region src/components/ThinkChatToolParts.ts
|
|
4
|
-
const WORKSPACE_TOOL_NAMES = new Set([
|
|
4
|
+
const WORKSPACE_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
5
5
|
"read",
|
|
6
6
|
"write",
|
|
7
7
|
"edit",
|
|
@@ -14,7 +14,7 @@ const WORKSPACE_TOOL_NAMES = new Set([
|
|
|
14
14
|
function isWorkspaceToolPart(part) {
|
|
15
15
|
return isStaticToolUIPart(part) && WORKSPACE_TOOL_NAMES.has(getStaticToolName(part));
|
|
16
16
|
}
|
|
17
|
-
const SKILL_TOOL_NAMES = new Set([
|
|
17
|
+
const SKILL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
18
18
|
"activate_skill",
|
|
19
19
|
"read_skill_resource",
|
|
20
20
|
"run_skill_script"
|
|
@@ -25,7 +25,7 @@ function isSkillToolPart(part) {
|
|
|
25
25
|
function isFetchToolPart(part) {
|
|
26
26
|
return isStaticToolUIPart(part) && getStaticToolName(part).startsWith("fetch_");
|
|
27
27
|
}
|
|
28
|
-
const BROWSER_TOOL_NAMES = new Set([
|
|
28
|
+
const BROWSER_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
29
29
|
"browser_execute",
|
|
30
30
|
"browser_markdown",
|
|
31
31
|
"browser_extract",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Think } from "@cloudflare/think";
|
|
3
|
+
import { AgentStub } from "agents/client";
|
|
4
|
+
|
|
5
|
+
//#region src/components/ThinkExecutionWorkbench.d.ts
|
|
6
|
+
type ThinkExecutionAgent<State = unknown> = Think<object, State>;
|
|
7
|
+
type ThinkExecutionWorkbenchSource<State = unknown> = AgentStub<ThinkExecutionAgent<State>>;
|
|
8
|
+
interface ThinkExecutionWorkbenchProps<State = unknown> extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
9
|
+
/** Agents SDK client stub for a Think agent; this UI calls native submission/workflow methods. */
|
|
10
|
+
source: ThinkExecutionWorkbenchSource<State>;
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
backButton?: React.ReactNode;
|
|
13
|
+
pageSize?: number;
|
|
14
|
+
}
|
|
15
|
+
declare function ThinkExecutionWorkbench<State = unknown>({
|
|
16
|
+
backButton,
|
|
17
|
+
className,
|
|
18
|
+
pageSize,
|
|
19
|
+
ref,
|
|
20
|
+
source,
|
|
21
|
+
title,
|
|
22
|
+
...props
|
|
23
|
+
}: ThinkExecutionWorkbenchProps<State> & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ThinkExecutionAgent, ThinkExecutionWorkbench, ThinkExecutionWorkbenchProps, ThinkExecutionWorkbenchSource };
|