@voltro/workflow 0.82.0 → 0.83.1

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.
@@ -1,13 +1,14 @@
1
- import { _ as e, a as t, b as n, c as r, l as i, m as a, n as o, p as s, s as c, t as l, x as u } from "./clusterDiagnostics-Dc7yBP3b.js";
2
- import { Context as d, Duration as f, Effect as p, Layer as m, Option as h, Runtime as g, Schema as _ } from "effect";
3
- import { eq as v } from "@voltro/database";
4
- import { SqlClient as y } from "@effect/sql";
5
- import { ClusterCron as ee, ClusterSchema as te, ClusterWorkflowEngine as b, EntityAddress as ne, EntityId as re, EntityType as ie, MessageStorage as x, RunnerAddress as S, ShardId as ae, Sharding as C, ShardingConfig as oe, SingleRunner as se, SqlMessageStorage as ce, SqlRunnerStorage as le } from "@effect/cluster";
6
- import { applyUndeclaredCharsetWork as ue, fnv1a64 as w, readUndeclaredCharsetColumns as de, resolveMigrationLockSchema as T, sqlPoolCapacity as fe, undeclaredCharsetWork as pe } from "@voltro/database/sql";
1
+ import { _ as e, a as t, b as n, c as r, l as i, m as a, n as o, p as s, s as c, t as l, x as u } from "./clusterDiagnostics-CGUtnJkX.js";
2
+ import { Context as d, Duration as f, Effect as p, Layer as m, Option as h, Runtime as g, Schedule as _, Schema as v } from "effect";
3
+ import { eq as y } from "@voltro/database";
4
+ import { SqlClient as b } from "@effect/sql";
5
+ import { ClusterCron as ee, ClusterSchema as te, ClusterWorkflowEngine as x, EntityAddress as ne, EntityId as re, EntityType as ie, MessageStorage as S, RunnerAddress as C, RunnerHealth as ae, RunnerStorage as w, Runners as oe, ShardId as se, Sharding as T, ShardingConfig as ce, SingleRunner as le, SqlMessageStorage as E, SqlRunnerStorage as D } from "@effect/cluster";
6
+ import { applyUndeclaredCharsetWork as ue, fnv1a64 as O, readUndeclaredCharsetColumns as de, resolveMigrationLockSchema as k, sqlPoolCapacity as fe, undeclaredCharsetWork as pe } from "@voltro/database/sql";
7
7
  import { realpath as me } from "node:fs/promises";
8
8
  import { createLogger as he } from "@voltro/logger";
9
+ import { PersistenceError as ge } from "@effect/cluster/ClusterError";
9
10
  //#region src/workflowResumeDispatch.ts
10
- var ge = (e) => p.gen(function* () {
11
+ var _e = (e) => p.gen(function* () {
11
12
  let t = yield* p.runtime(), r = yield* p.promise(() => e.transaction((n) => u(n, e.requestId, (e) => g.runPromise(t)(s(e)))));
12
13
  if (r.kind !== "bound") return r;
13
14
  let i = yield* p.promise(() => e.transaction((t) => n(t, e.requestId)));
@@ -19,15 +20,15 @@ var ge = (e) => p.gen(function* () {
19
20
  executionId: o.executionId,
20
21
  ...o.resumeJournal
21
22
  });
22
- return yield* (yield* C.Sharding).pollStorage, {
23
+ return yield* (yield* T.Sharding).pollStorage, {
23
24
  kind: "attempted",
24
25
  request: o,
25
26
  journal: c
26
27
  };
27
- }), E = class extends d.Tag("@voltro/workflow/WorkflowResumeDispatcher")() {}, _e = p.gen(function* () {
28
- let e = yield* y.SqlClient, t = yield* C.Sharding;
29
- return E.of({ dispatch: (n) => ge(n).pipe(p.provideService(y.SqlClient, e), p.provideService(C.Sharding, t)) });
30
- }), ve = async (e) => {
28
+ }), A = class extends d.Tag("@voltro/workflow/WorkflowResumeDispatcher")() {}, ve = p.gen(function* () {
29
+ let e = yield* b.SqlClient, t = yield* T.Sharding;
30
+ return A.of({ dispatch: (n) => _e(n).pipe(p.provideService(b.SqlClient, e), p.provideService(T.Sharding, t)) });
31
+ }), ye = async (e) => {
31
32
  if (e.workflow.name !== e.command.workflowName || e.control.workflowName !== e.command.workflowName) throw Error("Restart preparation requires the matching workflow");
32
33
  let n = await e.transaction(async (n) => {
33
34
  let r = await t(n, e.command);
@@ -37,7 +38,7 @@ var ge = (e) => p.gen(function* () {
37
38
  };
38
39
  let [i] = await n.query({
39
40
  table: "_voltro_workflow_runs",
40
- predicate: v("id", e.command.runId),
41
+ predicate: y("id", e.command.runId),
41
42
  lock: "update",
42
43
  order: [],
43
44
  take: 1,
@@ -46,24 +47,24 @@ var ge = (e) => p.gen(function* () {
46
47
  });
47
48
  return {
48
49
  kind: "captured",
49
- generation: _.decodeUnknownSync(_.NonEmptyString)(i?.runnerGeneration)
50
+ generation: v.decodeUnknownSync(v.NonEmptyString)(i?.runnerGeneration)
50
51
  };
51
52
  });
52
53
  return n.kind === "accepted" ? {
53
54
  kind: "reserved",
54
55
  request: n.request,
55
56
  reused: !0
56
- } : be({
57
+ } : xe({
57
58
  ...e,
58
59
  command: {
59
60
  ...e.command,
60
61
  generation: n.generation
61
62
  }
62
63
  });
63
- }, ye = _.Struct({
64
- requestId: _.NonEmptyString,
65
- restartToken: _.NullOr(_.NonEmptyString)
66
- }), be = async (e) => {
64
+ }, be = v.Struct({
65
+ requestId: v.NonEmptyString,
66
+ restartToken: v.NullOr(v.NonEmptyString)
67
+ }), xe = async (e) => {
67
68
  let { command: t } = e;
68
69
  if (e.workflow.name !== t.workflowName || e.control.workflowName !== t.workflowName) throw Error("Restart preparation requires the matching workflow");
69
70
  let n = await e.transaction(async (n) => {
@@ -74,7 +75,7 @@ var ge = (e) => p.gen(function* () {
74
75
  };
75
76
  let [i] = await n.query({
76
77
  table: "_voltro_workflow_runs",
77
- predicate: v("id", t.runId),
78
+ predicate: y("id", t.runId),
78
79
  lock: "update",
79
80
  order: [],
80
81
  take: 1,
@@ -82,11 +83,11 @@ var ge = (e) => p.gen(function* () {
82
83
  projection: void 0
83
84
  });
84
85
  if (i === void 0 || i.tag !== t.workflowName || i.runnerGeneration !== t.generation || i.status !== "failed" || i.discardedAt != null || typeof i.executionId != "string" || i.executionId.length === 0) throw Error("Restart preparation requires its failed resident generation");
85
- if ((_.decodeUnknownSync(_.NullOr(_.Struct({ tenantId: _.NullOr(_.NonEmptyString) })))(i.subject ?? null)?.tenantId ?? null) !== t.tenantId) throw Error("Restart preparation belongs to another tenant");
86
+ if ((v.decodeUnknownSync(v.NullOr(v.Struct({ tenantId: v.NullOr(v.NonEmptyString) })))(i.subject ?? null)?.tenantId ?? null) !== t.tenantId) throw Error("Restart preparation belongs to another tenant");
86
87
  return {
87
88
  kind: "observe",
88
89
  executionId: i.executionId,
89
- delivery: _.decodeUnknownSync(ye)(i.engineDelivery),
90
+ delivery: v.decodeUnknownSync(be)(i.engineDelivery),
90
91
  activities: await e.readActivities(n)
91
92
  };
92
93
  });
@@ -111,7 +112,7 @@ var ge = (e) => p.gen(function* () {
111
112
  if (i.kind === "unavailable") return i;
112
113
  let [s] = await a.query({
113
114
  table: "_voltro_workflow_runs",
114
- predicate: v("id", t.runId),
115
+ predicate: y("id", t.runId),
115
116
  lock: "update",
116
117
  order: [],
117
118
  take: 1,
@@ -129,16 +130,16 @@ var ge = (e) => p.gen(function* () {
129
130
  now: e.now
130
131
  });
131
132
  });
132
- }, D = (e, t) => `${e}/${t}`, O = (e, t, n) => {
133
+ }, j = (e, t) => `${e}/${t}`, M = (e, t, n) => {
133
134
  let r = re.make(t), i = d.get(e.annotations, te.ShardGroup)(r);
134
135
  return new ne.EntityAddress({
135
136
  entityType: ie.EntityType.make(`Workflow/${e.name}`),
136
137
  entityId: r,
137
138
  shardId: n.getShardId(r, i)
138
139
  });
139
- }, xe = (e, t) => p.gen(function* () {
140
- let n = yield* C.Sharding, r = yield* x.MessageStorage, i = yield* r.requestIdForPrimaryKey({
141
- address: O(e, t, n),
140
+ }, Se = (e, t) => p.gen(function* () {
141
+ let n = yield* T.Sharding, r = yield* S.MessageStorage, i = yield* r.requestIdForPrimaryKey({
142
+ address: M(e, t, n),
142
143
  tag: "run",
143
144
  id: ""
144
145
  });
@@ -153,23 +154,23 @@ var ge = (e) => p.gen(function* () {
153
154
  replyId: String(o.id),
154
155
  exit: o.exit
155
156
  };
156
- }), k = _.decodeUnknownOption(_.Exit({
157
- success: _.Unknown,
158
- failure: _.Unknown,
159
- defect: _.Unknown
160
- })), A = (e) => {
161
- let t = (e) => e && typeof e == "object" && "_tag" in e && typeof e._tag == "string" ? e._tag : void 0, n = k(e);
157
+ }), N = v.decodeUnknownOption(v.Exit({
158
+ success: v.Unknown,
159
+ failure: v.Unknown,
160
+ defect: v.Unknown
161
+ })), P = (e) => {
162
+ let t = (e) => e && typeof e == "object" && "_tag" in e && typeof e._tag == "string" ? e._tag : void 0, n = N(e);
162
163
  if (h.isNone(n)) return "unrecognized-reply";
163
164
  if (n.value._tag === "Failure") return "failed";
164
165
  let r = n.value.value, i = t(r);
165
166
  if (i === "Suspended") return "suspended";
166
167
  if (i === "Complete") {
167
- let e = r.exit, t = k(e);
168
+ let e = r.exit, t = N(e);
168
169
  return h.isNone(t) ? "unrecognized-reply" : t.value._tag === "Success" ? "succeeded" : "failed";
169
170
  }
170
171
  return "unrecognized-reply";
171
- }, Se = (e) => M(e.workflow, e.executionId, e.failedActivities), j = (e) => M(e.workflow, e.executionId, e.resetActivities), M = (e, t, n) => p.gen(function* () {
172
- let r = yield* C.Sharding, i = yield* x.MessageStorage, a = O(e, t, r), o = yield* i.requestIdForPrimaryKey({
172
+ }, Ce = (e) => F(e.workflow, e.executionId, e.failedActivities), we = (e) => F(e.workflow, e.executionId, e.resetActivities), F = (e, t, n) => p.gen(function* () {
173
+ let r = yield* T.Sharding, i = yield* S.MessageStorage, a = M(e, t, r), o = yield* i.requestIdForPrimaryKey({
173
174
  address: a,
174
175
  tag: "run",
175
176
  id: ""
@@ -187,7 +188,7 @@ var ge = (e) => p.gen(function* () {
187
188
  activitiesReset: 0,
188
189
  reason: "no-reply"
189
190
  };
190
- let c = A(s.exit);
191
+ let c = P(s.exit);
191
192
  if (c !== "failed") return {
192
193
  redriven: !1,
193
194
  runReplyCleared: !1,
@@ -199,7 +200,7 @@ var ge = (e) => p.gen(function* () {
199
200
  let t = yield* i.requestIdForPrimaryKey({
200
201
  address: a,
201
202
  tag: "activity",
202
- id: D(e.name, e.attempt)
203
+ id: j(e.name, e.attempt)
203
204
  }).pipe(p.orDie);
204
205
  if (h.isNone(t)) return {
205
206
  redriven: !1,
@@ -231,12 +232,12 @@ var ge = (e) => p.gen(function* () {
231
232
  activitiesReset: u,
232
233
  reason: "run-reset-unconfirmed"
233
234
  };
234
- }), Ce = _.parseJson(_.Record({
235
- key: _.String,
236
- value: _.String
237
- })), we = (e) => p.gen(function* () {
235
+ }), Te = v.parseJson(v.Record({
236
+ key: v.String,
237
+ value: v.String
238
+ })), Ee = (e) => p.gen(function* () {
238
239
  if (!/^[1-9]\d*$/.test(e.delivery.requestId) || e.executionId.length === 0 || e.activities.some((e) => e.name.length === 0 || !Number.isSafeInteger(e.attempt) || e.attempt < 1)) return yield* p.die(/* @__PURE__ */ Error("Restart observation requires an exact delivery and valid activity attempts"));
239
- let t = (yield* y.SqlClient).withoutTransforms(), n = yield* x.MessageStorage, r = yield* C.Sharding, i = O(e.workflow, e.executionId, r), a = (n, r) => p.gen(function* () {
240
+ let t = (yield* b.SqlClient).withoutTransforms(), n = yield* S.MessageStorage, r = yield* T.Sharding, i = M(e.workflow, e.executionId, r), a = (n, r) => p.gen(function* () {
240
241
  let [i] = yield* t`SELECT m.entity_type, m.entity_id, m.tag, m.headers, r.id AS reply_id, r.payload
241
242
  FROM cluster_messages m
242
243
  LEFT JOIN cluster_replies r ON r.id = m.last_reply_id AND r.request_id = m.id AND r.kind = 0
@@ -247,7 +248,7 @@ var ge = (e) => p.gen(function* () {
247
248
  kind: "unavailable",
248
249
  reason: "no-journal"
249
250
  };
250
- if (((yield* p.sync(() => _.decodeUnknownSync(Ce)(o.headers)))["voltro-workflow-restart"] ?? null) !== e.delivery.restartToken) return {
251
+ if (((yield* p.sync(() => v.decodeUnknownSync(Te)(o.headers)))["voltro-workflow-restart"] ?? null) !== e.delivery.restartToken) return {
251
252
  kind: "unavailable",
252
253
  reason: "delivery-changed"
253
254
  };
@@ -255,7 +256,7 @@ var ge = (e) => p.gen(function* () {
255
256
  kind: "unavailable",
256
257
  reason: "no-reply"
257
258
  };
258
- let s = A(yield* p.sync(() => JSON.parse(o.payload)));
259
+ let s = P(yield* p.sync(() => JSON.parse(o.payload)));
259
260
  if (s !== "failed") return {
260
261
  kind: "unavailable",
261
262
  reason: s
@@ -265,7 +266,7 @@ var ge = (e) => p.gen(function* () {
265
266
  let e = yield* n.requestIdForPrimaryKey({
266
267
  address: i,
267
268
  tag: "activity",
268
- id: D(t.name, t.attempt)
269
+ id: j(t.name, t.attempt)
269
270
  });
270
271
  if (h.isNone(e)) return {
271
272
  kind: "unavailable",
@@ -285,59 +286,59 @@ var ge = (e) => p.gen(function* () {
285
286
  replyId: t
286
287
  }))
287
288
  };
288
- }).pipe(p.provideService(y.SafeIntegers, !0)), Te = (e) => p.gen(function* () {
289
+ }).pipe(p.provideService(b.SafeIntegers, !0)), De = (e) => p.gen(function* () {
289
290
  let t = yield* i(e);
290
- return t.kind === "waiting-capacity" ? t : (yield* (yield* C.Sharding).pollStorage, {
291
+ return t.kind === "waiting-capacity" ? t : (yield* (yield* T.Sharding).pollStorage, {
291
292
  kind: "attempted",
292
293
  journal: t
293
294
  });
294
- }), N = class extends d.Tag("@voltro/workflow/WorkflowRestartDispatcher")() {}, Ee = p.gen(function* () {
295
- let e = yield* y.SqlClient, t = yield* C.Sharding, n = yield* x.MessageStorage, r = (r) => we(r).pipe(p.provideService(y.SqlClient, e), p.provideService(C.Sharding, t), p.provideService(x.MessageStorage, n));
296
- return N.of({
295
+ }), I = class extends d.Tag("@voltro/workflow/WorkflowRestartDispatcher")() {}, Oe = p.gen(function* () {
296
+ let e = yield* b.SqlClient, t = yield* T.Sharding, n = yield* S.MessageStorage, r = (r) => Ee(r).pipe(p.provideService(b.SqlClient, e), p.provideService(T.Sharding, t), p.provideService(S.MessageStorage, n));
297
+ return I.of({
297
298
  prepare: (e) => p.tryPromise({
298
- try: (t) => ve({
299
+ try: (t) => ye({
299
300
  ...e,
300
301
  observe: (e) => p.runPromise(r(e), { signal: t })
301
302
  }),
302
303
  catch: (e) => e
303
304
  }),
304
305
  observe: r,
305
- dispatch: (n) => Te(n).pipe(p.provideService(y.SqlClient, e), p.provideService(C.Sharding, t))
306
+ dispatch: (n) => De(n).pipe(p.provideService(b.SqlClient, e), p.provideService(T.Sharding, t))
306
307
  });
307
- }), P = 6322741009312601n, F = () => {
308
- let e = T();
309
- return e === void 0 ? P : w(`voltro_cluster_migration_lock:${e}`) & 9223372036854775807n;
310
- }, I = () => {
311
- let e = `voltro_cluster_migration_${P.toString(36)}`, t = T();
308
+ }), L = 6322741009312601n, R = () => {
309
+ let e = k();
310
+ return e === void 0 ? L : O(`voltro_cluster_migration_lock:${e}`) & 9223372036854775807n;
311
+ }, z = () => {
312
+ let e = `voltro_cluster_migration_${L.toString(36)}`, t = k();
312
313
  if (t === void 0) return e;
313
314
  let n = `${e}_${t}`;
314
- return /^[A-Za-z0-9_]+$/.test(t) && n.length <= 64 ? n : `${e}_h${w(`voltro_cluster_migration_lock:${t}`).toString(16)}`;
315
- }, L = () => {
315
+ return /^[A-Za-z0-9_]+$/.test(t) && n.length <= 64 ? n : `${e}_h${O(`voltro_cluster_migration_lock:${t}`).toString(16)}`;
316
+ }, B = () => {
316
317
  let e = Number(process.env.VOLTRO_CLUSTER_MIGRATION_LOCK_TIMEOUT_MS);
317
318
  return Number.isFinite(e) && e > 0 ? e : 6e4;
318
- }, De = 250, R = (e) => e[0]?.[0], Oe = (e, t) => e.onDialectOrElse({
319
+ }, ke = 250, V = (e) => e[0]?.[0], Ae = (e, t) => e.onDialectOrElse({
319
320
  sqlite: () => p.void,
320
- mysql: () => t.executeValues(`SELECT GET_LOCK('${I()}', ${Math.ceil(L() / 1e3)})`, []).pipe(p.flatMap((e) => R(e) === 1 || R(e) === "1" ? p.void : p.die(/* @__PURE__ */ Error(`could not acquire cluster migration lock '${I()}' (GET_LOCK timed out)`)))),
321
- mssql: () => t.executeValues(`DECLARE @res int; EXEC @res = sp_getapplock @Resource = '${I()}', @LockMode = 'Exclusive', @LockOwner = 'Session', @LockTimeout = ${L()}; SELECT @res`, []).pipe(p.flatMap((e) => Number(R(e) ?? -999) >= 0 ? p.void : p.die(/* @__PURE__ */ Error(`could not acquire cluster migration lock '${I()}' (sp_getapplock ${String(R(e))})`)))),
321
+ mysql: () => t.executeValues(`SELECT GET_LOCK('${z()}', ${Math.ceil(B() / 1e3)})`, []).pipe(p.flatMap((e) => V(e) === 1 || V(e) === "1" ? p.void : p.die(/* @__PURE__ */ Error(`could not acquire cluster migration lock '${z()}' (GET_LOCK timed out)`)))),
322
+ mssql: () => t.executeValues(`DECLARE @res int; EXEC @res = sp_getapplock @Resource = '${z()}', @LockMode = 'Exclusive', @LockOwner = 'Session', @LockTimeout = ${B()}; SELECT @res`, []).pipe(p.flatMap((e) => Number(V(e) ?? -999) >= 0 ? p.void : p.die(/* @__PURE__ */ Error(`could not acquire cluster migration lock '${z()}' (sp_getapplock ${String(V(e))})`)))),
322
323
  orElse: () => {
323
- let e = F().toString(), n = Date.now(), r = t.executeValues(`SELECT pg_try_advisory_lock(${e}::bigint)`, []).pipe(p.flatMap((e) => {
324
- let t = R(e);
325
- return t === !0 || t === "t" || t === 1 ? p.void : Date.now() - n >= L() ? p.die(/* @__PURE__ */ Error(`could not acquire the cluster migration advisory lock within ${Math.round(L() / 1e3)}s. Another runner is migrating the cluster schema, or a prior boot wedged while holding it. (Raise VOLTRO_CLUSTER_MIGRATION_LOCK_TIMEOUT_MS, or inspect pg_locks for the holder.)`)) : p.sleep(`${De} millis`).pipe(p.zipRight(r));
324
+ let e = R().toString(), n = Date.now(), r = t.executeValues(`SELECT pg_try_advisory_lock(${e}::bigint)`, []).pipe(p.flatMap((e) => {
325
+ let t = V(e);
326
+ return t === !0 || t === "t" || t === 1 ? p.void : Date.now() - n >= B() ? p.die(/* @__PURE__ */ Error(`could not acquire the cluster migration advisory lock within ${Math.round(B() / 1e3)}s. Another runner is migrating the cluster schema, or a prior boot wedged while holding it. (Raise VOLTRO_CLUSTER_MIGRATION_LOCK_TIMEOUT_MS, or inspect pg_locks for the holder.)`)) : p.sleep(`${ke} millis`).pipe(p.zipRight(r));
326
327
  }));
327
328
  return r;
328
329
  }
329
- }), z = (e, t) => e.onDialectOrElse({
330
+ }), je = (e, t) => e.onDialectOrElse({
330
331
  sqlite: () => p.void,
331
- mysql: () => p.asVoid(t.executeValues(`SELECT RELEASE_LOCK('${I()}')`, [])),
332
- mssql: () => p.asVoid(t.executeValues(`EXEC sp_releaseapplock @Resource = '${I()}', @LockOwner = 'Session'`, [])),
333
- orElse: () => p.asVoid(t.executeValues(`SELECT pg_advisory_unlock(${F().toString()}::bigint)`, []))
334
- }), ke = (e, t) => e.onDialectOrElse({
332
+ mysql: () => p.asVoid(t.executeValues(`SELECT RELEASE_LOCK('${z()}')`, [])),
333
+ mssql: () => p.asVoid(t.executeValues(`EXEC sp_releaseapplock @Resource = '${z()}', @LockOwner = 'Session'`, [])),
334
+ orElse: () => p.asVoid(t.executeValues(`SELECT pg_advisory_unlock(${R().toString()}::bigint)`, []))
335
+ }), Me = (e, t) => e.onDialectOrElse({
335
336
  sqlite: () => !0,
336
337
  orElse: () => !1
337
338
  }) ? t : p.scoped(p.gen(function* () {
338
339
  let n = yield* e.reserve;
339
- return yield* p.acquireRelease(Oe(e, n), () => z(e, n).pipe(p.orDie)), yield* t;
340
- })), Ae = (e) => e === "sql" ? ["cluster_messages", "cluster_runners"] : ["cluster_messages"], je = (e, t) => e.onDialectOrElse({
340
+ return yield* p.acquireRelease(Ae(e, n), () => je(e, n).pipe(p.orDie)), yield* t;
341
+ })), Ne = (e) => e === "sql" ? ["cluster_messages", "cluster_runners"] : ["cluster_messages"], Pe = (e, t) => e.onDialectOrElse({
341
342
  pg: () => e`SELECT (to_regclass(${t}) IS NOT NULL) AS present`,
342
343
  mysql: () => e`SELECT (COUNT(*) > 0) AS present FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = ${t}`,
343
344
  mssql: () => e`SELECT CASE WHEN OBJECT_ID(${t}, 'U') IS NULL THEN 0 ELSE 1 END AS present`,
@@ -345,63 +346,63 @@ var ge = (e) => p.gen(function* () {
345
346
  }).pipe(p.map((e) => {
346
347
  let t = e[0]?.present;
347
348
  return t === !0 || t === 1 || t === "1" || t === "t" || typeof t == "bigint" && t === 1n;
348
- }), p.catchAll(() => p.succeed(!1))), Me = (e, t) => p.forEach(Ae(t), (t) => je(e, t), { concurrency: 1 }).pipe(p.map((e) => e.every(Boolean))), B = (e, t) => p.scoped(p.asVoid(m.build(t.pipe(m.provide(oe.layerDefaults), m.provide(m.succeed(y.SqlClient, e)))))), V = (e, t) => B(e, ce.layer).pipe(p.zipRight(t === "sql" ? B(e, le.layer) : p.void)), H = (e) => p.map(e.unsafe("SELECT table_name AS t FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name LIKE 'cluster\\_%'"), (e) => new Set(e.map((e) => String(e.t ?? e.T)))), Ne = (e, t, n) => n === void 0 || !e.onDialectOrElse({
349
+ }), p.catchAll(() => p.succeed(!1))), Fe = (e, t) => p.forEach(Ne(t), (t) => Pe(e, t), { concurrency: 1 }).pipe(p.map((e) => e.every(Boolean))), H = (e, t) => p.scoped(p.asVoid(m.build(t.pipe(m.provide(ce.layerDefaults), m.provide(m.succeed(b.SqlClient, e)))))), U = (e, t) => H(e, E.layer).pipe(p.zipRight(t === "sql" ? H(e, D.layer) : p.void)), W = (e) => p.map(e.unsafe("SELECT table_name AS t FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name LIKE 'cluster\\_%'"), (e) => new Set(e.map((e) => String(e.t ?? e.T)))), Ie = (e, t, n) => n === void 0 || !e.onDialectOrElse({
349
350
  mysql: () => !0,
350
351
  orElse: () => !1
351
- }) ? V(e, t) : p.gen(function* () {
352
- let r = yield* H(e);
353
- yield* V(e, t);
354
- let i = new Set([...yield* H(e)].filter((e) => !r.has(e)));
352
+ }) ? U(e, t) : p.gen(function* () {
353
+ let r = yield* W(e);
354
+ yield* U(e, t);
355
+ let i = new Set([...yield* W(e)].filter((e) => !r.has(e)));
355
356
  i.size !== 0 && (yield* ue(e, pe(yield* de(e), /* @__PURE__ */ new Set(), n, i)));
356
- }), Pe = (e) => e === "sql" ? 3 : 2, U = (e) => m.effect(y.SqlClient, p.gen(function* () {
357
- let t = yield* y.SqlClient, n = Pe(e.runnerStorage), r = fe(t);
358
- return r !== void 0 && r < n ? yield* p.dieMessage(`the workflow runtime needs ${n} database connections at once and the pool has ${r}: ` + (e.runnerStorage === "sql" ? "on a first boot it holds its migration lock and its runner lock while the migration runs on a third, and once running it keeps the runner lock and needs one more to work. " : "on a first boot it holds its migration lock while the migration runs on a second. ") + `Set DB_MAX_CONNECTIONS (or PG_MAX_CONNECTIONS) to at least ${n}` + (e.runnerStorage === "sql" ? ", or VOLTRO_WORKFLOW_RUNNER_STORAGE=memory for a single-process runtime that needs 2 (no cross-pod shard handoff)." : ".")) : ((yield* Me(t, e.runnerStorage)) || (yield* ke(t, Ne(t, e.runnerStorage, e.charset))), t);
359
- })), Fe = (e) => p.gen(function* () {
357
+ }), Le = (e) => e === "sql" ? 3 : 2, G = (e) => m.effect(b.SqlClient, p.gen(function* () {
358
+ let t = yield* b.SqlClient, n = Le(e.runnerStorage), r = fe(t);
359
+ return r !== void 0 && r < n ? yield* p.dieMessage(`the workflow runtime needs ${n} database connections at once and the pool has ${r}: ` + (e.runnerStorage === "sql" ? "on a first boot it holds its migration lock and its runner lock while the migration runs on a third, and once running it keeps the runner lock and needs one more to work. " : "on a first boot it holds its migration lock while the migration runs on a second. ") + `Set DB_MAX_CONNECTIONS (or PG_MAX_CONNECTIONS) to at least ${n}` + (e.runnerStorage === "sql" ? ", or VOLTRO_WORKFLOW_RUNNER_STORAGE=memory for a single-process runtime that needs 2 (no cross-pod shard handoff)." : ".")) : ((yield* Fe(t, e.runnerStorage)) || (yield* Me(t, Ie(t, e.runnerStorage, e.charset))), t);
360
+ })), Re = (e) => p.gen(function* () {
360
361
  let t = yield* p.tryPromise({
361
362
  try: () => me(e),
362
- catch: W
363
+ catch: K
363
364
  }), n = yield* p.acquireRelease(p.tryPromise({
364
365
  try: async () => {
365
366
  let { DatabaseSync: e } = await import("node:sqlite");
366
367
  return new e(`${t}.voltro-workflow-lock`);
367
368
  },
368
- catch: W
369
+ catch: K
369
370
  }), (e) => p.sync(() => e.close()));
370
371
  yield* p.try({
371
372
  try: () => {
372
373
  n.exec("PRAGMA busy_timeout=0"), n.exec("CREATE TABLE IF NOT EXISTS workflow_mutex(id INTEGER PRIMARY KEY)"), n.exec("BEGIN IMMEDIATE");
373
374
  },
374
375
  catch: (e) => {
375
- let n = W(e), r = n.errcode;
376
+ let n = K(e), r = n.errcode;
376
377
  return r !== void 0 && ((r & 255) == 5 || (r & 255) == 6) ? Error("SQLite workflow journal is already owned by another engine. Stop that engine before starting another, or use a SQL dialect with shared runner coordination for replicas.", { cause: n }) : Error(`Could not acquire SQLite workflow ownership for ${t}`, { cause: n });
377
378
  }
378
379
  });
379
- }), W = (e) => e instanceof Error ? e : Error(String(e)), G = (e) => {
380
+ }), K = (e) => e instanceof Error ? e : Error(String(e)), q = (e) => {
380
381
  if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e;
381
382
  if (typeof e == "string" || typeof e == "number") {
382
383
  let t = typeof e == "string" && /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e) ? `${e.replace(" ", "T")}Z` : e, n = new Date(t);
383
384
  return Number.isNaN(n.getTime()) ? null : n;
384
385
  }
385
386
  return null;
386
- }, K = (e) => e === !0 || e === 1 || e === "1" || e instanceof Uint8Array && e[0] === 1, Ie = (e, t) => {
387
+ }, J = (e) => e === !0 || e === 1 || e === "1" || e instanceof Uint8Array && e[0] === 1, ze = (e, t) => {
387
388
  let n = e.lastIndexOf(":");
388
389
  if (n < 0) return;
389
390
  let r = e.slice(0, n), i = Number(e.slice(n + 1)), a = t.indexOf(r);
390
391
  if (!(a < 0 || !Number.isInteger(i))) return (a + 1) * 1e6 + i;
391
- }, q = (e) => p.gen(function* () {
392
- let t = yield* y.SqlClient, n = e.shardGroups ?? ["default"], r = e.dialectId ?? "", i = r.startsWith("postgres") || r === "pg", a = (e) => e.pipe(p.catchAll(() => p.succeed([]))), o = t.onDialectOrElse({
392
+ }, Y = (e) => p.gen(function* () {
393
+ let t = yield* b.SqlClient, n = e.shardGroups ?? ["default"], r = e.dialectId ?? "", i = r.startsWith("postgres") || r === "pg", a = (e) => e.pipe(p.catchAll(() => p.succeed([]))), o = t.onDialectOrElse({
393
394
  pg: () => t.literal("NOW()"),
394
395
  mysql: () => t.literal("NOW()"),
395
396
  mssql: () => t.literal("GETDATE()"),
396
397
  orElse: () => t.literal("CURRENT_TIMESTAMP")
397
398
  }), s = (e, t) => {
398
- let n = G(e.last_read), r = G(e.server_now), i = n !== null && r !== null ? Math.max(0, r.getTime() - n.getTime()) : null;
399
+ let n = q(e.last_read), r = q(e.server_now), i = n !== null && r !== null ? Math.max(0, r.getTime() - n.getTime()) : null;
399
400
  return {
400
401
  tag: typeof e.tag == "string" ? e.tag : null,
401
402
  entityType: String(e.entity_type ?? ""),
402
403
  entityId: String(e.entity_id ?? ""),
403
404
  shardId: String(e.shard_id ?? ""),
404
- processed: K(e.processed),
405
+ processed: J(e.processed),
405
406
  lastRead: i === null ? null : new Date(t - i)
406
407
  };
407
408
  }, c = (e) => t.onDialectOrElse({
@@ -446,12 +447,12 @@ var ge = (e) => p.gen(function* () {
446
447
  mode: "row",
447
448
  holder: r,
448
449
  own: r === e.ownAddress || (e.hasShard?.(i) ?? !1),
449
- since: G(n.acquired_at)
450
+ since: q(n.acquired_at)
450
451
  };
451
452
  }))), h = (r) => {
452
453
  let i = /* @__PURE__ */ new Map();
453
454
  for (let e of r) {
454
- let t = Ie(e, n);
455
+ let t = ze(e, n);
455
456
  t !== void 0 && i.set(t, e);
456
457
  }
457
458
  return i.size === 0 ? p.succeed([]) : p.gen(function* () {
@@ -469,14 +470,14 @@ var ge = (e) => p.gen(function* () {
469
470
  mode: "advisory",
470
471
  holder: s ? `this runner (pid ${a})` : `pid ${a} from ${o}`,
471
472
  own: s,
472
- since: G(n.state_change),
473
+ since: q(n.state_change),
473
474
  detail: {
474
475
  pid: a,
475
476
  clientAddr: n.client_addr ?? null,
476
477
  applicationName: n.application_name ?? null,
477
478
  state: n.state ?? null,
478
479
  waitEventType: n.wait_event_type ?? null,
479
- backendStart: G(n.backend_start)?.toISOString() ?? null
480
+ backendStart: q(n.backend_start)?.toISOString() ?? null
480
481
  }
481
482
  }];
482
483
  });
@@ -492,8 +493,8 @@ var ge = (e) => p.gen(function* () {
492
493
  let t = e;
493
494
  return {
494
495
  address: String(t.address ?? ""),
495
- lastHeartbeat: G(t.last_heartbeat),
496
- healthy: K(t.healthy)
496
+ lastHeartbeat: q(t.last_heartbeat),
497
+ healthy: J(t.healthy)
497
498
  };
498
499
  }))) : p.succeed([]),
499
500
  discardMessages: (e) => {
@@ -509,38 +510,62 @@ var ge = (e) => p.gen(function* () {
509
510
  }).pipe(t.withTransaction, p.catchAll(() => p.succeed(0)));
510
511
  }
511
512
  };
512
- }), J = he({ scope: "voltro:workflow" }), Le = 34e3, Y = (e) => {
513
+ }), Be = (e, t) => p.gen(function* () {
514
+ let n = f.decode(t.interval), r = f.toMillis(t.giveUpAfter), i, a, o = !1, s = !1;
515
+ yield* t.probe.pipe(p.timeout(n), p.isSuccess, p.flatMap((e) => p.sync(() => {
516
+ let n = Date.now();
517
+ if (e) {
518
+ if (i = void 0, !o || (a ??= n, n - a < r)) return;
519
+ t.log.info("workflow runner: its storage answers again — taking part in shard assignment again"), a = void 0, o = !1, s = !1;
520
+ return;
521
+ }
522
+ a = void 0, i ??= n, !o && n - i >= r && (o = !0, t.log.warn(`workflow runner: its connection pool has not served a query for ${Math.round((n - i) / 1e3)}s — released its shards and stopped its heartbeat, so another runner takes them`, { fix: "look for what holds this process's database connections (`voltro_db_operations_in_flight` against DB_MAX_CONNECTIONS)" }));
523
+ }))).pipe(p.repeat(_.spaced(n)), p.forkScoped);
524
+ let c = () => new ge({ cause: /* @__PURE__ */ Error("workflow runner gave its shards up: its connection pool does not serve queries") });
525
+ return w.RunnerStorage.of({
526
+ ...e,
527
+ register: (t, n) => p.suspend(() => o ? p.fail(c()) : e.register(t, n)),
528
+ acquire: (t, n) => p.suspend(() => o ? p.succeed([]) : e.acquire(t, n)),
529
+ refresh: (t, n) => p.suspend(() => {
530
+ if (!o) return e.refresh(t, n);
531
+ let r = s ? p.void : e.releaseAll(t).pipe(p.tap(() => p.sync(() => {
532
+ s = !0;
533
+ })), p.ignore);
534
+ return p.zipRight(r, p.fail(c()));
535
+ })
536
+ });
537
+ }), X = he({ scope: "voltro:workflow" }), Ve = 34e3, Z = (e) => {
513
538
  let t = e.runnerListenHost ?? process.env.POD_IP ?? process.env.VOLTRO_WORKFLOW_RUNNER_HOST ?? "localhost";
514
539
  return {
515
540
  host: t,
516
541
  port: e.runnerListenPort ?? 34e3,
517
542
  localhostRisk: e.runnerStorage === "sql" && (t === "localhost" || t === "127.0.0.1")
518
543
  };
519
- }, Re = (e) => {
520
- let t = e.sqliteFamily ? "memory" : "sql", n = e.override ?? process.env.VOLTRO_WORKFLOW_RUNNER_STORAGE;
521
- if (n === void 0 || n.trim() === "") return t;
522
- let r = n.trim().toLowerCase();
523
- if (r !== "memory" && r !== "sql") throw Error(`VOLTRO_WORKFLOW_RUNNER_STORAGE must be 'memory' or 'sql', got '${n}'.`);
524
- if (r === "sql" && e.sqliteFamily) throw Error("VOLTRO_WORKFLOW_RUNNER_STORAGE='sql' is unsupported on sqlite / turso — @effect/cluster has no sqlite advisory-lock branch. Use 'memory'.");
525
- return r;
526
- }, X = (e = process.env.VOLTRO_WORKFLOW_SHARD_LOCK) => {
544
+ }, He = (e) => {
545
+ let t = e.sqlRunnerSupported ?? !e.sqliteFamily, n = t ? "sql" : "memory", r = e.override ?? process.env.VOLTRO_WORKFLOW_RUNNER_STORAGE;
546
+ if (r === void 0 || r.trim() === "") return n;
547
+ let i = r.trim().toLowerCase();
548
+ if (i !== "memory" && i !== "sql") throw Error(`VOLTRO_WORKFLOW_RUNNER_STORAGE must be 'memory' or 'sql', got '${r}'.`);
549
+ if (i === "sql" && !t) throw Error("VOLTRO_WORKFLOW_RUNNER_STORAGE='sql' is unsupported for this database connection. Use 'memory' for a local or embedded SQLite-family connection.");
550
+ return i;
551
+ }, Q = (e = process.env.VOLTRO_WORKFLOW_SHARD_LOCK) => {
527
552
  if (e === void 0 || e.trim() === "") return "auto";
528
553
  let t = e.trim().toLowerCase();
529
554
  if (t === "auto" || t === "row" || t === "advisory") return t;
530
555
  throw Error(`VOLTRO_WORKFLOW_SHARD_LOCK must be 'auto', 'row', or 'advisory', got '${e}'.`);
531
- }, Z = p.gen(function* () {
532
- let e = yield* (yield* y.SqlClient)`SELECT @@wsrep_on AS wsrep`.pipe(p.catchAll(() => p.succeed([])));
556
+ }, Ue = p.gen(function* () {
557
+ let e = yield* (yield* b.SqlClient)`SELECT @@wsrep_on AS wsrep`.pipe(p.catchAll(() => p.succeed([])));
533
558
  if (e.length === 0) return !1;
534
559
  let t = e[0].wsrep;
535
560
  return t === 1 || t === "1" || t === !0 || t === "ON" || t === "on";
536
- }), Q = (e) => p.gen(function* () {
537
- return e.runnerStorage === "memory" ? !1 : e.mode === "row" ? !0 : e.mode === "advisory" || e.dialectId !== "mysql" && e.dialectId !== "mariadb" ? !1 : yield* Z;
538
- }), ze = (e) => ({
561
+ }), We = (e) => p.gen(function* () {
562
+ return e.runnerStorage === "memory" ? !1 : e.dialectId === "sqlite" || e.dialectId === "turso" || e.mode === "row" ? !0 : e.mode === "advisory" || e.dialectId !== "mysql" && e.dialectId !== "mariadb" ? !1 : yield* Ue;
563
+ }), Ge = (e) => ({
539
564
  coordination: e.disableAdvisory ? "row-based" : "advisory",
540
565
  dialect: e.dialectId ?? "unknown",
541
566
  mode: e.mode,
542
- ...e.disableAdvisory && e.mode === "auto" ? { reason: "wsrep/Galera cluster detected" } : {}
543
- }), Be = () => {
567
+ ...e.disableAdvisory && e.mode === "auto" ? { reason: e.dialectId === "sqlite" || e.dialectId === "turso" ? "SQLite-family connection uses row locks" : "wsrep/Galera cluster detected" } : {}
568
+ }), Ke = () => {
544
569
  let e = (e) => {
545
570
  if (e === void 0) return;
546
571
  let t = Number(e);
@@ -551,54 +576,62 @@ var ge = (e) => p.gen(function* () {
551
576
  ...n === void 0 ? {} : { failoverHeartbeatSeconds: n },
552
577
  ...r === void 0 ? {} : { messagePollSeconds: r }
553
578
  };
554
- }, Ve = p.flatMap(C.Sharding, (e) => e.pollStorage), $ = /* @__PURE__ */ new Set(), He = (t) => {
555
- let n = Y({
579
+ }, qe = p.flatMap(T.Sharding, (e) => e.pollStorage), $ = /* @__PURE__ */ new Set(), Je = (t) => {
580
+ let n = Z({
556
581
  runnerStorage: t.runnerStorage,
557
582
  runnerListenHost: t.runnerListenHost,
558
583
  runnerListenPort: t.runnerListenPort
559
584
  }), r = n.host, i = n.port;
560
- n.localhostRisk && !$.has(r) && ($.add(r), J.warn("runner host is not routable from other pods with SQL cluster storage — a workflow cannot resume on another pod after a reschedule. Inject POD_IP via the K8s downward API (fieldRef: status.podIP) or set runnerListenHost / VOLTRO_WORKFLOW_RUNNER_HOST.", { runnerHost: r }));
561
- let a = t.dialectId === "sqlite" ? m.scoped(y.SqlClient, p.gen(function* () {
562
- let e = yield* y.SqlClient, t = (yield* e.unsafe("PRAGMA database_list")).find((e) => e.name === "main");
563
- return t === void 0 ? yield* p.die(/* @__PURE__ */ Error("SQLite workflow connection has no main database")) : (t.file !== "" && (yield* Fe(t.file)), e);
564
- }).pipe(p.orDie)).pipe(m.provide(t.sqlClientLayer)) : t.sqlClientLayer, s = U({
585
+ n.localhostRisk && !$.has(r) && ($.add(r), X.warn("runner host is not routable from other pods with SQL cluster storage — a workflow cannot resume on another pod after a reschedule. Inject POD_IP via the K8s downward API (fieldRef: status.podIP) or set runnerListenHost / VOLTRO_WORKFLOW_RUNNER_HOST.", { runnerHost: r }));
586
+ let a = t.dialectId === "sqlite" ? m.scoped(b.SqlClient, p.gen(function* () {
587
+ let e = yield* b.SqlClient, t = (yield* e.unsafe("PRAGMA database_list")).find((e) => e.name === "main");
588
+ return t === void 0 ? yield* p.die(/* @__PURE__ */ Error("SQLite workflow connection has no main database")) : (t.file !== "" && (yield* Re(t.file)), e);
589
+ }).pipe(p.orDie)).pipe(m.provide(t.sqlClientLayer)) : t.sqlClientLayer, s = G({
565
590
  runnerStorage: t.runnerStorage,
566
591
  charset: t.charset
567
- }).pipe(m.provide(a)), c = t.shardLockMode ?? X(), l = m.unwrapEffect(Q({
592
+ }).pipe(m.provide(a)), c = t.shardLockMode ?? Q(), l = m.unwrapEffect(We({
568
593
  dialectId: t.dialectId,
569
594
  runnerStorage: t.runnerStorage,
570
595
  mode: c
571
596
  }).pipe(p.map((e) => {
572
- t.runnerStorage === "sql" && J.info("shard-lock coordination", ze({
597
+ t.runnerStorage === "sql" && X.info("shard-lock coordination", Ge({
573
598
  disableAdvisory: e,
574
599
  dialectId: t.dialectId,
575
600
  mode: c
576
601
  }));
577
- let n = m.effect(o, p.flatMap(C.Sharding, (n) => q({
578
- ownAddress: S.make(r, i).toString(),
602
+ let n = m.effect(o, p.flatMap(T.Sharding, (n) => Y({
603
+ ownAddress: C.make(r, i).toString(),
579
604
  shardLockMode: t.runnerStorage === "sql" ? e ? "row" : "advisory" : "none",
580
605
  runnerStorage: t.runnerStorage,
581
606
  dialectId: t.dialectId,
582
- hasShard: (e) => n.hasShardId(ae.ShardId.fromString(e))
583
- }))), a = se.layer({
607
+ hasShard: (e) => n.hasShardId(se.ShardId.fromString(e))
608
+ }))), a = {
609
+ runnerAddress: h.some(C.make(r, i)),
610
+ runnerListenAddress: h.some(C.make(r, i)),
611
+ ...e ? { shardLockDisableAdvisory: !0 } : {},
612
+ ...t.failoverLeaseSeconds === void 0 ? {} : { shardLockExpiration: f.seconds(t.failoverLeaseSeconds) },
613
+ ...t.failoverHeartbeatSeconds === void 0 ? {} : { shardLockRefreshInterval: f.seconds(t.failoverHeartbeatSeconds) },
614
+ ...t.messagePollSeconds === void 0 ? {} : { entityMessagePollInterval: f.seconds(t.messagePollSeconds) }
615
+ }, s = f.seconds(t.failoverHeartbeatSeconds ?? 10), l = t.runnerStorage === "sql" ? T.layer.pipe(m.provideMerge(oe.layerNoop), m.provideMerge(E.layer), m.provide([m.scoped(w.RunnerStorage, p.gen(function* () {
616
+ let e = yield* b.SqlClient;
617
+ return yield* Be(yield* w.RunnerStorage, {
618
+ probe: e`SELECT 1`,
619
+ interval: s,
620
+ giveUpAfter: f.times(s, 3),
621
+ log: X
622
+ });
623
+ })).pipe(m.provide(m.orDie(D.layer))), ae.layerNoop]), m.provide(ce.layerFromEnv(a))) : le.layer({
584
624
  runnerStorage: t.runnerStorage,
585
- shardingConfig: {
586
- runnerAddress: h.some(S.make(r, i)),
587
- runnerListenAddress: h.some(S.make(r, i)),
588
- ...e ? { shardLockDisableAdvisory: !0 } : {},
589
- ...t.failoverLeaseSeconds === void 0 ? {} : { shardLockExpiration: f.seconds(t.failoverLeaseSeconds) },
590
- ...t.failoverHeartbeatSeconds === void 0 ? {} : { shardLockRefreshInterval: f.seconds(t.failoverHeartbeatSeconds) },
591
- ...t.messagePollSeconds === void 0 ? {} : { entityMessagePollInterval: f.seconds(t.messagePollSeconds) }
592
- }
625
+ shardingConfig: a
593
626
  });
594
- return m.mergeAll(n, m.effect(E, _e), m.effect(N, Ee)).pipe(m.provideMerge(a));
595
- }))).pipe(m.provide(s)), u = t.extraShardingLayers ?? [], g = u.length === 0 ? b.layer : m.mergeAll(b.layer, ...u), _ = l.pipe(m.map((t) => d.add(t, C.Sharding, e(d.get(t, C.Sharding)))));
627
+ return m.mergeAll(n, m.effect(A, ve), m.effect(I, Oe)).pipe(m.provideMerge(l));
628
+ }))).pipe(m.provide(s)), u = t.extraShardingLayers ?? [], g = u.length === 0 ? x.layer : m.mergeAll(x.layer, ...u), _ = l.pipe(m.map((t) => d.add(t, T.Sharding, e(d.get(t, T.Sharding)))));
596
629
  return g.pipe(m.provideMerge(_));
597
- }, Ue = (e) => ee.make({
630
+ }, Ye = (e) => ee.make({
598
631
  name: e.name,
599
632
  cron: e.cron,
600
633
  execute: p.promise(() => e.execute()),
601
634
  skipIfOlderThan: e.skipIfOlderThan ?? f.days(1)
602
635
  });
603
636
  //#endregion
604
- export { j as _, Ve as a, Re as c, q as d, U as f, Se as g, xe as h, X as i, Q as l, D as m, Le as n, Be as o, N as p, Z as r, Y as s, Ue as t, He as u, E as v };
637
+ export { we as _, qe as a, He as c, Y as d, G as f, Ce as g, Se as h, Q as i, We as l, j as m, Ve as n, Ke as o, I as p, Ue as r, Z as s, Ye as t, Je as u, A as v };