@mcp-b/react-components 0.20.5 → 0.22.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/{AgentActivity-D2SHSGFX.d.ts → AgentActivity-D3OvrC02.d.ts} +14 -1
- package/dist/{AgentChat-C-ZyXbJz.d.ts → AgentChat-Bm1qYbOo.d.ts} +24 -1
- package/dist/AgentChatStartScreen-DDZ25aax.d.ts +60 -0
- package/dist/{Button-yRInko9u.d.ts → Button-SBIz6Lqi.d.ts} +2 -1
- package/dist/{CodeBlock-ygtuzqJd.js → CodeBlock-Cp67Njo3.js} +1 -1
- package/dist/{CodeBlock-Bbls1CnA.d.ts → CodeBlock-yMpGqScn.d.ts} +1 -1
- package/dist/Dialog-BD8NBKaE.d.ts +122 -0
- package/dist/{FileTree-CdgfccsM.js → FileTree-DW60q1w7.js} +1 -1
- package/dist/IconButton-CFKhu6OR.d.ts +35 -0
- package/dist/{Message-DzuteocT.js → Message-_-bEYLAO.js} +9 -16
- package/dist/{ModelSelector-pecWyOFI.js → ModelSelector-Brvj9Cab.js} +15 -8
- package/dist/{PromptInput-Cq-8RoXD.d.ts → PromptInput-BjoPWaaG.d.ts} +15 -2
- package/dist/{ThinkChatActivity-CdbL0aoA.d.ts → ThinkChatActivity-2BobmuvR.d.ts} +8 -7
- package/dist/{ThinkChatActivitySummary-D1xOrNrq.d.ts → ThinkChatActivitySummary-kr5fE0wg.d.ts} +14 -5
- package/dist/{ToggleGroup-DNd6cDJZ.d.ts → ToggleGroup-BW1jrhAF.d.ts} +10 -0
- package/dist/{Workspace-CWtust-2.d.ts → Workspace-CIycQ4xE.d.ts} +1 -1
- package/dist/{WorkspaceExplorer-DGigwsgH.d.ts → WorkspaceExplorer-BCipn7Vd.d.ts} +1 -1
- package/dist/{WorkspaceFile-D8Un_xge.d.ts → WorkspaceFile-DMtRMwVv.d.ts} +1 -1
- package/dist/{WorkspaceFileView-Bxx4wEzJ.js → WorkspaceFileView-rUEN2iox.js} +4 -4
- package/dist/assets/think-browser-host.png +0 -0
- package/dist/components/ActionGuide.d.ts +85 -0
- package/dist/components/ActionGuide.js +94 -0
- package/dist/components/Activity.d.ts +33 -17
- package/dist/components/Activity.js +40 -28
- package/dist/components/AgentActivity.d.ts +1 -1
- package/dist/components/AgentActivity.js +3 -11
- package/dist/components/AgentActivityPreview.d.ts +1 -1
- package/dist/components/AgentActivityPreview.js +17 -16
- package/dist/components/AgentAttention.d.ts +1 -1
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +169 -136
- package/dist/components/AgentChatStartScreen.d.ts +2 -0
- package/dist/components/AgentChatStartScreen.js +88 -0
- package/dist/components/AgentConnection.d.ts +1 -1
- package/dist/components/AgentConnection.js +2 -2
- package/dist/components/AgentMessageParts.js +1 -1
- package/dist/components/AgentToolDetail.js +1 -1
- package/dist/components/AlertDialog.d.ts +2 -1
- package/dist/components/AlertDialog.js +8 -2
- package/dist/components/AppIcon.d.ts +58 -0
- package/dist/components/AppIcon.js +51 -0
- package/dist/components/AppTopBar.js +9 -10
- package/dist/components/Approval.js +3 -5
- package/dist/components/Artifact.d.ts +3 -7
- package/dist/components/Artifact.js +12 -18
- package/dist/components/Avatar.d.ts +7 -2
- package/dist/components/Avatar.js +4 -2
- package/dist/components/BrowserLiveView.js +6 -8
- package/dist/components/BrowserReplay.js +9 -9
- package/dist/components/BrowserRunPanel.js +2 -2
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.js +2 -2
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/Checkpoint.js +1 -1
- package/dist/components/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/CodexModelSelector.js +1 -1
- package/dist/components/Commit.d.ts +1 -1
- package/dist/components/Commit.js +3 -3
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.d.ts +3 -24
- package/dist/components/Conversation.js +6 -34
- package/dist/components/Dialog.d.ts +1 -117
- package/dist/components/Dialog.js +9 -1
- package/dist/components/EmptyState.d.ts +46 -0
- package/dist/components/EmptyState.js +50 -0
- package/dist/components/EnvironmentVariables.d.ts +1 -1
- package/dist/components/EnvironmentVariables.js +2 -2
- package/dist/components/FileTree.js +1 -1
- package/dist/components/IconButton.d.ts +1 -31
- package/dist/components/IconButton.js +2 -1
- package/dist/components/Kbd.d.ts +32 -0
- package/dist/components/Kbd.js +34 -0
- package/dist/components/McpConnectionRequest.d.ts +1 -1
- package/dist/components/McpConnectionRequest.js +1 -1
- package/dist/components/McpPluginCatalog.d.ts +86 -0
- package/dist/components/McpPluginCatalog.js +364 -0
- package/dist/components/McpServerPicker.d.ts +2 -2
- package/dist/components/McpServerPicker.js +7 -13
- package/dist/components/MediaPreviewCard.js +1 -1
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.d.ts +4 -8
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +1 -1
- package/dist/components/MessageScroller.js +1 -1
- package/dist/components/ModelSelector.d.ts +12 -6
- package/dist/components/ModelSelector.js +2 -2
- package/dist/components/Plan.js +1 -1
- package/dist/components/PricingBillingToggle.js +1 -0
- package/dist/components/PricingPlanCard.d.ts +1 -1
- package/dist/components/PricingPlanCard.js +10 -12
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +30 -12
- package/dist/components/Queue.d.ts +1 -1
- package/dist/components/Queue.js +2 -2
- package/dist/components/Reasoning.js +5 -10
- package/dist/components/ResponsiveSidebarShell.js +2 -1
- package/dist/components/SearchField.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Sources.js +1 -1
- package/dist/components/StatusPill.d.ts +43 -0
- package/dist/components/StatusPill.js +35 -0
- package/dist/components/Stepper.js +1 -1
- package/dist/components/SubagentRunIndicator.js +1 -1
- package/dist/components/SubagentRunSelector.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.d.ts +3 -3
- package/dist/components/Terminal.js +7 -8
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThemeModeControl.js +1 -1
- package/dist/components/ThinkChat.d.ts +12 -6
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +28 -16
- package/dist/components/ThinkChatActivitySummary.d.ts +2 -2
- package/dist/components/ThinkChatActivitySummary.js +67 -64
- package/dist/components/ThinkChatToolPanels.js +1 -1
- package/dist/components/ThinkExecutionDetail.js +5 -5
- package/dist/components/ThinkExecutionStatus.js +1 -1
- package/dist/components/ThinkExecutionWorkbench.js +19 -25
- package/dist/components/ThinkFullApp.d.ts +8 -4
- package/dist/components/ThinkFullApp.js +17 -2
- package/dist/components/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/ThinkRoutineBrowser.js +3 -2
- package/dist/components/ThinkRoutineForm.js +3 -3
- package/dist/components/ThinkRoutineLibrary.js +2 -2
- package/dist/components/ThinkRoutineRuns.js +4 -3
- package/dist/components/ThinkThreadPicker.js +5 -4
- package/dist/components/Toast.d.ts +12 -2
- package/dist/components/Toast.js +14 -4
- package/dist/components/ToggleGroup.d.ts +1 -1
- package/dist/components/ToggleGroup.js +54 -7
- package/dist/components/ToolInvocation.js +1 -1
- package/dist/components/Tooltip.d.ts +6 -4
- package/dist/components/Tooltip.js +11 -4
- package/dist/components/WebPreview.d.ts +13 -6
- package/dist/components/WebPreview.js +55 -50
- package/dist/components/Workspace.d.ts +1 -1
- package/dist/components/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/WorkspaceBrowser.js +1 -1
- package/dist/components/WorkspaceExplorer.d.ts +3 -3
- package/dist/components/WorkspaceExplorer.js +1 -1
- package/dist/components/WorkspaceFile.d.ts +1 -1
- package/dist/components/WorkspaceFileView.d.ts +1 -1
- package/dist/components/WorkspaceFileView.js +1 -1
- package/dist/components/WorkspaceHeader.js +1 -1
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/{copy-button-BrvQ7z4W.d.ts → copy-button-EBv_B9F6.d.ts} +2 -2
- package/dist/{copy-button-vo1paUSi.js → copy-button-TWq8nZhc.js} +8 -8
- package/dist/{icons-DyOM0EJs.js → icons-ua6f_GH3.js} +3 -2
- package/dist/{icons-DkRtZmvT.d.ts → icons-wP1yFUXF.d.ts} +6 -1
- package/dist/mcp-server-catalog-DycejaJ5.d.ts +1077 -0
- package/dist/styles/action-guide.css +128 -0
- package/dist/styles/activity-header.css +41 -10
- package/dist/styles/activity.css +26 -4
- package/dist/styles/agent-activity-preview-overlay.css +51 -12
- package/dist/styles/agent-activity-preview.css +23 -53
- package/dist/styles/agent-attention.css +2 -2
- package/dist/styles/agent-chat.css +291 -57
- package/dist/styles/agent-connection.css +8 -8
- package/dist/styles/alert-dialog.css +5 -20
- package/dist/styles/app-icon.css +122 -0
- package/dist/styles/app-top-bar.css +4 -5
- package/dist/styles/approval.css +1 -7
- package/dist/styles/artifact.css +4 -4
- package/dist/styles/avatar.css +13 -0
- package/dist/styles/base-ui-motion.css +1 -1
- package/dist/styles/base.css +94 -3
- package/dist/styles/browser-control-overlay.css +16 -7
- package/dist/styles/browser-live-view.css +5 -38
- package/dist/styles/browser-replay.css +2 -6
- package/dist/styles/browser-run-panel.css +4 -18
- package/dist/styles/button.css +17 -1
- package/dist/styles/card.css +4 -4
- package/dist/styles/chain-of-thought.css +0 -1
- package/dist/styles/chatgpt-sign-in-screen.css +7 -5
- package/dist/styles/checkbox-group.css +3 -3
- package/dist/styles/code-block.css +4 -4
- package/dist/styles/context-menu.css +1 -1
- package/dist/styles/conversation.css +7 -42
- package/dist/styles/description-list.css +4 -4
- package/dist/styles/dialog.css +22 -7
- package/dist/styles/empty-state.css +48 -0
- package/dist/styles/environment-variables.css +4 -4
- package/dist/styles/field.css +2 -2
- package/dist/styles/index.css +6 -0
- package/dist/styles/inline-citation.css +1 -1
- package/dist/styles/kbd.css +40 -0
- package/dist/styles/mcp-plugin-catalog.css +296 -0
- package/dist/styles/mcp-server-picker.css +0 -26
- package/dist/styles/media-preview-card.css +5 -3
- package/dist/styles/message-scroller.css +4 -4
- package/dist/styles/message.css +11 -6
- package/dist/styles/model-selector.css +5 -8
- package/dist/styles/popover.css +1 -1
- package/dist/styles/preview-card.css +1 -1
- package/dist/styles/prompt-input.css +44 -54
- package/dist/styles/queue.css +2 -2
- package/dist/styles/recipes.css +83 -9
- package/dist/styles/resizable-side-panel.css +1 -1
- package/dist/styles/responsive-sidebar-shell.css +19 -14
- package/dist/styles/scrollbars.css +32 -3
- package/dist/styles/search-field.css +9 -0
- package/dist/styles/sources.css +1 -1
- package/dist/styles/status-pill.css +39 -0
- package/dist/styles/stepper.css +2 -2
- package/dist/styles/streamdown.css +13 -12
- package/dist/styles/subagent-run.css +3 -3
- package/dist/styles/switch.css +1 -3
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/task.css +1 -1
- package/dist/styles/terminal.css +2 -2
- package/dist/styles/test-results.css +1 -2
- package/dist/styles/textarea.css +1 -1
- package/dist/styles/theme-mode-control.css +1 -1
- package/dist/styles/think-execution-status.css +4 -23
- package/dist/styles/think-execution-workbench.css +2 -3
- package/dist/styles/think-full-app.css +24 -4
- package/dist/styles/think-routine-library.css +14 -16
- package/dist/styles/think-thread-picker.css +9 -26
- package/dist/styles/toast.css +2 -23
- package/dist/styles/toggle-group.css +76 -3
- package/dist/styles/tooltip.css +1 -2
- package/dist/styles/utilities.css +73 -0
- package/dist/styles/web-preview.css +5 -0
- package/dist/styles/workspace-explorer.css +4 -6
- package/dist/utils/favicon.d.ts +10 -0
- package/dist/utils/favicon.js +18 -0
- package/dist/utils/mcp-server-catalog.d.ts +2 -1078
- package/dist/utils/mcp-server-catalog.js +3 -11
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Button } from "./Button.js";
|
|
3
|
+
import { B as PencilIcon, H as PlusIcon, L as MoveToFrontIcon, Q as TrashIcon, U as QueueIcon, W as RefreshIcon } from "../icons-ua6f_GH3.js";
|
|
4
|
+
import { IconButton } from "./IconButton.js";
|
|
5
|
+
import { n as MessageAction, r as MessageActions, t as Message } from "../Message-_-bEYLAO.js";
|
|
4
6
|
import { AgentMessageParts } from "./AgentMessageParts.js";
|
|
5
7
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "./Context.js";
|
|
8
|
+
import { EmptyState } from "./EmptyState.js";
|
|
6
9
|
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
7
|
-
import {
|
|
10
|
+
import { Menu } from "./Menu.js";
|
|
11
|
+
import { PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger, PromptInputApproval, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputCommandComposer, PromptInputContextSelector, PromptInputDictation, PromptInputFooter, PromptInputHeader, PromptInputPermissionSelector, PromptInputReferences, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PromptInputTray, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals, usePromptInputAttachments } from "./PromptInput.js";
|
|
12
|
+
import { AgentChatStartScreen } from "./AgentChatStartScreen.js";
|
|
8
13
|
import { AgentChatMessageEditor } from "./AgentChatMessageEditor.js";
|
|
9
14
|
import { Marker, MarkerContent } from "./Marker.js";
|
|
10
|
-
import { Menu } from "./Menu.js";
|
|
11
15
|
import { TransitionSurface } from "./TransitionSurface.js";
|
|
12
|
-
import {
|
|
13
|
-
import { t as CopyButton } from "../copy-button-vo1paUSi.js";
|
|
16
|
+
import { t as CopyButton } from "../copy-button-TWq8nZhc.js";
|
|
14
17
|
import * as React from "react";
|
|
15
18
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
19
|
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
@@ -27,11 +30,23 @@ import { isReasoningUIPart, isTextUIPart } from "ai";
|
|
|
27
30
|
function observeAgentChatComposer(element) {
|
|
28
31
|
if (!element || typeof ResizeObserver === "undefined") return;
|
|
29
32
|
const root = element.parentElement;
|
|
33
|
+
let written;
|
|
34
|
+
let frame = 0;
|
|
30
35
|
const observer = new ResizeObserver(() => {
|
|
31
|
-
|
|
36
|
+
if (frame) return;
|
|
37
|
+
frame = requestAnimationFrame(() => {
|
|
38
|
+
frame = 0;
|
|
39
|
+
const size = `${element.offsetHeight}px`;
|
|
40
|
+
if (size === written) return;
|
|
41
|
+
written = size;
|
|
42
|
+
root?.style.setProperty("--agent-chat-composer-size", size);
|
|
43
|
+
});
|
|
32
44
|
});
|
|
33
45
|
observer.observe(element);
|
|
34
|
-
return () =>
|
|
46
|
+
return () => {
|
|
47
|
+
cancelAnimationFrame(frame);
|
|
48
|
+
observer.disconnect();
|
|
49
|
+
};
|
|
35
50
|
}
|
|
36
51
|
const EMPTY_PENDING_APPROVALS = [];
|
|
37
52
|
const EMPTY_SKIPPED_APPROVAL_IDS = [];
|
|
@@ -108,7 +123,7 @@ function getEditableUserText(message) {
|
|
|
108
123
|
* transport. Product code that talks to a Cloudflare Think agent should render
|
|
109
124
|
* `ThinkChat`; use this directly only for plain AI SDK or read-only messages.
|
|
110
125
|
*/
|
|
111
|
-
function AgentChat({ className, messages, status = "ready", onSubmit, showComposer = onSubmit !== void 0, onStop, placeholder = "Ask anything...", disabled, emptyState, composerHeader, composerTools, slashCommands, mentionCommands, contextSelector, composerEndTools, voiceInput, beforeVoiceStart, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, approvalsEnabled = true, permissionModeControl, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, ref }) {
|
|
126
|
+
function AgentChat({ className, messages, status = "ready", onSubmit, showComposer = onSubmit !== void 0, onStop, placeholder = "Ask anything...", disabled, emptyState, startScreen, composerHeader, composerTools, slashCommands, mentionCommands, contextSelector, composerEndTools, voiceInput, beforeVoiceStart, composerAddMenuItems, notice, onRegenerate, onEditAndResend, onApprovalResponse, thinkStub, approvalsEnabled = true, permissionModeControl, onExecutionSettled, pendingApprovals: durableApprovals = EMPTY_PENDING_APPROVALS, contextWindow, renderPart, renderMessageAfter, showAssistantActions, isMessageScrollAnchor, ref }) {
|
|
112
127
|
const [copyAnnouncement, setCopyAnnouncement] = React.useState("");
|
|
113
128
|
const [composerDraft, setComposerDraft] = React.useState("");
|
|
114
129
|
const [composerReferences, setComposerReferences] = React.useState([]);
|
|
@@ -286,6 +301,137 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
286
301
|
editButtonRef.current?.focus();
|
|
287
302
|
restoreEditFocus.current = false;
|
|
288
303
|
}, [editingMessageId]);
|
|
304
|
+
const composer = showComposer ? /* @__PURE__ */ jsxs("div", {
|
|
305
|
+
ref: observeAgentChatComposer,
|
|
306
|
+
className: "agent-chat__composer",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ jsx("div", {
|
|
309
|
+
className: "agent-chat__notice",
|
|
310
|
+
role: "status",
|
|
311
|
+
"aria-atomic": "true",
|
|
312
|
+
children: notice
|
|
313
|
+
}),
|
|
314
|
+
pendingPrompts.length ? /* @__PURE__ */ jsx(PromptInputTray, {
|
|
315
|
+
side: "top",
|
|
316
|
+
className: "agent-chat__queued",
|
|
317
|
+
role: "region",
|
|
318
|
+
"aria-label": "Queued messages",
|
|
319
|
+
children: /* @__PURE__ */ jsx("ul", {
|
|
320
|
+
className: "agent-chat__queued-list",
|
|
321
|
+
children: pendingPrompts.map((pending) => {
|
|
322
|
+
const messageText = pending.message.text || "Queued message";
|
|
323
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
324
|
+
className: "agent-chat__queued-message",
|
|
325
|
+
children: [
|
|
326
|
+
/* @__PURE__ */ jsx("span", {
|
|
327
|
+
className: "agent-chat__queued-indicator",
|
|
328
|
+
"aria-hidden": "true",
|
|
329
|
+
children: /* @__PURE__ */ jsx(QueueIcon, {})
|
|
330
|
+
}),
|
|
331
|
+
/* @__PURE__ */ jsx("span", {
|
|
332
|
+
className: "agent-chat__queued-text sigvelo-truncate sigvelo-truncate-grow",
|
|
333
|
+
children: messageText
|
|
334
|
+
}),
|
|
335
|
+
/* @__PURE__ */ jsxs(Button, {
|
|
336
|
+
className: "agent-chat__queued-action",
|
|
337
|
+
"aria-label": `Move queued message to front: ${messageText}`,
|
|
338
|
+
color: "neutral",
|
|
339
|
+
size: "xs",
|
|
340
|
+
variant: "ghost",
|
|
341
|
+
onClick: () => setPendingPrompts((current) => [pending, ...current.filter((item) => item !== pending)]),
|
|
342
|
+
children: [/* @__PURE__ */ jsx(MoveToFrontIcon, {}), "Move to front"]
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
345
|
+
className: "agent-chat__queued-action agent-chat__queued-remove",
|
|
346
|
+
color: "neutral",
|
|
347
|
+
label: `Remove queued message: ${messageText}`,
|
|
348
|
+
size: "xs",
|
|
349
|
+
variant: "ghost",
|
|
350
|
+
onClick: () => setPendingPrompts((current) => current.filter((item) => item !== pending)),
|
|
351
|
+
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
352
|
+
})
|
|
353
|
+
]
|
|
354
|
+
}, pending.id);
|
|
355
|
+
})
|
|
356
|
+
})
|
|
357
|
+
}) : null,
|
|
358
|
+
/* @__PURE__ */ jsx(PromptInput, {
|
|
359
|
+
multiple: true,
|
|
360
|
+
onSubmit: handleSubmit,
|
|
361
|
+
children: pendingApproval ? /* @__PURE__ */ jsx(PromptInputApproval, {
|
|
362
|
+
part: "part" in pendingApproval ? pendingApproval.part : void 0,
|
|
363
|
+
approval: "approval" in pendingApproval ? pendingApproval.approval : void 0,
|
|
364
|
+
count: pendingApprovalItems.length,
|
|
365
|
+
onRespond: onApprovalResponse,
|
|
366
|
+
thinkStub,
|
|
367
|
+
onExecutionSettled,
|
|
368
|
+
onSkip: () => {
|
|
369
|
+
const id = "part" in pendingApproval ? getApprovalStateKey(pendingApproval.part) : pendingApproval.approval.executionId;
|
|
370
|
+
if (id) updateApprovalSession((current) => ({
|
|
371
|
+
...current,
|
|
372
|
+
skippedApprovalIds: [...current.skippedApprovalIds, id]
|
|
373
|
+
}));
|
|
374
|
+
}
|
|
375
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
376
|
+
composerHeader ? /* @__PURE__ */ jsx(PromptInputHeader, { children: composerHeader }) : null,
|
|
377
|
+
/* @__PURE__ */ jsx(PromptInputAttachments, {}),
|
|
378
|
+
/* @__PURE__ */ jsxs(PromptInputBody, { children: [/* @__PURE__ */ jsx(PromptInputReferences, {
|
|
379
|
+
references: composerReferences,
|
|
380
|
+
onRemove: removeComposerReference
|
|
381
|
+
}), slashCommands || mentionCommands ? /* @__PURE__ */ jsx(PromptInputCommandComposer, {
|
|
382
|
+
"aria-label": "Message",
|
|
383
|
+
placeholder: composerReferences.length ? "" : placeholder,
|
|
384
|
+
disabled,
|
|
385
|
+
commands: slashCommands?.items ?? [],
|
|
386
|
+
mentionCommands: mentionCommands?.items,
|
|
387
|
+
value: composerDraft,
|
|
388
|
+
onValueChange: setComposerDraft,
|
|
389
|
+
onCommandSelect: selectComposerCommand
|
|
390
|
+
}) : /* @__PURE__ */ jsx(PromptInputTextarea, {
|
|
391
|
+
"aria-label": "Message",
|
|
392
|
+
placeholder,
|
|
393
|
+
disabled,
|
|
394
|
+
value: composerDraft,
|
|
395
|
+
onChange: (event) => setComposerDraft(event.currentTarget.value)
|
|
396
|
+
})] }),
|
|
397
|
+
/* @__PURE__ */ jsxs(PromptInputFooter, { children: [/* @__PURE__ */ jsxs(PromptInputTools, { children: [
|
|
398
|
+
/* @__PURE__ */ jsx(AgentChatAddMenu, { children: composerAddMenuItems }),
|
|
399
|
+
contextSelector ? /* @__PURE__ */ jsx(PromptInputContextSelector, { ...contextSelector }) : null,
|
|
400
|
+
approvalsWired ? /* @__PURE__ */ jsx(PromptInputPermissionSelector, {
|
|
401
|
+
value: permissionMode,
|
|
402
|
+
onValueChange: setPermissionMode
|
|
403
|
+
}) : null,
|
|
404
|
+
composerTools
|
|
405
|
+
] }), /* @__PURE__ */ jsxs("div", {
|
|
406
|
+
className: "prompt-input__footer-end",
|
|
407
|
+
children: [
|
|
408
|
+
composerEndTools,
|
|
409
|
+
voiceInput ? /* @__PURE__ */ jsx(PromptInputDictation, {
|
|
410
|
+
voice: voiceInput,
|
|
411
|
+
beforeStart: beforeVoiceStart,
|
|
412
|
+
disabled
|
|
413
|
+
}) : null,
|
|
414
|
+
contextWindow ? /* @__PURE__ */ jsxs(Context, {
|
|
415
|
+
usedTokens: getContextUsedTokens(contextUsage),
|
|
416
|
+
maxTokens: contextWindow.maxTokens,
|
|
417
|
+
usage: contextUsage,
|
|
418
|
+
modelId: contextWindow.modelId,
|
|
419
|
+
children: [/* @__PURE__ */ jsx(ContextTrigger, {}), /* @__PURE__ */ jsxs(ContextContent, { children: [/* @__PURE__ */ jsx(ContextContentHeader, {}), /* @__PURE__ */ jsx(ContextContentBody, {})] })]
|
|
420
|
+
}) : null,
|
|
421
|
+
/* @__PURE__ */ jsx(AgentChatSubmitAction, {
|
|
422
|
+
status,
|
|
423
|
+
onStop,
|
|
424
|
+
disabled,
|
|
425
|
+
hasDraft: Boolean(composerDraft.trim() || composerReferences.length)
|
|
426
|
+
})
|
|
427
|
+
]
|
|
428
|
+
})] })
|
|
429
|
+
] })
|
|
430
|
+
})
|
|
431
|
+
]
|
|
432
|
+
}) : null;
|
|
433
|
+
const showsStartScreen = messages.length === 0 && showComposer && startScreen !== false && (startScreen !== void 0 || emptyState === void 0);
|
|
434
|
+
const startScreenProps = startScreen && typeof startScreen === "object" ? startScreen : void 0;
|
|
289
435
|
return /* @__PURE__ */ jsxs(TransitionSurface, {
|
|
290
436
|
ref,
|
|
291
437
|
variant: "fade",
|
|
@@ -298,7 +444,10 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
298
444
|
"aria-atomic": "true",
|
|
299
445
|
children: copyAnnouncement
|
|
300
446
|
}),
|
|
301
|
-
/* @__PURE__ */ jsx(
|
|
447
|
+
showsStartScreen ? /* @__PURE__ */ jsx(AgentChatStartScreen, {
|
|
448
|
+
...startScreenProps,
|
|
449
|
+
composer
|
|
450
|
+
}) : /* @__PURE__ */ jsx(MessageScrollerProvider, {
|
|
302
451
|
autoScroll: true,
|
|
303
452
|
defaultScrollPosition: "last-anchor",
|
|
304
453
|
children: /* @__PURE__ */ jsxs(MessageScroller, {
|
|
@@ -308,13 +457,16 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
308
457
|
className: "agent-chat__transcript-content",
|
|
309
458
|
children: [messages.length === 0 ? /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
310
459
|
className: "conversation__empty-row",
|
|
311
|
-
children: emptyState ?? /* @__PURE__ */ jsx(
|
|
460
|
+
children: emptyState ?? /* @__PURE__ */ jsx(EmptyState, {
|
|
312
461
|
title: "Start a conversation",
|
|
313
462
|
description: "Ask the agent to inspect, plan, or build."
|
|
314
463
|
})
|
|
315
464
|
}) : null, messages.map((message, messageIndex) => /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
316
465
|
messageId: message.id,
|
|
317
|
-
scrollAnchor:
|
|
466
|
+
scrollAnchor: isMessageScrollAnchor?.({
|
|
467
|
+
message,
|
|
468
|
+
messageIndex
|
|
469
|
+
}) ?? message.role === "user",
|
|
318
470
|
children: isCompactionMessage(message) ? /* @__PURE__ */ jsx(Marker, {
|
|
319
471
|
variant: "separator",
|
|
320
472
|
children: /* @__PURE__ */ jsx(MarkerContent, { children: getMessageText(message) || "Conversation compacted" })
|
|
@@ -355,7 +507,10 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
355
507
|
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
356
508
|
})
|
|
357
509
|
}) : null,
|
|
358
|
-
message.role === "assistant"
|
|
510
|
+
message.role === "assistant" && (showAssistantActions?.({
|
|
511
|
+
message,
|
|
512
|
+
messageIndex
|
|
513
|
+
}) ?? true) ? /* @__PURE__ */ jsx(AgentChatAssistantActions, {
|
|
359
514
|
message,
|
|
360
515
|
responseNumber: assistantResponseNumbers[messageIndex],
|
|
361
516
|
showCopy: messageIndex !== newestAssistantIndex || status !== "streaming" && status !== "submitted",
|
|
@@ -373,129 +528,7 @@ function AgentChat({ className, messages, status = "ready", onSubmit, showCompos
|
|
|
373
528
|
})]
|
|
374
529
|
})
|
|
375
530
|
}),
|
|
376
|
-
|
|
377
|
-
ref: observeAgentChatComposer,
|
|
378
|
-
className: "agent-chat__composer",
|
|
379
|
-
children: [
|
|
380
|
-
/* @__PURE__ */ jsx("div", {
|
|
381
|
-
className: "agent-chat__notice",
|
|
382
|
-
role: "status",
|
|
383
|
-
"aria-atomic": "true",
|
|
384
|
-
children: notice
|
|
385
|
-
}),
|
|
386
|
-
pendingPrompts.length ? /* @__PURE__ */ jsx("section", {
|
|
387
|
-
className: "agent-chat__queued",
|
|
388
|
-
"aria-label": "Queued messages",
|
|
389
|
-
children: /* @__PURE__ */ jsx("ul", {
|
|
390
|
-
className: "agent-chat__queued-list",
|
|
391
|
-
children: pendingPrompts.map((pending) => {
|
|
392
|
-
const messageText = pending.message.text || "Queued message";
|
|
393
|
-
return /* @__PURE__ */ jsxs("li", {
|
|
394
|
-
className: "agent-chat__queued-message",
|
|
395
|
-
children: [
|
|
396
|
-
/* @__PURE__ */ jsx("span", {
|
|
397
|
-
className: "agent-chat__queued-indicator",
|
|
398
|
-
"aria-hidden": "true",
|
|
399
|
-
children: /* @__PURE__ */ jsx(QueueIcon, {})
|
|
400
|
-
}),
|
|
401
|
-
/* @__PURE__ */ jsx("span", {
|
|
402
|
-
className: "agent-chat__queued-text sigvelo-truncate sigvelo-truncate-grow",
|
|
403
|
-
children: messageText
|
|
404
|
-
}),
|
|
405
|
-
/* @__PURE__ */ jsxs("button", {
|
|
406
|
-
type: "button",
|
|
407
|
-
className: "agent-chat__queued-action",
|
|
408
|
-
"aria-label": `Move queued message to front: ${messageText}`,
|
|
409
|
-
onClick: () => setPendingPrompts((current) => [pending, ...current.filter((item) => item !== pending)]),
|
|
410
|
-
children: [/* @__PURE__ */ jsx(MoveToFrontIcon, {}), "Move to front"]
|
|
411
|
-
}),
|
|
412
|
-
/* @__PURE__ */ jsx("button", {
|
|
413
|
-
type: "button",
|
|
414
|
-
className: "agent-chat__queued-action agent-chat__queued-remove",
|
|
415
|
-
"aria-label": `Remove queued message: ${messageText}`,
|
|
416
|
-
onClick: () => setPendingPrompts((current) => current.filter((item) => item !== pending)),
|
|
417
|
-
children: /* @__PURE__ */ jsx(TrashIcon, {})
|
|
418
|
-
})
|
|
419
|
-
]
|
|
420
|
-
}, pending.id);
|
|
421
|
-
})
|
|
422
|
-
})
|
|
423
|
-
}) : null,
|
|
424
|
-
/* @__PURE__ */ jsx(PromptInput, {
|
|
425
|
-
multiple: true,
|
|
426
|
-
onSubmit: handleSubmit,
|
|
427
|
-
children: pendingApproval ? /* @__PURE__ */ jsx(PromptInputApproval, {
|
|
428
|
-
part: "part" in pendingApproval ? pendingApproval.part : void 0,
|
|
429
|
-
approval: "approval" in pendingApproval ? pendingApproval.approval : void 0,
|
|
430
|
-
count: pendingApprovalItems.length,
|
|
431
|
-
onRespond: onApprovalResponse,
|
|
432
|
-
thinkStub,
|
|
433
|
-
onExecutionSettled,
|
|
434
|
-
onSkip: () => {
|
|
435
|
-
const id = "part" in pendingApproval ? getApprovalStateKey(pendingApproval.part) : pendingApproval.approval.executionId;
|
|
436
|
-
if (id) updateApprovalSession((current) => ({
|
|
437
|
-
...current,
|
|
438
|
-
skippedApprovalIds: [...current.skippedApprovalIds, id]
|
|
439
|
-
}));
|
|
440
|
-
}
|
|
441
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
442
|
-
composerHeader ? /* @__PURE__ */ jsx(PromptInputHeader, { children: composerHeader }) : null,
|
|
443
|
-
/* @__PURE__ */ jsx(PromptInputAttachments, {}),
|
|
444
|
-
/* @__PURE__ */ jsxs(PromptInputBody, { children: [/* @__PURE__ */ jsx(PromptInputReferences, {
|
|
445
|
-
references: composerReferences,
|
|
446
|
-
onRemove: removeComposerReference
|
|
447
|
-
}), slashCommands || mentionCommands ? /* @__PURE__ */ jsx(PromptInputCommandComposer, {
|
|
448
|
-
"aria-label": "Message",
|
|
449
|
-
placeholder: composerReferences.length ? "" : placeholder,
|
|
450
|
-
disabled,
|
|
451
|
-
commands: slashCommands?.items ?? [],
|
|
452
|
-
mentionCommands: mentionCommands?.items,
|
|
453
|
-
value: composerDraft,
|
|
454
|
-
onValueChange: setComposerDraft,
|
|
455
|
-
onCommandSelect: selectComposerCommand
|
|
456
|
-
}) : /* @__PURE__ */ jsx(PromptInputTextarea, {
|
|
457
|
-
"aria-label": "Message",
|
|
458
|
-
placeholder,
|
|
459
|
-
disabled,
|
|
460
|
-
value: composerDraft,
|
|
461
|
-
onChange: (event) => setComposerDraft(event.currentTarget.value)
|
|
462
|
-
})] }),
|
|
463
|
-
/* @__PURE__ */ jsxs(PromptInputFooter, { children: [/* @__PURE__ */ jsxs(PromptInputTools, { children: [
|
|
464
|
-
/* @__PURE__ */ jsx(AgentChatAddMenu, { children: composerAddMenuItems }),
|
|
465
|
-
contextSelector ? /* @__PURE__ */ jsx(PromptInputContextSelector, { ...contextSelector }) : null,
|
|
466
|
-
approvalsWired ? /* @__PURE__ */ jsx(PromptInputPermissionSelector, {
|
|
467
|
-
value: permissionMode,
|
|
468
|
-
onValueChange: setPermissionMode
|
|
469
|
-
}) : null,
|
|
470
|
-
composerTools
|
|
471
|
-
] }), /* @__PURE__ */ jsxs("div", {
|
|
472
|
-
className: "prompt-input__footer-end",
|
|
473
|
-
children: [
|
|
474
|
-
composerEndTools,
|
|
475
|
-
voiceInput ? /* @__PURE__ */ jsx(PromptInputDictation, {
|
|
476
|
-
voice: voiceInput,
|
|
477
|
-
beforeStart: beforeVoiceStart,
|
|
478
|
-
disabled
|
|
479
|
-
}) : null,
|
|
480
|
-
contextWindow ? /* @__PURE__ */ jsxs(Context, {
|
|
481
|
-
usedTokens: getContextUsedTokens(contextUsage),
|
|
482
|
-
maxTokens: contextWindow.maxTokens,
|
|
483
|
-
usage: contextUsage,
|
|
484
|
-
modelId: contextWindow.modelId,
|
|
485
|
-
children: [/* @__PURE__ */ jsx(ContextTrigger, {}), /* @__PURE__ */ jsxs(ContextContent, { children: [/* @__PURE__ */ jsx(ContextContentHeader, {}), /* @__PURE__ */ jsx(ContextContentBody, {})] })]
|
|
486
|
-
}) : null,
|
|
487
|
-
/* @__PURE__ */ jsx(AgentChatSubmitAction, {
|
|
488
|
-
status,
|
|
489
|
-
onStop,
|
|
490
|
-
disabled,
|
|
491
|
-
hasDraft: Boolean(composerDraft.trim() || composerReferences.length)
|
|
492
|
-
})
|
|
493
|
-
]
|
|
494
|
-
})] })
|
|
495
|
-
] })
|
|
496
|
-
})
|
|
497
|
-
]
|
|
498
|
-
}) : null
|
|
531
|
+
showsStartScreen ? null : composer
|
|
499
532
|
]
|
|
500
533
|
});
|
|
501
534
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as AgentChatStarterListProps, i as AgentChatStarterList, n as AgentChatStartScreenProps, o as AgentChatStarterProps, r as AgentChatStarter, t as AgentChatStartScreen } from "../AgentChatStartScreen-DDZ25aax.js";
|
|
2
|
+
export { AgentChatStartScreen, AgentChatStartScreenProps, AgentChatStarter, AgentChatStarterList, AgentChatStarterListProps, AgentChatStarterProps };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { Button } from "./Button.js";
|
|
3
|
+
import { tt as XIcon } from "../icons-ua6f_GH3.js";
|
|
4
|
+
import { IconButton } from "./IconButton.js";
|
|
5
|
+
import { PromptInputTray } from "./PromptInput.js";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/AgentChatStartScreen.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Welcoming first-turn layout for `AgentChat` and `ThinkChat`.
|
|
11
|
+
*
|
|
12
|
+
* `AgentChat` normally creates this component through its `startScreen` prop so
|
|
13
|
+
* the same live composer moves from the center of the empty view to the pinned
|
|
14
|
+
* transcript position after the first message.
|
|
15
|
+
*/
|
|
16
|
+
function AgentChatStartScreen({ heading = "What should we work on?", composer, composerTray, children, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }) {
|
|
17
|
+
const headingId = React.useId();
|
|
18
|
+
return /* @__PURE__ */ jsx("section", {
|
|
19
|
+
"data-slot": "agent-chat-start-screen",
|
|
20
|
+
className: cx("agent-chat-start-screen", className),
|
|
21
|
+
"aria-label": ariaLabel,
|
|
22
|
+
"aria-labelledby": ariaLabel ? void 0 : ariaLabelledBy ?? (heading ? headingId : void 0),
|
|
23
|
+
...props,
|
|
24
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "agent-chat-start-screen__content",
|
|
26
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
27
|
+
className: "agent-chat-start-screen__primary",
|
|
28
|
+
children: [heading ? /* @__PURE__ */ jsx("h2", {
|
|
29
|
+
id: headingId,
|
|
30
|
+
className: "agent-chat-start-screen__heading",
|
|
31
|
+
children: heading
|
|
32
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "agent-chat-start-screen__composer",
|
|
34
|
+
children: [composer, composerTray ? /* @__PURE__ */ jsx(PromptInputTray, {
|
|
35
|
+
side: "bottom",
|
|
36
|
+
className: "agent-chat-start-screen__composer-tray",
|
|
37
|
+
children: composerTray
|
|
38
|
+
}) : null]
|
|
39
|
+
})]
|
|
40
|
+
}), children ? /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: "agent-chat-start-screen__starters",
|
|
42
|
+
children
|
|
43
|
+
}) : null]
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** Semantic list for first-turn prompts below an `AgentChatStartScreen`. */
|
|
48
|
+
function AgentChatStarterList({ className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
50
|
+
"data-slot": "agent-chat-starter-list",
|
|
51
|
+
role: "list",
|
|
52
|
+
className: cx("agent-chat-starter-list", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** One full-width, keyboard-native starter prompt. */
|
|
57
|
+
function AgentChatStarter({ icon, muted = false, onDismiss, dismissLabel, children, className, type = "button", ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
59
|
+
"data-slot": "agent-chat-starter",
|
|
60
|
+
className: "agent-chat-starter",
|
|
61
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
62
|
+
...props,
|
|
63
|
+
type,
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
color: "neutral",
|
|
66
|
+
className: cx("agent-chat-starter__action", className),
|
|
67
|
+
"data-muted": muted ? "" : void 0,
|
|
68
|
+
children: [icon ? /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "agent-chat-starter__icon",
|
|
70
|
+
"aria-hidden": "true",
|
|
71
|
+
children: icon
|
|
72
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "agent-chat-starter__label",
|
|
74
|
+
children
|
|
75
|
+
})]
|
|
76
|
+
}), onDismiss ? /* @__PURE__ */ jsx(IconButton, {
|
|
77
|
+
label: dismissLabel ?? "Dismiss suggestion",
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
color: "neutral",
|
|
80
|
+
size: "lg",
|
|
81
|
+
className: "agent-chat-starter__dismiss",
|
|
82
|
+
onClick: onDismiss,
|
|
83
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
84
|
+
}) : null]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
export { AgentChatStartScreen, AgentChatStarter, AgentChatStarterList };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as McpServerSetupAuthFieldName, l as McpServerSetupAuth } from "../mcp-server-catalog-DycejaJ5.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/AgentConnection.d.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
-
import { O as LinkIcon } from "../icons-DyOM0EJs.js";
|
|
3
2
|
import { Button } from "./Button.js";
|
|
3
|
+
import { k as LinkIcon } from "../icons-ua6f_GH3.js";
|
|
4
4
|
import { Popover } from "./Popover.js";
|
|
5
5
|
import { Field } from "./Field.js";
|
|
6
6
|
import { Form } from "./Form.js";
|
|
7
|
-
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-
|
|
7
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, n as CodeBlockActions, p as CodeBlockTitle, r as CodeBlockContainer, s as CodeBlockHeader, t as CodeBlock } from "../CodeBlock-Cp67Njo3.js";
|
|
8
8
|
import { CUSTOM_MCP_SERVER_CARD } from "../utils/mcp-server-catalog.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as MessageContent, f as MessageResponse, i as MessageAttachment } from "../Message-
|
|
1
|
+
import { d as MessageContent, f as MessageResponse, i as MessageAttachment } from "../Message-_-bEYLAO.js";
|
|
2
2
|
import { Reasoning, ReasoningContent, ReasoningTrigger } from "./Reasoning.js";
|
|
3
3
|
import { Source, Sources, SourcesContent, SourcesTrigger } from "./Sources.js";
|
|
4
4
|
import { ToolInvocation } from "./ToolInvocation.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-BiMDVpUo.js";
|
|
2
|
-
import { r as ArrowLeftIcon } from "../icons-
|
|
2
|
+
import { r as ArrowLeftIcon } from "../icons-ua6f_GH3.js";
|
|
3
3
|
import { TransitionSurface } from "./TransitionSurface.js";
|
|
4
4
|
import { AppTopBar } from "./AppTopBar.js";
|
|
5
5
|
import { NaniteMark } from "./NaniteScene.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ButtonVariant, i as ButtonSize, n as ButtonColor } from "../Button-
|
|
1
|
+
import { a as ButtonVariant, i as ButtonSize, n as ButtonColor } from "../Button-SBIz6Lqi.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
4
4
|
|
|
@@ -70,6 +70,7 @@ interface AlertDialogMediaProps extends React.HTMLAttributes<HTMLDivElement> {}
|
|
|
70
70
|
* @see {@link https://base-ui.com/react/components/alert-dialog | Base UI Alert Dialog}
|
|
71
71
|
*/
|
|
72
72
|
declare function AlertDialogTrigger({
|
|
73
|
+
render,
|
|
73
74
|
className,
|
|
74
75
|
ref,
|
|
75
76
|
...props
|
|
@@ -32,11 +32,17 @@ import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
|
|
|
32
32
|
*
|
|
33
33
|
* @see {@link https://base-ui.com/react/components/alert-dialog | Base UI Alert Dialog}
|
|
34
34
|
*/
|
|
35
|
-
function AlertDialogTrigger({ className, ref, ...props }) {
|
|
36
|
-
const classes = mergeBaseClassName(
|
|
35
|
+
function AlertDialogTrigger({ render, className, ref, ...props }) {
|
|
36
|
+
const classes = mergeBaseClassName(render == null ? buttonVariants({
|
|
37
|
+
variant: "normal",
|
|
38
|
+
color: "primary",
|
|
39
|
+
size: "sm",
|
|
40
|
+
className: "alert-dialog__trigger"
|
|
41
|
+
}) : "alert-dialog__trigger", className);
|
|
37
42
|
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, {
|
|
38
43
|
ref,
|
|
39
44
|
"data-slot": "alert-dialog-trigger",
|
|
45
|
+
render,
|
|
40
46
|
className: classes,
|
|
41
47
|
...props
|
|
42
48
|
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AvatarFallbackProps, AvatarImageProps, AvatarRootProps } from "./Avatar.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/AppIcon.d.ts
|
|
5
|
+
type AppIconSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
+
type AppIconVariant = "artwork" | "surface" | "contrast";
|
|
7
|
+
interface AppIconRootProps extends Omit<AvatarRootProps, "shape" | "size"> {
|
|
8
|
+
size?: AppIconSize;
|
|
9
|
+
/** Artwork fills the tile; surface and contrast variants inset a standalone mark. */
|
|
10
|
+
variant?: AppIconVariant;
|
|
11
|
+
}
|
|
12
|
+
interface AppIconImageProps extends AvatarImageProps {}
|
|
13
|
+
interface AppIconFallbackProps extends AvatarFallbackProps {}
|
|
14
|
+
interface AppIconStackProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
15
|
+
/** Rounded app artwork with Base UI's image-loading fallback behavior. */
|
|
16
|
+
declare function AppIconRoot({
|
|
17
|
+
className,
|
|
18
|
+
size,
|
|
19
|
+
variant,
|
|
20
|
+
ref,
|
|
21
|
+
...props
|
|
22
|
+
}: AppIconRootProps & {
|
|
23
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
24
|
+
}): React.JSX.Element;
|
|
25
|
+
/** App artwork or a resolved favicon, with lazy, async, no-referrer loading defaults. */
|
|
26
|
+
declare function AppIconImage({
|
|
27
|
+
className,
|
|
28
|
+
decoding,
|
|
29
|
+
loading,
|
|
30
|
+
ref,
|
|
31
|
+
referrerPolicy,
|
|
32
|
+
...props
|
|
33
|
+
}: AppIconImageProps & {
|
|
34
|
+
ref?: React.Ref<HTMLImageElement>;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
declare function AppIconFallback({
|
|
37
|
+
className,
|
|
38
|
+
ref,
|
|
39
|
+
...props
|
|
40
|
+
}: AppIconFallbackProps & {
|
|
41
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
42
|
+
}): React.JSX.Element;
|
|
43
|
+
/** Overlapping app marks; the first mark remains visually on top. */
|
|
44
|
+
declare function AppIconStack({
|
|
45
|
+
className,
|
|
46
|
+
ref,
|
|
47
|
+
...props
|
|
48
|
+
}: AppIconStackProps & {
|
|
49
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
50
|
+
}): React.JSX.Element;
|
|
51
|
+
declare const AppIcon: {
|
|
52
|
+
Root: typeof AppIconRoot;
|
|
53
|
+
Image: typeof AppIconImage;
|
|
54
|
+
Fallback: typeof AppIconFallback;
|
|
55
|
+
Stack: typeof AppIconStack;
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { AppIcon, AppIconFallbackProps, AppIconImageProps, AppIconRootProps, AppIconSize, AppIconStackProps, AppIconVariant };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { n as mergeBaseClassName } from "../class-names-BiMDVpUo.js";
|
|
2
|
+
import { Avatar } from "./Avatar.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/AppIcon.tsx
|
|
6
|
+
/** Rounded app artwork with Base UI's image-loading fallback behavior. */
|
|
7
|
+
function AppIconRoot({ className, size = "md", variant = "artwork", ref, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Avatar.Root, {
|
|
9
|
+
ref,
|
|
10
|
+
className: mergeBaseClassName("app-icon", className),
|
|
11
|
+
"data-app-icon-size": size,
|
|
12
|
+
"data-app-icon-variant": variant,
|
|
13
|
+
shape: "rounded",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** App artwork or a resolved favicon, with lazy, async, no-referrer loading defaults. */
|
|
18
|
+
function AppIconImage({ className, decoding = "async", loading = "lazy", ref, referrerPolicy = "no-referrer", ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Avatar.Image, {
|
|
20
|
+
ref,
|
|
21
|
+
className: mergeBaseClassName("app-icon__image", className),
|
|
22
|
+
decoding,
|
|
23
|
+
loading,
|
|
24
|
+
referrerPolicy,
|
|
25
|
+
...props
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function AppIconFallback({ className, ref, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(Avatar.Fallback, {
|
|
30
|
+
ref,
|
|
31
|
+
className: mergeBaseClassName("app-icon__fallback", className),
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Overlapping app marks; the first mark remains visually on top. */
|
|
36
|
+
function AppIconStack({ className, ref, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx("span", {
|
|
38
|
+
ref,
|
|
39
|
+
"data-slot": "app-icon-stack",
|
|
40
|
+
className: mergeBaseClassName("app-icon-stack", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
const AppIcon = {
|
|
45
|
+
Root: AppIconRoot,
|
|
46
|
+
Image: AppIconImage,
|
|
47
|
+
Fallback: AppIconFallback,
|
|
48
|
+
Stack: AppIconStack
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { AppIcon };
|