@powerhousedao/workflow 6.2.3-dev.87 → 6.2.3-dev.89

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 (108) hide show
  1. package/dist/browser/{BlockSelector-BKAJwJ4Y.js → BlockSelector-DFzzAWXh.js} +65 -7
  2. package/dist/browser/BlockSelector-DFzzAWXh.js.map +1 -0
  3. package/dist/browser/{connection-form-DltdMa8F.js → connection-form-B6zpGmAm.js} +3 -3
  4. package/dist/browser/{connection-form-DltdMa8F.js.map → connection-form-B6zpGmAm.js.map} +1 -1
  5. package/dist/browser/{data-tree-DAw8e0j8.js → data-tree-DKS0EQys.js} +2 -2
  6. package/dist/browser/{data-tree-DAw8e0j8.js.map → data-tree-DKS0EQys.js.map} +1 -1
  7. package/dist/browser/{editor-Dl6lzxkM.js → editor-Yt-_V04R.js} +207 -58
  8. package/dist/browser/editor-Yt-_V04R.js.map +1 -0
  9. package/dist/browser/{editor-CZLe6CAF.js → editor-bHCkW_XB.js} +4 -4
  10. package/dist/browser/{editor-CZLe6CAF.js.map → editor-bHCkW_XB.js.map} +1 -1
  11. package/dist/browser/{editor--J61vLSC.js → editor-gCkAwv09.js} +64 -132
  12. package/dist/browser/editor-gCkAwv09.js.map +1 -0
  13. package/dist/browser/editors/connection-editor/module.js +1 -1
  14. package/dist/browser/editors/runtime/index.js +1 -1
  15. package/dist/browser/editors/workflow-editor/module.js +1 -1
  16. package/dist/browser/editors/workflow-studio/module.js +1 -1
  17. package/dist/browser/index.js +2 -1
  18. package/dist/browser/index.js.map +1 -1
  19. package/dist/browser/{runtime-queries-D81Ghpok.js → runtime-queries-C5bqAgQy.js} +84 -13
  20. package/dist/browser/runtime-queries-C5bqAgQy.js.map +1 -0
  21. package/dist/browser/{trigger-text-BSVi5oGZ.js → trigger-text-BfIu-QcC.js} +176 -11
  22. package/dist/browser/trigger-text-BfIu-QcC.js.map +1 -0
  23. package/dist/node/{BlockSelector-DnTRF-C7.mjs → BlockSelector-Cia1Rpwz.mjs} +64 -6
  24. package/dist/node/BlockSelector-Cia1Rpwz.mjs.map +1 -0
  25. package/dist/node/{connection-form-DwSHfIRw.mjs → connection-form-CJFKPwfg.mjs} +3 -3
  26. package/dist/node/{connection-form-DwSHfIRw.mjs.map → connection-form-CJFKPwfg.mjs.map} +1 -1
  27. package/dist/node/{data-tree-uSJU9Ost.mjs → data-tree-D9jdFsaX.mjs} +2 -2
  28. package/dist/node/{data-tree-uSJU9Ost.mjs.map → data-tree-D9jdFsaX.mjs.map} +1 -1
  29. package/dist/node/{editor-B4ZwM3pR.mjs → editor-CwOjO82y.mjs} +63 -131
  30. package/dist/node/editor-CwOjO82y.mjs.map +1 -0
  31. package/dist/node/{editor-_4XHbqGl.mjs → editor-NMRVprgI.mjs} +206 -57
  32. package/dist/node/editor-NMRVprgI.mjs.map +1 -0
  33. package/dist/node/{editor-cXi5dIsd.mjs → editor-_c6UDRAN.mjs} +4 -4
  34. package/dist/node/{editor-cXi5dIsd.mjs.map → editor-_c6UDRAN.mjs.map} +1 -1
  35. package/dist/node/editors/connection-editor/module.mjs +1 -1
  36. package/dist/node/editors/runtime/index.mjs +1 -1
  37. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  38. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  39. package/dist/node/index.mjs +2 -1
  40. package/dist/node/index.mjs.map +1 -1
  41. package/dist/node/pieces/ai/descriptor.json +70 -1
  42. package/dist/node/pieces/ai/index.mjs +125 -125
  43. package/dist/node/pieces/ai/package.json +1 -1
  44. package/dist/node/pieces/reactor/descriptor.json +35 -1
  45. package/dist/node/pieces/reactor/index.mjs +39 -39
  46. package/dist/node/pieces/reactor/package.json +1 -1
  47. package/dist/node/{runtime-queries-VXJsWno5.mjs → runtime-queries-Ck5OoWdy.mjs} +137 -12
  48. package/dist/node/runtime-queries-Ck5OoWdy.mjs.map +1 -0
  49. package/dist/node/{trigger-text-BBP7QVLj.mjs → trigger-text-T2D0a2Br.mjs} +175 -10
  50. package/dist/node/trigger-text-T2D0a2Br.mjs.map +1 -0
  51. package/dist/powerhouse.manifest.json +2 -2
  52. package/dist/style.css +1 -1
  53. package/dist/types/ai/workflow-tools.d.ts.map +1 -1
  54. package/dist/types/editors/shared/icons.d.ts +4 -0
  55. package/dist/types/editors/shared/icons.d.ts.map +1 -1
  56. package/dist/types/editors/workflow-editor/editor.d.ts.map +1 -1
  57. package/dist/types/editors/workflow-editor/runtime-client.d.ts +5 -1
  58. package/dist/types/editors/workflow-editor/runtime-client.d.ts.map +1 -1
  59. package/dist/types/editors/workflow-editor/ui/BlockSelector.d.ts.map +1 -1
  60. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts +1 -0
  61. package/dist/types/editors/workflow-editor/ui/PropertyForm.d.ts.map +1 -1
  62. package/dist/types/editors/workflow-editor/ui/StepPanel.d.ts.map +1 -1
  63. package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts +1 -0
  64. package/dist/types/editors/workflow-editor/ui/ap-edge.d.ts.map +1 -1
  65. package/dist/types/editors/workflow-editor/ui/ap-layout.d.ts.map +1 -1
  66. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts +4 -0
  67. package/dist/types/editors/workflow-editor/ui/ap-nodes.d.ts.map +1 -1
  68. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts +3 -0
  69. package/dist/types/editors/workflow-editor/ui/block-meta.d.ts.map +1 -1
  70. package/dist/types/editors/workflow-editor/ui/blocks.d.ts +8 -0
  71. package/dist/types/editors/workflow-editor/ui/blocks.d.ts.map +1 -1
  72. package/dist/types/editors/workflow-editor/ui/canvas-menu.d.ts.map +1 -1
  73. package/dist/types/editors/workflow-editor/ui/flow-control.test.d.ts +2 -0
  74. package/dist/types/editors/workflow-editor/ui/flow-control.test.d.ts.map +1 -0
  75. package/dist/types/editors/workflow-editor/ui/prop-layout.d.ts +1 -0
  76. package/dist/types/editors/workflow-editor/ui/prop-layout.d.ts.map +1 -1
  77. package/dist/types/editors/workflow-editor/ui/prop-layout.test.d.ts +2 -0
  78. package/dist/types/editors/workflow-editor/ui/prop-layout.test.d.ts.map +1 -0
  79. package/dist/types/editors/workflow-editor/ui/trigger-text.d.ts.map +1 -1
  80. package/dist/types/editors/workflow-editor/ui/use-validity.d.ts.map +1 -1
  81. package/dist/types/editors/workflow-editor/ui/validation.d.ts +4 -1
  82. package/dist/types/editors/workflow-editor/ui/validation.d.ts.map +1 -1
  83. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts +4 -1
  84. package/dist/types/editors/workflow-studio/components/RunsTable.d.ts.map +1 -1
  85. package/dist/types/editors/workflow-studio/components/Waitpoints.d.ts +9 -1
  86. package/dist/types/editors/workflow-studio/components/Waitpoints.d.ts.map +1 -1
  87. package/dist/types/editors/workflow-studio/components/WorkflowGraph.d.ts.map +1 -1
  88. package/dist/types/editors/workflow-studio/components/graph-layout.d.ts +1 -0
  89. package/dist/types/editors/workflow-studio/components/graph-layout.d.ts.map +1 -1
  90. package/dist/types/editors/workflow-studio/components/tips.d.ts.map +1 -1
  91. package/dist/types/pieces/ai/lib/actions/decide-on-documents.d.ts.map +1 -1
  92. package/dist/types/pieces/ai/lib/actions/extract.d.ts.map +1 -1
  93. package/dist/types/pieces/ai/lib/actions/propose-actions.d.ts.map +1 -1
  94. package/dist/types/pieces/ai/lib/actions/summarize.d.ts.map +1 -1
  95. package/dist/types/pieces/reactor/lib/actions/document-find.d.ts.map +1 -1
  96. package/dist/types/test/ui/flow-control.spec.d.ts +2 -0
  97. package/dist/types/test/ui/flow-control.spec.d.ts.map +1 -0
  98. package/package.json +9 -9
  99. package/dist/browser/BlockSelector-BKAJwJ4Y.js.map +0 -1
  100. package/dist/browser/editor--J61vLSC.js.map +0 -1
  101. package/dist/browser/editor-Dl6lzxkM.js.map +0 -1
  102. package/dist/browser/runtime-queries-D81Ghpok.js.map +0 -1
  103. package/dist/browser/trigger-text-BSVi5oGZ.js.map +0 -1
  104. package/dist/node/BlockSelector-DnTRF-C7.mjs.map +0 -1
  105. package/dist/node/editor-B4ZwM3pR.mjs.map +0 -1
  106. package/dist/node/editor-_4XHbqGl.mjs.map +0 -1
  107. package/dist/node/runtime-queries-VXJsWno5.mjs.map +0 -1
  108. package/dist/node/trigger-text-BBP7QVLj.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
- import { Dt as parseManualInputs, Et as manualDefault, Q as CORE_PIECE, _t as ManualPayloadError, bt as coerceManualPayload, dt as stepBlock, et as MANUAL_TRIGGER, l as runsOfPages, pt as triggerBlock, ut as sameBlock } from "./runtime-queries-VXJsWno5.mjs";
2
- import { A as formatWhen, Bt as textAreaClass, C as canRerun, D as formatMs, Dt as useSearchParamDraft, E as formatDuration, Et as useSearchParam, F as statusLabel, Ft as Switch, Gt as DocumentLoadError, Ht as Icon, I as toneOf, Kt as errorMessage, L as workflowHealth, M as runStatusLabel, N as runTimeline, O as formatTrigger, Ot as Button, P as runTone, Pt as Select, S as TONE_TEXT, St as useRuntimeActions, T as formatAbsolute, Tt as ITEM_PARAM, Vt as textInputClass, Wt as DocumentErrorBoundary, _ as CONNECTION_TONE, b as STEP_TONE, f as blockMeta, g as usePieceLogos, j as runStats, k as formatUntil, mt as WorkflowRuntimeProvider, t as BlockLogo, v as RUN_STATUSES, vt as useRunPagesQuery, w as durationMs, wt as useWaitingRunsQuery, x as TONE_DOT, y as RUN_TONE, yt as useRunQuery } from "./BlockSelector-DnTRF-C7.mjs";
1
+ import { $ as CALL_FLOW_BLOCK, Et as coerceManualPayload, It as stepPortLabel, Mt as manualDefault, Nt as parseManualInputs, St as ManualPayloadError, et as CORE_PIECE, gt as stepBlock, ht as sameBlock, l as runsOfPages, rt as MANUAL_TRIGGER, vt as triggerBlock } from "./runtime-queries-Ck5OoWdy.mjs";
2
+ import { A as formatTrigger, At as Button, C as TONE_DOT, D as formatAbsolute, Dt as ITEM_PARAM, E as durationMs, Et as useWaitingRunsQuery, F as runTimeline, Ht as textAreaClass, I as runTone, It as Select, Jt as errorMessage, Kt as DocumentErrorBoundary, L as statusLabel, Lt as Switch, M as formatWhen, N as runStats, O as formatDuration, Ot as useSearchParam, P as runStatusLabel, R as toneOf, S as STEP_TONE, T as canRerun, Ut as textInputClass, Wt as Icon, b as RUN_STATUSES, bt as useRunPagesQuery, f as blockMeta, gt as WorkflowRuntimeProvider, j as formatUntil, k as formatMs, kt as useSearchParamDraft, qt as DocumentLoadError, t as BlockLogo, v as usePieceLogos, w as TONE_TEXT, wt as useRuntimeActions, x as RUN_TONE, xt as useRunQuery, y as CONNECTION_TONE, z as workflowHealth } from "./BlockSelector-Cia1Rpwz.mjs";
3
3
  import { y as actions } from "./module-CuTg45ct.mjs";
4
4
  import { r as useWorkflowDocumentsInSelectedDrive } from "./workflow-BgURVzdc.mjs";
5
- import { a as StepError, b as PropertyForm, f as StatusToggle, i as DataViewer, l as PublishState, r as describeTrigger } from "./trigger-text-BBP7QVLj.mjs";
5
+ import { C as PropertyForm, a as StepError, c as stepOutline, f as PublishState, h as StatusToggle, i as DataViewer, r as describeTrigger, s as graphLayout } from "./trigger-text-T2D0a2Br.mjs";
6
6
  import { addDocument, addFolder, deleteNode, getPHStore, showDeleteNodeModal, useDispatch, useDocumentSafe, useFileNodesInSelectedDrive, useNodesInSelectedDrive, usePHToast, useSearchParams, useSelectedDrive, useSelectedNode, useSetPHAppConfig, useSetSearchParams, useSetSelectedNode } from "@powerhousedao/reactor-browser";
7
7
  import { generateId } from "document-model";
8
8
  import { Fragment, Suspense, lazy, useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
@@ -195,117 +195,6 @@ function RunDialog(props) {
195
195
  });
196
196
  }
197
197
  //#endregion
198
- //#region editors/workflow-studio/components/step-outline.ts
199
- function stepOutline(args) {
200
- const inbound = /* @__PURE__ */ new Map();
201
- for (const edge of args.edges) {
202
- const list = inbound.get(edge.to) ?? [];
203
- list.push(edge);
204
- inbound.set(edge.to, list);
205
- }
206
- const decided = args.triggerId ? [args.triggerId] : [];
207
- const rows = [];
208
- const seen = /* @__PURE__ */ new Set();
209
- const firstDecided = (edges) => edges.reduce((first, edge) => decided.indexOf(edge.from) < decided.indexOf(first.from) ? edge : first);
210
- let progressed = true;
211
- while (progressed) {
212
- progressed = false;
213
- for (const step of args.steps) {
214
- if (seen.has(step.id)) continue;
215
- const edges = inbound.get(step.id) ?? [];
216
- const entry = !args.triggerId && edges.length === 0;
217
- if (!entry) {
218
- if (edges.length === 0) continue;
219
- if (!edges.every((edge) => decided.includes(edge.from))) continue;
220
- }
221
- seen.add(step.id);
222
- decided.push(step.id);
223
- const port = entry ? null : firstDecided(edges).port;
224
- rows.push({
225
- step,
226
- port: port === "next" ? null : port
227
- });
228
- progressed = true;
229
- }
230
- }
231
- return {
232
- rows,
233
- orphans: args.steps.filter((step) => !seen.has(step.id))
234
- };
235
- }
236
- //#endregion
237
- //#region editors/workflow-studio/components/graph-layout.ts
238
- const TRIGGER_NODE = "trigger";
239
- const SIDE_PORTS = /* @__PURE__ */ new Set(["false", "error"]);
240
- function graphLayout(args) {
241
- const { rows } = stepOutline(args);
242
- const nodeId = (id) => id === args.triggerId ? TRIGGER_NODE : id;
243
- const placed = /* @__PURE__ */ new Map([[TRIGGER_NODE, {
244
- col: 0,
245
- lane: 0
246
- }]]);
247
- const taken = /* @__PURE__ */ new Set();
248
- const inbound = /* @__PURE__ */ new Map();
249
- const outbound = /* @__PURE__ */ new Map();
250
- for (const edge of args.edges) {
251
- const list = inbound.get(edge.to) ?? [];
252
- list.push(edge);
253
- inbound.set(edge.to, list);
254
- outbound.set(edge.from, (outbound.get(edge.from) ?? 0) + 1);
255
- }
256
- const drops = (edge) => SIDE_PORTS.has(edge.port) && (outbound.get(edge.from) ?? 0) > 1;
257
- const nodes = [];
258
- for (const { step } of rows) {
259
- const from = (inbound.get(step.id) ?? []).filter((edge) => placed.has(nodeId(edge.from)));
260
- const col = Math.max(1, ...from.map((edge) => placed.get(nodeId(edge.from)).col + 1));
261
- let lane = Math.min(...from.map((edge) => placed.get(nodeId(edge.from)).lane + (drops(edge) ? 1 : 0)), from.length === 0 ? 0 : Infinity);
262
- const port = from.length === 1 && from[0].port !== "next" ? from[0].port : null;
263
- while (taken.has(`${col}:${lane}`)) lane++;
264
- taken.add(`${col}:${lane}`);
265
- placed.set(step.id, {
266
- col,
267
- lane
268
- });
269
- nodes.push({
270
- step,
271
- col,
272
- lane,
273
- port
274
- });
275
- }
276
- return {
277
- nodes,
278
- edges: args.edges.map((edge) => ({
279
- ...edge,
280
- from: nodeId(edge.from)
281
- })).filter((edge) => placed.has(edge.from) && placed.has(edge.to)).map((edge) => {
282
- const a = placed.get(edge.from);
283
- const b = placed.get(edge.to);
284
- const clear = (lane) => !nodes.some((node) => node.lane === lane && node.col > a.col && node.col < b.col);
285
- const low = Math.max(a.lane, b.lane);
286
- const high = Math.min(a.lane, b.lane);
287
- const track = clear(low) ? {
288
- lane: low,
289
- under: false
290
- } : clear(high) ? {
291
- lane: high,
292
- under: false
293
- } : {
294
- lane: high,
295
- under: true
296
- };
297
- return {
298
- from: edge.from,
299
- to: edge.to,
300
- port: edge.port,
301
- track
302
- };
303
- }),
304
- cols: Math.max(0, ...nodes.map((node) => node.col)),
305
- lanes: Math.max(1, ...nodes.map((node) => node.lane + 1))
306
- };
307
- }
308
- //#endregion
309
198
  //#region editors/workflow-studio/components/tips.tsx
310
199
  function TipProvider(props) {
311
200
  return /* @__PURE__ */ jsx(ConnectTooltipProvider, {
@@ -325,7 +214,9 @@ function Tip(props) {
325
214
  const PORT_TEXT = {
326
215
  true: "Runs when the condition is true",
327
216
  false: "Runs when the condition is false",
328
- error: "Runs when the step before it fails"
217
+ error: "Runs when the step before it fails",
218
+ each: "Runs once for each item of the loop before it",
219
+ otherwise: "Runs when no branch of the router before it holds"
329
220
  };
330
221
  function stepSummary(record, ran) {
331
222
  if (!ran) return "Not run yet";
@@ -353,7 +244,7 @@ function StepTip(props) {
353
244
  }),
354
245
  props.port ? /* @__PURE__ */ jsx("span", {
355
246
  className: "text-muted-foreground",
356
- children: PORT_TEXT[props.port] ?? `Runs on "${props.port}"`
247
+ children: PORT_TEXT[props.port] ?? (/^branch_\d+$/.test(props.port) ? "Runs when its router branch holds" : `Runs on "${props.port}"`)
357
248
  }) : null,
358
249
  /* @__PURE__ */ jsx("span", {
359
250
  className: "mt-1",
@@ -532,9 +423,11 @@ const WAITING_POLL_MS = 3e4;
532
423
  function isOpenApproval(waitpoint) {
533
424
  return waitpoint.status === "PENDING" && waitpoint.kind === "approval";
534
425
  }
535
- function waitDescription(waitpoint, stepName) {
426
+ function waitDescription(waitpoint, stepName, step) {
536
427
  if (waitpoint.kind === "delay") return waitpoint.resumeAt ? `${stepName} is waiting until ${formatAbsolute(waitpoint.resumeAt)}` : `${stepName} is waiting for its delay`;
537
- return `${stepName} is waiting for a webhook callback${waitpoint.expiresAt ? `, until ${formatAbsolute(waitpoint.expiresAt)}` : ""}`;
428
+ const expiry = waitpoint.expiresAt ? `, until ${formatAbsolute(waitpoint.expiresAt)}` : "";
429
+ if (step?.pieceName === "@activepieces/piece-subflows" && step.blockName === CALL_FLOW_BLOCK.name) return `${stepName} is waiting for the called workflow to respond${expiry}`;
430
+ return `${stepName} is waiting for a webhook callback${expiry}`;
538
431
  }
539
432
  function cancelFailure(result) {
540
433
  if (!result) return "The run was not found";
@@ -744,7 +637,7 @@ function RunWaitpoints(props) {
744
637
  children: [/* @__PURE__ */ jsx(Icon, {
745
638
  name: "clock",
746
639
  className: "h-3.5 w-3.5"
747
- }), waitDescription(waitpoint, props.names.get(waitpoint.stepKey) ?? waitpoint.stepKey)]
640
+ }), waitDescription(waitpoint, props.names.get(waitpoint.stepKey) ?? waitpoint.stepKey, props.steps?.find((step) => step.stepKey === waitpoint.stepKey))]
748
641
  }, waitpoint.id))
749
642
  });
750
643
  }
@@ -876,6 +769,16 @@ function TimelineBar(props) {
876
769
  })]
877
770
  });
878
771
  }
772
+ function iterationLabel(path) {
773
+ return `#${[...path.matchAll(/\[(\d+)\]/g)].map((match) => match[1]).join(".")}`;
774
+ }
775
+ function cappedIterationsNote(run) {
776
+ if (!run.iterationsTotal) return null;
777
+ return `Showing ${run.iterations?.length ?? 0} of ${run.iterationsTotal} loop iteration steps.`;
778
+ }
779
+ function loopIterations(run, loopId) {
780
+ return (run.iterations ?? []).filter((step) => step.path?.startsWith(`${loopId}[`));
781
+ }
879
782
  function StepRow(props) {
880
783
  const { step } = props;
881
784
  const meta = blockMeta({
@@ -886,7 +789,7 @@ function StepRow(props) {
886
789
  const [open, setOpen] = useState(false);
887
790
  return /* @__PURE__ */ jsxs("div", {
888
791
  role: "listitem",
889
- className: "border-t border-solid border-border",
792
+ className: `border-t border-solid border-border ${props.iteration ? "pl-6" : ""}`,
890
793
  children: [/* @__PURE__ */ jsxs("button", {
891
794
  type: "button",
892
795
  "aria-expanded": open,
@@ -902,10 +805,13 @@ function StepRow(props) {
902
805
  status: step.status,
903
806
  className: "w-24 shrink-0 text-xs"
904
807
  }),
905
- /* @__PURE__ */ jsx("span", {
808
+ /* @__PURE__ */ jsxs("span", {
906
809
  className: "shrink-0 font-medium text-foreground",
907
810
  title: `Key: ${step.stepKey}`,
908
- children: props.name ?? step.stepKey
811
+ children: [props.name ?? step.stepKey, props.iteration ? /* @__PURE__ */ jsx("span", {
812
+ className: "ml-1.5 font-normal text-muted-foreground",
813
+ children: props.iteration
814
+ }) : null]
909
815
  }),
910
816
  /* @__PURE__ */ jsxs("span", {
911
817
  className: "flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",
@@ -1051,7 +957,14 @@ function RunDetail(props) {
1051
957
  const run = full.data ?? props.run;
1052
958
  const dataPending = full.data === void 0 && full.status === "pending";
1053
959
  const dataError = full.status === "error" ? full.error instanceof Error ? full.error.message : String(full.error) : null;
1054
- const timeline = runTimeline(run);
960
+ const timeline = runTimeline({
961
+ ...run,
962
+ steps: [...run.steps, ...(run.iterations ?? []).map((step) => ({
963
+ ...step,
964
+ stepId: step.path
965
+ }))]
966
+ });
967
+ const iterated = new Set((run.iterations ?? []).map((step) => step.stepId));
1055
968
  const [rerunning, setRerunning] = useState(false);
1056
969
  const [rerunError, setRerunError] = useState(null);
1057
970
  return /* @__PURE__ */ jsxs("div", {
@@ -1064,6 +977,7 @@ function RunDetail(props) {
1064
977
  run.waitpoints ? /* @__PURE__ */ jsx(RunWaitpoints, {
1065
978
  waitpoints: run.waitpoints,
1066
979
  names,
980
+ steps: run.steps,
1067
981
  onChanged: props.onChanged
1068
982
  }) : null,
1069
983
  run.warningNotes.length > 0 ? /* @__PURE__ */ jsx("ul", {
@@ -1118,16 +1032,27 @@ function RunDetail(props) {
1118
1032
  className: "overflow-hidden rounded-md border border-solid border-border bg-card",
1119
1033
  children: [
1120
1034
  /* @__PURE__ */ jsx(TriggerRow, { run }),
1121
- run.steps.map((step) => /* @__PURE__ */ jsx(StepRow, {
1035
+ run.steps.map((step) => /* @__PURE__ */ jsxs(Fragment, { children: [iterated.has(step.stepId) ? null : /* @__PURE__ */ jsx(StepRow, {
1122
1036
  step,
1123
1037
  name: names.get(step.stepKey),
1124
1038
  span: timeline.get(step.stepId),
1125
1039
  dataPending,
1126
1040
  dataError
1127
- }, step.stepId + step.stepKey)),
1041
+ }), loopIterations(run, step.stepId).map((iteration) => /* @__PURE__ */ jsx(StepRow, {
1042
+ step: iteration,
1043
+ name: names.get(iteration.stepKey),
1044
+ iteration: iterationLabel(iteration.path),
1045
+ span: timeline.get(iteration.path),
1046
+ dataPending,
1047
+ dataError
1048
+ }, iteration.path))] }, step.stepId + step.stepKey)),
1128
1049
  run.steps.length === 0 ? /* @__PURE__ */ jsx("p", {
1129
1050
  className: "border-t border-solid border-border px-3 py-2 pl-10 text-xs text-muted-foreground",
1130
1051
  children: "No steps ran."
1052
+ }) : null,
1053
+ cappedIterationsNote(run) ? /* @__PURE__ */ jsx("p", {
1054
+ className: "border-t border-solid border-border px-3 py-2 pl-10 text-xs text-muted-foreground",
1055
+ children: cappedIterationsNote(run)
1131
1056
  }) : null
1132
1057
  ]
1133
1058
  })
@@ -2287,8 +2212,11 @@ const STROKE = {
2287
2212
  const PORT_PILL = {
2288
2213
  true: "bg-wf-ok/10 text-wf-ok ring-wf-ok/30",
2289
2214
  false: "bg-foreground/5 text-muted-foreground ring-foreground/15",
2290
- error: "bg-wf-fail/10 text-wf-fail ring-wf-fail/30"
2215
+ error: "bg-wf-fail/10 text-wf-fail ring-wf-fail/30",
2216
+ each: "bg-violet-500/10 text-violet-500 ring-violet-500/30",
2217
+ otherwise: "bg-foreground/5 text-muted-foreground ring-foreground/15"
2291
2218
  };
2219
+ const pillOf = (port) => PORT_PILL[port] ?? (/^branch_\d+$/.test(port) ? "bg-wf-run/10 text-wf-run ring-wf-run/30" : void 0);
2292
2220
  function roundedPath(points, radius = 6) {
2293
2221
  let d = `M ${points[0][0]} ${points[0][1]}`;
2294
2222
  for (let i = 1; i < points.length - 1; i++) {
@@ -2406,6 +2334,10 @@ function WorkflowGraph(props) {
2406
2334
  steps: state.steps,
2407
2335
  edges: state.edges
2408
2336
  });
2337
+ const portText = (edge) => {
2338
+ const step = state.steps.find((entry) => entry.id === edge.from);
2339
+ return (step && stepPortLabel(stepBlock(step), step.config, edge.port)) ?? edge.port;
2340
+ };
2409
2341
  const { g, stacked, perRow } = fitGraph(GEOMETRY[props.size ?? "sm"], layout.cols, props.fit ? room : null);
2410
2342
  const rowOf = (col) => Math.floor((col - 1) / perRow);
2411
2343
  const rows = Math.max(1, Math.ceil(layout.cols / perRow));
@@ -2454,7 +2386,7 @@ function WorkflowGraph(props) {
2454
2386
  route: wraps ? wrapRoute(g, source, target, ends) : edgeRoute(g, source, target, trackY(edge, target.row), stacked)
2455
2387
  };
2456
2388
  });
2457
- const dips = routes.filter((route) => route.under).map(({ route, edge }) => route.label.y + (PORT_PILL[edge.port] ? 10 : 4));
2389
+ const dips = routes.filter((route) => route.under).map(({ route, edge }) => route.label.y + (pillOf(edge.port) ? 10 : 4));
2458
2390
  const height = Math.max(...layout.nodes.map((node) => spot(node.col, node.lane).y + (g.label ? g.r + 6 + g.label : g.top)), ...dips);
2459
2391
  const labelBox = (x) => {
2460
2392
  let w = Math.min(g.col - 16, 2 * (width - x));
@@ -2524,7 +2456,7 @@ function WorkflowGraph(props) {
2524
2456
  className: STROKE[tone]
2525
2457
  }, key))
2526
2458
  }),
2527
- routes.map(({ key, edge, route }) => PORT_PILL[edge.port] ? /* @__PURE__ */ jsx("span", {
2459
+ routes.map(({ key, edge, route }) => pillOf(edge.port) ? /* @__PURE__ */ jsx("span", {
2528
2460
  "aria-hidden": true,
2529
2461
  className: "pointer-events-none absolute z-[1] -translate-x-1/2 -translate-y-1/2 rounded-full bg-card",
2530
2462
  style: {
@@ -2532,8 +2464,8 @@ function WorkflowGraph(props) {
2532
2464
  top: route.label.y
2533
2465
  },
2534
2466
  children: /* @__PURE__ */ jsx("span", {
2535
- className: `block rounded-full px-1.5 font-medium leading-4 ring-1 ring-inset ${g.portText} ${PORT_PILL[edge.port]}`,
2536
- children: edge.port
2467
+ className: `block rounded-full px-1.5 font-medium leading-4 ring-1 ring-inset ${g.portText} ${pillOf(edge.port)}`,
2468
+ children: portText(edge)
2537
2469
  })
2538
2470
  }, key) : null),
2539
2471
  layout.nodes.map((node) => {
@@ -3283,4 +3215,4 @@ function Editor(props) {
3283
3215
  //#endregion
3284
3216
  export { Editor as default };
3285
3217
 
3286
- //# sourceMappingURL=editor-B4ZwM3pR.mjs.map
3218
+ //# sourceMappingURL=editor-CwOjO82y.mjs.map