@mcp-b/react-components 0.46.7 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/{CodeBlock-CcteqDvA.js → CodeBlock-BSJl682D.js} +1 -1
  2. package/dist/Correspondent-7K6uNLUm.d.ts +64 -0
  3. package/dist/{FileTree-jtP9471I.js → FileTree-DvE0hNZu.js} +1 -1
  4. package/dist/{SetupChecklist-BXwSSorj.js → SetupChecklist-DeTU9YpW.js} +1 -1
  5. package/dist/ThinkChat-CwMdEum8.d.ts +185 -0
  6. package/dist/{ThinkChat-qztQ6Clo.js → ThinkChat-DiI6hhDP.js} +14 -14
  7. package/dist/ThinkThreadPicker-yFz4vvIf.d.ts +91 -0
  8. package/dist/{Workspace-DZusrEeP.d.ts → Workspace-LIoU30n7.d.ts} +13 -2
  9. package/dist/{WorkspaceFileView-D0HyoUV8.js → WorkspaceFileView-C_WnYm-a.js} +4 -4
  10. package/dist/{WorkspaceLink-DtH66bAY.js → WorkspaceLink-B1d2GIGl.js} +7 -2
  11. package/dist/WorkspaceLive-DfjH1Ypm.d.ts +61 -0
  12. package/dist/{WorkspaceMessageResponse-CJCmGvTx.js → WorkspaceMessageResponse-BqOezptB.js} +79 -40
  13. package/dist/WorkspaceMessageResponse-kJYU8Onj.d.ts +48 -0
  14. package/dist/components/agents-sdk/AgentActivity.js +1 -1
  15. package/dist/components/agents-sdk/AgentChat.js +2 -2
  16. package/dist/components/agents-sdk/BrowserLiveScreen.js +1 -1
  17. package/dist/components/agents-sdk/BrowserLiveView.js +1 -1
  18. package/dist/components/agents-sdk/BrowserReplay.js +1 -1
  19. package/dist/components/agents-sdk/BrowserRunPanel.js +1 -1
  20. package/dist/components/agents-sdk/ManagerOffice.d.ts +41 -50
  21. package/dist/components/agents-sdk/ManagerOffice.js +359 -978
  22. package/dist/components/agents-sdk/McpConnectionRequest.js +1 -1
  23. package/dist/components/agents-sdk/McpPluginCatalog.js +1 -1
  24. package/dist/components/agents-sdk/McpServerPicker.js +1 -1
  25. package/dist/components/agents-sdk/ModelSelector.js +1 -1
  26. package/dist/components/agents-sdk/PromptInputCommands.js +1 -1
  27. package/dist/components/agents-sdk/SubagentRunIndicator.js +1 -1
  28. package/dist/components/agents-sdk/ThinkChat.d.ts +1 -180
  29. package/dist/components/agents-sdk/ThinkChat.js +1 -1
  30. package/dist/components/agents-sdk/ThinkChatToolPanels.js +1 -1
  31. package/dist/components/agents-sdk/ThinkExecutionDetail.js +1 -1
  32. package/dist/components/agents-sdk/ThinkExecutionStatus.js +1 -1
  33. package/dist/components/agents-sdk/ThinkExecutionWorkbench.js +1 -1
  34. package/dist/components/agents-sdk/ThinkFullApp.d.ts +12 -3
  35. package/dist/components/agents-sdk/ThinkFullApp.js +15 -3
  36. package/dist/components/agents-sdk/ThinkRoutineBrowser.js +1 -1
  37. package/dist/components/agents-sdk/ThinkRoutineForm.js +1 -1
  38. package/dist/components/agents-sdk/ThinkRoutineLibrary.js +1 -1
  39. package/dist/components/agents-sdk/ThinkSidepanel.d.ts +20 -5
  40. package/dist/components/agents-sdk/ThinkSidepanel.js +48 -36
  41. package/dist/components/agents-sdk/ThinkThreadPicker.d.ts +1 -90
  42. package/dist/components/agents-sdk/ThinkThreadPicker.js +1 -1
  43. package/dist/components/agents-sdk/Workspace.d.ts +2 -2
  44. package/dist/components/agents-sdk/Workspace.js +13 -10
  45. package/dist/components/agents-sdk/WorkspaceBrowser.d.ts +1 -1
  46. package/dist/components/agents-sdk/WorkspaceBrowser.js +1 -1
  47. package/dist/components/agents-sdk/WorkspaceConcept.d.ts +45 -0
  48. package/dist/components/agents-sdk/WorkspaceConcept.js +42 -0
  49. package/dist/components/agents-sdk/WorkspaceCorrespondence.d.ts +96 -0
  50. package/dist/components/agents-sdk/WorkspaceCorrespondence.js +429 -0
  51. package/dist/components/agents-sdk/WorkspaceExecution.d.ts +115 -0
  52. package/dist/components/agents-sdk/WorkspaceExecution.js +330 -0
  53. package/dist/components/agents-sdk/WorkspaceExplorer.d.ts +1 -1
  54. package/dist/components/agents-sdk/WorkspaceExplorer.js +2 -2
  55. package/dist/components/agents-sdk/WorkspaceFileView.js +1 -1
  56. package/dist/components/agents-sdk/WorkspaceHeader.js +1 -1
  57. package/dist/components/agents-sdk/WorkspaceLink.js +1 -1
  58. package/dist/components/agents-sdk/WorkspaceLive.d.ts +2 -0
  59. package/dist/components/agents-sdk/WorkspaceLive.js +113 -0
  60. package/dist/components/agents-sdk/WorkspaceMessageResponse.d.ts +2 -2
  61. package/dist/components/agents-sdk/WorkspaceMessageResponse.js +2 -2
  62. package/dist/components/agents-sdk/WorkspaceMountManager.js +1 -1
  63. package/dist/components/agents-sdk/WorkspaceProject.d.ts +131 -0
  64. package/dist/components/agents-sdk/WorkspaceProject.js +238 -0
  65. package/dist/components/agents-sdk/WorkspaceUserScript.d.ts +47 -0
  66. package/dist/components/agents-sdk/WorkspaceUserScript.js +146 -0
  67. package/dist/components/ai-sdk/Activity.js +1 -1
  68. package/dist/components/ai-sdk/AgentChatStartScreen.js +1 -1
  69. package/dist/components/ai-sdk/Approval.js +1 -1
  70. package/dist/components/ai-sdk/Artifact.js +3 -3
  71. package/dist/components/ai-sdk/ChainOfThought.d.ts +1 -1
  72. package/dist/components/ai-sdk/ChainOfThought.js +1 -1
  73. package/dist/components/ai-sdk/Checkpoint.js +1 -1
  74. package/dist/components/ai-sdk/CodeBlock.js +1 -1
  75. package/dist/components/ai-sdk/ComposerLink.d.ts +4 -1
  76. package/dist/components/ai-sdk/ComposerLink.js +4 -3
  77. package/dist/components/ai-sdk/ConnectedAppCards.d.ts +29 -2
  78. package/dist/components/ai-sdk/ConnectedAppCards.js +78 -103
  79. package/dist/components/ai-sdk/Conversation.js +1 -1
  80. package/dist/components/ai-sdk/Correspondent.d.ts +2 -0
  81. package/dist/components/ai-sdk/Correspondent.js +145 -0
  82. package/dist/components/ai-sdk/Goal.js +1 -1
  83. package/dist/components/ai-sdk/MediaPreviewCard.js +1 -1
  84. package/dist/components/ai-sdk/Message.js +1 -1
  85. package/dist/components/ai-sdk/MessageScroller.js +1 -1
  86. package/dist/components/ai-sdk/MessageScrollerVirtual.js +1 -1
  87. package/dist/components/ai-sdk/Plan.js +1 -1
  88. package/dist/components/ai-sdk/PromptInput.js +1 -1
  89. package/dist/components/ai-sdk/Queue.js +1 -1
  90. package/dist/components/ai-sdk/Reasoning.js +1 -1
  91. package/dist/components/ai-sdk/Sources.js +1 -1
  92. package/dist/components/ai-sdk/Task.js +1 -1
  93. package/dist/components/extension/ChatGptSignInScreen.js +1 -1
  94. package/dist/components/extension/CodexModelSelector.js +1 -1
  95. package/dist/components/extension/ConversationTabPicker.js +1 -1
  96. package/dist/components/foundations/Checkbox.js +1 -1
  97. package/dist/components/foundations/ContextMenu.js +1 -1
  98. package/dist/components/foundations/Menubar.js +1 -1
  99. package/dist/components/foundations/SearchField.js +1 -1
  100. package/dist/components/foundations/Select.js +1 -1
  101. package/dist/components/foundations/Stepper.js +1 -1
  102. package/dist/components/foundations/Toast.js +1 -1
  103. package/dist/components/foundations/icons.d.ts +2 -2
  104. package/dist/components/foundations/icons.js +2 -2
  105. package/dist/components/general-purpose/Commit.js +2 -2
  106. package/dist/components/general-purpose/EnvironmentVariables.js +2 -2
  107. package/dist/components/general-purpose/FileTree.js +1 -1
  108. package/dist/components/general-purpose/PricingPlanCard.js +1 -1
  109. package/dist/components/general-purpose/ResponsiveSidebarShell.js +1 -1
  110. package/dist/components/general-purpose/SetupChecklist.js +1 -1
  111. package/dist/components/general-purpose/Terminal.js +2 -2
  112. package/dist/components/general-purpose/TestResults.js +1 -1
  113. package/dist/components/general-purpose/ThemeModeControl.js +1 -1
  114. package/dist/components/general-purpose/WebPreview.js +1 -1
  115. package/dist/components/nanites/AgentConnection.js +2 -2
  116. package/dist/components/nanites/AgentToolDetail.d.ts +1 -1
  117. package/dist/components/nanites/AgentToolDetail.js +2 -2
  118. package/dist/{copy-button-BABPlsc-.js → copy-button-Dk2vRe9j.js} +1 -1
  119. package/dist/{icons-ChPpNMmU.d.ts → icons-CCZGYUwU.d.ts} +6 -1
  120. package/dist/{icons-BC4HZqSK.js → icons-CeGfXO21.js} +3 -2
  121. package/dist/styles/base.css +2 -2
  122. package/dist/styles/connected-app-card.css +8 -0
  123. package/dist/styles/correspondent.css +73 -0
  124. package/dist/styles/description-list.css +3 -1
  125. package/dist/styles/index.css +2 -0
  126. package/dist/styles/manager-office.css +380 -1086
  127. package/dist/styles/workspace-concepts.css +28 -0
  128. package/dist/workspace-assets-GqsCYxqT.js +168 -0
  129. package/package.json +2 -2
  130. package/dist/WorkspaceMessageResponse-D66ty4FO.d.ts +0 -24
@@ -0,0 +1,330 @@
1
+ import { t as cx } from "../../class-names-BiMDVpUo.js";
2
+ import { K as SpinnerIcon, S as FileIcon, Z as TerminalIcon, d as CheckIcon, z as PlayIcon } from "../../icons-CeGfXO21.js";
3
+ import { Button } from "../foundations/Button.js";
4
+ import { Field } from "../foundations/Field.js";
5
+ import { Form } from "../foundations/Form.js";
6
+ import { IconButton } from "../foundations/IconButton.js";
7
+ import { a as formatErrorMessage, o as formatUnknownValue, r as firstLine } from "../../format-COCyV98Z.js";
8
+ import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "../foundations/Card.js";
9
+ import { DescriptionList } from "../foundations/DescriptionList.js";
10
+ import { Input } from "../foundations/Input.js";
11
+ import { Checkbox } from "../foundations/Checkbox.js";
12
+ import { EmptyState } from "../foundations/EmptyState.js";
13
+ import { i as WorkspaceDeleteControl, n as WorkspaceComposerLink, r as httpUrl, t as FaviconMark } from "../../workspace-assets-GqsCYxqT.js";
14
+ import * as React from "react";
15
+ import { createElement } from "react";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ import { useMutation, useQuery } from "@tanstack/react-query";
18
+ //#region src/components/agents-sdk/WorkspaceExecution.tsx
19
+ function draftFrom(parameters) {
20
+ return Object.fromEntries(parameters.flatMap((parameter) => parameter.value === void 0 ? [] : [[parameter.name, parameter.type === "boolean" ? Boolean(parameter.value) : String(parameter.value)]]));
21
+ }
22
+ /**
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
+ */
26
+ function collectRunParameters(parameters, draft) {
27
+ const collected = [];
28
+ for (const parameter of parameters) {
29
+ if (parameter.type === "boolean") {
30
+ if (Object.hasOwn(draft, parameter.name)) collected.push({
31
+ ...parameter,
32
+ value: Boolean(draft[parameter.name])
33
+ });
34
+ continue;
35
+ }
36
+ const raw = draft[parameter.name];
37
+ const text = (typeof raw === "string" ? raw : String(raw ?? "")).trim();
38
+ if (text === "") continue;
39
+ if (parameter.type === "number") {
40
+ const numeric = Number(text);
41
+ collected.push({
42
+ ...parameter,
43
+ value: Number.isFinite(numeric) ? numeric : text
44
+ });
45
+ continue;
46
+ }
47
+ collected.push({
48
+ ...parameter,
49
+ value: text
50
+ });
51
+ }
52
+ return collected;
53
+ }
54
+ function snapshotValue(parameter) {
55
+ if (parameter.value === void 0) return "";
56
+ if (parameter.type === "boolean") return parameter.value ? "Yes" : "No";
57
+ return String(parameter.value);
58
+ }
59
+ function ExecutionIcon({ module }) {
60
+ return module.icon ?? /* @__PURE__ */ jsx(TerminalIcon, {});
61
+ }
62
+ function RunLinks({ runs }) {
63
+ return /* @__PURE__ */ jsx("div", {
64
+ className: "sigvelo-cluster",
65
+ children: runs.map((run) => /* @__PURE__ */ jsx(WorkspaceComposerLink, {
66
+ value: run.path,
67
+ label: run.label,
68
+ hint: run.path,
69
+ onOpen: run.onOpen
70
+ }, run.path))
71
+ });
72
+ }
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
+ ] });
89
+ }
90
+ function ExecutionFields({ draft, outcome, parameters, runs, onDraftChange }) {
91
+ const fieldId = React.useId();
92
+ const editing = draft != null && onDraftChange != null;
93
+ const runItems = runs ?? [];
94
+ const visibleParameters = editing ? parameters : parameters.filter((parameter) => snapshotValue(parameter) !== "");
95
+ if (visibleParameters.length === 0 && runItems.length === 0 && outcome === void 0) return null;
96
+ return /* @__PURE__ */ jsxs(DescriptionList.Root, {
97
+ align: "start",
98
+ variant: "divided",
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
+ })]
130
+ });
131
+ }
132
+ function ExecutionActions({ busy, module }) {
133
+ if (module.onRun == null && module.onOpen == null && module.onDelete == null) return null;
134
+ return /* @__PURE__ */ jsxs(CardAction, {
135
+ className: "sigvelo-cluster",
136
+ children: [
137
+ module.onRun ? /* @__PURE__ */ jsx(IconButton, {
138
+ type: "submit",
139
+ label: `Run ${module.name}`,
140
+ tooltip: "Run",
141
+ variant: "ghost",
142
+ color: "neutral",
143
+ disabled: busy,
144
+ children: /* @__PURE__ */ jsx(PlayIcon, {})
145
+ }) : null,
146
+ module.onOpen ? /* @__PURE__ */ jsx(IconButton, {
147
+ label: `Open ${module.name}`,
148
+ tooltip: module.path,
149
+ variant: "ghost",
150
+ color: "neutral",
151
+ onClick: module.onOpen,
152
+ children: /* @__PURE__ */ jsx(FileIcon, {})
153
+ }) : null,
154
+ module.onDelete ? /* @__PURE__ */ jsx(WorkspaceDeleteControl, {
155
+ name: module.name,
156
+ onDelete: module.onDelete
157
+ }) : null
158
+ ]
159
+ });
160
+ }
161
+ function executionFormKey(module) {
162
+ return `${module.path}:${JSON.stringify(module.parameters)}`;
163
+ }
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 }) {
172
+ const titleId = React.useId();
173
+ const ariaLabel = props["aria-label"];
174
+ const ariaLabelledBy = props["aria-labelledby"] ?? (ariaLabel ? void 0 : titleId);
175
+ const editing = module.onRun != null;
176
+ const [draft, setDraft] = React.useState(() => draftFrom(module.parameters));
177
+ const formKey = executionFormKey(module);
178
+ const [seenFormKey, setSeenFormKey] = React.useState(formKey);
179
+ if (formKey !== seenFormKey) {
180
+ setSeenFormKey(formKey);
181
+ setDraft(draftFrom(module.parameters));
182
+ }
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);
190
+ const header = /* @__PURE__ */ jsxs(CardHeader, { children: [
191
+ /* @__PURE__ */ jsxs(CardTitle, {
192
+ id: titleId,
193
+ className: "connected-app-card__title",
194
+ render: /* @__PURE__ */ jsx("h3", {}),
195
+ children: [/* @__PURE__ */ jsx("span", {
196
+ className: "connected-app-card__icon",
197
+ "aria-hidden": "true",
198
+ children: /* @__PURE__ */ jsx(ExecutionIcon, { module })
199
+ }), module.name]
200
+ }),
201
+ module.description ? /* @__PURE__ */ jsx(CardDescription, { children: module.description }) : null,
202
+ /* @__PURE__ */ jsx(ExecutionActions, {
203
+ busy,
204
+ module
205
+ })
206
+ ] });
207
+ const body = hasBody ? /* @__PURE__ */ jsxs(CardContent, { children: [
208
+ /* @__PURE__ */ jsx(ExecutionFields, {
209
+ draft: editing ? draft : void 0,
210
+ outcome: runMutation.isSuccess ? runMutation.data : void 0,
211
+ parameters: module.parameters,
212
+ runs: module.runs,
213
+ onDraftChange: editing ? (name, value) => setDraft((current) => ({
214
+ ...current,
215
+ [name]: value
216
+ })) : void 0
217
+ }),
218
+ errorMessage ? /* @__PURE__ */ jsx(Field.Errors, { errors: [errorMessage] }) : null,
219
+ /* @__PURE__ */ jsx("span", {
220
+ className: "sigvelo-visually-hidden",
221
+ role: "status",
222
+ "aria-atomic": "true",
223
+ children: errorMessage || (busy ? "Running" : runMutation.isSuccess ? "Completed" : "")
224
+ })
225
+ ] }) : null;
226
+ const inner = editing ? /* @__PURE__ */ jsxs(Form, {
227
+ noValidate: true,
228
+ onSubmit: (event) => {
229
+ event.preventDefault();
230
+ if (!busy) runMutation.mutate();
231
+ },
232
+ children: [header, body]
233
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [header, body] });
234
+ return /* @__PURE__ */ jsx(Card, {
235
+ ...props,
236
+ ref,
237
+ role: props.role ?? "article",
238
+ "aria-labelledby": ariaLabelledBy,
239
+ "data-slot": "workspace-execution-card",
240
+ size: "sm",
241
+ className: cx("connected-app-card", className),
242
+ children: inner
243
+ });
244
+ }
245
+ /**
246
+ * Compact inline card for one queried execution module.
247
+ */
248
+ function WorkspaceExecutionFile({ fallback = null, path, source, ...props }) {
249
+ const module = useQuery(source.queryOptions).data?.find((candidate) => candidate.path === path);
250
+ if (!module) return fallback;
251
+ return /* @__PURE__ */ jsx(WorkspaceExecutionCard, {
252
+ ...props,
253
+ module: executionWithSource(module, source)
254
+ });
255
+ }
256
+ /**
257
+ * Workbench library. Same card as the inline placement. A query failure with
258
+ * nothing loaded renders as a quiet inline error, never as an empty library.
259
+ */
260
+ function WorkspaceExecutionsPanel({ className, error, loading = false, modules, onRetry, ref, ...props }) {
261
+ return /* @__PURE__ */ jsx("section", {
262
+ ref,
263
+ "data-slot": "workspace-executions-panel",
264
+ className: cx("workspace-concept-panel", className),
265
+ ...props,
266
+ "aria-label": props["aria-label"] ?? "Executions",
267
+ children: modules.length > 0 ? /* @__PURE__ */ jsx("ul", {
268
+ className: "sigvelo-stack-list sigvelo-stack",
269
+ children: modules.map((module) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(WorkspaceExecutionCard, { module }) }, module.path))
270
+ }) : error !== void 0 ? /* @__PURE__ */ jsx(EmptyState, {
271
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
272
+ title: "Executions unavailable",
273
+ description: error,
274
+ children: onRetry ? /* @__PURE__ */ jsx(Button, {
275
+ size: "sm",
276
+ variant: "outline",
277
+ color: "neutral",
278
+ onClick: onRetry,
279
+ children: "Retry"
280
+ }) : null
281
+ }) : loading ? /* @__PURE__ */ jsx(EmptyState, {
282
+ icon: /* @__PURE__ */ jsx(SpinnerIcon, {}),
283
+ title: "Loading modules"
284
+ }) : /* @__PURE__ */ jsx(EmptyState, {
285
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
286
+ title: "No modules"
287
+ })
288
+ });
289
+ }
290
+ function executionWithSource(module, source) {
291
+ const { onDelete, onOpen, onRun } = source;
292
+ const withOpen = (run) => ({
293
+ ...run,
294
+ onOpen: onOpen ? () => onOpen(run.path) : void 0
295
+ });
296
+ return {
297
+ ...module,
298
+ runs: module.runs?.map(withOpen),
299
+ onRun: onRun ? async (parameters) => {
300
+ const outcome = await onRun(module.path, parameters);
301
+ return {
302
+ ...outcome,
303
+ runs: outcome.runs.map(withOpen)
304
+ };
305
+ } : void 0,
306
+ onOpen: onOpen ? () => onOpen(module.path) : void 0,
307
+ onDelete: onDelete ? () => onDelete(module.path) : void 0
308
+ };
309
+ }
310
+ function WorkspaceExecutionSourcePanel({ source }) {
311
+ const query = useQuery(source.queryOptions);
312
+ return /* @__PURE__ */ jsx(WorkspaceExecutionsPanel, {
313
+ modules: (query.data ?? []).map((module) => executionWithSource(module, source)),
314
+ error: query.isError ? formatErrorMessage(query.error) : void 0,
315
+ loading: query.isPending,
316
+ onRetry: query.isError ? () => void query.refetch() : void 0,
317
+ "aria-busy": query.isFetching || void 0
318
+ });
319
+ }
320
+ /** Canonical workbench descriptor; hosts supply only the source adapter. */
321
+ function workspaceExecutionsPanel(source) {
322
+ return {
323
+ id: "executions",
324
+ label: "Executions",
325
+ icon: /* @__PURE__ */ jsx(TerminalIcon, {}),
326
+ render: () => /* @__PURE__ */ jsx(WorkspaceExecutionSourcePanel, { source })
327
+ };
328
+ }
329
+ //#endregion
330
+ export { WorkspaceExecutionCard, WorkspaceExecutionFile, WorkspaceExecutionsPanel, workspaceExecutionsPanel };
@@ -1,5 +1,5 @@
1
1
  import { l as WorkspaceNavigationAdapter } from "../../WorkspaceLink-Bh9-Jo1r.js";
2
- import { y as WorkspaceState } from "../../Workspace-DZusrEeP.js";
2
+ import { b as WorkspaceState } from "../../Workspace-LIoU30n7.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-DtH66bAY.js";
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-D0HyoUV8.js";
5
+ import { t as WorkspaceFileView } from "../../WorkspaceFileView-C_WnYm-a.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-D0HyoUV8.js";
1
+ import { t as WorkspaceFileView } from "../../WorkspaceFileView-C_WnYm-a.js";
2
2
  export { WorkspaceFileView };
@@ -1,4 +1,4 @@
1
- import { H as RefreshIcon } from "../../icons-BC4HZqSK.js";
1
+ import { H as RefreshIcon } from "../../icons-CeGfXO21.js";
2
2
  import { AppTopBar } from "../general-purpose/AppTopBar.js";
3
3
  import "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1,2 +1,2 @@
1
- import { n as WorkspaceNavigationProvider, r as resolveWorkspaceLink, t as WorkspaceFileLink } from "../../WorkspaceLink-DtH66bAY.js";
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-DfjH1Ypm.js";
2
+ export { UseWorkspaceLiveQueriesOptions, WorkspaceChange, WorkspaceChangeSource, invalidateWorkspaceDirectories, useWorkspaceLiveQueries };
@@ -0,0 +1,113 @@
1
+ import { refreshWorkspaceFileQueries, workspaceDirectoryQueryKey, workspaceDirectoryQueryPrefix, workspaceFileQueryKey, workspaceInfoQueryKey } from "./Workspace.js";
2
+ import { invalidateWorkspaceConceptQueries, workspacePathsOverlap } 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
+ async function invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths) {
15
+ queryClient.invalidateQueries({
16
+ queryKey: workspaceInfoQueryKey(sourceKey, root),
17
+ exact: true
18
+ });
19
+ if (!source || !selectedPath || paths && !paths.some((path) => workspacePathsOverlap(selectedPath, path))) return;
20
+ await queryClient.cancelQueries({ queryKey: workspaceFileQueryKey(sourceKey, root, selectedPath) });
21
+ await refreshWorkspaceFileQueries(queryClient, {
22
+ source,
23
+ sourceKey,
24
+ root,
25
+ selectedPath,
26
+ resolveFileAsset,
27
+ maxInlineAssetBytes
28
+ }).catch(() => {});
29
+ }
30
+ /**
31
+ * Synchronize external workspace freshness with the design system's Query
32
+ * resources. This is the one external-system effect: native observer events
33
+ * and host revision ticks both land here as targeted invalidation against
34
+ * stable query keys. Hosts only supply events; neither layer adds another
35
+ * watcher.
36
+ */
37
+ function useWorkspaceLiveQueries({ changes, maxInlineAssetBytes, resolveFileAsset, selectedPath, source, sourceKey, root, revision }) {
38
+ const queryClient = useQueryClient();
39
+ const refreshResources = React.useEffectEvent((paths) => {
40
+ if (!sourceKey) return;
41
+ invalidateWorkspaceResources(queryClient, sourceKey, root, source, selectedPath, resolveFileAsset, maxInlineAssetBytes, paths);
42
+ });
43
+ const previousRevisionRef = React.useRef(void 0);
44
+ React.useEffect(() => {
45
+ if (!sourceKey || revision === void 0) return;
46
+ const previous = previousRevisionRef.current;
47
+ previousRevisionRef.current = {
48
+ sourceKey,
49
+ root,
50
+ revision
51
+ };
52
+ if (previous?.sourceKey === sourceKey && previous.root === root && previous.revision === revision) return;
53
+ queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
54
+ invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
55
+ refreshResources();
56
+ }, [
57
+ queryClient,
58
+ revision,
59
+ root,
60
+ sourceKey
61
+ ]);
62
+ React.useEffect(() => {
63
+ if (!changes || !sourceKey) return;
64
+ Promise.resolve().then(() => changes.start?.()).catch((error) => {
65
+ console.error("The workspace change source failed to start.", error);
66
+ });
67
+ const pendingDirectories = /* @__PURE__ */ new Set();
68
+ const pendingPaths = /* @__PURE__ */ new Set();
69
+ let refreshAll = false;
70
+ let timer;
71
+ const flush = () => {
72
+ timer = void 0;
73
+ if (refreshAll) {
74
+ refreshAll = false;
75
+ pendingDirectories.clear();
76
+ pendingPaths.clear();
77
+ queryClient.invalidateQueries({ queryKey: workspaceDirectoryQueryPrefix(sourceKey, root) });
78
+ invalidateWorkspaceConceptQueries(queryClient, sourceKey, root);
79
+ refreshResources();
80
+ return;
81
+ }
82
+ invalidateWorkspaceDirectories(queryClient, sourceKey, pendingDirectories, root);
83
+ const paths = [...pendingPaths];
84
+ pendingDirectories.clear();
85
+ pendingPaths.clear();
86
+ invalidateWorkspaceConceptQueries(queryClient, sourceKey, root, paths);
87
+ refreshResources(paths);
88
+ };
89
+ const unsubscribe = changes.subscribe((change) => {
90
+ if (change.type === "unknown") refreshAll = true;
91
+ else {
92
+ pendingDirectories.add(workspaceDirname(change.path));
93
+ pendingPaths.add(change.path);
94
+ if (change.movedFrom) {
95
+ pendingDirectories.add(workspaceDirname(change.movedFrom));
96
+ pendingPaths.add(change.movedFrom);
97
+ }
98
+ }
99
+ timer ??= setTimeout(flush, DEFAULT_DEBOUNCE_MS);
100
+ });
101
+ return () => {
102
+ unsubscribe();
103
+ if (timer !== void 0) clearTimeout(timer);
104
+ };
105
+ }, [
106
+ changes,
107
+ queryClient,
108
+ root,
109
+ sourceKey
110
+ ]);
111
+ }
112
+ //#endregion
113
+ export { invalidateWorkspaceDirectories, useWorkspaceLiveQueries };
@@ -1,2 +1,2 @@
1
- import { i as WorkspaceMessageResponseProps, n as WorkspaceHtmlArtifactRenderer, r as WorkspaceMessageResponse, t as WorkspaceHtmlArtifactRenderInput } from "../../WorkspaceMessageResponse-D66ty4FO.js";
2
- export { WorkspaceHtmlArtifactRenderInput, WorkspaceHtmlArtifactRenderer, WorkspaceMessageResponse, WorkspaceMessageResponseProps };
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 { t as WorkspaceMessageResponse } from "../../WorkspaceMessageResponse-CJCmGvTx.js";
2
- export { WorkspaceMessageResponse };
1
+ import { n as WorkspaceMessageResponse, t as WorkspaceFileRendererProvider } from "../../WorkspaceMessageResponse-BqOezptB.js";
2
+ export { WorkspaceFileRendererProvider, WorkspaceMessageResponse };
@@ -1,4 +1,4 @@
1
- import { I as PaperclipIcon } from "../../icons-BC4HZqSK.js";
1
+ import { I as PaperclipIcon } from "../../icons-CeGfXO21.js";
2
2
  import { Button } from "../foundations/Button.js";
3
3
  import { Card, CardFooter, CardHeader, CardTitle } from "../foundations/Card.js";
4
4
  import { Popover } from "../foundations/Popover.js";
@@ -0,0 +1,131 @@
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
+ }
12
+ type WorkspaceProjectSectionItem = {
13
+ kind: "file";
14
+ path: string;
15
+ label: string;
16
+ } | {
17
+ kind: "link";
18
+ href: string;
19
+ label: string;
20
+ } | {
21
+ kind: "text";
22
+ label: string;
23
+ };
24
+ interface WorkspaceProjectSection {
25
+ label: string;
26
+ items: readonly WorkspaceProjectSectionItem[];
27
+ }
28
+ interface WorkspaceProjectThread {
29
+ id: string;
30
+ title: string;
31
+ origin: WorkspaceProjectThreadOrigin;
32
+ /** Channel or origin mark. Messenger threads pass a brand favicon. */
33
+ icon?: React.ReactNode;
34
+ }
35
+ interface WorkspaceProject {
36
+ /** Workspace path of PROJECT.md — directories are not addressable. */
37
+ path: string;
38
+ name: string;
39
+ description?: string;
40
+ /** Brand mark. Defaults to `FolderIcon`. */
41
+ icon?: React.ReactNode;
42
+ files?: readonly WorkspaceProjectFile[];
43
+ /** Explicit groups authored under `## Working set` in PROJECT.md. */
44
+ sections?: readonly WorkspaceProjectSection[];
45
+ threads?: readonly WorkspaceProjectThread[];
46
+ }
47
+ type WorkspaceProjectOpenable = {
48
+ onOpen?: () => void;
49
+ };
50
+ type WorkspaceProjectFileView = WorkspaceProjectFile & WorkspaceProjectOpenable;
51
+ type WorkspaceProjectSectionItemView = (Extract<WorkspaceProjectSectionItem, {
52
+ kind: "file";
53
+ }> & WorkspaceProjectOpenable) | Exclude<WorkspaceProjectSectionItem, {
54
+ kind: "file";
55
+ }>;
56
+ interface WorkspaceProjectSectionView {
57
+ label: string;
58
+ items: readonly WorkspaceProjectSectionItemView[];
59
+ }
60
+ type WorkspaceProjectThreadView = WorkspaceProjectThread & WorkspaceProjectOpenable;
61
+ /** Data-only project projection hydrated with card actions outside Query. */
62
+ interface WorkspaceProjectView extends Omit<WorkspaceProject, "files" | "sections" | "threads"> {
63
+ files?: readonly WorkspaceProjectFileView[];
64
+ sections?: readonly WorkspaceProjectSectionView[];
65
+ threads?: readonly WorkspaceProjectThreadView[];
66
+ onOpen?: () => void;
67
+ onDelete?: () => void | Promise<void>;
68
+ }
69
+ interface WorkspaceProjectSource {
70
+ queryOptions: WorkspaceConceptQueryOptions<readonly WorkspaceProject[]>;
71
+ onOpenFile?: (path: string) => void;
72
+ onOpenThread?: (id: string) => void;
73
+ /** Deletes PROJECT.md. The host decides whether the folder goes with it. */
74
+ onDelete?: (path: string) => void | Promise<void>;
75
+ }
76
+ interface WorkspaceProjectCardProps extends Omit<CardProps, "children" | "hover" | "size" | "title"> {
77
+ project: WorkspaceProjectView;
78
+ }
79
+ interface WorkspaceProjectFileCardProps extends Omit<WorkspaceProjectCardProps, "project"> {
80
+ path: string;
81
+ source: WorkspaceProjectSource;
82
+ fallback?: React.ReactNode;
83
+ }
84
+ interface WorkspaceProjectsPanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
85
+ projects: readonly WorkspaceProjectView[];
86
+ loading?: boolean;
87
+ /** Query failure to show instead of the empty state. Loaded projects win. */
88
+ error?: string;
89
+ onRetry?: () => void;
90
+ }
91
+ declare function WorkspaceProjectCard({
92
+ className,
93
+ project,
94
+ ref,
95
+ ...props
96
+ }: WorkspaceProjectCardProps & {
97
+ ref?: React.Ref<HTMLDivElement>;
98
+ }): React.JSX.Element;
99
+ /**
100
+ * Compact inline card for one queried PROJECT.md. Identity plus contents — no status.
101
+ */
102
+ declare function WorkspaceProjectFileCard({
103
+ fallback,
104
+ path,
105
+ source,
106
+ ...props
107
+ }: WorkspaceProjectFileCardProps & {
108
+ ref?: React.Ref<HTMLDivElement>;
109
+ }): 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;
110
+ /** Design-system-owned project query shared by panels, cards, and composer context. */
111
+ declare function useWorkspaceProjects(source: WorkspaceProjectSource): readonly WorkspaceProject[];
112
+ /**
113
+ * Workbench list of queried projects. Same card as the inline placement. A
114
+ * query failure with nothing loaded renders as a quiet inline error, never as
115
+ * an empty library.
116
+ */
117
+ declare function WorkspaceProjectsPanel({
118
+ className,
119
+ error,
120
+ loading,
121
+ projects,
122
+ onRetry,
123
+ ref,
124
+ ...props
125
+ }: WorkspaceProjectsPanelProps & {
126
+ ref?: React.Ref<HTMLElement>;
127
+ }): React.JSX.Element;
128
+ /** Canonical workbench descriptor; hosts supply only the source adapter. */
129
+ declare function workspaceProjectsPanel(source: WorkspaceProjectSource): ThinkFullAppPanel;
130
+ //#endregion
131
+ export { WorkspaceProject, WorkspaceProjectCard, WorkspaceProjectCardProps, WorkspaceProjectFile, WorkspaceProjectFileCard, WorkspaceProjectFileCardProps, WorkspaceProjectFileView, WorkspaceProjectSection, WorkspaceProjectSectionItem, WorkspaceProjectSectionItemView, WorkspaceProjectSectionView, WorkspaceProjectSource, WorkspaceProjectThread, WorkspaceProjectThreadOrigin, WorkspaceProjectThreadView, WorkspaceProjectView, WorkspaceProjectsPanel, WorkspaceProjectsPanelProps, useWorkspaceProjects, workspaceProjectsPanel };