@mcp-b/react-components 0.30.1 → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeBlock-B5I7wje1.js → CodeBlock-CM5gfmdq.js} +1 -1
- package/dist/{FileTree-DbQMpvxV.js → FileTree-4WP4Uc_m.js} +1 -1
- package/dist/{MenuDisclosureGroup-BUOZ42me.js → MenuDisclosureGroup-yJRq7YXa.js} +1 -1
- package/dist/{ModelSelector-DZcpUBgn.js → ModelSelector-DzdEs2fX.js} +1 -1
- package/dist/{ThinkChat-yid8e_Jb.js → ThinkChat-ldbrNiAx.js} +30 -17
- package/dist/{WorkspaceFileView-BeUpr6TU.js → WorkspaceFileView-BtzVKAed.js} +2 -2
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentActivityPreview.js +3 -3
- package/dist/components/agents-sdk/AgentChat.js +9 -9
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +3 -3
- package/dist/components/agents-sdk/McpServerPicker.js +3 -3
- package/dist/components/agents-sdk/ModelSelector.js +1 -1
- package/dist/components/agents-sdk/PromptInputApproval.js +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 +24 -1
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
- 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 +18 -14
- package/dist/components/agents-sdk/ThinkFullApp.js +35 -28
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineForm.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +2 -2
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +10 -2
- package/dist/components/agents-sdk/ThinkThreadPicker.js +4 -6
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +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.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +1 -1
- 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.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/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +3 -3
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +3 -3
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- 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/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- package/dist/components/general-purpose/SetupChecklist.js +2 -2
- package/dist/components/general-purpose/Terminal.js +2 -2
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +2 -2
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.js +2 -2
- package/dist/{copy-button-4YvddK4e.js → copy-button-CsNSSKYG.js} +1 -1
- package/package.json +2 -2
- package/dist/{icons-B4mGvCvc.js → icons-B1Qw05te.js} +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
2
|
import { Select } from "./components/foundations/Select.js";
|
|
3
|
-
import { t as CopyButton } from "./copy-button-
|
|
3
|
+
import { t as CopyButton } from "./copy-button-CsNSSKYG.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { createHighlighter } from "shiki";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { C as FileIcon, T as FolderOpenIcon, m as ChevronRightIcon, w as FolderIcon } from "./icons-
|
|
2
|
+
import { C as FileIcon, T as FolderOpenIcon, m as ChevronRightIcon, w as FolderIcon } from "./icons-B1Qw05te.js";
|
|
3
3
|
import { t as NavigationLink } from "./navigation-link-kqMa81v5.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeBaseClassName } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { f as ChevronDownIcon } from "./icons-
|
|
2
|
+
import { f as ChevronDownIcon } from "./icons-B1Qw05te.js";
|
|
3
3
|
import { Menu } from "./components/foundations/Menu.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "./class-names-BiMDVpUo.js";
|
|
2
|
-
import { G as SearchIcon, f as ChevronDownIcon } from "./icons-
|
|
2
|
+
import { G as SearchIcon, f as ChevronDownIcon } from "./icons-B1Qw05te.js";
|
|
3
3
|
import { Button } from "./components/foundations/Button.js";
|
|
4
4
|
import { Dialog } from "./components/foundations/Dialog.js";
|
|
5
5
|
import { a as titleCase } from "./format-CmopcfqJ.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { J as SpinnerIcon } from "./icons-
|
|
1
|
+
import { J as SpinnerIcon } from "./icons-B1Qw05te.js";
|
|
2
2
|
import { TransitionSurface } from "./components/foundations/TransitionSurface.js";
|
|
3
3
|
import { AgentChat } from "./components/agents-sdk/AgentChat.js";
|
|
4
4
|
import { AgentToolRunsProvider, useOptionalAgentToolRuns } from "./components/agents-sdk/AgentToolRunsContext.js";
|
|
5
5
|
import { SubagentRunList } from "./components/agents-sdk/SubagentRunList.js";
|
|
6
|
-
import { ThinkChatContext, ThinkChatLiveContext, useThinkChatContext } from "./components/agents-sdk/ThinkChatContext.js";
|
|
6
|
+
import { ThinkChatContext, ThinkChatLiveContext, useOptionalThinkChatContext, useThinkChatContext } from "./components/agents-sdk/ThinkChatContext.js";
|
|
7
7
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./components/agents-sdk/ThinkChatActivity.js";
|
|
8
8
|
import { ThinkRecoveryNotice } from "./components/agents-sdk/ThinkRecoveryNotice.js";
|
|
9
9
|
import { t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-BWbkIELl.js";
|
|
@@ -202,11 +202,10 @@ const ThinkChatApprovalsContext = React.createContext(null);
|
|
|
202
202
|
* inside the log) or `excludeTools` + your own `renderPart` (standalone
|
|
203
203
|
* card) — see README "App-specific tools" and the Custom Tool Panel story.
|
|
204
204
|
*/
|
|
205
|
-
function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAgentToolRunLink, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, sessionCompaction, ...props }) {
|
|
206
|
-
const chat =
|
|
205
|
+
function ThinkChatMessages({ composerHeader, draft, renderPart, excludeTools, renderAgentToolRunLink, toolRenderers, thinkStub, onExecutionSettled, pendingApprovals, notice, sessionCompaction, ...props }) {
|
|
206
|
+
const chat = useOptionalThinkChatContext();
|
|
207
207
|
const agentTools = useOptionalAgentToolRuns();
|
|
208
208
|
const approvals = React.useContext(ThinkChatApprovalsContext);
|
|
209
|
-
const status = toAgentChatStatus(chat);
|
|
210
209
|
const resolvedApprovals = resolveThinkApprovalProps({
|
|
211
210
|
thinkStub,
|
|
212
211
|
pendingApprovals,
|
|
@@ -241,7 +240,7 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAge
|
|
|
241
240
|
});
|
|
242
241
|
return custom === void 0 ? renderBuiltIn() : custom;
|
|
243
242
|
} : defaultRenderPart, [defaultRenderPart, renderPart]);
|
|
244
|
-
const defaultNotice = /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat });
|
|
243
|
+
const defaultNotice = chat ? /* @__PURE__ */ jsx(ThinkRecoveryNotice, { chat }) : null;
|
|
245
244
|
const [dismissedCompaction, setDismissedCompaction] = React.useState(null);
|
|
246
245
|
const landedCompaction = sessionCompaction?.lastCompaction && sessionCompaction.lastCompaction !== dismissedCompaction ? sessionCompaction.lastCompaction : null;
|
|
247
246
|
const sessionCompactionNotice = sessionCompaction?.compacting ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), "Compacting context…"] }) : sessionCompaction?.sessionError ? /* @__PURE__ */ jsxs(TransitionSurface, {
|
|
@@ -256,7 +255,7 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAge
|
|
|
256
255
|
className: "think-recovery-notice",
|
|
257
256
|
children: [compactionSizeText(landedCompaction), " Context usage updates after your next message."]
|
|
258
257
|
}) : null;
|
|
259
|
-
const recoveryActive = chat.isRecovering || chat.connectionError || chat.error;
|
|
258
|
+
const recoveryActive = chat && (chat.isRecovering || chat.connectionError || chat.error);
|
|
260
259
|
const backgroundRuns = renderAgentToolRunLink ? agentTools?.unboundRuns : void 0;
|
|
261
260
|
const resolvedComposerHeader = composerHeader || backgroundRuns?.length ? /* @__PURE__ */ jsxs(Fragment, { children: [composerHeader, backgroundRuns?.length && renderAgentToolRunLink ? /* @__PURE__ */ jsxs("div", {
|
|
262
261
|
className: "subagent-run__tray",
|
|
@@ -270,11 +269,32 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAge
|
|
|
270
269
|
renderRunLink: renderAgentToolRunLink
|
|
271
270
|
})]
|
|
272
271
|
}) : null] }) : void 0;
|
|
272
|
+
const submit = ({ text, files, references }, send) => {
|
|
273
|
+
setDismissedCompaction(sessionCompaction?.lastCompaction ?? null);
|
|
274
|
+
const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
275
|
+
if (!prompt && !files.length) return;
|
|
276
|
+
return send({
|
|
277
|
+
text: prompt,
|
|
278
|
+
files
|
|
279
|
+
});
|
|
280
|
+
};
|
|
281
|
+
if (!chat) {
|
|
282
|
+
if (!draft) throw new Error("ThinkChat.Messages must be used inside <ThinkChat.Provider> or <ThinkChat.Root>, or given a `draft`.");
|
|
283
|
+
return /* @__PURE__ */ jsx(AgentChat, {
|
|
284
|
+
...props,
|
|
285
|
+
renderPart: resolvedRenderPart,
|
|
286
|
+
messages: draft.messages ?? EMPTY_DRAFT_MESSAGES,
|
|
287
|
+
status: draft.status ?? "ready",
|
|
288
|
+
notice: notice ?? sessionCompactionNotice,
|
|
289
|
+
composerHeader: resolvedComposerHeader,
|
|
290
|
+
onSubmit: (message) => submit(message, draft.onSubmit)
|
|
291
|
+
});
|
|
292
|
+
}
|
|
273
293
|
return /* @__PURE__ */ jsx(AgentChat, {
|
|
274
294
|
...props,
|
|
275
295
|
renderPart: resolvedRenderPart,
|
|
276
296
|
messages: chat.messages,
|
|
277
|
-
status,
|
|
297
|
+
status: toAgentChatStatus(chat),
|
|
278
298
|
onStop: chat.stop,
|
|
279
299
|
onApprovalResponse: chat.addToolApprovalResponse,
|
|
280
300
|
thinkStub: resolvedApprovals.thinkStub,
|
|
@@ -283,17 +303,10 @@ function ThinkChatMessages({ composerHeader, renderPart, excludeTools, renderAge
|
|
|
283
303
|
notice: notice ?? (recoveryActive ? defaultNotice : sessionCompactionNotice),
|
|
284
304
|
composerHeader: resolvedComposerHeader,
|
|
285
305
|
onRegenerate: (messageId) => void chat.regenerate({ messageId }),
|
|
286
|
-
onSubmit: (
|
|
287
|
-
setDismissedCompaction(sessionCompaction?.lastCompaction ?? null);
|
|
288
|
-
const prompt = [...references?.map(({ trigger, value }) => trigger ? `${trigger}${value}` : value) ?? [], text.trim()].filter(Boolean).join(" ");
|
|
289
|
-
if (!prompt && !files.length) return;
|
|
290
|
-
return chat.sendMessage({
|
|
291
|
-
text: prompt,
|
|
292
|
-
files
|
|
293
|
-
});
|
|
294
|
-
}
|
|
306
|
+
onSubmit: (message) => submit(message, chat.sendMessage)
|
|
295
307
|
});
|
|
296
308
|
}
|
|
309
|
+
const EMPTY_DRAFT_MESSAGES = [];
|
|
297
310
|
/**
|
|
298
311
|
* The ambient chat value from `ThinkChat.Root`/`Provider` — for custom tool
|
|
299
312
|
* panels, cards, or composer actions that need `messages`, `status`, or
|
|
@@ -1,6 +1,6 @@
|
|
|
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-B1Qw05te.js";
|
|
2
2
|
import { r as formatClock } from "./format-CmopcfqJ.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-CM5gfmdq.js";
|
|
4
4
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
|
|
5
5
|
import { c as useWorkspaceNavigationContext, s as useWorkspaceNavigationRestoration } from "./WorkspaceLink-DZeLe_jN.js";
|
|
6
6
|
import { n as createWorkspaceRehypePlugins, t as WorkspaceMessageResponse } from "./WorkspaceMessageResponse-BWbkIELl.js";
|
|
@@ -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-B1Qw05te.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 { ActivityHeader } from "../ai-sdk/Activity.js";
|
|
4
|
-
import { Button } from "../foundations/Button.js";
|
|
2
|
+
import { C as FileIcon, J as SpinnerIcon, j as McpIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
5
3
|
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
4
|
+
import { ActivityHeader } from "../ai-sdk/Activity.js";
|
|
6
5
|
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
7
6
|
import { AppIcon } from "../foundations/AppIcon.js";
|
|
7
|
+
import { Button } from "../foundations/Button.js";
|
|
8
8
|
import "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
//#region src/components/agents-sdk/AgentActivityPreview.tsx
|
|
@@ -1,25 +1,25 @@
|
|
|
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";
|
|
2
3
|
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";
|
|
6
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
|
-
import { Menu } from "../foundations/Menu.js";
|
|
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";
|
|
9
|
-
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
10
6
|
import { Message, MessageAction, MessageActions } from "../ai-sdk/Message.js";
|
|
11
7
|
import { AgentMessageParts } from "../ai-sdk/AgentMessageParts.js";
|
|
12
|
-
import { Marker, MarkerContent } from "../foundations/Marker.js";
|
|
13
|
-
import { t as CopyButton } from "../../copy-button-4YvddK4e.js";
|
|
14
8
|
import { Context, ContextContent, ContextContentBody, ContextContentHeader, ContextTrigger, getContextUsage, getContextUsedTokens } from "../ai-sdk/Context.js";
|
|
15
|
-
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
16
9
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
10
|
+
import { VirtualMessageScroller } from "../ai-sdk/MessageScrollerVirtual.js";
|
|
11
|
+
import { Menu } from "../foundations/Menu.js";
|
|
12
|
+
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
|
+
import { AgentChatStartScreen } from "../ai-sdk/AgentChatStartScreen.js";
|
|
14
|
+
import { AgentChatMessageEditor } from "../ai-sdk/AgentChatMessageEditor.js";
|
|
15
|
+
import { Marker, MarkerContent } from "../foundations/Marker.js";
|
|
17
16
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
18
17
|
import { PromptInputApproval, getApprovalRequestId, getApprovalStateKey, getPendingToolApprovals } from "./PromptInputApproval.js";
|
|
18
|
+
import { t as CopyButton } from "../../copy-button-CsNSSKYG.js";
|
|
19
19
|
import * as React from "react";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { isTextUIPart } from "ai";
|
|
22
21
|
import { isCompactionMessage } from "agents/experimental/memory/utils";
|
|
22
|
+
import { isTextUIPart } from "ai";
|
|
23
23
|
//#region src/components/agents-sdk/AgentChat.tsx
|
|
24
24
|
/**
|
|
25
25
|
* Agents exports this helper from `agents/sessions` after cloudflare/agents#1896;
|
|
@@ -1,5 +1,5 @@
|
|
|
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-B1Qw05te.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { Dialog } from "../foundations/Dialog.js";
|
|
5
5
|
import { TransitionSurface } from "../foundations/TransitionSurface.js";
|
|
@@ -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-B1Qw05te.js";
|
|
3
3
|
import { IconButton } from "../foundations/IconButton.js";
|
|
4
4
|
import { r as formatClock } from "../../format-CmopcfqJ.js";
|
|
5
5
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
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-B1Qw05te.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { Tabs } from "../foundations/Tabs.js";
|
|
5
5
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
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-
|
|
3
|
+
import { J as SpinnerIcon, d as CheckIcon, j as McpIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
4
|
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
6
5
|
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
6
|
+
import { AgentAttention, AgentAttentionActions, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
7
7
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
8
8
|
import { n as getMcpServerConnectionKind } from "../../mcp-server-U71zhxFF.js";
|
|
9
9
|
import * as React from "react";
|
|
@@ -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-CmopcfqJ.js";
|
|
4
5
|
import { Field } from "../foundations/Field.js";
|
|
5
6
|
import { Form } from "../foundations/Form.js";
|
|
6
|
-
import { i as formatErrorMessage } from "../../format-CmopcfqJ.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,13 +1,13 @@
|
|
|
1
1
|
import { getMcpServerEntry } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
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-
|
|
3
|
+
import { H as PlusIcon, J as SpinnerIcon, b as EllipsisIcon, o as ArrowUpRightIcon, rt as XIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
|
+
import { AppIcon } from "../foundations/AppIcon.js";
|
|
4
5
|
import { Button } from "../foundations/Button.js";
|
|
5
|
-
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
6
6
|
import { IconButton } from "../foundations/IconButton.js";
|
|
7
7
|
import { Dialog } from "../foundations/Dialog.js";
|
|
8
8
|
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
9
9
|
import { Separator } from "../foundations/Separator.js";
|
|
10
|
-
import {
|
|
10
|
+
import { AgentAttention, AgentAttentionBody, AgentAttentionHeader } from "../ai-sdk/AgentAttention.js";
|
|
11
11
|
import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
|
|
12
12
|
import { SearchField } from "../foundations/SearchField.js";
|
|
13
13
|
import * as React from "react";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { getMcpServerEntry, getMcpServerRuntimeState } from "../../utils/mcp-server-catalog.js";
|
|
2
2
|
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-
|
|
3
|
+
import { J as SpinnerIcon, P as MinusIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
4
4
|
import { buttonVariants } from "../foundations/Button.js";
|
|
5
|
-
import { Menu } from "../foundations/Menu.js";
|
|
6
5
|
import { Dialog } from "../foundations/Dialog.js";
|
|
7
6
|
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
7
|
+
import { Menu } from "../foundations/Menu.js";
|
|
8
8
|
import { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuTrigger } from "../ai-sdk/PromptInput.js";
|
|
9
9
|
import { n as getMcpServerConnectionKind, t as McpServerIcon } from "../../mcp-server-U71zhxFF.js";
|
|
10
10
|
import { McpConnectorForm } from "./McpConnectorForm.js";
|
|
11
|
-
import { t as MenuDisclosureGroup } from "../../MenuDisclosureGroup-
|
|
11
|
+
import { t as MenuDisclosureGroup } from "../../MenuDisclosureGroup-yJRq7YXa.js";
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
//#region src/components/agents-sdk/McpServerPicker.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "../../ModelSelector-
|
|
1
|
+
import { _ as getCloudflareModelProvider, a as ModelSelectorEmpty, b as normalizeCloudflareModelSelectorModels, c as ModelSelectorItem, d as ModelSelectorLogoGroup, f as ModelSelectorName, g as formatCloudflareModelProvider, h as ModelSelectorTrigger, i as ModelSelectorDialog, l as ModelSelectorList, m as ModelSelectorSource, n as ModelSelector, o as ModelSelectorGroup, p as ModelSelectorSeparator, r as ModelSelectorContent, s as ModelSelectorInput, t as CloudflareModelSelector, u as ModelSelectorLogo, v as isCloudflareRunnableModelId, x as readCloudflareModelId, y as listCloudflareModelSelectorOptions } from "../../ModelSelector-DzdEs2fX.js";
|
|
2
2
|
export { CloudflareModelSelector, ModelSelector, ModelSelectorContent, ModelSelectorDialog, ModelSelectorEmpty, ModelSelectorGroup, ModelSelectorInput, ModelSelectorItem, ModelSelectorList, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorName, ModelSelectorSeparator, ModelSelectorSource, ModelSelectorTrigger, formatCloudflareModelProvider, getCloudflareModelProvider, isCloudflareRunnableModelId, listCloudflareModelSelectorOptions, normalizeCloudflareModelSelectorModels, readCloudflareModelId };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { ToolApproval } from "../ai-sdk/ToolApproval.js";
|
|
3
2
|
import { ThinkExecutionApproval, ThinkPendingApproval, getPausedExecution } from "./ThinkPendingApproval.js";
|
|
3
|
+
import { ToolApproval } from "../ai-sdk/ToolApproval.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { isToolUIPart } from "ai";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as BoxIcon, j as McpIcon } from "../../icons-
|
|
1
|
+
import { c as BoxIcon, j as McpIcon } from "../../icons-B1Qw05te.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/agents-sdk/PromptInputCommands.tsx
|
|
4
4
|
/** Project whole upstream Agents MCP state into composer mention commands. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { J as SpinnerIcon, X as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-
|
|
2
|
+
import { J as SpinnerIcon, X as StopIcon, d as CheckIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/agents-sdk/SubagentRunIndicator.tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { l as BrainIcon } from "../../icons-
|
|
2
|
+
import { l as BrainIcon } from "../../icons-B1Qw05te.js";
|
|
3
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
3
4
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
5
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
5
|
-
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
6
6
|
import { SubagentRunIndicator, getSubagentRunName, getSubagentRunTooltip } from "./SubagentRunIndicator.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { i as AgentMessageRenderPartContext } from "../../AgentMessageParts-C7L-Mv9U.js";
|
|
2
|
+
import { ct as PromptInputMessage } from "../../PromptInput-DOyee1kM.js";
|
|
2
3
|
import { r as AgentChatProps } from "../../AgentChat-CV-GuYA6.js";
|
|
3
4
|
import { i as useOptionalAgentToolRuns, n as AgentToolRunsProvider, r as AgentToolRunsProviderProps, t as AgentToolEventsValue } from "../../AgentToolRunsContext-Cgve-Upx.js";
|
|
4
5
|
import { n as BrowserLiveViewProps, t as BrowserLiveView } from "../../BrowserLiveView-tJTWkoyu.js";
|
|
@@ -46,8 +47,29 @@ interface ThinkChatRootProps<State = unknown> {
|
|
|
46
47
|
sourceKey: string;
|
|
47
48
|
children: React.ReactNode;
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* The first-turn surface with no conversation behind it. Supply this instead of
|
|
52
|
+
* a chat provider when the composer's submission is what creates the
|
|
53
|
+
* conversation: connecting early is what leaves empty threads behind.
|
|
54
|
+
*/
|
|
55
|
+
interface ThinkChatDraft<MessageT extends UIMessage = UIMessage> {
|
|
56
|
+
/** Client-only transcript rows, such as a locally rendered guide. */
|
|
57
|
+
messages?: readonly MessageT[];
|
|
58
|
+
/** Receives the first message, normalized the same way a live thread's is. */
|
|
59
|
+
onSubmit: (message: {
|
|
60
|
+
text: string;
|
|
61
|
+
files: PromptInputMessage["files"];
|
|
62
|
+
}) => void | Promise<void>;
|
|
63
|
+
/** Set while the app is creating the conversation, so the composer reads busy. */
|
|
64
|
+
status?: AgentChatProps<MessageT>["status"];
|
|
65
|
+
}
|
|
49
66
|
interface ThinkChatMessagesProps<MessageT extends UIMessage = UIMessage> extends ThinkChatActivityRendererOptions<MessageT> {
|
|
50
67
|
className?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Renders without a chat provider, for the first turn of a conversation that
|
|
70
|
+
* does not exist yet. Everything else here behaves as it does on a live thread.
|
|
71
|
+
*/
|
|
72
|
+
draft?: ThinkChatDraft<MessageT>;
|
|
51
73
|
/** Disable the composer (e.g. while the agent is unreachable). */
|
|
52
74
|
disabled?: boolean;
|
|
53
75
|
/** Hide the composer while retaining the normal Think transcript rendering. */
|
|
@@ -179,6 +201,7 @@ declare function ThinkChatRoot<State = unknown, MessageT extends UIMessage = UIM
|
|
|
179
201
|
*/
|
|
180
202
|
declare function ThinkChatMessages<State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
181
203
|
composerHeader,
|
|
204
|
+
draft,
|
|
182
205
|
renderPart,
|
|
183
206
|
excludeTools,
|
|
184
207
|
renderAgentToolRunLink,
|
|
@@ -230,4 +253,4 @@ declare const ThinkChat: {
|
|
|
230
253
|
createActivityRenderer: typeof createThinkChatActivityRenderer;
|
|
231
254
|
};
|
|
232
255
|
//#endregion
|
|
233
|
-
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
256
|
+
export { type AgentToolEventsValue, AgentToolRunsProvider, type AgentToolRunsProviderProps, BrowserLiveView, type BrowserLiveViewProps, BrowserReplay, type BrowserReplayProps, ThinkChat, ThinkChatActivity, type ThinkChatActivityProps, type ThinkChatActivityRendererOptions, ThinkChatDraft, ThinkChatMessages, ThinkChatMessagesProps, ThinkChatProvider, ThinkChatProviderProps, ThinkChatRoot, ThinkChatRootProps, type ThinkChatToolRenderer, type ThinkChatToolRenderers, ThinkPendingExecutionApprovalsQueryKey, ThinkPendingExecutionApprovalsQueryOptions, ThinkRecoveryNotice, type ThinkRecoveryNoticeProps, type UseWorkspaceOptions, WorkspaceExplorer, type WorkspaceExplorerProps, type WorkspaceFileReadTarget, type WorkspaceFileState, type WorkspaceInfo, type WorkspaceQueryKey, type WorkspaceSource, type WorkspaceState, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -6,7 +6,7 @@ import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
|
|
|
6
6
|
import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
|
|
7
7
|
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
|
|
8
8
|
import { ThinkRecoveryNotice } from "./ThinkRecoveryNotice.js";
|
|
9
|
-
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-
|
|
9
|
+
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-ldbrNiAx.js";
|
|
10
10
|
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
11
11
|
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
12
12
|
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
1
2
|
import { useExpansionState } from "../ai-sdk/ExpansionState.js";
|
|
2
3
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityText, ActivityTrigger } from "../ai-sdk/Activity.js";
|
|
3
4
|
import { Button } from "../foundations/Button.js";
|
|
4
5
|
import { MessageResponse } from "../ai-sdk/Message.js";
|
|
5
|
-
import { AgentActivityFavicon, AgentActivityIcon } from "./AgentActivity.js";
|
|
6
6
|
import { useOptionalAgentToolRuns } from "./AgentToolRunsContext.js";
|
|
7
7
|
import { SubagentRunList } from "./SubagentRunList.js";
|
|
8
8
|
import { useOptionalThinkChatLive } from "./ThinkChatContext.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActivityOutput, ActivityPanel } from "../ai-sdk/Activity.js";
|
|
2
2
|
import { Tabs } from "../foundations/Tabs.js";
|
|
3
|
-
import { t as CodeBlock } from "../../CodeBlock-B5I7wje1.js";
|
|
4
3
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
4
|
+
import { t as CodeBlock } from "../../CodeBlock-CM5gfmdq.js";
|
|
5
5
|
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
6
6
|
import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
|
|
7
7
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { $ as TerminalIcon, C as FileIcon, O as InfoIcon, W as RefreshIcon, d as CheckIcon, n as ArrowDownIcon, rt as XIcon } from "../../icons-
|
|
2
|
+
import { $ as TerminalIcon, C as FileIcon, O as InfoIcon, W as RefreshIcon, d as CheckIcon, n as ArrowDownIcon, rt as XIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { Activity, ActivityContent, ActivityItem, ActivityItemGroup, ActivityOutput, ActivityPanel, ActivityTrigger } from "../ai-sdk/Activity.js";
|
|
4
4
|
import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
5
5
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { J as SpinnerIcon, O as InfoIcon, d as CheckIcon, rt as XIcon, z as PauseIcon } from "../../icons-
|
|
2
|
+
import { J as SpinnerIcon, O as InfoIcon, d as CheckIcon, rt as XIcon, z as PauseIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
4
4
|
import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, getThinkExecutionRunSubtitle, getThinkExecutionRunTitle } from "./ThinkExecutionRun.js";
|
|
5
5
|
import "react";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { W as RefreshIcon, b as EllipsisIcon } from "../../icons-
|
|
2
|
+
import { W as RefreshIcon, b as EllipsisIcon } from "../../icons-B1Qw05te.js";
|
|
3
|
+
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
3
4
|
import { buttonVariants } from "../foundations/Button.js";
|
|
4
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
-
import { Menu } from "../foundations/Menu.js";
|
|
6
6
|
import { i as formatErrorMessage } from "../../format-CmopcfqJ.js";
|
|
7
7
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
8
|
-
import {
|
|
8
|
+
import { Menu } from "../foundations/Menu.js";
|
|
9
9
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
10
10
|
import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, isSameThinkExecutionRun, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
11
11
|
import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
|
|
@@ -33,21 +33,26 @@ interface ThinkFullAppWorkspaceConfig {
|
|
|
33
33
|
leading?: React.ReactNode;
|
|
34
34
|
actions?: React.ReactNode;
|
|
35
35
|
}
|
|
36
|
-
interface
|
|
37
|
-
agent: ReturnType<typeof useAgent<AgentT, State>>;
|
|
38
|
-
chat: ReturnType<typeof useAgentChat<State, MessageT>>;
|
|
39
|
-
workspace?: ThinkFullAppWorkspaceConfig;
|
|
40
|
-
}
|
|
41
|
-
interface ThinkFullAppPanel<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends ThinkFullAppView {
|
|
36
|
+
interface ThinkFullAppPanel extends ThinkFullAppView {
|
|
42
37
|
/** Unique panel id used by `workbenchView`; custom panels should not reuse built-in ids. */
|
|
43
38
|
id: ThinkFullAppWorkbenchView;
|
|
44
|
-
|
|
39
|
+
/** Panels are app-authored, so anything one needs is already in its scope. */
|
|
40
|
+
render: () => React.ReactNode;
|
|
45
41
|
}
|
|
46
|
-
|
|
42
|
+
/** The live conversation the chat lane, approvals, and executions belong to. */
|
|
43
|
+
interface ThinkFullAppConversation<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> {
|
|
47
44
|
/** The `useAgent` value from `agents/react`; its stub drives approvals and execution records. */
|
|
48
45
|
agent: ReturnType<typeof useAgent<AgentT, State>>;
|
|
49
46
|
/** The `useAgentChat` value from `@cloudflare/think/react` used by the chat surface. */
|
|
50
47
|
chat: ReturnType<typeof useAgentChat<State, MessageT>>;
|
|
48
|
+
}
|
|
49
|
+
interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage> extends React.HTMLAttributes<HTMLDivElement> {
|
|
50
|
+
/**
|
|
51
|
+
* Omit it and supply `messages.draft` for the first turn of a conversation
|
|
52
|
+
* that does not exist yet. The approvals, execution, and background-agent
|
|
53
|
+
* surfaces wait for a conversation to belong to; everything else is unchanged.
|
|
54
|
+
*/
|
|
55
|
+
conversation?: ThinkFullAppConversation<AgentT, State, MessageT>;
|
|
51
56
|
/** Atomic workspace source, navigation, media, and header configuration. */
|
|
52
57
|
workspace?: ThinkFullAppWorkspaceConfig;
|
|
53
58
|
/** Plugin directory backed by the host's live Agents MCP state and connection callbacks. */
|
|
@@ -80,7 +85,7 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
80
85
|
/** Message rendering labels and approval overrides for ThinkChat. */
|
|
81
86
|
messages?: ThinkChatMessagesProps<MessageT>;
|
|
82
87
|
/** Extra workbench panels appended after the enabled built-in panels. */
|
|
83
|
-
workbenchPanels?: readonly ThinkFullAppPanel
|
|
88
|
+
workbenchPanels?: readonly ThinkFullAppPanel[];
|
|
84
89
|
/** Returns an application-authored TanStack Router Link and enables retained Agent Tool runs. */
|
|
85
90
|
renderAgentToolRunLink?: NonNullable<ThinkChatMessagesProps<MessageT>["renderAgentToolRunLink"]>;
|
|
86
91
|
/**
|
|
@@ -118,12 +123,11 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
118
123
|
}
|
|
119
124
|
/** Combines ThinkChat with an optional resizable workbench shell. */
|
|
120
125
|
declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = unknown, MessageT extends UIMessage = UIMessage>({
|
|
121
|
-
agent,
|
|
122
126
|
appBarActions,
|
|
123
127
|
appBarLeading,
|
|
124
128
|
appBarTitle,
|
|
125
|
-
chat,
|
|
126
129
|
className,
|
|
130
|
+
conversation,
|
|
127
131
|
defaultMobileView,
|
|
128
132
|
defaultWorkbenchOpen,
|
|
129
133
|
defaultWorkbenchView,
|
|
@@ -133,8 +137,8 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
|
|
|
133
137
|
mobileView,
|
|
134
138
|
onMobileViewChange,
|
|
135
139
|
onThreadSidebarOpenChange,
|
|
136
|
-
onWorkbenchViewChange,
|
|
137
140
|
onWorkbenchOpenChange,
|
|
141
|
+
onWorkbenchViewChange,
|
|
138
142
|
plugins,
|
|
139
143
|
ref,
|
|
140
144
|
renderAgentToolRunLink,
|
|
@@ -147,8 +151,8 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
|
|
|
147
151
|
threadSidebar,
|
|
148
152
|
threadSidebarOpen,
|
|
149
153
|
threadStatusSummary,
|
|
150
|
-
workbenchPanels,
|
|
151
154
|
workbenchOpen,
|
|
155
|
+
workbenchPanels,
|
|
152
156
|
workbenchView,
|
|
153
157
|
workspace,
|
|
154
158
|
...props
|
|
@@ -156,4 +160,4 @@ declare function ThinkFullApp<AgentT extends ThinkFullAppAgent<State>, State = u
|
|
|
156
160
|
ref?: React.Ref<HTMLDivElement>;
|
|
157
161
|
}): React.JSX.Element;
|
|
158
162
|
//#endregion
|
|
159
|
-
export { ThinkFullApp, ThinkFullAppAgent, ThinkFullAppMobileView, ThinkFullAppPanel,
|
|
163
|
+
export { ThinkFullApp, ThinkFullAppAgent, ThinkFullAppConversation, ThinkFullAppMobileView, ThinkFullAppPanel, ThinkFullAppProps, ThinkFullAppWorkbenchView, ThinkFullAppWorkspaceConfig };
|