@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,34 +1,33 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
-
import {
|
|
2
|
+
import { K as SpinnerIcon, S as FileIcon, Z as TerminalIcon, d as CheckIcon, z as PlayIcon } from "../../icons-cuEtsgj9.js";
|
|
3
3
|
import { Button } from "../foundations/Button.js";
|
|
4
4
|
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
-
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
6
|
-
import { EmptyState } from "../foundations/EmptyState.js";
|
|
5
|
+
import { a as formatErrorMessage, o as formatUnknownValue, r as firstLine } from "../../format-COCyV98Z.js";
|
|
7
6
|
import { Field } from "../foundations/Field.js";
|
|
8
7
|
import { Form } from "../foundations/Form.js";
|
|
8
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
9
9
|
import { Input } from "../foundations/Input.js";
|
|
10
10
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
11
|
-
import {
|
|
11
|
+
import { Checkbox } from "../foundations/Checkbox.js";
|
|
12
12
|
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
13
|
-
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, r as httpUrl, t as FaviconMark } from "../../workspace-assets-
|
|
13
|
+
import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, r as httpUrl, t as FaviconMark } from "../../workspace-assets-Bg7XhPsk.js";
|
|
14
14
|
import * as React from "react";
|
|
15
|
+
import { createElement } from "react";
|
|
15
16
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { useQuery } from "@tanstack/react-query";
|
|
17
|
+
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
17
18
|
//#region src/components/agents-sdk/WorkspaceExecution.tsx
|
|
18
19
|
function draftFrom(parameters) {
|
|
19
|
-
return Object.fromEntries(parameters.
|
|
20
|
+
return Object.fromEntries(parameters.flatMap((parameter) => parameter.value === void 0 ? [] : [[parameter.name, parameter.type === "boolean" ? Boolean(parameter.value) : String(parameter.value)]]));
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* fields and non-numeric numbers refuse the run with a field-level message.
|
|
23
|
+
* Values for one run. Empty and untouched fields stay absent so module
|
|
24
|
+
* defaults work. Schema types improve the input but never gate execution.
|
|
25
25
|
*/
|
|
26
26
|
function collectRunParameters(parameters, draft) {
|
|
27
27
|
const collected = [];
|
|
28
|
-
const problems = [];
|
|
29
28
|
for (const parameter of parameters) {
|
|
30
29
|
if (parameter.type === "boolean") {
|
|
31
|
-
collected.push({
|
|
30
|
+
if (Object.hasOwn(draft, parameter.name)) collected.push({
|
|
32
31
|
...parameter,
|
|
33
32
|
value: Boolean(draft[parameter.name])
|
|
34
33
|
});
|
|
@@ -36,19 +35,12 @@ function collectRunParameters(parameters, draft) {
|
|
|
36
35
|
}
|
|
37
36
|
const raw = draft[parameter.name];
|
|
38
37
|
const text = (typeof raw === "string" ? raw : String(raw ?? "")).trim();
|
|
39
|
-
if (text === "")
|
|
40
|
-
if (parameter.required) problems.push(`${parameter.label} is required.`);
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
38
|
+
if (text === "") continue;
|
|
43
39
|
if (parameter.type === "number") {
|
|
44
40
|
const numeric = Number(text);
|
|
45
|
-
if (!Number.isFinite(numeric)) {
|
|
46
|
-
problems.push(`${parameter.label} must be a number.`);
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
41
|
collected.push({
|
|
50
42
|
...parameter,
|
|
51
|
-
value: numeric
|
|
43
|
+
value: Number.isFinite(numeric) ? numeric : text
|
|
52
44
|
});
|
|
53
45
|
continue;
|
|
54
46
|
}
|
|
@@ -57,66 +49,15 @@ function collectRunParameters(parameters, draft) {
|
|
|
57
49
|
value: text
|
|
58
50
|
});
|
|
59
51
|
}
|
|
60
|
-
return
|
|
61
|
-
status: "invalid",
|
|
62
|
-
message: problems.join(" ")
|
|
63
|
-
} : {
|
|
64
|
-
status: "ok",
|
|
65
|
-
parameters: collected
|
|
66
|
-
};
|
|
52
|
+
return collected;
|
|
67
53
|
}
|
|
68
54
|
function snapshotValue(parameter) {
|
|
55
|
+
if (parameter.value === void 0) return "";
|
|
69
56
|
if (parameter.type === "boolean") return parameter.value ? "Yes" : "No";
|
|
70
|
-
return String(parameter.value
|
|
71
|
-
}
|
|
72
|
-
function siteHref(value) {
|
|
73
|
-
return httpUrl(value.includes("://") ? value : `https://${value}`);
|
|
74
|
-
}
|
|
75
|
-
function siteMarks(values) {
|
|
76
|
-
const marks = [];
|
|
77
|
-
for (const value of values) {
|
|
78
|
-
const trimmed = value.trim();
|
|
79
|
-
if (!trimmed) continue;
|
|
80
|
-
const href = siteHref(trimmed);
|
|
81
|
-
let site = trimmed;
|
|
82
|
-
if (href) try {
|
|
83
|
-
site = new URL(href).hostname.replace(/^www\./, "");
|
|
84
|
-
} catch {
|
|
85
|
-
site = trimmed;
|
|
86
|
-
}
|
|
87
|
-
if (!site || marks.some((mark) => mark.site === site)) continue;
|
|
88
|
-
marks.push({
|
|
89
|
-
site,
|
|
90
|
-
href,
|
|
91
|
-
hint: trimmed
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
return marks;
|
|
57
|
+
return String(parameter.value);
|
|
95
58
|
}
|
|
96
59
|
function ExecutionIcon({ module }) {
|
|
97
|
-
|
|
98
|
-
const href = siteMarks(module.sites ?? []).find((mark) => mark.href)?.href;
|
|
99
|
-
return href ? /* @__PURE__ */ jsx(FaviconMark, {
|
|
100
|
-
href,
|
|
101
|
-
fallback: /* @__PURE__ */ jsx(TerminalIcon, {})
|
|
102
|
-
}) : /* @__PURE__ */ jsx(TerminalIcon, {});
|
|
103
|
-
}
|
|
104
|
-
function SiteDetails({ sites }) {
|
|
105
|
-
const marks = siteMarks(sites);
|
|
106
|
-
if (marks.length === 0) return null;
|
|
107
|
-
return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Sites" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx("div", {
|
|
108
|
-
className: "sigvelo-cluster",
|
|
109
|
-
children: marks.map(({ href, hint, site }) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
|
|
110
|
-
kind: "tab",
|
|
111
|
-
value: site,
|
|
112
|
-
label: site,
|
|
113
|
-
hint: hint === site ? void 0 : hint,
|
|
114
|
-
icon: /* @__PURE__ */ jsx(FaviconMark, {
|
|
115
|
-
href,
|
|
116
|
-
fallback: /* @__PURE__ */ jsx(MonitorIcon, {})
|
|
117
|
-
})
|
|
118
|
-
}, site))
|
|
119
|
-
}) })] });
|
|
60
|
+
return module.icon ?? /* @__PURE__ */ jsx(TerminalIcon, {});
|
|
120
61
|
}
|
|
121
62
|
function RunLinks({ runs }) {
|
|
122
63
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -129,61 +70,63 @@ function RunLinks({ runs }) {
|
|
|
129
70
|
}, run.path))
|
|
130
71
|
});
|
|
131
72
|
}
|
|
132
|
-
function RunDetails({
|
|
133
|
-
const completed =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
73
|
+
function RunDetails({ outcome, runs }) {
|
|
74
|
+
const completed = outcome !== void 0;
|
|
75
|
+
const result = outcome?.result != null ? firstLine(formatUnknownValue(outcome.result)) : "";
|
|
76
|
+
const log = outcome ? firstLine(outcome.logs.join("\n")) : "";
|
|
77
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
|
+
completed ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Last run" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: "sigvelo-cluster",
|
|
80
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
81
|
+
className: "workspace-execution-outcome",
|
|
82
|
+
children: [/* @__PURE__ */ jsx(CheckIcon, { size: 14 }), "Completed"]
|
|
83
|
+
}), outcome.runs.length > 0 ? /* @__PURE__ */ jsx(RunLinks, { runs: outcome.runs }) : null]
|
|
84
|
+
}) })] }) : null,
|
|
85
|
+
result ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Result" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: result })] }) : null,
|
|
86
|
+
log ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Log" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: log })] }) : null,
|
|
87
|
+
runs.length > 0 ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: completed ? "Earlier" : runs.length === 1 ? "Last" : "Runs" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsx(RunLinks, { runs }) })] }) : null
|
|
88
|
+
] });
|
|
141
89
|
}
|
|
142
|
-
function ExecutionFields({ draft,
|
|
90
|
+
function ExecutionFields({ draft, outcome, parameters, runs, onDraftChange }) {
|
|
143
91
|
const fieldId = React.useId();
|
|
144
92
|
const editing = draft != null && onDraftChange != null;
|
|
145
|
-
const siteItems = siteMarks(sites ?? []);
|
|
146
93
|
const runItems = runs ?? [];
|
|
147
94
|
const visibleParameters = editing ? parameters : parameters.filter((parameter) => snapshotValue(parameter) !== "");
|
|
148
|
-
if (visibleParameters.length === 0 &&
|
|
95
|
+
if (visibleParameters.length === 0 && runItems.length === 0 && outcome === void 0) return null;
|
|
149
96
|
return /* @__PURE__ */ jsxs(DescriptionList.Root, {
|
|
150
97
|
align: "start",
|
|
151
98
|
variant: "divided",
|
|
152
|
-
children: [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
runState,
|
|
184
|
-
runs: runItems
|
|
185
|
-
})
|
|
186
|
-
]
|
|
99
|
+
children: [visibleParameters.map((parameter) => {
|
|
100
|
+
const id = `${fieldId}-${parameter.name}`;
|
|
101
|
+
const parameterLabel = editing && parameter.required ? `${parameter.label} (required)` : parameter.label;
|
|
102
|
+
const href = parameter.type === "string" ? httpUrl(String(editing ? draft?.[parameter.name] ?? parameter.value : parameter.value)) : void 0;
|
|
103
|
+
return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsxs(DescriptionList.Term, {
|
|
104
|
+
id: parameter.type === "boolean" ? id : void 0,
|
|
105
|
+
children: [href ? /* @__PURE__ */ jsx(FaviconMark, { href }) : null, editing && parameter.type !== "boolean" ? /* @__PURE__ */ jsx("label", {
|
|
106
|
+
htmlFor: id,
|
|
107
|
+
children: parameterLabel
|
|
108
|
+
}) : parameterLabel]
|
|
109
|
+
}), /* @__PURE__ */ jsx(DescriptionList.Details, { children: editing && parameter.type === "boolean" ? /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
110
|
+
checked: draft?.[parameter.name] === true,
|
|
111
|
+
indeterminate: draft?.[parameter.name] === void 0,
|
|
112
|
+
"aria-labelledby": id,
|
|
113
|
+
onCheckedChange: (checked) => {
|
|
114
|
+
if (typeof checked === "boolean") onDraftChange?.(parameter.name, checked);
|
|
115
|
+
},
|
|
116
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {})
|
|
117
|
+
}) : editing ? /* @__PURE__ */ jsx(Input, {
|
|
118
|
+
id,
|
|
119
|
+
name: parameter.name,
|
|
120
|
+
type: href ? "url" : void 0,
|
|
121
|
+
value: String(draft?.[parameter.name] ?? ""),
|
|
122
|
+
autoComplete: "off",
|
|
123
|
+
inputMode: parameter.type === "number" ? "decimal" : void 0,
|
|
124
|
+
onChange: (event) => onDraftChange?.(parameter.name, event.currentTarget.value)
|
|
125
|
+
}) : snapshotValue(parameter) })] }, parameter.name);
|
|
126
|
+
}), /* @__PURE__ */ jsx(RunDetails, {
|
|
127
|
+
outcome,
|
|
128
|
+
runs: runItems
|
|
129
|
+
})]
|
|
187
130
|
});
|
|
188
131
|
}
|
|
189
132
|
function ExecutionActions({ busy, module }) {
|
|
@@ -218,50 +161,40 @@ function ExecutionActions({ busy, module }) {
|
|
|
218
161
|
function executionFormKey(module) {
|
|
219
162
|
return `${module.path}:${JSON.stringify(module.parameters)}`;
|
|
220
163
|
}
|
|
221
|
-
function WorkspaceExecutionCard({
|
|
164
|
+
function WorkspaceExecutionCard({ module, ...props }) {
|
|
165
|
+
return /* @__PURE__ */ createElement(WorkspaceExecutionCardSession, {
|
|
166
|
+
...props,
|
|
167
|
+
key: module.path,
|
|
168
|
+
module
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function WorkspaceExecutionCardSession({ className, module, ref, ...props }) {
|
|
222
172
|
const titleId = React.useId();
|
|
223
173
|
const ariaLabel = props["aria-label"];
|
|
224
174
|
const ariaLabelledBy = props["aria-labelledby"] ?? (ariaLabel ? void 0 : titleId);
|
|
225
175
|
const editing = module.onRun != null;
|
|
226
176
|
const [draft, setDraft] = React.useState(() => draftFrom(module.parameters));
|
|
227
|
-
const [runState, setRunState] = React.useState({ status: "idle" });
|
|
228
|
-
const [validationMessage, setValidationMessage] = React.useState("");
|
|
229
177
|
const formKey = executionFormKey(module);
|
|
230
178
|
const [seenFormKey, setSeenFormKey] = React.useState(formKey);
|
|
231
179
|
if (formKey !== seenFormKey) {
|
|
232
180
|
setSeenFormKey(formKey);
|
|
233
181
|
setDraft(draftFrom(module.parameters));
|
|
234
|
-
setValidationMessage("");
|
|
235
182
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
setValidationMessage("");
|
|
245
|
-
setRunState({ status: "running" });
|
|
246
|
-
try {
|
|
247
|
-
setRunState({
|
|
248
|
-
status: "completed",
|
|
249
|
-
runs: await module.onRun(submission.parameters)
|
|
250
|
-
});
|
|
251
|
-
} catch (error) {
|
|
252
|
-
setRunState({
|
|
253
|
-
status: "failed",
|
|
254
|
-
message: formatErrorMessage(error)
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
const errorMessage = validationMessage || (runState.status === "failed" ? runState.message : "");
|
|
259
|
-
const hasBody = module.parameters.length > 0 || (module.sites?.length ?? 0) > 0 || (module.runs?.length ?? 0) > 0 || runState.status === "completed" || editing || Boolean(errorMessage);
|
|
183
|
+
const runMutation = useMutation({ mutationFn: async () => {
|
|
184
|
+
if (!module.onRun) throw new Error("Execution is no longer available.");
|
|
185
|
+
return module.onRun(collectRunParameters(module.parameters, draft));
|
|
186
|
+
} });
|
|
187
|
+
const busy = runMutation.isPending;
|
|
188
|
+
const errorMessage = runMutation.isError ? formatErrorMessage(runMutation.error) : "";
|
|
189
|
+
const hasBody = module.parameters.length > 0 || (module.runs?.length ?? 0) > 0 || runMutation.isSuccess || editing || Boolean(errorMessage);
|
|
260
190
|
const header = /* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
261
191
|
/* @__PURE__ */ jsxs(CardTitle, {
|
|
262
192
|
id: titleId,
|
|
263
193
|
className: "connected-app-card__title",
|
|
264
|
-
render: /* @__PURE__ */ jsx("h3", {
|
|
194
|
+
render: (props) => /* @__PURE__ */ jsx("h3", {
|
|
195
|
+
...props,
|
|
196
|
+
children: props.children
|
|
197
|
+
}),
|
|
265
198
|
children: [/* @__PURE__ */ jsx("span", {
|
|
266
199
|
className: "connected-app-card__icon",
|
|
267
200
|
"aria-hidden": "true",
|
|
@@ -277,30 +210,27 @@ function WorkspaceExecutionCard({ className, module, ref, ...props }) {
|
|
|
277
210
|
const body = hasBody ? /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
278
211
|
/* @__PURE__ */ jsx(ExecutionFields, {
|
|
279
212
|
draft: editing ? draft : void 0,
|
|
213
|
+
outcome: runMutation.isSuccess ? runMutation.data : void 0,
|
|
280
214
|
parameters: module.parameters,
|
|
281
|
-
runState,
|
|
282
215
|
runs: module.runs,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
...current,
|
|
288
|
-
[name]: value
|
|
289
|
-
}));
|
|
290
|
-
} : void 0
|
|
216
|
+
onDraftChange: editing ? (name, value) => setDraft((current) => ({
|
|
217
|
+
...current,
|
|
218
|
+
[name]: value
|
|
219
|
+
})) : void 0
|
|
291
220
|
}),
|
|
292
221
|
errorMessage ? /* @__PURE__ */ jsx(Field.Errors, { errors: [errorMessage] }) : null,
|
|
293
222
|
/* @__PURE__ */ jsx("span", {
|
|
294
223
|
className: "sigvelo-visually-hidden",
|
|
295
224
|
role: "status",
|
|
296
225
|
"aria-atomic": "true",
|
|
297
|
-
children: errorMessage || (busy ? "Running" :
|
|
226
|
+
children: errorMessage || (busy ? "Running" : runMutation.isSuccess ? "Completed" : "")
|
|
298
227
|
})
|
|
299
228
|
] }) : null;
|
|
300
229
|
const inner = editing ? /* @__PURE__ */ jsxs(Form, {
|
|
230
|
+
noValidate: true,
|
|
301
231
|
onSubmit: (event) => {
|
|
302
232
|
event.preventDefault();
|
|
303
|
-
|
|
233
|
+
if (!busy) runMutation.mutate();
|
|
304
234
|
},
|
|
305
235
|
children: [header, body]
|
|
306
236
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [header, body] });
|
|
@@ -324,13 +254,15 @@ function WorkspaceExecutionFile({ fallback = null, path, source, ...props }) {
|
|
|
324
254
|
return /* @__PURE__ */ jsx(WorkspaceExecutionCard, {
|
|
325
255
|
...props,
|
|
326
256
|
module: executionWithSource(module, source)
|
|
327
|
-
});
|
|
257
|
+
}, JSON.stringify(source.queryOptions.queryKey));
|
|
328
258
|
}
|
|
329
259
|
/**
|
|
330
260
|
* Workbench library. Same card as the inline placement. A query failure with
|
|
331
261
|
* nothing loaded renders as a quiet inline error, never as an empty library.
|
|
332
262
|
*/
|
|
333
|
-
function WorkspaceExecutionsPanel({ className,
|
|
263
|
+
function WorkspaceExecutionsPanel({ className, source, ref, ...props }) {
|
|
264
|
+
const query = useQuery(source.queryOptions);
|
|
265
|
+
const modules = query.data ?? [];
|
|
334
266
|
return /* @__PURE__ */ jsx("section", {
|
|
335
267
|
ref,
|
|
336
268
|
"data-slot": "workspace-executions-panel",
|
|
@@ -339,23 +271,26 @@ function WorkspaceExecutionsPanel({ className, error, modules, onRetry, ref, ...
|
|
|
339
271
|
"aria-label": props["aria-label"] ?? "Executions",
|
|
340
272
|
children: modules.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
341
273
|
className: "sigvelo-stack-list sigvelo-stack",
|
|
342
|
-
children: modules.map((module) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceExecutionCard, { module }) }, module.path))
|
|
343
|
-
}) : error
|
|
274
|
+
children: modules.map((module) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceExecutionCard, { module: executionWithSource(module, source) }) }, module.path))
|
|
275
|
+
}) : query.error ? /* @__PURE__ */ jsx(EmptyState, {
|
|
344
276
|
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
345
277
|
title: "Executions unavailable",
|
|
346
|
-
description: error,
|
|
347
|
-
children:
|
|
278
|
+
description: formatErrorMessage(query.error),
|
|
279
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
348
280
|
size: "sm",
|
|
349
281
|
variant: "outline",
|
|
350
282
|
color: "neutral",
|
|
351
|
-
onClick:
|
|
283
|
+
onClick: () => void query.refetch(),
|
|
352
284
|
children: "Retry"
|
|
353
|
-
})
|
|
285
|
+
})
|
|
286
|
+
}) : query.isPending ? /* @__PURE__ */ jsx(EmptyState, {
|
|
287
|
+
icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
|
|
288
|
+
title: "Loading modules"
|
|
354
289
|
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
355
290
|
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
356
291
|
title: "No modules"
|
|
357
292
|
})
|
|
358
|
-
});
|
|
293
|
+
}, JSON.stringify(source.queryOptions.queryKey));
|
|
359
294
|
}
|
|
360
295
|
function executionWithSource(module, source) {
|
|
361
296
|
const { onDelete, onOpen, onRun } = source;
|
|
@@ -366,28 +301,16 @@ function executionWithSource(module, source) {
|
|
|
366
301
|
return {
|
|
367
302
|
...module,
|
|
368
303
|
runs: module.runs?.map(withOpen),
|
|
369
|
-
onRun: onRun ? async (parameters) =>
|
|
304
|
+
onRun: onRun ? async (parameters) => {
|
|
305
|
+
const outcome = await onRun(module.path, parameters);
|
|
306
|
+
return {
|
|
307
|
+
...outcome,
|
|
308
|
+
runs: outcome.runs.map(withOpen)
|
|
309
|
+
};
|
|
310
|
+
} : void 0,
|
|
370
311
|
onOpen: onOpen ? () => onOpen(module.path) : void 0,
|
|
371
312
|
onDelete: onDelete ? () => onDelete(module.path) : void 0
|
|
372
313
|
};
|
|
373
314
|
}
|
|
374
|
-
function WorkspaceExecutionSourcePanel({ source }) {
|
|
375
|
-
const query = useQuery(source.queryOptions);
|
|
376
|
-
return /* @__PURE__ */ jsx(WorkspaceExecutionsPanel, {
|
|
377
|
-
modules: (query.data ?? []).map((module) => executionWithSource(module, source)),
|
|
378
|
-
error: query.isError ? formatErrorMessage(query.error) : void 0,
|
|
379
|
-
onRetry: query.isError ? () => void query.refetch() : void 0,
|
|
380
|
-
"aria-busy": query.isFetching || void 0
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
/** Canonical workbench descriptor; hosts supply only the source adapter. */
|
|
384
|
-
function workspaceExecutionsPanel(source) {
|
|
385
|
-
return {
|
|
386
|
-
id: "executions",
|
|
387
|
-
label: "Executions",
|
|
388
|
-
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
389
|
-
render: () => /* @__PURE__ */ jsx(WorkspaceExecutionSourcePanel, { source })
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
315
|
//#endregion
|
|
393
|
-
export { WorkspaceExecutionCard, WorkspaceExecutionFile, WorkspaceExecutionsPanel
|
|
316
|
+
export { WorkspaceExecutionCard, WorkspaceExecutionFile, WorkspaceExecutionsPanel };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-Bh9-Jo1r.js";
|
|
2
|
-
import { b as WorkspaceState } from "../../Workspace-
|
|
2
|
+
import { b as WorkspaceState } from "../../Workspace-HzGrWDX3.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/agents-sdk/WorkspaceExplorer.d.ts
|
|
6
6
|
interface WorkspaceExplorerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
7
|
+
/** Workspace state that owns the file tree, selection, loading, and refresh behavior. */
|
|
7
8
|
workspace: WorkspaceState;
|
|
8
9
|
/** Host-owned URL/history adapter shared by chat links and the file explorer. */
|
|
9
10
|
navigation: WorkspaceNavigationAdapter;
|
|
@@ -15,7 +16,9 @@ interface WorkspaceExplorerProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
15
16
|
actions?: React.ReactNode;
|
|
16
17
|
/** Show the file filter input. Hidden by default to keep the browser compact. */
|
|
17
18
|
showFilter?: boolean;
|
|
19
|
+
/** Placeholder for the optional file filter. */
|
|
18
20
|
filterPlaceholder?: string;
|
|
21
|
+
/** Content shown when the workspace contains no visible files. */
|
|
19
22
|
emptyState?: React.ReactNode;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
@@ -26,7 +29,7 @@ interface WorkspaceExplorerProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
26
29
|
declare function WorkspaceExplorer({
|
|
27
30
|
...props
|
|
28
31
|
}: WorkspaceExplorerProps & {
|
|
29
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
32
|
+
/** Ref forwarded to the component's rendered root element. */ref?: React.Ref<HTMLDivElement>;
|
|
30
33
|
}): React.JSX.Element;
|
|
31
34
|
//#endregion
|
|
32
35
|
export { WorkspaceExplorer, WorkspaceExplorerProps };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
2
|
import { n as mergeRefs } from "../../merge-refs-DF_7w2x_.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as WorkspaceNavigationProvider, r as resolveWorkspaceLink } from "../../WorkspaceLink-BYZG-V_I.js";
|
|
4
|
+
import { WorkspaceNavigationRestorationBoundary, useRequiredWorkspaceNavigationRestoration } from "./WorkspaceNavigationRestoration.js";
|
|
4
5
|
import { WorkspaceBrowser } from "./WorkspaceBrowser.js";
|
|
5
|
-
import { t as WorkspaceFileView } from "../../WorkspaceFileView-
|
|
6
|
+
import { t as WorkspaceFileView } from "../../WorkspaceFileView-DYPtRVpM.js";
|
|
6
7
|
import * as React from "react";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/agents-sdk/WorkspaceExplorer.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as isWorkspaceTextPath, a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as isWorkspaceSkillPath, h as isWorkspaceMediaPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMarkdownPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as inferWorkspaceMimeType, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset, u as getWorkspaceBasename, v as parseWorkspaceSkill } from "../../WorkspaceFile-
|
|
1
|
+
import { _ as isWorkspaceTextPath, a as WorkspaceMediaInfo, c as WorkspaceMediaTrackKind, d as inferWorkspaceLanguage, f as inferWorkspaceMedia, g as isWorkspaceSkillPath, h as isWorkspaceMediaPath, i as WorkspaceFileState, l as WorkspaceSkillDocument, m as isWorkspaceMarkdownPath, n as WorkspaceFileAssetRequest, o as WorkspaceMediaKind, p as inferWorkspaceMimeType, r as WorkspaceFileAssetResolver, s as WorkspaceMediaTrack, t as WorkspaceFileAsset, u as getWorkspaceBasename, v as parseWorkspaceSkill } from "../../WorkspaceFile-Bouauobc.js";
|
|
2
2
|
export { WorkspaceFileAsset, WorkspaceFileAssetRequest, WorkspaceFileAssetResolver, WorkspaceFileState, WorkspaceMediaInfo, WorkspaceMediaKind, WorkspaceMediaTrack, WorkspaceMediaTrackKind, WorkspaceSkillDocument, getWorkspaceBasename, inferWorkspaceLanguage, inferWorkspaceMedia, inferWorkspaceMimeType, isWorkspaceMarkdownPath, isWorkspaceMediaPath, isWorkspaceSkillPath, isWorkspaceTextPath, parseWorkspaceSkill };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WorkspaceFileView } from "../../WorkspaceFileView-
|
|
1
|
+
import { t as WorkspaceFileView } from "../../WorkspaceFileView-DYPtRVpM.js";
|
|
2
2
|
export { WorkspaceFileView };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as WorkspaceNavigationProvider, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "../../WorkspaceLink-
|
|
1
|
+
import { n as WorkspaceNavigationProvider, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "../../WorkspaceLink-BYZG-V_I.js";
|
|
2
2
|
export { WorkspaceFileLink, WorkspaceNavigationProvider, resolveWorkspaceLink };
|
|
@@ -1,2 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as WorkspaceFileAssetResolver } from "../../WorkspaceFile-Bouauobc.js";
|
|
2
|
+
import { y as WorkspaceSource } from "../../Workspace-HzGrWDX3.js";
|
|
3
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
4
|
+
|
|
5
|
+
//#region src/components/agents-sdk/WorkspaceLive.d.ts
|
|
6
|
+
type WorkspaceChange = {
|
|
7
|
+
type: "changed";
|
|
8
|
+
path: string;
|
|
9
|
+
movedFrom?: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: "unknown";
|
|
12
|
+
};
|
|
13
|
+
/** Host adapter for a native workspace observer. */
|
|
14
|
+
interface WorkspaceChangeSource {
|
|
15
|
+
start?(): void | Promise<void>;
|
|
16
|
+
subscribe(listener: (change: WorkspaceChange) => void): () => void;
|
|
17
|
+
}
|
|
18
|
+
declare function invalidateWorkspaceDirectories(queryClient: QueryClient, sourceKey: string, directories: Iterable<string>, root: string): void;
|
|
19
|
+
interface UseWorkspaceLiveQueriesOptions {
|
|
20
|
+
/** Native observer adapter. Omit for hosts without workspace observation. */
|
|
21
|
+
changes?: WorkspaceChangeSource;
|
|
22
|
+
sourceKey: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The host's workspace boundary. Required, and the same value the concept
|
|
25
|
+
* options were built with: invalidation is prefix-matched on it, so a root
|
|
26
|
+
* that disagrees with the queries silently invalidates nothing.
|
|
27
|
+
*/
|
|
28
|
+
root: string;
|
|
29
|
+
/** Workspace read adapter used to refresh an observed open file in order. */
|
|
30
|
+
source?: WorkspaceSource;
|
|
31
|
+
/** Route-owned open file. Omit or pass null when Files has no selection. */
|
|
32
|
+
selectedPath?: string | null;
|
|
33
|
+
resolveFileAsset?: WorkspaceFileAssetResolver;
|
|
34
|
+
maxInlineAssetBytes?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Disposable freshness tick for hosts without native observation — for
|
|
37
|
+
* example a serialization of settled-turn state. Every change of a defined
|
|
38
|
+
* value invalidates the source's concept queries. It never enters query
|
|
39
|
+
* identity, so data, mutation state, and form drafts survive the refresh.
|
|
40
|
+
*/
|
|
41
|
+
revision?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Synchronize external workspace freshness with the design system's Query
|
|
45
|
+
* resources. This is the one external-system effect: native observer events
|
|
46
|
+
* and host revision ticks both land here as targeted invalidation against
|
|
47
|
+
* stable query keys. Hosts only supply events; neither layer adds another
|
|
48
|
+
* watcher.
|
|
49
|
+
*/
|
|
50
|
+
declare function useWorkspaceLiveQueries({
|
|
51
|
+
changes,
|
|
52
|
+
maxInlineAssetBytes,
|
|
53
|
+
resolveFileAsset,
|
|
54
|
+
selectedPath,
|
|
55
|
+
source,
|
|
56
|
+
sourceKey,
|
|
57
|
+
root,
|
|
58
|
+
revision
|
|
59
|
+
}: UseWorkspaceLiveQueriesOptions): void;
|
|
60
|
+
//#endregion
|
|
2
61
|
export { UseWorkspaceLiveQueriesOptions, WorkspaceChange, WorkspaceChangeSource, invalidateWorkspaceDirectories, useWorkspaceLiveQueries };
|