@mcp-b/react-components 0.6.5 → 0.7.1
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-403mckDG.d.ts +101 -0
- package/dist/BrowserLiveView-ZktFZiMD.d.ts +47 -0
- package/dist/BrowserReplay-6G-mnwcn.d.ts +40 -0
- package/dist/{CodeBlock-BK0sOAbV.js → CodeBlock-D9koxDA7.js} +1 -1
- package/dist/{FileTree-BWQZ0FSi.js → FileTree-BdK93Uuu.js} +1 -1
- package/dist/ModelSelector-MQvK-pNb.js +306 -0
- package/dist/PromptInput-D6-G24p7.d.ts +528 -0
- package/dist/ThinkChatActivity-CeHzk6-K.d.ts +73 -0
- package/dist/ThinkChatContext-CC94HL4u.d.ts +28 -0
- package/dist/ThinkChatToolParts-DnUiZgCC.d.ts +83 -0
- package/dist/components/Activity.js +1 -1
- package/dist/components/AgentChat.d.ts +1 -103
- package/dist/components/AgentChat.js +77 -58
- package/dist/components/AgentConnection.d.ts +43 -2
- package/dist/components/AgentConnection.js +154 -3
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.d.ts +1 -46
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.d.ts +1 -39
- 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.d.ts +38 -0
- package/dist/components/ChatGptSignInScreen.js +201 -0
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/Commit.js +1 -1
- package/dist/components/Context.d.ts +6 -10
- package/dist/components/Context.js +4 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.d.ts +28 -28
- package/dist/components/Conversation.js +36 -55
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.js +1 -1
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Marker.d.ts +57 -0
- package/dist/components/Marker.js +89 -0
- package/dist/components/McpServerPicker.js +1 -1
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +52 -0
- package/dist/components/MessageScroller.js +62 -0
- package/dist/components/ModelSelector.js +1 -305
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/PromptInput.d.ts +2 -534
- package/dist/components/PromptInput.js +18 -12
- 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 +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThinkChat.d.ts +23 -80
- package/dist/components/ThinkChat.js +60 -857
- package/dist/components/ThinkChatActivity.d.ts +3 -0
- package/dist/components/ThinkChatActivity.js +429 -0
- package/dist/components/ThinkChatContext.d.ts +2 -0
- package/dist/components/ThinkChatContext.js +10 -0
- package/dist/components/ThinkChatToolPanels.d.ts +39 -0
- package/dist/components/ThinkChatToolPanels.js +355 -0
- package/dist/components/ThinkChatToolParts.d.ts +2 -0
- package/dist/components/ThinkChatToolParts.js +66 -0
- package/dist/components/ThinkFullApp.d.ts +23 -0
- package/dist/components/ThinkFullApp.js +175 -0
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceExplorer.d.ts +1 -1
- package/dist/components/WorkspaceExplorer.js +3 -3
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/components/useStickToBottom.d.ts +5 -2
- package/dist/components/useStickToBottom.js +5 -2
- package/dist/{copy-button-CB2MWcau.js → copy-button-TVhDAroI.js} +1 -1
- package/dist/{icons-BCNawx-T.js → icons-BAlTbWWP.js} +27 -1
- package/dist/{icons-BYpJY6L2.d.ts → icons-BRI54ATJ.d.ts} +2 -1
- package/dist/styles/agent-chat.css +15 -3
- package/dist/styles/agent-connection.css +33 -4
- package/dist/styles/chatgpt-sign-in-screen.css +224 -0
- package/dist/styles/code-block.css +6 -4
- package/dist/styles/conversation.css +10 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/marker.css +95 -0
- package/dist/styles/message-scroller.css +113 -0
- package/dist/styles/message.css +2 -1
- package/dist/styles/prompt-input.css +1 -0
- package/dist/styles/scrollbars.css +10 -2
- package/dist/styles/streamdown.css +2 -0
- package/dist/styles/think-full-app.css +318 -0
- package/dist/utils/mcp-server-catalog.d.ts +23 -1
- package/dist/utils/mcp-server-catalog.js +27 -1
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as CheckIcon, j as SpinnerIcon } from "../icons-BAlTbWWP.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 {
|
|
3
|
+
import { A as SearchIcon, c as ChevronRightIcon, h as FileIcon } from "../icons-BAlTbWWP.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 { I as XIcon, N as TerminalIcon } from "../icons-BAlTbWWP.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-TVhDAroI.js";
|
|
6
6
|
import { Badge } from "./Badge.js";
|
|
7
7
|
import { ScrollArea } from "./ScrollArea.js";
|
|
8
8
|
import * as React from "react";
|
|
@@ -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 { I as XIcon, a as CheckIcon, c as ChevronRightIcon, j as SpinnerIcon } from "../icons-BAlTbWWP.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";
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import { ExecutionApprovals } from "
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as ExecutionApprovals } from "../PromptInput-D6-G24p7.js";
|
|
2
|
+
import { a as AgentChatRenderPartContext, r as AgentChatProps } from "../AgentChat-403mckDG.js";
|
|
3
|
+
import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../BrowserLiveView-ZktFZiMD.js";
|
|
4
|
+
import { n as BrowserReplayProps, t as BrowserReplay } from "../BrowserReplay-6G-mnwcn.js";
|
|
5
|
+
import { _ as isThinkChatActivityPart } from "../ThinkChatToolParts-DnUiZgCC.js";
|
|
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-CC94HL4u.js";
|
|
5
8
|
import { FileInfo, UseWorkspaceOptions, WorkspaceExplorer, WorkspaceExplorerProps, WorkspaceFileState, WorkspaceInfo, WorkspaceSource, WorkspaceState, inferWorkspaceLanguage, useWorkspace } from "./WorkspaceExplorer.js";
|
|
6
9
|
import * as React from "react";
|
|
7
|
-
import {
|
|
8
|
-
import { useAgentChat } from "@cloudflare/think/react";
|
|
10
|
+
import { UIMessage } from "ai";
|
|
9
11
|
import { UseAgentOptions } from "agents/react";
|
|
12
|
+
import { PendingApproval } from "@cloudflare/think";
|
|
10
13
|
|
|
11
14
|
//#region src/components/ThinkChat.d.ts
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
interface ThinkApprovalStub {
|
|
16
|
+
pendingApprovals(executionId?: string): Promise<PendingApproval[]>;
|
|
17
|
+
approveExecution(executionId: string): Promise<unknown>;
|
|
18
|
+
rejectExecution(executionId: string, reason?: string): Promise<unknown>;
|
|
19
|
+
}
|
|
14
20
|
interface ThinkChatProviderProps {
|
|
15
21
|
/** The `useAgentChat` value from the `agents` SDK that descendants read. */
|
|
16
22
|
chat: ThinkChatValue;
|
|
@@ -44,11 +50,10 @@ interface ThinkChatMessagesProps extends ThinkChatActivityRendererOptions {
|
|
|
44
50
|
notice?: AgentChatProps["notice"];
|
|
45
51
|
/** Full replacement for part rendering; wins over excludeTools/toolRenderers. */
|
|
46
52
|
renderPart?: AgentChatProps["renderPart"];
|
|
47
|
-
/**
|
|
48
|
-
* Surfaces paused codemode executions in the composer's approval UI —
|
|
49
|
-
* the same confirmation tool approvals use. See {@link ExecutionApprovals}.
|
|
50
|
-
*/
|
|
53
|
+
/** Resolves Think execution approvals. `ThinkChat.Root` wires this automatically. */
|
|
51
54
|
executionApprovals?: ExecutionApprovals;
|
|
55
|
+
/** Think durable-pause approvals from `pendingApprovals()`. */
|
|
56
|
+
pendingApprovals?: AgentChatProps["pendingApprovals"];
|
|
52
57
|
/**
|
|
53
58
|
* Shows a Context ring in the composer footer — how much of the model's
|
|
54
59
|
* window the conversation occupies, from `metadata.usage` on the newest
|
|
@@ -56,29 +61,10 @@ interface ThinkChatMessagesProps extends ThinkChatActivityRendererOptions {
|
|
|
56
61
|
*/
|
|
57
62
|
contextWindow?: AgentChatProps["contextWindow"];
|
|
58
63
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
|
-
interface ThinkChatToolRenderer {
|
|
65
|
-
/** One-line step label. `null` hides the step from the log. */
|
|
66
|
-
describe?: (part: ToolUIPart | DynamicToolUIPart) => string | null | undefined;
|
|
67
|
-
/** Expanded detail under the step. `null` keeps the step a plain row. */
|
|
68
|
-
panel?: (part: ToolUIPart | DynamicToolUIPart) => React.ReactNode;
|
|
69
|
-
}
|
|
70
|
-
type ThinkChatToolRenderers = Record<string, ThinkChatToolRenderer>;
|
|
71
|
-
interface ThinkChatActivityRendererOptions {
|
|
72
|
-
/**
|
|
73
|
-
* Tool names to keep out of activity folding entirely — the run splits
|
|
74
|
-
* around them and they fall through to your own renderPart / AgentChat's
|
|
75
|
-
* generic standalone activity row. For tools that should stay in the log
|
|
76
|
-
* with custom UI, use `toolRenderers` instead.
|
|
77
|
-
*/
|
|
78
|
-
excludeTools?: readonly string[];
|
|
79
|
-
/** Per-tool label/panel overrides inside the activity log, keyed by tool name. */
|
|
80
|
-
toolRenderers?: ThinkChatToolRenderers;
|
|
81
|
-
}
|
|
64
|
+
declare function useThinkPendingApprovals(stub: ThinkApprovalStub, refreshKey: unknown): {
|
|
65
|
+
pendingApprovals: readonly PendingApproval[];
|
|
66
|
+
executionApprovals: ExecutionApprovals;
|
|
67
|
+
};
|
|
82
68
|
/**
|
|
83
69
|
* Chat UI for Cloudflare Think agents. Provide a `useAgentChat` value (or let
|
|
84
70
|
* `ThinkChat.Root` create one) and `ThinkChat.Messages` renders the message
|
|
@@ -118,53 +104,10 @@ declare function ThinkChatMessages({
|
|
|
118
104
|
excludeTools,
|
|
119
105
|
toolRenderers,
|
|
120
106
|
executionApprovals,
|
|
107
|
+
pendingApprovals,
|
|
121
108
|
notice,
|
|
122
109
|
...props
|
|
123
110
|
}: ThinkChatMessagesProps): React.JSX.Element;
|
|
124
|
-
/** Agent work (reasoning, tool calls, step boundaries) vs. content shown to the user. */
|
|
125
|
-
declare function isThinkChatActivityPart(part: ThinkChatPart | undefined, excludeTools?: ReadonlySet<string>): boolean;
|
|
126
|
-
/**
|
|
127
|
-
* One-line natural-language label for an activity part ("Ran vp test",
|
|
128
|
-
* "Fetched developers.cloudflare.com/agents/"); `null` for boundaries that
|
|
129
|
-
* aren't steps (step-start). Exported so a custom `renderPart` can reuse the
|
|
130
|
-
* built-in labels for tools it doesn't override.
|
|
131
|
-
*/
|
|
132
|
-
declare function describeThinkChatActivityPart(part: ThinkChatPart, toolRenderers?: ThinkChatToolRenderers): string | null;
|
|
133
|
-
interface ThinkChatActivityProps {
|
|
134
|
-
/** Render with the log expanded. */
|
|
135
|
-
defaultOpen?: boolean;
|
|
136
|
-
parts: readonly ThinkChatPart[];
|
|
137
|
-
/** Defaults to deriving from part states (reasoning streaming, tool awaiting output). */
|
|
138
|
-
isStreaming?: boolean;
|
|
139
|
-
/** Per-tool label/panel overrides, keyed by tool name. */
|
|
140
|
-
toolRenderers?: ThinkChatToolRenderers;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* One run of agent work as a collapsed Activity block: while streaming the
|
|
144
|
-
* label shimmers with the live step; settled, it becomes a short summary
|
|
145
|
-
* ("Thought, read 2 files and ran a command") over an expandable step log
|
|
146
|
-
* with per-tool panels. Normally reached through `ThinkChat.Messages`;
|
|
147
|
-
* exported for apps that lay out messages themselves.
|
|
148
|
-
*/
|
|
149
|
-
declare function ThinkChatActivity({
|
|
150
|
-
parts,
|
|
151
|
-
defaultOpen,
|
|
152
|
-
isStreaming,
|
|
153
|
-
toolRenderers
|
|
154
|
-
}: ThinkChatActivityProps): React.JSX.Element | null;
|
|
155
|
-
/**
|
|
156
|
-
* Builds a renderPart handler that folds every run of consecutive activity
|
|
157
|
-
* parts (reasoning + tool calls) into one collapsed Activity box. Everything
|
|
158
|
-
* is derived from the UIMessage stream: part order, tool states, reasoning
|
|
159
|
-
* state. Excluded tools split the run and return undefined so your own
|
|
160
|
-
* renderPart (or AgentChat's generic activity row) takes over for them.
|
|
161
|
-
*/
|
|
162
|
-
declare function createThinkChatActivityRenderer({
|
|
163
|
-
excludeTools,
|
|
164
|
-
toolRenderers
|
|
165
|
-
}?: ThinkChatActivityRendererOptions): NonNullable<AgentChatProps["renderPart"]>;
|
|
166
|
-
/** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
|
|
167
|
-
declare const renderThinkChatActivityPart: (context: AgentChatRenderPartContext<UIMessage<unknown, import("ai").UIDataTypes, import("ai").UITools>>) => React.ReactNode | undefined;
|
|
168
111
|
/**
|
|
169
112
|
* The ambient chat value from `ThinkChat.Root`/`Provider` — for custom tool
|
|
170
113
|
* panels, cards, or composer actions that need `messages`, `status`, or
|
|
@@ -204,4 +147,4 @@ declare const ThinkChat: {
|
|
|
204
147
|
createActivityRenderer: typeof createThinkChatActivityRenderer;
|
|
205
148
|
};
|
|
206
149
|
//#endregion
|
|
207
|
-
export { BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, type ExecutionApprovals, type FileInfo, ThinkChat, ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, ThinkChatToolRenderer, ThinkChatToolRenderers, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useWorkspace };
|
|
150
|
+
export { BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, type ExecutionApprovals, type FileInfo, ThinkApprovalStub, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, useThinkChat, useThinkPendingApprovals, useWorkspace };
|