@mcp-b/react-components 0.34.1 → 0.36.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-CV-GuYA6.d.ts → AgentChat-CVO7xyLC.d.ts} +22 -3
- package/dist/{CodeBlock-CM5gfmdq.js → CodeBlock-Bk4nn7l-.js} +4 -3
- package/dist/{CodeBlock-DzGhYyNe.d.ts → CodeBlock-C380GD5t.d.ts} +2 -5
- package/dist/{Dialog-DeOSJ0Oy.d.ts → Dialog-B_FhRWaz.d.ts} +22 -37
- package/dist/{Menu-DVmjBIuM.d.ts → Menu-yb6QXWA3.d.ts} +64 -75
- package/dist/{PromptInput-DOyee1kM.d.ts → PromptInput-BRX7FhjH.d.ts} +7 -272
- package/dist/ResponsiveSidebarShell-DWjULskY.d.ts +68 -0
- package/dist/{Select-D96d09ww.d.ts → Select-RrceeEIe.d.ts} +17 -52
- package/dist/{ThinkChat-en0UbkVv.js → ThinkChat-ByR-QT_D.js} +19 -12
- package/dist/{ThinkChatActivity-CgqpROz_.d.ts → ThinkChatActivity-Dkmm2pIj.d.ts} +1 -1
- package/dist/{ToggleGroup-CSBWfPXo.d.ts → ToggleGroup-BrQZOQn_.d.ts} +4 -6
- package/dist/{WorkspaceFile-C8Riev9j.d.ts → WorkspaceFile-BLaFmMrt.d.ts} +18 -2
- package/dist/{WorkspaceFileView-BtzVKAed.js → WorkspaceFileView-DTHJLKW_.js} +11 -17
- package/dist/components/agents-sdk/AgentChat.d.ts +2 -2
- package/dist/components/agents-sdk/AgentChat.js +47 -26
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +47 -1
- package/dist/components/agents-sdk/BrowserReplay.d.ts +40 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +14 -15
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +17 -24
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +19 -17
- package/dist/components/agents-sdk/ModelSelector.d.ts +9 -9
- package/dist/components/agents-sdk/ModelSelector.js +504 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +18 -95
- package/dist/components/agents-sdk/ThinkChat.js +2 -12
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +2 -4
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -8
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +5 -3
- package/dist/components/agents-sdk/ThinkExecutionRun.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +4 -4
- package/dist/components/agents-sdk/ThinkFullApp.js +12 -14
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkPendingApproval.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +5 -4
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +2 -3
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +11 -15
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -4
- package/dist/components/agents-sdk/ThinkThreadShell.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +140 -2
- package/dist/components/agents-sdk/Workspace.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +32 -5
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -5
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceFile.js +41 -4
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/ai-sdk/Activity.d.ts +5 -0
- package/dist/components/ai-sdk/Activity.js +33 -13
- package/dist/components/ai-sdk/Approval.d.ts +1 -2
- package/dist/components/ai-sdk/Approval.js +4 -7
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/Message.js +2 -6
- package/dist/components/ai-sdk/MessageScroller.d.ts +5 -0
- package/dist/components/ai-sdk/MessageScroller.js +18 -12
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +18 -10
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +124 -127
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.d.ts +3 -4
- package/dist/components/ai-sdk/Reasoning.js +29 -13
- package/dist/components/ai-sdk/ToolInvocation.d.ts +3 -5
- package/dist/components/ai-sdk/ToolInvocation.js +2 -2
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.d.ts +1 -1
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Accordion.d.ts +1 -3
- package/dist/components/foundations/Accordion.js +1 -3
- package/dist/components/foundations/AlertDialog.d.ts +16 -36
- package/dist/components/foundations/Autocomplete.d.ts +12 -33
- package/dist/components/foundations/Autocomplete.js +2 -1
- package/dist/components/foundations/Combobox.d.ts +119 -2
- package/dist/components/foundations/Combobox.js +6 -23
- package/dist/components/foundations/ContextMenu.d.ts +50 -57
- package/dist/components/foundations/ContextMenu.js +4 -28
- package/dist/components/foundations/DescriptionList.d.ts +34 -2
- package/dist/components/foundations/DescriptionList.js +33 -2
- package/dist/components/foundations/Dialog.d.ts +1 -1
- package/dist/components/foundations/Dialog.js +2 -1
- package/dist/components/foundations/EmptyState.d.ts +5 -2
- package/dist/components/foundations/EmptyState.js +11 -7
- package/dist/components/foundations/Menu.d.ts +1 -1
- package/dist/components/foundations/Menu.js +3 -21
- package/dist/components/foundations/Menubar.d.ts +35 -64
- package/dist/components/foundations/Menubar.js +3 -22
- package/dist/components/foundations/Popover.d.ts +8 -21
- package/dist/components/foundations/Popover.js +3 -48
- package/dist/components/foundations/PreviewCard.d.ts +44 -29
- package/dist/components/foundations/PreviewCard.js +3 -6
- package/dist/components/foundations/RadioGroup.d.ts +4 -6
- package/dist/components/foundations/Select.d.ts +1 -1
- package/dist/components/foundations/Select.js +7 -21
- package/dist/components/foundations/Slider.d.ts +31 -44
- package/dist/components/foundations/Slider.js +26 -25
- package/dist/components/foundations/Stepper.d.ts +3 -3
- package/dist/components/foundations/Stepper.js +5 -6
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/Tooltip.d.ts +6 -8
- package/dist/components/foundations/Tooltip.js +4 -3
- package/dist/components/general-purpose/Commit.js +1 -1
- package/dist/components/general-purpose/EnvironmentVariables.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.d.ts +2 -3
- package/dist/components/general-purpose/PricingBillingToggle.js +4 -22
- package/dist/components/general-purpose/PricingPage.d.ts +3 -4
- package/dist/components/general-purpose/ResizableSidePanel.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -67
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +7 -2
- package/dist/components/general-purpose/SettingsFormDialog.js +18 -3
- package/dist/components/general-purpose/Terminal.js +3 -3
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +4 -4
- package/dist/components/nanites/AgentConnection.js +16 -11
- package/dist/components/nanites/AgentToolDetail.js +6 -7
- package/dist/{format-CmopcfqJ.js → format-DB2mX9DA.js} +16 -1
- package/dist/{mcp-server-U71zhxFF.js → mcp-server-SD_S-IpB.js} +18 -2
- package/dist/message-scroller-C8cplcQO.js +32 -0
- package/dist/{progress-ring-Dz_ztrW2.js → progress-ring-BEocM1e3.js} +1 -1
- package/dist/provider-logos-zjZycgV6.js +74 -0
- package/dist/styles/agent-chat.css +25 -0
- package/dist/styles/agent-connection.css +4 -31
- package/dist/styles/agent-tool-detail.css +0 -7
- package/dist/styles/alert-dialog.css +0 -2
- package/dist/styles/base-ui-motion.css +7 -5
- package/dist/styles/chatgpt-sign-in-screen.css +5 -3
- package/dist/styles/dialog.css +0 -2
- package/dist/styles/field.css +2 -2
- package/dist/styles/model-selector.css +30 -12
- package/dist/styles/popover.css +0 -1
- package/dist/styles/preview-card.css +0 -4
- package/dist/styles/pricing-page.css +1 -13
- package/dist/styles/prompt-input.css +12 -10
- package/dist/styles/recipes.css +22 -14
- package/dist/styles/slider.css +2 -2
- package/dist/styles/think-execution-workbench.css +9 -13
- package/dist/styles/think-routine-library.css +2 -30
- package/dist/styles/tooltip.css +0 -1
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +17 -7
- package/dist/BrowserLiveView-tJTWkoyu.d.ts +0 -48
- package/dist/BrowserReplay-B0BQZr-N.d.ts +0 -41
- package/dist/Combobox-WrrDDaEv.d.ts +0 -154
- package/dist/ModelSelector-DzdEs2fX.js +0 -504
- package/dist/Workspace-EhvvlHOB.d.ts +0 -278
- package/dist/WorkspaceExplorer-DygQnEyi.d.ts +0 -32
- package/dist/components/foundations/DescriptionListParts.d.ts +0 -37
- package/dist/components/foundations/DescriptionListParts.js +0 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as CodeBlockLanguage } from "./CodeBlock-
|
|
1
|
+
import { O as CodeBlockLanguage } from "./CodeBlock-C380GD5t.js";
|
|
2
2
|
import { SkillParseResult } from "agent-skills-ts-sdk";
|
|
3
3
|
import { FileInfo } from "@cloudflare/shell";
|
|
4
4
|
|
|
@@ -97,10 +97,26 @@ declare function isWorkspaceSkillPath(path: string): boolean;
|
|
|
97
97
|
* that report generic values such as `application/octet-stream`.
|
|
98
98
|
*/
|
|
99
99
|
declare function inferWorkspaceMedia(path: string, mimeType?: string | null): WorkspaceMediaInfo | null;
|
|
100
|
+
/**
|
|
101
|
+
* The mime type this vocabulary fixes for a file name, or `null` where it has
|
|
102
|
+
* no opinion and the caller's own answer stands.
|
|
103
|
+
*
|
|
104
|
+
* A workspace that derives mime types from names needs this for the reason
|
|
105
|
+
* `inferWorkspaceMedia` distrusts them: the platform registries call `.ts`
|
|
106
|
+
* MPEG-2 transport stream, and every downstream media check believes it. Media
|
|
107
|
+
* extensions answer their canonical type here too, so a host has one call
|
|
108
|
+
* instead of a copy of the table this module already keeps.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const mimeType = inferWorkspaceMimeType(name) ?? lookup(name) ?? "application/octet-stream";
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
declare function inferWorkspaceMimeType(path: string): string | null;
|
|
100
116
|
declare function isWorkspaceMediaPath(path: string, mimeType?: string | null): boolean;
|
|
101
117
|
/** Parse and validate a workspace skill with the canonical Agent Skills SDK. */
|
|
102
118
|
declare function parseWorkspaceSkill(content: string): WorkspaceSkillDocument;
|
|
103
119
|
/** Best-effort syntax-highlighting language from a file path; unknown extensions render as plain text. */
|
|
104
120
|
declare function inferWorkspaceLanguage(path: string): CodeBlockLanguage;
|
|
105
121
|
//#endregion
|
|
106
|
-
export { WorkspaceMediaInfo as a, WorkspaceMediaTrackKind as c, inferWorkspaceLanguage as d, inferWorkspaceMedia as f,
|
|
122
|
+
export { parseWorkspaceSkill as _, WorkspaceMediaInfo as a, WorkspaceMediaTrackKind as c, inferWorkspaceLanguage as d, inferWorkspaceMedia as f, isWorkspaceSkillPath as g, isWorkspaceMediaPath as h, WorkspaceFileState as i, WorkspaceSkillDocument as l, isWorkspaceMarkdownPath as m, WorkspaceFileAssetRequest as n, WorkspaceMediaKind as o, inferWorkspaceMimeType as p, WorkspaceFileAssetResolver as r, WorkspaceMediaTrack as s, WorkspaceFileAsset as t, getWorkspaceBasename as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as MaximizeIcon, d as CheckIcon, h as CodeIcon, r as ArrowLeftIcon, tt as WarningIcon, x as EyeIcon, y as DownloadIcon } from "./icons-B1Qw05te.js";
|
|
2
|
-
import { r as formatClock } from "./format-
|
|
3
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-
|
|
2
|
+
import { r as formatClock } from "./format-DB2mX9DA.js";
|
|
3
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Bk4nn7l-.js";
|
|
4
4
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
|
|
5
5
|
import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DZeLe_jN.js";
|
|
6
6
|
import { n as createWorkspaceRehypePlugins, t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-BWbkIELl.js";
|
|
@@ -123,23 +123,17 @@ function useWorkspaceAssetUrl(asset, mimeType) {
|
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
function WorkspaceAssetActions({ fileName, url, downloadUrl, allowOpen = true }) {
|
|
126
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [allowOpen ? /* @__PURE__ */ jsx(AppTopBar.
|
|
126
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [allowOpen ? /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
127
127
|
label: `Open ${fileName} in a new tab`,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
target: "_blank",
|
|
132
|
-
rel: "noreferrer"
|
|
133
|
-
}),
|
|
128
|
+
href: url,
|
|
129
|
+
target: "_blank",
|
|
130
|
+
rel: "noreferrer",
|
|
134
131
|
children: /* @__PURE__ */ jsx(MaximizeIcon, { "aria-hidden": "true" })
|
|
135
|
-
}) : null, downloadUrl ? /* @__PURE__ */ jsx(AppTopBar.
|
|
132
|
+
}) : null, downloadUrl ? /* @__PURE__ */ jsx(AppTopBar.Link, {
|
|
136
133
|
label: `Download ${fileName}`,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
download: fileName,
|
|
141
|
-
rel: "noreferrer"
|
|
142
|
-
}),
|
|
134
|
+
href: downloadUrl,
|
|
135
|
+
download: fileName,
|
|
136
|
+
rel: "noreferrer",
|
|
143
137
|
children: /* @__PURE__ */ jsx(DownloadIcon, { "aria-hidden": "true" })
|
|
144
138
|
}) : null] });
|
|
145
139
|
}
|
|
@@ -245,7 +239,7 @@ function WorkspaceImagePreview({ asset, fileName, media, url }) {
|
|
|
245
239
|
onError: () => setLoadFailed(true)
|
|
246
240
|
})
|
|
247
241
|
}), /* @__PURE__ */ jsx("div", {
|
|
248
|
-
className: "
|
|
242
|
+
className: "sigvelo-visually-hidden",
|
|
249
243
|
role: "status",
|
|
250
244
|
"aria-live": "polite",
|
|
251
245
|
"aria-atomic": "true",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PermissionModeControl, i as AgentChatRenderMessageContext, n as AgentChatComposerDraft, r as AgentChatProps, t as AgentChat } from "../../AgentChat-
|
|
2
|
-
export { AgentChat, AgentChatComposerDraft, AgentChatProps, AgentChatRenderMessageContext, PermissionModeControl };
|
|
1
|
+
import { a as PermissionModeControl, i as AgentChatRenderMessageContext, n as AgentChatComposerDraft, o as compactingNotice, r as AgentChatProps, t as AgentChat } from "../../AgentChat-CVO7xyLC.js";
|
|
2
|
+
export { AgentChat, AgentChatComposerDraft, AgentChatProps, AgentChatRenderMessageContext, PermissionModeControl, compactingNotice };
|
|
@@ -8,6 +8,7 @@ import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
|
|
|
8
8
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
|
|
9
9
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
10
10
|
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
11
|
+
import { QueueItem, QueueItemActions, QueueItemContent } from "../ai-sdk/Queue.js";
|
|
11
12
|
import { Menu } from "../foundations/Menu.js";
|
|
12
13
|
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, usePromptInputAttachments } from "../ai-sdk/PromptInput.js";
|
|
13
14
|
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
@@ -43,10 +44,17 @@ const COMPACT_SLASH_COMMAND = {
|
|
|
43
44
|
group: "Conversation",
|
|
44
45
|
meta: "Built in"
|
|
45
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* The affordance for a compaction that is running right now, for the `notice`
|
|
49
|
+
* slot. Exported because Think's session frames report the same state from
|
|
50
|
+
* outside this component's own `/compact` lifecycle, and one running
|
|
51
|
+
* compaction must not read two ways.
|
|
52
|
+
*/
|
|
53
|
+
const compactingNotice = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Compacting context…"] });
|
|
46
54
|
const COMPACTION_NOTICES = {
|
|
47
55
|
compacted: "Context compacted. Context usage updates after your next message.",
|
|
48
56
|
failed: "Compaction failed — run /compact to try again.",
|
|
49
|
-
pending:
|
|
57
|
+
pending: compactingNotice,
|
|
50
58
|
unchanged: "No context was compacted. Recent context is already protected."
|
|
51
59
|
};
|
|
52
60
|
function observeAgentChatComposer(element) {
|
|
@@ -240,7 +248,8 @@ const AgentChatTranscriptRowBody = React.memo(AgentChatTranscriptRowBodyImpl);
|
|
|
240
248
|
* announce re-inserted old rows as new); announce new messages from a
|
|
241
249
|
* host-owned live region if that matters.
|
|
242
250
|
*/
|
|
243
|
-
function AgentChat({ className, messages, status = "ready", onSubmit, showComposer = onSubmit !== void 0, onStop, onPromptQueued, placeholder = "Ask anything...", disabled, emptyState, startScreen, composerHeader, composerTray, composerTools, slashCommands, onCompact, mentionCommands, contextSelector, composerEndTools, voiceInput, beforeVoiceStart, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, approvalsEnabled = true, permissionModeControl, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, showAssistantActions, ref }) {
|
|
251
|
+
function AgentChat({ className, messages, status = "ready", onSubmit, showComposer = onSubmit !== void 0, onStop, onPromptQueued, placeholder = "Ask anything...", disabled: composerDisabled, emptyState, loading, startScreen, composerHeader, composerTray, composerTools, slashCommands, onCompact, mentionCommands, contextSelector, composerEndTools, voiceInput, beforeVoiceStart, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, approvalsEnabled = true, permissionModeControl, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, showAssistantActions, ref }) {
|
|
252
|
+
const disabled = composerDisabled || loading;
|
|
244
253
|
const [copyAnnouncement, setCopyAnnouncement] = React.useState("");
|
|
245
254
|
const [composerDraft, setComposerDraft] = React.useState("");
|
|
246
255
|
const [composerReferences, setComposerReferences] = React.useState([]);
|
|
@@ -521,7 +530,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
521
530
|
"aria-label": "Queued messages",
|
|
522
531
|
children: pendingPrompts.map((pending) => {
|
|
523
532
|
const messageText = pending.message.text || "Queued message";
|
|
524
|
-
return /* @__PURE__ */ jsxs(
|
|
533
|
+
return /* @__PURE__ */ jsxs(QueueItem, {
|
|
525
534
|
className: "agent-chat__queued-message",
|
|
526
535
|
children: [
|
|
527
536
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -529,27 +538,32 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
529
538
|
"aria-hidden": "true",
|
|
530
539
|
children: /* @__PURE__ */ jsx(QueueIcon, {})
|
|
531
540
|
}),
|
|
532
|
-
/* @__PURE__ */ jsx(
|
|
533
|
-
className: "agent-chat__queued-
|
|
534
|
-
children:
|
|
541
|
+
/* @__PURE__ */ jsx(QueueItemContent, {
|
|
542
|
+
className: "agent-chat__queued-content",
|
|
543
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
544
|
+
className: "agent-chat__queued-text sigvelo-truncate sigvelo-truncate-grow",
|
|
545
|
+
children: messageText
|
|
546
|
+
})
|
|
535
547
|
}),
|
|
536
|
-
/* @__PURE__ */ jsxs(
|
|
537
|
-
className: "agent-chat__queued-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
548
|
+
/* @__PURE__ */ jsxs(QueueItemActions, {
|
|
549
|
+
className: "agent-chat__queued-actions",
|
|
550
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
551
|
+
className: "agent-chat__queued-action",
|
|
552
|
+
"aria-label": `Move queued message to front: ${messageText}`,
|
|
553
|
+
color: "neutral",
|
|
554
|
+
size: "xs",
|
|
555
|
+
variant: "ghost",
|
|
556
|
+
onClick: () => setPendingPrompts((current) => [pending, ...current.filter((item) => item !== pending)]),
|
|
557
|
+
children: [/* @__PURE__ */ jsx(MoveToFrontIcon, {}), "Move to front"]
|
|
558
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
559
|
+
className: "agent-chat__queued-action agent-chat__queued-remove",
|
|
560
|
+
color: "neutral",
|
|
561
|
+
label: `Remove queued message: ${messageText}`,
|
|
562
|
+
size: "xs",
|
|
563
|
+
variant: "ghost",
|
|
564
|
+
onClick: () => setPendingPrompts((current) => current.filter((item) => item !== pending)),
|
|
565
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
566
|
+
})]
|
|
553
567
|
})
|
|
554
568
|
]
|
|
555
569
|
}, pending.id);
|
|
@@ -638,7 +652,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
638
652
|
title: "Start a conversation",
|
|
639
653
|
description: "Ask the agent to inspect, plan, or build."
|
|
640
654
|
});
|
|
641
|
-
const showsStartScreen = messages.length === 0 && showComposer && startScreen !== false && (startScreen !== void 0 || emptyState === void 0);
|
|
655
|
+
const showsStartScreen = !loading && messages.length === 0 && showComposer && startScreen !== false && (startScreen !== void 0 || emptyState === void 0);
|
|
642
656
|
const startScreenProps = startScreen && typeof startScreen === "object" ? startScreen : void 0;
|
|
643
657
|
return /* @__PURE__ */ jsxs(TransitionSurface, {
|
|
644
658
|
ref,
|
|
@@ -652,7 +666,14 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
652
666
|
"aria-atomic": "true",
|
|
653
667
|
children: copyAnnouncement
|
|
654
668
|
}),
|
|
655
|
-
|
|
669
|
+
loading ? /* @__PURE__ */ jsxs("div", {
|
|
670
|
+
className: "agent-chat__transcript-loading",
|
|
671
|
+
role: "status",
|
|
672
|
+
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
673
|
+
className: "sigvelo-visually-hidden",
|
|
674
|
+
children: "Loading conversation"
|
|
675
|
+
})]
|
|
676
|
+
}) : showsStartScreen ? /* @__PURE__ */ jsx(AgentChatStartScreen, {
|
|
656
677
|
...startScreenProps,
|
|
657
678
|
composer
|
|
658
679
|
}) : /* @__PURE__ */ jsx(ExpansionStateProvider, { children: /* @__PURE__ */ jsx(VirtualMessageScroller, {
|
|
@@ -678,4 +699,4 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
678
699
|
});
|
|
679
700
|
}
|
|
680
701
|
//#endregion
|
|
681
|
-
export { AgentChat };
|
|
702
|
+
export { AgentChat, compactingNotice };
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { BrowserLiveViewUrl } from "agents/browser";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/BrowserLiveView.d.ts
|
|
5
|
+
interface BrowserLiveViewProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** Complete upstream value returned by `cdp.getLiveViewUrl()`. */
|
|
7
|
+
source: BrowserLiveViewUrl;
|
|
8
|
+
/** Epoch ms when `source` was received. Defaults to its first render. */
|
|
9
|
+
receivedAt?: number;
|
|
10
|
+
/** The page the session was showing — used for the ended-state text. */
|
|
11
|
+
pageTitle?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Shown once the link expires — pass the last screenshot the agent took
|
|
14
|
+
* (`<img>`) to keep the final frame on screen. Defaults to a quiet
|
|
15
|
+
* "Live view ended" state.
|
|
16
|
+
*/
|
|
17
|
+
fallback?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Embeds a Browser Run Live View — a real-time, interactive view of the
|
|
21
|
+
* agent's browser session. Links expire (~5 minutes), so the iframe swaps to
|
|
22
|
+
* `fallback` (e.g. the last screenshot) once `source.expiresInMs` passes.
|
|
23
|
+
* While the hosted viewer connects, a quiet loading overlay hides the frame; if it
|
|
24
|
+
* never loads, the view degrades to `fallback` or an unavailable state. An
|
|
25
|
+
* expand button opens the same view in a fullscreen dialog.
|
|
26
|
+
*
|
|
27
|
+
* Where URLs come from (upstream: `agents/browser` in
|
|
28
|
+
* github.com/cloudflare/agents — `BrowserLiveViewUrl`): the model calls
|
|
29
|
+
* `cdp.getLiveViewUrl()` inside a `browser_execute` tool run, or the host
|
|
30
|
+
* calls `connector.liveView()`/`sessionInfo()`. This package's chat rendering
|
|
31
|
+
* derives the component automatically from links found in tool results.
|
|
32
|
+
*
|
|
33
|
+
* Styling rides `@mcp-b/react-components/styles` (browser-live-view.css),
|
|
34
|
+
* which think-chat consumers load anyway.
|
|
35
|
+
*
|
|
36
|
+
* The iframe is unsandboxed by design: the hosted Live View UI needs scripts
|
|
37
|
+
* and its own origin to stream the session. Only pass trusted Live View URLs.
|
|
38
|
+
*/
|
|
39
|
+
declare function BrowserLiveView({
|
|
40
|
+
source,
|
|
41
|
+
receivedAt,
|
|
42
|
+
pageTitle,
|
|
43
|
+
fallback,
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}: BrowserLiveViewProps): React.JSX.Element;
|
|
47
|
+
//#endregion
|
|
2
48
|
export { BrowserLiveView, BrowserLiveViewProps };
|
|
@@ -1,2 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { BrowserRecording } from "agents/browser";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/BrowserReplay.d.ts
|
|
5
|
+
interface BrowserReplayProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
6
|
+
/**
|
|
7
|
+
* rrweb events for one tab, e.g. one
|
|
8
|
+
* `BrowserRecording.events[targetId]` entry from Cloudflare Browser Run.
|
|
9
|
+
*/
|
|
10
|
+
events: BrowserRecording["events"][string];
|
|
11
|
+
/** Start playing on mount. */
|
|
12
|
+
autoPlay?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Replays a completed Cloudflare Browser Run recording locally with rrweb.
|
|
16
|
+
*
|
|
17
|
+
* This is intentionally not derived from Think chat message parts. Live view
|
|
18
|
+
* links and screenshots ride the `browser_execute` stream and belong to
|
|
19
|
+
* `BrowserLiveView`; replay events are fetched after a session closes with
|
|
20
|
+
* Browser Run's `getBrowserRecording()`. Upstream currently shapes those
|
|
21
|
+
* recordings as `Record<targetId, unknown[]>`, where each array is plain rrweb
|
|
22
|
+
* JSON for one tab. Playback happens in the viewer's browser through
|
|
23
|
+
* `@rrweb/replay`; no replay service is contacted at playback time.
|
|
24
|
+
*
|
|
25
|
+
* Styling rides `@mcp-b/react-components/styles` (browser-replay.css), which
|
|
26
|
+
* think-chat consumers load anyway.
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/cloudflare/agents/tree/main/packages/agents/src/browser
|
|
29
|
+
* @see https://github.com/rrweb-io/rrweb/tree/main/packages/%40rrweb/replay
|
|
30
|
+
*/
|
|
31
|
+
declare function BrowserReplay({
|
|
32
|
+
className,
|
|
33
|
+
events,
|
|
34
|
+
autoPlay,
|
|
35
|
+
ref,
|
|
36
|
+
...props
|
|
37
|
+
}: BrowserReplayProps & {
|
|
38
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
39
|
+
}): React.JSX.Element;
|
|
40
|
+
//#endregion
|
|
2
41
|
export { BrowserReplay, BrowserReplayProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { V as PlayIcon, z as PauseIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { IconButton } from "../foundations/IconButton.js";
|
|
4
|
-
import { r as formatClock } from "../../format-
|
|
4
|
+
import { r as formatClock } from "../../format-DB2mX9DA.js";
|
|
5
5
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
6
6
|
import { Slider } from "../foundations/Slider.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
2
|
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
3
|
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { i as formatErrorMessage } from "../../format-
|
|
4
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
6
5
|
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
7
6
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
8
|
-
import { n as
|
|
7
|
+
import { n as getMcpServerProjection } from "../../mcp-server-SD_S-IpB.js";
|
|
9
8
|
import * as React from "react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { getToolPartState } from "@cloudflare/think/react";
|
|
@@ -17,25 +16,25 @@ import { getToolPartState } from "@cloudflare/think/react";
|
|
|
17
16
|
*/
|
|
18
17
|
function McpConnectionRequest(props) {
|
|
19
18
|
const { mcp, part, server, serverId } = props;
|
|
20
|
-
const
|
|
21
|
-
const connectedServer = serverId === void 0 ? entry?.[1] : mcp?.servers[serverId];
|
|
22
|
-
const serverState = connectedServer ? getMcpServerRuntimeState(connectedServer) : void 0;
|
|
19
|
+
const projection = getMcpServerProjection(server, mcp, serverId);
|
|
23
20
|
const actionStateKey = JSON.stringify([
|
|
24
21
|
part.toolCallId,
|
|
25
22
|
server.id,
|
|
26
23
|
server.url,
|
|
27
|
-
serverId ??
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
serverId ?? projection.serverId,
|
|
25
|
+
projection.runtimeState,
|
|
26
|
+
projection.server?.error
|
|
30
27
|
]);
|
|
31
|
-
return /* @__PURE__ */ jsx(McpConnectionRequestContent, {
|
|
28
|
+
return /* @__PURE__ */ jsx(McpConnectionRequestContent, {
|
|
29
|
+
projection,
|
|
30
|
+
...props
|
|
31
|
+
}, actionStateKey);
|
|
32
32
|
}
|
|
33
|
-
function McpConnectionRequestContent({ part, server, reason, mcp, serverId, outcome, onConnect, onDecline, className, ref, ...props }) {
|
|
33
|
+
function McpConnectionRequestContent({ part, server, reason, mcp: _mcp, serverId: _serverId, outcome, onConnect, onDecline, className, ref, projection, ...props }) {
|
|
34
34
|
const [action, setAction] = React.useState(null);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const connectionKind = getMcpServerConnectionKind(connectedServer);
|
|
35
|
+
const connectedServer = projection.server;
|
|
36
|
+
const serverState = projection.runtimeState;
|
|
37
|
+
const connectionKind = projection.connectionKind;
|
|
39
38
|
const pendingAction = action?.status === "pending" ? action.kind : null;
|
|
40
39
|
const actionError = action?.status === "error" ? action.error : null;
|
|
41
40
|
const failedAction = action?.status === "error" ? action.kind : null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CUSTOM_MCP_SERVER_CARD } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
-
import { i as formatErrorMessage } from "../../format-
|
|
4
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
5
5
|
import { Field } from "../foundations/Field.js";
|
|
6
6
|
import { Form } from "../foundations/Form.js";
|
|
7
7
|
import { Fieldset } from "../foundations/Fieldset.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as McpServerCard } from "../../mcp-server-catalog-CCj2ItkV.js";
|
|
2
|
-
import { l as DialogProps } from "../../Dialog-
|
|
2
|
+
import { l as DialogProps } from "../../Dialog-B_FhRWaz.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { MCPServersState } from "agents";
|
|
5
5
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { getMcpServerEntry } from "../../utils/mcp-server-catalog.js";
|
|
2
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
2
|
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
3
|
import { AppIcon } from "../foundations/AppIcon.js";
|
|
5
4
|
import { Button } from "../foundations/Button.js";
|
|
6
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
6
|
import { Dialog } from "../foundations/Dialog.js";
|
|
8
|
-
import { i as formatErrorMessage } from "../../format-
|
|
7
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
9
8
|
import { Separator } from "../foundations/Separator.js";
|
|
10
9
|
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
11
|
-
import { n as
|
|
10
|
+
import { n as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-SD_S-IpB.js";
|
|
12
11
|
import { SearchField } from "../foundations/SearchField.js";
|
|
13
12
|
import * as React from "react";
|
|
14
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -23,7 +22,7 @@ function McpPluginCatalog({ servers, mcp, detailsByServerId, featuredServerIds =
|
|
|
23
22
|
const [selectedServer, setSelectedServer] = React.useState(null);
|
|
24
23
|
const headingIdPrefix = React.useId();
|
|
25
24
|
const sections = groupServers(filterServers(servers, detailsByServerId, query), featuredServerIds, query);
|
|
26
|
-
const installedServers = query ? [] : servers.filter((server) =>
|
|
25
|
+
const installedServers = query ? [] : servers.filter((server) => getMcpServerProjection(server, mcp).connectionKind === "connected");
|
|
27
26
|
return /* @__PURE__ */ jsxs("section", {
|
|
28
27
|
className: cx("mcp-plugin-catalog", className),
|
|
29
28
|
...props,
|
|
@@ -119,8 +118,8 @@ function McpPluginDetailsDialog({ server, details, mcp, brandName = "your AI", b
|
|
|
119
118
|
/* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("strong", { children: "Data shared with this plugin." }), " Your AI may send relevant context from your request so the plugin can respond. Review the provider's terms and privacy policy before connecting."] })
|
|
120
119
|
] }), onConnect, onDisconnect, onOpenChange }) {
|
|
121
120
|
const popupRef = React.useRef(null);
|
|
122
|
-
const projection = server ?
|
|
123
|
-
const title = server ? getDialogTitle(server.name, projection?.
|
|
121
|
+
const projection = server ? getMcpServerProjection(server, mcp) : null;
|
|
122
|
+
const title = server ? getDialogTitle(server.name, projection?.connectionKind, brandName) : "Plugin details";
|
|
124
123
|
const description = details?.longDescription ?? server?.description;
|
|
125
124
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
126
125
|
open: server !== null,
|
|
@@ -168,9 +167,9 @@ function McpPluginDetailsDialog({ server, details, mcp, brandName = "your AI", b
|
|
|
168
167
|
className: "mcp-plugin-details__title",
|
|
169
168
|
children: title
|
|
170
169
|
}),
|
|
171
|
-
projection && projection.
|
|
170
|
+
projection && projection.connectionKind !== "available" ? /* @__PURE__ */ jsx("p", {
|
|
172
171
|
className: "mcp-plugin-details__state",
|
|
173
|
-
children: projection.
|
|
172
|
+
children: getServerStatusLabel(projection.connectionKind)
|
|
174
173
|
}) : null,
|
|
175
174
|
/* @__PURE__ */ jsx(Dialog.Description, {
|
|
176
175
|
className: "mcp-plugin-details__description",
|
|
@@ -193,11 +192,12 @@ function McpPluginDetailsDialog({ server, details, mcp, brandName = "your AI", b
|
|
|
193
192
|
});
|
|
194
193
|
}
|
|
195
194
|
function McpPluginCard({ server, details, mcp, onSelect }) {
|
|
196
|
-
const projection =
|
|
195
|
+
const projection = getMcpServerProjection(server, mcp);
|
|
196
|
+
const statusLabel = getServerStatusLabel(projection.connectionKind);
|
|
197
197
|
return /* @__PURE__ */ jsxs("article", {
|
|
198
198
|
className: "mcp-plugin-catalog__card",
|
|
199
199
|
children: [/* @__PURE__ */ jsxs(Button, {
|
|
200
|
-
"aria-label": `View ${server.name} details. ${
|
|
200
|
+
"aria-label": `View ${server.name} details. ${statusLabel}.`,
|
|
201
201
|
className: "mcp-plugin-catalog__card-main",
|
|
202
202
|
color: "neutral",
|
|
203
203
|
size: "xl",
|
|
@@ -218,22 +218,22 @@ function McpPluginCard({ server, details, mcp, onSelect }) {
|
|
|
218
218
|
})]
|
|
219
219
|
}), /* @__PURE__ */ jsx(IconButton, {
|
|
220
220
|
color: "neutral",
|
|
221
|
-
label: projection.
|
|
221
|
+
label: projection.connectionKind === "connected" ? `More actions for ${server.name}` : `View ${server.name} connection options`,
|
|
222
222
|
size: "sm",
|
|
223
223
|
variant: "ghost",
|
|
224
224
|
onClick: onSelect,
|
|
225
|
-
children: projection.
|
|
225
|
+
children: projection.connectionKind === "connecting" ? /* @__PURE__ */ jsx(SpinnerIcon, {}) : projection.connectionKind === "connected" ? /* @__PURE__ */ jsx(EllipsisIcon, {}) : /* @__PURE__ */ jsx(PlusIcon, {})
|
|
226
226
|
})]
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
function McpPluginDialogActions({ projection, server, onConnect, onDisconnect }) {
|
|
230
230
|
const [action, setAction] = React.useState({ pending: false });
|
|
231
231
|
if (!projection) return null;
|
|
232
|
-
const disconnect = projection.
|
|
232
|
+
const disconnect = projection.connectionKind === "connected";
|
|
233
233
|
const connectedServerId = projection.serverId;
|
|
234
234
|
const callback = disconnect ? connectedServerId && onDisconnect ? () => onDisconnect(connectedServerId) : void 0 : onConnect ? () => onConnect(server) : void 0;
|
|
235
|
-
const actionLabel = action.pending ? disconnect ? "Disconnecting" : "Connecting" : disconnect ? onDisconnect ? "Disconnect" : "Connected" : projection.
|
|
236
|
-
const disabled = action.pending || projection.
|
|
235
|
+
const actionLabel = action.pending ? disconnect ? "Disconnecting" : "Connecting" : disconnect ? onDisconnect ? "Disconnect" : "Connected" : projection.connectionKind === "connecting" ? "Connecting" : projection.connectionKind === "reconnect" ? `Reconnect ${server.name}` : `Connect ${server.name}`;
|
|
236
|
+
const disabled = action.pending || projection.connectionKind === "connecting" || !callback;
|
|
237
237
|
async function runAction() {
|
|
238
238
|
if (!callback || disabled) return;
|
|
239
239
|
setAction({ pending: true });
|
|
@@ -272,15 +272,8 @@ function McpPluginDialogActions({ projection, server, onConnect, onDisconnect })
|
|
|
272
272
|
})
|
|
273
273
|
})] });
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
|
|
277
|
-
const kind = getMcpServerConnectionKind(entry?.[1]);
|
|
278
|
-
const statusLabel = kind === "connected" ? "Connected" : kind === "connecting" ? "Connecting" : kind === "reconnect" ? "Needs attention" : "Available";
|
|
279
|
-
return {
|
|
280
|
-
kind,
|
|
281
|
-
serverId: entry?.[0],
|
|
282
|
-
statusLabel
|
|
283
|
-
};
|
|
275
|
+
function getServerStatusLabel(kind) {
|
|
276
|
+
return kind === "connected" ? "Connected" : kind === "connecting" ? "Connecting" : kind === "reconnect" ? "Needs attention" : "Available";
|
|
284
277
|
}
|
|
285
278
|
function getDialogTitle(name, kind, brandName) {
|
|
286
279
|
if (kind === "connected") return name;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as MenuItemProps, t as Menu } from "../../Menu-
|
|
1
|
+
import { s as MenuItemProps, t as Menu } from "../../Menu-yb6QXWA3.js";
|
|
2
2
|
import { o as McpServerCard } from "../../mcp-server-catalog-CCj2ItkV.js";
|
|
3
3
|
import { McpConnectorFormProps } from "./McpConnectorForm.js";
|
|
4
|
-
import { l as DialogProps } from "../../Dialog-
|
|
4
|
+
import { l as DialogProps } from "../../Dialog-B_FhRWaz.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { MCPServersState } from "agents";
|
|
7
7
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
1
|
import { n as mergeBaseClassName } from "../../class-names-BiMDVpUo.js";
|
|
3
2
|
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
3
|
import { buttonVariants } from "../foundations/Button.js";
|
|
5
4
|
import { Dialog } from "../foundations/Dialog.js";
|
|
6
|
-
import { i as formatErrorMessage } from "../../format-
|
|
5
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
7
6
|
import { Menu } from "../foundations/Menu.js";
|
|
8
7
|
import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
|
|
9
|
-
import { n as
|
|
8
|
+
import { n as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-SD_S-IpB.js";
|
|
10
9
|
import { McpConnectorForm } from "./McpConnectorForm.js";
|
|
11
10
|
import * as React from "react";
|
|
12
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -156,11 +155,11 @@ function McpServerPickerAction({ icon, label, description, className, ...props }
|
|
|
156
155
|
});
|
|
157
156
|
}
|
|
158
157
|
function McpServerPickerRow({ row, onConnect, onDisconnect, pendingAction }) {
|
|
159
|
-
const {
|
|
160
|
-
const connectedServerId =
|
|
161
|
-
const connectedServer =
|
|
162
|
-
const state =
|
|
163
|
-
const connectionKind =
|
|
158
|
+
const { projection, server } = row;
|
|
159
|
+
const connectedServerId = projection.serverId;
|
|
160
|
+
const connectedServer = projection.server;
|
|
161
|
+
const state = projection.runtimeState;
|
|
162
|
+
const connectionKind = projection.connectionKind;
|
|
164
163
|
const connectKey = `connect:${server.id}:${server.url}`;
|
|
165
164
|
const connecting = connectionKind === "connecting";
|
|
166
165
|
const pendingConnect = pendingAction === connectKey;
|
|
@@ -241,25 +240,28 @@ function getStatusLabel(connectionKind, state) {
|
|
|
241
240
|
}
|
|
242
241
|
function getPickerRows(servers, mcp) {
|
|
243
242
|
const catalogRows = servers.map((server) => ({
|
|
244
|
-
server,
|
|
245
|
-
|
|
243
|
+
projection: getMcpServerProjection(server, mcp),
|
|
244
|
+
server
|
|
246
245
|
}));
|
|
247
246
|
if (!mcp) return catalogRows;
|
|
248
|
-
const resolvedServerIds = new Set(catalogRows.flatMap((row) => row.
|
|
249
|
-
const upstreamRows = Object.entries(mcp.servers).filter(([serverId]) => !resolvedServerIds.has(serverId)).map(([serverId, entry]) =>
|
|
250
|
-
|
|
251
|
-
server: {
|
|
247
|
+
const resolvedServerIds = new Set(catalogRows.flatMap((row) => row.projection.serverId ? [row.projection.serverId] : []));
|
|
248
|
+
const upstreamRows = Object.entries(mcp.servers).filter(([serverId]) => !resolvedServerIds.has(serverId)).map(([serverId, entry]) => {
|
|
249
|
+
const server = {
|
|
252
250
|
id: serverId,
|
|
253
251
|
name: entry.name,
|
|
254
252
|
url: entry.server_url
|
|
255
|
-
}
|
|
256
|
-
|
|
253
|
+
};
|
|
254
|
+
return {
|
|
255
|
+
projection: getMcpServerProjection(server, mcp, serverId),
|
|
256
|
+
server
|
|
257
|
+
};
|
|
258
|
+
});
|
|
257
259
|
return [...catalogRows, ...upstreamRows];
|
|
258
260
|
}
|
|
259
261
|
function groupPickerRows(rows) {
|
|
260
262
|
const groups = /* @__PURE__ */ new Map();
|
|
261
263
|
for (const row of rows) {
|
|
262
|
-
const key =
|
|
264
|
+
const key = row.projection.connectionKind === "connected" ? "Connected" : row.server.category === "Auto" ? "MCP connectors" : row.server.category === "Manual" ? "Manual setup" : row.server.category ?? "Other";
|
|
263
265
|
const group = groups.get(key) ?? [];
|
|
264
266
|
group.push(row);
|
|
265
267
|
groups.set(key, group);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as ButtonProps } from "../../Button-CZt3yywF.js";
|
|
2
|
-
import { l as DialogProps } from "../../Dialog-
|
|
2
|
+
import { l as DialogProps } from "../../Dialog-B_FhRWaz.js";
|
|
3
3
|
import { SeparatorProps } from "../foundations/Separator.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import Cloudflare from "cloudflare";
|
|
@@ -70,14 +70,13 @@ interface ModelSelectorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
70
70
|
* from a grouped provider list. Do not use it as a general command palette or
|
|
71
71
|
* multiselect; use Combobox or a dedicated component for that.
|
|
72
72
|
*
|
|
73
|
-
* Sigvelo changes: composes the design-system Dialog
|
|
74
|
-
*
|
|
75
|
-
* CSS tokens.
|
|
73
|
+
* Sigvelo changes: composes the design-system Dialog, Autocomplete, ScrollArea,
|
|
74
|
+
* and Button, and maps provider logos plus option styling to Sigvelo CSS tokens.
|
|
76
75
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* typography tokens. Add provider/item
|
|
80
|
-
* shared.
|
|
76
|
+
* Dialog owns modal focus and dismissal. Autocomplete owns listbox semantics,
|
|
77
|
+
* active-descendant focus, and keyboard navigation. Styling consumes surface,
|
|
78
|
+
* border, spacing, radius, focus, and typography tokens. Add provider/item
|
|
79
|
+
* affordances here when they need to be shared.
|
|
81
80
|
*
|
|
82
81
|
* @example
|
|
83
82
|
* ```tsx
|
|
@@ -196,6 +195,7 @@ declare function ModelSelectorItem({
|
|
|
196
195
|
children,
|
|
197
196
|
onClick,
|
|
198
197
|
ref,
|
|
198
|
+
disabled,
|
|
199
199
|
...props
|
|
200
200
|
}: ModelSelectorItemProps & {
|
|
201
201
|
ref?: React.Ref<HTMLButtonElement>;
|
|
@@ -208,7 +208,7 @@ declare function ModelSelectorEmpty({
|
|
|
208
208
|
...props
|
|
209
209
|
}: ModelSelectorEmptyProps & {
|
|
210
210
|
ref?: React.Ref<HTMLDivElement>;
|
|
211
|
-
}): React.JSX.Element;
|
|
211
|
+
}): React.JSX.Element | null;
|
|
212
212
|
interface ModelSelectorSeparatorProps extends SeparatorProps {}
|
|
213
213
|
declare function ModelSelectorSeparator({
|
|
214
214
|
className,
|