@arbidocs/blocks 0.4.84 → 0.4.86

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 (126) hide show
  1. package/dist/MailBodyEditor-5PIQLYVY.js +217 -0
  2. package/dist/MailBodyEditor-5PIQLYVY.js.map +1 -0
  3. package/dist/MailBodyEditor-D7MGJMLH.cjs +223 -0
  4. package/dist/MailBodyEditor-D7MGJMLH.cjs.map +1 -0
  5. package/dist/agents/index.cjs +282 -281
  6. package/dist/agents/index.js +7 -6
  7. package/dist/agents/workflows/StepBarFrame.d.ts +3 -1
  8. package/dist/agents/workflows/WorkflowRunner.d.ts +10 -1
  9. package/dist/agents/workflows/run.d.ts +24 -3
  10. package/dist/agents/workflows/stepWindow.d.ts +4 -2
  11. package/dist/agents/workflows/types.d.ts +5 -0
  12. package/dist/agents/workflows/useWorkflowView.d.ts +16 -1
  13. package/dist/chat/index.cjs +1 -1
  14. package/dist/chat/index.js +1 -1
  15. package/dist/chunk-3R6XBYL7.cjs +576 -0
  16. package/dist/chunk-3R6XBYL7.cjs.map +1 -0
  17. package/dist/{chunk-CKB64Z4R.js → chunk-4XJZ6AAY.js} +6 -245
  18. package/dist/chunk-4XJZ6AAY.js.map +1 -0
  19. package/dist/{chunk-B3WCKBJ7.cjs → chunk-5YXG342J.cjs} +6 -18
  20. package/dist/chunk-5YXG342J.cjs.map +1 -0
  21. package/dist/{chunk-SB5ZKOYN.js → chunk-7C35WXYB.js} +4 -63
  22. package/dist/chunk-7C35WXYB.js.map +1 -0
  23. package/dist/chunk-7RJTEWYM.js +362 -0
  24. package/dist/chunk-7RJTEWYM.js.map +1 -0
  25. package/dist/chunk-AFSOUS5X.cjs +253 -0
  26. package/dist/chunk-AFSOUS5X.cjs.map +1 -0
  27. package/dist/{chunk-F4RUCUXF.cjs → chunk-C2HRZSAT.cjs} +2 -63
  28. package/dist/chunk-C2HRZSAT.cjs.map +1 -0
  29. package/dist/{chunk-XA5S4776.cjs → chunk-IHYVK6F7.cjs} +52 -51
  30. package/dist/chunk-IHYVK6F7.cjs.map +1 -0
  31. package/dist/{chunk-CONIA2ZA.js → chunk-KHY4PYU7.js} +246 -146
  32. package/dist/chunk-KHY4PYU7.js.map +1 -0
  33. package/dist/chunk-LGX6UFYG.js +557 -0
  34. package/dist/chunk-LGX6UFYG.js.map +1 -0
  35. package/dist/chunk-O4YPVYPO.cjs +373 -0
  36. package/dist/chunk-O4YPVYPO.cjs.map +1 -0
  37. package/dist/chunk-R26OHONI.js +250 -0
  38. package/dist/chunk-R26OHONI.js.map +1 -0
  39. package/dist/{chunk-RYYYHPFU.cjs → chunk-RZUMQM7W.cjs} +246 -146
  40. package/dist/chunk-RZUMQM7W.cjs.map +1 -0
  41. package/dist/{chunk-RX35SMPR.js → chunk-S2NFD4QV.js} +8 -7
  42. package/dist/chunk-S2NFD4QV.js.map +1 -0
  43. package/dist/{chunk-YJQVLVBJ.cjs → chunk-S5HZBXZA.cjs} +2 -243
  44. package/dist/chunk-S5HZBXZA.cjs.map +1 -0
  45. package/dist/{chunk-GJV2G4FC.js → chunk-W7NZRZ54.js} +6 -18
  46. package/dist/chunk-W7NZRZ54.js.map +1 -0
  47. package/dist/{chunk-ZQYE7J3J.cjs → chunk-WRSBM6QN.cjs} +332 -94
  48. package/dist/chunk-WRSBM6QN.cjs.map +1 -0
  49. package/dist/{chunk-RSKSXEPW.js → chunk-X23U6QEJ.js} +324 -88
  50. package/dist/chunk-X23U6QEJ.js.map +1 -0
  51. package/dist/collaboration/index.cjs +100 -49
  52. package/dist/collaboration/index.js +4 -1
  53. package/dist/collaboration/mail/MailBodyEditor.d.ts +7 -0
  54. package/dist/collaboration/mail/MailDeliveryList.d.ts +8 -0
  55. package/dist/collaboration/mail/MailDocumentPicker.d.ts +15 -0
  56. package/dist/collaboration/mail/MailGrid.d.ts +17 -0
  57. package/dist/collaboration/mail/MailMessageView.d.ts +27 -0
  58. package/dist/collaboration/mail/PlainMailBodyEditor.d.ts +12 -0
  59. package/dist/collaboration/mail/index.d.ts +6 -0
  60. package/dist/collaboration/mail/mailCompose.d.ts +24 -0
  61. package/dist/connect/index.cjs +1673 -96
  62. package/dist/connect/index.cjs.map +1 -1
  63. package/dist/connect/index.d.ts +2 -1
  64. package/dist/connect/index.js +1634 -63
  65. package/dist/connect/index.js.map +1 -1
  66. package/dist/connection/ConnectedSettings.d.ts +1 -4
  67. package/dist/connection/ConnectedTagTable.d.ts +32 -0
  68. package/dist/connection/mail/ConnectedMailAccounts.d.ts +21 -0
  69. package/dist/connection/mail/ConnectedMailComposer.d.ts +40 -0
  70. package/dist/connection/mail/ConnectedMailSetup.d.ts +16 -0
  71. package/dist/connection/mail/ConnectedMailbox.d.ts +65 -0
  72. package/dist/connection/mail/MailComposerForm.d.ts +25 -0
  73. package/dist/connection/mail/attachments.d.ts +13 -0
  74. package/dist/connection/mail/index.d.ts +6 -0
  75. package/dist/connection/mail/mailbox.d.ts +6 -0
  76. package/dist/connection/mail/types.d.ts +92 -0
  77. package/dist/connection/useConnectedWorkNotifications.d.ts +6 -0
  78. package/dist/connection/useWorkflowThread.d.ts +7 -2
  79. package/dist/facts/index.cjs +3 -3
  80. package/dist/facts/index.js +3 -3
  81. package/dist/files/index.cjs +48 -368
  82. package/dist/files/index.cjs.map +1 -1
  83. package/dist/files/index.js +11 -361
  84. package/dist/files/index.js.map +1 -1
  85. package/dist/home/index.cjs +1 -1
  86. package/dist/home/index.js +1 -1
  87. package/dist/index.cjs +496 -437
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.js +23 -20
  90. package/dist/index.js.map +1 -1
  91. package/dist/settings/PasswordChangeDialog.d.ts +9 -12
  92. package/dist/settings/index.cjs +44 -43
  93. package/dist/settings/index.cjs.map +1 -1
  94. package/dist/settings/index.js +3 -2
  95. package/dist/settings/index.js.map +1 -1
  96. package/dist/shell/index.cjs +2 -2
  97. package/dist/shell/index.js +2 -2
  98. package/dist/studio/index.cjs +1 -1
  99. package/dist/studio/index.js +1 -1
  100. package/dist/tags/TagColumnsEditor.d.ts +34 -0
  101. package/dist/tags/TagDetail.d.ts +13 -11
  102. package/dist/tags/TagTable.d.ts +99 -0
  103. package/dist/tags/TagsNav.d.ts +2 -2
  104. package/dist/tags/index.d.ts +7 -5
  105. package/dist/tags/{tagMatrixDocx.d.ts → tagTableDocx.d.ts} +12 -12
  106. package/dist/tags/tagTableModel.d.ts +47 -0
  107. package/dist/workflow-canvas/index.cjs +50 -49
  108. package/dist/workflow-canvas/index.cjs.map +1 -1
  109. package/dist/workflow-canvas/index.js +7 -6
  110. package/dist/workflow-canvas/index.js.map +1 -1
  111. package/package.json +29 -4
  112. package/dist/chunk-B3WCKBJ7.cjs.map +0 -1
  113. package/dist/chunk-CKB64Z4R.js.map +0 -1
  114. package/dist/chunk-CONIA2ZA.js.map +0 -1
  115. package/dist/chunk-F4RUCUXF.cjs.map +0 -1
  116. package/dist/chunk-GJV2G4FC.js.map +0 -1
  117. package/dist/chunk-RSKSXEPW.js.map +0 -1
  118. package/dist/chunk-RX35SMPR.js.map +0 -1
  119. package/dist/chunk-RYYYHPFU.cjs.map +0 -1
  120. package/dist/chunk-SB5ZKOYN.js.map +0 -1
  121. package/dist/chunk-XA5S4776.cjs.map +0 -1
  122. package/dist/chunk-YJQVLVBJ.cjs.map +0 -1
  123. package/dist/chunk-ZQYE7J3J.cjs.map +0 -1
  124. package/dist/connection/ConnectedTagMatrix.d.ts +0 -23
  125. package/dist/tags/TagMatrix.d.ts +0 -87
  126. package/dist/tags/tagMatrixModel.d.ts +0 -43
@@ -678,10 +678,12 @@ function stepStatesFromActivity(events) {
678
678
  const approved = Array.isArray(detail.approved) ? detail.approved.filter(asRecord) : void 0;
679
679
  const finished2 = status === "done" || status === "skipped" || status === "failed";
680
680
  const declinedBy = str2(detail.declined_by);
681
+ const afterFailure = status === "skipped" && (before?.status === "failed" || !!before?.skippedAfterFailure);
681
682
  states[step] = {
682
683
  status,
683
684
  responseId,
684
- error: str2(detail.error) ?? null,
685
+ error: str2(detail.error) ?? (afterFailure ? before?.error ?? null : null),
686
+ ...afterFailure ? { skippedAfterFailure: true } : {},
685
687
  ...startedAt ? { startedAt } : {},
686
688
  ...action ? { action } : {},
687
689
  ...documents?.length ? { documents } : {},
@@ -715,7 +717,7 @@ var isRunFinished = (steps, states) => steps.length > 0 && steps.every((s) => fi
715
717
  var isPersonStep = (step) => step.kind !== "agent" && step.kind !== "action";
716
718
  var isPersonAction = (step) => step.kind === "action" && (step.action.type === "sign" || step.action.type === "email_draft");
717
719
  var canAssign = (step) => isPersonStep(step) || isPersonAction(step);
718
- function nextAction(steps, states, current) {
720
+ function nextAction(steps, states, current, { needsStart = false, canRetry = false } = {}) {
719
721
  const i = steps.findIndex((s) => s.id === current);
720
722
  const step = steps[i];
721
723
  if (!step) return "wait";
@@ -730,9 +732,17 @@ function nextAction(steps, states, current) {
730
732
  if (isPersonStep(step)) return "complete";
731
733
  if (phase === "waiting" && step.kind === "action" && step.action.type === "email_draft")
732
734
  return "complete";
735
+ if (phase === "ready" && needsStart) return "start";
733
736
  if (phase !== "failed") return independentNext ? "move" : "wait";
734
737
  const waitedFor = steps.slice(i + 1).some((s) => dependsOn(steps, s.id, step.id));
735
- return waitedFor || !following ? "skip" : "move";
738
+ if (!waitedFor && following) return "move";
739
+ return canRetry ? "retry" : "wait";
740
+ }
741
+ function failedUpstream(steps, states, id) {
742
+ return upstreamSteps(steps, id).flatMap((s) => {
743
+ const state = states[s.id];
744
+ return state && (state.status === "failed" || state.skippedAfterFailure) ? [{ step: s, state }] : [];
745
+ });
736
746
  }
737
747
  function validateStep(step, inputs) {
738
748
  const fields = stepFields(step);
@@ -1129,26 +1139,33 @@ function useWorkflowView(options) {
1129
1139
  },
1130
1140
  [following]
1131
1141
  );
1132
- const action = busy ? "wait" : nextAction(steps, states, current);
1142
+ const actionOptions = useCallback(
1143
+ (o) => ({
1144
+ needsStart: !!o.start && !!o.needsStart,
1145
+ canRetry: !!o.retry
1146
+ }),
1147
+ []
1148
+ );
1149
+ const action = busy ? "wait" : nextAction(steps, states, current, actionOptions(options));
1133
1150
  const next = useCallback(async () => {
1134
1151
  const { steps: s, states: st, inputs: values } = optionsRef.current;
1135
1152
  const at = s.find((x) => x.id === current);
1136
- const act2 = nextAction(s, st, current);
1153
+ const act2 = nextAction(s, st, current, actionOptions(optionsRef.current));
1137
1154
  if (!at || act2 === "wait" || busy) return;
1138
1155
  setActionError(null);
1139
1156
  if (act2 === "finish") return setCurrent(null);
1140
1157
  if (act2 === "move") return setCurrent(following(current));
1141
1158
  setBusy(true);
1142
1159
  try {
1143
- if (act2 === "skip") {
1144
- await optionsRef.current.skip(at.id);
1145
- } else {
1146
- if (Object.keys(validateStep(at, values)).length > 0) {
1147
- setShowErrors(true);
1148
- return;
1149
- }
1150
- await optionsRef.current.complete(at);
1160
+ if (act2 === "start" || act2 === "retry") {
1161
+ await (act2 === "start" ? optionsRef.current.start?.() : optionsRef.current.retry?.(at.id));
1162
+ return;
1163
+ }
1164
+ if (Object.keys(validateStep(at, values)).length > 0) {
1165
+ setShowErrors(true);
1166
+ return;
1151
1167
  }
1168
+ await optionsRef.current.complete(at);
1152
1169
  setShowErrors(false);
1153
1170
  setCurrent(onward(at.id) ?? current);
1154
1171
  } catch (e) {
@@ -1156,7 +1173,7 @@ function useWorkflowView(options) {
1156
1173
  } finally {
1157
1174
  setBusy(false);
1158
1175
  }
1159
- }, [current, busy, following, onward]);
1176
+ }, [current, busy, following, onward, actionOptions]);
1160
1177
  const goTo = useCallback((stepId) => {
1161
1178
  setShowErrors(false);
1162
1179
  setActionError(null);
@@ -1246,11 +1263,14 @@ function useWorkflowView(options) {
1246
1263
  setInput,
1247
1264
  stateOf: (id) => states[id],
1248
1265
  phaseOf: (id) => stepPhase(steps, states, id),
1266
+ failedUpstreamOf: (id) => failedUpstream(steps, states, id),
1249
1267
  isLocked,
1250
1268
  errors: showErrors && step && !isLocked(step.id) ? validateStep(step, inputs) : {},
1251
1269
  busy,
1252
1270
  actionError,
1253
1271
  isRunning: Object.values(states).some((s) => s.status === "running"),
1272
+ needsStart: !!options.start && !!options.needsStart,
1273
+ runError: options.runError ?? null,
1254
1274
  action,
1255
1275
  canBack: (current === null || index > 0) && !busy,
1256
1276
  next,
@@ -1345,6 +1365,7 @@ function stepWindow({
1345
1365
  canBack: start > 0,
1346
1366
  canForward: end < n,
1347
1367
  runningHidden: all.filter((s) => phaseOf(s.id) === "running" && !shown.has(s.id)),
1368
+ failedHidden: all.filter((s) => phaseOf(s.id) === "failed" && !shown.has(s.id)),
1348
1369
  position: Math.max(1, all.findIndex((s) => s.id === at) + 1),
1349
1370
  total: all.length
1350
1371
  };
@@ -1368,6 +1389,7 @@ var DEFAULT_STEP_BAR_LABELS = {
1368
1389
  inParallel: "In parallel",
1369
1390
  working: "Working: {title}",
1370
1391
  moreWorking: "+{count} working",
1392
+ failedStep: "Failed: {title}",
1371
1393
  waitingFor: "Waiting for {name}",
1372
1394
  phases: {
1373
1395
  blocked: "Not started",
@@ -1589,6 +1611,21 @@ function StepBarFrame({
1589
1611
  },
1590
1612
  s.id
1591
1613
  );
1614
+ const failedPill = (s) => /* @__PURE__ */ jsxs(
1615
+ "button",
1616
+ {
1617
+ type: "button",
1618
+ onClick: () => select(s.id),
1619
+ className: "flex min-w-0 max-w-[14rem] shrink items-center gap-1.5 rounded-full border border-destructive/40 bg-destructive/5 px-2 py-1 text-xs text-destructive hover:bg-destructive/10",
1620
+ title: fill(l.failedStep, { title: s.title }),
1621
+ "data-testid": tid(`failed-${s.id}`),
1622
+ children: [
1623
+ /* @__PURE__ */ jsx(AlertTriangle, { className: "size-3.5 shrink-0" }),
1624
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: fill(l.failedStep, { title: s.title }) })
1625
+ ]
1626
+ },
1627
+ s.id
1628
+ );
1592
1629
  return /* @__PURE__ */ jsxs(
1593
1630
  "nav",
1594
1631
  {
@@ -1676,6 +1713,17 @@ function StepBarFrame({
1676
1713
  ] })
1677
1714
  ]
1678
1715
  }
1716
+ ),
1717
+ win.failedHidden.length > 0 && /* @__PURE__ */ jsx(
1718
+ "div",
1719
+ {
1720
+ className: cn(
1721
+ "flex min-w-[6.5rem] shrink-[1000] items-center gap-1",
1722
+ narrow && "basis-full"
1723
+ ),
1724
+ "data-testid": tid("failed"),
1725
+ children: win.failedHidden.map(failedPill)
1726
+ }
1679
1727
  )
1680
1728
  ]
1681
1729
  }
@@ -2009,6 +2057,7 @@ function ActionStepBody({
2009
2057
  }) {
2010
2058
  const state = run.stateOf(step.id);
2011
2059
  const phase = run.phaseOf(step.id);
2060
+ const underWay = phase === "running" || phase === "ready" && !run.needsStart;
2012
2061
  const name = (id) => run.nameOf?.(id) ?? id;
2013
2062
  const [declining, setDeclining] = useState(false);
2014
2063
  const [note, setNote] = useState("");
@@ -2033,7 +2082,7 @@ function ActionStepBody({
2033
2082
  const mine = !actions?.me || signers.includes(actions.me) && !signed.has(actions.me);
2034
2083
  const signedRef = state?.status === "done" ? state.documents?.[0] : void 0;
2035
2084
  body = /* @__PURE__ */ jsxs(Fragment, { children: [
2036
- (phase === "ready" || phase === "running") && working(l.preparingSign),
2085
+ underWay && working(l.preparingSign),
2037
2086
  phase === "waiting" && waiting?.doc_ext_id && /* @__PURE__ */ jsx(
2038
2087
  DocChip,
2039
2088
  {
@@ -2143,7 +2192,7 @@ function ActionStepBody({
2143
2192
  } else if (a.type === "email_draft") {
2144
2193
  const draftId = state?.waiting?.draft_id ?? (typeof state?.output?.draft_id === "string" ? state.output.draft_id : void 0);
2145
2194
  body = /* @__PURE__ */ jsxs(Fragment, { children: [
2146
- (phase === "ready" || phase === "running") && working(l.preparingDraft),
2195
+ underWay && working(l.preparingDraft),
2147
2196
  phase === "waiting" && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.draftReady }),
2148
2197
  phase === "done" && /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-1.5 text-sm", "data-testid": `${testId}-sent`, children: [
2149
2198
  /* @__PURE__ */ jsx(Check, { className: "size-4 text-primary" }),
@@ -2169,7 +2218,7 @@ function ActionStepBody({
2169
2218
  const tags = state?.output?.tag_ext_ids ?? a.tags;
2170
2219
  const docs = state?.output?.doc_ext_ids ?? [];
2171
2220
  body = /* @__PURE__ */ jsxs(Fragment, { children: [
2172
- (phase === "ready" || phase === "running") && working(l.reviewRunning),
2221
+ underWay && working(l.reviewRunning),
2173
2222
  phase === "done" && /* @__PURE__ */ jsxs(Fragment, { children: [
2174
2223
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", "data-testid": `${testId}-reviewed`, children: l.reviewDone.replace("{docs}", String(docs.length)).replace("{cols}", String(tags.length)) }),
2175
2224
  actions?.openReview && /* @__PURE__ */ jsxs(
@@ -2220,7 +2269,9 @@ function WorkflowStepBar({
2220
2269
  const isCurrent = s.id === current;
2221
2270
  const assignee = ["ready", "waiting"].includes(phase) ? run.assigneeOf(s.id) : void 0;
2222
2271
  const waiting = assignee ? l.waitingFor.replace("{name}", assignee) : void 0;
2223
- const title = waiting ? `${s.title} \xB7 ${waiting}` : s.title;
2272
+ const state = s.id === DONE ? void 0 : run.stateOf(s.id);
2273
+ const failure = (phase === "failed" || state?.skippedAfterFailure) && state?.error ? `${l.phases.failed}: ${state.error}` : void 0;
2274
+ const title = [s.title, waiting, failure].filter(Boolean).join(" \xB7 ");
2224
2275
  const name = `${title} (${l.phases[phase]})`;
2225
2276
  if (s.id === DONE)
2226
2277
  return /* @__PURE__ */ jsxs(
@@ -2296,15 +2347,19 @@ function WorkflowStepBar({
2296
2347
  var DEFAULT_WORKFLOW_RUNNER_LABELS = {
2297
2348
  back: "Back",
2298
2349
  next: "Continue",
2299
- skip: "Skip",
2300
2350
  skipStep: "Skip this step",
2301
2351
  finish: "Finish",
2302
2352
  approve: "Approve",
2303
2353
  working: "Working\u2026",
2304
2354
  stepWorking: "{step}\u2026 {elapsed}",
2305
2355
  starting: "Starting\u2026",
2356
+ start: "Start",
2357
+ notStarted: "Not started yet. Press Start to run this step.",
2306
2358
  retry: "Retry",
2307
2359
  failed: "This step did not finish.",
2360
+ upstreamFailed: "\u201C{step}\u201D failed{error}. Retry it before this step can go on.",
2361
+ upstreamSkippedAfterFailure: "\u201C{step}\u201D failed{error} and was skipped: this step goes on without its result.",
2362
+ skippedAfterFailure: "Skipped after it failed{error}.",
2308
2363
  blocked: "Starts after {steps}.",
2309
2364
  awaitingReview: "Waiting for approval.",
2310
2365
  approved: "Approved.",
@@ -2373,7 +2428,7 @@ function WorkflowRunner({
2373
2428
  const unsent = added.filter((f) => f.status === "upload-failed").length;
2374
2429
  const uploadHold = step?.kind === "upload" && (sending > 0 || uploading || unsent > 0);
2375
2430
  const docsWait = !!step && waitingDocuments(run.stateOf(step.id)).length > 0;
2376
- const nextLabel = sending ? sending === 1 ? l.uploadingFile : l.uploadingFiles.replace("{count}", String(sending)) : uploadHold && uploading ? l.uploadingAny : uploadHold ? unsent === 1 ? l.uploadFailed : l.uploadsFailed.replace("{count}", String(unsent)) : 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 || docsWait) ? l.working : (step && !run.isLocked(step.id) ? step.nextLabel : void 0) ?? l.next;
2431
+ const nextLabel = sending ? sending === 1 ? l.uploadingFile : l.uploadingFiles.replace("{count}", String(sending)) : uploadHold && uploading ? l.uploadingAny : uploadHold ? unsent === 1 ? l.uploadFailed : l.uploadsFailed.replace("{count}", String(unsent)) : reading ? l.readingFiles.replace("{current}", String(Math.min(added.length - unread + 1, added.length))).replace("{count}", String(added.length)) : action === "start" ? l.start : action === "retry" ? l.retry : action === "finish" ? l.finish : action === "complete" && step?.kind === "review" ? l.approve : action === "complete" && step?.kind === "action" ? l.markSent : action === "wait" && (run.isRunning || run.busy || docsWait) ? l.working : (step && !run.isLocked(step.id) ? step.nextLabel : void 0) ?? l.next;
2377
2432
  return /* @__PURE__ */ jsxs("div", { className: cn(compact3 ? "space-y-3" : "space-y-6", className), "data-testid": testIdPrefix, children: [
2378
2433
  !hideStepBar && /* @__PURE__ */ jsx(
2379
2434
  WorkflowStepBar,
@@ -2400,138 +2455,141 @@ function WorkflowRunner({
2400
2455
  children: l.restart
2401
2456
  }
2402
2457
  )
2403
- ] }) : step ? /* @__PURE__ */ jsx("div", { className: "space-y-3", children: run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsx(Card, { className: cn(box, "p-6"), "data-testid": tid(step.id), children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-blocked`), children: l.blocked.replace(
2404
- "{steps}",
2405
- stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
2406
- ) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2407
- /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
2408
- /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2409
- /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2410
- /* @__PURE__ */ jsx("fieldset", { disabled: run.isLocked(step.id), className: "contents", children: /* @__PURE__ */ jsx(
2411
- SchemaForm,
2412
- {
2413
- fields: step.inputs,
2414
- values: run.inputs,
2415
- onChange: run.setInput,
2416
- errors: run.errors,
2417
- renderScope,
2418
- renderDocuments,
2419
- renderIcon,
2420
- people,
2421
- onEnterSubmit: () => void run.next(),
2422
- testIdPrefix: tid("field")
2423
- }
2424
- ) }),
2425
- run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", "data-testid": tid("action-error"), children: run.actionError }),
2426
- renderStepNote?.(step, run)
2427
- ] }) : step.kind === "upload" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2428
- /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2429
- /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2430
- renderUpload?.(step) ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2458
+ ] }) : step ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
2459
+ /* @__PURE__ */ jsx(StepNotices, { run, step, l, tid }),
2460
+ run.phaseOf(step.id) === "blocked" ? /* @__PURE__ */ jsx(Card, { className: cn(box, "p-6"), "data-testid": tid(step.id), children: /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-blocked`), children: l.blocked.replace(
2461
+ "{steps}",
2462
+ stepDependencies(steps, step.id).map((d) => steps.find((s) => s.id === d)?.title ?? d).join(", ")
2463
+ ) }) }) : step.kind === "form" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2464
+ /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon), testId: tid(`${step.id}-title`) }),
2465
+ /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2466
+ /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2467
+ /* @__PURE__ */ jsx("fieldset", { disabled: run.isLocked(step.id), className: "contents", children: /* @__PURE__ */ jsx(
2468
+ SchemaForm,
2469
+ {
2470
+ fields: step.inputs,
2471
+ values: run.inputs,
2472
+ onChange: run.setInput,
2473
+ errors: run.errors,
2474
+ renderScope,
2475
+ renderDocuments,
2476
+ renderIcon,
2477
+ people,
2478
+ onEnterSubmit: () => void run.next(),
2479
+ testIdPrefix: tid("field")
2480
+ }
2481
+ ) }),
2482
+ run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", "data-testid": tid("action-error"), children: run.actionError }),
2483
+ renderStepNote?.(step, run)
2484
+ ] }) : step.kind === "upload" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2485
+ /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2486
+ /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2487
+ renderUpload?.(step) ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2488
+ /* @__PURE__ */ jsx(
2489
+ UploadDropzone,
2490
+ {
2491
+ onFiles: (picked) => void onUpload?.(picked, step),
2492
+ uploading,
2493
+ disabled: !onUpload,
2494
+ accept: step.accept,
2495
+ title: step.title,
2496
+ description: step.description,
2497
+ hint: step.hint,
2498
+ testId: tid(`${step.id}-drop`)
2499
+ }
2500
+ ),
2501
+ files && /* @__PURE__ */ jsx(
2502
+ UploadFiles,
2503
+ {
2504
+ onRetry: onRetryUpload,
2505
+ onRemove: onRemoveUpload,
2506
+ added,
2507
+ others: files.filter((f) => f.addedFor !== step.id),
2508
+ l,
2509
+ testId: tid(`${step.id}-files`)
2510
+ }
2511
+ )
2512
+ ] }),
2513
+ run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2514
+ renderStepNote?.(step, run)
2515
+ ] }) : step.kind === "review" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2516
+ /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon) }),
2517
+ /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2518
+ /* @__PURE__ */ jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: reviewInstructions(step, run.inputs) }),
2519
+ /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2520
+ !(run.phaseOf(step.id) === "done" && run.stateOf(step.id)?.by) && /* @__PURE__ */ jsx("p", { className: "text-sm", "data-testid": tid(`${step.id}-status`), children: run.phaseOf(step.id) === "done" ? l.approved : run.phaseOf(step.id) === "skipped" ? l.skipped : l.awaitingReview }),
2521
+ (step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsx(
2522
+ SchemaForm,
2523
+ {
2524
+ fields: step.fields ?? [],
2525
+ values: run.inputs,
2526
+ onChange: run.setInput,
2527
+ errors: run.errors,
2528
+ renderScope,
2529
+ renderDocuments,
2530
+ renderIcon,
2531
+ people,
2532
+ testIdPrefix: tid("field")
2533
+ }
2534
+ ),
2431
2535
  /* @__PURE__ */ jsx(
2432
- UploadDropzone,
2536
+ ApprovalEvidence,
2433
2537
  {
2434
- onFiles: (picked) => void onUpload?.(picked, step),
2435
- uploading,
2436
- disabled: !onUpload,
2437
- accept: step.accept,
2438
- title: step.title,
2439
- description: step.description,
2440
- hint: step.hint,
2441
- testId: tid(`${step.id}-drop`)
2538
+ run,
2539
+ step,
2540
+ actions,
2541
+ nameOfDoc,
2542
+ l: pl,
2543
+ testId: tid(step.id)
2442
2544
  }
2443
2545
  ),
2444
- files && /* @__PURE__ */ jsx(
2445
- UploadFiles,
2546
+ run.phaseOf(step.id) === "ready" && renderReview?.(step),
2547
+ /* @__PURE__ */ jsx(SendBackControl, { run, step, l: pl, testId: tid(step.id) }),
2548
+ run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2549
+ renderStepNote?.(step, run)
2550
+ ] }) : step.kind === "action" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2551
+ /* @__PURE__ */ jsx(
2552
+ ActionStepBody,
2446
2553
  {
2447
- onRetry: onRetryUpload,
2448
- onRemove: onRemoveUpload,
2449
- added,
2450
- others: files.filter((f) => f.addedFor !== step.id),
2451
- l,
2452
- testId: tid(`${step.id}-files`)
2554
+ step,
2555
+ run,
2556
+ actions,
2557
+ nameOfDoc,
2558
+ heading: /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon) }),
2559
+ l: pl,
2560
+ testId: tid(step.id)
2453
2561
  }
2454
- )
2455
- ] }),
2456
- run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2457
- renderStepNote?.(step, run)
2458
- ] }) : step.kind === "review" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2459
- /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon) }),
2460
- /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2461
- /* @__PURE__ */ jsx("p", { className: "whitespace-pre-line text-sm text-muted-foreground", children: reviewInstructions(step, run.inputs) }),
2462
- /* @__PURE__ */ jsx(AssigneeLine, { run, stepId: step.id, l: pl, testId: tid(step.id) }),
2463
- !(run.phaseOf(step.id) === "done" && run.stateOf(step.id)?.by) && /* @__PURE__ */ jsx("p", { className: "text-sm", "data-testid": tid(`${step.id}-status`), children: run.phaseOf(step.id) === "done" ? l.approved : run.phaseOf(step.id) === "skipped" ? l.skipped : l.awaitingReview }),
2464
- (step.fields ?? []).length > 0 && run.phaseOf(step.id) === "ready" && /* @__PURE__ */ jsx(
2465
- SchemaForm,
2466
- {
2467
- fields: step.fields ?? [],
2468
- values: run.inputs,
2469
- onChange: run.setInput,
2470
- errors: run.errors,
2471
- renderScope,
2472
- renderDocuments,
2473
- renderIcon,
2474
- people,
2475
- testIdPrefix: tid("field")
2476
- }
2477
- ),
2478
- /* @__PURE__ */ jsx(
2479
- ApprovalEvidence,
2480
- {
2481
- run,
2482
- step,
2483
- actions,
2484
- nameOfDoc,
2485
- l: pl,
2486
- testId: tid(step.id)
2487
- }
2488
- ),
2489
- run.phaseOf(step.id) === "ready" && renderReview?.(step),
2490
- /* @__PURE__ */ jsx(SendBackControl, { run, step, l: pl, testId: tid(step.id) }),
2491
- run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2492
- renderStepNote?.(step, run)
2493
- ] }) : step.kind === "action" ? /* @__PURE__ */ jsxs(Card, { className: cn(box, "space-y-4"), "data-testid": tid(step.id), children: [
2494
- /* @__PURE__ */ jsx(
2495
- ActionStepBody,
2562
+ ),
2563
+ run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2564
+ renderStepNote?.(step, run)
2565
+ ] }) : /* @__PURE__ */ jsx(
2566
+ AgentStepBody,
2496
2567
  {
2497
2568
  step,
2498
2569
  run,
2499
- actions,
2570
+ renderAgentOutput,
2571
+ icon: icon(step.icon),
2572
+ renderStepNote,
2573
+ compact: compact3,
2500
2574
  nameOfDoc,
2501
- heading: /* @__PURE__ */ jsx(StepHeading, { step, icon: icon(step.icon) }),
2502
- l: pl,
2503
- testId: tid(step.id)
2575
+ extra: /* @__PURE__ */ jsxs(Fragment, { children: [
2576
+ /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2577
+ /* @__PURE__ */ jsx(
2578
+ RedlineOpen,
2579
+ {
2580
+ step,
2581
+ state: run.stateOf(step.id),
2582
+ actions,
2583
+ l: pl,
2584
+ testId: tid(step.id)
2585
+ }
2586
+ )
2587
+ ] }),
2588
+ l,
2589
+ tid
2504
2590
  }
2505
- ),
2506
- run.actionError && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: run.actionError }),
2507
- renderStepNote?.(step, run)
2508
- ] }) : /* @__PURE__ */ jsx(
2509
- AgentStepBody,
2510
- {
2511
- step,
2512
- run,
2513
- renderAgentOutput,
2514
- icon: icon(step.icon),
2515
- renderStepNote,
2516
- compact: compact3,
2517
- nameOfDoc,
2518
- extra: /* @__PURE__ */ jsxs(Fragment, { children: [
2519
- /* @__PURE__ */ jsx(SentBackNote, { state: run.stateOf(step.id), l: pl, testId: tid(step.id) }),
2520
- /* @__PURE__ */ jsx(
2521
- RedlineOpen,
2522
- {
2523
- step,
2524
- state: run.stateOf(step.id),
2525
- actions,
2526
- l: pl,
2527
- testId: tid(step.id)
2528
- }
2529
- )
2530
- ] }),
2531
- l,
2532
- tid
2533
- }
2534
- ) }, step.id) : null,
2591
+ )
2592
+ ] }, step.id) : null,
2535
2593
  !isComplete && /* @__PURE__ */ jsxs(
2536
2594
  "div",
2537
2595
  {
@@ -2559,7 +2617,7 @@ function WorkflowRunner({
2559
2617
  {
2560
2618
  className: cn("flex items-center gap-2", compact3 && "ml-auto flex-wrap justify-end"),
2561
2619
  children: [
2562
- step && action !== "skip" && // A step that commits (creates the matter, starts the thread) is what the run stands on.
2620
+ step && // A step that commits (creates the matter, starts the thread) is what the run stands on.
2563
2621
  !step.commit && ["ready", "blocked", "failed"].includes(run.phaseOf(step.id)) && /* @__PURE__ */ jsx(
2564
2622
  Button,
2565
2623
  {
@@ -2750,7 +2808,7 @@ function AgentStepBody({
2750
2808
  " ",
2751
2809
  l.branch
2752
2810
  ] }),
2753
- (phase === "ready" || phase === "running") && !state?.text && /* @__PURE__ */ jsxs(
2811
+ (phase === "running" || phase === "ready" && !run.needsStart) && !state?.text && /* @__PURE__ */ jsxs(
2754
2812
  "p",
2755
2813
  {
2756
2814
  className: "flex items-center gap-2 text-sm text-muted-foreground",
@@ -2777,7 +2835,7 @@ function AgentStepBody({
2777
2835
  }
2778
2836
  ),
2779
2837
  phase === "failed" && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", "data-testid": tid(`${step.id}-failed`), children: state?.error || l.failed }),
2780
- phase === "skipped" && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: l.skipped }),
2838
+ phase === "skipped" && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", "data-testid": tid(`${step.id}-skipped`), children: state?.skippedAfterFailure ? l.skippedAfterFailure.replace("{error}", state.error ? `: ${state.error}` : "") : l.skipped }),
2781
2839
  extra
2782
2840
  ] });
2783
2841
  if (step.output === "artifact" && !compact3) {
@@ -2804,7 +2862,49 @@ function AgentStepBody({
2804
2862
  renderStepNote?.(step, run)
2805
2863
  ] });
2806
2864
  }
2865
+ function StepNotices({
2866
+ run,
2867
+ step,
2868
+ l,
2869
+ tid
2870
+ }) {
2871
+ const notStarted = !isPersonStep(step) && run.needsStart && run.phaseOf(step.id) === "ready";
2872
+ const failed = run.failedUpstreamOf(step.id);
2873
+ if (!notStarted && failed.length === 0) return null;
2874
+ const why = (error) => error ? `: ${error}` : "";
2875
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-testid": tid(`${step.id}-notices`), children: [
2876
+ notStarted && /* @__PURE__ */ jsxs(
2877
+ "p",
2878
+ {
2879
+ className: cn(
2880
+ "flex items-start gap-2 text-sm",
2881
+ run.runError ? "text-destructive" : "text-muted-foreground"
2882
+ ),
2883
+ "data-testid": tid(`${step.id}-not-started`),
2884
+ children: [
2885
+ run.runError && /* @__PURE__ */ jsx(AlertTriangle, { className: "mt-0.5 size-4 shrink-0" }),
2886
+ run.runError || l.notStarted
2887
+ ]
2888
+ }
2889
+ ),
2890
+ failed.map(({ step: s, state }) => /* @__PURE__ */ jsxs(
2891
+ "p",
2892
+ {
2893
+ className: cn(
2894
+ "flex items-start gap-2 rounded-md border px-3 py-2 text-sm",
2895
+ state.status === "failed" ? "border-destructive/40 text-destructive" : "border-amber-500/40 text-amber-700 dark:text-amber-300"
2896
+ ),
2897
+ "data-testid": tid(`${step.id}-upstream-${s.id}`),
2898
+ children: [
2899
+ /* @__PURE__ */ jsx(AlertTriangle, { className: "mt-0.5 size-4 shrink-0" }),
2900
+ (state.status === "failed" ? l.upstreamFailed : l.upstreamSkippedAfterFailure).replace("{step}", s.title).replace("{error}", why(state.error))
2901
+ ]
2902
+ },
2903
+ s.id
2904
+ ))
2905
+ ] });
2906
+ }
2807
2907
 
2808
2908
  export { ActionStepBody, ApprovalEvidence, AssigneeLine, DEFAULT_ASSIGNEE_WORDING, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_STEP_BAR_LABELS, DEFAULT_WORKFLOW_RUNNER_LABELS, DEFAULT_WORKFLOW_STEP_PARTS_LABELS, EMPTY_WORKFLOW_SCOPE, PhaseMark, SKILL_PROMPT_FALLBACK_PLACEHOLDER, SKILL_PROMPT_LABEL, STEP_EXTRA, STEP_LABEL, STEP_LABEL_CURRENT, STEP_LABEL_MAX, STEP_PILL, SchemaForm, SendBackControl, StepBarFrame, WorkflowRunner, WorkflowStepBar, activeStepId, assigneeName, buildLaunch, canAssign, composeStepPrompt, composeWorkflowPrompt, defaultInputs, dependsOn, eventWaitingDocuments, fieldToFrontmatter, fillRunText, fillStepInputs, fromPlanAssignee, fromPlanDocumentRef, fromPlanSteps, initialRunInputs, inputsFromContext, isEmptyWorkflowScope, isIncompleteSignal, isPersonAction, isPersonStep, isRunFinished, isSteppedWorkflow, isWorkflowScope, layoutFromPlanSteps, nextAction, orderSteps, promptFieldName, reviewInstructions, runFields, runFieldsOf, runThreadTitle, sendBackTargets, skillToWorkflow, splitDocRef, stepConfigProblems, stepDependencies, stepFields, stepLevels, stepPhase, stepPillTone, stepStatesFromActivity, stepWindow, toPlanAssignee, toPlanDocumentRef, toPlanSteps, upstreamSteps, useWorkflowView, validateInputs, validateStep, validateWorkflowGraph, waitingDocuments, waitingForDocumentsText, workflowAccepts, workflowFromFrontmatter, workflowSteps, workflowsAccepting, workflowsForHost };
2809
- //# sourceMappingURL=chunk-CONIA2ZA.js.map
2810
- //# sourceMappingURL=chunk-CONIA2ZA.js.map
2909
+ //# sourceMappingURL=chunk-KHY4PYU7.js.map
2910
+ //# sourceMappingURL=chunk-KHY4PYU7.js.map