@voltro/workflow 0.69.1 → 0.71.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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, B as t, C as n, D as r, E as i, G as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, W as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, r as F, s as I, t as L, u as R, v as z, w as B, x as V, y as H, z as U } from "./primitives-CqHxfASq.js";
2
- import { $ as W, A as G, At as K, B as q, Bt as J, C as Y, Ct as X, D as Z, Dt as Q, E as $, Et as ee, F as te, Ft as ne, G as re, H as ie, I as ae, It as oe, J as se, K as ce, L as le, Lt as ue, M as de, Mt as fe, N as pe, Nt as me, O as he, Ot as ge, P as _e, Pt as ve, Q as ye, R as be, Rt as xe, S as Se, St as Ce, T as we, Tt as Te, U as Ee, V as De, Vt as Oe, W as ke, X as Ae, Y as je, Z as Me, _ as Ne, _t as Pe, a as Fe, at as Ie, b as Le, bt as Re, c as ze, ct as Be, d as Ve, dt as He, et as Ue, f as We, ft as Ge, g as Ke, gt as qe, h as Je, ht as Ye, i as Xe, it as Ze, j as Qe, jt as $e, k as et, kt as tt, l as nt, lt as rt, m as it, mt as at, n as ot, nt as st, o as ct, ot as lt, p as ut, pt as dt, q as ft, r as pt, rt as mt, s as ht, st as gt, t as _t, tt as vt, u as yt, ut as bt, v as xt, vt as St, w as Ct, wt, x as Tt, xt as Et, y as Dt, yt as Ot, z as kt, zt as At } from "./src-TRpoU54e.js";
3
- import { n as jt, r as Mt, t as Nt } from "./clusterDiagnostics-CNtl5LX9.js";
4
- export { mt as ADMISSIONS_TABLE, ut as BUDGET_HOLDS_TABLE, it as BudgetHoldExpired, ke as CANCEL_ON_WATERMARK, Nt as CLUSTER_REREAD_WINDOW_MS, jt as ClusterDiagnostics, l as CurrentWorkflowExecutionId, u as CurrentWorkflowPatches, B as CurrentWorkflowReplayShape, f as CurrentWorkflowRunId, Je as DEFAULT_BUDGET_HOLD_TIMEOUT_MS, re as DEFAULT_COLD_LOOKBACK_MS, be as DEFAULT_DRAIN_BATCH, ce as DEFAULT_EVENT_BATCH, Ze as DEFAULT_LEASE_MS, Xe as DEFAULT_MAX_RUN_RECLAIMS, Fe as DEFAULT_REPLAY_SHAPE_LIMIT, q as DEFAULT_STALL_AFTER_MS, De as DEFAULT_STALL_EVENT_LOOKBACK, ie as DEFAULT_STALL_RUN_PAGE, pe as DEFAULT_SUSPEND_HINT_MS, d as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, t as DEFERRING_CONTROLS, ft as EVENTS_TABLE, ee as FlowControlKeyError, Ie as PAUSES_TABLE, lt as PENDING_TABLE, se as WATERMARKS_TABLE, L as WorkflowFlowControlProperty, M as WorkflowMessagesProperty, s as WorkflowRunRecorder, k as WorkflowScheduleProperty, c as WorkflowStepInterceptorTag, F as WorkflowVersionTypeId, D as WorkflowWorkerLayerTypeId, Ke as _voltroBudgetHoldsTable, ve as _voltroWorkflowAdmissionsTable, ne as _voltroWorkflowPausesTable, oe as _voltroWorkflowPendingTable, xe as _voltroWorkflowRunEventsTable, At as _voltroWorkflowRunStepsTable, J as _voltroWorkflowRunsTable, ue as _voltroWorkflowStartContextsTable, Ue as _voltroWorkflowWatermarksTable, vt as admitStart, gt as allIntents, _ as assertConsistentPools, Qe as awaitEvent, de as awaitSignal, Ct as awaitSignalSuspending, We as awaitUpdate, Ne as budgetHoldGeneration, xt as budgetHoldKey, Dt as budgetHoldSignalName, pt as closeWorkflowChildrenForParent, Q as comparePendingOrder, we as completeSuspendingSignal, Be as deadLetterIntent, ge as decideAdmission, o as deferringControlsOf, rt as deleteIntent, Mt as describeStalledRun, bt as discardIntent, kt as drainTick, He as dueIntents, b as durableClock, N as durableQueue, I as durableQueueModule, S as durableRateLimiterModule, Ge as evaluateAdmission, p as getCurrentWorkflowExecutionId, U as getCurrentWorkflowRunId, A as getWorkflowFlowControl, e as getWorkflowSchedule, R as getWorkflowVersionMetadata, g as hasCancelOn, v as hasFlowControl, Le as heldBudgets, Oe as inMemoryWorkflowEngineLayer, ot as inspectWorkflow, tt as isFinishExpired, K as isStartExpired, C as isWorkflowWorkerLayer, st as linkExecution, _t as makeInMemoryRecorder, h as makeReplayShapeTracker, ct as makeWorkflowRunRecorder, Z as makeWorkflowUpdateId, _e as maybeHintSuspendingSignal, ye as newestEventAt, $e as nextSlotAt, i as nondeterminismEventPayload, ht as normaliseWorkflowPatches, dt as noteIntentAttempt, at as parkDelayedStart, w as patch, Ye as pauseWorkflow, Tt as pendingBudgetHolds, qe as pendingSlotId, Pe as pendingWindow, St as persistDefer, W as planCancellations, fe as pooledConcurrencyKey, P as processQueue, Ot as pruneAdmissions, j as queueWorker, E as rateLimit, Re as readAdmissionState, Et as readPausedWorkflows, je as readWatermark, Ce as recordAdmission, Se as releaseBudgetHolds, X as releaseLease, r as reportNondeterminism, te as resetSuspendHintsForTest, me as resolveAdmissionKeys, ze as resolveRunGuardTuning, ae as resolveSuspendHintMs, he as resolveWorkflowMessageRun, wt as resumeWorkflow, Te as retryDeadLetterIntent, et as sendWorkflowSignal, G as sendWorkflowUpdate, nt as serialiseWorkflowRowForWire, le as setSuspendSignalHintMs, T as sleep, y as sleepUntil, z as step, H as stepIdempotencyKey, x as stepModule, Y as suspendForBudget, $ as suspendingSignalDeferredName, Ae as sweepCancelOn, Ee as sweepStalledRuns, yt as truncateWorkflowValue, a as validateFlowControl, O as validateWorkflowSchedule, V as withCompensation, m as workflow, n as workflowModule, Ve as wrapWorkflowExecuteWithRunRecording, Me as writeWatermark };
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, K as c, L as l, M as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, W as v, _ as y, a as b, b as x, c as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, u as z, v as B, w as V, x as H, y as U, z as W } from "./primitives-DsMsMr5S.js";
2
+ import { $ as G, $t as K, A as q, At as J, B as Y, Bt as X, C as Z, Ct as Q, D as $, Dt as ee, E as te, Et as ne, F as re, Ft as ie, G as ae, Gt as oe, H as se, Ht as ce, I as le, It as ue, J as de, Jt as fe, K as pe, Kt as me, L as he, Lt as ge, M as _e, Mt as ve, N as ye, Nt as be, O as xe, Ot as Se, P as Ce, Pt as we, Q as Te, Qt as Ee, R as De, Rt as Oe, S as ke, St as Ae, T as je, Tt as Me, U as Ne, Ut as Pe, V as Fe, Vt as Ie, W as Le, Wt as Re, X as ze, Xt as Be, Y as Ve, Yt as He, Z as Ue, Zt as We, _ as Ge, _n as Ke, _t as qe, a as Je, an as Ye, at as Xe, b as Ze, bn as Qe, bt as $e, c as et, cn as tt, ct as nt, d as rt, dn as it, dt as at, en as ot, et as st, f as ct, fn as lt, ft as ut, g as dt, gn as ft, gt as pt, h as mt, hn as ht, ht as gt, i as _t, in as vt, it as yt, j as bt, jt as xt, k as St, kt as Ct, l as wt, ln as Tt, lt as Et, m as Dt, mn as Ot, mt as kt, n as At, nn as jt, nt as Mt, o as Nt, on as Pt, ot as Ft, p as It, pn as Lt, pt as Rt, q as zt, qt as Bt, r as Vt, rn as Ht, rt as Ut, s as Wt, sn as Gt, st as Kt, t as qt, tn as Jt, tt as Yt, u as Xt, un as Zt, ut as Qt, v as $t, vn as en, vt as tn, w as nn, wt as rn, x as an, xt as on, y as sn, yn as cn, yt as ln, z as un, zt as dn } from "./src-OEBqLBJl.js";
3
+ import { c as fn, l as pn, n as mn, p as hn, r as gn, s as _n, t as vn } from "./clusterDiagnostics-jpkNVay6.js";
4
+ export { ut as ADMISSIONS_TABLE, ct as BUDGET_HOLDS_TABLE, It as BudgetHoldExpired, Le as CANCEL_ON_WATERMARK, vn as CLUSTER_REREAD_WINDOW_MS, mn as ClusterDiagnostics, u as CurrentWorkflowExecutionId, f as CurrentWorkflowPatches, V as CurrentWorkflowReplayShape, a as CurrentWorkflowRunId, Dt as DEFAULT_BUDGET_HOLD_TIMEOUT_MS, ae as DEFAULT_COLD_LOOKBACK_MS, he as DEFAULT_DRAIN_BATCH, pe as DEFAULT_EVENT_BATCH, Rt as DEFAULT_LEASE_MS, qt as DEFAULT_MAX_RUN_RECLAIMS, At as DEFAULT_REPLAY_SHAPE_LIMIT, Y as DEFAULT_STALL_AFTER_MS, Fe as DEFAULT_STALL_EVENT_LOOKBACK, se as DEFAULT_STALL_RUN_PAGE, _e as DEFAULT_SUSPEND_HINT_MS, d as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, _ as DEFERRING_CONTROLS, zt as EVENTS_TABLE, Ee as FlowControlKeyError, kt as PAUSES_TABLE, gt as PENDING_TABLE, de as WATERMARKS_TABLE, R as WorkflowFlowControlProperty, M as WorkflowMessagesProperty, l as WorkflowRunRecorder, k as WorkflowScheduleProperty, p as WorkflowStepInterceptorTag, I as WorkflowVersionTypeId, D as WorkflowWorkerLayerTypeId, mt as _voltroBudgetHoldsTable, Gt as _voltroWorkflowAdmissionLocksTable, tt as _voltroWorkflowAdmissionsTable, Tt as _voltroWorkflowControlRequestsTable, Zt as _voltroWorkflowFailureReportsTable, it as _voltroWorkflowParentClosuresTable, lt as _voltroWorkflowPausesTable, Lt as _voltroWorkflowPendingTable, Ke as _voltroWorkflowRunEventsTable, en as _voltroWorkflowRunStepsTable, cn as _voltroWorkflowRunsTable, ft as _voltroWorkflowStartContextsTable, Ot as _voltroWorkflowStartReceiptsTable, ht as _voltroWorkflowSubmissionsTable, st as _voltroWorkflowWatermarksTable, De as acceptAdmissionSubmission, _n as acceptWorkflowControlInTransaction, X as acknowledgeAdmissionSubmission, Yt as admitStart, pt as allIntents, s as assertConsistentPools, q as awaitEvent, bt as awaitSignal, Z as awaitSignalSuspending, rt as awaitUpdate, Ie as beginAdmissionSubmissionDispatchInTransaction, fn as beginWorkflowControlDispatchInTransaction, pn as bindWorkflowResumeJournalInTransaction, ue as bindWorkflowStartReceipts, dt as budgetHoldGeneration, Ge as budgetHoldKey, $t as budgetHoldSignalName, Xe as cancelQueuedWorkflowStartInTransaction, nt as cancelSuspendedWorkflowRunInTransaction, K as comparePendingOrder, nn as completeSuspendingSignal, Et as completeWorkflowRunGenerationInTransaction, qe as deadLetterIntent, ot as decideAdmission, g as deferringControlsOf, tn as deleteIntent, gn as describeStalledRun, ln as discardIntent, $e as discardIntentInTransaction, un as drainTick, on as dueIntents, b as durableClock, N as durableQueue, L as durableQueueModule, S as durableRateLimiterModule, Qt as enterWorkflowRunGenerationInTransaction, Ae as evaluateAdmission, F as executePreparedWorkflow, W as getCurrentWorkflowExecutionId, t as getCurrentWorkflowRunId, A as getWorkflowFlowControl, e as getWorkflowSchedule, z as getWorkflowVersionMetadata, fe as handoffWorkflowFailureInTransaction, v as hasCancelOn, o as hasFlowControl, sn as heldBudgets, Qe as inMemoryWorkflowEngineLayer, Xt as inspectWorkflow, Jt as isFinishExpired, jt as isStartExpired, C as isWorkflowWorkerLayer, Mt as linkExecution, wt as makeInMemoryRecorder, h as makeReplayShapeTracker, Vt as makeWorkflowRunRecorder, te as makeWorkflowUpdateId, ye as maybeHintSuspendingSignal, Te as newestEventAt, Ht as nextSlotAt, i as nondeterminismEventPayload, _t as normaliseWorkflowPatches, ce as noteAdmissionSubmissionFailure, Q as noteIntentAttempt, rn as parkDelayedStart, w as patch, Me as pauseWorkflow, Pe as pendingAdmissionSubmissions, Ze as pendingBudgetHolds, ne as pendingSlotId, ee as pendingWindow, Se as persistDefer, G as planCancellations, vt as pooledConcurrencyKey, Re as prepareAdmissionSubmissionExecutionInTransaction, P as processQueue, Ct as pruneAdmissions, j as queueWorker, Kt as queuedCancellationRequestsTable, E as rateLimit, J as readAdmissionState, oe as readAdmissionSubmission, xt as readPausedWorkflows, Ft as readQueuedWorkflowCancellationInTransaction, Ve as readWatermark, hn as readWorkflowControlInTransaction, Be as readWorkflowFailureRecord, ge as readWorkflowStartReceipt, He as reconcileWorkflowFailureInTransaction, ve as recordAdmission, We as recordWorkflowFailureInTransaction, Oe as recordWorkflowStartReceipt, me as rejectAdmissionSubmissionInTransaction, an as releaseBudgetHolds, be as releaseLease, r as reportNondeterminism, Bt as reserveAdmissionSubmission, Ce as resetSuspendHintsForTest, Ye as resolveAdmissionKeys, Je as resolveRunGuardTuning, re as resolveSuspendHintMs, $ as resolveWorkflowMessageRun, dn as resolveWorkflowStartReceipt, we as resumeWorkflow, ie as retryDeadLetterIntent, xe as sendWorkflowSignal, St as sendWorkflowUpdate, Nt as serialiseWorkflowRowForWire, le as setSuspendSignalHintMs, T as sleep, y as sleepUntil, at as stageWorkflowParentClosureInTransaction, B as step, U as stepIdempotencyKey, x as stepModule, ke as suspendForBudget, je as suspendingSignalDeferredName, ze as sweepCancelOn, Ne as sweepStalledRuns, Ut as takeAdmittedSubmissionInTransaction, yt as takePendingAdmissionSubmission, Wt as truncateWorkflowValue, c as validateFlowControl, O as validateWorkflowSchedule, Pt as withAdmissionTransaction, H as withCompensation, m as workflow, n as workflowModule, et as wrapWorkflowExecuteWithRunRecording, Ue as writeWatermark };
@@ -1,45 +1,54 @@
1
- import { Activity as e, Activity as t, DurableClock as n, DurableClock as r, DurableQueue as i, DurableQueue as a, DurableRateLimiter as o, DurableRateLimiter as s, Workflow as c, Workflow as l } from "@effect/workflow";
2
- import { Cause as u, Context as d, Cron as f, Duration as p, Effect as m, Either as h, Exit as ee, FiberRef as g, Option as _, Schedule as v, Schema as y } from "effect";
3
- import { attachWorkflowAccess as te, resolveWorkflowAccess as ne } from "@voltro/protocol";
4
- //#region src/flowControl.ts
5
- var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0 || e.concurrency !== void 0 || e.throttle !== void 0 || e.rateLimit !== void 0 || e.batch !== void 0 || e.timeouts?.startMs !== void 0 || e.timeouts?.finishMs !== void 0), x = (e) => e?.cancelOn !== void 0 && e.cancelOn.length > 0, re = [
1
+ import { Activity as e, Activity as t, DurableClock as n, DurableClock as r, DurableQueue as i, DurableQueue as a, DurableRateLimiter as o, DurableRateLimiter as s, Workflow as c, Workflow as l, WorkflowEngine as u } from "@effect/workflow";
2
+ import { Cause as d, Context as f, Cron as p, Duration as m, Effect as h, Either as g, Exit as _, FiberRef as v, Option as ee, Schedule as y, Schema as b } from "effect";
3
+ import { attachWorkflowAccess as x, resolveWorkflowAccess as S } from "@voltro/protocol";
4
+ //#region src/preparedExecution.ts
5
+ var C = Symbol.for("@voltro/workflow/PreparedExecution"), te = (e, t) => {
6
+ Object.defineProperty(e, C, {
7
+ value: t,
8
+ enumerable: !0
9
+ });
10
+ }, ne = (e, t, n, r) => h.suspend(() => {
11
+ if (n.length === 0) return h.die(/* @__PURE__ */ Error("Prepared workflow execution requires a non-empty identity"));
12
+ let i = e[C];
13
+ return typeof i == "function" ? i(t, n, r?.discard ?? !0) : h.die(/* @__PURE__ */ Error("Workflow definition has no prepared-execution capability"));
14
+ }), re = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0 || e.concurrency !== void 0 || e.throttle !== void 0 || e.rateLimit !== void 0 || e.batch !== void 0 || e.timeouts?.startMs !== void 0 || e.timeouts?.finishMs !== void 0), ie = (e) => e?.cancelOn !== void 0 && e.cancelOn.length > 0, ae = [
6
15
  "debounce",
7
16
  "batch",
8
17
  "throttle",
9
18
  "concurrency"
10
- ], S = (e) => {
19
+ ], w = (e) => {
11
20
  if (e === void 0) return [];
12
21
  let t = [];
13
22
  return e.debounce !== void 0 && t.push("debounce"), e.batch !== void 0 && t.push("batch"), e.throttle !== void 0 && t.push("throttle"), e.concurrency !== void 0 && t.push("concurrency"), t;
14
- }, C = (e, t, n) => {
23
+ }, T = (e, t, n) => {
15
24
  let r;
16
25
  try {
17
- r = p.toMillis(p.decode(e));
26
+ r = m.toMillis(m.decode(e));
18
27
  } catch {
19
28
  throw Error(`workflow '${n}': ${t} is not a duration Effect can read (got ${JSON.stringify(e)}). Use a spelled-out unit ('15 minutes', '1 hour', '30 seconds'), a number of milliseconds, or a Duration — the abbreviated forms ('15m', '1h') are NOT accepted.`);
20
29
  }
21
30
  if (!Number.isFinite(r) || r <= 0) throw Error(`workflow '${n}': ${t} must be a positive finite duration, got ${String(e)}`);
22
31
  return r;
23
- }, w = (e, t, n) => {
32
+ }, E = (e, t, n) => {
24
33
  if (!Number.isInteger(e) || e <= 0) throw Error(`workflow '${n}': ${t} must be a positive integer, got ${String(e)}`);
25
34
  return e;
26
- }, T = (e, t, n) => {
35
+ }, D = (e, t, n) => {
27
36
  if (typeof e != "function") throw Error(`workflow '${n}': ${t} must be a function of the payload`);
28
37
  return e;
29
- }, E = (e) => {
38
+ }, O = (e) => {
30
39
  let t = e?.ast?.propertySignatures;
31
40
  if (!Array.isArray(t)) return !1;
32
41
  let n = t.find((e) => e.name === "items");
33
42
  return n !== void 0 && n.type?._tag === "TupleType";
34
- }, D = (e) => {
43
+ }, k = (e) => {
35
44
  let { workflowName: t, control: n } = e;
36
45
  if (n === void 0) return;
37
46
  let r = { workflowName: t };
38
47
  if (n.debounce !== void 0) {
39
- let e = n.debounce, i = C(e.period, "debounce.period", t), a = e.timeout === void 0 ? void 0 : C(e.timeout, "debounce.timeout", t);
48
+ let e = n.debounce, i = T(e.period, "debounce.period", t), a = e.timeout === void 0 ? void 0 : T(e.timeout, "debounce.timeout", t);
40
49
  if (a !== void 0 && a < i) throw Error(`workflow '${t}': debounce.timeout (${a}ms) is shorter than debounce.period (${i}ms), so the burst can never be collapsed — the run would be admitted before the quiet period could ever elapse. Raise the timeout or lower the period.`);
41
50
  r.debounce = {
42
- key: T(e.key, "debounce.key", t),
51
+ key: D(e.key, "debounce.key", t),
43
52
  periodMs: i,
44
53
  ...a === void 0 ? {} : { timeoutMs: a }
45
54
  };
@@ -48,7 +57,7 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
48
57
  let e = n.singleton;
49
58
  if (e.mode !== "skip" && e.mode !== "cancel") throw Error(`workflow '${t}': singleton.mode must be 'skip' or 'cancel'. There is no default — 'skip' discards the incoming request and 'cancel' discards the running one, and choosing for you would silently throw away work either way.`);
50
59
  r.singleton = {
51
- key: T(e.key, "singleton.key", t),
60
+ key: D(e.key, "singleton.key", t),
52
61
  mode: e.mode
53
62
  };
54
63
  }
@@ -56,34 +65,34 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
56
65
  let e = n.concurrency;
57
66
  if (e.pool !== void 0 && (typeof e.pool != "string" || e.pool.trim() === "")) throw Error(`workflow '${t}': concurrency.pool must be a non-empty name — it is the identity other workflows declare to share this budget, and an empty one would silently merge every empty-named pool in the deployment into one.`);
58
67
  r.concurrency = {
59
- limit: w(e.limit, "concurrency.limit", t),
60
- ...e.key === void 0 ? {} : { key: T(e.key, "concurrency.key", t) },
68
+ limit: E(e.limit, "concurrency.limit", t),
69
+ ...e.key === void 0 ? {} : { key: D(e.key, "concurrency.key", t) },
61
70
  ...e.pool === void 0 ? {} : { pool: e.pool.trim() }
62
71
  };
63
72
  }
64
73
  if (n.throttle !== void 0) {
65
74
  let e = n.throttle;
66
75
  r.throttle = {
67
- limit: w(e.limit, "throttle.limit", t),
68
- periodMs: C(e.period, "throttle.period", t),
69
- ...e.key === void 0 ? {} : { key: T(e.key, "throttle.key", t) }
76
+ limit: E(e.limit, "throttle.limit", t),
77
+ periodMs: T(e.period, "throttle.period", t),
78
+ ...e.key === void 0 ? {} : { key: D(e.key, "throttle.key", t) }
70
79
  };
71
80
  }
72
81
  if (n.rateLimit !== void 0) {
73
82
  let e = n.rateLimit;
74
83
  r.rateLimit = {
75
- limit: w(e.limit, "rateLimit.limit", t),
76
- periodMs: C(e.period, "rateLimit.period", t),
77
- ...e.key === void 0 ? {} : { key: T(e.key, "rateLimit.key", t) }
84
+ limit: E(e.limit, "rateLimit.limit", t),
85
+ periodMs: T(e.period, "rateLimit.period", t),
86
+ ...e.key === void 0 ? {} : { key: D(e.key, "rateLimit.key", t) }
78
87
  };
79
88
  }
80
89
  if (n.batch !== void 0) {
81
90
  let i = n.batch;
82
- if (e.payloadSchema !== void 0 && !E(e.payloadSchema)) throw Error(`workflow '${t}': batch is declared, so the workflow's own \`payload\` must be the BATCH shape — \`Schema.Struct({ items: Schema.Array(Item) })\` — while callers start it with a SINGLE item. Declare the item's schema as \`batch.item\`. Checked here rather than at admission because a decode failure on the batching replica is a failure nobody is watching.`);
91
+ if (e.payloadSchema !== void 0 && !O(e.payloadSchema)) throw Error(`workflow '${t}': batch is declared, so the workflow's own \`payload\` must be the BATCH shape — \`Schema.Struct({ items: Schema.Array(Item) })\` — while callers start it with a SINGLE item. Declare the item's schema as \`batch.item\`. Checked here rather than at admission because a decode failure on the batching replica is a failure nobody is watching.`);
83
92
  r.batch = {
84
- ...i.key === void 0 ? {} : { key: T(i.key, "batch.key", t) },
85
- maxSize: w(i.maxSize, "batch.maxSize", t),
86
- timeoutMs: C(i.timeout, "batch.timeout", t),
93
+ ...i.key === void 0 ? {} : { key: D(i.key, "batch.key", t) },
94
+ maxSize: E(i.maxSize, "batch.maxSize", t),
95
+ timeoutMs: T(i.timeout, "batch.timeout", t),
87
96
  ...i.item === void 0 ? {} : { item: i.item }
88
97
  };
89
98
  }
@@ -92,7 +101,7 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
92
101
  r.priority = n.priority;
93
102
  }
94
103
  if (n.timeouts !== void 0) {
95
- let e = n.timeouts, i = e.start === void 0 ? void 0 : C(e.start, "timeouts.start", t), a = e.finish === void 0 ? void 0 : C(e.finish, "timeouts.finish", t);
104
+ let e = n.timeouts, i = e.start === void 0 ? void 0 : T(e.start, "timeouts.start", t), a = e.finish === void 0 ? void 0 : T(e.finish, "timeouts.finish", t);
96
105
  (i !== void 0 || a !== void 0) && (r.timeouts = {
97
106
  ...i === void 0 ? {} : { startMs: i },
98
107
  ...a === void 0 ? {} : { finishMs: a }
@@ -112,7 +121,7 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
112
121
  if (typeof e?.event != "string" || e.event.length === 0) throw Error(`workflow '${t}': ${r}.event must be a non-empty event name, exactly as ctx.events.publish writes it.`);
113
122
  if (e.schema === void 0 || typeof e.schema.ast != "object") throw Error(`workflow '${t}': ${r}.schema must be a Schema for the event payload. It is decoded before \`match\` runs, so the predicate reads the domain type rather than raw JSON.`);
114
123
  if (typeof e.match != "function") throw Error(`workflow '${t}': ${r}.match is required. Omitting it would mean "cancel every live run of this workflow whenever '${e.event}' is published" — write \`match: () => true\` if that is what you mean, so it is visible in review.`);
115
- let i = e.within === void 0 ? void 0 : C(e.within, `${r}.within`, t);
124
+ let i = e.within === void 0 ? void 0 : T(e.within, `${r}.within`, t);
116
125
  return {
117
126
  event: e.event,
118
127
  schema: e.schema,
@@ -123,9 +132,9 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
123
132
  });
124
133
  e.length > 0 && (r.cancelOn = e);
125
134
  }
126
- if (r.timeouts?.startMs !== void 0 && S(r).length === 0) throw Error(`workflow '${t}': timeouts.start bounds how long a run may sit in the ADMISSION queue, but this workflow declares no control that can defer one (debounce, batch, throttle, concurrency). It would never fire. Use timeouts.finish to bound the run itself.`);
135
+ if (r.timeouts?.startMs !== void 0 && w(r).length === 0) throw Error(`workflow '${t}': timeouts.start bounds how long a run may sit in the ADMISSION queue, but this workflow declares no control that can defer one (debounce, batch, throttle, concurrency). It would never fire. Use timeouts.finish to bound the run itself.`);
127
136
  return r;
128
- }, O = (e) => {
137
+ }, oe = (e) => {
129
138
  let t = /* @__PURE__ */ new Map();
130
139
  for (let n of e) {
131
140
  let e = n?.concurrency;
@@ -138,25 +147,25 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
138
147
  else if (r.limit !== e.limit) throw Error(`concurrency pool '${e.pool}': '${n.workflowName}' declares limit ${e.limit}, but ${r.workflows.map((e) => `'${e}'`).join(", ")} declare${r.workflows.length === 1 ? "s" : ""} limit ${r.limit}. A pool is ONE budget — every member must declare the same number, or the enforced limit would depend on which workflow's start arrived first. Align the limits, or give the workflows different pool names if they were never meant to share.`);
139
148
  else r.workflows.push(n.workflowName);
140
149
  }
141
- }, k = class extends d.Tag("@voltro/WorkflowRunRecorder")() {}, A = g.unsafeMake(void 0), j = g.unsafeMake(void 0), M = g.unsafeMake(void 0), N = g.unsafeMake([]), P = () => g.get(A), ie = () => g.get(j), F = class extends d.Tag("@voltro/WorkflowStepInterceptor")() {}, I = 864e5, ae = /* @__PURE__ */ new Set([
150
+ }, A = class extends f.Tag("@voltro/WorkflowRunRecorder")() {}, j = v.unsafeMake(void 0), M = v.unsafeMake(void 0), se = v.unsafeMake(void 0), N = v.unsafeMake(void 0), P = v.unsafeMake([]), ce = () => v.get(j), le = () => v.get(M), F = class extends f.Tag("@voltro/WorkflowStepInterceptor")() {}, I = 864e5, L = /* @__PURE__ */ new Set([
142
151
  "skip",
143
152
  "buffer",
144
153
  "cancelOther"
145
- ]), L = /* @__PURE__ */ new Set([
154
+ ]), R = /* @__PURE__ */ new Set([
146
155
  "skip",
147
156
  "latest",
148
157
  "all"
149
- ]), R = (e, t) => {
158
+ ]), z = (e, t) => {
150
159
  if (t === void 0) return;
151
160
  if (typeof t.timezone != "string" || t.timezone.trim() === "") throw Error(`workflow '${e}': schedule.timezone is required (e.g. "UTC", "Europe/Berlin") — never server-local, which differs between your machine and the container.`);
152
- let n = f.parse(t.cron, t.timezone);
153
- if (h.isLeft(n)) throw Error(`workflow '${e}': schedule.cron "${t.cron}" (tz="${t.timezone}") is not a valid cron expression — ${String(n.left)}`);
161
+ let n = p.parse(t.cron, t.timezone);
162
+ if (g.isLeft(n)) throw Error(`workflow '${e}': schedule.cron "${t.cron}" (tz="${t.timezone}") is not a valid cron expression — ${String(n.left)}`);
154
163
  let r = t.onOverlap ?? "skip";
155
- if (!ae.has(r)) throw Error(`workflow '${e}': schedule.onOverlap must be 'skip' | 'buffer' | 'cancelOther', got ${JSON.stringify(r)}`);
164
+ if (!L.has(r)) throw Error(`workflow '${e}': schedule.onOverlap must be 'skip' | 'buffer' | 'cancelOther', got ${JSON.stringify(r)}`);
156
165
  let i = t.backfill ?? "skip";
157
- if (!L.has(i)) throw Error(`workflow '${e}': schedule.backfill must be 'skip' | 'latest' | 'all', got ${JSON.stringify(i)}`);
166
+ if (!R.has(i)) throw Error(`workflow '${e}': schedule.backfill must be 'skip' | 'latest' | 'all', got ${JSON.stringify(i)}`);
158
167
  let a = I;
159
- return t.maxRuntime !== void 0 && (a = z(t.maxRuntime, e)), {
168
+ return t.maxRuntime !== void 0 && (a = B(t.maxRuntime, e)), {
160
169
  cron: t.cron,
161
170
  timezone: t.timezone,
162
171
  ...t.payload === void 0 ? {} : { payload: t.payload },
@@ -164,20 +173,20 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
164
173
  backfill: i,
165
174
  maxRuntimeMs: a
166
175
  };
167
- }, z = (e, t) => {
176
+ }, B = (e, t) => {
168
177
  let n;
169
178
  try {
170
- n = p.toMillis(p.decode(e));
179
+ n = m.toMillis(m.decode(e));
171
180
  } catch {
172
181
  throw Error(`workflow '${t}': schedule.maxRuntime is not a duration Effect can read (got ${JSON.stringify(e)}). Use '2 hours', a number of milliseconds, or a Duration.`);
173
182
  }
174
183
  if (!Number.isFinite(n) || n <= 0) throw Error(`workflow '${t}': schedule.maxRuntime must be a positive finite duration`);
175
184
  return n;
176
- }, B = "__voltroWorkflowSchedule", V = (e) => {
185
+ }, V = "__voltroWorkflowSchedule", H = (e) => {
177
186
  if (typeof e != "object" || !e) return;
178
- let t = e[B];
187
+ let t = e[V];
179
188
  return t === void 0 ? void 0 : t;
180
- }, H = (e) => {
189
+ }, U = (e) => {
181
190
  let t = /* @__PURE__ */ new Map();
182
191
  for (let n of e) t.set(n.stepName, (t.get(n.stepName) ?? 0) + 1);
183
192
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = (e) => !r.has(e) && (r.add(e), !0);
@@ -206,80 +215,90 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
206
215
  return e;
207
216
  }
208
217
  };
209
- }, U = g.unsafeMake(void 0), W = (e) => ({
218
+ }, W = v.unsafeMake(void 0), G = (e) => ({
210
219
  kind: e.kind,
211
220
  stepName: e.stepName,
212
221
  recorded: e.recorded,
213
222
  reached: e.reached,
214
223
  detail: e.detail
215
- }), G = (e) => m.gen(function* () {
224
+ }), K = (e) => h.gen(function* () {
216
225
  if (e.length === 0) return;
217
- let t = yield* g.get(A), n = yield* m.serviceOption(k);
226
+ let t = yield* v.get(j), n = yield* h.serviceOption(A);
218
227
  if (t === void 0 || n._tag !== "Some") return;
219
228
  let r = n.value;
220
- for (let n of e) yield* m.promise(() => r.recordEvent({
229
+ for (let n of e) yield* h.promise(() => r.recordEvent({
221
230
  runId: t,
222
231
  eventType: "nondeterminism-suspected",
223
- payload: W(n)
232
+ payload: G(n)
224
233
  }).then(() => void 0).catch(() => void 0));
225
- }), K = (e) => {
234
+ }), ue = (e) => {
226
235
  if (typeof e != "object" || !e) return;
227
236
  let t = e.retryAfterMillis;
228
- if (typeof t == "number" && Number.isFinite(t) && t >= 0) return p.millis(t);
237
+ if (typeof t == "number" && Number.isFinite(t) && t >= 0) return m.millis(t);
229
238
  let n = e.retryAfter;
230
- if (typeof n == "number" && Number.isFinite(n) && n >= 0) return p.seconds(n);
231
- }, q = (e) => p.decode(e), J = (e) => typeof e == "object" && e && "_tag" in e ? String(e._tag) : void 0, oe = (e) => e !== void 0 && (e.maxAttempts ?? 3) > 1, se = (e) => {
239
+ if (typeof n == "number" && Number.isFinite(n) && n >= 0) return m.seconds(n);
240
+ }, q = (e) => m.decode(e), de = (e) => typeof e == "object" && e && "_tag" in e ? String(e._tag) : void 0, fe = (e) => e !== void 0 && (e.maxAttempts ?? 3) > 1, pe = (e) => {
232
241
  if (e.retryable) return e.retryable;
233
242
  if (e.retryableErrors && e.retryableErrors.length > 0) {
234
243
  let t = new Set(e.retryableErrors);
235
244
  return (e) => {
236
- let n = J(e);
245
+ let n = de(e);
237
246
  return n !== void 0 && t.has(n);
238
247
  };
239
248
  }
240
249
  return () => !0;
241
- }, ce = (e) => {
242
- let t = e.baseDelay ?? "200 millis", n = e.strategy ?? "exponential", r = e.maxAttempts ?? 3, i = n === "linear" ? v.linear(q(e.step ?? t)) : n === "fixed" ? v.spaced(q(t)) : v.exponential(q(t), e.factor ?? 2);
250
+ }, me = (e) => {
251
+ let t = e.baseDelay ?? "200 millis", n = e.strategy ?? "exponential", r = e.maxAttempts ?? 3, i = n === "linear" ? y.linear(q(e.step ?? t)) : n === "fixed" ? y.spaced(q(t)) : y.exponential(q(t), e.factor ?? 2);
243
252
  if (e.maxDelay !== void 0) {
244
253
  let t = q(e.maxDelay);
245
- i = v.modifyDelay(i, (e, n) => p.min(n, t));
254
+ i = y.modifyDelay(i, (e, n) => m.min(n, t));
246
255
  }
247
- (e.jitter ?? !0) === !0 && (i = v.jittered(i));
248
- let a = v.intersect(i, v.recurs(Math.max(0, r - 1)));
249
- return e.maxElapsed !== void 0 && (a = v.upTo(q(e.maxElapsed))(a)), a;
250
- }, le = (e, t) => {
251
- let n = p.toMillis(q(e.baseDelay ?? "200 millis")), r = e.strategy ?? "exponential", i = r === "fixed" ? n : r === "linear" ? n + p.toMillis(q(e.step ?? e.baseDelay ?? "200 millis")) * (t - 1) : n * (e.factor ?? 2) ** (t - 1);
252
- return e.maxDelay !== void 0 && (i = Math.min(i, p.toMillis(q(e.maxDelay)))), (e.jitter ?? !0) === !0 && (i *= Math.random()), i;
253
- }, ue = (e, t, n, r) => m.gen(function* () {
254
- let i = t.maxAttempts ?? 3, a = t.maxElapsed === void 0 ? Infinity : p.toMillis(q(t.maxElapsed)), o = yield* m.sync(() => Date.now()), s = 0;
256
+ (e.jitter ?? !0) === !0 && (i = y.jittered(i));
257
+ let a = y.intersect(i, y.recurs(Math.max(0, r - 1)));
258
+ return e.maxElapsed !== void 0 && (a = y.upTo(q(e.maxElapsed))(a)), a;
259
+ }, he = (e, t) => {
260
+ let n = m.toMillis(q(e.baseDelay ?? "200 millis")), r = e.strategy ?? "exponential", i = r === "fixed" ? n : r === "linear" ? n + m.toMillis(q(e.step ?? e.baseDelay ?? "200 millis")) * (t - 1) : n * (e.factor ?? 2) ** (t - 1);
261
+ return e.maxDelay !== void 0 && (i = Math.min(i, m.toMillis(q(e.maxDelay)))), (e.jitter ?? !0) === !0 && (i *= Math.random()), i;
262
+ }, ge = (e, t, n, r) => h.gen(function* () {
263
+ let i = t.maxAttempts ?? 3, a = t.maxElapsed === void 0 ? Infinity : m.toMillis(q(t.maxElapsed)), o = yield* h.sync(() => Date.now()), s = 0;
255
264
  for (;;) {
256
- let c = yield* m.exit(e);
257
- if (ee.isSuccess(c)) return c.value;
258
- let l = c.cause, d = u.failureOption(l), f = _.isSome(d) ? d.value : u.squash(l);
265
+ let c = yield* h.exit(e);
266
+ if (_.isSuccess(c)) return c.value;
267
+ let l = c.cause, u = d.failureOption(l), f = ee.isSome(u) ? u.value : d.squash(l);
259
268
  s += 1;
260
- let h = (yield* m.sync(() => Date.now())) - o;
261
- if (s >= i || !n(f) || h >= a) return yield* m.failCause(l);
269
+ let p = (yield* h.sync(() => Date.now())) - o;
270
+ if (s >= i || !n(f) || p >= a) return yield* h.failCause(l);
262
271
  r?.(f);
263
- let g = K(f), v = g === void 0 ? le(t, s) : p.toMillis(g);
264
- yield* m.sleep(p.millis(v));
272
+ let g = ue(f), v = g === void 0 ? he(t, s) : m.toMillis(g);
273
+ yield* h.sleep(m.millis(v));
265
274
  }
266
- }), de = (e, t, n) => {
267
- if (!oe(t)) return e;
268
- let r = se(t);
269
- if (t.respectRetryAfter === !0) return ue(e, t, r, n);
270
- let i = ce(t), a = n ? m.tapError(e, (e) => m.sync(() => {
275
+ }), _e = (e, t, n) => {
276
+ if (!fe(t)) return e;
277
+ let r = pe(t);
278
+ if (t.respectRetryAfter === !0) return ge(e, t, r, n);
279
+ let i = me(t), a = n ? h.tapError(e, (e) => h.sync(() => {
271
280
  r(e) && n(e);
272
281
  })) : e;
273
- return m.retry(a, {
282
+ return h.retry(a, {
274
283
  schedule: i,
275
284
  while: r
276
285
  });
277
- }, Y = Symbol.for("voltro.workflow.workerLayer"), X = Symbol.for("voltro.workflow.version"), Z = "__voltroWorkflowMessages", Q = "__voltroWorkflowFlowControl", fe = (e) => typeof e == "object" && !!e && e[Y] === !0, pe = (e) => typeof e == "object" && e && e[X] !== void 0 ? e[X] : {
286
+ }, J = Symbol.for("voltro.workflow.workerLayer"), Y = Symbol.for("voltro.workflow.version"), X = "__voltroWorkflowMessages", Z = "__voltroWorkflowFlowControl", ve = (e) => typeof e == "object" && !!e && e[J] === !0, ye = (e) => typeof e == "object" && e && e[Y] !== void 0 ? e[Y] : {
278
287
  version: "1",
279
288
  compatibleWith: ["1"],
280
289
  patches: []
281
- }, me = ((e) => {
282
- let t = c.make(e), n = e.suspendOnFailure === !0 ? t.annotate(c.SuspendOnFailure, !0) : t, r = String(e.version ?? "1"), i = {
290
+ }, be = ((e) => {
291
+ let t = c.make(e), n = e.suspendOnFailure === !0 ? t.annotate(c.SuspendOnFailure, !0) : t;
292
+ te(n, (t, r, i) => h.gen(function* () {
293
+ let a = n.payloadSchema.make(t), o = yield* u.WorkflowEngine;
294
+ return yield* h.annotateCurrentSpan({ executionId: r }), yield* o.execute(n, {
295
+ executionId: r,
296
+ payload: a,
297
+ discard: i,
298
+ suspendedRetrySchedule: e.suspendedRetrySchedule
299
+ });
300
+ }).pipe(h.withSpan(`${e.name}.execute`, { captureStackTrace: !1 })));
301
+ let r = String(e.version ?? "1"), i = {
283
302
  version: r,
284
303
  compatibleWith: (e.compatibleWith ?? [r]).map(String),
285
304
  patches: [...e.patches ?? []]
@@ -287,42 +306,42 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
287
306
  signals: { ...e.messages?.signals ?? {} },
288
307
  updates: { ...e.messages?.updates ?? {} }
289
308
  };
290
- Object.defineProperty(n, X, {
309
+ Object.defineProperty(n, Y, {
291
310
  value: i,
292
311
  enumerable: !1
293
- }), Object.defineProperty(n, Z, {
312
+ }), Object.defineProperty(n, X, {
294
313
  value: a,
295
314
  enumerable: !1
296
- }), te(n, ne(e.name, e));
297
- let o = D({
315
+ }), x(n, S(e.name, e));
316
+ let o = k({
298
317
  workflowName: e.name,
299
318
  payloadSchema: e.payload,
300
319
  control: e
301
320
  });
302
- o !== void 0 && Object.defineProperty(n, Q, {
321
+ o !== void 0 && Object.defineProperty(n, Z, {
303
322
  value: o,
304
323
  enumerable: !1
305
324
  });
306
- let s = R(e.name, e.schedule);
307
- return s !== void 0 && Object.defineProperty(n, B, {
325
+ let s = z(e.name, e.schedule);
326
+ return s !== void 0 && Object.defineProperty(n, V, {
308
327
  value: s,
309
328
  enumerable: !1
310
329
  }), n;
311
- }), he = (e) => {
330
+ }), xe = (e) => {
312
331
  if (typeof e != "object" || !e) return;
313
- let t = e[Q];
332
+ let t = e[Z];
314
333
  return t === void 0 ? void 0 : t;
315
- }, ge = i.make, _e = i.process, ve = ((...e) => {
334
+ }, Q = i.make, Se = i.process, Ce = ((...e) => {
316
335
  let t = i.worker(...e);
317
- return Object.defineProperty(t, Y, {
336
+ return Object.defineProperty(t, J, {
318
337
  value: !0,
319
338
  enumerable: !1
320
339
  }), t;
321
- }), ye = o.rateLimit, $ = (e) => m.gen(function* () {
322
- let t = yield* A, r = yield* m.serviceOption(k), i = p.toMillis(p.decode(e.duration));
340
+ }), we = o.rateLimit, $ = (e) => h.gen(function* () {
341
+ let t = yield* j, r = yield* h.serviceOption(A), i = m.toMillis(m.decode(e.duration));
323
342
  if (t !== void 0 && r._tag === "Some") {
324
- let a = r.value, o = new Date(Date.now() + i).toISOString(), s = yield* M;
325
- yield* m.promise(() => a.recordEvent({
343
+ let a = r.value, o = new Date(Date.now() + i).toISOString(), s = yield* N;
344
+ yield* h.promise(() => a.recordEvent({
326
345
  runId: t,
327
346
  eventType: "timer-set",
328
347
  payload: {
@@ -333,7 +352,7 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
333
352
  }
334
353
  }).catch(() => {}));
335
354
  let c = Date.now();
336
- yield* n.sleep(e), yield* m.promise(() => a.recordEvent({
355
+ yield* n.sleep(e), yield* h.promise(() => a.recordEvent({
337
356
  runId: t,
338
357
  eventType: "timer-fired",
339
358
  payload: {
@@ -345,27 +364,27 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
345
364
  return;
346
365
  }
347
366
  yield* n.sleep(e);
348
- }), be = (t) => m.gen(function* () {
367
+ }), Te = (t) => h.gen(function* () {
349
368
  let n = (yield* e.make({
350
369
  name: `sleepUntil:${t.name}`,
351
- success: y.Number,
352
- execute: m.sync(() => t.until instanceof Date ? t.until.getTime() : t.until)
370
+ success: b.Number,
371
+ execute: h.sync(() => t.until instanceof Date ? t.until.getTime() : t.until)
353
372
  })) - Date.now();
354
373
  n <= 0 || (yield* $({
355
374
  name: t.name,
356
375
  duration: `${n} millis`
357
376
  }));
358
- }), xe = (t, n, r, i) => m.gen(function* () {
359
- let a = yield* A, o = yield* e.CurrentAttempt, s = yield* m.serviceOption(k), c = yield* m.serviceOption(F), l = c._tag === "Some" ? c.value.interceptor(n, {
377
+ }), Ee = (t, n, r, i) => h.gen(function* () {
378
+ let a = yield* j, o = yield* e.CurrentAttempt, s = yield* h.serviceOption(A), c = yield* h.serviceOption(F), l = c._tag === "Some" ? c.value.interceptor(n, {
360
379
  runId: a ?? "unrecorded",
361
380
  stepName: t,
362
381
  attempt: o
363
- }) : n, d, f;
382
+ }) : n, u, f;
364
383
  if (a !== void 0 && s._tag === "Some") {
365
384
  f = s.value;
366
385
  let e = i === void 0 ? void 0 : (({ retryable: e, ...t }) => t)(i);
367
386
  try {
368
- d = yield* m.promise(() => f.startStep({
387
+ u = yield* h.promise(() => f.startStep({
369
388
  runId: a,
370
389
  stepName: t,
371
390
  attempt: o,
@@ -373,51 +392,51 @@ var b = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
373
392
  ...e === void 0 ? {} : { retryPolicy: e }
374
393
  }));
375
394
  } catch {
376
- d = void 0;
395
+ u = void 0;
377
396
  }
378
397
  }
379
398
  let p = Date.now();
380
- return yield* de(l, i).pipe(m.tap((e) => d && f ? m.promise(async () => {
399
+ return yield* _e(l, i).pipe(h.tap((e) => u && f ? h.promise(async () => {
381
400
  try {
382
401
  await f.endStepSuccess({
383
- stepRecordId: d,
402
+ stepRecordId: u,
384
403
  output: e,
385
404
  durationMs: Date.now() - p
386
405
  });
387
406
  } catch {}
388
- }) : m.void), m.tapErrorCause((e) => d && f && !u.isInterruptedOnly(e) ? m.promise(async () => {
407
+ }) : h.void), h.tapErrorCause((e) => u && f && !d.isInterruptedOnly(e) ? h.promise(async () => {
389
408
  try {
390
- let t = u.failureOption(e), n = Array.from(u.failures(e)), r = Array.from(u.defects(e)), i = t._tag === "Some" ? t.value : r[0] ?? u.squash(e), a = i?.message ?? String(i), o = i && typeof i == "object" && "_tag" in i ? String(i._tag) : null;
409
+ let t = d.failureOption(e), n = Array.from(d.failures(e)), r = Array.from(d.defects(e)), i = t._tag === "Some" ? t.value : r[0] ?? d.squash(e), a = i?.message ?? String(i), o = i && typeof i == "object" && "_tag" in i ? String(i._tag) : null;
391
410
  await f.endStepFailure({
392
- stepRecordId: d,
411
+ stepRecordId: u,
393
412
  errorTag: o,
394
413
  errorMessage: a,
395
414
  errorCause: {
396
- pretty: u.pretty(e),
415
+ pretty: d.pretty(e),
397
416
  failures: n,
398
417
  defects: r
399
418
  },
400
419
  durationMs: Date.now() - p
401
420
  });
402
421
  } catch {}
403
- }) : m.void));
404
- }), Se = (e) => m.gen(function* () {
405
- let t = yield* g.get(U);
422
+ }) : h.void));
423
+ }), De = (e) => h.gen(function* () {
424
+ let t = yield* v.get(W);
406
425
  if (t === void 0) return;
407
426
  let n = t.reach(e);
408
- n !== void 0 && (yield* G([n]));
409
- }), Ce = (e, t) => {
427
+ n !== void 0 && (yield* K([n]));
428
+ }), Oe = (e, t) => {
410
429
  let n = e;
411
430
  return {
412
431
  ...e,
413
- commit: () => m.zipRight(Se(t), n)
432
+ commit: () => h.zipRight(De(t), n)
414
433
  };
415
- }, we = (t) => {
434
+ }, ke = (t) => {
416
435
  let { input: n, retry: r, ...i } = t;
417
- return Ce(e.make({
436
+ return Oe(e.make({
418
437
  ...i,
419
- execute: xe(i.name, i.execute, n, r)
438
+ execute: Ee(i.name, i.execute, n, r)
420
439
  }), i.name);
421
- }, Te = (e) => m.map(g.get(N), (t) => t.includes(e)), Ee = c.withCompensation, De = e.idempotencyKey;
440
+ }, Ae = (e) => h.map(v.get(P), (t) => t.includes(e)), je = c.withCompensation, Me = e.idempotencyKey;
422
441
  //#endregion
423
- export { V as A, re as B, l as C, G as D, W as E, M as F, D as G, S as H, k as I, F as L, j as M, N, I as O, A as P, ie as R, me as S, H as T, x as U, O as V, b as W, be as _, r as a, t as b, s as c, fe as d, Te as f, $ as g, ye as h, Y as i, R as j, B as k, he as l, ve as m, Z as n, ge as o, _e as p, X as r, a as s, Q as t, pe as u, we as v, U as w, Ee as x, De as y, P as z };
442
+ export { H as A, ce as B, l as C, K as D, G as E, j as F, re as G, oe as H, N as I, k as K, A as L, M, se as N, I as O, P, F as R, be as S, U as T, w as U, ae as V, ie as W, Te as _, r as a, t as b, s as c, ve as d, Ae as f, $ as g, we as h, J as i, z as j, V as k, xe as l, Ce as m, X as n, Q as o, Se as p, ne as q, Y as r, a as s, Z as t, ye as u, ke as v, W as w, je as x, Me as y, le as z };
@@ -1,2 +1,2 @@
1
- import { A as e, B as t, C as n, D as r, E as i, G as a, H as o, O as s, S as c, T as l, U as u, V as d, W as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "./primitives-CqHxfASq.js";
2
- export { P as CurrentWorkflowReplayShape, s as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, t as DEFERRING_CONTROLS, j as WorkflowFlowControlProperty, E as WorkflowMessagesProperty, C as WorkflowScheduleProperty, k as WorkflowVersionTypeId, x as WorkflowWorkerLayerTypeId, d as assertConsistentPools, o as deferringControlsOf, m as durableClock, D as durableQueue, A as durableQueueModule, g as durableRateLimiterModule, w as getWorkflowFlowControl, e as getWorkflowSchedule, M as getWorkflowVersionMetadata, u as hasCancelOn, f as hasFlowControl, _ as isWorkflowWorkerLayer, l as makeReplayShapeTracker, i as nondeterminismEventPayload, v as patch, O as processQueue, T as queueWorker, b as rateLimit, r as reportNondeterminism, y as sleep, p as sleepUntil, N as step, I as stepIdempotencyKey, h as stepModule, a as validateFlowControl, S as validateWorkflowSchedule, F as withCompensation, c as workflow, n as workflowModule };
1
+ import { A as e, C as t, D as n, E as r, G as i, H as a, K as o, O as s, S as c, T as l, U as u, V as d, W as f, _ as p, a as m, b as h, c as g, d as _, f as v, g as y, h as b, i as x, j as S, k as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "./primitives-DsMsMr5S.js";
2
+ export { P as CurrentWorkflowReplayShape, s as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, d as DEFERRING_CONTROLS, j as WorkflowFlowControlProperty, E as WorkflowMessagesProperty, C as WorkflowScheduleProperty, k as WorkflowVersionTypeId, x as WorkflowWorkerLayerTypeId, a as assertConsistentPools, u as deferringControlsOf, m as durableClock, D as durableQueue, A as durableQueueModule, g as durableRateLimiterModule, w as getWorkflowFlowControl, e as getWorkflowSchedule, M as getWorkflowVersionMetadata, f as hasCancelOn, i as hasFlowControl, _ as isWorkflowWorkerLayer, l as makeReplayShapeTracker, r as nondeterminismEventPayload, v as patch, O as processQueue, T as queueWorker, b as rateLimit, n as reportNondeterminism, y as sleep, p as sleepUntil, N as step, I as stepIdempotencyKey, h as stepModule, o as validateFlowControl, S as validateWorkflowSchedule, F as withCompensation, c as workflow, t as workflowModule };