@mcp-b/react-components 0.35.0 → 0.37.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-mpacmRU1.d.ts → AgentChat-CVO7xyLC.d.ts} +1 -1
- package/dist/{CodeBlock-DzGhYyNe.d.ts → CodeBlock-C380GD5t.d.ts} +2 -5
- package/dist/{CodeBlock-CM5gfmdq.js → CodeBlock-DO4Hdu1R.js} +4 -3
- package/dist/{Dialog-DeOSJ0Oy.d.ts → Dialog-B_FhRWaz.d.ts} +22 -37
- package/dist/{FileTree-4WP4Uc_m.js → FileTree-DbQMpvxV.js} +1 -1
- 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-DbzqSTBt.js → ThinkChat-DQh59CeC.js} +6 -8
- package/dist/{ThinkChatActivity-BZyN5MBg.d.ts → ThinkChatActivity-Dkmm2pIj.d.ts} +1 -1
- package/dist/{ToggleGroup-CSBWfPXo.d.ts → ToggleGroup-_pQMyHGM.d.ts} +5 -7
- package/dist/{WorkspaceFile-CVAzjTt6.d.ts → WorkspaceFile-BLaFmMrt.d.ts} +1 -1
- package/dist/{WorkspaceFileView-BmxSbhRu.js → WorkspaceFileView-Cu_ZG6HJ.js} +11 -17
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentActivityPreview.js +4 -4
- package/dist/components/agents-sdk/AgentChat.d.ts +1 -1
- package/dist/components/agents-sdk/AgentChat.js +36 -30
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +47 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +2 -2
- package/dist/components/agents-sdk/BrowserReplay.d.ts +40 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +2 -2
- package/dist/components/agents-sdk/McpConnectionRequest.js +15 -16
- 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 +19 -26
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +20 -18
- package/dist/components/agents-sdk/ModelSelector.d.ts +9 -9
- package/dist/components/agents-sdk/ModelSelector.js +504 -1
- package/dist/components/agents-sdk/PromptInputApproval.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunSelector.js +2 -2
- package/dist/components/agents-sdk/ThinkChat.d.ts +17 -107
- 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 +2 -2
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +4 -4
- package/dist/components/agents-sdk/ThinkFullApp.js +10 -14
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +2 -3
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +4 -4
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +2 -2
- package/dist/components/agents-sdk/ThinkThreadPicker.js +6 -7
- 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/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +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 +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
- package/dist/components/ai-sdk/Activity.d.ts +5 -0
- package/dist/components/ai-sdk/Activity.js +34 -14
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/InlineCitation.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.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 +19 -13
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +19 -11
- 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 +126 -129
- package/dist/components/ai-sdk/Queue.js +2 -2
- package/dist/components/ai-sdk/Reasoning.d.ts +3 -4
- package/dist/components/ai-sdk/Reasoning.js +30 -14
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/ai-sdk/ToolInvocation.d.ts +3 -5
- package/dist/components/extension/ChatGptSignInScreen.js +3 -3
- package/dist/components/extension/CodexModelSelector.d.ts +1 -1
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +3 -3
- 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/Card.d.ts +3 -3
- package/dist/components/foundations/Card.js +3 -3
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -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 +5 -29
- 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/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 +4 -23
- 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/SearchField.js +1 -1
- package/dist/components/foundations/Select.d.ts +1 -1
- package/dist/components/foundations/Select.js +8 -22
- 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 +6 -7
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/ToggleGroup.js +1 -1
- package/dist/components/foundations/Tooltip.d.ts +6 -8
- package/dist/components/foundations/Tooltip.js +4 -3
- package/dist/components/foundations/icons.js +1 -1
- package/dist/components/general-purpose/Commit.js +3 -3
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.d.ts +2 -3
- package/dist/components/general-purpose/PricingBillingToggle.js +5 -23
- package/dist/components/general-purpose/PricingPage.d.ts +3 -4
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- 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 +19 -4
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +4 -4
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +2 -2
- package/dist/components/general-purpose/WebPreview.js +5 -5
- package/dist/components/nanites/AgentConnection.js +17 -12
- package/dist/components/nanites/AgentToolDetail.js +4 -4
- package/dist/{copy-button-CsNSSKYG.js → copy-button-4YvddK4e.js} +1 -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/provider-logos-zjZycgV6.js +74 -0
- package/dist/styles/agent-chat.css +9 -0
- package/dist/styles/agent-connection.css +4 -31
- 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/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/tooltip.css +0 -1
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +18 -8
- 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-DtBxWqRn.js +0 -504
- package/dist/Workspace-GTlqvcIn.d.ts +0 -278
- package/dist/WorkspaceExplorer-Cu044amt.d.ts +0 -32
- package/dist/components/foundations/DescriptionListParts.d.ts +0 -37
- package/dist/components/foundations/DescriptionListParts.js +0 -35
- package/dist/{icons-B1Qw05te.js → icons-B4mGvCvc.js} +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
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-
|
|
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-B4mGvCvc.js";
|
|
2
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-
|
|
3
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-DO4Hdu1R.js";
|
|
4
|
+
import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
|
|
4
5
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
|
|
5
6
|
import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DZeLe_jN.js";
|
|
6
7
|
import { n as createWorkspaceRehypePlugins, t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-BWbkIELl.js";
|
|
7
|
-
import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
|
|
8
8
|
import { WorkspaceHeader } from "./components/agents-sdk/WorkspaceHeader.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inferFaviconUrl } from "../../utils/favicon.js";
|
|
2
|
-
import { $ as TerminalIcon, B as PencilIcon, C as FileIcon, F as MonitorIcon, G as SearchIcon, O as InfoIcon, k as LinkIcon, nt as WrenchIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { $ as TerminalIcon, B as PencilIcon, C as FileIcon, F as MonitorIcon, G as SearchIcon, O as InfoIcon, k as LinkIcon, nt as WrenchIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/agents-sdk/AgentActivity.tsx
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FileIcon, J as SpinnerIcon, j as McpIcon, rt as XIcon, tt as WarningIcon } from "../../icons-
|
|
3
|
-
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
2
|
+
import { C as FileIcon, J as SpinnerIcon, j as McpIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
4
3
|
import { ActivityHeader } from "../ai-sdk/Activity.js";
|
|
5
|
-
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
6
|
-
import { AppIcon } from "../foundations/AppIcon.js";
|
|
7
4
|
import { Button } from "../foundations/Button.js";
|
|
5
|
+
import { AppIcon } from "../foundations/AppIcon.js";
|
|
6
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
7
|
+
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/agents-sdk/AgentActivityPreview.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PermissionModeControl, i as AgentChatRenderMessageContext, n as AgentChatComposerDraft, o as compactingNotice, r as AgentChatProps, t as AgentChat } from "../../AgentChat-
|
|
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
2
|
export { AgentChat, AgentChatComposerDraft, AgentChatProps, AgentChatRenderMessageContext, PermissionModeControl, compactingNotice };
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { B as PencilIcon, H as PlusIcon, J as SpinnerIcon, L as MoveToFrontIcon, U as QueueIcon, W as RefreshIcon, et as TrashIcon, t as ArchiveIcon } from "../../icons-B1Qw05te.js";
|
|
3
2
|
import { ExpansionStateProvider } from "../ai-sdk/ExpansionState.js";
|
|
3
|
+
import { B as PencilIcon, H as PlusIcon, J as SpinnerIcon, L as MoveToFrontIcon, U as QueueIcon, W as RefreshIcon, et as TrashIcon, t as ArchiveIcon } from "../../icons-B4mGvCvc.js";
|
|
4
4
|
import { Button } from "../foundations/Button.js";
|
|
5
|
+
import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
|
|
5
6
|
import { IconButton } from "../foundations/IconButton.js";
|
|
6
|
-
import { Message, MessageAction, MessageActions } from "../ai-sdk/Message.js";
|
|
7
|
-
import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
|
|
8
|
-
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
|
|
9
|
-
import { EmptyState } from "../foundations/EmptyState.js";
|
|
10
|
-
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
11
7
|
import { Menu } from "../foundations/Menu.js";
|
|
12
8
|
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
9
|
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
14
|
-
import {
|
|
10
|
+
import { Message, MessageAction, MessageActions } from "../ai-sdk/Message.js";
|
|
11
|
+
import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
|
|
15
12
|
import { Marker, MarkerContent } from "../foundations/Marker.js";
|
|
13
|
+
import { t as CopyButton } from "../../copy-button-4YvddK4e.js";
|
|
14
|
+
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
|
|
15
|
+
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
16
|
+
import { QueueItem, QueueItemActions, QueueItemContent } from "../ai-sdk/Queue.js";
|
|
17
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
16
18
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
17
19
|
import { PromptInputApproval, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals } from "./PromptInputApproval.js";
|
|
18
|
-
import { t as CopyButton } from "../../copy-button-CsNSSKYG.js";
|
|
19
20
|
import * as React from "react";
|
|
20
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
22
22
|
import { isTextUIPart } from "ai";
|
|
23
|
+
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
23
24
|
//#region src/components/agents-sdk/AgentChat.tsx
|
|
24
25
|
/**
|
|
25
26
|
* Agents exports this helper from `agents/sessions` after cloudflare/agents#1896;
|
|
@@ -529,7 +530,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
529
530
|
"aria-label": "Queued messages",
|
|
530
531
|
children: pendingPrompts.map((pending) => {
|
|
531
532
|
const messageText = pending.message.text || "Queued message";
|
|
532
|
-
return /* @__PURE__ */ jsxs(
|
|
533
|
+
return /* @__PURE__ */ jsxs(QueueItem, {
|
|
533
534
|
className: "agent-chat__queued-message",
|
|
534
535
|
children: [
|
|
535
536
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -537,27 +538,32 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
537
538
|
"aria-hidden": "true",
|
|
538
539
|
children: /* @__PURE__ */ jsx(QueueIcon, {})
|
|
539
540
|
}),
|
|
540
|
-
/* @__PURE__ */ jsx(
|
|
541
|
-
className: "agent-chat__queued-
|
|
542
|
-
children:
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
"aria-label": `Move queued message to front: ${messageText}`,
|
|
547
|
-
color: "neutral",
|
|
548
|
-
size: "xs",
|
|
549
|
-
variant: "ghost",
|
|
550
|
-
onClick: () => setPendingPrompts((current) => [pending, ...current.filter((item) => item !== pending)]),
|
|
551
|
-
children: [/* @__PURE__ */ jsx(MoveToFrontIcon, {}), "Move to front"]
|
|
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
|
+
})
|
|
552
547
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
className: "agent-chat__queued-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
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
|
+
})]
|
|
561
567
|
})
|
|
562
568
|
]
|
|
563
569
|
}, pending.id);
|
|
@@ -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,9 +1,9 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { A as MaximizeIcon, J as SpinnerIcon } from "../../icons-
|
|
2
|
+
import { A as MaximizeIcon, J as SpinnerIcon } from "../../icons-B4mGvCvc.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { Dialog } from "../foundations/Dialog.js";
|
|
5
|
-
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
6
5
|
import { StatusPill } from "../foundations/StatusPill.js";
|
|
6
|
+
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/agents-sdk/BrowserLiveView.tsx
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { V as PlayIcon, z as PauseIcon } from "../../icons-
|
|
2
|
+
import { V as PlayIcon, z as PauseIcon } from "../../icons-B4mGvCvc.js";
|
|
3
3
|
import { IconButton } from "../foundations/IconButton.js";
|
|
4
4
|
import { r as formatClock } from "../../format-DB2mX9DA.js";
|
|
5
5
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { J as SpinnerIcon, rt as XIcon } from "../../icons-
|
|
2
|
+
import { J as SpinnerIcon, rt as XIcon } from "../../icons-B4mGvCvc.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { Tabs } from "../foundations/Tabs.js";
|
|
5
|
-
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
6
5
|
import { WebPreview, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewUrl } from "../general-purpose/WebPreview.js";
|
|
6
|
+
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/agents-sdk/BrowserRunPanel.tsx
|
|
@@ -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
|
-
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
4
3
|
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
6
4
|
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
5
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.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,9 +1,9 @@
|
|
|
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-DB2mX9DA.js";
|
|
5
4
|
import { Field } from "../foundations/Field.js";
|
|
6
5
|
import { Form } from "../foundations/Form.js";
|
|
6
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
7
7
|
import { Fieldset } from "../foundations/Fieldset.js";
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -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,15 +1,14 @@
|
|
|
1
|
-
import { getMcpServerEntry } from "../../utils/mcp-server-catalog.js";
|
|
2
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
3
|
-
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-
|
|
4
|
-
import { AppIcon } from "../foundations/AppIcon.js";
|
|
2
|
+
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
5
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
6
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
6
|
import { Dialog } from "../foundations/Dialog.js";
|
|
8
7
|
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
9
8
|
import { Separator } from "../foundations/Separator.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
|
|
9
|
+
import { AppIcon } from "../foundations/AppIcon.js";
|
|
12
10
|
import { SearchField } from "../foundations/SearchField.js";
|
|
11
|
+
import { n as getMcpServerProjection, t as McpServerIcon } from "../../mcp-server-SD_S-IpB.js";
|
|
13
12
|
import * as React from "react";
|
|
14
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
14
|
//#region src/components/agents-sdk/McpPluginCatalog.tsx
|
|
@@ -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
|
-
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B4mGvCvc.js";
|
|
4
3
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
|
+
import { Menu } from "../foundations/Menu.js";
|
|
5
5
|
import { Dialog } from "../foundations/Dialog.js";
|
|
6
6
|
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
7
|
-
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,
|