@mcp-b/react-components 0.46.6 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodeBlock-BpooTofO.js → CodeBlock-DMHZiw86.js} +1 -1
- package/dist/{FileTree-CAXWXH63.js → FileTree-BHebfvkK.js} +1 -1
- package/dist/{SetupChecklist-DyPZWzK2.js → SetupChecklist-CwRjIDH4.js} +1 -1
- package/dist/ThinkChat-CwMdEum8.d.ts +185 -0
- package/dist/{ThinkChat-qztQ6Clo.js → ThinkChat-DLDta57t.js} +16 -16
- package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +91 -0
- package/dist/{Workspace-DZusrEeP.d.ts → Workspace-C_zHq9KZ.d.ts} +1 -1
- package/dist/{WorkspaceFileView-BvDbKM2c.js → WorkspaceFileView-ChIJz-fl.js} +4 -4
- package/dist/{WorkspaceLink-DtH66bAY.js → WorkspaceLink-B1d2GIGl.js} +7 -2
- package/dist/WorkspaceLive-DLGhtIly.d.ts +49 -0
- package/dist/{WorkspaceMessageResponse-CJCmGvTx.js → WorkspaceMessageResponse-Dg_aNpoj.js} +76 -40
- package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +48 -0
- package/dist/components/agents-sdk/AgentActivity.js +1 -1
- package/dist/components/agents-sdk/AgentChat.js +22 -18
- package/dist/components/agents-sdk/AgentEvent.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
- package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
- package/dist/components/agents-sdk/BrowserReplay.js +1 -1
- package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
- package/dist/components/agents-sdk/ManagerOffice.js +4 -4
- package/dist/components/agents-sdk/McpConnectionRequest.js +2 -2
- package/dist/components/agents-sdk/McpConnectorForm.js +1 -1
- package/dist/components/agents-sdk/McpPluginCatalog.js +2 -2
- package/dist/components/agents-sdk/McpServerPicker.js +2 -2
- package/dist/components/agents-sdk/ModelSelector.js +3 -3
- package/dist/components/agents-sdk/PromptInputApproval.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/SubagentRunSelector.js +1 -1
- package/dist/components/agents-sdk/ThinkChat.d.ts +1 -180
- package/dist/components/agents-sdk/ThinkChat.js +1 -1
- package/dist/components/agents-sdk/ThinkChatActivity.js +1 -1
- package/dist/components/agents-sdk/ThinkChatToolPanels.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionDetail.js +2 -2
- package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
- package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +3 -3
- package/dist/components/agents-sdk/ThinkFullApp.d.ts +13 -4
- package/dist/components/agents-sdk/ThinkFullApp.js +11 -4
- package/dist/components/agents-sdk/ThinkFullAppViewSwitch.js +1 -1
- package/dist/components/agents-sdk/ThinkRecoveryNotice.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineBrowser.js +2 -2
- package/dist/components/agents-sdk/ThinkRoutineDetail.js +1 -1
- package/dist/components/agents-sdk/ThinkRoutineForm.js +4 -4
- package/dist/components/agents-sdk/ThinkRoutineLibrary.js +3 -3
- package/dist/components/agents-sdk/ThinkRoutineRuns.js +1 -1
- package/dist/components/agents-sdk/ThinkSidepanel.d.ts +20 -5
- package/dist/components/agents-sdk/ThinkSidepanel.js +56 -44
- package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -90
- package/dist/components/agents-sdk/ThinkThreadPicker.js +4 -4
- package/dist/components/agents-sdk/Workspace.d.ts +2 -2
- 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 +44 -0
- package/dist/components/agents-sdk/WorkspaceConcept.js +42 -0
- package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +100 -0
- package/dist/components/agents-sdk/WorkspaceCorrespondence.js +429 -0
- package/dist/components/agents-sdk/WorkspaceExecution.d.ts +106 -0
- package/dist/components/agents-sdk/WorkspaceExecution.js +393 -0
- package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
- package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
- package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
- package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
- package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -0
- package/dist/components/agents-sdk/WorkspaceLive.js +85 -0
- package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +2 -2
- package/dist/components/agents-sdk/WorkspaceMessageResponse.js +2 -2
- package/dist/components/agents-sdk/WorkspaceMountManager.js +2 -2
- package/dist/components/agents-sdk/WorkspaceProject.d.ts +93 -0
- package/dist/components/agents-sdk/WorkspaceProject.js +201 -0
- package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +47 -0
- package/dist/components/agents-sdk/WorkspaceUserScript.js +146 -0
- package/dist/components/ai-sdk/Activity.js +1 -1
- package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
- package/dist/components/ai-sdk/Approval.js +2 -2
- 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.js +1 -1
- package/dist/components/ai-sdk/ComposerLink.d.ts +4 -1
- package/dist/components/ai-sdk/ComposerLink.js +4 -3
- package/dist/components/ai-sdk/ConnectedAppCards.d.ts +22 -2
- package/dist/components/ai-sdk/ConnectedAppCards.js +50 -43
- package/dist/components/ai-sdk/Conversation.js +1 -1
- package/dist/components/ai-sdk/Goal.js +1 -1
- package/dist/components/ai-sdk/InlineCitation.js +1 -1
- package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
- package/dist/components/ai-sdk/Message.js +1 -1
- package/dist/components/ai-sdk/MessageScroller.js +1 -1
- package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
- package/dist/components/ai-sdk/Plan.js +1 -1
- package/dist/components/ai-sdk/PromptInput.js +5 -5
- package/dist/components/ai-sdk/Queue.js +1 -1
- package/dist/components/ai-sdk/Reasoning.js +1 -1
- package/dist/components/ai-sdk/Sources.js +1 -1
- package/dist/components/ai-sdk/Task.js +1 -1
- package/dist/components/extension/ChatGptSignInScreen.js +1 -1
- package/dist/components/extension/CodexModelSelector.js +2 -2
- package/dist/components/extension/ConversationTabPicker.js +2 -2
- package/dist/components/foundations/Checkbox.js +1 -1
- package/dist/components/foundations/Collapsible.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/ToggleGroup.d.ts +1 -1
- package/dist/components/foundations/ToggleGroup.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/PricingBillingToggle.js +1 -1
- package/dist/components/general-purpose/PricingPlanCard.js +2 -2
- package/dist/components/general-purpose/PricingUsageCalculator.js +2 -2
- package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
- package/dist/components/general-purpose/SettingsFormDialog.js +2 -2
- 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 +2 -2
- package/dist/components/general-purpose/WebPreview.js +2 -2
- package/dist/components/nanites/AgentConnection.js +2 -2
- package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
- package/dist/components/nanites/AgentToolDetail.js +5 -5
- package/dist/{copy-button-D7ySsRRo.js → copy-button-CSDuDfdP.js} +1 -1
- package/dist/{icons-D0Pd2P9v.d.ts → icons-CCZGYUwU.d.ts} +6 -6
- package/dist/{icons-BNEY4gO5.js → icons-cuEtsgj9.js} +4 -4
- package/dist/styles/agent-chat.css +33 -13
- package/dist/styles/connected-app-card.css +8 -0
- package/dist/styles/description-list.css +3 -1
- package/dist/styles/index.css +1 -0
- package/dist/styles/workspace-concepts.css +28 -0
- package/dist/workspace-assets-CxpEHsac.js +154 -0
- package/package.json +2 -2
- package/dist/WorkspaceMessageResponse-D66ty4FO.d.ts +0 -24
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { t as cx } from "../../class-names-BiMDVpUo.js";
|
|
2
|
+
import { P as MonitorIcon, S as FileIcon, Z as TerminalIcon, d as CheckIcon, z as PlayIcon } from "../../icons-cuEtsgj9.js";
|
|
3
|
+
import { Button } from "../foundations/Button.js";
|
|
4
|
+
import { IconButton } from "../foundations/IconButton.js";
|
|
5
|
+
import { a as formatErrorMessage } from "../../format-COCyV98Z.js";
|
|
6
|
+
import { EmptyState } from "../foundations/EmptyState.js";
|
|
7
|
+
import { Field } from "../foundations/Field.js";
|
|
8
|
+
import { Form } from "../foundations/Form.js";
|
|
9
|
+
import { Input } from "../foundations/Input.js";
|
|
10
|
+
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
11
|
+
import { Switch } from "../foundations/Switch.js";
|
|
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-CxpEHsac.js";
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { useQuery } from "@tanstack/react-query";
|
|
17
|
+
//#region src/components/agents-sdk/WorkspaceExecution.tsx
|
|
18
|
+
function draftFrom(parameters) {
|
|
19
|
+
return Object.fromEntries(parameters.map((parameter) => [parameter.name, parameter.type === "boolean" ? Boolean(parameter.value) : String(parameter.value ?? "")]));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Typed values for one run. Empty optional fields are omitted — an absent
|
|
23
|
+
* property is the schema's own "use the default" — while empty required
|
|
24
|
+
* fields and non-numeric numbers refuse the run with a field-level message.
|
|
25
|
+
*/
|
|
26
|
+
function collectRunParameters(parameters, draft) {
|
|
27
|
+
const collected = [];
|
|
28
|
+
const problems = [];
|
|
29
|
+
for (const parameter of parameters) {
|
|
30
|
+
if (parameter.type === "boolean") {
|
|
31
|
+
collected.push({
|
|
32
|
+
...parameter,
|
|
33
|
+
value: Boolean(draft[parameter.name])
|
|
34
|
+
});
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const raw = draft[parameter.name];
|
|
38
|
+
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
|
+
}
|
|
43
|
+
if (parameter.type === "number") {
|
|
44
|
+
const numeric = Number(text);
|
|
45
|
+
if (!Number.isFinite(numeric)) {
|
|
46
|
+
problems.push(`${parameter.label} must be a number.`);
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
collected.push({
|
|
50
|
+
...parameter,
|
|
51
|
+
value: numeric
|
|
52
|
+
});
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
collected.push({
|
|
56
|
+
...parameter,
|
|
57
|
+
value: text
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return problems.length > 0 ? {
|
|
61
|
+
status: "invalid",
|
|
62
|
+
message: problems.join(" ")
|
|
63
|
+
} : {
|
|
64
|
+
status: "ok",
|
|
65
|
+
parameters: collected
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function snapshotValue(parameter) {
|
|
69
|
+
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;
|
|
95
|
+
}
|
|
96
|
+
function ExecutionIcon({ module }) {
|
|
97
|
+
if (module.icon) return module.icon;
|
|
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
|
+
}) })] });
|
|
120
|
+
}
|
|
121
|
+
function RunLinks({ runs }) {
|
|
122
|
+
return /* @__PURE__ */ jsx("div", {
|
|
123
|
+
className: "sigvelo-cluster",
|
|
124
|
+
children: runs.map((run) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
|
|
125
|
+
value: run.path,
|
|
126
|
+
label: run.label,
|
|
127
|
+
hint: run.path,
|
|
128
|
+
onOpen: run.onOpen
|
|
129
|
+
}, run.path))
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function RunDetails({ runState, runs }) {
|
|
133
|
+
const completed = runState.status === "completed";
|
|
134
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [completed ? /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsx(DescriptionList.Term, { children: "Last run" }), /* @__PURE__ */ jsx(DescriptionList.Details, { children: /* @__PURE__ */ jsxs("div", {
|
|
135
|
+
className: "sigvelo-cluster",
|
|
136
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
137
|
+
className: "workspace-execution-outcome",
|
|
138
|
+
children: [/* @__PURE__ */ jsx(CheckIcon, { size: 14 }), "Completed"]
|
|
139
|
+
}), runState.runs.length > 0 ? /* @__PURE__ */ jsx(RunLinks, { runs: runState.runs }) : null]
|
|
140
|
+
}) })] }) : null, 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] });
|
|
141
|
+
}
|
|
142
|
+
function ExecutionFields({ draft, parameters, runState, runs, sites, onDraftChange }) {
|
|
143
|
+
const fieldId = React.useId();
|
|
144
|
+
const editing = draft != null && onDraftChange != null;
|
|
145
|
+
const siteItems = siteMarks(sites ?? []);
|
|
146
|
+
const runItems = runs ?? [];
|
|
147
|
+
const visibleParameters = editing ? parameters : parameters.filter((parameter) => snapshotValue(parameter) !== "");
|
|
148
|
+
if (visibleParameters.length === 0 && siteItems.length === 0 && runItems.length === 0 && runState.status !== "completed") return null;
|
|
149
|
+
return /* @__PURE__ */ jsxs(DescriptionList.Root, {
|
|
150
|
+
align: "start",
|
|
151
|
+
variant: "divided",
|
|
152
|
+
children: [
|
|
153
|
+
siteItems.length > 0 ? /* @__PURE__ */ jsx(SiteDetails, { sites: sites ?? [] }) : null,
|
|
154
|
+
visibleParameters.map((parameter) => {
|
|
155
|
+
const id = `${fieldId}-${parameter.name}`;
|
|
156
|
+
const href = parameter.type === "string" ? httpUrl(String(editing ? draft?.[parameter.name] ?? parameter.value : parameter.value)) : void 0;
|
|
157
|
+
return /* @__PURE__ */ jsxs(DescriptionList.Item, { children: [/* @__PURE__ */ jsxs(DescriptionList.Term, {
|
|
158
|
+
id: parameter.type === "boolean" ? id : void 0,
|
|
159
|
+
children: [href ? /* @__PURE__ */ jsx(FaviconMark, { href }) : null, editing && parameter.type !== "boolean" ? /* @__PURE__ */ jsx("label", {
|
|
160
|
+
htmlFor: id,
|
|
161
|
+
children: parameter.label
|
|
162
|
+
}) : parameter.label]
|
|
163
|
+
}), /* @__PURE__ */ jsx(DescriptionList.Details, { children: editing && parameter.type === "boolean" ? /* @__PURE__ */ jsx(Switch.Root, {
|
|
164
|
+
size: "sm",
|
|
165
|
+
checked: Boolean(draft?.[parameter.name]),
|
|
166
|
+
"aria-labelledby": id,
|
|
167
|
+
onCheckedChange: (checked) => {
|
|
168
|
+
if (typeof checked === "boolean") onDraftChange?.(parameter.name, checked);
|
|
169
|
+
},
|
|
170
|
+
children: /* @__PURE__ */ jsx(Switch.Thumb, {})
|
|
171
|
+
}) : editing ? /* @__PURE__ */ jsx(Input, {
|
|
172
|
+
id,
|
|
173
|
+
name: parameter.name,
|
|
174
|
+
type: href ? "url" : void 0,
|
|
175
|
+
required: parameter.required || void 0,
|
|
176
|
+
value: String(draft?.[parameter.name] ?? ""),
|
|
177
|
+
autoComplete: "off",
|
|
178
|
+
inputMode: parameter.type === "number" ? "decimal" : void 0,
|
|
179
|
+
onChange: (event) => onDraftChange?.(parameter.name, event.currentTarget.value)
|
|
180
|
+
}) : snapshotValue(parameter) })] }, parameter.name);
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ jsx(RunDetails, {
|
|
183
|
+
runState,
|
|
184
|
+
runs: runItems
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function ExecutionActions({ busy, module }) {
|
|
190
|
+
if (module.onRun == null && module.onOpen == null && module.onDelete == null) return null;
|
|
191
|
+
return /* @__PURE__ */ jsxs(CardAction, {
|
|
192
|
+
className: "sigvelo-cluster",
|
|
193
|
+
children: [
|
|
194
|
+
module.onRun ? /* @__PURE__ */ jsx(IconButton, {
|
|
195
|
+
type: "submit",
|
|
196
|
+
label: `Run ${module.name}`,
|
|
197
|
+
tooltip: "Run",
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
color: "neutral",
|
|
200
|
+
disabled: busy,
|
|
201
|
+
children: /* @__PURE__ */ jsx(PlayIcon, {})
|
|
202
|
+
}) : null,
|
|
203
|
+
module.onOpen ? /* @__PURE__ */ jsx(IconButton, {
|
|
204
|
+
label: `Open ${module.name}`,
|
|
205
|
+
tooltip: module.path,
|
|
206
|
+
variant: "ghost",
|
|
207
|
+
color: "neutral",
|
|
208
|
+
onClick: module.onOpen,
|
|
209
|
+
children: /* @__PURE__ */ jsx(FileIcon, {})
|
|
210
|
+
}) : null,
|
|
211
|
+
module.onDelete ? /* @__PURE__ */ jsx(WorkspaceDeleteControl, {
|
|
212
|
+
name: module.name,
|
|
213
|
+
onDelete: module.onDelete
|
|
214
|
+
}) : null
|
|
215
|
+
]
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
function executionFormKey(module) {
|
|
219
|
+
return `${module.path}:${JSON.stringify(module.parameters)}`;
|
|
220
|
+
}
|
|
221
|
+
function WorkspaceExecutionCard({ className, module, ref, ...props }) {
|
|
222
|
+
const titleId = React.useId();
|
|
223
|
+
const ariaLabel = props["aria-label"];
|
|
224
|
+
const ariaLabelledBy = props["aria-labelledby"] ?? (ariaLabel ? void 0 : titleId);
|
|
225
|
+
const editing = module.onRun != null;
|
|
226
|
+
const [draft, setDraft] = React.useState(() => draftFrom(module.parameters));
|
|
227
|
+
const [runState, setRunState] = React.useState({ status: "idle" });
|
|
228
|
+
const [validationMessage, setValidationMessage] = React.useState("");
|
|
229
|
+
const formKey = executionFormKey(module);
|
|
230
|
+
const [seenFormKey, setSeenFormKey] = React.useState(formKey);
|
|
231
|
+
if (formKey !== seenFormKey) {
|
|
232
|
+
setSeenFormKey(formKey);
|
|
233
|
+
setDraft(draftFrom(module.parameters));
|
|
234
|
+
setValidationMessage("");
|
|
235
|
+
}
|
|
236
|
+
const busy = runState.status === "running";
|
|
237
|
+
const run = async () => {
|
|
238
|
+
if (!module.onRun || busy) return;
|
|
239
|
+
const submission = collectRunParameters(module.parameters, draft);
|
|
240
|
+
if (submission.status === "invalid") {
|
|
241
|
+
setValidationMessage(submission.message);
|
|
242
|
+
return;
|
|
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);
|
|
260
|
+
const header = /* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
261
|
+
/* @__PURE__ */ jsxs(CardTitle, {
|
|
262
|
+
id: titleId,
|
|
263
|
+
className: "connected-app-card__title",
|
|
264
|
+
render: /* @__PURE__ */ jsx("h3", {}),
|
|
265
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
266
|
+
className: "connected-app-card__icon",
|
|
267
|
+
"aria-hidden": "true",
|
|
268
|
+
children: /* @__PURE__ */ jsx(ExecutionIcon, { module })
|
|
269
|
+
}), module.name]
|
|
270
|
+
}),
|
|
271
|
+
module.description ? /* @__PURE__ */ jsx(CardDescription, { children: module.description }) : null,
|
|
272
|
+
/* @__PURE__ */ jsx(ExecutionActions, {
|
|
273
|
+
busy,
|
|
274
|
+
module
|
|
275
|
+
})
|
|
276
|
+
] });
|
|
277
|
+
const body = hasBody ? /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
278
|
+
/* @__PURE__ */ jsx(ExecutionFields, {
|
|
279
|
+
draft: editing ? draft : void 0,
|
|
280
|
+
parameters: module.parameters,
|
|
281
|
+
runState,
|
|
282
|
+
runs: module.runs,
|
|
283
|
+
sites: module.sites,
|
|
284
|
+
onDraftChange: editing ? (name, value) => {
|
|
285
|
+
setValidationMessage("");
|
|
286
|
+
setDraft((current) => ({
|
|
287
|
+
...current,
|
|
288
|
+
[name]: value
|
|
289
|
+
}));
|
|
290
|
+
} : void 0
|
|
291
|
+
}),
|
|
292
|
+
errorMessage ? /* @__PURE__ */ jsx(Field.Errors, { errors: [errorMessage] }) : null,
|
|
293
|
+
/* @__PURE__ */ jsx("span", {
|
|
294
|
+
className: "sigvelo-visually-hidden",
|
|
295
|
+
role: "status",
|
|
296
|
+
"aria-atomic": "true",
|
|
297
|
+
children: errorMessage || (busy ? "Running" : runState.status === "completed" ? "Completed" : "")
|
|
298
|
+
})
|
|
299
|
+
] }) : null;
|
|
300
|
+
const inner = editing ? /* @__PURE__ */ jsxs(Form, {
|
|
301
|
+
onSubmit: (event) => {
|
|
302
|
+
event.preventDefault();
|
|
303
|
+
run();
|
|
304
|
+
},
|
|
305
|
+
children: [header, body]
|
|
306
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [header, body] });
|
|
307
|
+
return /* @__PURE__ */ jsx(Card, {
|
|
308
|
+
...props,
|
|
309
|
+
ref,
|
|
310
|
+
role: props.role ?? "article",
|
|
311
|
+
"aria-labelledby": ariaLabelledBy,
|
|
312
|
+
"data-slot": "workspace-execution-card",
|
|
313
|
+
size: "sm",
|
|
314
|
+
className: cx("connected-app-card", className),
|
|
315
|
+
children: inner
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Compact inline card for one queried execution module.
|
|
320
|
+
*/
|
|
321
|
+
function WorkspaceExecutionFile({ fallback = null, path, source, ...props }) {
|
|
322
|
+
const module = useQuery(source.queryOptions).data?.find((candidate) => candidate.path === path);
|
|
323
|
+
if (!module) return fallback;
|
|
324
|
+
return /* @__PURE__ */ jsx(WorkspaceExecutionCard, {
|
|
325
|
+
...props,
|
|
326
|
+
module: executionWithSource(module, source)
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Workbench library. Same card as the inline placement. A query failure with
|
|
331
|
+
* nothing loaded renders as a quiet inline error, never as an empty library.
|
|
332
|
+
*/
|
|
333
|
+
function WorkspaceExecutionsPanel({ className, error, modules, onRetry, ref, ...props }) {
|
|
334
|
+
return /* @__PURE__ */ jsx("section", {
|
|
335
|
+
ref,
|
|
336
|
+
"data-slot": "workspace-executions-panel",
|
|
337
|
+
className: cx("workspace-concept-panel", className),
|
|
338
|
+
...props,
|
|
339
|
+
"aria-label": props["aria-label"] ?? "Executions",
|
|
340
|
+
children: modules.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
341
|
+
className: "sigvelo-stack-list sigvelo-stack",
|
|
342
|
+
children: modules.map((module) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceExecutionCard, { module }) }, module.path))
|
|
343
|
+
}) : error !== void 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
344
|
+
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
345
|
+
title: "Executions unavailable",
|
|
346
|
+
description: error,
|
|
347
|
+
children: onRetry ? /* @__PURE__ */ jsx(Button, {
|
|
348
|
+
size: "sm",
|
|
349
|
+
variant: "outline",
|
|
350
|
+
color: "neutral",
|
|
351
|
+
onClick: onRetry,
|
|
352
|
+
children: "Retry"
|
|
353
|
+
}) : null
|
|
354
|
+
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
355
|
+
icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
|
|
356
|
+
title: "No modules"
|
|
357
|
+
})
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
function executionWithSource(module, source) {
|
|
361
|
+
const { onDelete, onOpen, onRun } = source;
|
|
362
|
+
const withOpen = (run) => ({
|
|
363
|
+
...run,
|
|
364
|
+
onOpen: onOpen ? () => onOpen(run.path) : void 0
|
|
365
|
+
});
|
|
366
|
+
return {
|
|
367
|
+
...module,
|
|
368
|
+
runs: module.runs?.map(withOpen),
|
|
369
|
+
onRun: onRun ? async (parameters) => (await onRun(module.path, parameters)).map(withOpen) : void 0,
|
|
370
|
+
onOpen: onOpen ? () => onOpen(module.path) : void 0,
|
|
371
|
+
onDelete: onDelete ? () => onDelete(module.path) : void 0
|
|
372
|
+
};
|
|
373
|
+
}
|
|
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
|
+
//#endregion
|
|
393
|
+
export { WorkspaceExecutionCard, WorkspaceExecutionFile, WorkspaceExecutionsPanel, workspaceExecutionsPanel };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-Bh9-Jo1r.js";
|
|
2
|
-
import {
|
|
2
|
+
import { b as WorkspaceState } from "../../Workspace-C_zHq9KZ.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/agents-sdk/WorkspaceExplorer.d.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
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 { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationProvider, o as useRequiredWorkspaceNavigationRestoration, r as resolveWorkspaceLink } from "../../WorkspaceLink-
|
|
3
|
+
import { a as WorkspaceNavigationRestorationBoundary, n as WorkspaceNavigationProvider, o as useRequiredWorkspaceNavigationRestoration, r as resolveWorkspaceLink } from "../../WorkspaceLink-B1d2GIGl.js";
|
|
4
4
|
import { WorkspaceBrowser } from "./WorkspaceBrowser.js";
|
|
5
|
-
import { t as WorkspaceFileView } from "../../WorkspaceFileView-
|
|
5
|
+
import { t as WorkspaceFileView } from "../../WorkspaceFileView-ChIJz-fl.js";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/agents-sdk/WorkspaceExplorer.tsx
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WorkspaceFileView } from "../../WorkspaceFileView-
|
|
1
|
+
import { t as WorkspaceFileView } from "../../WorkspaceFileView-ChIJz-fl.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-B1d2GIGl.js";
|
|
2
2
|
export { WorkspaceFileLink, WorkspaceNavigationProvider, resolveWorkspaceLink };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as useWorkspaceLiveQueries, i as invalidateWorkspaceDirectories, n as WorkspaceChange, r as WorkspaceChangeSource, t as UseWorkspaceLiveQueriesOptions } from "../../WorkspaceLive-DLGhtIly.js";
|
|
2
|
+
export { UseWorkspaceLiveQueriesOptions, WorkspaceChange, WorkspaceChangeSource, invalidateWorkspaceDirectories, useWorkspaceLiveQueries };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix } from "./Workspace.js";
|
|
2
|
+
import { invalidateWorkspaceConceptQueries } from "./WorkspaceConcept.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
//#region src/components/agents-sdk/WorkspaceLive.ts
|
|
6
|
+
const DEFAULT_DEBOUNCE_MS = 200;
|
|
7
|
+
function workspaceDirname(path) {
|
|
8
|
+
const separator = path.lastIndexOf("/");
|
|
9
|
+
return separator <= 0 ? "/" : path.slice(0, separator);
|
|
10
|
+
}
|
|
11
|
+
function invalidateWorkspaceDirectories(queryClient, sourceKey, directories, root) {
|
|
12
|
+
for (const directory of directories) queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryKey(sourceKey, root, directory) });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Synchronize external workspace freshness with the design system's Query
|
|
16
|
+
* resources. This is the one external-system effect: native observer events
|
|
17
|
+
* and host revision ticks both land here as targeted invalidation against
|
|
18
|
+
* stable query keys. Hosts only supply events; neither layer adds another
|
|
19
|
+
* watcher.
|
|
20
|
+
*/
|
|
21
|
+
function useWorkspaceLiveQueries({ changes, sourceKey, root, revision }) {
|
|
22
|
+
const queryClient = useQueryClient();
|
|
23
|
+
const previousRevisionRef = React.useRef(void 0);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
if (!sourceKey || revision === void 0) return;
|
|
26
|
+
const previous = previousRevisionRef.current;
|
|
27
|
+
previousRevisionRef.current = revision;
|
|
28
|
+
if (revision === previous) return;
|
|
29
|
+
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
|
|
30
|
+
}, [
|
|
31
|
+
queryClient,
|
|
32
|
+
revision,
|
|
33
|
+
root,
|
|
34
|
+
sourceKey
|
|
35
|
+
]);
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
if (!changes || !sourceKey) return;
|
|
38
|
+
Promise.resolve().then(() => changes.start?.()).catch((error) => {
|
|
39
|
+
console.error("The workspace change source failed to start.", error);
|
|
40
|
+
});
|
|
41
|
+
const pendingDirectories = /* @__PURE__ */ new Set();
|
|
42
|
+
const pendingPaths = /* @__PURE__ */ new Set();
|
|
43
|
+
let refreshAll = false;
|
|
44
|
+
let timer;
|
|
45
|
+
const flush = () => {
|
|
46
|
+
timer = void 0;
|
|
47
|
+
if (refreshAll) {
|
|
48
|
+
refreshAll = false;
|
|
49
|
+
pendingDirectories.clear();
|
|
50
|
+
pendingPaths.clear();
|
|
51
|
+
queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
|
|
52
|
+
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
invalidateWorkspaceDirectories(queryClient, sourceKey, pendingDirectories, root);
|
|
56
|
+
const paths = [...pendingPaths];
|
|
57
|
+
pendingDirectories.clear();
|
|
58
|
+
pendingPaths.clear();
|
|
59
|
+
invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, paths);
|
|
60
|
+
};
|
|
61
|
+
const unsubscribe = changes.subscribe((change) => {
|
|
62
|
+
if (change.type === "unknown") refreshAll = true;
|
|
63
|
+
else {
|
|
64
|
+
pendingDirectories.add(workspaceDirname(change.path));
|
|
65
|
+
pendingPaths.add(change.path);
|
|
66
|
+
if (change.movedFrom) {
|
|
67
|
+
pendingDirectories.add(workspaceDirname(change.movedFrom));
|
|
68
|
+
pendingPaths.add(change.movedFrom);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
timer ??= setTimeout(flush, DEFAULT_DEBOUNCE_MS);
|
|
72
|
+
});
|
|
73
|
+
return () => {
|
|
74
|
+
unsubscribe();
|
|
75
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
76
|
+
};
|
|
77
|
+
}, [
|
|
78
|
+
changes,
|
|
79
|
+
queryClient,
|
|
80
|
+
root,
|
|
81
|
+
sourceKey
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { invalidateWorkspaceDirectories, useWorkspaceLiveQueries };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { a as WorkspaceMessageResponseProps, i as WorkspaceMessageResponse, n as WorkspaceFileRenderer, r as WorkspaceFileRendererProvider, t as WorkspaceFileRenderInput } from "../../WorkspaceMessageResponse-kJYU8Onj.js";
|
|
2
|
+
export { WorkspaceFileRenderInput, WorkspaceFileRenderer, WorkspaceFileRendererProvider, WorkspaceMessageResponse, WorkspaceMessageResponseProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { WorkspaceMessageResponse };
|
|
1
|
+
import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-Dg_aNpoj.js";
|
|
2
|
+
export { WorkspaceFileRendererProvider, WorkspaceMessageResponse };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as PaperclipIcon } from "../../icons-cuEtsgj9.js";
|
|
2
2
|
import { Button } from "../foundations/Button.js";
|
|
3
|
-
import { Card, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
4
3
|
import { Popover } from "../foundations/Popover.js";
|
|
5
4
|
import { EmptyState } from "../foundations/EmptyState.js";
|
|
6
5
|
import { AppTopBar } from "../general-purpose/AppTopBar.js";
|
|
6
|
+
import { Card, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
//#region src/components/agents-sdk/WorkspaceMountManager.tsx
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ThinkFullAppPanel } from "./ThinkFullApp.js";
|
|
2
|
+
import { WorkspaceConceptQueryOptions } from "./WorkspaceConcept.js";
|
|
3
|
+
import { CardProps } from "../foundations/Card.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
//#region src/components/agents-sdk/WorkspaceProject.d.ts
|
|
7
|
+
type WorkspaceProjectThreadOrigin = "user" | "routine" | "messenger";
|
|
8
|
+
interface WorkspaceProjectFile {
|
|
9
|
+
path: string;
|
|
10
|
+
label: string;
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
}
|
|
13
|
+
interface WorkspaceProjectThread {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
origin: WorkspaceProjectThreadOrigin;
|
|
17
|
+
/** Channel or origin mark. Messenger threads pass a brand favicon. */
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
onOpen?: () => void;
|
|
20
|
+
}
|
|
21
|
+
interface WorkspaceProject {
|
|
22
|
+
/** Workspace path of PROJECT.md — directories are not addressable. */
|
|
23
|
+
path: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
/** Brand mark. Defaults to `FolderIcon`. */
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
files?: readonly WorkspaceProjectFile[];
|
|
29
|
+
threads?: readonly WorkspaceProjectThread[];
|
|
30
|
+
onOpen?: () => void;
|
|
31
|
+
onDelete?: () => void | Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
interface WorkspaceProjectSource {
|
|
34
|
+
queryOptions: WorkspaceConceptQueryOptions<readonly WorkspaceProject[]>;
|
|
35
|
+
onOpenFile?: (path: string) => void;
|
|
36
|
+
onOpenThread?: (id: string) => void;
|
|
37
|
+
/** Deletes PROJECT.md. The host decides whether the folder goes with it. */
|
|
38
|
+
onDelete?: (path: string) => void | Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
interface WorkspaceProjectCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
|
|
41
|
+
project: WorkspaceProject;
|
|
42
|
+
}
|
|
43
|
+
interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps, "project"> {
|
|
44
|
+
path: string;
|
|
45
|
+
source: WorkspaceProjectSource;
|
|
46
|
+
fallback?: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
interface WorkspaceProjectsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
|
|
49
|
+
projects: readonly WorkspaceProject[];
|
|
50
|
+
/** Query failure to show instead of the empty state. Loaded projects win. */
|
|
51
|
+
error?: string;
|
|
52
|
+
onRetry?: () => void;
|
|
53
|
+
}
|
|
54
|
+
declare function WorkspaceProjectCard({
|
|
55
|
+
className,
|
|
56
|
+
project,
|
|
57
|
+
ref,
|
|
58
|
+
...props
|
|
59
|
+
}: WorkspaceProjectCardProps & {
|
|
60
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
61
|
+
}): React.JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* Compact inline card for one queried PROJECT.md. Identity plus contents — no status.
|
|
64
|
+
*/
|
|
65
|
+
declare function WorkspaceProjectFileCard({
|
|
66
|
+
fallback,
|
|
67
|
+
path,
|
|
68
|
+
source,
|
|
69
|
+
...props
|
|
70
|
+
}: WorkspaceProjectFileCardProps & {
|
|
71
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
72
|
+
}): 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;
|
|
73
|
+
/** Design-system-owned project query shared by panels, cards, and composer context. */
|
|
74
|
+
declare function useWorkspaceProjects(source: WorkspaceProjectSource): readonly WorkspaceProject[];
|
|
75
|
+
/**
|
|
76
|
+
* Workbench list of queried projects. Same card as the inline placement. A
|
|
77
|
+
* query failure with nothing loaded renders as a quiet inline error, never as
|
|
78
|
+
* an empty library.
|
|
79
|
+
*/
|
|
80
|
+
declare function WorkspaceProjectsPanel({
|
|
81
|
+
className,
|
|
82
|
+
error,
|
|
83
|
+
projects,
|
|
84
|
+
onRetry,
|
|
85
|
+
ref,
|
|
86
|
+
...props
|
|
87
|
+
}: WorkspaceProjectsPanelProps & {
|
|
88
|
+
ref?: React.Ref<HTMLElement>;
|
|
89
|
+
}): React.JSX.Element;
|
|
90
|
+
/** Canonical workbench descriptor; hosts supply only the source adapter. */
|
|
91
|
+
declare function workspaceProjectsPanel(source: WorkspaceProjectSource): ThinkFullAppPanel;
|
|
92
|
+
//#endregion
|
|
93
|
+
export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects, workspaceProjectsPanel };
|