@mcp-b/react-components 0.46.5 → 0.46.6
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/{Workspace-BGhTdDTI.d.ts → Workspace-DZusrEeP.d.ts} +5 -5
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- package/dist/components/agents-sdk/Workspace.js +2 -6
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as WorkspaceMediaInfo, i as WorkspaceFileState, r as WorkspaceFileAssetResolver, t as WorkspaceFileAsset } from "./WorkspaceFile-Dq-GC0_T.js";
|
|
2
2
|
import { DataTag, QueryKey, UnusedSkipTokenOptions } from "@tanstack/react-query";
|
|
3
|
-
import { FileInfo, Workspace } from "@cloudflare/shell";
|
|
3
|
+
import { FileInfo, Workspace, WorkspaceFsLike } from "@cloudflare/shell";
|
|
4
4
|
|
|
5
5
|
//#region src/components/agents-sdk/Workspace.d.ts
|
|
6
6
|
/** Workspace summary, as returned by `Workspace.getWorkspaceInfo()` upstream. */
|
|
7
7
|
type WorkspaceInfo = Awaited<ReturnType<Workspace["getWorkspaceInfo"]>>;
|
|
8
|
-
/**
|
|
9
|
-
type WorkspaceSource =
|
|
8
|
+
/** Upstream's proxy-safe filesystem contract plus its workspace summary. */
|
|
9
|
+
type WorkspaceSource = WorkspaceFsLike & Pick<Workspace, "getWorkspaceInfo">;
|
|
10
10
|
interface UseWorkspaceOptions {
|
|
11
11
|
/** Must be referentially stable (memoize in the app). */
|
|
12
12
|
source: WorkspaceSource;
|
|
@@ -53,7 +53,7 @@ interface WorkspaceState {
|
|
|
53
53
|
loadingPaths: ReadonlySet<string>;
|
|
54
54
|
/** Root/directory listing failure. Per-file read errors live on the file state. */
|
|
55
55
|
error: string | null;
|
|
56
|
-
/** Workspace summary
|
|
56
|
+
/** Workspace summary. */
|
|
57
57
|
info: WorkspaceInfo | null;
|
|
58
58
|
/** Reload the root, every expanded directory, and the selected file. */
|
|
59
59
|
refresh: () => void;
|
|
@@ -98,7 +98,7 @@ declare function workspaceFileVersion(target: WorkspaceFileReadTarget): {
|
|
|
98
98
|
type WorkspaceFileVersion = ReturnType<typeof workspaceFileVersion>;
|
|
99
99
|
type WorkspaceDirectoryQueryOptions = WorkspaceQueryOptions<readonly FileInfo[], WorkspaceDirectoryQueryKey>;
|
|
100
100
|
type WorkspaceInfoQueryKey = readonly [...WorkspaceQueryKey, "info"];
|
|
101
|
-
type WorkspaceInfoQueryOptions = WorkspaceQueryOptions<WorkspaceInfo
|
|
101
|
+
type WorkspaceInfoQueryOptions = WorkspaceQueryOptions<WorkspaceInfo, WorkspaceInfoQueryKey>;
|
|
102
102
|
type WorkspaceFileStatQueryKey = readonly [...WorkspaceFileQueryKey, "stat"];
|
|
103
103
|
type WorkspaceFileStatQueryOptions = WorkspaceQueryOptions<WorkspaceFileReadTarget, WorkspaceFileStatQueryKey>;
|
|
104
104
|
type WorkspaceFileAssetQueryKey = readonly [...WorkspaceFileQueryKey, "asset", WorkspaceFileVersion];
|
|
@@ -5,7 +5,7 @@ import { n as McpPluginCatalogProps } from "../../McpPluginCatalog-3qWu8oK1.js";
|
|
|
5
5
|
import { ThinkChatMessagesProps } from "./ThinkChat.js";
|
|
6
6
|
import { ThinkThreadStatusSummary } from "./ThinkThreadPicker.js";
|
|
7
7
|
import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-Dq-GC0_T.js";
|
|
8
|
-
import { v as WorkspaceSource } from "../../Workspace-
|
|
8
|
+
import { v as WorkspaceSource } from "../../Workspace-DZusrEeP.js";
|
|
9
9
|
import { t as ThinkAgent } from "../../think-agent-Cip5KAPj.js";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { UIMessage } from "ai";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as workspaceQueryKey, C as workspaceBinaryFileQueryOptions, D as workspaceFileAssetQueryOptions, E as workspaceDirectoryQueryPrefix, O as workspaceFileStatQueryOptions, S as useWorkspace, T as workspaceDirectoryQueryOptions, _ as WorkspaceResolvedAsset, a as WorkspaceDirectoryQueryOptions, b as WorkspaceTextFileQueryKey, c as WorkspaceFileQueryKey, d as WorkspaceFileStatQueryOptions, f as WorkspaceFileVersion, g as WorkspaceQueryKey, h as WorkspaceInfoQueryOptions, i as WorkspaceDirectoryQueryKey, j as workspaceTextFileQueryOptions, k as workspaceInfoQueryOptions, l as WorkspaceFileReadTarget, m as WorkspaceInfoQueryKey, n as WorkspaceBinaryFileQueryKey, o as WorkspaceFileAssetQueryKey, p as WorkspaceInfo, r as WorkspaceBinaryFileQueryOptions, s as WorkspaceFileAssetQueryOptions, t as UseWorkspaceOptions, u as WorkspaceFileStatQueryKey, v as WorkspaceSource, w as workspaceDirectoryQueryKey, x as WorkspaceTextFileQueryOptions, y as WorkspaceState } from "../../Workspace-
|
|
1
|
+
import { A as workspaceQueryKey, C as workspaceBinaryFileQueryOptions, D as workspaceFileAssetQueryOptions, E as workspaceDirectoryQueryPrefix, O as workspaceFileStatQueryOptions, S as useWorkspace, T as workspaceDirectoryQueryOptions, _ as WorkspaceResolvedAsset, a as WorkspaceDirectoryQueryOptions, b as WorkspaceTextFileQueryKey, c as WorkspaceFileQueryKey, d as WorkspaceFileStatQueryOptions, f as WorkspaceFileVersion, g as WorkspaceQueryKey, h as WorkspaceInfoQueryOptions, i as WorkspaceDirectoryQueryKey, j as workspaceTextFileQueryOptions, k as workspaceInfoQueryOptions, l as WorkspaceFileReadTarget, m as WorkspaceInfoQueryKey, n as WorkspaceBinaryFileQueryKey, o as WorkspaceFileAssetQueryKey, p as WorkspaceInfo, r as WorkspaceBinaryFileQueryOptions, s as WorkspaceFileAssetQueryOptions, t as UseWorkspaceOptions, u as WorkspaceFileStatQueryKey, v as WorkspaceSource, w as workspaceDirectoryQueryKey, x as WorkspaceTextFileQueryOptions, y as WorkspaceState } from "../../Workspace-DZusrEeP.js";
|
|
2
2
|
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 };
|
|
@@ -121,7 +121,6 @@ function workspaceInfoQueryOptions(source, sourceKey, root) {
|
|
|
121
121
|
return queryOptions({
|
|
122
122
|
queryKey: [...workspaceQueryKey(sourceKey, root), "info"],
|
|
123
123
|
queryFn: async ({ signal }) => {
|
|
124
|
-
if (!("getWorkspaceInfo" in source) || typeof source.getWorkspaceInfo !== "function") return null;
|
|
125
124
|
const info = await source.getWorkspaceInfo();
|
|
126
125
|
throwIfAborted(signal);
|
|
127
126
|
return info;
|
|
@@ -269,10 +268,7 @@ function useWorkspace({ source, sourceKey, root = "/", selectedPath, onSelectedP
|
|
|
269
268
|
const normalizedMaxInlineAssetBytes = Number.isFinite(maxInlineAssetBytes) && maxInlineAssetBytes >= 0 ? maxInlineAssetBytes : DEFAULT_MAX_INLINE_ASSET_BYTES;
|
|
270
269
|
const directoryPaths = React.useMemo(() => [.../* @__PURE__ */ new Set([root, ...expandedPaths])].sort(), [expandedPaths, root]);
|
|
271
270
|
const directoryQueries = useQueries({ queries: directoryPaths.map((path) => workspaceDirectoryQueryOptions(source, sourceKey, root, path)) });
|
|
272
|
-
const infoQuery = useQuery(
|
|
273
|
-
...workspaceInfoQueryOptions(source, sourceKey, root),
|
|
274
|
-
enabled: "getWorkspaceInfo" in source && typeof source.getWorkspaceInfo === "function"
|
|
275
|
-
});
|
|
271
|
+
const infoQuery = useQuery(workspaceInfoQueryOptions(source, sourceKey, root));
|
|
276
272
|
const statQuery = useQuery({
|
|
277
273
|
...workspaceFileStatQueryOptions(source, sourceKey, root, selectedPath ?? root),
|
|
278
274
|
enabled: selectedPath !== null
|
|
@@ -406,7 +402,7 @@ function useWorkspace({ source, sourceKey, root = "/", selectedPath, onSelectedP
|
|
|
406
402
|
return false;
|
|
407
403
|
}
|
|
408
404
|
}));
|
|
409
|
-
|
|
405
|
+
await queryClient.fetchQuery({
|
|
410
406
|
...workspaceInfoQueryOptions(source, sourceKey, root),
|
|
411
407
|
staleTime: 0
|
|
412
408
|
}).catch(() => void 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-Bh9-Jo1r.js";
|
|
2
|
-
import { y as WorkspaceState } from "../../Workspace-
|
|
2
|
+
import { y as WorkspaceState } from "../../Workspace-DZusrEeP.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/agents-sdk/WorkspaceExplorer.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.6",
|
|
4
4
|
"description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
|
|
5
5
|
"homepage": "https://design-system.sigvelo.com",
|
|
6
6
|
"bugs": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"streamdown": "^2.5.0",
|
|
55
55
|
"unist-util-visit": "^5.1.0",
|
|
56
56
|
"yet-another-react-lightbox": "^3.32.2",
|
|
57
|
-
"@mcp-b/design-tokens": "0.46.
|
|
57
|
+
"@mcp-b/design-tokens": "0.46.6"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@ai-sdk/react": "^3.0.249",
|