@arbidocs/blocks 0.4.77 → 0.4.79
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/agents/index.cjs +287 -275
- package/dist/agents/index.js +3 -3
- package/dist/agents/tasks/WorkflowThreadStrip.d.ts +9 -4
- package/dist/agents/workflows/StepBarFrame.d.ts +75 -0
- package/dist/agents/workflows/WorkflowRunner.d.ts +5 -1
- package/dist/agents/workflows/WorkflowStepBar.d.ts +9 -11
- package/dist/agents/workflows/index.d.ts +2 -0
- package/dist/agents/workflows/stepWindow.d.ts +59 -0
- package/dist/chat/ChatPage.d.ts +1 -1
- package/dist/chat/chat-page-types.d.ts +5 -0
- package/dist/chat/index.cjs +124 -124
- package/dist/chat/index.js +2 -2
- package/dist/{chunk-JFUN4D7D.cjs → chunk-3YET6D5E.cjs} +150 -146
- package/dist/chunk-3YET6D5E.cjs.map +1 -0
- package/dist/{chunk-B3WCKBJ7.cjs → chunk-5XVWGJ2H.cjs} +3 -3
- package/dist/{chunk-B3WCKBJ7.cjs.map → chunk-5XVWGJ2H.cjs.map} +1 -1
- package/dist/{chunk-34UW6XUQ.js → chunk-6GXF62XN.js} +566 -171
- package/dist/chunk-6GXF62XN.js.map +1 -0
- package/dist/{chunk-HEVVT6IT.js → chunk-BMOL5DN6.js} +126 -122
- package/dist/chunk-BMOL5DN6.js.map +1 -0
- package/dist/chunk-CWAZNXC5.js +441 -0
- package/dist/chunk-CWAZNXC5.js.map +1 -0
- package/dist/{chunk-NIP5BOP7.js → chunk-EWSEQEPL.js} +5 -4
- package/dist/chunk-EWSEQEPL.js.map +1 -0
- package/dist/{chunk-UEU23PTW.js → chunk-ICBAFX5B.js} +3 -3
- package/dist/{chunk-UEU23PTW.js.map → chunk-ICBAFX5B.js.map} +1 -1
- package/dist/{chunk-EKIUMNCN.cjs → chunk-IF6VAYIA.cjs} +5 -5
- package/dist/{chunk-EKIUMNCN.cjs.map → chunk-IF6VAYIA.cjs.map} +1 -1
- package/dist/chunk-MLAHDAN5.cjs +450 -0
- package/dist/chunk-MLAHDAN5.cjs.map +1 -0
- package/dist/{chunk-HOD6OM7L.cjs → chunk-MP6FK43E.cjs} +5 -4
- package/dist/chunk-MP6FK43E.cjs.map +1 -0
- package/dist/{chunk-GJV2G4FC.js → chunk-O35LRB3P.js} +3 -3
- package/dist/{chunk-GJV2G4FC.js.map → chunk-O35LRB3P.js.map} +1 -1
- package/dist/{chunk-GTXOV7IJ.cjs → chunk-XMBYDLZQ.cjs} +4 -4
- package/dist/{chunk-GTXOV7IJ.cjs.map → chunk-XMBYDLZQ.cjs.map} +1 -1
- package/dist/{chunk-OEM5ARVM.js → chunk-XQDM6T6C.js} +3 -3
- package/dist/{chunk-OEM5ARVM.js.map → chunk-XQDM6T6C.js.map} +1 -1
- package/dist/{chunk-3XR3IEGU.cjs → chunk-YGUKTFKW.cjs} +572 -167
- package/dist/chunk-YGUKTFKW.cjs.map +1 -0
- package/dist/connect/index.cjs +233 -77
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +2 -0
- package/dist/connect/index.js +191 -37
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedTagMatrix.d.ts +20 -0
- package/dist/connection/ConnectedWorkflowRunner.d.ts +13 -1
- package/dist/connection/WorkflowRunThread.d.ts +21 -0
- package/dist/databases/ColumnConfigFields.d.ts +68 -0
- package/dist/databases/DatabaseColumnDialog.d.ts +27 -2
- package/dist/databases/DatabaseTable.d.ts +8 -1
- package/dist/databases/PickCellEditor.d.ts +21 -0
- package/dist/databases/column-types.d.ts +73 -9
- package/dist/databases/databaseColumns.d.ts +4 -0
- package/dist/databases/index.cjs +758 -27
- package/dist/databases/index.cjs.map +1 -1
- package/dist/databases/index.d.ts +4 -1
- package/dist/databases/index.js +745 -31
- package/dist/databases/index.js.map +1 -1
- package/dist/databases/linkCells.d.ts +48 -0
- package/dist/files/index.cjs +2 -2
- package/dist/files/index.js +2 -2
- package/dist/index.cjs +624 -579
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +35 -35
- package/dist/settings/index.js +3 -3
- package/dist/studio/index.cjs +3 -3
- package/dist/studio/index.js +2 -2
- package/dist/tags/TagMatrix.d.ts +64 -0
- package/dist/tags/index.d.ts +3 -0
- package/dist/tags/tagMatrixModel.d.ts +39 -0
- package/dist/workflow-canvas/index.cjs +46 -46
- package/dist/workflow-canvas/index.js +3 -3
- package/dist/workspaces/index.cjs +1 -1
- package/dist/workspaces/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-34UW6XUQ.js.map +0 -1
- package/dist/chunk-3XR3IEGU.cjs.map +0 -1
- package/dist/chunk-HEVVT6IT.js.map +0 -1
- package/dist/chunk-HOD6OM7L.cjs.map +0 -1
- package/dist/chunk-JFUN4D7D.cjs.map +0 -1
- package/dist/chunk-NIP5BOP7.js.map +0 -1
|
@@ -1271,6 +1271,431 @@ function useWorkflowView(options) {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
};
|
|
1273
1273
|
}
|
|
1274
|
+
|
|
1275
|
+
// src/agents/workflows/stepWindow.ts
|
|
1276
|
+
var ATTENTION = ["waiting", "failed", "ready"];
|
|
1277
|
+
function activeStepId(levels, phaseOf) {
|
|
1278
|
+
const all = levels.flat();
|
|
1279
|
+
for (const phase of ["running", ...ATTENTION]) {
|
|
1280
|
+
const hit = all.find((s) => phaseOf(s.id) === phase);
|
|
1281
|
+
if (hit) return hit.id;
|
|
1282
|
+
}
|
|
1283
|
+
return all[all.length - 1]?.id;
|
|
1284
|
+
}
|
|
1285
|
+
function primaryOf(steps, phaseOf, current) {
|
|
1286
|
+
return steps.find((s) => phaseOf(s.id) === "running") ?? steps.find((s) => s.id === current) ?? ATTENTION.map((p) => steps.find((s) => phaseOf(s.id) === p)).find(Boolean) ?? steps[0];
|
|
1287
|
+
}
|
|
1288
|
+
function stepWindow({
|
|
1289
|
+
levels: raw,
|
|
1290
|
+
phaseOf,
|
|
1291
|
+
current,
|
|
1292
|
+
start: requested,
|
|
1293
|
+
span = 3
|
|
1294
|
+
}) {
|
|
1295
|
+
const levelsIn = raw.filter((l) => l.length > 0);
|
|
1296
|
+
const known = current && levelsIn.some((l) => l.some((s) => s.id === current));
|
|
1297
|
+
const at = known ? current : activeStepId(levelsIn, phaseOf);
|
|
1298
|
+
const currentLevel = Math.max(
|
|
1299
|
+
0,
|
|
1300
|
+
levelsIn.findIndex((l) => l.some((s) => s.id === at))
|
|
1301
|
+
);
|
|
1302
|
+
const n = levelsIn.length;
|
|
1303
|
+
const size = Math.max(1, Math.min(span, n));
|
|
1304
|
+
const maxStart = Math.max(0, n - size);
|
|
1305
|
+
const auto = currentLevel - (size >= 3 ? 1 : 0);
|
|
1306
|
+
const start = Math.min(maxStart, Math.max(0, requested ?? auto));
|
|
1307
|
+
const end = start + size;
|
|
1308
|
+
const levels = levelsIn.map((steps, index) => {
|
|
1309
|
+
const primary = primaryOf(steps, phaseOf, at);
|
|
1310
|
+
return {
|
|
1311
|
+
index,
|
|
1312
|
+
steps,
|
|
1313
|
+
primary,
|
|
1314
|
+
others: steps.filter((s) => s !== primary),
|
|
1315
|
+
role: index === currentLevel ? "current" : index === currentLevel - 1 ? "previous" : index === currentLevel + 1 ? "next" : "other"
|
|
1316
|
+
};
|
|
1317
|
+
});
|
|
1318
|
+
const visible = levels.slice(start, end);
|
|
1319
|
+
const count = (ls) => ls.reduce((sum, l) => sum + l.steps.length, 0);
|
|
1320
|
+
const shown = new Set(visible.map((l) => l.primary.id));
|
|
1321
|
+
const all = levelsIn.flat();
|
|
1322
|
+
return {
|
|
1323
|
+
levels,
|
|
1324
|
+
visible,
|
|
1325
|
+
start,
|
|
1326
|
+
end,
|
|
1327
|
+
currentLevel,
|
|
1328
|
+
hiddenBefore: count(levels.slice(0, start)),
|
|
1329
|
+
hiddenAfter: count(levels.slice(end)),
|
|
1330
|
+
canBack: start > 0,
|
|
1331
|
+
canForward: end < n,
|
|
1332
|
+
runningHidden: all.filter((s) => phaseOf(s.id) === "running" && !shown.has(s.id)),
|
|
1333
|
+
position: Math.max(1, all.findIndex((s) => s.id === at) + 1),
|
|
1334
|
+
total: all.length
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
function PhaseMark({ phase, icon }) {
|
|
1338
|
+
if (phase === "done") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 shrink-0" });
|
|
1339
|
+
if (phase === "running") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 shrink-0 animate-spin" });
|
|
1340
|
+
if (phase === "waiting") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Hourglass, { className: "size-3.5 shrink-0" });
|
|
1341
|
+
if (phase === "failed") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5 shrink-0" });
|
|
1342
|
+
if (phase === "skipped") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusCircle, { className: "size-3.5 shrink-0" });
|
|
1343
|
+
return icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5", children: icon }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mx-1 size-1.5 shrink-0 rounded-full bg-current opacity-60" });
|
|
1344
|
+
}
|
|
1345
|
+
var DEFAULT_STEP_BAR_LABELS = {
|
|
1346
|
+
nav: "Workflow steps",
|
|
1347
|
+
back: "Earlier steps",
|
|
1348
|
+
forward: "Later steps",
|
|
1349
|
+
hiddenBefore: "{count} earlier steps: show all steps",
|
|
1350
|
+
hiddenAfter: "{count} later steps: show all steps",
|
|
1351
|
+
position: "Step {position} of {total}",
|
|
1352
|
+
parallel: "{count} more in parallel",
|
|
1353
|
+
inParallel: "In parallel",
|
|
1354
|
+
working: "Working: {title}",
|
|
1355
|
+
moreWorking: "+{count} working",
|
|
1356
|
+
waitingFor: "Waiting for {name}",
|
|
1357
|
+
phases: {
|
|
1358
|
+
blocked: "Not started",
|
|
1359
|
+
ready: "To do",
|
|
1360
|
+
running: "Working",
|
|
1361
|
+
waiting: "Waiting",
|
|
1362
|
+
done: "Done",
|
|
1363
|
+
skipped: "Skipped",
|
|
1364
|
+
failed: "Failed"
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
function stepPillTone(phase, current) {
|
|
1368
|
+
if (current) return "border-primary bg-primary/10 text-primary font-semibold shadow-sm";
|
|
1369
|
+
switch (phase) {
|
|
1370
|
+
case "done":
|
|
1371
|
+
return "border-emerald-600/30 text-emerald-700 dark:border-emerald-400/30 dark:text-emerald-400";
|
|
1372
|
+
case "running":
|
|
1373
|
+
return "border-primary/40 bg-primary/5 text-primary";
|
|
1374
|
+
case "waiting":
|
|
1375
|
+
return "border-amber-500/40 text-amber-700 dark:text-amber-300";
|
|
1376
|
+
case "failed":
|
|
1377
|
+
return "border-destructive/40 text-destructive";
|
|
1378
|
+
case "skipped":
|
|
1379
|
+
return "border-border text-muted-foreground line-through decoration-1";
|
|
1380
|
+
case "ready":
|
|
1381
|
+
return "border-border text-foreground";
|
|
1382
|
+
default:
|
|
1383
|
+
return "border-dashed border-border text-muted-foreground";
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
var PHASE_TEXT = {
|
|
1387
|
+
done: "text-emerald-700 dark:text-emerald-400",
|
|
1388
|
+
running: "text-primary",
|
|
1389
|
+
waiting: "text-amber-700 dark:text-amber-300",
|
|
1390
|
+
failed: "text-destructive",
|
|
1391
|
+
skipped: "text-muted-foreground",
|
|
1392
|
+
ready: "text-foreground",
|
|
1393
|
+
blocked: "text-muted-foreground"
|
|
1394
|
+
};
|
|
1395
|
+
var STEP_PILL = "flex min-w-0 items-center gap-1.5 whitespace-nowrap rounded-full border px-2.5 py-1 text-xs font-medium transition-colors";
|
|
1396
|
+
var STEP_LABEL = "min-w-[2.5rem] truncate";
|
|
1397
|
+
var STEP_EXTRA = "min-w-0 shrink-[6] truncate font-normal opacity-80";
|
|
1398
|
+
var fill = (template, values) => Object.entries(values).reduce((s, [k, v]) => s.replace(`{${k}}`, String(v)), template);
|
|
1399
|
+
var NARROW_PX = 560;
|
|
1400
|
+
var FULL_LEVEL_PX = 190;
|
|
1401
|
+
function StepBarFrame({
|
|
1402
|
+
levels,
|
|
1403
|
+
phaseOf,
|
|
1404
|
+
current,
|
|
1405
|
+
onSelect,
|
|
1406
|
+
renderStep,
|
|
1407
|
+
noteOf,
|
|
1408
|
+
renderAfter,
|
|
1409
|
+
leading,
|
|
1410
|
+
trailing,
|
|
1411
|
+
isSelectable = () => true,
|
|
1412
|
+
icon,
|
|
1413
|
+
disabled,
|
|
1414
|
+
labels,
|
|
1415
|
+
tid,
|
|
1416
|
+
className
|
|
1417
|
+
}) {
|
|
1418
|
+
const l = { ...DEFAULT_STEP_BAR_LABELS, ...labels };
|
|
1419
|
+
const box = react.useRef(null);
|
|
1420
|
+
const { width } = chunkB4SRYJLM_cjs.useElementSize(box);
|
|
1421
|
+
const narrow = width > 0 && width < NARROW_PX;
|
|
1422
|
+
const [start, setStart] = react.useState(null);
|
|
1423
|
+
react.useEffect(() => setStart(null), [current]);
|
|
1424
|
+
const span = narrow ? 2 : width >= levels.length * FULL_LEVEL_PX ? levels.length : 3;
|
|
1425
|
+
const win = stepWindow({ levels, phaseOf, current, start, span });
|
|
1426
|
+
const [listOpen, setListOpen] = react.useState(null);
|
|
1427
|
+
const move = (to) => setStart(Math.max(0, Math.min(win.levels.length - 1, to)));
|
|
1428
|
+
const select = (id) => {
|
|
1429
|
+
setListOpen(null);
|
|
1430
|
+
setStart(null);
|
|
1431
|
+
onSelect(id);
|
|
1432
|
+
};
|
|
1433
|
+
const onKeyDown = (e) => {
|
|
1434
|
+
if (!box.current?.contains(e.target)) return;
|
|
1435
|
+
const to = e.key === "ArrowLeft" ? win.start - 1 : e.key === "ArrowRight" ? win.start + 1 : e.key === "Home" ? 0 : e.key === "End" ? win.levels.length : null;
|
|
1436
|
+
if (to === null) return;
|
|
1437
|
+
e.preventDefault();
|
|
1438
|
+
move(to);
|
|
1439
|
+
};
|
|
1440
|
+
const row = (s, isCurrent) => {
|
|
1441
|
+
const phase = phaseOf(s.id);
|
|
1442
|
+
const selectable = isSelectable(s.id);
|
|
1443
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1444
|
+
"button",
|
|
1445
|
+
{
|
|
1446
|
+
type: "button",
|
|
1447
|
+
disabled: !selectable || disabled,
|
|
1448
|
+
onClick: () => select(s.id),
|
|
1449
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
1450
|
+
className: ui.cn(
|
|
1451
|
+
"flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1 text-left text-xs hover:bg-accent disabled:cursor-default disabled:hover:bg-transparent",
|
|
1452
|
+
isCurrent && "bg-primary/10 font-semibold text-primary"
|
|
1453
|
+
),
|
|
1454
|
+
"data-phase": phase,
|
|
1455
|
+
"data-testid": tid(`list-step-${s.id}`),
|
|
1456
|
+
children: [
|
|
1457
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn("flex shrink-0", !isCurrent && PHASE_TEXT[phase]), children: /* @__PURE__ */ jsxRuntime.jsx(PhaseMark, { phase, icon: icon?.(s) }) }),
|
|
1458
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", title: s.title, children: s.title }),
|
|
1459
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-[10px] font-normal text-muted-foreground", children: l.phases[phase] })
|
|
1460
|
+
]
|
|
1461
|
+
},
|
|
1462
|
+
s.id
|
|
1463
|
+
);
|
|
1464
|
+
};
|
|
1465
|
+
const at = win.levels[win.currentLevel];
|
|
1466
|
+
const atId = at && (at.steps.find((s) => s.id === current) ?? at.primary).id;
|
|
1467
|
+
const focusCurrent = (e) => {
|
|
1468
|
+
const el = e.currentTarget?.querySelector(
|
|
1469
|
+
'[aria-current="step"]'
|
|
1470
|
+
);
|
|
1471
|
+
if (!el) return;
|
|
1472
|
+
e.preventDefault();
|
|
1473
|
+
el.focus();
|
|
1474
|
+
el.scrollIntoView?.({ block: "nearest" });
|
|
1475
|
+
};
|
|
1476
|
+
const allSteps = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1477
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-1 text-[11px] font-medium text-muted-foreground", children: fill(l.position, { position: win.position, total: win.total }) }),
|
|
1478
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { children: win.levels.map((level) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1479
|
+
"li",
|
|
1480
|
+
{
|
|
1481
|
+
className: ui.cn(level.steps.length > 1 && "my-0.5 border-l-2 border-primary/30 pl-1"),
|
|
1482
|
+
children: [
|
|
1483
|
+
level.steps.length > 1 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 text-[10px] uppercase tracking-wide text-muted-foreground", children: l.inParallel }),
|
|
1484
|
+
level.steps.map((s) => row(s, s.id === atId))
|
|
1485
|
+
]
|
|
1486
|
+
},
|
|
1487
|
+
level.index
|
|
1488
|
+
)) })
|
|
1489
|
+
] });
|
|
1490
|
+
const overflow = (side, count) => narrow && side === "before" ? null : narrow && side === "after" ? win.hiddenBefore + win.hiddenAfter > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: listOpen === side, onOpenChange: (o) => setListOpen(o ? side : null), children: [
|
|
1491
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1492
|
+
"button",
|
|
1493
|
+
{
|
|
1494
|
+
type: "button",
|
|
1495
|
+
className: "flex shrink-0 items-center rounded-full px-1.5 py-1 text-[11px] tabular-nums text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
1496
|
+
"aria-label": fill(l.position, { position: win.position, total: win.total }),
|
|
1497
|
+
title: fill(l.position, { position: win.position, total: win.total }),
|
|
1498
|
+
"data-testid": tid("steps-count"),
|
|
1499
|
+
children: [
|
|
1500
|
+
win.position,
|
|
1501
|
+
"/",
|
|
1502
|
+
win.total
|
|
1503
|
+
]
|
|
1504
|
+
}
|
|
1505
|
+
) }),
|
|
1506
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1507
|
+
ui.PopoverContent,
|
|
1508
|
+
{
|
|
1509
|
+
align: "end",
|
|
1510
|
+
className: "max-h-[min(24rem,70vh)] w-72 overflow-y-auto p-1",
|
|
1511
|
+
onOpenAutoFocus: focusCurrent,
|
|
1512
|
+
"data-testid": tid("all-steps"),
|
|
1513
|
+
children: allSteps
|
|
1514
|
+
}
|
|
1515
|
+
)
|
|
1516
|
+
] }) : null : count > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: listOpen === side, onOpenChange: (o) => setListOpen(o ? side : null), children: [
|
|
1517
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1518
|
+
"button",
|
|
1519
|
+
{
|
|
1520
|
+
type: "button",
|
|
1521
|
+
className: "flex shrink-0 items-center gap-0.5 rounded-full px-1.5 py-1 text-xs text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
1522
|
+
"aria-label": fill(side === "before" ? l.hiddenBefore : l.hiddenAfter, { count }),
|
|
1523
|
+
title: fill(side === "before" ? l.hiddenBefore : l.hiddenAfter, { count }),
|
|
1524
|
+
"data-testid": tid(`hidden-${side}`),
|
|
1525
|
+
children: [
|
|
1526
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u2026" }),
|
|
1527
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tabular-nums", children: count })
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
) }),
|
|
1531
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1532
|
+
ui.PopoverContent,
|
|
1533
|
+
{
|
|
1534
|
+
align: side === "before" ? "start" : "end",
|
|
1535
|
+
className: "max-h-[min(24rem,70vh)] w-80 overflow-y-auto p-1",
|
|
1536
|
+
onOpenAutoFocus: focusCurrent,
|
|
1537
|
+
"data-testid": tid("all-steps"),
|
|
1538
|
+
children: allSteps
|
|
1539
|
+
}
|
|
1540
|
+
)
|
|
1541
|
+
] }) : null;
|
|
1542
|
+
const arrow = (dir) => {
|
|
1543
|
+
const can = dir === "back" ? win.canBack : win.canForward;
|
|
1544
|
+
const Icon = dir === "back" ? lucideReact.ChevronLeft : lucideReact.ChevronRight;
|
|
1545
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1546
|
+
"button",
|
|
1547
|
+
{
|
|
1548
|
+
type: "button",
|
|
1549
|
+
onClick: () => move(win.start + (dir === "back" ? -1 : 1)),
|
|
1550
|
+
disabled: !can,
|
|
1551
|
+
"aria-label": dir === "back" ? l.back : l.forward,
|
|
1552
|
+
title: dir === "back" ? l.back : l.forward,
|
|
1553
|
+
className: "flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-30",
|
|
1554
|
+
"data-testid": tid(`steps-${dir}`),
|
|
1555
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "size-4" })
|
|
1556
|
+
}
|
|
1557
|
+
);
|
|
1558
|
+
};
|
|
1559
|
+
const running = win.runningHidden;
|
|
1560
|
+
const workingPill = (s) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1561
|
+
"button",
|
|
1562
|
+
{
|
|
1563
|
+
type: "button",
|
|
1564
|
+
onClick: () => select(s.id),
|
|
1565
|
+
className: "flex min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full border border-primary/40 bg-primary/5 px-2 py-1 text-xs text-primary hover:bg-primary/10",
|
|
1566
|
+
title: fill(l.working, { title: s.title }),
|
|
1567
|
+
"data-testid": tid(`working-${s.id}`),
|
|
1568
|
+
children: [
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 shrink-0 animate-spin" }),
|
|
1570
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: fill(l.working, { title: s.title }) })
|
|
1571
|
+
]
|
|
1572
|
+
},
|
|
1573
|
+
s.id
|
|
1574
|
+
);
|
|
1575
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1576
|
+
"nav",
|
|
1577
|
+
{
|
|
1578
|
+
ref: box,
|
|
1579
|
+
"aria-label": l.nav,
|
|
1580
|
+
onKeyDown,
|
|
1581
|
+
className: ui.cn("flex min-w-0 items-center gap-1", narrow && "flex-wrap", className),
|
|
1582
|
+
"data-testid": tid("steps"),
|
|
1583
|
+
"data-narrow": narrow || void 0,
|
|
1584
|
+
children: [
|
|
1585
|
+
arrow("back"),
|
|
1586
|
+
win.start === 0 && leading,
|
|
1587
|
+
overflow("before", win.hiddenBefore),
|
|
1588
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex min-w-0 flex-1 items-center gap-1", children: win.visible.map((level, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1589
|
+
"li",
|
|
1590
|
+
{
|
|
1591
|
+
className: ui.cn(
|
|
1592
|
+
"flex min-w-[5.5rem] items-center gap-1",
|
|
1593
|
+
i === win.visible.length - 1 ? "flex-[0_1_auto]" : "flex-[1_1_auto]"
|
|
1594
|
+
),
|
|
1595
|
+
"data-role": level.role,
|
|
1596
|
+
children: [
|
|
1597
|
+
renderStep(level.primary, level, win, narrow),
|
|
1598
|
+
level.others.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1599
|
+
GroupChip,
|
|
1600
|
+
{
|
|
1601
|
+
level,
|
|
1602
|
+
label: fill(l.parallel, { count: level.others.length }),
|
|
1603
|
+
heading: l.inParallel,
|
|
1604
|
+
row: (s) => row(s, s.id === atId),
|
|
1605
|
+
tid
|
|
1606
|
+
}
|
|
1607
|
+
),
|
|
1608
|
+
renderAfter?.(level),
|
|
1609
|
+
i < win.visible.length - 1 && !narrow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1610
|
+
"span",
|
|
1611
|
+
{
|
|
1612
|
+
"aria-hidden": true,
|
|
1613
|
+
className: ui.cn(
|
|
1614
|
+
"h-px min-w-3 flex-1",
|
|
1615
|
+
level.steps.every((s) => ["done", "skipped"].includes(phaseOf(s.id))) ? "bg-emerald-600/40" : "bg-border"
|
|
1616
|
+
)
|
|
1617
|
+
}
|
|
1618
|
+
)
|
|
1619
|
+
]
|
|
1620
|
+
},
|
|
1621
|
+
level.steps.map((s) => s.id).join("+")
|
|
1622
|
+
)) }),
|
|
1623
|
+
overflow("after", win.hiddenAfter),
|
|
1624
|
+
!win.canForward && trailing,
|
|
1625
|
+
arrow("forward"),
|
|
1626
|
+
narrow && atId && noteOf?.(atId) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1627
|
+
"p",
|
|
1628
|
+
{
|
|
1629
|
+
className: "min-w-0 basis-full truncate px-1 text-[11px] text-muted-foreground",
|
|
1630
|
+
"data-testid": tid("note"),
|
|
1631
|
+
children: noteOf(atId)
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
running.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1635
|
+
"div",
|
|
1636
|
+
{
|
|
1637
|
+
className: ui.cn("flex min-w-0 shrink items-center gap-1", narrow && "basis-full"),
|
|
1638
|
+
"data-testid": tid("working"),
|
|
1639
|
+
children: [
|
|
1640
|
+
(running.length > 2 ? running.slice(0, 1) : running).map(workingPill),
|
|
1641
|
+
running.length > 2 && /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
1642
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1643
|
+
"button",
|
|
1644
|
+
{
|
|
1645
|
+
type: "button",
|
|
1646
|
+
className: "flex shrink-0 items-center gap-1 rounded-full border border-primary/40 bg-primary/5 px-2 py-1 text-xs text-primary hover:bg-primary/10",
|
|
1647
|
+
"data-testid": tid("working-more"),
|
|
1648
|
+
children: [
|
|
1649
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 animate-spin" }),
|
|
1650
|
+
fill(l.moreWorking, { count: running.length - 1 })
|
|
1651
|
+
]
|
|
1652
|
+
}
|
|
1653
|
+
) }),
|
|
1654
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { align: "end", className: "w-72 p-1", children: running.slice(1).map((s) => row(s, false)) })
|
|
1655
|
+
] })
|
|
1656
|
+
]
|
|
1657
|
+
}
|
|
1658
|
+
)
|
|
1659
|
+
]
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
}
|
|
1663
|
+
function GroupChip({
|
|
1664
|
+
level,
|
|
1665
|
+
label,
|
|
1666
|
+
heading,
|
|
1667
|
+
row,
|
|
1668
|
+
tid
|
|
1669
|
+
}) {
|
|
1670
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
1671
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1672
|
+
"button",
|
|
1673
|
+
{
|
|
1674
|
+
type: "button",
|
|
1675
|
+
className: "shrink-0 rounded-full border border-border bg-muted px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-muted-foreground hover:border-primary/40 hover:text-primary",
|
|
1676
|
+
"aria-label": label,
|
|
1677
|
+
title: label,
|
|
1678
|
+
"data-testid": tid(`group-${level.steps[0].id}`),
|
|
1679
|
+
children: [
|
|
1680
|
+
"+",
|
|
1681
|
+
level.others.length
|
|
1682
|
+
]
|
|
1683
|
+
}
|
|
1684
|
+
) }),
|
|
1685
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1686
|
+
ui.PopoverContent,
|
|
1687
|
+
{
|
|
1688
|
+
align: "start",
|
|
1689
|
+
className: "w-72 p-1",
|
|
1690
|
+
"data-testid": tid(`group-${level.steps[0].id}-list`),
|
|
1691
|
+
children: [
|
|
1692
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "px-2 py-1 text-[11px] font-medium text-muted-foreground", children: heading }),
|
|
1693
|
+
level.steps.map(row)
|
|
1694
|
+
]
|
|
1695
|
+
}
|
|
1696
|
+
)
|
|
1697
|
+
] });
|
|
1698
|
+
}
|
|
1274
1699
|
var DEFAULT_WORKFLOW_STEP_PARTS_LABELS = {
|
|
1275
1700
|
waitingFor: "Waiting for {name}",
|
|
1276
1701
|
sendBack: "Send back",
|
|
@@ -1750,152 +2175,102 @@ function ActionStepBody({
|
|
|
1750
2175
|
phase === "failed" && !state?.declinedBy && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", "data-testid": `${testId}-failed`, children: state?.error || "" })
|
|
1751
2176
|
] });
|
|
1752
2177
|
}
|
|
1753
|
-
|
|
1754
|
-
if (phase === "done") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 shrink-0" });
|
|
1755
|
-
if (phase === "running") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3.5 shrink-0 animate-spin" });
|
|
1756
|
-
if (phase === "waiting") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Hourglass, { className: "size-3.5 shrink-0" });
|
|
1757
|
-
if (phase === "failed") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "size-3.5 shrink-0" });
|
|
1758
|
-
if (phase === "skipped") return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MinusCircle, { className: "size-3.5 shrink-0" });
|
|
1759
|
-
return icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5", children: icon }) : null;
|
|
1760
|
-
}
|
|
1761
|
-
var PILL = "flex min-w-0 max-w-full shrink-0 items-center gap-2 whitespace-nowrap rounded-full border px-2.5 py-1.5 text-xs font-medium";
|
|
1762
|
-
var LABEL = "min-w-0 max-w-[12rem] truncate";
|
|
2178
|
+
var DONE = "__done";
|
|
1763
2179
|
function WorkflowStepBar({
|
|
1764
2180
|
run,
|
|
1765
2181
|
levels,
|
|
1766
2182
|
doneTitle,
|
|
1767
2183
|
doneIcon,
|
|
1768
2184
|
icon,
|
|
1769
|
-
tid
|
|
2185
|
+
tid,
|
|
2186
|
+
labels
|
|
1770
2187
|
}) {
|
|
1771
|
-
const
|
|
1772
|
-
const
|
|
1773
|
-
const
|
|
1774
|
-
const
|
|
1775
|
-
const
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
const el = row.current?.querySelector('[aria-current="step"]');
|
|
1784
|
-
el?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
|
1785
|
-
}, [compact3, run.current]);
|
|
1786
|
-
const pill = (s) => {
|
|
1787
|
-
const phase = run.phaseOf(s.id);
|
|
1788
|
-
const current = s.id === run.current;
|
|
2188
|
+
const l = { ...DEFAULT_STEP_BAR_LABELS, ...labels };
|
|
2189
|
+
const done = { id: DONE, title: doneTitle };
|
|
2190
|
+
const phaseOf = (id) => id === DONE ? run.isComplete ? "done" : "blocked" : run.phaseOf(id);
|
|
2191
|
+
const current = run.isComplete ? DONE : run.current;
|
|
2192
|
+
const waitingOf = (id) => {
|
|
2193
|
+
if (id === DONE || !["ready", "waiting"].includes(phaseOf(id))) return void 0;
|
|
2194
|
+
const assignee = run.assigneeOf(id);
|
|
2195
|
+
return assignee ? l.waitingFor.replace("{name}", assignee) : void 0;
|
|
2196
|
+
};
|
|
2197
|
+
const pill = (s, narrow = false) => {
|
|
2198
|
+
const phase = phaseOf(s.id);
|
|
2199
|
+
const isCurrent = s.id === current;
|
|
1789
2200
|
const assignee = ["ready", "waiting"].includes(phase) ? run.assigneeOf(s.id) : void 0;
|
|
1790
|
-
const
|
|
2201
|
+
const waiting = assignee ? l.waitingFor.replace("{name}", assignee) : void 0;
|
|
2202
|
+
const title = waiting ? `${s.title} \xB7 ${waiting}` : s.title;
|
|
2203
|
+
const name = `${title} (${l.phases[phase]})`;
|
|
2204
|
+
if (s.id === DONE)
|
|
2205
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2206
|
+
"span",
|
|
2207
|
+
{
|
|
2208
|
+
className: ui.cn(STEP_PILL, stepPillTone(phase, isCurrent)),
|
|
2209
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
2210
|
+
"aria-label": name,
|
|
2211
|
+
title: doneTitle,
|
|
2212
|
+
"data-phase": phase,
|
|
2213
|
+
"data-testid": tid("step-done"),
|
|
2214
|
+
children: [
|
|
2215
|
+
/* @__PURE__ */ jsxRuntime.jsx(PhaseMark, { phase: run.isComplete ? "done" : "ready", icon: doneIcon }),
|
|
2216
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn(STEP_LABEL, "max-w-[12rem]"), children: doneTitle })
|
|
2217
|
+
]
|
|
2218
|
+
}
|
|
2219
|
+
);
|
|
1791
2220
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1792
2221
|
"button",
|
|
1793
2222
|
{
|
|
1794
2223
|
type: "button",
|
|
1795
2224
|
onClick: () => run.goTo(s.id),
|
|
1796
2225
|
disabled: run.busy,
|
|
1797
|
-
className: ui.cn(
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
current ? "border-primary bg-primary/10 text-primary" : phase === "failed" ? "border-destructive/40 text-destructive" : phase === "done" || phase === "skipped" || phase === "running" || phase === "waiting" ? "border-primary/30 bg-primary/5 text-primary" : "border-border text-muted-foreground"
|
|
1801
|
-
),
|
|
1802
|
-
"aria-current": current ? "step" : void 0,
|
|
1803
|
-
"aria-label": title,
|
|
2226
|
+
className: ui.cn(STEP_PILL, stepPillTone(phase, isCurrent), "disabled:cursor-default"),
|
|
2227
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
2228
|
+
"aria-label": name,
|
|
1804
2229
|
title,
|
|
1805
2230
|
"data-phase": phase,
|
|
1806
2231
|
"data-testid": tid(`step-${s.id}`),
|
|
1807
2232
|
children: [
|
|
1808
2233
|
/* @__PURE__ */ jsxRuntime.jsx(PhaseMark, { phase, icon: icon(s.icon) }),
|
|
1809
|
-
|
|
1810
|
-
assignee && !compact3 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2234
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1811
2235
|
"span",
|
|
1812
2236
|
{
|
|
1813
|
-
className: "
|
|
2237
|
+
className: ui.cn(STEP_LABEL, isCurrent ? "max-w-[18rem]" : "max-w-[12rem]"),
|
|
2238
|
+
"data-testid": tid(`step-${s.id}-label`),
|
|
2239
|
+
children: s.title
|
|
2240
|
+
}
|
|
2241
|
+
),
|
|
2242
|
+
assignee && isCurrent && !narrow && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2243
|
+
"span",
|
|
2244
|
+
{
|
|
2245
|
+
className: ui.cn(STEP_EXTRA, "max-w-[12rem]"),
|
|
1814
2246
|
"data-testid": tid(`step-${s.id}-assignee`),
|
|
1815
2247
|
children: [
|
|
1816
2248
|
"\xB7 ",
|
|
1817
|
-
|
|
2249
|
+
waiting
|
|
1818
2250
|
]
|
|
1819
2251
|
}
|
|
1820
2252
|
)
|
|
1821
2253
|
]
|
|
1822
|
-
}
|
|
1823
|
-
s.id
|
|
2254
|
+
}
|
|
1824
2255
|
);
|
|
1825
2256
|
};
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
)
|
|
1844
|
-
] }, s.id)) }),
|
|
1845
|
-
i < levels.length && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-2" })
|
|
1846
|
-
] }, i))
|
|
1847
|
-
}
|
|
1848
|
-
),
|
|
1849
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1850
|
-
"ol",
|
|
1851
|
-
{
|
|
1852
|
-
ref: row,
|
|
1853
|
-
className: ui.cn("flex w-full items-center gap-1.5", compact3 && "overflow-x-auto pb-1"),
|
|
1854
|
-
"data-compact": compact3 || void 0,
|
|
1855
|
-
"data-testid": tid("steps"),
|
|
1856
|
-
children: [...levels, null].map((level, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1857
|
-
"li",
|
|
1858
|
-
{
|
|
1859
|
-
className: ui.cn(
|
|
1860
|
-
"flex min-w-0 items-center gap-1.5",
|
|
1861
|
-
i < levels.length && !compact3 && "flex-1",
|
|
1862
|
-
compact3 && "flex-none"
|
|
1863
|
-
),
|
|
1864
|
-
children: [
|
|
1865
|
-
level ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 flex-col items-start gap-1", children: level.map(pill) }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1866
|
-
"div",
|
|
1867
|
-
{
|
|
1868
|
-
className: ui.cn(
|
|
1869
|
-
PILL,
|
|
1870
|
-
done ? "border-primary bg-primary/10 text-primary" : "border-border text-muted-foreground"
|
|
1871
|
-
),
|
|
1872
|
-
"aria-current": done ? "step" : void 0,
|
|
1873
|
-
"aria-label": doneTitle,
|
|
1874
|
-
title: doneTitle,
|
|
1875
|
-
"data-testid": tid("step-done"),
|
|
1876
|
-
children: [
|
|
1877
|
-
/* @__PURE__ */ jsxRuntime.jsx(PhaseMark, { phase: "ready", icon: doneIcon }),
|
|
1878
|
-
(done || !compact3) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: LABEL, children: doneTitle })
|
|
1879
|
-
]
|
|
1880
|
-
}
|
|
1881
|
-
),
|
|
1882
|
-
i < levels.length && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1883
|
-
"div",
|
|
1884
|
-
{
|
|
1885
|
-
className: ui.cn(
|
|
1886
|
-
"h-px",
|
|
1887
|
-
compact3 ? "w-3 flex-none" : "min-w-2 flex-1",
|
|
1888
|
-
level?.every((s) => ["done", "skipped"].includes(run.phaseOf(s.id))) ? "bg-primary/40" : "bg-border"
|
|
1889
|
-
)
|
|
1890
|
-
}
|
|
1891
|
-
)
|
|
1892
|
-
]
|
|
1893
|
-
},
|
|
1894
|
-
level ? level.map((s) => s.id).join("+") : "done"
|
|
1895
|
-
))
|
|
1896
|
-
}
|
|
1897
|
-
)
|
|
1898
|
-
] });
|
|
2257
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2258
|
+
StepBarFrame,
|
|
2259
|
+
{
|
|
2260
|
+
levels: [...levels, [done]],
|
|
2261
|
+
phaseOf,
|
|
2262
|
+
current,
|
|
2263
|
+
onSelect: (id) => id !== DONE && run.goTo(id),
|
|
2264
|
+
isSelectable: (id) => id !== DONE,
|
|
2265
|
+
renderStep: (s, _level, _win, narrow) => pill(s, narrow),
|
|
2266
|
+
noteOf: waitingOf,
|
|
2267
|
+
icon: (s) => s.id === DONE ? doneIcon : icon(s.icon),
|
|
2268
|
+
disabled: run.busy,
|
|
2269
|
+
labels,
|
|
2270
|
+
tid,
|
|
2271
|
+
className: "w-full"
|
|
2272
|
+
}
|
|
2273
|
+
);
|
|
1899
2274
|
}
|
|
1900
2275
|
var DEFAULT_WORKFLOW_RUNNER_LABELS = {
|
|
1901
2276
|
back: "Back",
|
|
@@ -1942,6 +2317,8 @@ function WorkflowRunner({
|
|
|
1942
2317
|
people,
|
|
1943
2318
|
actions,
|
|
1944
2319
|
nameOfDoc,
|
|
2320
|
+
hideStepBar,
|
|
2321
|
+
compact: compact3,
|
|
1945
2322
|
labels,
|
|
1946
2323
|
partsLabels,
|
|
1947
2324
|
testIdPrefix = "workflow-run",
|
|
@@ -1949,6 +2326,7 @@ function WorkflowRunner({
|
|
|
1949
2326
|
}) {
|
|
1950
2327
|
const l = { ...DEFAULT_WORKFLOW_RUNNER_LABELS, ...labels };
|
|
1951
2328
|
const pl = { ...DEFAULT_WORKFLOW_STEP_PARTS_LABELS, ...partsLabels };
|
|
2329
|
+
const box = compact3 ? "p-4" : "max-w-2xl p-6";
|
|
1952
2330
|
const { steps, step, isComplete, action } = run;
|
|
1953
2331
|
const completion = workflow.run.kind === "steps" ? workflow.run.completion : void 0;
|
|
1954
2332
|
const tid = (suffix) => `${testIdPrefix}-${suffix}`;
|
|
@@ -1958,8 +2336,8 @@ function WorkflowRunner({
|
|
|
1958
2336
|
const unread = added.filter((f) => f.status === "processing").length;
|
|
1959
2337
|
const reading = action === "complete" && unread > 0;
|
|
1960
2338
|
const nextLabel = reading ? l.readingFiles.replace("{current}", String(Math.min(added.length - unread + 1, added.length))).replace("{count}", String(added.length)) : action === "skip" ? l.skip : action === "finish" ? l.finish : action === "complete" && step?.kind === "review" ? l.approve : action === "complete" && step?.kind === "action" ? l.markSent : action === "wait" && (run.isRunning || run.busy) ? l.working : (step && !run.isLocked(step.id) ? step.nextLabel : void 0) ?? l.next;
|
|
1961
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("space-y-6", className), "data-testid": testIdPrefix, children: [
|
|
1962
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2339
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn(compact3 ? "space-y-3" : "space-y-6", className), "data-testid": testIdPrefix, children: [
|
|
2340
|
+
!hideStepBar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1963
2341
|
WorkflowStepBar,
|
|
1964
2342
|
{
|
|
1965
2343
|
run,
|
|
@@ -1984,10 +2362,10 @@ function WorkflowRunner({
|
|
|
1984
2362
|
children: l.restart
|
|
1985
2363
|
}
|
|
1986
2364
|
)
|
|
1987
|
-
] }) : step ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { className: "
|
|
2365
|
+
] }) : step ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsxRuntime.jsx(ui.Card, { className: ui.cn(box, "p-6"), "data-testid": tid(step.id), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-blocked`), children: l.blocked.replace(
|
|
1988
2366
|
"{steps}",
|
|
1989
2367
|
stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
|
|
1990
|
-
) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: "
|
|
2368
|
+
) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
1991
2369
|
/* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
|
|
1992
2370
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
1993
2371
|
/* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
|
|
@@ -2008,7 +2386,7 @@ function WorkflowRunner({
|
|
|
2008
2386
|
) }),
|
|
2009
2387
|
run.actionError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", "data-testid": tid("action-error"), children: run.actionError }),
|
|
2010
2388
|
renderStepNote?.(step, run)
|
|
2011
|
-
] }) : step.kind === "upload" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: "
|
|
2389
|
+
] }) : step.kind === "upload" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
2012
2390
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
2013
2391
|
/* @__PURE__ */ jsxRuntime.jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
|
|
2014
2392
|
renderUpload?.(step) ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -2037,7 +2415,7 @@ function WorkflowRunner({
|
|
|
2037
2415
|
] }),
|
|
2038
2416
|
run.actionError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
|
|
2039
2417
|
renderStepNote?.(step, run)
|
|
2040
|
-
] }) : step.kind === "review" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: "
|
|
2418
|
+
] }) : step.kind === "review" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
2041
2419
|
/* @__PURE__ */ jsxRuntime.jsx(StepHeading, { step, icon: icon(step.icon) }),
|
|
2042
2420
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
2043
2421
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: reviewInstructions(step, run.inputs) }),
|
|
@@ -2072,7 +2450,7 @@ function WorkflowRunner({
|
|
|
2072
2450
|
/* @__PURE__ */ jsxRuntime.jsx(SendBackControl, { run, step, l: pl, testId: tid(step.id) }),
|
|
2073
2451
|
run.actionError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
|
|
2074
2452
|
renderStepNote?.(step, run)
|
|
2075
|
-
] }) : step.kind === "action" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: "
|
|
2453
|
+
] }) : step.kind === "action" ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
|
|
2076
2454
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2077
2455
|
ActionStepBody,
|
|
2078
2456
|
{
|
|
@@ -2095,6 +2473,7 @@ function WorkflowRunner({
|
|
|
2095
2473
|
renderAgentOutput,
|
|
2096
2474
|
icon: icon(step.icon),
|
|
2097
2475
|
renderStepNote,
|
|
2476
|
+
compact: compact3,
|
|
2098
2477
|
extra: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2099
2478
|
/* @__PURE__ */ jsxRuntime.jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
|
|
2100
2479
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2112,47 +2491,62 @@ function WorkflowRunner({
|
|
|
2112
2491
|
tid
|
|
2113
2492
|
}
|
|
2114
2493
|
) }, step.id) : null,
|
|
2115
|
-
!isComplete && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
disabled: !run.canBack,
|
|
2122
|
-
"data-testid": tid("back"),
|
|
2123
|
-
children: [
|
|
2124
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "size-4" }),
|
|
2125
|
-
" ",
|
|
2126
|
-
l.back
|
|
2127
|
-
]
|
|
2128
|
-
}
|
|
2129
|
-
),
|
|
2130
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2131
|
-
step && action !== "skip" && // A step that commits (creates the matter, starts the thread) is what the run stands on.
|
|
2132
|
-
!step.commit && ["ready", "blocked", "failed"].includes(run.phaseOf(step.id)) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2133
|
-
ui.Button,
|
|
2134
|
-
{
|
|
2135
|
-
variant: "ghost",
|
|
2136
|
-
onClick: () => void run.skip(step.id),
|
|
2137
|
-
disabled: run.busy,
|
|
2138
|
-
"data-testid": tid("skip-step"),
|
|
2139
|
-
children: l.skipStep
|
|
2140
|
-
}
|
|
2494
|
+
!isComplete && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2495
|
+
"div",
|
|
2496
|
+
{
|
|
2497
|
+
className: ui.cn(
|
|
2498
|
+
"flex items-center justify-between border-t border-border pt-4",
|
|
2499
|
+
compact3 && "flex-wrap gap-2 pt-3"
|
|
2141
2500
|
),
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2501
|
+
children: [
|
|
2502
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2503
|
+
ui.Button,
|
|
2504
|
+
{
|
|
2505
|
+
variant: "ghost",
|
|
2506
|
+
onClick: run.back,
|
|
2507
|
+
disabled: !run.canBack,
|
|
2508
|
+
"data-testid": tid("back"),
|
|
2509
|
+
children: [
|
|
2510
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: "size-4" }),
|
|
2511
|
+
" ",
|
|
2512
|
+
l.back
|
|
2513
|
+
]
|
|
2514
|
+
}
|
|
2515
|
+
),
|
|
2516
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2517
|
+
"div",
|
|
2518
|
+
{
|
|
2519
|
+
className: ui.cn("flex items-center gap-2", compact3 && "ml-auto flex-wrap justify-end"),
|
|
2520
|
+
children: [
|
|
2521
|
+
step && action !== "skip" && // A step that commits (creates the matter, starts the thread) is what the run stands on.
|
|
2522
|
+
!step.commit && ["ready", "blocked", "failed"].includes(run.phaseOf(step.id)) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2523
|
+
ui.Button,
|
|
2524
|
+
{
|
|
2525
|
+
variant: "ghost",
|
|
2526
|
+
onClick: () => void run.skip(step.id),
|
|
2527
|
+
disabled: run.busy,
|
|
2528
|
+
"data-testid": tid("skip-step"),
|
|
2529
|
+
children: l.skipStep
|
|
2530
|
+
}
|
|
2531
|
+
),
|
|
2532
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2533
|
+
ui.Button,
|
|
2534
|
+
{
|
|
2535
|
+
onClick: () => void run.next(),
|
|
2536
|
+
disabled: action === "wait" || reading,
|
|
2537
|
+
"data-testid": tid("next"),
|
|
2538
|
+
children: [
|
|
2539
|
+
nextLabel,
|
|
2540
|
+
reading || action === "wait" && (run.isRunning || run.busy) ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { className: "size-4" })
|
|
2541
|
+
]
|
|
2542
|
+
}
|
|
2543
|
+
)
|
|
2544
|
+
]
|
|
2545
|
+
}
|
|
2546
|
+
)
|
|
2547
|
+
]
|
|
2548
|
+
}
|
|
2549
|
+
)
|
|
2156
2550
|
] });
|
|
2157
2551
|
}
|
|
2158
2552
|
function UploadFiles({
|
|
@@ -2239,6 +2633,7 @@ function AgentStepBody({
|
|
|
2239
2633
|
icon,
|
|
2240
2634
|
renderStepNote,
|
|
2241
2635
|
extra,
|
|
2636
|
+
compact: compact3,
|
|
2242
2637
|
l,
|
|
2243
2638
|
tid
|
|
2244
2639
|
}) {
|
|
@@ -2284,7 +2679,7 @@ function AgentStepBody({
|
|
|
2284
2679
|
phase === "skipped" && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.skipped }),
|
|
2285
2680
|
extra
|
|
2286
2681
|
] });
|
|
2287
|
-
if (step.output === "artifact") {
|
|
2682
|
+
if (step.output === "artifact" && !compact3) {
|
|
2288
2683
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2289
2684
|
"div",
|
|
2290
2685
|
{
|
|
@@ -2301,7 +2696,7 @@ function AgentStepBody({
|
|
|
2301
2696
|
}
|
|
2302
2697
|
);
|
|
2303
2698
|
}
|
|
2304
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: "space-y-3 p-6", "data-testid": tid(step.id), children: [
|
|
2699
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Card, { className: ui.cn("space-y-3", compact3 ? "p-4" : "p-6"), "data-testid": tid(step.id), children: [
|
|
2305
2700
|
header,
|
|
2306
2701
|
status,
|
|
2307
2702
|
renderAgentOutput(step, state),
|
|
@@ -2314,14 +2709,22 @@ exports.ApprovalEvidence = ApprovalEvidence;
|
|
|
2314
2709
|
exports.AssigneeLine = AssigneeLine;
|
|
2315
2710
|
exports.DEFAULT_ASSIGNEE_WORDING = DEFAULT_ASSIGNEE_WORDING;
|
|
2316
2711
|
exports.DEFAULT_SCHEMA_FORM_LABELS = DEFAULT_SCHEMA_FORM_LABELS;
|
|
2712
|
+
exports.DEFAULT_STEP_BAR_LABELS = DEFAULT_STEP_BAR_LABELS;
|
|
2317
2713
|
exports.DEFAULT_WORKFLOW_RUNNER_LABELS = DEFAULT_WORKFLOW_RUNNER_LABELS;
|
|
2318
2714
|
exports.DEFAULT_WORKFLOW_STEP_PARTS_LABELS = DEFAULT_WORKFLOW_STEP_PARTS_LABELS;
|
|
2319
2715
|
exports.EMPTY_WORKFLOW_SCOPE = EMPTY_WORKFLOW_SCOPE;
|
|
2716
|
+
exports.PhaseMark = PhaseMark;
|
|
2320
2717
|
exports.SKILL_PROMPT_FALLBACK_PLACEHOLDER = SKILL_PROMPT_FALLBACK_PLACEHOLDER;
|
|
2321
2718
|
exports.SKILL_PROMPT_LABEL = SKILL_PROMPT_LABEL;
|
|
2719
|
+
exports.STEP_EXTRA = STEP_EXTRA;
|
|
2720
|
+
exports.STEP_LABEL = STEP_LABEL;
|
|
2721
|
+
exports.STEP_PILL = STEP_PILL;
|
|
2322
2722
|
exports.SchemaForm = SchemaForm;
|
|
2323
2723
|
exports.SendBackControl = SendBackControl;
|
|
2724
|
+
exports.StepBarFrame = StepBarFrame;
|
|
2324
2725
|
exports.WorkflowRunner = WorkflowRunner;
|
|
2726
|
+
exports.WorkflowStepBar = WorkflowStepBar;
|
|
2727
|
+
exports.activeStepId = activeStepId;
|
|
2325
2728
|
exports.assigneeName = assigneeName;
|
|
2326
2729
|
exports.buildLaunch = buildLaunch;
|
|
2327
2730
|
exports.canAssign = canAssign;
|
|
@@ -2360,7 +2763,9 @@ exports.stepDependencies = stepDependencies;
|
|
|
2360
2763
|
exports.stepFields = stepFields;
|
|
2361
2764
|
exports.stepLevels = stepLevels;
|
|
2362
2765
|
exports.stepPhase = stepPhase;
|
|
2766
|
+
exports.stepPillTone = stepPillTone;
|
|
2363
2767
|
exports.stepStatesFromActivity = stepStatesFromActivity;
|
|
2768
|
+
exports.stepWindow = stepWindow;
|
|
2364
2769
|
exports.toPlanAssignee = toPlanAssignee;
|
|
2365
2770
|
exports.toPlanDocumentRef = toPlanDocumentRef;
|
|
2366
2771
|
exports.toPlanSteps = toPlanSteps;
|
|
@@ -2374,5 +2779,5 @@ exports.workflowFromFrontmatter = workflowFromFrontmatter;
|
|
|
2374
2779
|
exports.workflowSteps = workflowSteps;
|
|
2375
2780
|
exports.workflowsAccepting = workflowsAccepting;
|
|
2376
2781
|
exports.workflowsForHost = workflowsForHost;
|
|
2377
|
-
//# sourceMappingURL=chunk-
|
|
2378
|
-
//# sourceMappingURL=chunk-
|
|
2782
|
+
//# sourceMappingURL=chunk-YGUKTFKW.cjs.map
|
|
2783
|
+
//# sourceMappingURL=chunk-YGUKTFKW.cjs.map
|