@mcp-b/react-components 0.34.1 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentChat-CV-GuYA6.d.ts → AgentChat-CVO7xyLC.d.ts} +22 -3
- package/dist/{CodeBlock-CM5gfmdq.js → CodeBlock-Bk4nn7l-.js} +4 -3
- package/dist/{CodeBlock-DzGhYyNe.d.ts → CodeBlock-C380GD5t.d.ts} +2 -5
- package/dist/{Dialog-DeOSJ0Oy.d.ts → Dialog-B_FhRWaz.d.ts} +22 -37
- package/dist/{Menu-DVmjBIuM.d.ts → Menu-yb6QXWA3.d.ts} +64 -75
- package/dist/{PromptInput-DOyee1kM.d.ts → PromptInput-BRX7FhjH.d.ts} +7 -272
- package/dist/ResponsiveSidebarShell-DWjULskY.d.ts +68 -0
- package/dist/{Select-D96d09ww.d.ts → Select-RrceeEIe.d.ts} +17 -52
- package/dist/{ThinkChat-en0UbkVv.js → ThinkChat-ByR-QT_D.js} +19 -12
- package/dist/{ThinkChatActivity-CgqpROz_.d.ts → ThinkChatActivity-Dkmm2pIj.d.ts} +1 -1
- package/dist/{ToggleGroup-CSBWfPXo.d.ts → ToggleGroup-BrQZOQn_.d.ts} +4 -6
- package/dist/{WorkspaceFile-C8Riev9j.d.ts → WorkspaceFile-BLaFmMrt.d.ts} +18 -2
- package/dist/{WorkspaceFileView-BtzVKAed.js → WorkspaceFileView-DTHJLKW_.js} +11 -17
- package/dist/components/agents-sdk/AgentChat.d.ts +2 -2
- package/dist/components/agents-sdk/AgentChat.js +47 -26
- package/dist/components/agents-sdk/BrowserLiveView.d.ts +47 -1
- package/dist/components/agents-sdk/BrowserReplay.d.ts +40 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +14 -15
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +17 -24
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +19 -17
- package/dist/components/agents-sdk/ModelSelector.d.ts +9 -9
- package/dist/components/agents-sdk/ModelSelector.js +504 -1
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +18 -95
- package/dist/components/agents-sdk/ThinkChat.js +2 -12
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +2 -4
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivitySummary.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +3 -8
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +5 -3
- package/dist/components/agents-sdk/ThinkExecutionRun.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +2 -2
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +4 -4
- package/dist/components/agents-sdk/ThinkFullApp.js +12 -14
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkPendingApproval.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +5 -4
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +2 -3
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +11 -15
- package/dist/components/agents-sdk/ThinkThreadPicker.js +3 -4
- package/dist/components/agents-sdk/ThinkThreadShell.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +140 -2
- package/dist/components/agents-sdk/Workspace.js +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +32 -5
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -5
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceFile.js +41 -4
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/ai-sdk/Activity.d.ts +5 -0
- package/dist/components/ai-sdk/Activity.js +33 -13
- package/dist/components/ai-sdk/Approval.d.ts +1 -2
- package/dist/components/ai-sdk/Approval.js +4 -7
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/Context.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/Message.js +2 -6
- package/dist/components/ai-sdk/MessageScroller.d.ts +5 -0
- package/dist/components/ai-sdk/MessageScroller.js +18 -12
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +18 -10
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +124 -127
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.d.ts +3 -4
- package/dist/components/ai-sdk/Reasoning.js +29 -13
- package/dist/components/ai-sdk/ToolInvocation.d.ts +3 -5
- package/dist/components/ai-sdk/ToolInvocation.js +2 -2
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.d.ts +1 -1
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Accordion.d.ts +1 -3
- package/dist/components/foundations/Accordion.js +1 -3
- package/dist/components/foundations/AlertDialog.d.ts +16 -36
- package/dist/components/foundations/Autocomplete.d.ts +12 -33
- package/dist/components/foundations/Autocomplete.js +2 -1
- package/dist/components/foundations/Combobox.d.ts +119 -2
- package/dist/components/foundations/Combobox.js +6 -23
- package/dist/components/foundations/ContextMenu.d.ts +50 -57
- package/dist/components/foundations/ContextMenu.js +4 -28
- package/dist/components/foundations/DescriptionList.d.ts +34 -2
- package/dist/components/foundations/DescriptionList.js +33 -2
- package/dist/components/foundations/Dialog.d.ts +1 -1
- package/dist/components/foundations/Dialog.js +2 -1
- package/dist/components/foundations/EmptyState.d.ts +5 -2
- package/dist/components/foundations/EmptyState.js +11 -7
- package/dist/components/foundations/Menu.d.ts +1 -1
- package/dist/components/foundations/Menu.js +3 -21
- package/dist/components/foundations/Menubar.d.ts +35 -64
- package/dist/components/foundations/Menubar.js +3 -22
- package/dist/components/foundations/Popover.d.ts +8 -21
- package/dist/components/foundations/Popover.js +3 -48
- package/dist/components/foundations/PreviewCard.d.ts +44 -29
- package/dist/components/foundations/PreviewCard.js +3 -6
- package/dist/components/foundations/RadioGroup.d.ts +4 -6
- package/dist/components/foundations/Select.d.ts +1 -1
- package/dist/components/foundations/Select.js +7 -21
- package/dist/components/foundations/Slider.d.ts +31 -44
- package/dist/components/foundations/Slider.js +26 -25
- package/dist/components/foundations/Stepper.d.ts +3 -3
- package/dist/components/foundations/Stepper.js +5 -6
- package/dist/components/foundations/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/Tooltip.d.ts +6 -8
- package/dist/components/foundations/Tooltip.js +4 -3
- package/dist/components/general-purpose/Commit.js +1 -1
- package/dist/components/general-purpose/EnvironmentVariables.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.d.ts +2 -3
- package/dist/components/general-purpose/PricingBillingToggle.js +4 -22
- package/dist/components/general-purpose/PricingPage.d.ts +3 -4
- package/dist/components/general-purpose/ResizableSidePanel.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +1 -67
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +7 -2
- package/dist/components/general-purpose/SettingsFormDialog.js +18 -3
- package/dist/components/general-purpose/Terminal.js +3 -3
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +4 -4
- package/dist/components/nanites/AgentConnection.js +16 -11
- package/dist/components/nanites/AgentToolDetail.js +6 -7
- package/dist/{format-CmopcfqJ.js → format-DB2mX9DA.js} +16 -1
- package/dist/{mcp-server-U71zhxFF.js → mcp-server-SD_S-IpB.js} +18 -2
- package/dist/message-scroller-C8cplcQO.js +32 -0
- package/dist/{progress-ring-Dz_ztrW2.js → progress-ring-BEocM1e3.js} +1 -1
- package/dist/provider-logos-zjZycgV6.js +74 -0
- package/dist/styles/agent-chat.css +25 -0
- package/dist/styles/agent-connection.css +4 -31
- package/dist/styles/agent-tool-detail.css +0 -7
- package/dist/styles/alert-dialog.css +0 -2
- package/dist/styles/base-ui-motion.css +7 -5
- package/dist/styles/chatgpt-sign-in-screen.css +5 -3
- package/dist/styles/dialog.css +0 -2
- package/dist/styles/field.css +2 -2
- package/dist/styles/model-selector.css +30 -12
- package/dist/styles/popover.css +0 -1
- package/dist/styles/preview-card.css +0 -4
- package/dist/styles/pricing-page.css +1 -13
- package/dist/styles/prompt-input.css +12 -10
- package/dist/styles/recipes.css +22 -14
- package/dist/styles/slider.css +2 -2
- package/dist/styles/think-execution-workbench.css +9 -13
- package/dist/styles/think-routine-library.css +2 -30
- package/dist/styles/tooltip.css +0 -1
- package/dist/utils/structured-code.d.ts +1 -1
- package/package.json +17 -7
- package/dist/BrowserLiveView-tJTWkoyu.d.ts +0 -48
- package/dist/BrowserReplay-B0BQZr-N.d.ts +0 -41
- package/dist/Combobox-WrrDDaEv.d.ts +0 -154
- package/dist/ModelSelector-DzdEs2fX.js +0 -504
- package/dist/Workspace-EhvvlHOB.d.ts +0 -278
- package/dist/WorkspaceExplorer-DygQnEyi.d.ts +0 -32
- package/dist/components/foundations/DescriptionListParts.d.ts +0 -37
- package/dist/components/foundations/DescriptionListParts.js +0 -35
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { BrowserReplay } from "./BrowserReplay.js";
|
|
4
|
-
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
5
|
-
import { isThinkChatActivityPart } from "./ThinkChatToolParts.js";
|
|
6
|
-
import { describeThinkChatActivityPart } from "./ThinkChatActivitySummary.js";
|
|
7
|
-
import { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart } from "./ThinkChatActivity.js";
|
|
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-en0UbkVv.js";
|
|
10
|
-
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
11
|
-
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
12
|
-
export { AgentToolRunsProvider, BrowserLiveView, BrowserReplay, ThinkChat, ThinkChatActivity, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, ThinkRecoveryNotice, WorkspaceExplorer, createThinkChatActivityRenderer, describeThinkChatActivityPart, inferWorkspaceLanguage, isThinkChatActivityPart, renderThinkChatActivityPart, thinkPendingExecutionApprovalsQueryOptions, useOptionalAgentToolRuns, useSourceScopedAgentToolEvents, useThinkChat, useThinkPendingExecutionApprovals, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
1
|
+
import { a as thinkPendingExecutionApprovalsQueryOptions, i as ThinkChatRoot, n as ThinkChatMessages, o as useThinkChat, r as ThinkChatProvider, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-ByR-QT_D.js";
|
|
2
|
+
export { ThinkChat, ThinkChatMessages, ThinkChatProvider, ThinkChatRoot, thinkPendingExecutionApprovalsQueryOptions, useThinkChat, useThinkPendingExecutionApprovals };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../../ThinkChatActivity-CgqpROz_.js";
|
|
4
|
-
export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, describeThinkChatActivityPart, isThinkChatActivityPart, renderThinkChatActivityPart };
|
|
1
|
+
import { a as ThinkChatToolRenderers, i as ThinkChatToolRenderer, n as ThinkChatActivityProps, o as createThinkChatActivityRenderer, r as ThinkChatActivityRendererOptions, s as renderThinkChatActivityPart, t as ThinkChatActivity } from "../../ThinkChatActivity-Dkmm2pIj.js";
|
|
2
|
+
export { ThinkChatActivity, ThinkChatActivityProps, ThinkChatActivityRendererOptions, ThinkChatToolRenderer, ThinkChatToolRenderers, createThinkChatActivityRenderer, renderThinkChatActivityPart };
|
|
@@ -225,4 +225,4 @@ function createThinkChatActivityRenderer({ excludeTools, renderAgentToolRunLink,
|
|
|
225
225
|
/** Default activity renderer — `createThinkChatActivityRenderer()` with no overrides. */
|
|
226
226
|
const renderThinkChatActivityPart = createThinkChatActivityRenderer();
|
|
227
227
|
//#endregion
|
|
228
|
-
export { ThinkChatActivity, createThinkChatActivityRenderer,
|
|
228
|
+
export { ThinkChatActivity, createThinkChatActivityRenderer, renderThinkChatActivityPart };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as capitalize } from "../../format-
|
|
1
|
+
import { t as capitalize } from "../../format-DB2mX9DA.js";
|
|
2
2
|
import { getToolDisplayName } from "../ai-sdk/ToolPart.js";
|
|
3
3
|
import { t as summarizeToolInput } from "../../summarize-tool-input-CqTcGRYy.js";
|
|
4
4
|
import { displayUrl, isBrowserToolPart, isExecuteToolPart, isFetchToolPart, isPartFailed, isPartWorking, isSessionContextToolFailure, isSessionContextToolPart, isSkillToolPart, isWorkspaceToolPart } from "./ThinkChatToolParts.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ActivityOutput, ActivityPanel } from "../ai-sdk/Activity.js";
|
|
2
|
+
import { a as formatUnknownValue } from "../../format-DB2mX9DA.js";
|
|
2
3
|
import { Tabs } from "../foundations/Tabs.js";
|
|
3
4
|
import { BrowserLiveView } from "./BrowserLiveView.js";
|
|
4
|
-
import { t as CodeBlock } from "../../CodeBlock-
|
|
5
|
+
import { t as CodeBlock } from "../../CodeBlock-Bk4nn7l-.js";
|
|
5
6
|
import { inferWorkspaceLanguage } from "./WorkspaceFile.js";
|
|
6
7
|
import { displayUrl, isSessionContextToolFailure } from "./ThinkChatToolParts.js";
|
|
7
8
|
import * as React from "react";
|
|
@@ -320,13 +321,7 @@ function formatToolCall(call) {
|
|
|
320
321
|
return `${target}(${call.args === void 0 ? "…" : formatAuditValue(call.args)})`;
|
|
321
322
|
}
|
|
322
323
|
function formatAuditValue(value) {
|
|
323
|
-
|
|
324
|
-
if (typeof value === "string") formatted = value;
|
|
325
|
-
else try {
|
|
326
|
-
formatted = JSON.stringify(value, (_, item) => typeof item === "bigint" ? `${item}n` : item) ?? String(value);
|
|
327
|
-
} catch {
|
|
328
|
-
formatted = String(value);
|
|
329
|
-
}
|
|
324
|
+
const formatted = formatUnknownValue(value);
|
|
330
325
|
const maxLength = 240;
|
|
331
326
|
return formatted.length > maxLength ? `${formatted.slice(0, maxLength - 1)}…` : formatted;
|
|
332
327
|
}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
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
|
+
import { a as formatUnknownValue } from "../../format-DB2mX9DA.js";
|
|
5
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
4
6
|
import { formatThinkExecutionRunProgress, formatThinkExecutionStatus, formatThinkExecutionTimestamp, getThinkExecutionRunError, getThinkExecutionRunId, getThinkExecutionRunProgressedAt, getThinkExecutionRunProgressedLabel, getThinkExecutionRunStatus, getThinkExecutionRunTitle, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
5
7
|
import { ThinkExecutionStatus } from "./ThinkExecutionStatus.js";
|
|
6
8
|
import "react";
|
|
7
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
//#region src/components/agents-sdk/ThinkExecutionDetail.tsx
|
|
9
11
|
function formatJson(value) {
|
|
10
|
-
return
|
|
12
|
+
return formatUnknownValue(value, 2);
|
|
11
13
|
}
|
|
12
14
|
/** Native Think submission or Agents Workflow detail, reusable outside the execution workbench. */
|
|
13
15
|
function ThinkExecutionDetail({ className, emptyState = "Select a run to view its activity.", ref, run, ...props }) {
|
|
14
16
|
if (!run) return /* @__PURE__ */ jsx("section", {
|
|
15
17
|
ref,
|
|
16
|
-
className: cx("think-execution-detail", "think-execution-
|
|
18
|
+
className: cx("think-execution-detail", "think-execution-detail--empty", className),
|
|
17
19
|
role: "status",
|
|
18
20
|
...props,
|
|
19
|
-
children: /* @__PURE__ */ jsx(
|
|
21
|
+
children: /* @__PURE__ */ jsx(EmptyState, { description: emptyState })
|
|
20
22
|
});
|
|
21
23
|
const id = getThinkExecutionRunId(run);
|
|
22
24
|
const progressedAt = getThinkExecutionRunProgressedAt(run);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as capitalize } from "../../format-
|
|
1
|
+
import { t as capitalize } from "../../format-DB2mX9DA.js";
|
|
2
2
|
//#region src/components/agents-sdk/ThinkExecutionRun.ts
|
|
3
3
|
/** Narrows the direct upstream execution union without wrapping either record. */
|
|
4
4
|
function isThinkSubmissionRun(run) {
|
|
@@ -3,13 +3,13 @@ import { W as RefreshIcon, b as EllipsisIcon } from "../../icons-B1Qw05te.js";
|
|
|
3
3
|
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
4
|
import { buttonVariants } from "../foundations/Button.js";
|
|
5
5
|
import { IconButton } from "../foundations/IconButton.js";
|
|
6
|
-
import { i as formatErrorMessage } from "../../format-
|
|
6
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
7
7
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
8
8
|
import { Menu } from "../foundations/Menu.js";
|
|
9
|
-
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
10
9
|
import { getThinkExecutionRunAccessibleName, getThinkExecutionRunId, getThinkExecutionRunStatus, getThinkExecutionRunStatusTone, isSameThinkExecutionRun, isThinkSubmissionRun } from "./ThinkExecutionRun.js";
|
|
11
10
|
import { ThinkExecutionRunSummary } from "./ThinkExecutionStatus.js";
|
|
12
11
|
import { ThinkExecutionDetail } from "./ThinkExecutionDetail.js";
|
|
12
|
+
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { queryOptions, useMutation, useSuspenseQuery } from "@tanstack/react-query";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-DQogVe8E.js";
|
|
2
2
|
import { n as AgentToolEventsValue } from "../../AgentToolRunsContext-BCVqCtJ1.js";
|
|
3
3
|
import { McpPluginCatalogProps } from "./McpPluginCatalog.js";
|
|
4
|
-
import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-C8Riev9j.js";
|
|
5
|
-
import { a as WorkspaceSource } from "../../Workspace-EhvvlHOB.js";
|
|
6
4
|
import { ThinkChatMessagesProps } from "./ThinkChat.js";
|
|
7
5
|
import { t as ThinkExecutionRun } from "../../ThinkExecutionRun-lYYgyeE1.js";
|
|
8
6
|
import { ThinkExecutionWorkbenchProps } from "./ThinkExecutionWorkbench.js";
|
|
9
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
10
7
|
import { ThinkFullAppView } from "./ThinkFullAppViewSwitch.js";
|
|
11
8
|
import { ThinkThreadStatusSummary } from "./ThinkThreadPicker.js";
|
|
9
|
+
import { ThinkThreadShell } from "./ThinkThreadShell.js";
|
|
10
|
+
import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-BLaFmMrt.js";
|
|
11
|
+
import { WorkspaceSource } from "./Workspace.js";
|
|
12
12
|
import { t as ThinkAgent } from "../../think-agent-Cip5KAPj.js";
|
|
13
13
|
import * as React from "react";
|
|
14
14
|
import { UIMessage } from "ai";
|
|
@@ -100,7 +100,7 @@ interface ThinkFullAppProps<AgentT extends ThinkFullAppAgent<State>, State = unk
|
|
|
100
100
|
* Optional parent-owned thread picker/sidebar rendered beside the selected child app.
|
|
101
101
|
* Use the render form to close the compact drawer after selecting a thread.
|
|
102
102
|
*/
|
|
103
|
-
threadSidebar?: React.ComponentProps<typeof
|
|
103
|
+
threadSidebar?: React.ComponentProps<typeof ThinkThreadShell>["sidebar"];
|
|
104
104
|
/** Whether the thread sidebar is open. Omit for internal state. */
|
|
105
105
|
threadSidebarOpen?: boolean;
|
|
106
106
|
/** Initial thread sidebar state when `threadSidebarOpen` is uncontrolled. */
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { $ as TerminalIcon, C as FileIcon, J as SpinnerIcon, c as BoxIcon, f as ChevronDownIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
|
-
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
5
4
|
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
5
|
+
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
6
6
|
import { McpPluginCatalog } from "./McpPluginCatalog.js";
|
|
7
7
|
import { a as WorkspaceNavigationRestorationBoundary, i as WorkspaceNavigationFocusRestorer, n as WorkspaceNavigationProvider } from "../../WorkspaceLink-DZeLe_jN.js";
|
|
8
|
-
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-
|
|
8
|
+
import { c as resolveThinkApprovalProps, s as useThinkPendingExecutionApprovals, t as ThinkChat } from "../../ThinkChat-ByR-QT_D.js";
|
|
9
9
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
10
|
-
import { useWorkspace } from "./Workspace.js";
|
|
11
|
-
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
12
10
|
import { ThinkExecutionWorkbench } from "./ThinkExecutionWorkbench.js";
|
|
13
11
|
import { ResizableSidePanel } from "../general-purpose/ResizableSidePanel.js";
|
|
14
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
15
12
|
import { ThinkFullAppViewSwitch } from "./ThinkFullAppViewSwitch.js";
|
|
16
13
|
import { ThinkThreadStatusIndicators } from "./ThinkThreadPicker.js";
|
|
14
|
+
import { ThinkThreadShell } from "./ThinkThreadShell.js";
|
|
15
|
+
import { useWorkspace } from "./Workspace.js";
|
|
16
|
+
import { WorkspaceExplorer } from "./WorkspaceExplorer.js";
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
19
|
//#region src/components/agents-sdk/ThinkFullApp.tsx
|
|
@@ -42,7 +42,7 @@ function WorkspacePanel({ config }) {
|
|
|
42
42
|
function PluginsPanel({ config }) {
|
|
43
43
|
return /* @__PURE__ */ jsxs(ScrollArea.Root, {
|
|
44
44
|
className: "think-full-app__workbench",
|
|
45
|
-
children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, { children: /* @__PURE__ */ jsx(McpPluginCatalog, { ...config }) }), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, { children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })]
|
|
45
|
+
children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, { children: /* @__PURE__ */ jsx(ScrollArea.Content, { children: /* @__PURE__ */ jsx(McpPluginCatalog, { ...config }) }) }), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, { children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })]
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -119,11 +119,13 @@ function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, co
|
|
|
119
119
|
label: "Execution",
|
|
120
120
|
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
121
121
|
render: () => /* @__PURE__ */ jsx(React.Suspense, {
|
|
122
|
-
fallback: /* @__PURE__ */
|
|
122
|
+
fallback: /* @__PURE__ */ jsxs("div", {
|
|
123
123
|
className: "think-full-app__workbench",
|
|
124
124
|
role: "status",
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
children: [/* @__PURE__ */ jsx(SpinnerIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
126
|
+
className: "sigvelo-visually-hidden",
|
|
127
|
+
children: "Loading execution"
|
|
128
|
+
})]
|
|
127
129
|
}),
|
|
128
130
|
children: /* @__PURE__ */ jsx(ThinkExecutionWorkbench, {
|
|
129
131
|
source: agent.stub,
|
|
@@ -311,17 +313,13 @@ function ThinkFullApp({ appBarActions, appBarLeading, appBarTitle, className, co
|
|
|
311
313
|
}), appContent] })
|
|
312
314
|
}) : appContent;
|
|
313
315
|
if (!threadSidebar) return app;
|
|
314
|
-
return /* @__PURE__ */ jsx(
|
|
315
|
-
className: "think-thread-shell",
|
|
316
|
+
return /* @__PURE__ */ jsx(ThinkThreadShell, {
|
|
316
317
|
sidebar: threadSidebar,
|
|
317
|
-
sidebarLabel: "threads",
|
|
318
318
|
sidebarOpen: threadSidebarOpen,
|
|
319
319
|
defaultSidebarOpen: defaultThreadSidebarOpen,
|
|
320
320
|
onSidebarOpenChange: onThreadSidebarOpenChange,
|
|
321
321
|
"data-hide-app-bar-in-workbench": hideAppBarInWorkbench ? "" : void 0,
|
|
322
322
|
topBar: (controls) => renderAppTopBar(controls),
|
|
323
|
-
toolbarLabel: "Thread controls",
|
|
324
|
-
showMainLabel: "Show selected thread",
|
|
325
323
|
children: app
|
|
326
324
|
});
|
|
327
325
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as titleCase } from "../../format-
|
|
2
|
-
import { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalPreview, ApprovalPreviewRow, ApprovalQuestion
|
|
1
|
+
import { a as formatUnknownValue, o as titleCase } from "../../format-DB2mX9DA.js";
|
|
2
|
+
import { Approval, ApprovalCount, ApprovalDecision, ApprovalHeader, ApprovalInputPreview, ApprovalPreview, ApprovalPreviewRow, ApprovalQuestion } from "../ai-sdk/Approval.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { getToolName } from "ai";
|
|
@@ -77,7 +77,7 @@ function ThinkExecutionApproval({ className, count, onSettled, onSkip, part, que
|
|
|
77
77
|
/* @__PURE__ */ jsxs(ApprovalHeader, { children: [/* @__PURE__ */ jsx(ApprovalQuestion, { children: question ?? /* @__PURE__ */ jsx(Fragment, { children: "The agent's code is paused on these calls. Allow it to continue?" }) }), count && count > 1 ? /* @__PURE__ */ jsxs(ApprovalCount, { children: ["1 of ", count] }) : null] }),
|
|
78
78
|
/* @__PURE__ */ jsx(ApprovalPreview, { children: paused.pending.map((action) => /* @__PURE__ */ jsx(ApprovalPreviewRow, {
|
|
79
79
|
label: `${action.connector}.${action.method}`,
|
|
80
|
-
children: action.args === void 0 ? null :
|
|
80
|
+
children: action.args === void 0 ? null : formatUnknownValue(action.args)
|
|
81
81
|
}, action.seq)) }),
|
|
82
82
|
/* @__PURE__ */ jsx(ApprovalDecision, {
|
|
83
83
|
subject: toolName,
|
|
@@ -3,7 +3,8 @@ import { H as PlusIcon } from "../../icons-B1Qw05te.js";
|
|
|
3
3
|
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
4
|
import { buttonVariants } from "../foundations/Button.js";
|
|
5
5
|
import { Tooltip } from "../foundations/Tooltip.js";
|
|
6
|
-
import { t as capitalize } from "../../format-
|
|
6
|
+
import { t as capitalize } from "../../format-DB2mX9DA.js";
|
|
7
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
7
8
|
import { SearchField } from "../foundations/SearchField.js";
|
|
8
9
|
import { ToggleGroup } from "../foundations/ToggleGroup.js";
|
|
9
10
|
import { getThinkRoutineNextRun } from "./ThinkRoutine.js";
|
|
@@ -139,9 +140,9 @@ function ThinkRoutineBrowser({ className, routines, selectedRoutineId, showOwner
|
|
|
139
140
|
})
|
|
140
141
|
}, routine.id);
|
|
141
142
|
})
|
|
142
|
-
}) : /* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
144
|
+
title: "No matching schedules",
|
|
145
|
+
description: "Try another search or filter."
|
|
145
146
|
})
|
|
146
147
|
]
|
|
147
148
|
});
|
|
@@ -2,10 +2,10 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
|
2
2
|
import { J as SpinnerIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
4
|
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
5
|
-
import { Select } from "../foundations/Select.js";
|
|
6
5
|
import { Field } from "../foundations/Field.js";
|
|
7
6
|
import { Form } from "../foundations/Form.js";
|
|
8
7
|
import { Textarea } from "../foundations/Textarea.js";
|
|
8
|
+
import { Select } from "../foundations/Select.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/agents-sdk/ThinkRoutineForm.tsx
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ThinkRoutine, ThinkRoutineCreateRequest, ThinkRoutineOwner, ThinkRoutineRunOf } from "./ThinkRoutine.js";
|
|
1
|
+
import { ThinkRoutine, ThinkRoutineRunOf } from "./ThinkRoutine.js";
|
|
3
2
|
import * as React from "react";
|
|
4
3
|
|
|
5
4
|
//#region src/components/agents-sdk/ThinkRoutineLibrary.d.ts
|
|
@@ -76,4 +75,4 @@ declare function ThinkRoutineLibrary<TRoutine extends ThinkRoutine = ThinkRoutin
|
|
|
76
75
|
ref?: React.Ref<HTMLDivElement>;
|
|
77
76
|
}): React.JSX.Element;
|
|
78
77
|
//#endregion
|
|
79
|
-
export {
|
|
78
|
+
export { ThinkRoutineLibrary, ThinkRoutineLibraryDetailRenderProps, ThinkRoutineLibraryProps };
|
|
@@ -2,11 +2,12 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
|
2
2
|
import { J as SpinnerIcon, V as PlayIcon, b as EllipsisIcon, f as ChevronDownIcon, tt as WarningIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
4
|
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
5
|
-
import { i as formatErrorMessage } from "../../format-
|
|
5
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
6
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
6
7
|
import { Menu } from "../foundations/Menu.js";
|
|
7
8
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
8
|
-
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
9
9
|
import { AlertDialog } from "../foundations/AlertDialog.js";
|
|
10
|
+
import { ResponsiveSidebarShell } from "../general-purpose/ResponsiveSidebarShell.js";
|
|
10
11
|
import { ThinkRoutineBrowser } from "./ThinkRoutineBrowser.js";
|
|
11
12
|
import { ThinkRoutineDetail } from "./ThinkRoutineDetail.js";
|
|
12
13
|
import * as React from "react";
|
|
@@ -175,20 +176,15 @@ function ThinkRoutineLibrary({ appBarActions, appBarLeading, className, createRo
|
|
|
175
176
|
}) : /* @__PURE__ */ jsx(ThinkRoutineDetail, {
|
|
176
177
|
...detailProps,
|
|
177
178
|
showOwner
|
|
178
|
-
}) }, detailProps.routine.id) : /* @__PURE__ */
|
|
179
|
+
}) }, detailProps.routine.id) : /* @__PURE__ */ jsx(EmptyState, {
|
|
179
180
|
className: "think-routine-library__empty-detail",
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
className: "think-routine-library__empty-action"
|
|
188
|
-
}),
|
|
189
|
-
children: "Create schedule"
|
|
190
|
-
}) : null
|
|
191
|
-
]
|
|
181
|
+
title: selectedRoutineId ? "Schedule unavailable" : routines.length ? "Select a schedule" : "No schedules yet",
|
|
182
|
+
description: routines.length ? "Select an available schedule." : "Create a schedule to run recurring Think prompts.",
|
|
183
|
+
children: !routines.length && createRoutineLink ? /* @__PURE__ */ jsx(NavigationLink, {
|
|
184
|
+
render: createRoutineLink,
|
|
185
|
+
className: buttonVariants({ color: "primary" }),
|
|
186
|
+
children: "Create schedule"
|
|
187
|
+
}) : null
|
|
192
188
|
})
|
|
193
189
|
})
|
|
194
190
|
}),
|
|
@@ -2,7 +2,7 @@ import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
|
2
2
|
import { H as PlusIcon, J as SpinnerIcon, t as ArchiveIcon, tt as WarningIcon, v as DotIcon } from "../../icons-B1Qw05te.js";
|
|
3
3
|
import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
4
4
|
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
5
|
-
import { i as formatErrorMessage } from "../../format-
|
|
5
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
6
6
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
7
7
|
import { ScrollArea } from "../foundations/ScrollArea.js";
|
|
8
8
|
import { SearchField } from "../foundations/SearchField.js";
|
|
@@ -186,8 +186,7 @@ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onSelect, onDe
|
|
|
186
186
|
className: "think-thread-picker__scroll",
|
|
187
187
|
children: [/* @__PURE__ */ jsx(ScrollArea.Viewport, {
|
|
188
188
|
className: "think-thread-picker__viewport",
|
|
189
|
-
|
|
190
|
-
children: visibleThreads.length ? /* @__PURE__ */ jsx("ul", {
|
|
189
|
+
children: /* @__PURE__ */ jsx(ScrollArea.Content, { children: visibleThreads.length ? /* @__PURE__ */ jsx("ul", {
|
|
191
190
|
className: "think-thread-picker__list",
|
|
192
191
|
children: visibleThreads.map((thread) => {
|
|
193
192
|
const timestamp = formatThreadTimestamp(thread);
|
|
@@ -251,7 +250,7 @@ function ThinkThreadPicker({ threads, renderThreadLink, onCreate, onSelect, onDe
|
|
|
251
250
|
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
252
251
|
className: "think-thread-picker__empty",
|
|
253
252
|
description: threads.length ? "No matching threads." : "No threads yet."
|
|
254
|
-
})
|
|
253
|
+
}) })
|
|
255
254
|
}), /* @__PURE__ */ jsx(ScrollArea.Scrollbar, {
|
|
256
255
|
orientation: "vertical",
|
|
257
256
|
children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResponsiveSidebarShell } from "
|
|
1
|
+
import { t as ResponsiveSidebarShell } from "../../ResponsiveSidebarShell-DWjULskY.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/agents-sdk/ThinkThreadShell.d.ts
|
|
@@ -1,2 +1,140 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
|
|
1
|
+
import { a as WorkspaceMediaInfo, i as WorkspaceFileState, r as WorkspaceFileAssetResolver, t as WorkspaceFileAsset } from "../../WorkspaceFile-BLaFmMrt.js";
|
|
2
|
+
import { DataTag, QueryKey, UnusedSkipTokenOptions } from "@tanstack/react-query";
|
|
3
|
+
import { WorkspaceLike } from "@cloudflare/think";
|
|
4
|
+
import { FileInfo, Workspace } from "@cloudflare/shell";
|
|
5
|
+
|
|
6
|
+
//#region src/components/agents-sdk/Workspace.d.ts
|
|
7
|
+
/** Workspace summary, as returned by `Workspace.getWorkspaceInfo()` upstream. */
|
|
8
|
+
type WorkspaceInfo = Awaited<ReturnType<Workspace["getWorkspaceInfo"]>>;
|
|
9
|
+
/** Whole upstream workspace shapes, accepted without narrowing or mirroring. */
|
|
10
|
+
type WorkspaceSource = Workspace | WorkspaceLike;
|
|
11
|
+
interface UseWorkspaceOptions {
|
|
12
|
+
/** Must be referentially stable (memoize in the app). */
|
|
13
|
+
source: WorkspaceSource;
|
|
14
|
+
/**
|
|
15
|
+
* Stable, non-secret identity for the endpoint/account/tenant/workspace
|
|
16
|
+
* behind `source`. Change it whenever that backing workspace changes.
|
|
17
|
+
*/
|
|
18
|
+
sourceKey: string;
|
|
19
|
+
/** Root directory to list first. Defaults to "/". */
|
|
20
|
+
root?: string;
|
|
21
|
+
/** Route-owned selected file path. */
|
|
22
|
+
selectedPath: string | null;
|
|
23
|
+
/** Called when a non-link browser asks the app to select a file. */
|
|
24
|
+
onSelectedPathChange?: (path: string | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Optional host adapter called before text/binary reads. Return `null` for
|
|
27
|
+
* ordinary text files and prefer signed/range-friendly URLs for large media.
|
|
28
|
+
* The configured root scopes navigation; hosts must enforce authorization
|
|
29
|
+
* atomically when resolving assets across a trust boundary.
|
|
30
|
+
* Keep this resolver semantically stable for a given `sourceKey`; function
|
|
31
|
+
* identity is intentionally excluded from serializable query keys.
|
|
32
|
+
*/
|
|
33
|
+
resolveFileAsset?: WorkspaceFileAssetResolver;
|
|
34
|
+
/** Maximum size for the built-in buffered-byte fallback. Defaults to 32 MiB. */
|
|
35
|
+
maxInlineAssetBytes?: number;
|
|
36
|
+
}
|
|
37
|
+
interface WorkspaceState {
|
|
38
|
+
root: string;
|
|
39
|
+
/** Loaded directory listings, keyed by directory path. */
|
|
40
|
+
entriesByDirectory: Readonly<Record<string, readonly FileInfo[]>>;
|
|
41
|
+
/** Every loaded entry, keyed by its path. */
|
|
42
|
+
entryByPath: ReadonlyMap<string, FileInfo>;
|
|
43
|
+
expandedPaths: ReadonlySet<string>;
|
|
44
|
+
/** Update expansion; newly expanded directories load lazily. */
|
|
45
|
+
setExpandedPaths: (next: Set<string>) => void;
|
|
46
|
+
selectedPath: string | null;
|
|
47
|
+
/** Ask the route owner to select a file. */
|
|
48
|
+
selectFile: (path: string | null) => void;
|
|
49
|
+
/** The selected file once its read settles; null while loading. */
|
|
50
|
+
selectedFile: WorkspaceFileState | null;
|
|
51
|
+
/** Initial root/info load or explicit refresh in flight. */
|
|
52
|
+
isLoading: boolean;
|
|
53
|
+
/** Directory and file paths with a query in flight. */
|
|
54
|
+
loadingPaths: ReadonlySet<string>;
|
|
55
|
+
/** Root/directory listing failure. Per-file read errors live on the file state. */
|
|
56
|
+
error: string | null;
|
|
57
|
+
/** Workspace summary, when the source provides `getWorkspaceInfo`. */
|
|
58
|
+
info: WorkspaceInfo | null;
|
|
59
|
+
/** Reload the root, every expanded directory, and the selected file. */
|
|
60
|
+
refresh: () => void;
|
|
61
|
+
}
|
|
62
|
+
interface WorkspaceFileReadTarget {
|
|
63
|
+
requestedPath: string;
|
|
64
|
+
readPath: string;
|
|
65
|
+
info: FileInfo;
|
|
66
|
+
media: WorkspaceMediaInfo | null;
|
|
67
|
+
}
|
|
68
|
+
interface WorkspaceResolvedAsset {
|
|
69
|
+
asset: WorkspaceFileAsset;
|
|
70
|
+
media: WorkspaceMediaInfo;
|
|
71
|
+
}
|
|
72
|
+
type WorkspaceQueryOptions<TData, TQueryKey extends QueryKey> = UnusedSkipTokenOptions<TData, Error, TData, TQueryKey> & {
|
|
73
|
+
queryKey: DataTag<TQueryKey, TData, Error>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Source/root prefix for cache inspection, cancellation, or removal.
|
|
77
|
+
* Do not broadly invalidate this prefix: active file queries must refresh in
|
|
78
|
+
* stat → resolver → content order. Use a resource option key or `refresh()`.
|
|
79
|
+
*/
|
|
80
|
+
declare function workspaceQueryKey(sourceKey: string, root: string): readonly ["workspace", string, string];
|
|
81
|
+
type WorkspaceQueryKey = ReturnType<typeof workspaceQueryKey>;
|
|
82
|
+
/** Directory-listing prefix for targeted cache invalidation. */
|
|
83
|
+
declare function workspaceDirectoryQueryPrefix(sourceKey: string, root: string): readonly ["workspace", string, string, "directory"];
|
|
84
|
+
/** Exact directory-listing key shared by query options and live hosts. */
|
|
85
|
+
declare function workspaceDirectoryQueryKey(sourceKey: string, root: string, path: string): readonly ["workspace", string, string, "directory", string];
|
|
86
|
+
type WorkspaceDirectoryQueryKey = ReturnType<typeof workspaceDirectoryQueryKey>;
|
|
87
|
+
declare function workspaceFileQueryKey(sourceKey: string, root: string, requestedPath: string): readonly ["workspace", string, string, "file", string];
|
|
88
|
+
type WorkspaceFileQueryKey = ReturnType<typeof workspaceFileQueryKey>;
|
|
89
|
+
declare function workspaceFileVersion(target: WorkspaceFileReadTarget): {
|
|
90
|
+
readonly path: string;
|
|
91
|
+
readonly name: string;
|
|
92
|
+
readonly type: import("@cloudflare/shell").EntryType;
|
|
93
|
+
readonly mimeType: string;
|
|
94
|
+
readonly size: number;
|
|
95
|
+
readonly createdAt: number;
|
|
96
|
+
readonly updatedAt: number;
|
|
97
|
+
readonly target: string | null;
|
|
98
|
+
};
|
|
99
|
+
type WorkspaceFileVersion = ReturnType<typeof workspaceFileVersion>;
|
|
100
|
+
type WorkspaceDirectoryQueryOptions = WorkspaceQueryOptions<readonly FileInfo[], WorkspaceDirectoryQueryKey>;
|
|
101
|
+
type WorkspaceInfoQueryKey = readonly [...WorkspaceQueryKey, "info"];
|
|
102
|
+
type WorkspaceInfoQueryOptions = WorkspaceQueryOptions<WorkspaceInfo | null, WorkspaceInfoQueryKey>;
|
|
103
|
+
type WorkspaceFileStatQueryKey = readonly [...WorkspaceFileQueryKey, "stat"];
|
|
104
|
+
type WorkspaceFileStatQueryOptions = WorkspaceQueryOptions<WorkspaceFileReadTarget, WorkspaceFileStatQueryKey>;
|
|
105
|
+
type WorkspaceFileAssetQueryKey = readonly [...WorkspaceFileQueryKey, "asset", WorkspaceFileVersion];
|
|
106
|
+
type WorkspaceFileAssetQueryOptions = WorkspaceQueryOptions<WorkspaceResolvedAsset | null, WorkspaceFileAssetQueryKey>;
|
|
107
|
+
type WorkspaceTextFileQueryKey = readonly [...WorkspaceFileQueryKey, "text", WorkspaceFileVersion];
|
|
108
|
+
type WorkspaceTextFileQueryOptions = WorkspaceQueryOptions<string | null, WorkspaceTextFileQueryKey>;
|
|
109
|
+
type WorkspaceBinaryFileQueryKey = readonly [...WorkspaceFileQueryKey, "bytes", WorkspaceFileVersion, {
|
|
110
|
+
readonly maxInlineAssetBytes: number;
|
|
111
|
+
}];
|
|
112
|
+
type WorkspaceBinaryFileQueryOptions = WorkspaceQueryOptions<WorkspaceResolvedAsset | null, WorkspaceBinaryFileQueryKey>;
|
|
113
|
+
/** Shared directory options for workspace components and route loaders. */
|
|
114
|
+
declare function workspaceDirectoryQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, path: string): WorkspaceDirectoryQueryOptions;
|
|
115
|
+
/** Shared workspace-summary options for workspace components and route loaders. */
|
|
116
|
+
declare function workspaceInfoQueryOptions(source: WorkspaceSource, sourceKey: string, root: string): WorkspaceInfoQueryOptions;
|
|
117
|
+
/** Re-stat and validate a requested path before any resolver or file read. */
|
|
118
|
+
declare function workspaceFileStatQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, requestedPath: string): WorkspaceFileStatQueryOptions;
|
|
119
|
+
/** Optional host asset resolution, scoped to the current stat result. */
|
|
120
|
+
declare function workspaceFileAssetQueryOptions(sourceKey: string, root: string, target: WorkspaceFileReadTarget, resolveFileAsset: WorkspaceFileAssetResolver): WorkspaceFileAssetQueryOptions;
|
|
121
|
+
/** Cached text read options, scoped to the validated stat result. */
|
|
122
|
+
declare function workspaceTextFileQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, target: WorkspaceFileReadTarget): WorkspaceTextFileQueryOptions;
|
|
123
|
+
/** Active-file-only buffered asset options, scoped to the validated stat result. */
|
|
124
|
+
declare function workspaceBinaryFileQueryOptions(source: WorkspaceSource, sourceKey: string, root: string, target: WorkspaceFileReadTarget, maxInlineAssetBytes: number): WorkspaceBinaryFileQueryOptions;
|
|
125
|
+
/**
|
|
126
|
+
* Headless state for browsing a Think workspace. TanStack Query owns remote
|
|
127
|
+
* directory, metadata, resolver, text, and byte lifecycles; the route owns
|
|
128
|
+
* selection, while this hook only keeps local tree expansion state.
|
|
129
|
+
*/
|
|
130
|
+
declare function useWorkspace({
|
|
131
|
+
source,
|
|
132
|
+
sourceKey,
|
|
133
|
+
root,
|
|
134
|
+
selectedPath,
|
|
135
|
+
onSelectedPathChange,
|
|
136
|
+
resolveFileAsset,
|
|
137
|
+
maxInlineAssetBytes
|
|
138
|
+
}: UseWorkspaceOptions): WorkspaceState;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { UseWorkspaceOptions, WorkspaceBinaryFileQueryKey, WorkspaceBinaryFileQueryOptions, WorkspaceDirectoryQueryKey, WorkspaceDirectoryQueryOptions, WorkspaceFileAssetQueryKey, WorkspaceFileAssetQueryOptions, WorkspaceFileQueryKey, WorkspaceFileReadTarget, WorkspaceFileStatQueryKey, WorkspaceFileStatQueryOptions, WorkspaceFileVersion, WorkspaceInfo, WorkspaceInfoQueryKey, WorkspaceInfoQueryOptions, WorkspaceQueryKey, WorkspaceResolvedAsset, WorkspaceSource, WorkspaceState, WorkspaceTextFileQueryKey, WorkspaceTextFileQueryOptions, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as formatErrorMessage } from "../../format-
|
|
1
|
+
import { i as formatErrorMessage } from "../../format-DB2mX9DA.js";
|
|
2
2
|
import { getWorkspaceBasename, inferWorkspaceMedia } from "./WorkspaceFile.js";
|
|
3
3
|
import { n as isWorkspacePathWithinRoot, t as canonicalizeAbsoluteWorkspacePath } from "../../workspace-path-L_KmjRjq.js";
|
|
4
4
|
import * as React from "react";
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-DQogVe8E.js";
|
|
2
|
+
import { WorkspaceState } from "./Workspace.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/agents-sdk/WorkspaceExplorer.d.ts
|
|
6
|
+
interface WorkspaceExplorerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
7
|
+
workspace: WorkspaceState;
|
|
8
|
+
/** Host-owned URL/history adapter shared by chat links and the file explorer. */
|
|
9
|
+
navigation: WorkspaceNavigationAdapter;
|
|
10
|
+
/** Header label. Defaults to "Workspace". */
|
|
11
|
+
title?: React.ReactNode;
|
|
12
|
+
/** Leading workspace control, such as a host-owned Back to chat button. */
|
|
13
|
+
leading?: React.ReactNode;
|
|
14
|
+
/** Extra header actions, rendered next to the built-in refresh button. */
|
|
15
|
+
actions?: React.ReactNode;
|
|
16
|
+
/** Show the file filter input. Hidden by default to keep the browser compact. */
|
|
17
|
+
showFilter?: boolean;
|
|
18
|
+
filterPlaceholder?: string;
|
|
19
|
+
emptyState?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Convenience workspace application composed from `WorkspaceBrowser` and
|
|
23
|
+
* `WorkspaceFileView`. The host adapter owns URLs and history; the explorer
|
|
24
|
+
* only restores presentation state for stable navigation entry keys.
|
|
25
|
+
*/
|
|
26
|
+
declare function WorkspaceExplorer({
|
|
27
|
+
...props
|
|
28
|
+
}: WorkspaceExplorerProps & {
|
|
29
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
30
|
+
}): React.JSX.Element;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { WorkspaceExplorer, WorkspaceExplorerProps };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationProvider, o as useRequiredWorkspaceNavigationRestoration, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "../../WorkspaceLink-DZeLe_jN.js";
|
|
3
|
+
import { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationProvider, o as useRequiredWorkspaceNavigationRestoration, r as resolveWorkspaceLink } from "../../WorkspaceLink-DZeLe_jN.js";
|
|
5
4
|
import { WorkspaceBrowser } from "./WorkspaceBrowser.js";
|
|
6
|
-
import { t as WorkspaceFileView } from "../../WorkspaceFileView-
|
|
7
|
-
import { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions } from "./Workspace.js";
|
|
5
|
+
import { t as WorkspaceFileView } from "../../WorkspaceFileView-DTHJLKW_.js";
|
|
8
6
|
import * as React from "react";
|
|
9
7
|
import { jsx } from "react/jsx-runtime";
|
|
10
8
|
//#region src/components/agents-sdk/WorkspaceExplorer.tsx
|
|
@@ -123,4 +121,4 @@ function WorkspaceExplorerContent({ workspace, navigation, className, title = "W
|
|
|
123
121
|
});
|
|
124
122
|
}
|
|
125
123
|
//#endregion
|
|
126
|
-
export { WorkspaceExplorer
|
|
124
|
+
export { WorkspaceExplorer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as
|
|
2
|
-
export { WorkspaceFileAsset, WorkspaceFileAssetRequest, WorkspaceFileAssetResolver, WorkspaceFileState, WorkspaceMediaInfo, WorkspaceMediaKind, WorkspaceMediaTrack, WorkspaceMediaTrackKind, WorkspaceSkillDocument, getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
|
|
1
|
+
import { _ as parseWorkspaceSkill, a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as isWorkspaceSkillPath, h as isWorkspaceMediaPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMarkdownPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as inferWorkspaceMimeType, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset, u as getWorkspaceBasename } from "../../WorkspaceFile-BLaFmMrt.js";
|
|
2
|
+
export { WorkspaceFileAsset, WorkspaceFileAssetRequest, WorkspaceFileAssetResolver, WorkspaceFileState, WorkspaceMediaInfo, WorkspaceMediaKind, WorkspaceMediaTrack, WorkspaceMediaTrackKind, WorkspaceSkillDocument, getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, inferWorkspaceMimeType, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, parseWorkspaceSkill };
|