@mcp-b/react-components 0.72.2 → 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
@@ -37,10 +52,8 @@ export interface ComputerAutomationsHost<TSchedule extends ComputerSchedule = Co
37
52
  * workbench link names, such as a run's trace or result; absent, Files opens it.
38
53
  */
39
54
  automations: Omit<WorkspaceAutomationSource, "onSchedule" | "onScheduleTable">;
40
- /** The selected automation's step outline, loaded by the host; absent while it loads. */
41
- selectedGraph?: ExecutionGraph;
42
- /** The saved run the host loaded for the selected trace file. */
43
- selectedTrace?: ExecutionTrace;
55
+ /** The selected workflow file's contents, loaded by the host; absent while it loads. */
56
+ selected?: ComputerAutomationsSelected;
44
57
  /** Every schedule, each carrying its next run and retained runs. */
45
58
  schedules: readonly TSchedule[];
46
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(59);
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,30 +1098,31 @@ function useAutomationsModel() {
1095
1098
  const { openAutomationSchedule } = schedules;
1096
1099
  const workflows = useQuery(host.automations.queryOptions);
1097
1100
  const { onRun } = host.automations;
1098
- let t5;
1101
+ const t5 = selectedTable ?? host.automations.tableExecution;
1102
+ let t6;
1099
1103
  if ($[9] !== host.automations.onOpen || $[10] !== openWorkspaceFile || $[11] !== setSelectedWorkflowPath || $[12] !== workflows) {
1100
- t5 = (path_1) => workflows.data?.some((automation) => automation.path === path_1) ? setSelectedWorkflowPath(path_1) : (host.automations.onOpen ?? openWorkspaceFile)(path_1);
1104
+ t6 = (path_1) => workflows.data?.some((automation) => automation.path === path_1) ? setSelectedWorkflowPath(path_1) : (host.automations.onOpen ?? openWorkspaceFile)(path_1);
1101
1105
  $[9] = host.automations.onOpen;
1102
1106
  $[10] = openWorkspaceFile;
1103
1107
  $[11] = setSelectedWorkflowPath;
1104
1108
  $[12] = workflows;
1105
- $[13] = t5;
1106
- } else t5 = $[13];
1107
- let t6;
1109
+ $[13] = t6;
1110
+ } else t6 = $[13];
1108
1111
  let t7;
1112
+ let t8;
1109
1113
  if ($[14] !== openAutomationSchedule) {
1110
- t6 = async (path_2) => void await openAutomationSchedule({ path: path_2 });
1111
- t7 = async (invocation) => void await openAutomationSchedule(invocation);
1114
+ t7 = async (path_2) => void await openAutomationSchedule({ path: path_2 });
1115
+ t8 = async (invocation) => void await openAutomationSchedule(invocation);
1112
1116
  $[14] = openAutomationSchedule;
1113
- $[15] = t6;
1114
- $[16] = t7;
1117
+ $[15] = t7;
1118
+ $[16] = t8;
1115
1119
  } else {
1116
- t6 = $[15];
1117
- t7 = $[16];
1120
+ t7 = $[15];
1121
+ t8 = $[16];
1118
1122
  }
1119
- let t8;
1123
+ let t9;
1120
1124
  if ($[17] !== onRun) {
1121
- t8 = onRun ? async (invocation_0) => {
1125
+ t9 = onRun ? async (invocation_0) => {
1122
1126
  const outcome = await onRun(invocation_0);
1123
1127
  const [output] = outcome.files;
1124
1128
  if (output) setRecentWorkflowOutputs((current) => [{
@@ -1128,16 +1132,17 @@ function useAutomationsModel() {
1128
1132
  return outcome;
1129
1133
  } : void 0;
1130
1134
  $[17] = onRun;
1131
- $[18] = t8;
1132
- } else t8 = $[18];
1133
- let t9;
1134
- if ($[19] !== host.automations || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8) {
1135
- t9 = {
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 = {
1136
1140
  ...host.automations,
1137
- onOpen: t5,
1138
- onSchedule: t6,
1139
- onScheduleTable: t7,
1140
- onRun: t8
1141
+ tableExecution: t5,
1142
+ onOpen: t6,
1143
+ onSchedule: t7,
1144
+ onScheduleTable: t8,
1145
+ onRun: t9
1141
1146
  };
1142
1147
  $[19] = host.automations;
1143
1148
  $[20] = t5;
@@ -1145,22 +1150,23 @@ function useAutomationsModel() {
1145
1150
  $[22] = t7;
1146
1151
  $[23] = t8;
1147
1152
  $[24] = t9;
1148
- } else t9 = $[24];
1149
- const source = t9;
1150
- let t10;
1151
- if ($[25] !== host.schedules || $[26] !== runId) {
1152
- t10 = host.schedules.flatMap(_temp7).find((run_0) => getThinkExecutionRunId(run_0) === runId) ?? null;
1153
- $[25] = host.schedules;
1154
- $[26] = runId;
1155
- $[27] = t10;
1156
- } else t10 = $[27];
1157
- const selectedRun = t10;
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;
1158
1164
  const scheduleApp = schedules.model;
1159
1165
  const [outlet] = React.useState(createAppBarOutlet);
1160
1166
  const [sections, setSections] = React.useState(null);
1161
- let t11;
1162
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
1163
- t11 = /* @__PURE__ */ jsxs(Tabs.Tab, {
1167
+ let t12;
1168
+ if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
1169
+ t12 = /* @__PURE__ */ jsxs(Tabs.Tab, {
1164
1170
  unstyled: true,
1165
1171
  value: "workflows",
1166
1172
  render: /* @__PURE__ */ jsx(Button, {
@@ -1171,11 +1177,11 @@ function useAutomationsModel() {
1171
1177
  }),
1172
1178
  children: [/* @__PURE__ */ jsx(QueueIcon, { "aria-hidden": "true" }), "Automations"]
1173
1179
  });
1174
- $[28] = t11;
1175
- } else t11 = $[28];
1176
- let t12;
1177
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
1178
- t12 = /* @__PURE__ */ jsxs(Tabs.Tab, {
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, {
1179
1185
  unstyled: true,
1180
1186
  value: "schedules",
1181
1187
  render: /* @__PURE__ */ jsx(Button, {
@@ -1186,17 +1192,17 @@ function useAutomationsModel() {
1186
1192
  }),
1187
1193
  children: [/* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": "true" }), "Schedules"]
1188
1194
  });
1189
- $[29] = t12;
1190
- } else t12 = $[29];
1191
- let t13;
1192
- if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
1193
- t13 = /* @__PURE__ */ jsxs(Tabs.List, {
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, {
1194
1200
  unstyled: true,
1195
1201
  className: "computer-automations__tabs",
1196
1202
  "aria-label": "Automations",
1197
1203
  children: [
1198
- t11,
1199
1204
  t12,
1205
+ t13,
1200
1206
  /* @__PURE__ */ jsxs(Tabs.Tab, {
1201
1207
  unstyled: true,
1202
1208
  value: "runs",
@@ -1210,27 +1216,27 @@ function useAutomationsModel() {
1210
1216
  })
1211
1217
  ]
1212
1218
  });
1213
- $[30] = t13;
1214
- } else t13 = $[30];
1215
- const sectionList = t13;
1216
- const t14 = section === "schedules" ? scheduleApp.renderMenus : void 0;
1217
- let t15;
1218
- if ($[31] !== outlet || $[32] !== scheduleApp.renderTitle || $[33] !== schedules.editing) {
1219
- t15 = schedules.editing ? scheduleApp.renderTitle : (t16) => {
1220
- const { phone } = t16;
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;
1221
1227
  return phone ? "Automations" : /* @__PURE__ */ jsx(AutomationsToolbar, {
1222
1228
  outlet,
1223
1229
  sections: setSections
1224
1230
  });
1225
1231
  };
1226
- $[31] = outlet;
1227
- $[32] = scheduleApp.renderTitle;
1228
- $[33] = schedules.editing;
1229
- $[34] = t15;
1230
- } else t15 = $[34];
1231
- let t16;
1232
- if ($[35] !== clock || $[36] !== host || $[37] !== openWorkspaceFile || $[38] !== outlet || $[39] !== recentWorkflowOutputs || $[40] !== runId || $[41] !== scheduleApp || $[42] !== schedules.editing || $[43] !== section || $[44] !== sections || $[45] !== selectedRun || $[46] !== selectedWorkflowPath || $[47] !== setSection || $[48] !== setSelectedRun || $[49] !== setSelectedWorkflowPath || $[50] !== source || $[51] !== workflows) {
1233
- t16 = (context) => {
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) => {
1234
1240
  const paneOutlet = (pane) => !context.phone && section === pane ? outlet : null;
1235
1241
  return schedules.editing ? scheduleApp.render(context) : /* @__PURE__ */ jsxs(Tabs.Root, {
1236
1242
  className: "computer-automations",
@@ -1249,11 +1255,11 @@ function useAutomationsModel() {
1249
1255
  children: /* @__PURE__ */ jsx(ContentAppBarOutletContext, {
1250
1256
  value: paneOutlet("workflows"),
1251
1257
  children: /* @__PURE__ */ jsx(WorkspaceAutomationsPanel, {
1252
- "aria-label": workflows.data?.find((automation_0) => automation_0.path === selectedWorkflowPath)?.name ?? "Automation library",
1258
+ "aria-label": workflows.data?.find((automation_0) => automation_0.path === openPath)?.name ?? "Automation library",
1253
1259
  source,
1254
- selectedPath: selectedWorkflowPath,
1255
- selectedGraph: host.selectedGraph,
1256
- selectedTrace: host.selectedTrace,
1260
+ selectedPath: openPath,
1261
+ selectedGraph: selected?.kind === "script" ? selected.graph : void 0,
1262
+ selectedTrace: selected?.kind === "trace" ? selected.trace : void 0,
1257
1263
  onBack: () => setSelectedWorkflowPath(void 0)
1258
1264
  })
1259
1265
  })
@@ -1298,42 +1304,43 @@ function useAutomationsModel() {
1298
1304
  })]
1299
1305
  });
1300
1306
  };
1301
- $[35] = clock;
1302
- $[36] = host;
1303
- $[37] = openWorkspaceFile;
1304
- $[38] = outlet;
1305
- $[39] = recentWorkflowOutputs;
1306
- $[40] = runId;
1307
- $[41] = scheduleApp;
1308
- $[42] = schedules.editing;
1309
- $[43] = section;
1310
- $[44] = sections;
1311
- $[45] = selectedRun;
1312
- $[46] = selectedWorkflowPath;
1313
- $[47] = setSection;
1314
- $[48] = setSelectedRun;
1315
- $[49] = setSelectedWorkflowPath;
1316
- $[50] = source;
1317
- $[51] = workflows;
1318
- $[52] = t16;
1319
- } else t16 = $[52];
1320
- let t17;
1321
- if ($[53] !== scheduleApp.beforeQuit || $[54] !== scheduleApp.onKeyDown || $[55] !== t14 || $[56] !== t15 || $[57] !== t16) {
1322
- t17 = {
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 = {
1323
1330
  beforeQuit: scheduleApp.beforeQuit,
1324
1331
  onKeyDown: scheduleApp.onKeyDown,
1325
- renderMenus: t14,
1326
- renderTitle: t15,
1327
- render: t16
1332
+ renderMenus: t15,
1333
+ renderTitle: t16,
1334
+ render: t17
1328
1335
  };
1329
- $[53] = scheduleApp.beforeQuit;
1330
- $[54] = scheduleApp.onKeyDown;
1331
- $[55] = t14;
1332
- $[56] = t15;
1333
- $[57] = t16;
1334
- $[58] = t17;
1335
- } else t17 = $[58];
1336
- return t17;
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;
1337
1344
  }
1338
1345
  function _temp7(schedule) {
1339
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: React.ReactNode;
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: EmployeeShellProps["view"];
22
- /** Current output pane, or null when the conversation occupies the screen. */
23
- workbench: React.ReactNode;
24
- live: React.ReactNode;
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.72.2",
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.72.2"
58
+ "@mcp-b/design-tokens": "0.73.0"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@ai-sdk/react": "^4.0.136",