executant 1.12.0 → 1.14.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 (2) hide show
  1. package/dist/index.js +62 -29
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1162,6 +1162,12 @@ var STATUS_COLOR = {
1162
1162
  function statusIcon(status, tick) {
1163
1163
  return status === "running" ? SPINNER[tick % SPINNER.length] : STATUS_ICON[status] ?? "\xB7";
1164
1164
  }
1165
+ function countIterationRows(iterationHistory, maxVisible) {
1166
+ if (!iterationHistory?.length) return 0;
1167
+ if (iterationHistory.every((r) => r.item === String(r.iteration))) return 0;
1168
+ const visible = Math.min(iterationHistory.length, maxVisible);
1169
+ return visible + (iterationHistory.length > maxVisible ? 1 : 0);
1170
+ }
1165
1171
  var EXIT_DELAY_MS = 300;
1166
1172
  function formatHeaderElapsed(start, end) {
1167
1173
  const ms = (end ?? Date.now()) - start;
@@ -1221,6 +1227,8 @@ function IterationRow({ record, tick }) {
1221
1227
  /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: " " }),
1222
1228
  /* @__PURE__ */ jsx2(Text2, { color, children: icon }),
1223
1229
  /* @__PURE__ */ jsx2(Text2, { children: " " }),
1230
+ /* @__PURE__ */ jsx2(Text2, { dimColor: true, children: `[${record.iteration}/${record.total}]` }),
1231
+ /* @__PURE__ */ jsx2(Text2, { children: " " }),
1224
1232
  /* @__PURE__ */ jsxs2(
1225
1233
  Text2,
1226
1234
  {
@@ -1403,20 +1411,34 @@ function App({ workflow: workflow2, events: events2, options: options2, updateCh
1403
1411
  }, [events2, exit]);
1404
1412
  const { isRawModeSupported } = useStdin();
1405
1413
  const { stdout } = useStdout();
1406
- const terminalRows = stdout?.rows ?? 24;
1407
- const FIXED_OVERHEAD = 12;
1408
- const logPaneMaxLines = Math.max(
1409
- 5,
1410
- terminalRows - FIXED_OVERHEAD - state.tasks.length
1411
- );
1412
- const [tick, setTick] = useState(0);
1413
- useInterval(() => {
1414
- if (!state.endTime) setTick((t) => t + 1);
1415
- }, 100);
1416
1414
  const [updateVersion, setUpdateVersion] = useState(null);
1417
1415
  useEffect2(() => {
1418
1416
  updateCheck2.then(setUpdateVersion);
1419
1417
  }, [updateCheck2]);
1418
+ const [tick, setTick] = useState(0);
1419
+ useInterval(() => {
1420
+ if (!state.endTime) setTick((t) => t + 1);
1421
+ }, 100);
1422
+ const terminalRows = stdout?.rows ?? 24;
1423
+ const LOG_PANE_MIN = 5;
1424
+ const runningTask = state.tasks.find((t) => t.status === "running");
1425
+ const iterationRowCount = countIterationRows(
1426
+ runningTask?.iterationHistory,
1427
+ MAX_VISIBLE_ITERATIONS
1428
+ );
1429
+ const FIXED_OVERHEAD = 12 + (updateVersion ? 1 : 0);
1430
+ const availableForTaskSection = Math.max(
1431
+ 1,
1432
+ terminalRows - FIXED_OVERHEAD - LOG_PANE_MIN - iterationRowCount
1433
+ );
1434
+ const visibleTaskCount = state.tasks.length > availableForTaskSection ? availableForTaskSection - 1 : state.tasks.length;
1435
+ const taskSlice = state.tasks.slice(-visibleTaskCount);
1436
+ const hiddenTaskCount = state.tasks.length - taskSlice.length;
1437
+ const taskRowsUsed = visibleTaskCount + (hiddenTaskCount > 0 ? 1 : 0);
1438
+ const logPaneMaxLines = Math.max(
1439
+ LOG_PANE_MIN,
1440
+ terminalRows - FIXED_OVERHEAD - taskRowsUsed - iterationRowCount
1441
+ );
1420
1442
  const elapsed = formatHeaderElapsed(state.startTime, state.endTime);
1421
1443
  const activeTask = state.tasks[state.currentIndex];
1422
1444
  const completedCount = state.tasks.filter(
@@ -1438,25 +1460,36 @@ function App({ workflow: workflow2, events: events2, options: options2, updateCh
1438
1460
  filterInfo
1439
1461
  ] })
1440
1462
  ] }),
1441
- /* @__PURE__ */ jsx5(Box5, { flexDirection: "column", marginBottom: 1, children: state.tasks.map((taskState, i) => /* @__PURE__ */ jsxs4(Box5, { flexDirection: "column", children: [
1442
- /* @__PURE__ */ jsx5(
1443
- TaskRow,
1444
- {
1445
- index: i,
1446
- tick,
1447
- taskState,
1448
- isActive: i === state.currentIndex
1449
- }
1450
- ),
1451
- taskState.status === "running" && taskState.iterationHistory?.length ? /* @__PURE__ */ jsx5(
1452
- IterationList,
1453
- {
1454
- iterationHistory: taskState.iterationHistory,
1455
- tick,
1456
- maxVisible: MAX_VISIBLE_ITERATIONS
1457
- }
1458
- ) : null
1459
- ] }, i)) }),
1463
+ /* @__PURE__ */ jsxs4(Box5, { flexDirection: "column", marginBottom: 1, children: [
1464
+ hiddenTaskCount > 0 && /* @__PURE__ */ jsxs4(Text5, { dimColor: true, children: [
1465
+ " ",
1466
+ "\xB7\xB7\xB7 ",
1467
+ hiddenTaskCount,
1468
+ " earlier"
1469
+ ] }),
1470
+ taskSlice.map((taskState, i) => {
1471
+ const globalIndex = hiddenTaskCount + i;
1472
+ return /* @__PURE__ */ jsxs4(Box5, { flexDirection: "column", children: [
1473
+ /* @__PURE__ */ jsx5(
1474
+ TaskRow,
1475
+ {
1476
+ index: globalIndex,
1477
+ tick,
1478
+ taskState,
1479
+ isActive: globalIndex === state.currentIndex
1480
+ }
1481
+ ),
1482
+ taskState.status === "running" && taskState.iterationHistory?.length ? /* @__PURE__ */ jsx5(
1483
+ IterationList,
1484
+ {
1485
+ iterationHistory: taskState.iterationHistory,
1486
+ tick,
1487
+ maxVisible: MAX_VISIBLE_ITERATIONS
1488
+ }
1489
+ ) : null
1490
+ ] }, globalIndex);
1491
+ })
1492
+ ] }),
1460
1493
  activeTask && /* @__PURE__ */ jsx5(
1461
1494
  LogPane,
1462
1495
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "executant",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "Harness for YAML-defined workflows that enables stepping through Claude sessions and bash commands",
5
5
  "repository": {
6
6
  "type": "git",