@mcp-b/react-components 0.47.0 → 0.49.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/AgentChatQueue-C_Jaw3Ia.d.ts +48 -0
- package/dist/AgentToolRunsContext-GMe_hSnD.d.ts +35 -0
- package/dist/Avatar-o2NO1fCG.d.ts +124 -0
- package/dist/{Button-CZt3yywF.d.ts → Button-DjONW5UW.d.ts} +1 -1
- package/dist/{CodeBlock-C380GD5t.d.ts → CodeBlock--r6GS8YV.d.ts} +8 -2
- package/dist/{CodeBlock-DMHZiw86.js → CodeBlock-g8sADidM.js} +7 -7
- package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
- package/dist/{FileTree-BHebfvkK.js → FileTree-H8mMg4rV.js} +20 -29
- package/dist/{IconButton-BAUFhUk8.d.ts → IconButton-ByiyjkYE.d.ts} +2 -2
- package/dist/{Message-D_vCVEGB.d.ts → Message-DyaTBiV7.d.ts} +17 -4
- package/dist/MessageScrollerVirtual-D4afYwVB.d.ts +84 -0
- package/dist/{PromptInput-DtJHyp0S.d.ts → PromptInput-C4Mofitz.d.ts} +44 -31
- package/dist/PromptInputApproval-D2hpn54U.d.ts +44 -0
- package/dist/Separator-CzhtLYE1.d.ts +41 -0
- package/dist/Toolbar-CGY004u0.d.ts +155 -0
- package/dist/{Workspace-C_zHq9KZ.d.ts → Workspace-HzGrWDX3.d.ts} +14 -3
- package/dist/{WorkspaceFile-Dq-GC0_T.d.ts → WorkspaceFile-Bouauobc.d.ts} +1 -1
- package/dist/{WorkspaceFileView-ChIJz-fl.js → WorkspaceFileView-DYPtRVpM.js} +4 -3
- package/dist/{WorkspaceLink-B1d2GIGl.js → WorkspaceLink-BYZG-V_I.js} +8 -91
- package/dist/{WorkspaceMessageResponse-Dg_aNpoj.js → WorkspaceMessageResponse-CUJk9_P5.js} +6 -3
- package/dist/components/agents-sdk/AgentChat.d.ts +198 -2
- package/dist/components/agents-sdk/AgentChat.js +525 -670
- package/dist/components/agents-sdk/AgentChatQueue.d.ts +2 -0
- package/dist/components/agents-sdk/AgentChatQueue.js +206 -0
- package/dist/components/agents-sdk/AgentEvent.js +1 -1
- package/dist/components/agents-sdk/AgentToolRunsContext.d.ts +2 -2
- package/dist/components/agents-sdk/AgentToolRunsContext.js +1 -36
- package/dist/components/agents-sdk/BrowserLiveScreen.js +21 -13
- package/dist/components/agents-sdk/BrowserReplay.d.ts +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.d.ts +3 -0
- package/dist/components/agents-sdk/BrowserRunPanel.js +31 -30
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +212 -0
- package/dist/components/agents-sdk/EmployeeChrome.js +555 -0
- package/dist/components/agents-sdk/ManagerOffice.d.ts +115 -85
- package/dist/components/agents-sdk/ManagerOffice.js +545 -1154
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +4 -4
- package/dist/components/agents-sdk/McpConnectionRequest.js +3 -2
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +38 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +93 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +3 -2
- package/dist/components/agents-sdk/McpServerIcon.d.ts +17 -0
- package/dist/components/agents-sdk/McpServerIcon.js +25 -0
- package/dist/components/agents-sdk/McpServerPicker.d.ts +4 -3
- package/dist/components/agents-sdk/McpServerPicker.js +2 -1
- package/dist/components/agents-sdk/ModelSelector.d.ts +4 -4
- package/dist/components/agents-sdk/ModelSelector.js +3 -3
- package/dist/components/agents-sdk/PromptInputApproval.d.ts +1 -43
- package/dist/components/agents-sdk/PromptInputCommands.d.ts +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -2
- package/dist/components/agents-sdk/SessionCompaction.d.ts +88 -1
- package/dist/components/agents-sdk/SessionCompaction.js +2 -2
- package/dist/components/agents-sdk/SubagentRunDetails.d.ts +30 -1
- package/dist/components/agents-sdk/SubagentRunDetails.js +57 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.d.ts +9 -9
- package/dist/components/agents-sdk/SubagentRunIndicator.js +18 -23
- package/dist/components/agents-sdk/SubagentRunList.d.ts +6 -3
- package/dist/components/agents-sdk/SubagentRunList.js +4 -2
- package/dist/components/agents-sdk/SubagentRunPanel.d.ts +60 -0
- package/dist/components/agents-sdk/SubagentRunPanel.js +255 -0
- package/dist/components/agents-sdk/SubagentRunSelector.d.ts +8 -4
- package/dist/components/agents-sdk/SubagentRunSelector.js +4 -2
- package/dist/components/agents-sdk/ThinkChat.d.ts +102 -2
- package/dist/components/agents-sdk/ThinkChat.js +233 -2
- package/dist/components/agents-sdk/ThinkChatActivity.d.ts +76 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +17 -9
- package/dist/components/agents-sdk/ThinkChatContext.d.ts +27 -1
- package/dist/components/agents-sdk/ThinkChatContext.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +23 -18
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionStatus.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.d.ts +85 -28
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +158 -101
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +40 -158
- package/dist/components/agents-sdk/ThinkFullApp.js +71 -285
- package/dist/components/agents-sdk/ThinkRecoveryNotice.d.ts +18 -1
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +51 -0
- package/dist/components/agents-sdk/ThinkRoutineActions.js +201 -0
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +4 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +16 -14
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +12 -12
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +2 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +11 -11
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +6 -6
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +90 -1
- package/dist/components/agents-sdk/ThinkThreadPicker.js +2 -2
- package/dist/components/agents-sdk/Workspace.d.ts +2 -2
- package/dist/components/agents-sdk/Workspace.js +20 -23
- 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 +3 -2
- package/dist/components/agents-sdk/WorkspaceConcept.js +3 -3
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +15 -10
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +43 -40
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +31 -31
- package/dist/components/agents-sdk/WorkspaceExecution.js +115 -192
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +5 -2
- package/dist/components/agents-sdk/WorkspaceExplorer.js +3 -2
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +60 -1
- package/dist/components/agents-sdk/WorkspaceLive.js +33 -5
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +47 -1
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +1 -1
- package/dist/components/agents-sdk/WorkspaceMountManager.d.ts +3 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +5 -8
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.d.ts +38 -0
- package/dist/components/agents-sdk/WorkspaceNavigationRestoration.js +86 -0
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +44 -15
- package/dist/components/agents-sdk/WorkspaceProject.js +74 -51
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +5 -2
- package/dist/components/ai-sdk/Activity.d.ts +1 -1
- package/dist/components/ai-sdk/AgentAttention.d.ts +2 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.d.ts +89 -2
- package/dist/components/ai-sdk/AgentChatStartScreen.js +63 -42
- package/dist/components/ai-sdk/AgentMessageParts.d.ts +45 -1
- package/dist/components/ai-sdk/Approval.d.ts +1 -1
- package/dist/components/ai-sdk/Artifact.d.ts +2 -2
- package/dist/components/ai-sdk/Artifact.js +2 -2
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +1 -2
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +16 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +69 -94
- package/dist/components/ai-sdk/Context.d.ts +7 -3
- package/dist/components/ai-sdk/Context.js +7 -17
- package/dist/components/ai-sdk/Conversation.d.ts +2 -2
- 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.d.ts +3 -3
- package/dist/components/ai-sdk/Goal.js +2 -2
- package/dist/components/ai-sdk/InlineCitation.d.ts +1 -1
- package/dist/components/ai-sdk/InlineCitation.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
- package/dist/components/ai-sdk/Message.d.ts +2 -2
- package/dist/components/ai-sdk/Message.js +11 -2
- package/dist/components/ai-sdk/MessageScroller.d.ts +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.d.ts +2 -76
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +38 -4
- package/dist/components/ai-sdk/Plan.d.ts +1 -1
- package/dist/components/ai-sdk/PromptInput.d.ts +2 -2
- package/dist/components/ai-sdk/PromptInput.js +170 -226
- package/dist/components/ai-sdk/PromptInputComposerEditor.js +32 -9
- package/dist/components/ai-sdk/Queue.d.ts +28 -5
- package/dist/components/ai-sdk/Queue.js +19 -4
- package/dist/components/ai-sdk/Reasoning.d.ts +1 -1
- package/dist/components/ai-sdk/Reasoning.js +4 -4
- package/dist/components/ai-sdk/Sources.d.ts +1 -1
- package/dist/components/ai-sdk/Task.d.ts +1 -1
- package/dist/components/extension/ChatGptSignInScreen.d.ts +1 -1
- package/dist/components/extension/CodexModelSelector.d.ts +5 -0
- package/dist/components/extension/ConversationTabPicker.d.ts +1 -0
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/AlertDialog.d.ts +1 -1
- package/dist/components/foundations/AppIcon.d.ts +3 -2
- package/dist/components/foundations/Autocomplete.js +6 -1
- package/dist/components/foundations/Avatar.d.ts +1 -121
- package/dist/components/foundations/Button.d.ts +1 -1
- package/dist/components/foundations/Card.d.ts +22 -27
- package/dist/components/foundations/Card.js +51 -32
- package/dist/components/foundations/CheckboxGroup.d.ts +1 -1
- package/dist/components/foundations/Collapsible.d.ts +1 -1
- package/dist/components/foundations/Combobox.js +6 -1
- package/dist/components/foundations/Dialog.d.ts +106 -1
- package/dist/components/foundations/EmptyState.d.ts +1 -1
- package/dist/components/foundations/Field.d.ts +2 -1
- package/dist/components/foundations/Fieldset.d.ts +1 -1
- package/dist/components/foundations/Form.d.ts +4 -4
- package/dist/components/foundations/IconButton.d.ts +1 -1
- package/dist/components/foundations/Label.d.ts +1 -1
- package/dist/components/foundations/LinkButton.d.ts +2 -2
- package/dist/components/foundations/Meter.d.ts +1 -1
- package/dist/components/foundations/NumberField.d.ts +1 -1
- package/dist/components/foundations/ScrollArea.d.ts +1 -1
- package/dist/components/foundations/SearchField.d.ts +1 -1
- package/dist/components/foundations/Select.js +6 -1
- package/dist/components/foundations/Separator.d.ts +1 -40
- package/dist/components/foundations/Stepper.d.ts +1 -1
- package/dist/components/foundations/Textarea.d.ts +1 -1
- package/dist/components/foundations/Toast.d.ts +5 -1
- package/dist/components/foundations/Toggle.d.ts +70 -1
- package/dist/components/foundations/ToggleGroup.d.ts +3 -2
- package/dist/components/foundations/Toolbar.d.ts +1 -151
- package/dist/components/foundations/TransitionSurface.d.ts +1 -1
- package/dist/components/general-purpose/ActionGuide.d.ts +10 -26
- package/dist/components/general-purpose/ActionGuide.js +4 -18
- package/dist/components/general-purpose/AppTopBar.d.ts +4 -2
- package/dist/components/general-purpose/Commit.d.ts +2 -2
- package/dist/components/general-purpose/Commit.js +1 -1
- package/dist/components/general-purpose/EnvironmentVariables.d.ts +2 -2
- package/dist/components/general-purpose/FileTree.d.ts +1 -7
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingBillingToggle.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.d.ts +4 -0
- package/dist/components/general-purpose/PricingUsageCalculator.js +1 -1
- package/dist/components/general-purpose/ResizableSidePanel.d.ts +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.d.ts +128 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +119 -101
- package/dist/components/general-purpose/SettingsFormDialog.d.ts +14 -27
- package/dist/components/general-purpose/SettingsFormDialog.js +40 -70
- package/dist/components/general-purpose/SetupChecklist.d.ts +1 -0
- package/dist/components/general-purpose/SetupChecklist.js +76 -1
- package/dist/components/general-purpose/Terminal.d.ts +3 -3
- package/dist/components/general-purpose/Terminal.js +10 -5
- package/dist/components/general-purpose/TestResults.d.ts +23 -11
- package/dist/components/general-purpose/TestResults.js +48 -50
- package/dist/components/general-purpose/ThemeModeControl.d.ts +2 -0
- package/dist/components/general-purpose/WebPreview.d.ts +29 -4
- package/dist/components/general-purpose/WebPreview.js +37 -12
- package/dist/components/nanites/AgentConnection.js +1 -1
- package/dist/components/nanites/AgentToolDetail.d.ts +13 -11
- package/dist/components/nanites/AgentToolDetail.js +20 -41
- package/dist/{copy-button-C0JyjClr.d.ts → copy-button-OUwOdgEm.d.ts} +1 -1
- package/dist/mcp-server-mAErsxHU.js +27 -0
- package/dist/styles/activity.css +1 -96
- package/dist/styles/agent-chat.css +75 -102
- package/dist/styles/agent-tool-detail.css +0 -16
- package/dist/styles/base.css +3 -3
- package/dist/styles/browser-run-panel.css +1 -15
- package/dist/styles/button.css +7 -1
- package/dist/styles/code-block.css +12 -0
- package/dist/styles/composition-motion.css +0 -2
- package/dist/styles/correspondent.css +73 -0
- package/dist/styles/employee-chrome.css +43 -0
- package/dist/styles/file-tree.css +5 -0
- package/dist/styles/index.css +5 -2
- package/dist/styles/manager-office.css +380 -1086
- package/dist/styles/message.css +2 -10
- package/dist/styles/queue.css +71 -0
- package/dist/styles/subagent-run.css +122 -6
- package/dist/styles/test-results.css +2 -5
- package/dist/styles/think-chat-activity.css +13 -0
- package/dist/styles/think-chat-tool-panels.css +81 -0
- package/dist/styles/think-execution-workbench.css +2 -8
- package/dist/styles/think-full-app.css +42 -251
- package/dist/styles/{think-routine-library.css → think-routine.css} +64 -80
- package/dist/styles/web-preview.css +15 -1
- package/dist/utils/mcp-server-catalog.d.ts +1112 -2
- package/dist/utils/mcp-server-catalog.js +28 -9
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-CxpEHsac.js → workspace-assets-Bg7XhPsk.js} +16 -2
- package/package.json +7 -3
- package/dist/AgentChat-BLmQghkt.d.ts +0 -327
- package/dist/AgentChatStartScreen-Bkv7Avni.d.ts +0 -84
- package/dist/AgentMessageParts-C7L-Mv9U.d.ts +0 -46
- package/dist/AgentToolRunsContext-jtmveaRE.d.ts +0 -57
- package/dist/Dialog-B_FhRWaz.d.ts +0 -107
- package/dist/McpConnectorForm-CeYNY0MI.d.ts +0 -39
- package/dist/McpPluginCatalog-3qWu8oK1.d.ts +0 -92
- package/dist/ResponsiveSidebarShell-BTVPxLJK.d.ts +0 -123
- package/dist/SessionCompaction-CmTJFpzj.d.ts +0 -89
- package/dist/SetupChecklist-CwRjIDH4.js +0 -77
- package/dist/ThinkChat-CwMdEum8.d.ts +0 -185
- package/dist/ThinkChat-DLDta57t.js +0 -332
- package/dist/ThinkChatActivity-B3lGVS-6.d.ts +0 -77
- package/dist/ThinkChatContext-COIgzkYp.d.ts +0 -28
- package/dist/ThinkRecoveryNotice-DGWr94rk.d.ts +0 -19
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +0 -91
- package/dist/Toggle-DLrIf5YH.d.ts +0 -69
- package/dist/WorkspaceLive-DLGhtIly.d.ts +0 -49
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +0 -48
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.d.ts +0 -31
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +0 -34
- package/dist/components/agents-sdk/ThinkRoutineLibrary.d.ts +0 -80
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +0 -159
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +0 -200
- package/dist/components/agents-sdk/ThinkSidepanel.js +0 -775
- package/dist/mcp-server-7NR24ASj.js +0 -69
- package/dist/mcp-server-catalog-C_g7C-9o.d.ts +0 -1108
- package/dist/styles/think-sidepanel.css +0 -78
- package/dist/think-agent-Cip5KAPj.d.ts +0 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix } from "./Workspace.js";
|
|
2
|
-
import { invalidateWorkspaceConceptQueries } from "./WorkspaceConcept.js";
|
|
1
|
+
import { refreshWorkspaceFileQueries, workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix, workspaceFileQueryKey, workspaceInfoQueryKey } from "./Workspace.js";
|
|
2
|
+
import { invalidateWorkspaceConceptQueries, workspacePathsOverlap } from "./WorkspaceConcept.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { useQueryClient } from "@tanstack/react-query";
|
|
5
5
|
//#region src/components/agents-sdk/WorkspaceLive.ts
|
|
@@ -11,6 +11,22 @@ function workspaceDirname(path) {
|
|
|
11
11
|
function invalidateWorkspaceDirectories(queryClient, sourceKey, directories, root) {
|
|
12
12
|
for (const directory of directories) queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryKey(sourceKey, root, directory) });
|
|
13
13
|
}
|
|
14
|
+
async function invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths) {
|
|
15
|
+
queryClient.invalidateQueries({
|
|
16
|
+
queryKey: workspaceInfoQueryKey(sourceKey, root),
|
|
17
|
+
exact: true
|
|
18
|
+
});
|
|
19
|
+
if (!source || !selectedPath || paths && !paths.some((path) => workspacePathsOverlap(selectedPath, path))) return;
|
|
20
|
+
await queryClient.cancelQueries({ queryKey: workspaceFileQueryKey(sourceKey, root, selectedPath) });
|
|
21
|
+
await refreshWorkspaceFileQueries(queryClient, {
|
|
22
|
+
source,
|
|
23
|
+
sourceKey,
|
|
24
|
+
root,
|
|
25
|
+
selectedPath,
|
|
26
|
+
resolveFileAsset,
|
|
27
|
+
maxInlineAssetBytes
|
|
28
|
+
}).catch(() => {});
|
|
29
|
+
}
|
|
14
30
|
/**
|
|
15
31
|
* Synchronize external workspace freshness with the design system's Query
|
|
16
32
|
* resources. This is the one external-system effect: native observer events
|
|
@@ -18,15 +34,25 @@ function invalidateWorkspaceDirectories(queryClient, sourceKey, directories, roo
|
|
|
18
34
|
* stable query keys. Hosts only supply events; neither layer adds another
|
|
19
35
|
* watcher.
|
|
20
36
|
*/
|
|
21
|
-
function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
|
|
37
|
+
function useWorkspaceLiveQueries({ changes, maxInlineAssetBytes, resolveFileAsset, selectedPath, source, sourceKey, root, revision }) {
|
|
22
38
|
const queryClient = useQueryClient();
|
|
39
|
+
const refreshResources = React.useEffectEvent((paths) => {
|
|
40
|
+
if (!sourceKey) return;
|
|
41
|
+
invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths);
|
|
42
|
+
});
|
|
23
43
|
const previousRevisionRef = React.useRef(void 0);
|
|
24
44
|
React.useEffect(() => {
|
|
25
45
|
if (!sourceKey || revision === void 0) return;
|
|
26
46
|
const previous = previousRevisionRef.current;
|
|
27
|
-
previousRevisionRef.current =
|
|
28
|
-
|
|
47
|
+
previousRevisionRef.current = {
|
|
48
|
+
sourceKey,
|
|
49
|
+
root,
|
|
50
|
+
revision
|
|
51
|
+
};
|
|
52
|
+
if (previous?.sourceKey === sourceKey && previous.root === root && previous.revision === revision) return;
|
|
53
|
+
queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
|
|
29
54
|
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
|
|
55
|
+
refreshResources();
|
|
30
56
|
}, [
|
|
31
57
|
queryClient,
|
|
32
58
|
revision,
|
|
@@ -50,6 +76,7 @@ function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
|
|
|
50
76
|
pendingPaths.clear();
|
|
51
77
|
queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
|
|
52
78
|
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
|
|
79
|
+
refreshResources();
|
|
53
80
|
return;
|
|
54
81
|
}
|
|
55
82
|
invalidateWorkspaceDirectories(queryClient, sourceKey, pendingDirectories, root);
|
|
@@ -57,6 +84,7 @@ function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
|
|
|
57
84
|
pendingDirectories.clear();
|
|
58
85
|
pendingPaths.clear();
|
|
59
86
|
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, paths);
|
|
87
|
+
refreshResources(paths);
|
|
60
88
|
};
|
|
61
89
|
const unsubscribe = changes.subscribe((change) => {
|
|
62
90
|
if (change.type === "unknown") refreshAll = true;
|
|
@@ -1,2 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as MessageResponseProps } from "../../Message-DyaTBiV7.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/WorkspaceMessageResponse.d.ts
|
|
5
|
+
interface WorkspaceFileRenderInput {
|
|
6
|
+
label: string;
|
|
7
|
+
path: string;
|
|
8
|
+
/** Shared workspace link element; hosts pass it through to the preview unchanged. */
|
|
9
|
+
sourceLink: React.ReactElement;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Host callback for one standalone workspace file link in an assistant
|
|
13
|
+
* paragraph. Return a node to replace the link, or `null` to keep it.
|
|
14
|
+
*/
|
|
15
|
+
type WorkspaceFileRenderer = (file: WorkspaceFileRenderInput) => React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Ambient workspace-file renderer for every `WorkspaceMessageResponse` below,
|
|
18
|
+
* and the only way to supply one. The value is read inside the promoted
|
|
19
|
+
* paragraph, not by the response component, so a host handing down a fresh
|
|
20
|
+
* callback every render re-renders only the paragraphs — the memoized Markdown
|
|
21
|
+
* pipeline is untouched and promoted cards keep their state.
|
|
22
|
+
* `ThinkChat.MessageContent` provides it from its `renderWorkspaceFile` prop; hosts
|
|
23
|
+
* composing `WorkspaceMessageResponse` directly provide it once at their
|
|
24
|
+
* conversation root.
|
|
25
|
+
*/
|
|
26
|
+
declare function WorkspaceFileRendererProvider({
|
|
27
|
+
children,
|
|
28
|
+
renderWorkspaceFile
|
|
29
|
+
}: {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
renderWorkspaceFile: WorkspaceFileRenderer | undefined;
|
|
32
|
+
}): React.JSX.Element;
|
|
33
|
+
interface WorkspaceMessageResponseProps extends MessageResponseProps {
|
|
34
|
+
/**
|
|
35
|
+
* Whether standalone workspace file links may be promoted. `ThinkChat`
|
|
36
|
+
* passes `false` for user messages: user links remain ordinary navigation.
|
|
37
|
+
*/
|
|
38
|
+
promoteWorkspaceFiles?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** Adds workspace-aware Markdown links when rendered inside a workspace provider. */
|
|
41
|
+
declare const WorkspaceMessageResponse: React.MemoExoticComponent<({
|
|
42
|
+
components,
|
|
43
|
+
rehypePlugins,
|
|
44
|
+
promoteWorkspaceFiles,
|
|
45
|
+
...props
|
|
46
|
+
}: WorkspaceMessageResponseProps) => React.JSX.Element>;
|
|
47
|
+
//#endregion
|
|
2
48
|
export { WorkspaceFileRenderInput, WorkspaceFileRenderer, WorkspaceFileRendererProvider, WorkspaceMessageResponse, WorkspaceMessageResponseProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-
|
|
1
|
+
import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-CUJk9_P5.js";
|
|
2
2
|
export { WorkspaceFileRendererProvider, WorkspaceMessageResponse };
|
|
@@ -15,7 +15,8 @@ interface WorkspaceMountManagerProps {
|
|
|
15
15
|
onAdd: () => void;
|
|
16
16
|
onReconnect: (mount: WorkspaceMountItem) => void;
|
|
17
17
|
onRemove: (mount: WorkspaceMountItem) => void;
|
|
18
|
-
|
|
18
|
+
/** Caller-owned button, including its accessible name and optional toolbar composition. */
|
|
19
|
+
trigger: React.ReactElement;
|
|
19
20
|
}
|
|
20
21
|
/** Controlled local-mount presentation; native handles and persistence stay in the host. */
|
|
21
22
|
declare function WorkspaceMountManager({
|
|
@@ -26,7 +27,7 @@ declare function WorkspaceMountManager({
|
|
|
26
27
|
onAdd,
|
|
27
28
|
onReconnect,
|
|
28
29
|
onRemove,
|
|
29
|
-
|
|
30
|
+
trigger
|
|
30
31
|
}: WorkspaceMountManagerProps): React.JSX.Element;
|
|
31
32
|
//#endregion
|
|
32
33
|
export { WorkspaceMountItem, WorkspaceMountManager, WorkspaceMountManagerProps, WorkspaceMountPermission };
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { I as PaperclipIcon } from "../../icons-cuEtsgj9.js";
|
|
2
1
|
import { Button } from "../foundations/Button.js";
|
|
3
|
-
import { Popover } from "../foundations/Popover.js";
|
|
4
2
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
5
|
-
import {
|
|
3
|
+
import { Popover } from "../foundations/Popover.js";
|
|
6
4
|
import { Card, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
7
5
|
import "react";
|
|
8
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
7
|
//#region src/components/agents-sdk/WorkspaceMountManager.tsx
|
|
10
8
|
/** Controlled local-mount presentation; native handles and persistence stay in the host. */
|
|
11
|
-
function WorkspaceMountManager({ mounts, adding = false, busyMountId = null, error, onAdd, onReconnect, onRemove,
|
|
9
|
+
function WorkspaceMountManager({ mounts, adding = false, busyMountId = null, error, onAdd, onReconnect, onRemove, trigger }) {
|
|
12
10
|
const busy = adding || busyMountId !== null;
|
|
13
|
-
return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
children: /* @__PURE__ */ jsx(PaperclipIcon, {})
|
|
11
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { children: [/* @__PURE__ */ jsx(Popover.Trigger, {
|
|
12
|
+
render: trigger,
|
|
13
|
+
unstyled: true
|
|
17
14
|
}), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
18
15
|
side: "bottom",
|
|
19
16
|
align: "end",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { n as WorkspaceDestination } from "../../WorkspaceLink-Bh9-Jo1r.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/agents-sdk/WorkspaceNavigationRestoration.d.ts
|
|
5
|
+
interface WorkspaceNavigationRestoration {
|
|
6
|
+
focusDestination?: WorkspaceDestination;
|
|
7
|
+
focusScope?: string;
|
|
8
|
+
scrollTop?: number;
|
|
9
|
+
}
|
|
10
|
+
interface WorkspaceNavigationRestorationContextValue {
|
|
11
|
+
get(entryKey: string): WorkspaceNavigationRestoration | undefined;
|
|
12
|
+
recordFocus(entryKey: string, destination: WorkspaceDestination, scope?: string): void;
|
|
13
|
+
recordScroll(entryKey: string, scrollTop: number): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Owns entry-keyed presentation state unless an ancestor already provides it.
|
|
17
|
+
* This lets a full application share restoration between chat and files while
|
|
18
|
+
* keeping a standalone WorkspaceExplorer self-contained.
|
|
19
|
+
*/
|
|
20
|
+
declare function WorkspaceNavigationRestorationBoundary({
|
|
21
|
+
children
|
|
22
|
+
}: {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
25
|
+
/** Restores a link in a named surface, including when that surface renders asynchronously. */
|
|
26
|
+
declare function WorkspaceNavigationFocusRestorer({
|
|
27
|
+
entryKey,
|
|
28
|
+
rootRef,
|
|
29
|
+
scope
|
|
30
|
+
}: {
|
|
31
|
+
entryKey: string;
|
|
32
|
+
rootRef: React.RefObject<HTMLElement | null>;
|
|
33
|
+
scope: string;
|
|
34
|
+
}): null;
|
|
35
|
+
declare function useWorkspaceNavigationRestoration(): WorkspaceNavigationRestorationContextValue | null;
|
|
36
|
+
declare function useRequiredWorkspaceNavigationRestoration(): WorkspaceNavigationRestorationContextValue;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { WorkspaceNavigationFocusRestorer, WorkspaceNavigationRestoration, WorkspaceNavigationRestorationBoundary, WorkspaceNavigationRestorationContextValue, useRequiredWorkspaceNavigationRestoration, useWorkspaceNavigationRestoration };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/agents-sdk/WorkspaceNavigationRestoration.tsx
|
|
4
|
+
const WorkspaceNavigationRestorationContext = React.createContext(null);
|
|
5
|
+
/**
|
|
6
|
+
* Owns entry-keyed presentation state unless an ancestor already provides it.
|
|
7
|
+
* This lets a full application share restoration between chat and files while
|
|
8
|
+
* keeping a standalone WorkspaceExplorer self-contained.
|
|
9
|
+
*/
|
|
10
|
+
function WorkspaceNavigationRestorationBoundary({ children }) {
|
|
11
|
+
const parent = React.use(WorkspaceNavigationRestorationContext);
|
|
12
|
+
const restorationsRef = React.useRef(/* @__PURE__ */ new Map());
|
|
13
|
+
const localValue = React.useMemo(() => ({
|
|
14
|
+
get: (entryKey) => restorationsRef.current.get(entryKey),
|
|
15
|
+
recordFocus: (entryKey, destination, scope) => {
|
|
16
|
+
const current = restorationsRef.current.get(entryKey);
|
|
17
|
+
restorationsRef.current.set(entryKey, {
|
|
18
|
+
...current,
|
|
19
|
+
focusDestination: destination,
|
|
20
|
+
focusScope: scope
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
recordScroll: (entryKey, scrollTop) => {
|
|
24
|
+
const current = restorationsRef.current.get(entryKey);
|
|
25
|
+
restorationsRef.current.set(entryKey, {
|
|
26
|
+
...current,
|
|
27
|
+
scrollTop
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}), []);
|
|
31
|
+
if (parent) return children;
|
|
32
|
+
return /* @__PURE__ */ jsx(WorkspaceNavigationRestorationContext, {
|
|
33
|
+
value: localValue,
|
|
34
|
+
children
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function findDestinationLink(root, destination) {
|
|
38
|
+
if (destination.kind !== "file") return null;
|
|
39
|
+
return [...root.querySelectorAll("[data-workspace-link=\"file\"]")].find((candidate) => candidate.dataset.workspacePath === destination.path && (candidate.dataset.workspaceDestinationFragment || null) === destination.fragment) ?? null;
|
|
40
|
+
}
|
|
41
|
+
/** Restores a link in a named surface, including when that surface renders asynchronously. */
|
|
42
|
+
function WorkspaceNavigationFocusRestorer({ entryKey, rootRef, scope }) {
|
|
43
|
+
const restoration = useWorkspaceNavigationRestoration();
|
|
44
|
+
const handledEntryRef = React.useRef(null);
|
|
45
|
+
React.useEffect(() => {
|
|
46
|
+
if (handledEntryRef.current === entryKey) return;
|
|
47
|
+
const saved = restoration?.get(entryKey);
|
|
48
|
+
if (!saved?.focusDestination || saved.focusScope !== scope) return;
|
|
49
|
+
const focusDestination = saved.focusDestination;
|
|
50
|
+
const root = rootRef.current;
|
|
51
|
+
if (!root) return;
|
|
52
|
+
const restore = () => {
|
|
53
|
+
const surface = [...root.matches("[data-workspace-restoration-scope]") ? [root] : [], ...root.querySelectorAll("[data-workspace-restoration-scope]")].find((candidate) => candidate.dataset.workspaceRestorationScope === scope);
|
|
54
|
+
const target = surface ? findDestinationLink(surface, focusDestination) : null;
|
|
55
|
+
if (!target) return false;
|
|
56
|
+
target.focus({ preventScroll: true });
|
|
57
|
+
handledEntryRef.current = entryKey;
|
|
58
|
+
return true;
|
|
59
|
+
};
|
|
60
|
+
if (restore()) return;
|
|
61
|
+
const observer = new MutationObserver(() => {
|
|
62
|
+
if (restore()) observer.disconnect();
|
|
63
|
+
});
|
|
64
|
+
observer.observe(root, {
|
|
65
|
+
childList: true,
|
|
66
|
+
subtree: true
|
|
67
|
+
});
|
|
68
|
+
return () => observer.disconnect();
|
|
69
|
+
}, [
|
|
70
|
+
entryKey,
|
|
71
|
+
restoration,
|
|
72
|
+
rootRef,
|
|
73
|
+
scope
|
|
74
|
+
]);
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function useWorkspaceNavigationRestoration() {
|
|
78
|
+
return React.use(WorkspaceNavigationRestorationContext);
|
|
79
|
+
}
|
|
80
|
+
function useRequiredWorkspaceNavigationRestoration() {
|
|
81
|
+
const restoration = useWorkspaceNavigationRestoration();
|
|
82
|
+
if (!restoration) throw new Error("Workspace navigation restoration is unavailable outside its boundary.");
|
|
83
|
+
return restoration;
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { WorkspaceNavigationFocusRestorer, WorkspaceNavigationRestorationBoundary, useRequiredWorkspaceNavigationRestoration, useWorkspaceNavigationRestoration };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ThinkFullAppPanel } from "./ThinkFullApp.js";
|
|
2
1
|
import { WorkspaceConceptQueryOptions } from "./WorkspaceConcept.js";
|
|
3
2
|
import { CardProps } from "../foundations/Card.js";
|
|
4
3
|
import * as React from "react";
|
|
@@ -8,7 +7,22 @@ type WorkspaceProjectThreadOrigin = "user" | "routine" | "messenger";
|
|
|
8
7
|
interface WorkspaceProjectFile {
|
|
9
8
|
path: string;
|
|
10
9
|
label: string;
|
|
11
|
-
|
|
10
|
+
}
|
|
11
|
+
type WorkspaceProjectSectionItem = {
|
|
12
|
+
kind: "file";
|
|
13
|
+
path: string;
|
|
14
|
+
label: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "link";
|
|
17
|
+
href: string;
|
|
18
|
+
label: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "text";
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
interface WorkspaceProjectSection {
|
|
24
|
+
label: string;
|
|
25
|
+
items: readonly WorkspaceProjectSectionItem[];
|
|
12
26
|
}
|
|
13
27
|
interface WorkspaceProjectThread {
|
|
14
28
|
id: string;
|
|
@@ -16,7 +30,6 @@ interface WorkspaceProjectThread {
|
|
|
16
30
|
origin: WorkspaceProjectThreadOrigin;
|
|
17
31
|
/** Channel or origin mark. Messenger threads pass a brand favicon. */
|
|
18
32
|
icon?: React.ReactNode;
|
|
19
|
-
onOpen?: () => void;
|
|
20
33
|
}
|
|
21
34
|
interface WorkspaceProject {
|
|
22
35
|
/** Workspace path of PROJECT.md — directories are not addressable. */
|
|
@@ -26,7 +39,29 @@ interface WorkspaceProject {
|
|
|
26
39
|
/** Brand mark. Defaults to `FolderIcon`. */
|
|
27
40
|
icon?: React.ReactNode;
|
|
28
41
|
files?: readonly WorkspaceProjectFile[];
|
|
42
|
+
/** Explicit groups authored under `## Working set` in PROJECT.md. */
|
|
43
|
+
sections?: readonly WorkspaceProjectSection[];
|
|
29
44
|
threads?: readonly WorkspaceProjectThread[];
|
|
45
|
+
}
|
|
46
|
+
type WorkspaceProjectOpenable = {
|
|
47
|
+
onOpen?: () => void;
|
|
48
|
+
};
|
|
49
|
+
type WorkspaceProjectFileView = WorkspaceProjectFile & WorkspaceProjectOpenable;
|
|
50
|
+
type WorkspaceProjectSectionItemView = (Extract<WorkspaceProjectSectionItem, {
|
|
51
|
+
kind: "file";
|
|
52
|
+
}> & WorkspaceProjectOpenable) | Exclude<WorkspaceProjectSectionItem, {
|
|
53
|
+
kind: "file";
|
|
54
|
+
}>;
|
|
55
|
+
interface WorkspaceProjectSectionView {
|
|
56
|
+
label: string;
|
|
57
|
+
items: readonly WorkspaceProjectSectionItemView[];
|
|
58
|
+
}
|
|
59
|
+
type WorkspaceProjectThreadView = WorkspaceProjectThread & WorkspaceProjectOpenable;
|
|
60
|
+
/** Data-only project projection hydrated with card actions outside Query. */
|
|
61
|
+
interface WorkspaceProjectView extends Omit<WorkspaceProject, "files" | "sections" | "threads"> {
|
|
62
|
+
files?: readonly WorkspaceProjectFileView[];
|
|
63
|
+
sections?: readonly WorkspaceProjectSectionView[];
|
|
64
|
+
threads?: readonly WorkspaceProjectThreadView[];
|
|
30
65
|
onOpen?: () => void;
|
|
31
66
|
onDelete?: () => void | Promise<void>;
|
|
32
67
|
}
|
|
@@ -38,7 +73,7 @@ interface WorkspaceProjectSource {
|
|
|
38
73
|
onDelete?: (path: string) => void | Promise<void>;
|
|
39
74
|
}
|
|
40
75
|
interface WorkspaceProjectCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
|
|
41
|
-
project:
|
|
76
|
+
project: WorkspaceProjectView;
|
|
42
77
|
}
|
|
43
78
|
interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps, "project"> {
|
|
44
79
|
path: string;
|
|
@@ -46,10 +81,8 @@ interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps,
|
|
|
46
81
|
fallback?: React.ReactNode;
|
|
47
82
|
}
|
|
48
83
|
interface WorkspaceProjectsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
error?: string;
|
|
52
|
-
onRetry?: () => void;
|
|
84
|
+
/** Shared workspace query and host actions, also used by inline project cards. */
|
|
85
|
+
source: WorkspaceProjectSource;
|
|
53
86
|
}
|
|
54
87
|
declare function WorkspaceProjectCard({
|
|
55
88
|
className,
|
|
@@ -79,15 +112,11 @@ declare function useWorkspaceProjects(source: WorkspaceProjectSource): readonly
|
|
|
79
112
|
*/
|
|
80
113
|
declare function WorkspaceProjectsPanel({
|
|
81
114
|
className,
|
|
82
|
-
|
|
83
|
-
projects,
|
|
84
|
-
onRetry,
|
|
115
|
+
source,
|
|
85
116
|
ref,
|
|
86
117
|
...props
|
|
87
118
|
}: WorkspaceProjectsPanelProps & {
|
|
88
|
-
ref?: React.Ref<HTMLElement>;
|
|
119
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLElement>;
|
|
89
120
|
}): React.JSX.Element;
|
|
90
|
-
/** Canonical workbench descriptor; hosts supply only the source adapter. */
|
|
91
|
-
declare function workspaceProjectsPanel(source: WorkspaceProjectSource): ThinkFullAppPanel;
|
|
92
121
|
//#endregion
|
|
93
|
-
export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects
|
|
122
|
+
export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectFileView, WorkspaceProjectSection, WorkspaceProjectSectionItem, WorkspaceProjectSectionItemView, WorkspaceProjectSectionView, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectThreadView, WorkspaceProjectView, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import { $ as UserIcon, C as FolderIcon, S as FileIcon, j as MessageSquareIcon, u as CalendarIcon } from "../../icons-cuEtsgj9.js";
|
|
2
|
+
import { $ as UserIcon, C as FolderIcon, D as LinkIcon, K as SpinnerIcon, S as FileIcon, j as MessageSquareIcon, u as CalendarIcon } from "../../icons-cuEtsgj9.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
5
|
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
6
6
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
7
|
+
import { LinkButton } from "../foundations/LinkButton.js";
|
|
7
8
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
8
9
|
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
9
|
-
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink } from "../../workspace-assets-
|
|
10
|
+
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
|
|
10
11
|
import * as React from "react";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -51,30 +52,55 @@ function LinkList({ items }) {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
function ProjectDetails({ project }) {
|
|
54
|
-
const
|
|
55
|
+
const referencedFiles = new Set((project.sections ?? []).flatMap(({ items }) => items.flatMap((item) => item.kind === "file" ? [item.path] : [])));
|
|
56
|
+
const files = (project.files ?? []).filter((file) => !file.path.endsWith("/PROJECT.md") && !referencedFiles.has(file.path));
|
|
57
|
+
const sections = (project.sections ?? []).filter(({ items }) => items.length > 0);
|
|
55
58
|
const threads = project.threads ?? [];
|
|
56
|
-
if (files.length === 0 && threads.length === 0) return null;
|
|
59
|
+
if (files.length === 0 && sections.length === 0 && threads.length === 0) return null;
|
|
57
60
|
return /* @__PURE__ */ jsxs(DescriptionList.Root, {
|
|
58
61
|
align: "start",
|
|
59
62
|
variant: "divided",
|
|
60
|
-
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
63
|
+
children: [
|
|
64
|
+
sections.map((section) => /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: section.label }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "sigvelo-cluster",
|
|
66
|
+
children: section.items.map((item) => item.kind === "file" ? /* @__PURE__ */ jsx(WorkspaceComposerLink, {
|
|
67
|
+
value: item.path,
|
|
68
|
+
label: item.label,
|
|
69
|
+
hint: item.path,
|
|
70
|
+
onOpen: item.onOpen
|
|
71
|
+
}, `${item.kind}:${item.path}`) : item.kind === "link" ? /* @__PURE__ */ jsxs(LinkButton, {
|
|
72
|
+
href: item.href,
|
|
73
|
+
target: "_blank",
|
|
74
|
+
rel: "noreferrer",
|
|
75
|
+
variant: "link",
|
|
76
|
+
color: "neutral",
|
|
77
|
+
size: "xs",
|
|
78
|
+
children: [/* @__PURE__ */ jsx(FaviconMark, {
|
|
79
|
+
href: item.href,
|
|
80
|
+
fallback: /* @__PURE__ */ jsx(LinkIcon, {})
|
|
81
|
+
}), item.label]
|
|
82
|
+
}, `${item.kind}:${item.href}`) : /* @__PURE__ */ jsx("span", { children: item.label }, `${item.kind}:${item.label}`))
|
|
83
|
+
}) })] }, section.label)),
|
|
84
|
+
files.length > 0 ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Contents" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "sigvelo-cluster",
|
|
86
|
+
children: files.map((file) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
|
|
87
|
+
value: file.path,
|
|
88
|
+
label: file.label,
|
|
89
|
+
hint: file.path,
|
|
90
|
+
onOpen: file.onOpen
|
|
91
|
+
}, file.path))
|
|
92
|
+
}) })] }) : null,
|
|
93
|
+
ORIGIN_ORDER.map((origin) => {
|
|
94
|
+
const grouped = threads.filter((thread) => thread.origin === origin);
|
|
95
|
+
if (grouped.length === 0) return null;
|
|
96
|
+
return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: ORIGIN_LABEL[origin] }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx(LinkList, { items: grouped.map((thread) => ({
|
|
97
|
+
key: thread.id,
|
|
98
|
+
label: thread.title,
|
|
99
|
+
icon: thread.icon ?? ORIGIN_ICON[origin],
|
|
100
|
+
onOpen: thread.onOpen
|
|
101
|
+
})) }) })] }, origin);
|
|
102
|
+
})
|
|
103
|
+
]
|
|
78
104
|
});
|
|
79
105
|
}
|
|
80
106
|
function WorkspaceProjectCard({ className, project, ref, ...props }) {
|
|
@@ -93,7 +119,10 @@ function WorkspaceProjectCard({ className, project, ref, ...props }) {
|
|
|
93
119
|
/* @__PURE__ */ jsxs(CardTitle, {
|
|
94
120
|
id: titleId,
|
|
95
121
|
className: "connected-app-card__title",
|
|
96
|
-
render: /* @__PURE__ */ jsx("h3", {
|
|
122
|
+
render: (props) => /* @__PURE__ */ jsx("h3", {
|
|
123
|
+
...props,
|
|
124
|
+
children: props.children
|
|
125
|
+
}),
|
|
97
126
|
children: [/* @__PURE__ */ jsx("span", {
|
|
98
127
|
className: "connected-app-card__icon",
|
|
99
128
|
"aria-hidden": "true",
|
|
@@ -126,7 +155,7 @@ function WorkspaceProjectFileCard({ fallback = null, path, source, ...props }) {
|
|
|
126
155
|
return project ? /* @__PURE__ */ jsx(WorkspaceProjectCard, {
|
|
127
156
|
...props,
|
|
128
157
|
project: projectWithSource(project, source)
|
|
129
|
-
}) : fallback;
|
|
158
|
+
}, JSON.stringify(source.queryOptions.queryKey)) : fallback;
|
|
130
159
|
}
|
|
131
160
|
/** Design-system-owned project query shared by panels, cards, and composer context. */
|
|
132
161
|
function useWorkspaceProjects(source) {
|
|
@@ -137,7 +166,9 @@ function useWorkspaceProjects(source) {
|
|
|
137
166
|
* query failure with nothing loaded renders as a quiet inline error, never as
|
|
138
167
|
* an empty library.
|
|
139
168
|
*/
|
|
140
|
-
function WorkspaceProjectsPanel({ className,
|
|
169
|
+
function WorkspaceProjectsPanel({ className, source, ref, ...props }) {
|
|
170
|
+
const query = useQuery(source.queryOptions);
|
|
171
|
+
const projects = query.data ?? [];
|
|
141
172
|
return /* @__PURE__ */ jsx("section", {
|
|
142
173
|
ref,
|
|
143
174
|
"data-slot": "workspace-projects-panel",
|
|
@@ -146,23 +177,26 @@ function WorkspaceProjectsPanel({ className, error, projects, onRetry, ref, ...p
|
|
|
146
177
|
"aria-label": props["aria-label"] ?? "Projects",
|
|
147
178
|
children: projects.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
148
179
|
className: "sigvelo-stack-list sigvelo-stack",
|
|
149
|
-
children: projects.map((project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectCard, { project }) }, project.path))
|
|
150
|
-
}) : error
|
|
180
|
+
children: projects.map((project) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceProjectCard, { project: projectWithSource(project, source) }) }, project.path))
|
|
181
|
+
}) : query.error ? /* @__PURE__ */ jsx(EmptyState, {
|
|
151
182
|
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
152
183
|
title: "Projects unavailable",
|
|
153
|
-
description: error,
|
|
154
|
-
children:
|
|
184
|
+
description: formatErrorMessage(query.error),
|
|
185
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
155
186
|
size: "sm",
|
|
156
187
|
variant: "outline",
|
|
157
188
|
color: "neutral",
|
|
158
|
-
onClick:
|
|
189
|
+
onClick: () => void query.refetch(),
|
|
159
190
|
children: "Retry"
|
|
160
|
-
})
|
|
191
|
+
})
|
|
192
|
+
}) : query.isPending ? /* @__PURE__ */ jsx(EmptyState, {
|
|
193
|
+
icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
|
|
194
|
+
title: "Loading projects"
|
|
161
195
|
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
162
196
|
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
163
197
|
title: "No projects"
|
|
164
198
|
})
|
|
165
|
-
});
|
|
199
|
+
}, JSON.stringify(source.queryOptions.queryKey));
|
|
166
200
|
}
|
|
167
201
|
function projectWithSource(project, source) {
|
|
168
202
|
return {
|
|
@@ -171,6 +205,13 @@ function projectWithSource(project, source) {
|
|
|
171
205
|
...file,
|
|
172
206
|
onOpen: source.onOpenFile ? () => source.onOpenFile?.(file.path) : void 0
|
|
173
207
|
})),
|
|
208
|
+
sections: project.sections?.map((section) => ({
|
|
209
|
+
...section,
|
|
210
|
+
items: section.items.map((item) => item.kind === "file" ? {
|
|
211
|
+
...item,
|
|
212
|
+
onOpen: source.onOpenFile ? () => source.onOpenFile?.(item.path) : void 0
|
|
213
|
+
} : item)
|
|
214
|
+
})),
|
|
174
215
|
threads: project.threads?.map((thread) => ({
|
|
175
216
|
...thread,
|
|
176
217
|
onOpen: source.onOpenThread ? () => source.onOpenThread?.(thread.id) : void 0
|
|
@@ -179,23 +220,5 @@ function projectWithSource(project, source) {
|
|
|
179
220
|
onDelete: source.onDelete ? () => source.onDelete?.(project.path) : void 0
|
|
180
221
|
};
|
|
181
222
|
}
|
|
182
|
-
function WorkspaceProjectSourcePanel({ source }) {
|
|
183
|
-
const query = useQuery(source.queryOptions);
|
|
184
|
-
return /* @__PURE__ */ jsx(WorkspaceProjectsPanel, {
|
|
185
|
-
projects: (query.data ?? []).map((project) => projectWithSource(project, source)),
|
|
186
|
-
error: query.isError ? formatErrorMessage(query.error) : void 0,
|
|
187
|
-
onRetry: query.isError ? () => void query.refetch() : void 0,
|
|
188
|
-
"aria-busy": query.isFetching || void 0
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
/** Canonical workbench descriptor; hosts supply only the source adapter. */
|
|
192
|
-
function workspaceProjectsPanel(source) {
|
|
193
|
-
return {
|
|
194
|
-
id: "projects",
|
|
195
|
-
label: "Projects",
|
|
196
|
-
icon: /* @__PURE__ */ jsx(FolderIcon, {}),
|
|
197
|
-
render: () => /* @__PURE__ */ jsx(WorkspaceProjectSourcePanel, { source })
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
223
|
//#endregion
|
|
201
|
-
export { WorkspaceProjectCard, WorkspaceProjectFileCard, WorkspaceProjectsPanel, useWorkspaceProjects
|
|
224
|
+
export { WorkspaceProjectCard, WorkspaceProjectFileCard, WorkspaceProjectsPanel, useWorkspaceProjects };
|
|
@@ -41,7 +41,7 @@ declare function WorkspaceUserScriptsPanel({
|
|
|
41
41
|
scripts,
|
|
42
42
|
...props
|
|
43
43
|
}: WorkspaceUserScriptsPanelProps & {
|
|
44
|
-
ref?: React.Ref<HTMLElement>;
|
|
44
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLElement>;
|
|
45
45
|
}): React.JSX.Element;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { WorkspaceUserScript, WorkspaceUserScriptCard, WorkspaceUserScriptCardProps, WorkspaceUserScriptsPanel, WorkspaceUserScriptsPanelProps };
|
|
@@ -5,7 +5,7 @@ import { EmptyState } from "../foundations/EmptyState.js";
|
|
|
5
5
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
6
6
|
import { Switch } from "../foundations/Switch.js";
|
|
7
7
|
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
8
|
-
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-
|
|
8
|
+
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
|
|
9
9
|
import * as React from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/agents-sdk/WorkspaceUserScript.tsx
|
|
@@ -93,7 +93,10 @@ function WorkspaceUserScriptCard({ className, script, ref, ...props }) {
|
|
|
93
93
|
/* @__PURE__ */ jsxs(CardTitle, {
|
|
94
94
|
id: titleId,
|
|
95
95
|
className: "connected-app-card__title",
|
|
96
|
-
render: /* @__PURE__ */ jsx("h3", {
|
|
96
|
+
render: (props) => /* @__PURE__ */ jsx("h3", {
|
|
97
|
+
...props,
|
|
98
|
+
children: props.children
|
|
99
|
+
}),
|
|
97
100
|
children: [/* @__PURE__ */ jsx("span", {
|
|
98
101
|
className: "connected-app-card__icon",
|
|
99
102
|
"aria-hidden": "true",
|
|
@@ -43,7 +43,7 @@ declare function Activity({
|
|
|
43
43
|
ref,
|
|
44
44
|
...props
|
|
45
45
|
}: ActivityProps & {
|
|
46
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
46
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
|
|
47
47
|
}): React.JSX.Element;
|
|
48
48
|
interface ActivityTriggerProps extends Omit<React.ComponentProps<typeof Collapsible.Trigger>, "unstyled" | "children"> {
|
|
49
49
|
/** The action being taken. Defaults to "Working…". */
|