@mcp-b/react-components 0.72.1 → 0.73.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as AgentComputerApp } from "../../AgentComputer-BI8RsGzq.js";
|
|
2
2
|
import { a as ExecutionTrace, r as ExecutionGraph } from "../../ExecutionBoard-DBj1Aiva.js";
|
|
3
|
-
import { l as WorkspaceAutomationSource } from "../../WorkspaceAutomation-hwl6C1aX.js";
|
|
3
|
+
import { l as WorkspaceAutomationSource, x as WorkspaceAutomationTableRun } from "../../WorkspaceAutomation-hwl6C1aX.js";
|
|
4
4
|
import { t as ThinkSchedule } from "../../ThinkSchedule-C9vErgZQ.js";
|
|
5
5
|
import { ComputerCalendarEvent, ComputerCalendarRange } from "./ComputerCalendar.js";
|
|
6
6
|
import { ThinkScheduleFormSchedule, ThinkScheduleFormValue } from "./ThinkScheduleForm.js";
|
|
@@ -19,11 +19,26 @@ export type ComputerAutomationsSection = (typeof COMPUTER_AUTOMATIONS_SECTIONS)[
|
|
|
19
19
|
*/
|
|
20
20
|
export interface ComputerAutomationsSelection {
|
|
21
21
|
section: ComputerAutomationsSection;
|
|
22
|
+
/** The automation, saved run or table run file the workbench shows. */
|
|
22
23
|
workflow?: string;
|
|
23
24
|
schedule: string | null;
|
|
24
25
|
newSchedule?: true;
|
|
25
26
|
run?: string;
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* What the host loaded for the selected workflow file: an automation's step
|
|
30
|
+
* outline, a saved run, or a table run, which opens its automation in table mode.
|
|
31
|
+
*/
|
|
32
|
+
export type ComputerAutomationsSelected = {
|
|
33
|
+
kind: "script";
|
|
34
|
+
graph: ExecutionGraph;
|
|
35
|
+
} | {
|
|
36
|
+
kind: "trace";
|
|
37
|
+
trace: ExecutionTrace;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "table";
|
|
40
|
+
table: WorkspaceAutomationTableRun;
|
|
41
|
+
};
|
|
27
42
|
/**
|
|
28
43
|
* Everything Automations and Calendar read from the host: the saved
|
|
29
44
|
* automations and schedules the side panel's Automations and Schedules already
|
|
@@ -31,12 +46,14 @@ export interface ComputerAutomationsSelection {
|
|
|
31
46
|
* apps place runs on.
|
|
32
47
|
*/
|
|
33
48
|
export interface ComputerAutomationsHost<TSchedule extends ComputerSchedule = ComputerSchedule> {
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Saved automations; Automations itself opens a workflow and starts its
|
|
51
|
+
* schedule, single or per table row. `onOpen` receives every other path a
|
|
52
|
+
* workbench link names, such as a run's trace or result; absent, Files opens it.
|
|
53
|
+
*/
|
|
54
|
+
automations: Omit<WorkspaceAutomationSource, "onSchedule" | "onScheduleTable">;
|
|
55
|
+
/** The selected workflow file's contents, loaded by the host; absent while it loads. */
|
|
56
|
+
selected?: ComputerAutomationsSelected;
|
|
40
57
|
/** Every schedule, each carrying its next run and retained runs. */
|
|
41
58
|
schedules: readonly TSchedule[];
|
|
42
59
|
/** Creates a schedule and resolves its id. `requestKey` is stable for one editor, so a retried save is idempotent. */
|
|
@@ -1045,10 +1045,13 @@ function AutomationsToolbar(t0) {
|
|
|
1045
1045
|
* runs, as the side panel's Automations and Schedules show them.
|
|
1046
1046
|
*/
|
|
1047
1047
|
function useAutomationsModel() {
|
|
1048
|
-
const $ = c(
|
|
1048
|
+
const $ = c(61);
|
|
1049
1049
|
const { host, clock, schedules } = useComputerAutomationsContext();
|
|
1050
1050
|
const files = React.use(AppHostsContext).files;
|
|
1051
1051
|
const { section, workflow: selectedWorkflowPath, run: runId } = host.selection;
|
|
1052
|
+
const { selected } = host;
|
|
1053
|
+
const selectedTable = selected?.kind === "table" ? selected.table : void 0;
|
|
1054
|
+
const openPath = selectedTable?.invocation.path ?? selectedWorkflowPath;
|
|
1052
1055
|
const navigate = host.onNavigate;
|
|
1053
1056
|
let t0;
|
|
1054
1057
|
if ($[0] !== navigate) {
|
|
@@ -1095,29 +1098,31 @@ function useAutomationsModel() {
|
|
|
1095
1098
|
const { openAutomationSchedule } = schedules;
|
|
1096
1099
|
const workflows = useQuery(host.automations.queryOptions);
|
|
1097
1100
|
const { onRun } = host.automations;
|
|
1098
|
-
|
|
1099
|
-
if ($[9] !== openWorkspaceFile || $[10] !== setSelectedWorkflowPath || $[11] !== workflows) {
|
|
1100
|
-
t5 = (path_1) => workflows.data?.some((automation) => automation.path === path_1) ? setSelectedWorkflowPath(path_1) : openWorkspaceFile(path_1);
|
|
1101
|
-
$[9] = openWorkspaceFile;
|
|
1102
|
-
$[10] = setSelectedWorkflowPath;
|
|
1103
|
-
$[11] = workflows;
|
|
1104
|
-
$[12] = t5;
|
|
1105
|
-
} else t5 = $[12];
|
|
1101
|
+
const t5 = selectedTable ?? host.automations.tableExecution;
|
|
1106
1102
|
let t6;
|
|
1103
|
+
if ($[9] !== host.automations.onOpen || $[10] !== openWorkspaceFile || $[11] !== setSelectedWorkflowPath || $[12] !== workflows) {
|
|
1104
|
+
t6 = (path_1) => workflows.data?.some((automation) => automation.path === path_1) ? setSelectedWorkflowPath(path_1) : (host.automations.onOpen ?? openWorkspaceFile)(path_1);
|
|
1105
|
+
$[9] = host.automations.onOpen;
|
|
1106
|
+
$[10] = openWorkspaceFile;
|
|
1107
|
+
$[11] = setSelectedWorkflowPath;
|
|
1108
|
+
$[12] = workflows;
|
|
1109
|
+
$[13] = t6;
|
|
1110
|
+
} else t6 = $[13];
|
|
1107
1111
|
let t7;
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
t7 = async (
|
|
1111
|
-
|
|
1112
|
-
$[14] =
|
|
1112
|
+
let t8;
|
|
1113
|
+
if ($[14] !== openAutomationSchedule) {
|
|
1114
|
+
t7 = async (path_2) => void await openAutomationSchedule({ path: path_2 });
|
|
1115
|
+
t8 = async (invocation) => void await openAutomationSchedule(invocation);
|
|
1116
|
+
$[14] = openAutomationSchedule;
|
|
1113
1117
|
$[15] = t7;
|
|
1118
|
+
$[16] = t8;
|
|
1114
1119
|
} else {
|
|
1115
|
-
t6 = $[14];
|
|
1116
1120
|
t7 = $[15];
|
|
1121
|
+
t8 = $[16];
|
|
1117
1122
|
}
|
|
1118
|
-
let
|
|
1119
|
-
if ($[
|
|
1120
|
-
|
|
1123
|
+
let t9;
|
|
1124
|
+
if ($[17] !== onRun) {
|
|
1125
|
+
t9 = onRun ? async (invocation_0) => {
|
|
1121
1126
|
const outcome = await onRun(invocation_0);
|
|
1122
1127
|
const [output] = outcome.files;
|
|
1123
1128
|
if (output) setRecentWorkflowOutputs((current) => [{
|
|
@@ -1126,40 +1131,42 @@ function useAutomationsModel() {
|
|
|
1126
1131
|
}, ...current.filter((candidate) => candidate.workflowPath !== invocation_0.path || candidate.run.path !== output.path)]);
|
|
1127
1132
|
return outcome;
|
|
1128
1133
|
} : void 0;
|
|
1129
|
-
$[
|
|
1130
|
-
$[
|
|
1131
|
-
} else
|
|
1132
|
-
let
|
|
1133
|
-
if ($[
|
|
1134
|
-
|
|
1134
|
+
$[17] = onRun;
|
|
1135
|
+
$[18] = t9;
|
|
1136
|
+
} else t9 = $[18];
|
|
1137
|
+
let t10;
|
|
1138
|
+
if ($[19] !== host.automations || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9) {
|
|
1139
|
+
t10 = {
|
|
1135
1140
|
...host.automations,
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1141
|
+
tableExecution: t5,
|
|
1142
|
+
onOpen: t6,
|
|
1143
|
+
onSchedule: t7,
|
|
1144
|
+
onScheduleTable: t8,
|
|
1145
|
+
onRun: t9
|
|
1140
1146
|
};
|
|
1141
|
-
$[
|
|
1142
|
-
$[
|
|
1143
|
-
$[
|
|
1144
|
-
$[
|
|
1145
|
-
$[
|
|
1146
|
-
$[
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
$[
|
|
1154
|
-
$[
|
|
1155
|
-
|
|
1156
|
-
|
|
1147
|
+
$[19] = host.automations;
|
|
1148
|
+
$[20] = t5;
|
|
1149
|
+
$[21] = t6;
|
|
1150
|
+
$[22] = t7;
|
|
1151
|
+
$[23] = t8;
|
|
1152
|
+
$[24] = t9;
|
|
1153
|
+
$[25] = t10;
|
|
1154
|
+
} else t10 = $[25];
|
|
1155
|
+
const source = t10;
|
|
1156
|
+
let t11;
|
|
1157
|
+
if ($[26] !== host.schedules || $[27] !== runId) {
|
|
1158
|
+
t11 = host.schedules.flatMap(_temp7).find((run_0) => getThinkExecutionRunId(run_0) === runId) ?? null;
|
|
1159
|
+
$[26] = host.schedules;
|
|
1160
|
+
$[27] = runId;
|
|
1161
|
+
$[28] = t11;
|
|
1162
|
+
} else t11 = $[28];
|
|
1163
|
+
const selectedRun = t11;
|
|
1157
1164
|
const scheduleApp = schedules.model;
|
|
1158
1165
|
const [outlet] = React.useState(createAppBarOutlet);
|
|
1159
1166
|
const [sections, setSections] = React.useState(null);
|
|
1160
|
-
let
|
|
1161
|
-
if ($[
|
|
1162
|
-
|
|
1167
|
+
let t12;
|
|
1168
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1169
|
+
t12 = /* @__PURE__ */ jsxs(Tabs.Tab, {
|
|
1163
1170
|
unstyled: true,
|
|
1164
1171
|
value: "workflows",
|
|
1165
1172
|
render: /* @__PURE__ */ jsx(Button, {
|
|
@@ -1170,11 +1177,11 @@ function useAutomationsModel() {
|
|
|
1170
1177
|
}),
|
|
1171
1178
|
children: [/* @__PURE__ */ jsx(QueueIcon, { "aria-hidden": "true" }), "Automations"]
|
|
1172
1179
|
});
|
|
1173
|
-
$[
|
|
1174
|
-
} else
|
|
1175
|
-
let
|
|
1176
|
-
if ($[
|
|
1177
|
-
|
|
1180
|
+
$[29] = t12;
|
|
1181
|
+
} else t12 = $[29];
|
|
1182
|
+
let t13;
|
|
1183
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1184
|
+
t13 = /* @__PURE__ */ jsxs(Tabs.Tab, {
|
|
1178
1185
|
unstyled: true,
|
|
1179
1186
|
value: "schedules",
|
|
1180
1187
|
render: /* @__PURE__ */ jsx(Button, {
|
|
@@ -1185,17 +1192,17 @@ function useAutomationsModel() {
|
|
|
1185
1192
|
}),
|
|
1186
1193
|
children: [/* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": "true" }), "Schedules"]
|
|
1187
1194
|
});
|
|
1188
|
-
$[
|
|
1189
|
-
} else
|
|
1190
|
-
let
|
|
1191
|
-
if ($[
|
|
1192
|
-
|
|
1195
|
+
$[30] = t13;
|
|
1196
|
+
} else t13 = $[30];
|
|
1197
|
+
let t14;
|
|
1198
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1199
|
+
t14 = /* @__PURE__ */ jsxs(Tabs.List, {
|
|
1193
1200
|
unstyled: true,
|
|
1194
1201
|
className: "computer-automations__tabs",
|
|
1195
1202
|
"aria-label": "Automations",
|
|
1196
1203
|
children: [
|
|
1197
|
-
t11,
|
|
1198
1204
|
t12,
|
|
1205
|
+
t13,
|
|
1199
1206
|
/* @__PURE__ */ jsxs(Tabs.Tab, {
|
|
1200
1207
|
unstyled: true,
|
|
1201
1208
|
value: "runs",
|
|
@@ -1209,27 +1216,27 @@ function useAutomationsModel() {
|
|
|
1209
1216
|
})
|
|
1210
1217
|
]
|
|
1211
1218
|
});
|
|
1212
|
-
$[
|
|
1213
|
-
} else
|
|
1214
|
-
const sectionList =
|
|
1215
|
-
const
|
|
1216
|
-
let
|
|
1217
|
-
if ($[
|
|
1218
|
-
|
|
1219
|
-
const { phone } =
|
|
1219
|
+
$[31] = t14;
|
|
1220
|
+
} else t14 = $[31];
|
|
1221
|
+
const sectionList = t14;
|
|
1222
|
+
const t15 = section === "schedules" ? scheduleApp.renderMenus : void 0;
|
|
1223
|
+
let t16;
|
|
1224
|
+
if ($[32] !== outlet || $[33] !== scheduleApp.renderTitle || $[34] !== schedules.editing) {
|
|
1225
|
+
t16 = schedules.editing ? scheduleApp.renderTitle : (t17) => {
|
|
1226
|
+
const { phone } = t17;
|
|
1220
1227
|
return phone ? "Automations" : /* @__PURE__ */ jsx(AutomationsToolbar, {
|
|
1221
1228
|
outlet,
|
|
1222
1229
|
sections: setSections
|
|
1223
1230
|
});
|
|
1224
1231
|
};
|
|
1225
|
-
$[
|
|
1226
|
-
$[
|
|
1227
|
-
$[
|
|
1228
|
-
$[
|
|
1229
|
-
} else
|
|
1230
|
-
let
|
|
1231
|
-
if ($[
|
|
1232
|
-
|
|
1232
|
+
$[32] = outlet;
|
|
1233
|
+
$[33] = scheduleApp.renderTitle;
|
|
1234
|
+
$[34] = schedules.editing;
|
|
1235
|
+
$[35] = t16;
|
|
1236
|
+
} else t16 = $[35];
|
|
1237
|
+
let t17;
|
|
1238
|
+
if ($[36] !== clock || $[37] !== host || $[38] !== openPath || $[39] !== openWorkspaceFile || $[40] !== outlet || $[41] !== recentWorkflowOutputs || $[42] !== runId || $[43] !== scheduleApp || $[44] !== schedules.editing || $[45] !== section || $[46] !== sections || $[47] !== selected || $[48] !== selectedRun || $[49] !== setSection || $[50] !== setSelectedRun || $[51] !== setSelectedWorkflowPath || $[52] !== source || $[53] !== workflows) {
|
|
1239
|
+
t17 = (context) => {
|
|
1233
1240
|
const paneOutlet = (pane) => !context.phone && section === pane ? outlet : null;
|
|
1234
1241
|
return schedules.editing ? scheduleApp.render(context) : /* @__PURE__ */ jsxs(Tabs.Root, {
|
|
1235
1242
|
className: "computer-automations",
|
|
@@ -1248,11 +1255,11 @@ function useAutomationsModel() {
|
|
|
1248
1255
|
children: /* @__PURE__ */ jsx(ContentAppBarOutletContext, {
|
|
1249
1256
|
value: paneOutlet("workflows"),
|
|
1250
1257
|
children: /* @__PURE__ */ jsx(WorkspaceAutomationsPanel, {
|
|
1251
|
-
"aria-label": workflows.data?.find((automation_0) => automation_0.path ===
|
|
1258
|
+
"aria-label": workflows.data?.find((automation_0) => automation_0.path === openPath)?.name ?? "Automation library",
|
|
1252
1259
|
source,
|
|
1253
|
-
selectedPath:
|
|
1254
|
-
selectedGraph:
|
|
1255
|
-
selectedTrace:
|
|
1260
|
+
selectedPath: openPath,
|
|
1261
|
+
selectedGraph: selected?.kind === "script" ? selected.graph : void 0,
|
|
1262
|
+
selectedTrace: selected?.kind === "trace" ? selected.trace : void 0,
|
|
1256
1263
|
onBack: () => setSelectedWorkflowPath(void 0)
|
|
1257
1264
|
})
|
|
1258
1265
|
})
|
|
@@ -1297,42 +1304,43 @@ function useAutomationsModel() {
|
|
|
1297
1304
|
})]
|
|
1298
1305
|
});
|
|
1299
1306
|
};
|
|
1300
|
-
$[
|
|
1301
|
-
$[
|
|
1302
|
-
$[
|
|
1303
|
-
$[
|
|
1304
|
-
$[
|
|
1305
|
-
$[
|
|
1306
|
-
$[
|
|
1307
|
-
$[
|
|
1308
|
-
$[
|
|
1309
|
-
$[
|
|
1310
|
-
$[
|
|
1311
|
-
$[
|
|
1312
|
-
$[
|
|
1313
|
-
$[
|
|
1314
|
-
$[
|
|
1315
|
-
$[
|
|
1316
|
-
$[
|
|
1317
|
-
$[
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1307
|
+
$[36] = clock;
|
|
1308
|
+
$[37] = host;
|
|
1309
|
+
$[38] = openPath;
|
|
1310
|
+
$[39] = openWorkspaceFile;
|
|
1311
|
+
$[40] = outlet;
|
|
1312
|
+
$[41] = recentWorkflowOutputs;
|
|
1313
|
+
$[42] = runId;
|
|
1314
|
+
$[43] = scheduleApp;
|
|
1315
|
+
$[44] = schedules.editing;
|
|
1316
|
+
$[45] = section;
|
|
1317
|
+
$[46] = sections;
|
|
1318
|
+
$[47] = selected;
|
|
1319
|
+
$[48] = selectedRun;
|
|
1320
|
+
$[49] = setSection;
|
|
1321
|
+
$[50] = setSelectedRun;
|
|
1322
|
+
$[51] = setSelectedWorkflowPath;
|
|
1323
|
+
$[52] = source;
|
|
1324
|
+
$[53] = workflows;
|
|
1325
|
+
$[54] = t17;
|
|
1326
|
+
} else t17 = $[54];
|
|
1327
|
+
let t18;
|
|
1328
|
+
if ($[55] !== scheduleApp.beforeQuit || $[56] !== scheduleApp.onKeyDown || $[57] !== t15 || $[58] !== t16 || $[59] !== t17) {
|
|
1329
|
+
t18 = {
|
|
1322
1330
|
beforeQuit: scheduleApp.beforeQuit,
|
|
1323
1331
|
onKeyDown: scheduleApp.onKeyDown,
|
|
1324
|
-
renderMenus:
|
|
1325
|
-
renderTitle:
|
|
1326
|
-
render:
|
|
1332
|
+
renderMenus: t15,
|
|
1333
|
+
renderTitle: t16,
|
|
1334
|
+
render: t17
|
|
1327
1335
|
};
|
|
1328
|
-
$[
|
|
1329
|
-
$[
|
|
1330
|
-
$[
|
|
1331
|
-
$[
|
|
1332
|
-
$[
|
|
1333
|
-
$[
|
|
1334
|
-
} else
|
|
1335
|
-
return
|
|
1336
|
+
$[55] = scheduleApp.beforeQuit;
|
|
1337
|
+
$[56] = scheduleApp.onKeyDown;
|
|
1338
|
+
$[57] = t15;
|
|
1339
|
+
$[58] = t16;
|
|
1340
|
+
$[59] = t17;
|
|
1341
|
+
$[60] = t18;
|
|
1342
|
+
} else t18 = $[60];
|
|
1343
|
+
return t18;
|
|
1336
1344
|
}
|
|
1337
1345
|
function _temp7(schedule) {
|
|
1338
1346
|
return schedule.runs;
|
|
@@ -10,7 +10,7 @@ export interface EmployeeAppRootProps extends EmployeeShellProps {
|
|
|
10
10
|
brand: EmployeeBrand;
|
|
11
11
|
modelSetup?: EmployeeModelSetup;
|
|
12
12
|
/** Schedule navigation owns its own shell; the chat remains mounted behind it. */
|
|
13
|
-
schedules
|
|
13
|
+
schedules?: React.ReactNode;
|
|
14
14
|
/** Render the extension or manager shell with the same chrome state. */
|
|
15
15
|
shell: (props: EmployeeShellProps) => React.ReactNode;
|
|
16
16
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -18,10 +18,10 @@ export interface EmployeeAppRootProps extends EmployeeShellProps {
|
|
|
18
18
|
/** Persistent admission and navigation frame. Put keyed runtimes and Suspense inside it. */
|
|
19
19
|
declare function EmployeeAppRoot({ status, workspaceNavigation, brand, modelSetup, schedules, shell, ref, children, ...chrome }: EmployeeAppRootProps): React.JSX.Element;
|
|
20
20
|
export interface EmployeeAppContentProps {
|
|
21
|
-
view
|
|
22
|
-
/** Current output pane
|
|
23
|
-
workbench
|
|
24
|
-
live
|
|
21
|
+
view?: EmployeeShellProps["view"];
|
|
22
|
+
/** Current output pane; absent when the conversation occupies the screen. */
|
|
23
|
+
workbench?: React.ReactNode;
|
|
24
|
+
live?: React.ReactNode;
|
|
25
25
|
/** Place transcript hydration boundaries here so they cannot replace navigation or output. */
|
|
26
26
|
children: React.ReactNode;
|
|
27
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-b/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "MCP-B React components built on Base UI and shared design tokens, including Cloudflare Think chat primitives.",
|
|
5
5
|
"homepage": "https://design-system.sigvelo.com",
|
|
6
6
|
"bugs": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"streamdown": "^2.7.0",
|
|
56
56
|
"unist-util-visit": "^5.1.0",
|
|
57
57
|
"yet-another-react-lightbox": "^3.32.2",
|
|
58
|
-
"@mcp-b/design-tokens": "0.
|
|
58
|
+
"@mcp-b/design-tokens": "0.73.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@ai-sdk/react": "^4.0.136",
|