@mcp-b/react-components 0.57.0 → 0.58.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/Card-BPkXIkBz.d.ts +46 -0
- package/dist/{CodeBlock-Dw1z6jc8.js → CodeBlock-Bs_Z03eC.js} +2 -1
- package/dist/{CodeBlock-CPotpyyM.d.ts → CodeBlock-DYp5V_4O.d.ts} +1 -1
- package/dist/{EmployeeChrome-CN99SVfF.d.ts → EmployeeChrome-DsdIek0l.d.ts} +2 -10
- package/dist/ExecutionBoard-DHfMvKlB.d.ts +64 -0
- package/dist/ExecutionResult-BSZsUbrL.js +279 -0
- package/dist/{FileTree-D61EeWRU.js → FileTree-DyLBn7O_.js} +1 -1
- package/dist/{ManagerOffice-D4L_xO4i.js → ManagerOffice-DHcLRhFu.js} +2 -17
- package/dist/{McpConnectorForm-BPWCo9bU.d.ts → McpConnectorForm-D4bY-lm_.d.ts} +1 -1
- package/dist/{McpPluginCatalog-uSh0gGeY.d.ts → McpPluginCatalog-2FZDLCeK.d.ts} +2 -2
- package/dist/{SetupChecklist-DWyifWWg.js → SetupChecklist-CKQ-mKYt.js} +1 -1
- package/dist/{ThinkRoutine-DGlKJbIy.d.ts → ThinkRoutine-DoZjbzyn.d.ts} +15 -3
- package/dist/{Workspace-Cr-aGDfx.d.ts → Workspace-iCkXvQRJ.d.ts} +1 -1
- package/dist/WorkspaceConcept-ByaG-kBq.d.ts +38 -0
- package/dist/WorkspaceExecutionTable-DNhj6YDX.d.ts +239 -0
- package/dist/{WorkspaceFile-DiwiJEwO.d.ts → WorkspaceFile-DkIZKoK6.d.ts} +1 -1
- package/dist/{WorkspaceFileView-DCvGBsI1.js → WorkspaceFileView-M2jC2P4p.js} +217 -139
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +4 -4
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/EmployeeApp.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeApp.js +3 -7
- package/dist/components/agents-sdk/EmployeeChat.d.ts +3 -1
- package/dist/components/agents-sdk/EmployeeChat.js +11 -4
- package/dist/components/agents-sdk/EmployeeChrome.d.ts +1 -1
- package/dist/components/agents-sdk/EmployeeChrome.js +72 -57
- package/dist/components/agents-sdk/EmployeeSchedules.d.ts +6 -3
- package/dist/components/agents-sdk/EmployeeSchedules.js +12 -10
- package/dist/components/agents-sdk/EmployeeStartScreen.d.ts +2 -2
- package/dist/components/agents-sdk/EmployeeStartScreen.js +2 -2
- package/dist/components/agents-sdk/ExecutionBoard.d.ts +2 -0
- package/dist/components/agents-sdk/ExecutionBoard.js +648 -0
- package/dist/components/agents-sdk/ManagerAccountActions.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.d.ts +1 -1
- package/dist/components/agents-sdk/ManagerOfficeScreens.js +4 -3
- package/dist/components/agents-sdk/McpConnectionRequest.d.ts +1 -1
- package/dist/components/agents-sdk/McpConnectionRequest.js +1 -1
- package/dist/components/agents-sdk/McpConnectorForm.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.d.ts +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +16 -7
- package/dist/components/agents-sdk/McpServerIcon.d.ts +1 -1
- package/dist/components/agents-sdk/McpServerPicker.d.ts +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +1 -1
- package/dist/components/agents-sdk/ModelSelector.js +1 -1
- package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
- package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
- package/dist/components/agents-sdk/SubagentRunPanel.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +238 -209
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +13 -34
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutine.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkRoutineActions.d.ts +2 -2
- package/dist/components/agents-sdk/ThinkRoutineActions.js +25 -15
- package/dist/components/agents-sdk/ThinkRoutineBrowser.d.ts +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineDetail.d.ts +5 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +13 -7
- package/dist/components/agents-sdk/ThinkRoutineForm.d.ts +23 -6
- package/dist/components/agents-sdk/ThinkRoutineForm.js +519 -212
- package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
- package/dist/components/agents-sdk/TypeSafeConnectionDialog.d.ts +10 -0
- package/dist/components/agents-sdk/TypeSafeConnectionDialog.js +34 -0
- package/dist/components/agents-sdk/WorkbenchBack.js +1 -1
- package/dist/components/agents-sdk/Workspace.d.ts +1 -1
- 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 +2 -37
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +3 -2
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +2 -92
- package/dist/components/agents-sdk/WorkspaceExecution.js +648 -131
- package/dist/components/agents-sdk/WorkspaceExecutionTable.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceExecutionTable.js +824 -0
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +3 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +4 -3
- package/dist/components/agents-sdk/WorkspaceFile.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceFileView.d.ts +4 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceProject.js +4 -3
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceUserScript.js +3 -2
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +1 -1
- package/dist/components/ai-sdk/Artifact.js +1 -1
- package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
- package/dist/components/ai-sdk/ChainOfThought.js +1 -1
- package/dist/components/ai-sdk/Checkpoint.js +1 -1
- package/dist/components/ai-sdk/CodeBlock.d.ts +1 -1
- package/dist/components/ai-sdk/CodeBlock.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.js +1 -1
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +1 -1
- package/dist/components/ai-sdk/ConnectedAppCards.js +1 -1
- package/dist/components/ai-sdk/Context.js +2 -2
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.d.ts +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +2 -2
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +1 -1
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +2 -2
- package/dist/components/extension/CodexModelSelector.js +1 -1
- package/dist/components/extension/ConversationTabPicker.js +1 -1
- package/dist/components/foundations/Card.d.ts +2 -45
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/ContextMenu.js +1 -1
- package/dist/components/foundations/Menubar.js +1 -1
- package/dist/components/foundations/SearchField.js +1 -1
- package/dist/components/foundations/Select.js +1 -1
- package/dist/components/foundations/Stepper.js +1 -1
- package/dist/components/foundations/Toast.js +1 -1
- package/dist/components/foundations/icons.d.ts +2 -2
- package/dist/components/foundations/icons.js +2 -2
- package/dist/components/general-purpose/Commit.js +2 -2
- package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
- package/dist/components/general-purpose/FileTree.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +1 -1
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SetupChecklist.js +1 -1
- package/dist/components/general-purpose/Terminal.js +2 -2
- package/dist/components/general-purpose/TestResults.js +1 -1
- package/dist/components/general-purpose/ThemeModeControl.js +1 -1
- package/dist/components/general-purpose/WebPreview.js +1 -1
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.js +1 -1
- package/dist/{copy-button-Dk2vRe9j.js → copy-button-M4sAp9xS.js} +1 -1
- package/dist/execution-result-DWVmm-bL.js +80 -0
- package/dist/{icons-CUuD7iEh.d.ts → icons-Dj6id76o.d.ts} +2 -1
- package/dist/{icons-CeGfXO21.js → icons-DvlrWt54.js} +3 -2
- package/dist/{mcp-server-catalog-DgA9BnL0.d.ts → mcp-server-catalog-kaMWaSAL.d.ts} +3 -1
- package/dist/styles/app-top-bar.css +2 -1
- package/dist/styles/base.css +1 -0
- package/dist/styles/chatgpt-sign-in-screen.css +8 -14
- package/dist/styles/context.css +8 -0
- package/dist/styles/description-list.css +12 -9
- package/dist/styles/execution-board.css +383 -0
- package/dist/styles/index.css +3 -0
- package/dist/styles/mcp-plugin-catalog.css +8 -7
- package/dist/styles/think-chat-tool-panels.css +1 -2
- package/dist/styles/think-execution-workbench.css +1 -12
- package/dist/styles/think-routine.css +39 -41
- package/dist/styles/workspace-concepts.css +441 -17
- package/dist/styles/workspace-explorer.css +18 -4
- package/dist/utils/mcp-server-catalog.d.ts +2 -2
- package/dist/utils/mcp-server-catalog.js +18 -1
- package/dist/utils/structured-code.d.ts +1 -1
- package/dist/{workspace-assets-wW_lQLYK.js → workspace-assets-DVn0d-fN.js} +24 -81
- package/dist/workspace-delete-DfloiBWp.js +80 -0
- package/package.json +3 -2
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { a as ExecutionTrace, r as ExecutionGraph } from "./ExecutionBoard-DHfMvKlB.js";
|
|
2
|
+
import { f as CardProps } from "./Card-BPkXIkBz.js";
|
|
3
|
+
import { r as WorkspaceConceptQueryOptions } from "./WorkspaceConcept-ByaG-kBq.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { MutationKey } from "@tanstack/react-query";
|
|
6
|
+
//#region src/components/agents-sdk/WorkspaceExecution.d.ts
|
|
7
|
+
type WorkspaceExecutionParamType = "string" | "number" | "boolean";
|
|
8
|
+
interface WorkspaceExecutionParam {
|
|
9
|
+
name: string;
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional help text, kept separate from the concise field label. */
|
|
12
|
+
description?: string;
|
|
13
|
+
type: WorkspaceExecutionParamType;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the module's schema lists this property as required. This is a
|
|
16
|
+
* presentation hint only; the execution runtime owns argument validation.
|
|
17
|
+
*/
|
|
18
|
+
required: boolean;
|
|
19
|
+
value?: string | number | boolean;
|
|
20
|
+
}
|
|
21
|
+
interface WorkspaceExecutionRun {
|
|
22
|
+
path: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
interface WorkspaceExecutionRunView extends WorkspaceExecutionRun {
|
|
26
|
+
onOpen?: () => void;
|
|
27
|
+
}
|
|
28
|
+
interface WorkspaceExecutionOutcome {
|
|
29
|
+
/** Matches this outcome to its synchronized trace when the host publishes one. */
|
|
30
|
+
executionId?: string;
|
|
31
|
+
/** Serialized return value from the existing execution runtime. */
|
|
32
|
+
result: unknown;
|
|
33
|
+
logs: readonly string[];
|
|
34
|
+
/** Result and log files emitted when the runtime overflowed its inline bounds. */
|
|
35
|
+
runs: readonly WorkspaceExecutionRun[];
|
|
36
|
+
}
|
|
37
|
+
interface WorkspaceExecutionViewOutcome extends Omit<WorkspaceExecutionOutcome, "runs"> {
|
|
38
|
+
runs: readonly WorkspaceExecutionRunView[];
|
|
39
|
+
}
|
|
40
|
+
interface WorkspaceExecution {
|
|
41
|
+
graph?: ExecutionGraph;
|
|
42
|
+
/** Workspace path of the module file. */
|
|
43
|
+
path: string;
|
|
44
|
+
name: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
/** Brand mark. Defaults to `QueueIcon`. */
|
|
47
|
+
icon?: React.ReactNode;
|
|
48
|
+
parameters: readonly WorkspaceExecutionParam[];
|
|
49
|
+
/** Recent result peeks, newest first. Not a results directory. */
|
|
50
|
+
runs?: readonly WorkspaceExecutionRun[];
|
|
51
|
+
}
|
|
52
|
+
/** Data-only execution projection hydrated with card actions outside Query. */
|
|
53
|
+
interface WorkspaceExecutionView extends WorkspaceExecution, WorkspaceExecutionTableActions {
|
|
54
|
+
/** Prepared or retained table execution for this workflow. */
|
|
55
|
+
tableExecution?: WorkspaceExecutionTableRun;
|
|
56
|
+
/** TanStack identity shared by inline and workbench run controls. */
|
|
57
|
+
mutationKey?: MutationKey;
|
|
58
|
+
trace?: ExecutionTrace;
|
|
59
|
+
onStop?: () => Promise<void>;
|
|
60
|
+
runs?: readonly WorkspaceExecutionRunView[];
|
|
61
|
+
/**
|
|
62
|
+
* Runs the module with the submitted values. Shared mutation state keeps the
|
|
63
|
+
* lifecycle visible when an inline card opens its workbench.
|
|
64
|
+
*/
|
|
65
|
+
onRun?: (parameters: readonly WorkspaceExecutionParam[]) => Promise<WorkspaceExecutionViewOutcome>;
|
|
66
|
+
onOpen?: () => void;
|
|
67
|
+
/** Opens the host-owned execution workbench without starting a run. */
|
|
68
|
+
onOpenBoard?: () => void;
|
|
69
|
+
/** Opens the host-owned schedule form with this saved workflow selected. */
|
|
70
|
+
onSchedule?: () => void;
|
|
71
|
+
onDelete?: () => void | Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
interface WorkspaceExecutionSource extends WorkspaceExecutionTableActions {
|
|
74
|
+
/** Live host-owned table receipt; its workflow path scopes it to one workbench. */
|
|
75
|
+
tableExecution?: WorkspaceExecutionTableRun;
|
|
76
|
+
trace?: ExecutionTrace;
|
|
77
|
+
onStop?: (executionId: string) => Promise<void>;
|
|
78
|
+
queryOptions: WorkspaceConceptQueryOptions<readonly WorkspaceExecution[]>;
|
|
79
|
+
/** Runs the module with the submitted values and returns its visible outcome. */
|
|
80
|
+
onRun?: (path: string, parameters: readonly WorkspaceExecutionParam[]) => Promise<WorkspaceExecutionOutcome>;
|
|
81
|
+
onOpen?: (path: string) => void;
|
|
82
|
+
/** Selects the script in the host-owned execution workbench. */
|
|
83
|
+
onOpenBoard?: (path: string) => void;
|
|
84
|
+
/** Starts a new schedule using the existing saved-workflow catalog. */
|
|
85
|
+
onSchedule?: (path: string) => void;
|
|
86
|
+
onDelete?: (path: string) => void | Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
interface WorkspaceExecutionCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
|
|
89
|
+
module: WorkspaceExecutionView;
|
|
90
|
+
}
|
|
91
|
+
interface WorkspaceExecutionFileProps extends Omit<WorkspaceExecutionCardProps, "module"> {
|
|
92
|
+
path: string;
|
|
93
|
+
source: WorkspaceExecutionSource;
|
|
94
|
+
fallback?: React.ReactNode;
|
|
95
|
+
}
|
|
96
|
+
interface WorkspaceExecutionsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
97
|
+
/** Shared workspace query and host actions, also used by inline module cards. */
|
|
98
|
+
source: WorkspaceExecutionSource;
|
|
99
|
+
/** Route-owned selection; absent means the script library. */
|
|
100
|
+
selectedPath?: string;
|
|
101
|
+
/** Lazily loaded outline for the selected script. Trace graphs take precedence. */
|
|
102
|
+
selectedGraph?: ExecutionGraph;
|
|
103
|
+
/** Saved run loaded by the host for the selected trace file. */
|
|
104
|
+
selectedTrace?: ExecutionTrace;
|
|
105
|
+
/** Returns from the selected script to the library. */
|
|
106
|
+
onBack?: () => void;
|
|
107
|
+
}
|
|
108
|
+
declare function WorkspaceExecutionCard({ module, ...props }: WorkspaceExecutionCardProps & {
|
|
109
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
110
|
+
}): React.JSX.Element;
|
|
111
|
+
/**
|
|
112
|
+
* Compact inline card for one queried execution module.
|
|
113
|
+
*/
|
|
114
|
+
declare function WorkspaceExecutionFile({ fallback, path, source, ...props }: WorkspaceExecutionFileProps & {
|
|
115
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
116
|
+
}): 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;
|
|
117
|
+
/**
|
|
118
|
+
* Route-owned script workbench: compact discovery cards or one selected board.
|
|
119
|
+
* A query failure with nothing loaded is an error, never an empty library.
|
|
120
|
+
*/
|
|
121
|
+
declare function WorkspaceExecutionsPanel({ className, source, selectedPath, selectedTrace, selectedGraph, onBack, ref, ...props }: WorkspaceExecutionsPanelProps & {
|
|
122
|
+
/** Ref forwarded to the component's rendered root element. */
|
|
123
|
+
ref?: React.Ref<HTMLElement>;
|
|
124
|
+
}): React.JSX.Element;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/components/agents-sdk/WorkspaceExecutionTable.d.ts
|
|
127
|
+
type WorkspaceExecutionTableValue = string | number | boolean;
|
|
128
|
+
/** Provider-neutral table. Blank cells retain their column positions. */
|
|
129
|
+
interface WorkspaceExecutionTableData {
|
|
130
|
+
columns: string[];
|
|
131
|
+
rows: (WorkspaceExecutionTableValue | null)[][];
|
|
132
|
+
source?: {
|
|
133
|
+
label: string;
|
|
134
|
+
href?: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** The host owns loading and parsing; the component never connects to a provider. */
|
|
138
|
+
type WorkspaceExecutionTableSource = {
|
|
139
|
+
data: WorkspaceExecutionTableData;
|
|
140
|
+
} | {
|
|
141
|
+
path: string;
|
|
142
|
+
sheet?: string;
|
|
143
|
+
header?: boolean;
|
|
144
|
+
delimiter?: "," | "\t" | ";";
|
|
145
|
+
} | {
|
|
146
|
+
script: {
|
|
147
|
+
path: string;
|
|
148
|
+
args?: Record<string, unknown>;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
interface WorkspaceExecutionTableInvocation {
|
|
152
|
+
path: string;
|
|
153
|
+
args?: Record<string, unknown>;
|
|
154
|
+
table?: {
|
|
155
|
+
source: WorkspaceExecutionTableSource;
|
|
156
|
+
columns: Record<string, string>;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
interface WorkspaceExecutionTableRow {
|
|
160
|
+
/** Zero-based position in the snapshotted data, including any omitted blank rows. */
|
|
161
|
+
index: number;
|
|
162
|
+
args: Record<string, unknown>;
|
|
163
|
+
status: "waiting" | "running" | "completed" | "error" | "aborted" | "interrupted";
|
|
164
|
+
executionId?: string;
|
|
165
|
+
tracePath?: string;
|
|
166
|
+
summary?: string;
|
|
167
|
+
/** Actual output retained by the host; presentation never predicts result fields. */
|
|
168
|
+
result?: unknown;
|
|
169
|
+
error?: string;
|
|
170
|
+
}
|
|
171
|
+
/** Retained host-owned receipt. The data and each row's inputs are fixed before execution. */
|
|
172
|
+
interface WorkspaceExecutionTableRun {
|
|
173
|
+
path: string;
|
|
174
|
+
threadId: string;
|
|
175
|
+
id: string;
|
|
176
|
+
name: string;
|
|
177
|
+
invocation: WorkspaceExecutionTableInvocation;
|
|
178
|
+
data: WorkspaceExecutionTableData;
|
|
179
|
+
rows: WorkspaceExecutionTableRow[];
|
|
180
|
+
status: "ready" | "running" | "completed" | "error" | "aborted" | "interrupted";
|
|
181
|
+
createdAt: number;
|
|
182
|
+
startedAt?: number;
|
|
183
|
+
completedAt?: number;
|
|
184
|
+
error?: string;
|
|
185
|
+
}
|
|
186
|
+
type WorkspaceExecutionTableInput = {
|
|
187
|
+
file: File;
|
|
188
|
+
} | {
|
|
189
|
+
text: string;
|
|
190
|
+
} | {
|
|
191
|
+
path: string;
|
|
192
|
+
};
|
|
193
|
+
interface WorkspaceExecutionTableLoadOptions {
|
|
194
|
+
sheet?: string;
|
|
195
|
+
header?: boolean;
|
|
196
|
+
delimiter?: "," | "\t" | ";";
|
|
197
|
+
}
|
|
198
|
+
interface WorkspaceExecutionTableLoaded {
|
|
199
|
+
data: WorkspaceExecutionTableData;
|
|
200
|
+
source: WorkspaceExecutionTableSource;
|
|
201
|
+
sheets?: string[];
|
|
202
|
+
}
|
|
203
|
+
/** Shared table actions; the host persists receipts and supplies live updates. */
|
|
204
|
+
interface WorkspaceExecutionTableActions {
|
|
205
|
+
/** Loads a file, pasted rows, or workspace source without executing the workflow. */
|
|
206
|
+
onLoadTable?: (input: WorkspaceExecutionTableInput, options?: WorkspaceExecutionTableLoadOptions) => Promise<WorkspaceExecutionTableLoaded>;
|
|
207
|
+
/** Opens a host conversation to prepare a table from a sheet, app, or description. */
|
|
208
|
+
onRequestTableSource?: (input: {
|
|
209
|
+
path: string;
|
|
210
|
+
request: string;
|
|
211
|
+
invocation?: WorkspaceExecutionTableInvocation;
|
|
212
|
+
}) => Promise<void>;
|
|
213
|
+
/** Validates and retains the exact rows and workflow before any row effects. */
|
|
214
|
+
onPrepareTable?: (invocation: WorkspaceExecutionTableInvocation) => Promise<WorkspaceExecutionTableRun>;
|
|
215
|
+
/** Starts the retained receipt identified by its workspace path. */
|
|
216
|
+
onRunTable?: (path: string) => Promise<WorkspaceExecutionTableRun>;
|
|
217
|
+
/** Stops the active row and leaves the remaining rows unstarted. */
|
|
218
|
+
onStopTable?: (path: string) => Promise<void>;
|
|
219
|
+
/** Reads one row's saved observations for the existing execution board. */
|
|
220
|
+
onLoadTableTrace?: (path: string) => Promise<ExecutionTrace>;
|
|
221
|
+
/** Saves the same table source and mapping in the host's existing schedule form. */
|
|
222
|
+
onScheduleTable?: (invocation: WorkspaceExecutionTableInvocation) => void | Promise<void>;
|
|
223
|
+
}
|
|
224
|
+
interface WorkspaceExecutionTableProps extends WorkspaceExecutionTableActions {
|
|
225
|
+
/** Workspace path of the existing single-row workflow. */
|
|
226
|
+
path: string;
|
|
227
|
+
/** Existing workflow fields used to infer exact column matches without exposing script inputs. */
|
|
228
|
+
parameters: readonly WorkspaceExecutionParam[];
|
|
229
|
+
/** Retained receipt refreshed by the host as rows progress. */
|
|
230
|
+
execution?: WorkspaceExecutionTableRun;
|
|
231
|
+
/** Current row's live observations, matched by execution identity. */
|
|
232
|
+
trace?: ExecutionTrace;
|
|
233
|
+
/** Existing workflow outline for rows that have not started. */
|
|
234
|
+
graph?: ExecutionGraph;
|
|
235
|
+
}
|
|
236
|
+
/** Run one existing workflow for each row, then inspect each row on the same execution board. */
|
|
237
|
+
declare function WorkspaceExecutionTable(props: WorkspaceExecutionTableProps): React.JSX.Element;
|
|
238
|
+
//#endregion
|
|
239
|
+
export { WorkspaceExecutionSource as C, WorkspaceExecutionsPanelProps as D, WorkspaceExecutionsPanel as E, WorkspaceExecutionRunView as S, WorkspaceExecutionViewOutcome as T, WorkspaceExecutionFileProps as _, WorkspaceExecutionTableInvocation as a, WorkspaceExecutionParamType as b, WorkspaceExecutionTableProps as c, WorkspaceExecutionTableSource as d, WorkspaceExecutionTableValue as f, WorkspaceExecutionFile as g, WorkspaceExecutionCardProps as h, WorkspaceExecutionTableInput as i, WorkspaceExecutionTableRow as l, WorkspaceExecutionCard as m, WorkspaceExecutionTableActions as n, WorkspaceExecutionTableLoadOptions as o, WorkspaceExecution as p, WorkspaceExecutionTableData as r, WorkspaceExecutionTableLoaded as s, WorkspaceExecutionTable as t, WorkspaceExecutionTableRun as u, WorkspaceExecutionOutcome as v, WorkspaceExecutionView as w, WorkspaceExecutionRun as x, WorkspaceExecutionParam as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as CodeBlockLanguage } from "./CodeBlock-
|
|
1
|
+
import { O as CodeBlockLanguage } from "./CodeBlock-DYp5V_4O.js";
|
|
2
2
|
import { SkillParseResult } from "agent-skills-ts-sdk";
|
|
3
3
|
import { FileInfo } from "@cloudflare/shell";
|
|
4
4
|
//#region src/components/agents-sdk/WorkspaceFile.d.ts
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { b as EyeIcon, d as CheckIcon,
|
|
1
|
+
import { b as EyeIcon, d as CheckIcon, k as MaximizeIcon, m as CodeIcon, r as ArrowLeftIcon, tt as WarningIcon, v as DownloadIcon } from "./icons-DvlrWt54.js";
|
|
2
2
|
import { i as formatClock } from "./format-CWaZEp5o.js";
|
|
3
|
-
import {
|
|
3
|
+
import { t as CopyButton } from "./copy-button-M4sAp9xS.js";
|
|
4
|
+
import { a as CodeBlockCopyButton, i as CodeBlockContent, r as CodeBlockContainer, t as CodeBlock } from "./CodeBlock-Bs_Z03eC.js";
|
|
4
5
|
import { AppTopBar } from "./components/general-purpose/AppTopBar.js";
|
|
5
6
|
import { inferWorkspaceLanguage, inferWorkspaceMedia, isWorkspaceMarkdownPath, isWorkspaceSkillPath, parseWorkspaceSkill } from "./components/agents-sdk/WorkspaceFile.js";
|
|
6
7
|
import { i as useWorkspaceNavigationContext } from "./WorkspaceLink-BeFAXpbI.js";
|
|
7
8
|
import { useWorkspaceNavigationRestoration } from "./components/agents-sdk/WorkspaceNavigationRestoration.js";
|
|
9
|
+
import { t as ExecutionResult } from "./ExecutionResult-BSZsUbrL.js";
|
|
8
10
|
import { n as WorkspaceMessageResponse, r as createWorkspaceRehypePlugins } from "./WorkspaceMessageResponse-DnsdpaGU.js";
|
|
9
11
|
import { WorkspaceHeader } from "./components/agents-sdk/WorkspaceHeader.js";
|
|
10
12
|
import * as React from "react";
|
|
@@ -465,14 +467,85 @@ function createWorkspaceHeading(tag, prefix) {
|
|
|
465
467
|
});
|
|
466
468
|
};
|
|
467
469
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
470
|
+
function filePreviewStatus(file, isLoading, assetError, isPreparingAsset, media) {
|
|
471
|
+
if (isLoading) return { message: "Loading file..." };
|
|
472
|
+
if (!file) return { message: "File preview is unavailable." };
|
|
473
|
+
if (file.error) return {
|
|
474
|
+
message: `Could not preview this file: ${file.error}`,
|
|
475
|
+
role: "alert"
|
|
476
|
+
};
|
|
477
|
+
if (assetError) return {
|
|
478
|
+
message: `Could not preview this file: ${assetError}`,
|
|
479
|
+
role: "alert"
|
|
480
|
+
};
|
|
481
|
+
if (isPreparingAsset) return { message: "Preparing file preview..." };
|
|
482
|
+
if (file.asset && !media) return { message: "This media type is not supported." };
|
|
483
|
+
if (file.asset) return null;
|
|
484
|
+
if (media && file.asset === null) return { message: "This workspace source did not provide preview data for this file." };
|
|
485
|
+
if (file.content === null) return { message: "This file has no text preview." };
|
|
486
|
+
if (file.content.length === 0) return { message: "This file is empty." };
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
function WorkspaceMarkdownArticle({ file, path, showSkillIdentity, components, rehypePlugins }) {
|
|
490
|
+
if (file.content === null) return null;
|
|
491
|
+
const skill = isWorkspaceSkillPath(file.path) ? parseWorkspaceSkill(file.content) : null;
|
|
492
|
+
const markdown = skill?.parsed?.body ?? file.content;
|
|
493
|
+
return /* @__PURE__ */ jsxs("article", {
|
|
494
|
+
className: "workspace-explorer__markdown",
|
|
495
|
+
children: [skill ? /* @__PURE__ */ jsx(WorkspaceSkillHeader, {
|
|
496
|
+
skill,
|
|
497
|
+
showSkillIdentity
|
|
498
|
+
}) : null, /* @__PURE__ */ jsx(WorkspaceMessageResponse, {
|
|
499
|
+
className: "workspace-explorer__markdown-content",
|
|
500
|
+
components,
|
|
501
|
+
mode: "static",
|
|
502
|
+
rehypePlugins,
|
|
503
|
+
children: markdown
|
|
504
|
+
}, path)]
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function WorkspaceSkillHeader({ skill, showSkillIdentity }) {
|
|
508
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
509
|
+
className: "workspace-explorer__skill",
|
|
510
|
+
"data-skill-identity": showSkillIdentity ? "" : void 0,
|
|
511
|
+
children: [showSkillIdentity ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
512
|
+
className: "workspace-explorer__skill-kicker",
|
|
513
|
+
children: "Agent Skill"
|
|
514
|
+
}), skill.parsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
515
|
+
/* @__PURE__ */ jsx("p", {
|
|
516
|
+
className: "workspace-explorer__skill-name",
|
|
517
|
+
children: skill.parsed.properties.name
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ jsx("p", {
|
|
520
|
+
className: "workspace-explorer__skill-description",
|
|
521
|
+
children: skill.parsed.properties.description
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ jsxs("dl", {
|
|
524
|
+
className: "workspace-explorer__skill-metadata",
|
|
525
|
+
children: [skill.parsed.properties.compatibility ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Compatibility" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.compatibility })] }) : null, skill.parsed.properties.allowedTools ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Allowed tools" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.allowedTools })] }) : null]
|
|
526
|
+
})
|
|
527
|
+
] }) : null] }) : null, /* @__PURE__ */ jsx(WorkspaceSkillValidation, { errors: skill.validationErrors })]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function WorkspaceSkillValidation({ errors }) {
|
|
531
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
532
|
+
className: "workspace-explorer__skill-status",
|
|
533
|
+
"data-invalid": errors.length > 0 ? "" : void 0,
|
|
534
|
+
children: [errors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), errors.length > 0 ? `${errors.length.toLocaleString()} validation ${errors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
|
|
535
|
+
}), errors.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
536
|
+
className: "workspace-explorer__skill-errors",
|
|
537
|
+
children: errors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
|
|
538
|
+
}) : null] });
|
|
539
|
+
}
|
|
540
|
+
function WorkspaceViewToggle({ view, isMarkdown, onToggle }) {
|
|
541
|
+
const label = view === "preview" ? isMarkdown ? "View Markdown source" : "View source" : isMarkdown ? "Preview Markdown" : "Preview";
|
|
542
|
+
return /* @__PURE__ */ jsx(AppTopBar.Button, {
|
|
543
|
+
label,
|
|
544
|
+
onClick: onToggle,
|
|
545
|
+
children: view === "preview" ? /* @__PURE__ */ jsx(CodeIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function useWorkspaceFileNavigation(path, file, isLoading, isPreparingAsset) {
|
|
476
549
|
const workspaceNavigation = useWorkspaceNavigationContext();
|
|
477
550
|
const restoration = useWorkspaceNavigationRestoration();
|
|
478
551
|
const currentEntry = workspaceNavigation?.navigation.current;
|
|
@@ -480,24 +553,10 @@ function WorkspaceFileView({ appearance = "contained", file, path, isLoading, is
|
|
|
480
553
|
const fragment = currentDestination?.kind === "file" && currentDestination.path === path ? currentDestination.fragment : null;
|
|
481
554
|
const entryKey = currentEntry?.key ?? null;
|
|
482
555
|
const fileViewRef = React.useRef(null);
|
|
483
|
-
const scrollRef = React.useRef(null);
|
|
484
556
|
const handledFocusRequestRef = React.useRef(null);
|
|
485
|
-
const headingPrefix = React.useId().replaceAll(":", "");
|
|
486
|
-
const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [workspaceNavigation]);
|
|
487
|
-
const media = inferWorkspaceMedia(path, file?.asset?.mimeType ?? file?.info?.mimeType);
|
|
488
|
-
const assetUrl = useWorkspaceAssetUrl(file?.asset, media?.mimeType ?? "application/octet-stream");
|
|
489
|
-
const isPreparingAsset = Boolean(file?.asset && !assetUrl.url && !assetUrl.error);
|
|
490
557
|
const handleScroll = React.useCallback((event) => {
|
|
491
558
|
if (entryKey) restoration?.recordScroll(entryKey, event.currentTarget.scrollTop);
|
|
492
559
|
}, [entryKey, restoration]);
|
|
493
|
-
const markdownComponents = React.useMemo(() => ({
|
|
494
|
-
h1: createWorkspaceHeading("h1", headingPrefix),
|
|
495
|
-
h2: createWorkspaceHeading("h2", headingPrefix),
|
|
496
|
-
h3: createWorkspaceHeading("h3", headingPrefix),
|
|
497
|
-
h4: createWorkspaceHeading("h4", headingPrefix),
|
|
498
|
-
h5: createWorkspaceHeading("h5", headingPrefix),
|
|
499
|
-
h6: createWorkspaceHeading("h6", headingPrefix)
|
|
500
|
-
}), [headingPrefix]);
|
|
501
560
|
React.useEffect(() => {
|
|
502
561
|
if (!entryKey || isLoading || isPreparingAsset || !file) return;
|
|
503
562
|
const focusRequest = JSON.stringify([
|
|
@@ -536,6 +595,34 @@ function WorkspaceFileView({ appearance = "contained", file, path, isLoading, is
|
|
|
536
595
|
path,
|
|
537
596
|
restoration
|
|
538
597
|
]);
|
|
598
|
+
return {
|
|
599
|
+
workspaceNavigation,
|
|
600
|
+
fileViewRef,
|
|
601
|
+
handleScroll
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
/** Workspace file preview composed from CodeBlock and AppTopBar. */
|
|
605
|
+
function WorkspaceFileView({ preview, appearance = "contained", file, path, isLoading, isRefreshing, leading, actions, showSkillIdentity = true, onRefresh }) {
|
|
606
|
+
const [markdownViewState, setMarkdownViewState] = React.useState(() => ({
|
|
607
|
+
path,
|
|
608
|
+
view: "preview"
|
|
609
|
+
}));
|
|
610
|
+
const markdownView = markdownViewState.path === path ? markdownViewState.view : "preview";
|
|
611
|
+
const isMarkdown = isWorkspaceMarkdownPath(path);
|
|
612
|
+
const headingPrefix = React.useId().replaceAll(":", "");
|
|
613
|
+
const media = inferWorkspaceMedia(path, file?.asset?.mimeType ?? file?.info?.mimeType);
|
|
614
|
+
const assetUrl = useWorkspaceAssetUrl(file?.asset, media?.mimeType ?? "application/octet-stream");
|
|
615
|
+
const isPreparingAsset = Boolean(file?.asset && !assetUrl.url && !assetUrl.error);
|
|
616
|
+
const { workspaceNavigation, fileViewRef, handleScroll } = useWorkspaceFileNavigation(path, file, isLoading, isPreparingAsset);
|
|
617
|
+
const workspaceRehypePlugins = React.useMemo(() => createFileViewRehypePlugins(workspaceNavigation), [workspaceNavigation]);
|
|
618
|
+
const markdownComponents = React.useMemo(() => ({
|
|
619
|
+
h1: createWorkspaceHeading("h1", headingPrefix),
|
|
620
|
+
h2: createWorkspaceHeading("h2", headingPrefix),
|
|
621
|
+
h3: createWorkspaceHeading("h3", headingPrefix),
|
|
622
|
+
h4: createWorkspaceHeading("h4", headingPrefix),
|
|
623
|
+
h5: createWorkspaceHeading("h5", headingPrefix),
|
|
624
|
+
h6: createWorkspaceHeading("h6", headingPrefix)
|
|
625
|
+
}), [headingPrefix]);
|
|
539
626
|
const assetActions = file?.asset && assetUrl.url ? /* @__PURE__ */ jsx(WorkspaceAssetActions, {
|
|
540
627
|
fileName: file.name,
|
|
541
628
|
url: assetUrl.url,
|
|
@@ -550,50 +637,35 @@ function WorkspaceFileView({ appearance = "contained", file, path, isLoading, is
|
|
|
550
637
|
render: workspaceNavigation.navigation.renderLink({ kind: "files" }),
|
|
551
638
|
children: /* @__PURE__ */ jsx(ArrowLeftIcon, { "aria-hidden": "true" })
|
|
552
639
|
}) : leading,
|
|
553
|
-
actions:
|
|
640
|
+
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
554
641
|
actions,
|
|
555
642
|
assetActions,
|
|
556
|
-
/* @__PURE__ */ jsx(
|
|
557
|
-
|
|
558
|
-
|
|
643
|
+
isMarkdown || preview ? /* @__PURE__ */ jsx(WorkspaceViewToggle, {
|
|
644
|
+
view: markdownView,
|
|
645
|
+
isMarkdown,
|
|
646
|
+
onToggle: () => setMarkdownViewState({
|
|
559
647
|
path,
|
|
560
648
|
view: markdownView === "preview" ? "source" : "preview"
|
|
561
|
-
})
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [actions, assetActions] }),
|
|
649
|
+
})
|
|
650
|
+
}) : null
|
|
651
|
+
] }),
|
|
565
652
|
isRefreshing,
|
|
566
653
|
onRefresh
|
|
567
654
|
};
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
else if (file?.content.length === 0) message = "This file is empty.";
|
|
583
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
584
|
-
ref: fileViewRef,
|
|
585
|
-
className: "workspace-explorer__file",
|
|
586
|
-
"data-appearance": appearance,
|
|
587
|
-
"data-workspace-restoration-scope": "file",
|
|
588
|
-
children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
|
|
589
|
-
className: "workspace-explorer__empty",
|
|
590
|
-
"data-workspace-file-content": "",
|
|
591
|
-
"data-workspace-focus-target": "",
|
|
592
|
-
role,
|
|
593
|
-
children: message
|
|
594
|
-
})]
|
|
595
|
-
});
|
|
596
|
-
}
|
|
655
|
+
const unavailable = filePreviewStatus(file, isLoading, assetUrl.error, isPreparingAsset, media);
|
|
656
|
+
if (!file || unavailable) return /* @__PURE__ */ jsxs("div", {
|
|
657
|
+
ref: fileViewRef,
|
|
658
|
+
className: "workspace-explorer__file",
|
|
659
|
+
"data-appearance": appearance,
|
|
660
|
+
"data-workspace-restoration-scope": "file",
|
|
661
|
+
children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
|
|
662
|
+
className: "workspace-explorer__empty",
|
|
663
|
+
"data-workspace-file-content": "",
|
|
664
|
+
"data-workspace-focus-target": "",
|
|
665
|
+
role: unavailable?.role,
|
|
666
|
+
children: unavailable?.message ?? "File preview is unavailable."
|
|
667
|
+
})]
|
|
668
|
+
});
|
|
597
669
|
if (file.asset && media && assetUrl.url) return /* @__PURE__ */ jsxs("div", {
|
|
598
670
|
ref: fileViewRef,
|
|
599
671
|
className: "workspace-explorer__file",
|
|
@@ -608,92 +680,98 @@ function WorkspaceFileView({ appearance = "contained", file, path, isLoading, is
|
|
|
608
680
|
onScroll: handleScroll
|
|
609
681
|
})]
|
|
610
682
|
});
|
|
611
|
-
if (
|
|
612
|
-
if (isMarkdown && markdownView === "preview") {
|
|
613
|
-
const skill = isWorkspaceSkillPath(file.path) ? parseWorkspaceSkill(file.content) : null;
|
|
614
|
-
const markdown = skill?.parsed?.body ?? file.content;
|
|
615
|
-
const response = /* @__PURE__ */ jsx(WorkspaceMessageResponse, {
|
|
616
|
-
className: "workspace-explorer__markdown-content",
|
|
617
|
-
components: markdownComponents,
|
|
618
|
-
mode: "static",
|
|
619
|
-
rehypePlugins: workspaceRehypePlugins,
|
|
620
|
-
children: markdown
|
|
621
|
-
}, path);
|
|
622
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
623
|
-
ref: fileViewRef,
|
|
624
|
-
className: "workspace-explorer__file",
|
|
625
|
-
"data-appearance": appearance,
|
|
626
|
-
"data-workspace-restoration-scope": "file",
|
|
627
|
-
children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
|
|
628
|
-
ref: scrollRef,
|
|
629
|
-
className: "workspace-explorer__markdown-scroll",
|
|
630
|
-
"data-workspace-file-content": "",
|
|
631
|
-
"data-workspace-scroll": "",
|
|
632
|
-
onScroll: handleScroll,
|
|
633
|
-
children: /* @__PURE__ */ jsxs("article", {
|
|
634
|
-
className: "workspace-explorer__markdown",
|
|
635
|
-
children: [skill ? /* @__PURE__ */ jsxs("header", {
|
|
636
|
-
className: "workspace-explorer__skill",
|
|
637
|
-
"data-skill-identity": showSkillIdentity ? "" : void 0,
|
|
638
|
-
children: [
|
|
639
|
-
showSkillIdentity ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
640
|
-
className: "workspace-explorer__skill-kicker",
|
|
641
|
-
children: "Agent Skill"
|
|
642
|
-
}), skill.parsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
643
|
-
/* @__PURE__ */ jsx("p", {
|
|
644
|
-
className: "workspace-explorer__skill-name",
|
|
645
|
-
children: skill.parsed.properties.name
|
|
646
|
-
}),
|
|
647
|
-
/* @__PURE__ */ jsx("p", {
|
|
648
|
-
className: "workspace-explorer__skill-description",
|
|
649
|
-
children: skill.parsed.properties.description
|
|
650
|
-
}),
|
|
651
|
-
/* @__PURE__ */ jsxs("dl", {
|
|
652
|
-
className: "workspace-explorer__skill-metadata",
|
|
653
|
-
children: [skill.parsed.properties.compatibility ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Compatibility" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.compatibility })] }) : null, skill.parsed.properties.allowedTools ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", { children: "Allowed tools" }), /* @__PURE__ */ jsx("dd", { children: skill.parsed.properties.allowedTools })] }) : null]
|
|
654
|
-
})
|
|
655
|
-
] }) : null] }) : null,
|
|
656
|
-
/* @__PURE__ */ jsxs("div", {
|
|
657
|
-
className: "workspace-explorer__skill-status",
|
|
658
|
-
"data-invalid": skill.validationErrors.length > 0 ? "" : void 0,
|
|
659
|
-
children: [skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx(WarningIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), skill.validationErrors.length > 0 ? `${skill.validationErrors.length.toLocaleString()} validation ${skill.validationErrors.length === 1 ? "issue" : "issues"}` : "Valid Agent Skill"]
|
|
660
|
-
}),
|
|
661
|
-
skill.validationErrors.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
662
|
-
className: "workspace-explorer__skill-errors",
|
|
663
|
-
children: skill.validationErrors.map((error) => /* @__PURE__ */ jsx("li", { children: error }, error))
|
|
664
|
-
}) : null
|
|
665
|
-
]
|
|
666
|
-
}) : null, response]
|
|
667
|
-
})
|
|
668
|
-
})]
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
return /* @__PURE__ */ jsx("div", {
|
|
683
|
+
if (preview && markdownView === "preview") return /* @__PURE__ */ jsxs("div", {
|
|
672
684
|
ref: fileViewRef,
|
|
673
685
|
className: "workspace-explorer__file",
|
|
674
686
|
"data-appearance": appearance,
|
|
675
687
|
"data-workspace-restoration-scope": "file",
|
|
676
|
-
children: /* @__PURE__ */
|
|
677
|
-
className: "workspace-
|
|
678
|
-
code: file.content,
|
|
688
|
+
children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
|
|
689
|
+
className: "workspace-explorer__preview",
|
|
679
690
|
"data-workspace-file-content": "",
|
|
680
691
|
"data-workspace-focus-target": "",
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
692
|
+
onScroll: handleScroll,
|
|
693
|
+
children: preview
|
|
694
|
+
})]
|
|
695
|
+
});
|
|
696
|
+
return /* @__PURE__ */ jsx("div", {
|
|
697
|
+
ref: fileViewRef,
|
|
698
|
+
className: "workspace-explorer__file",
|
|
699
|
+
"data-appearance": appearance,
|
|
700
|
+
"data-workspace-restoration-scope": "file",
|
|
701
|
+
children: /* @__PURE__ */ jsx(WorkspaceTextFile, {
|
|
702
|
+
file,
|
|
703
|
+
headerProps,
|
|
704
|
+
handleScroll,
|
|
705
|
+
markdown: isMarkdown && markdownView === "preview" ? /* @__PURE__ */ jsx(WorkspaceMarkdownArticle, {
|
|
706
|
+
file,
|
|
707
|
+
path,
|
|
708
|
+
showSkillIdentity,
|
|
709
|
+
components: markdownComponents,
|
|
710
|
+
rehypePlugins: workspaceRehypePlugins
|
|
711
|
+
}) : void 0
|
|
695
712
|
})
|
|
696
713
|
});
|
|
697
714
|
}
|
|
715
|
+
function WorkspaceTextFile({ file, headerProps, handleScroll, markdown }) {
|
|
716
|
+
if (file.content === null) return null;
|
|
717
|
+
const language = inferWorkspaceLanguage(file.path);
|
|
718
|
+
if (language === "json" || language === "text") {
|
|
719
|
+
let content;
|
|
720
|
+
try {
|
|
721
|
+
content = /* @__PURE__ */ jsx(ExecutionResult, {
|
|
722
|
+
result: language === "json" ? JSON.parse(file.content) : file.content,
|
|
723
|
+
showSummary: false
|
|
724
|
+
});
|
|
725
|
+
} catch {
|
|
726
|
+
content = /* @__PURE__ */ jsx("p", {
|
|
727
|
+
role: "status",
|
|
728
|
+
children: "This file could not be displayed. Ask Rook to repair it."
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WorkspaceHeader, {
|
|
732
|
+
...headerProps,
|
|
733
|
+
copyAction: /* @__PURE__ */ jsx(CopyButton, {
|
|
734
|
+
label: language === "json" ? "Copy data" : "Copy text",
|
|
735
|
+
text: file.content,
|
|
736
|
+
nativeButton: true,
|
|
737
|
+
render: /* @__PURE__ */ jsx(AppTopBar.Control, {})
|
|
738
|
+
})
|
|
739
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
740
|
+
className: "workspace-explorer__preview",
|
|
741
|
+
"data-workspace-file-content": "",
|
|
742
|
+
"data-workspace-focus-target": "",
|
|
743
|
+
"data-workspace-scroll": "",
|
|
744
|
+
onScroll: handleScroll,
|
|
745
|
+
children: content
|
|
746
|
+
})] });
|
|
747
|
+
}
|
|
748
|
+
if (markdown) return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(WorkspaceHeader, { ...headerProps }), /* @__PURE__ */ jsx("div", {
|
|
749
|
+
className: "workspace-explorer__markdown-scroll",
|
|
750
|
+
"data-workspace-file-content": "",
|
|
751
|
+
"data-workspace-scroll": "",
|
|
752
|
+
onScroll: handleScroll,
|
|
753
|
+
children: markdown
|
|
754
|
+
})] });
|
|
755
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(CodeBlock, {
|
|
756
|
+
className: "workspace-explorer__code",
|
|
757
|
+
code: file.content,
|
|
758
|
+
"data-workspace-file-content": "",
|
|
759
|
+
"data-workspace-focus-target": "",
|
|
760
|
+
language: inferWorkspaceLanguage(file.path),
|
|
761
|
+
showLineNumbers: true,
|
|
762
|
+
children: [/* @__PURE__ */ jsx(WorkspaceHeader, {
|
|
763
|
+
...headerProps,
|
|
764
|
+
copyAction: /* @__PURE__ */ jsx(CodeBlockCopyButton, {
|
|
765
|
+
size: "sm",
|
|
766
|
+
nativeButton: true,
|
|
767
|
+
render: /* @__PURE__ */ jsx(AppTopBar.Control, {})
|
|
768
|
+
})
|
|
769
|
+
}), /* @__PURE__ */ jsx(CodeBlockContainer, {
|
|
770
|
+
"data-workspace-scroll": "",
|
|
771
|
+
onScroll: handleScroll,
|
|
772
|
+
children: /* @__PURE__ */ jsx(CodeBlockContent, {})
|
|
773
|
+
})]
|
|
774
|
+
}) });
|
|
775
|
+
}
|
|
698
776
|
//#endregion
|
|
699
777
|
export { WorkspaceFileView as t };
|