@mcp-b/react-components 0.46.7 → 0.48.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/{CodeBlock-CcteqDvA.js → CodeBlock-BSJl682D.js} +1 -1
- package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
- package/dist/{FileTree-jtP9471I.js → FileTree-DvE0hNZu.js} +1 -1
- package/dist/{SetupChecklist-BXwSSorj.js → SetupChecklist-DeTU9YpW.js} +1 -1
- package/dist/ThinkChat-CwMdEum8.d.ts +185 -0
- package/dist/{ThinkChat-qztQ6Clo.js → ThinkChat-DiI6hhDP.js} +14 -14
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +91 -0
- package/dist/{Workspace-DZusrEeP.d.ts → Workspace-LIoU30n7.d.ts} +13 -2
- package/dist/{WorkspaceFileView-D0HyoUV8.js → WorkspaceFileView-C_WnYm-a.js} +4 -4
- package/dist/{WorkspaceLink-DtH66bAY.js → WorkspaceLink-B1d2GIGl.js} +7 -2
- package/dist/WorkspaceLive-DfjH1Ypm.d.ts +61 -0
- package/dist/{WorkspaceMessageResponse-CJCmGvTx.js → WorkspaceMessageResponse-BqOezptB.js} +79 -40
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +48 -0
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +2 -2
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- 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/ManagerOffice.d.ts +41 -50
- package/dist/components/agents-sdk/ManagerOffice.js +359 -978
- package/dist/components/agents-sdk/McpConnectionRequest.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
- package/dist/components/agents-sdk/McpServerPicker.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.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/ThinkChat.d.ts +1 -180
- package/dist/components/agents-sdk/ThinkChat.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 +1 -1
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +12 -3
- package/dist/components/agents-sdk/ThinkFullApp.js +15 -3
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +1 -1
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +20 -5
- package/dist/components/agents-sdk/ThinkSidepanel.js +48 -36
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -90
- package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +2 -2
- package/dist/components/agents-sdk/Workspace.js +13 -10
- package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
- package/dist/components/agents-sdk/WorkspaceConcept.d.ts +45 -0
- package/dist/components/agents-sdk/WorkspaceConcept.js +42 -0
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +96 -0
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +429 -0
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +115 -0
- package/dist/components/agents-sdk/WorkspaceExecution.js +330 -0
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceLive.js +113 -0
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +2 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +131 -0
- package/dist/components/agents-sdk/WorkspaceProject.js +238 -0
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +47 -0
- package/dist/components/agents-sdk/WorkspaceUserScript.js +146 -0
- 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 +3 -3
- package/dist/components/ai-sdk/ChainOfThought.d.ts +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/ComposerLink.d.ts +4 -1
- package/dist/components/ai-sdk/ComposerLink.js +4 -3
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +29 -2
- package/dist/components/ai-sdk/ConnectedAppCards.js +78 -103
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Correspondent.d.ts +2 -0
- package/dist/components/ai-sdk/Correspondent.js +145 -0
- 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 +1 -1
- 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 +1 -1
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Checkbox.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.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/Commit.js +2 -2
- 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 +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- 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 +1 -1
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
- package/dist/components/nanites/AgentToolDetail.js +2 -2
- package/dist/{copy-button-BABPlsc-.js → copy-button-Dk2vRe9j.js} +1 -1
- package/dist/{icons-ChPpNMmU.d.ts → icons-CCZGYUwU.d.ts} +6 -1
- package/dist/{icons-BC4HZqSK.js → icons-CeGfXO21.js} +3 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/connected-app-card.css +8 -0
- package/dist/styles/correspondent.css +73 -0
- package/dist/styles/description-list.css +3 -1
- package/dist/styles/index.css +2 -0
- package/dist/styles/manager-office.css +380 -1086
- package/dist/styles/workspace-concepts.css +28 -0
- package/dist/workspace-assets-GqsCYxqT.js +168 -0
- package/package.json +2 -2
- package/dist/WorkspaceMessageResponse-D66ty4FO.d.ts +0 -24
|
@@ -1,91 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/components/agents-sdk/ThinkThreadPicker.d.ts
|
|
4
|
-
interface ThinkThreadItem {
|
|
5
|
-
/** Stable child-agent/thread id used by the app-authored link's route params. */
|
|
6
|
-
id: string;
|
|
7
|
-
/** Human-readable thread title, usually generated by the parent Think agent. */
|
|
8
|
-
title: string;
|
|
9
|
-
/** Optional parent-owned preview for apps that render their own richer sidebar. */
|
|
10
|
-
lastMessagePreview?: string;
|
|
11
|
-
/** Timestamp from the parent registry or metadata row. `updatedAt` wins over `createdAt`. */
|
|
12
|
-
createdAt?: Date | number;
|
|
13
|
-
/** Timestamp from parent-owned thread metadata when available. */
|
|
14
|
-
updatedAt?: Date | number;
|
|
15
|
-
/** Preformatted timestamp label when the app already has one, such as "14m". */
|
|
16
|
-
updatedAtLabel?: string;
|
|
17
|
-
/** Optional upstream/app status string. The picker only displays it; it does not derive it. */
|
|
18
|
-
status?: string;
|
|
19
|
-
/** Human label for `status` when the raw upstream value is not user-facing. */
|
|
20
|
-
statusLabel?: string;
|
|
21
|
-
}
|
|
22
|
-
interface ThinkThreadStatusSummary {
|
|
23
|
-
/** Threads currently processing a turn. */
|
|
24
|
-
running: number;
|
|
25
|
-
/** Completed or interrupted background threads that have not been reviewed. */
|
|
26
|
-
attention: number;
|
|
27
|
-
/** Threads whose latest turn failed. */
|
|
28
|
-
failed: number;
|
|
29
|
-
}
|
|
30
|
-
interface ThinkThreadStatusIndicatorsProps {
|
|
31
|
-
summary: ThinkThreadStatusSummary;
|
|
32
|
-
className?: string;
|
|
33
|
-
}
|
|
34
|
-
interface ThinkThreadPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "title"> {
|
|
35
|
-
/** Threads from the parent agent, already sorted in the order the app wants to show. */
|
|
36
|
-
threads: readonly ThinkThreadItem[];
|
|
37
|
-
/**
|
|
38
|
-
* Renders the application-owned TanStack Router Link for a thread.
|
|
39
|
-
*
|
|
40
|
-
* Put `to`, `params`, `search`, and active state on this element so they stay
|
|
41
|
-
* inferred from the consuming application's registered route tree.
|
|
42
|
-
*/
|
|
43
|
-
renderThreadLink: (thread: ThinkThreadItem) => React.ReactElement;
|
|
44
|
-
/**
|
|
45
|
-
* App-authored TanStack Router Link to the new-thread screen. A thread
|
|
46
|
-
* created on click is an empty thread until someone writes in it.
|
|
47
|
-
*/
|
|
48
|
-
createThreadLink?: React.ReactElement;
|
|
49
|
-
/**
|
|
50
|
-
* Notified on unmodified primary activation. The link still navigates — the
|
|
51
|
-
* route is the selection — so this is for side effects such as closing a
|
|
52
|
-
* compact drawer, never for performing the selection itself.
|
|
53
|
-
*/
|
|
54
|
-
onSelect?: (thread: ThinkThreadItem) => void;
|
|
55
|
-
/** Optional parent-agent delete action, usually `parent.stub.deleteThread(thread.id)`. */
|
|
56
|
-
onDelete?: (thread: ThinkThreadItem) => void | Promise<void>;
|
|
57
|
-
/** Visible heading for the roster. */
|
|
58
|
-
title?: React.ReactNode;
|
|
59
|
-
/** Accessible label for the list navigation. */
|
|
60
|
-
"aria-label"?: string;
|
|
61
|
-
}
|
|
62
|
-
declare function summarizeThinkThreads(threads: readonly Pick<ThinkThreadItem, "status">[]): ThinkThreadStatusSummary;
|
|
63
|
-
declare function ThinkThreadStatusIndicators({
|
|
64
|
-
summary,
|
|
65
|
-
className
|
|
66
|
-
}: ThinkThreadStatusIndicatorsProps): React.JSX.Element | null;
|
|
67
|
-
/**
|
|
68
|
-
* Thread roster UI for sub-agent chat apps.
|
|
69
|
-
*
|
|
70
|
-
* This component does not call Think or Cloudflare RPC methods directly. Feed
|
|
71
|
-
* it from the parent agent's roster method, then render app-owned route links
|
|
72
|
-
* that select the child `useAgent({ sub: [...] })` name. Keep backend contract
|
|
73
|
-
* notes beside the parent Think agent because
|
|
74
|
-
* `listThreads()`/`createThread()`/`deleteThread()` are app-owned.
|
|
75
|
-
*/
|
|
76
|
-
declare function ThinkThreadPicker({
|
|
77
|
-
threads,
|
|
78
|
-
renderThreadLink,
|
|
79
|
-
createThreadLink,
|
|
80
|
-
onSelect,
|
|
81
|
-
onDelete,
|
|
82
|
-
className,
|
|
83
|
-
title,
|
|
84
|
-
"aria-label": ariaLabel,
|
|
85
|
-
ref,
|
|
86
|
-
...props
|
|
87
|
-
}: ThinkThreadPickerProps & {
|
|
88
|
-
ref?: React.Ref<HTMLElement>;
|
|
89
|
-
}): React.JSX.Element;
|
|
90
|
-
//#endregion
|
|
1
|
+
import { a as ThinkThreadStatusIndicatorsProps, i as ThinkThreadStatusIndicators, n as ThinkThreadPicker, o as ThinkThreadStatusSummary, r as ThinkThreadPickerProps, s as summarizeThinkThreads, t as ThinkThreadItem } from "../../ThinkThreadPicker-yFz4vvIf.js";
|
|
91
2
|
export { ThinkThreadItem, ThinkThreadPicker, ThinkThreadPickerProps, ThinkThreadStatusIndicators, ThinkThreadStatusIndicatorsProps, ThinkThreadStatusSummary, summarizeThinkThreads };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as PlusIcon, K as SpinnerIcon, _ as DotIcon, et as WarningIcon, t as ArchiveIcon } from "../../icons-CeGfXO21.js";
|
|
3
3
|
import { Button, buttonVariants } from "../foundations/Button.js";
|
|
4
4
|
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
5
5
|
import { n as isPlainPrimaryLinkActivation, t as NavigationLink } from "../../navigation-link-kqMa81v5.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
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 };
|
|
1
|
+
import { A as workspaceFileQueryKey, C as refreshWorkspaceFileQueries, D as workspaceDirectoryQueryOptions, E as workspaceDirectoryQueryKey, F as workspaceTextFileQueryOptions, M as workspaceInfoQueryKey, N as workspaceInfoQueryOptions, O as workspaceDirectoryQueryPrefix, P as workspaceQueryKey, S as WorkspaceTextFileQueryOptions, T as workspaceBinaryFileQueryOptions, _ as WorkspaceQueryOptions, a as WorkspaceDirectoryQueryOptions, b as WorkspaceState, c as WorkspaceFileQueryKey, d as WorkspaceFileStatQueryOptions, f as WorkspaceFileVersion, g as WorkspaceQueryKey, h as WorkspaceInfoQueryOptions, i as WorkspaceDirectoryQueryKey, j as workspaceFileStatQueryOptions, k as workspaceFileAssetQueryOptions, 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 WorkspaceResolvedAsset, w as useWorkspace, x as WorkspaceTextFileQueryKey, y as WorkspaceSource } from "../../Workspace-LIoU30n7.js";
|
|
2
|
+
export { UseWorkspaceOptions, WorkspaceBinaryFileQueryKey, WorkspaceBinaryFileQueryOptions, WorkspaceDirectoryQueryKey, WorkspaceDirectoryQueryOptions, WorkspaceFileAssetQueryKey, WorkspaceFileAssetQueryOptions, WorkspaceFileQueryKey, WorkspaceFileReadTarget, WorkspaceFileStatQueryKey, WorkspaceFileStatQueryOptions, WorkspaceFileVersion, WorkspaceInfo, WorkspaceInfoQueryKey, WorkspaceInfoQueryOptions, WorkspaceQueryKey, WorkspaceQueryOptions, WorkspaceResolvedAsset, WorkspaceSource, WorkspaceState, WorkspaceTextFileQueryKey, WorkspaceTextFileQueryOptions, refreshWorkspaceFileQueries, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileQueryKey, workspaceFileStatQueryOptions, workspaceInfoQueryKey, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -75,12 +75,15 @@ function workspaceDirectoryQueryPrefix(sourceKey, root) {
|
|
|
75
75
|
function workspaceDirectoryQueryKey(sourceKey, root, path) {
|
|
76
76
|
return [...workspaceDirectoryQueryPrefix(sourceKey, root), path];
|
|
77
77
|
}
|
|
78
|
+
/** File-resource prefix shared by the exact resource keys below. */
|
|
79
|
+
function workspaceFileQueryPrefix(sourceKey, root) {
|
|
80
|
+
return [...workspaceQueryKey(sourceKey, root), "file"];
|
|
81
|
+
}
|
|
78
82
|
function workspaceFileQueryKey(sourceKey, root, requestedPath) {
|
|
79
|
-
return [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
];
|
|
83
|
+
return [...workspaceFileQueryPrefix(sourceKey, root), requestedPath];
|
|
84
|
+
}
|
|
85
|
+
function workspaceInfoQueryKey(sourceKey, root) {
|
|
86
|
+
return [...workspaceQueryKey(sourceKey, root), "info"];
|
|
84
87
|
}
|
|
85
88
|
function workspaceFileVersion(target) {
|
|
86
89
|
return {
|
|
@@ -119,7 +122,7 @@ function workspaceDirectoryQueryOptions(source, sourceKey, root, path) {
|
|
|
119
122
|
/** Shared workspace-summary options for workspace components and route loaders. */
|
|
120
123
|
function workspaceInfoQueryOptions(source, sourceKey, root) {
|
|
121
124
|
return queryOptions({
|
|
122
|
-
queryKey:
|
|
125
|
+
queryKey: workspaceInfoQueryKey(sourceKey, root),
|
|
123
126
|
queryFn: async ({ signal }) => {
|
|
124
127
|
const info = await source.getWorkspaceInfo();
|
|
125
128
|
throwIfAborted(signal);
|
|
@@ -222,7 +225,7 @@ function workspaceBinaryFileQueryOptions(source, sourceKey, root, target, maxInl
|
|
|
222
225
|
retry: false
|
|
223
226
|
});
|
|
224
227
|
}
|
|
225
|
-
async function
|
|
228
|
+
async function refreshWorkspaceFileQueries(queryClient, { source, sourceKey, root, selectedPath, resolveFileAsset, maxInlineAssetBytes }) {
|
|
226
229
|
if (!selectedPath) return;
|
|
227
230
|
const target = await queryClient.fetchQuery({
|
|
228
231
|
...workspaceFileStatQueryOptions(source, sourceKey, root, selectedPath),
|
|
@@ -237,7 +240,7 @@ async function refreshWorkspaceFile(queryClient, { source, sourceKey, root, sele
|
|
|
237
240
|
})) return;
|
|
238
241
|
}
|
|
239
242
|
if (target.media) {
|
|
240
|
-
const options = workspaceBinaryFileQueryOptions(source, sourceKey, root, target, maxInlineAssetBytes);
|
|
243
|
+
const options = workspaceBinaryFileQueryOptions(source, sourceKey, root, target, maxInlineAssetBytes ?? DEFAULT_MAX_INLINE_ASSET_BYTES);
|
|
241
244
|
if (queryClient.getQueryState(options.queryKey)) await queryClient.fetchQuery({
|
|
242
245
|
...options,
|
|
243
246
|
staleTime: 0
|
|
@@ -407,7 +410,7 @@ function useWorkspace({ source, sourceKey, root = "/", selectedPath, onSelectedP
|
|
|
407
410
|
staleTime: 0
|
|
408
411
|
}).catch(() => void 0);
|
|
409
412
|
if (refreshedDirectories.includes(false)) return;
|
|
410
|
-
await
|
|
413
|
+
await refreshWorkspaceFileQueries(queryClient, {
|
|
411
414
|
source,
|
|
412
415
|
sourceKey,
|
|
413
416
|
root,
|
|
@@ -444,4 +447,4 @@ function useWorkspace({ source, sourceKey, root = "/", selectedPath, onSelectedP
|
|
|
444
447
|
};
|
|
445
448
|
}
|
|
446
449
|
//#endregion
|
|
447
|
-
export { useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileStatQueryOptions, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
450
|
+
export { refreshWorkspaceFileQueries, useWorkspace, workspaceBinaryFileQueryOptions, workspaceDirectoryQueryKey, workspaceDirectoryQueryOptions, workspaceDirectoryQueryPrefix, workspaceFileAssetQueryOptions, workspaceFileQueryKey, workspaceFileStatQueryOptions, workspaceInfoQueryKey, workspaceInfoQueryOptions, workspaceQueryKey, workspaceTextFileQueryOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchField } from "../foundations/SearchField.js";
|
|
2
|
-
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../../FileTree-
|
|
2
|
+
import { i as FileTreeFolder, r as FileTreeFile, t as FileTree } from "../../FileTree-DvE0hNZu.js";
|
|
3
3
|
import { WorkspaceHeader } from "./WorkspaceHeader.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { _ as WorkspaceQueryOptions, g as WorkspaceQueryKey } from "../../Workspace-LIoU30n7.js";
|
|
2
|
+
import { QueryClient, QueryFunction } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/WorkspaceConcept.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Concept query identity is what the data is: source, root, concept, scope.
|
|
7
|
+
* Freshness never lives in the key — external changes arrive as invalidation
|
|
8
|
+
* through `useWorkspaceLiveQueries` (native observer events or the host's
|
|
9
|
+
* `revision` tick), so cards keep their data, mutation state, and typed form
|
|
10
|
+
* drafts across refreshes.
|
|
11
|
+
*/
|
|
12
|
+
type WorkspaceConceptQueryKey = readonly [...WorkspaceQueryKey, "concept", concept: string, scope: string];
|
|
13
|
+
type WorkspaceConceptQueryOptions<TData> = WorkspaceQueryOptions<TData, WorkspaceConceptQueryKey>;
|
|
14
|
+
interface WorkspaceConceptQueryInput<TData> {
|
|
15
|
+
sourceKey: string;
|
|
16
|
+
/**
|
|
17
|
+
* The host's workspace boundary. Required, and never defaulted: concept keys
|
|
18
|
+
* and live invalidation must agree on one root, and a silent `"/"` default on
|
|
19
|
+
* either side leaves a host with a nested root receiving zero invalidations.
|
|
20
|
+
*/
|
|
21
|
+
root: string;
|
|
22
|
+
concept: string;
|
|
23
|
+
/** The workspace path (file or directory) this projection reads. */
|
|
24
|
+
scope: string;
|
|
25
|
+
queryFn: QueryFunction<TData, WorkspaceConceptQueryKey>;
|
|
26
|
+
}
|
|
27
|
+
declare function workspaceConceptQueryPrefix(sourceKey: string, root: string): readonly ["workspace", string, string, "concept"];
|
|
28
|
+
declare function workspaceConceptQueryKey(sourceKey: string, root: string, concept: string, scope: string): WorkspaceConceptQueryKey;
|
|
29
|
+
/** Shared concept options for design-system components and host loaders. */
|
|
30
|
+
declare function workspaceConceptQueryOptions<TData>({
|
|
31
|
+
sourceKey,
|
|
32
|
+
root,
|
|
33
|
+
concept,
|
|
34
|
+
scope,
|
|
35
|
+
queryFn
|
|
36
|
+
}: WorkspaceConceptQueryInput<TData>): WorkspaceConceptQueryOptions<TData>;
|
|
37
|
+
declare function workspacePathsOverlap(left: string, right: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Invalidate active concept queries touched by an external workspace change.
|
|
40
|
+
* `root` is required and must be the same root the concept options were built
|
|
41
|
+
* with — the prefix is derived from it, so a mismatch invalidates nothing.
|
|
42
|
+
*/
|
|
43
|
+
declare function invalidateWorkspaceConceptQueries(queryClient: QueryClient, sourceKey: string, root: string, changedPaths?: readonly string[]): Promise<void>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { WorkspaceConceptQueryInput, WorkspaceConceptQueryKey, WorkspaceConceptQueryOptions, invalidateWorkspaceConceptQueries, workspaceConceptQueryKey, workspaceConceptQueryOptions, workspaceConceptQueryPrefix, workspacePathsOverlap };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { workspaceQueryKey } from "./Workspace.js";
|
|
2
|
+
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
+
//#region src/components/agents-sdk/WorkspaceConcept.ts
|
|
4
|
+
function workspaceConceptQueryPrefix(sourceKey, root) {
|
|
5
|
+
return [...workspaceQueryKey(sourceKey, root), "concept"];
|
|
6
|
+
}
|
|
7
|
+
function workspaceConceptQueryKey(sourceKey, root, concept, scope) {
|
|
8
|
+
return [
|
|
9
|
+
...workspaceConceptQueryPrefix(sourceKey, root),
|
|
10
|
+
concept,
|
|
11
|
+
scope
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
/** Shared concept options for design-system components and host loaders. */
|
|
15
|
+
function workspaceConceptQueryOptions({ sourceKey, root, concept, scope, queryFn }) {
|
|
16
|
+
return queryOptions({
|
|
17
|
+
queryKey: workspaceConceptQueryKey(sourceKey, root, concept, scope),
|
|
18
|
+
queryFn,
|
|
19
|
+
staleTime: Infinity
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function workspacePathsOverlap(left, right) {
|
|
23
|
+
return left === right || left === "/" || right === "/" || left.startsWith(`${right}/`) || right.startsWith(`${left}/`);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Invalidate active concept queries touched by an external workspace change.
|
|
27
|
+
* `root` is required and must be the same root the concept options were built
|
|
28
|
+
* with — the prefix is derived from it, so a mismatch invalidates nothing.
|
|
29
|
+
*/
|
|
30
|
+
function invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, changedPaths) {
|
|
31
|
+
const prefix = workspaceConceptQueryPrefix(sourceKey, root);
|
|
32
|
+
return queryClient.invalidateQueries({
|
|
33
|
+
queryKey: prefix,
|
|
34
|
+
predicate: (query) => {
|
|
35
|
+
if (!changedPaths || changedPaths.length === 0) return true;
|
|
36
|
+
const scope = query.queryKey[prefix.length + 1];
|
|
37
|
+
return typeof scope === "string" && changedPaths.some((path) => workspacePathsOverlap(scope, path));
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { invalidateWorkspaceConceptQueries, workspaceConceptQueryKey, workspaceConceptQueryOptions, workspaceConceptQueryPrefix, workspacePathsOverlap };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { WorkspaceConceptQueryOptions } from "./WorkspaceConcept.js";
|
|
2
|
+
import { CardProps } from "../foundations/Card.js";
|
|
3
|
+
import { ConnectedAppCardSaveState } from "../ai-sdk/ConnectedAppCards.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/agents-sdk/WorkspaceCorrespondence.d.ts
|
|
7
|
+
interface WorkspaceCorrespondenceField {
|
|
8
|
+
name: string;
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
interface WorkspaceCorrespondenceDraft {
|
|
13
|
+
fields: readonly WorkspaceCorrespondenceField[];
|
|
14
|
+
body: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Lifecycle of the reviewed file. `draft` is editable and sendable; `sent`
|
|
18
|
+
* renders the snapshot. `WorkspaceCorrespondenceFile` latches `sent` for the
|
|
19
|
+
* session after `onSend` resolves; a host with real delivery state overrides
|
|
20
|
+
* the latch by setting `state` on the queried data.
|
|
21
|
+
*/
|
|
22
|
+
type WorkspaceCorrespondenceState = "draft" | "sent";
|
|
23
|
+
interface WorkspaceCorrespondence extends WorkspaceCorrespondenceDraft {
|
|
24
|
+
kind: string;
|
|
25
|
+
path: string;
|
|
26
|
+
state?: WorkspaceCorrespondenceState;
|
|
27
|
+
}
|
|
28
|
+
interface WorkspaceCorrespondenceSource {
|
|
29
|
+
queryOptions: WorkspaceConceptQueryOptions<WorkspaceCorrespondence | null>;
|
|
30
|
+
onChange?: (path: string, next: WorkspaceCorrespondenceDraft) => Promise<void>;
|
|
31
|
+
onSend?: (path: string) => Promise<void>;
|
|
32
|
+
onOpen?: (path: string) => void;
|
|
33
|
+
onDelete?: (path: string) => void | Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
interface WorkspaceCorrespondenceCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title" | "onChange"> {
|
|
36
|
+
kind: string;
|
|
37
|
+
path: string;
|
|
38
|
+
fields: readonly WorkspaceCorrespondenceField[];
|
|
39
|
+
body: string;
|
|
40
|
+
icon?: React.ReactNode;
|
|
41
|
+
/** `sent` renders the read-only snapshot and ignores `onChange`/`onSend`. */
|
|
42
|
+
state?: WorkspaceCorrespondenceState;
|
|
43
|
+
/** Persistence lifecycle of the visible draft. Send is disabled while set. */
|
|
44
|
+
saveState?: ConnectedAppCardSaveState;
|
|
45
|
+
onChange?: (next: WorkspaceCorrespondenceDraft) => void;
|
|
46
|
+
onSend?: () => void | Promise<void>;
|
|
47
|
+
onOpen?: () => void;
|
|
48
|
+
onDelete?: () => void | Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
interface WorkspaceCorrespondenceFileProps extends Omit<WorkspaceCorrespondenceCardProps, "body" | "fields" | "kind" | "onChange" | "onDelete" | "onOpen" | "onSend" | "path" | "saveState" | "state"> {
|
|
51
|
+
source: WorkspaceCorrespondenceSource;
|
|
52
|
+
fallback?: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Reviewed workspace correspondence. The host passes one normalized file
|
|
56
|
+
* shape; this component owns channel-specific presentation, the sent
|
|
57
|
+
* snapshot, and falls back to the generic card for kinds without a richer
|
|
58
|
+
* design-system surface.
|
|
59
|
+
*/
|
|
60
|
+
declare function WorkspaceCorrespondenceCard({
|
|
61
|
+
body,
|
|
62
|
+
fields,
|
|
63
|
+
kind,
|
|
64
|
+
path,
|
|
65
|
+
icon,
|
|
66
|
+
saveState,
|
|
67
|
+
state,
|
|
68
|
+
onChange,
|
|
69
|
+
onDelete,
|
|
70
|
+
onOpen,
|
|
71
|
+
onSend,
|
|
72
|
+
ref,
|
|
73
|
+
...props
|
|
74
|
+
}: WorkspaceCorrespondenceCardProps & {
|
|
75
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
76
|
+
}): React.JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* Query-backed reviewed correspondence. The host supplies normalized reads
|
|
79
|
+
* and writes; this adapter owns the draft, its debounced save lifecycle, the
|
|
80
|
+
* save-gated Send, and the session sent latch.
|
|
81
|
+
*
|
|
82
|
+
* The visible draft is interaction state layered over query data, so an
|
|
83
|
+
* observer-driven refetch can never clobber typing, and a failed save is
|
|
84
|
+
* shown with a retry affordance instead of rendering as success. Send always
|
|
85
|
+
* flushes the outstanding edit first and refuses when that save fails — the
|
|
86
|
+
* agent must never be told to send content the workspace does not hold.
|
|
87
|
+
*
|
|
88
|
+
* Interaction state belongs to one query identity. The keyed session makes a
|
|
89
|
+
* source swap a real unmount, so an old save or send cannot settle onto the
|
|
90
|
+
* next file.
|
|
91
|
+
*/
|
|
92
|
+
declare function WorkspaceCorrespondenceFile(props: WorkspaceCorrespondenceFileProps & {
|
|
93
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
94
|
+
}): React.JSX.Element;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { WorkspaceCorrespondence, WorkspaceCorrespondenceCard, WorkspaceCorrespondenceCardProps, WorkspaceCorrespondenceDraft, WorkspaceCorrespondenceField, WorkspaceCorrespondenceFile, WorkspaceCorrespondenceFileProps, WorkspaceCorrespondenceSource, WorkspaceCorrespondenceState };
|