@voltro/workflow 0.87.0 → 0.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +169 -6
  2. package/THIRD-PARTY-NOTICES.md +3 -1346
  3. package/dist/admission.js +1 -2
  4. package/dist/admissionDrainer.js +5 -3
  5. package/dist/admissionGate.js +1 -2
  6. package/dist/admissionStore.js +1 -2
  7. package/dist/admissionSubmission.js +1 -2
  8. package/dist/admissionTables.js +4 -4
  9. package/dist/admissionTransaction.js +1 -2
  10. package/dist/awaitEvent.js +1 -2
  11. package/dist/budgetHold.js +1 -2
  12. package/dist/cancelOnPlan.js +1 -2
  13. package/dist/cancelOnSweep.js +1 -2
  14. package/dist/cancelPendingStart.js +1 -2
  15. package/dist/clusterCron.js +1 -2
  16. package/dist/clusterDiagnostics.js +1 -2
  17. package/dist/clusterDiagnosticsSql.js +1 -2
  18. package/dist/clusterLayer.js +1 -2
  19. package/dist/clusterMigrationGate.js +1 -2
  20. package/dist/clusterRunnerLayer.js +1 -2
  21. package/dist/clusterShardGroups.js +1 -2
  22. package/dist/clusterTestSuite.d.ts +22 -2
  23. package/dist/clusterTestSuite.js +170 -172
  24. package/dist/controlMonitor.js +1 -2
  25. package/dist/controlRequest.js +1 -2
  26. package/dist/executionRefusal.js +1 -2
  27. package/dist/failureHandoff.js +1 -2
  28. package/dist/failureMessage.js +1 -2
  29. package/dist/failureRecovery.js +1 -2
  30. package/dist/failureReportStore.js +1 -2
  31. package/dist/flowControl.js +1 -2
  32. package/dist/forwardStartReceipts.js +1 -2
  33. package/dist/inMemoryLayer.js +1 -2
  34. package/dist/inMemoryRecorder.js +1 -2
  35. package/dist/index.d.ts +3 -1
  36. package/dist/inspectWorkflow.js +2 -3
  37. package/dist/journalEncryption.js +1 -2
  38. package/dist/journalRoutingGuard.js +1 -2
  39. package/dist/journalRoutingLayout.js +1 -2
  40. package/dist/journalRoutingLock.js +1 -2
  41. package/dist/journalRoutingMaintenance.js +1 -2
  42. package/dist/journalRoutingMessageStorage.js +1 -2
  43. package/dist/journalRoutingNamespace.js +1 -2
  44. package/dist/journalRoutingRuntime.js +1 -2
  45. package/dist/journalRoutingSharding.js +1 -2
  46. package/dist/journalRoutingState.js +1 -2
  47. package/dist/journalRoutingTable.js +1 -2
  48. package/dist/journalRoutingTransaction.js +2 -3
  49. package/dist/messages.js +1 -2
  50. package/dist/nondeterminism.js +1 -2
  51. package/dist/parentClosure.js +1 -2
  52. package/dist/parentClosureRecovery.js +1 -2
  53. package/dist/pendingSubmission.js +1 -2
  54. package/dist/prepareSubmissionDispatch.js +1 -2
  55. package/dist/preparedExecution.js +1 -2
  56. package/dist/primitives.js +1 -2
  57. package/dist/queuedCancellationRequest.js +1 -2
  58. package/dist/queuedControl.js +1 -2
  59. package/dist/recorder.js +1 -2
  60. package/dist/residentExecutionEvidence.js +1 -2
  61. package/dist/retryPolicy.js +1 -2
  62. package/dist/runEventsTable.js +1 -2
  63. package/dist/runGeneration.js +1 -2
  64. package/dist/runRecording.js +1 -2
  65. package/dist/runStepsTable.js +1 -2
  66. package/dist/runnerStorageGuard.js +1 -2
  67. package/dist/runsTable.js +1 -2
  68. package/dist/scheduleDeclaration.js +1 -2
  69. package/dist/signalHint.js +1 -2
  70. package/dist/signals.js +1 -2
  71. package/dist/signalsSuspending.js +1 -2
  72. package/dist/sqliteWorkflowOwnership.js +1 -2
  73. package/dist/stalenessSweep.js +1 -2
  74. package/dist/startContextsTable.js +1 -2
  75. package/dist/startReceipt.js +1 -2
  76. package/dist/submissionRecovery.js +1 -2
  77. package/dist/submissionRejection.js +1 -2
  78. package/dist/submissionRetry.js +1 -2
  79. package/dist/suspensionUnavailable.js +1 -2
  80. package/dist/updates.js +1 -2
  81. package/dist/watermarkTable.js +1 -2
  82. package/dist/webCrypto.js +4 -17
  83. package/dist/workflowDelivery.js +1 -2
  84. package/dist/workflowExecutorRouting.js +1 -2
  85. package/dist/workflowJournal.js +1 -2
  86. package/dist/workflowJournalReset.js +1 -2
  87. package/dist/workflowReadSelections.js +1 -2
  88. package/dist/workflowRestartDispatch.js +1 -2
  89. package/dist/workflowRestartObservation.js +1 -2
  90. package/dist/workflowRestartPreparation.js +1 -2
  91. package/dist/workflowRestartReservation.js +4 -4
  92. package/dist/workflowResumeDispatch.js +1 -2
  93. package/dist/workflowRuntimeReadiness.js +1 -2
  94. package/dist/workflowShardRelocation.js +1 -2
  95. package/dist/workflowShardRelocationSql.js +1 -2
  96. package/package.json +5 -11
@@ -1,4 +1,4 @@
1
- //#region src/failureMessage.ts
1
+ // src/failureMessage.ts
2
2
  var e = (e) => {
3
3
  let t = e?.message;
4
4
  if (typeof t == "string" && t.length > 0) return t;
@@ -8,5 +8,4 @@ var e = (e) => {
8
8
  }
9
9
  return String(e);
10
10
  };
11
- //#endregion
12
11
  export { e as failureMessage };
@@ -2,7 +2,7 @@ import { FAILURE_REPORTS_TABLE as e } from "./failureReportStore.js";
2
2
  import { FailureReconciliationError as t, reconcileWorkflowFailureInTransaction as n } from "./failureHandoff.js";
3
3
  import { retryBackoffMs as r } from "./admissionStore.js";
4
4
  import { and as i, gt as a, isNotNull as o, isNull as s } from "@voltro/database";
5
- //#region src/failureRecovery.ts
5
+ // src/failureRecovery.ts
6
6
  var c = /* @__PURE__ */ new WeakMap(), l = async (l, u, d) => {
7
7
  let f = c.get(l), p = await l.store.query({
8
8
  table: e,
@@ -46,5 +46,4 @@ var c = /* @__PURE__ */ new WeakMap(), l = async (l, u, d) => {
46
46
  examined: p.length > 0
47
47
  });
48
48
  };
49
- //#endregion
50
49
  export { l as recoverWorkflowFailures };
@@ -1,7 +1,7 @@
1
1
  import { sealErrorText as e } from "./journalEncryption.js";
2
2
  import { Schema as t } from "effect";
3
3
  import { eq as n } from "@voltro/database";
4
- //#region src/failureReportStore.ts
4
+ // src/failureReportStore.ts
5
5
  var r = "_voltro_workflow_failure_reports", i = t.Struct({
6
6
  id: t.String,
7
7
  workflowName: t.String,
@@ -56,5 +56,4 @@ var r = "_voltro_workflow_failure_reports", i = t.Struct({
56
56
  acceptedExecutionId: null
57
57
  }), l;
58
58
  };
59
- //#endregion
60
59
  export { r as FAILURE_REPORTS_TABLE, a as readWorkflowFailureRecord, o as recordWorkflowFailureInTransaction };
@@ -1,6 +1,6 @@
1
1
  import { sealedSchema as e } from "./journalEncryption.js";
2
2
  import { Duration as t, Schema as n } from "effect";
3
- //#region src/flowControl.ts
3
+ // src/flowControl.ts
4
4
  var r = (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), i = (e) => e?.cancelOn !== void 0 && e.cancelOn.length > 0, a = [
5
5
  "debounce",
6
6
  "batch",
@@ -138,5 +138,4 @@ var r = (e) => e !== void 0 && (e.debounce !== void 0 || e.singleton !== void 0
138
138
  else r.workflows.push(n.workflowName);
139
139
  }
140
140
  };
141
- //#endregion
142
141
  export { a as DEFERRING_CONTROLS, f as assertConsistentPools, o as deferringControlsOf, i as hasCancelOn, r as hasFlowControl, d as validateFlowControl };
@@ -2,7 +2,7 @@ import { START_RECEIPTS_TABLE as e, decodeWorkflowStartReceipt as t } from "./st
2
2
  import { PENDING_TABLE as n } from "./admissionStore.js";
3
3
  import { Schema as r } from "effect";
4
4
  import { and as i, eq as a, isNull as o } from "@voltro/database";
5
- //#region src/forwardStartReceipts.ts
5
+ // src/forwardStartReceipts.ts
6
6
  var s = async (s, c) => {
7
7
  if (c.from === c.to) throw Error("Queue transfer requires distinct source and target");
8
8
  let l = await s.query({
@@ -37,5 +37,4 @@ var s = async (s, c) => {
37
37
  }
38
38
  }
39
39
  };
40
- //#endregion
41
40
  export { s as forwardStartReceipts };
@@ -1,7 +1,6 @@
1
1
  import { WorkflowEngine as e } from "effect/workflow";
2
2
  import { RateLimiter as t } from "effect/persistence";
3
3
  import { Layer as n } from "effect";
4
- //#region src/inMemoryLayer.ts
4
+ // src/inMemoryLayer.ts
5
5
  var r = n.merge(e.layerMemory, t.layer.pipe(n.provide(t.layerStoreMemory)));
6
- //#endregion
7
6
  export { r as inMemoryWorkflowEngineLayer };
@@ -1,6 +1,6 @@
1
1
  import { WorkflowRunRecorder as e } from "./recorder.js";
2
2
  import { Layer as t } from "effect";
3
- //#region src/inMemoryRecorder.ts
3
+ // src/inMemoryRecorder.ts
4
4
  var n = () => {
5
5
  let n = [], r = [], i = 0, a = 0;
6
6
  return {
@@ -52,5 +52,4 @@ var n = () => {
52
52
  readEvents: () => r
53
53
  };
54
54
  };
55
- //#endregion
56
55
  export { n as makeInMemoryRecorder };
package/dist/index.d.ts CHANGED
@@ -4290,7 +4290,9 @@ export declare const workflowRestartRequestsTable: Table<"_voltro_workflow_resta
4290
4290
  readonly requestedAt: ColumnBuilder<Date, "timestamp", boolean>;
4291
4291
  readonly dispatchAttempts: ColumnBuilder<number, "integer", true>;
4292
4292
  readonly enteredGeneration: ColumnBuilder<string | null, "text", boolean>;
4293
- }>, false, never>;
4293
+ /** Recovery acknowledgement is independent of command replay/entry authority. */
4294
+ readonly poolReleaseSettledAt: ColumnBuilder<Date | null, "timestamp", boolean>;
4295
+ }>, false, "_voltro_workflow_restart_requests_pool_settlement_idx">;
4294
4296
 
4295
4297
  declare type WorkflowRestartSelection = typeof Selection.Type;
4296
4298
 
@@ -3,7 +3,7 @@ import { _voltroWorkflowRunsTable as n } from "./runsTable.js";
3
3
  import { _voltroWorkflowRunStepsTable as r } from "./runStepsTable.js";
4
4
  import { eq as i, or as a, queryFor as o } from "@voltro/database";
5
5
  import { types as s } from "node:util";
6
- //#region src/inspectWorkflow.ts
6
+ // src/inspectWorkflow.ts
7
7
  var c = (e) => {
8
8
  if (e == null) return null;
9
9
  if (e instanceof Date) return e;
@@ -42,7 +42,7 @@ var c = (e) => {
42
42
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = !s.isProxy(e) && Object.getPrototypeOf(e) === Array.prototype && !Object.hasOwn(e, Symbol.iterator) && e.find === Array.prototype.find, i = 0;
43
43
  for (let a of e) {
44
44
  let o = r ? Object.getOwnPropertyDescriptor(e, String(i)) : void 0;
45
- (o === void 0 || !("value" in o) || !d(a)) && (r = !1), i++;
45
+ o !== void 0 && "value" in o && d(a) || (r = !1), i++;
46
46
  let s = String(a.stepName), c = t.get(s);
47
47
  c === void 0 ? (t.set(s, [a]), n.set(s, a)) : c.push(a);
48
48
  }
@@ -97,5 +97,4 @@ var c = (e) => {
97
97
  parentClosePolicy: u(m.parentClosePolicy)
98
98
  };
99
99
  };
100
- //#endregion
101
100
  export { m as inspectWorkflow };
@@ -1,7 +1,7 @@
1
1
  import { failureMessage as e } from "./failureMessage.js";
2
2
  import { Activity as t } from "effect/workflow";
3
3
  import { Cause as n, Context as r, Effect as i, Effectable as a, Schema as o, SchemaAST as s, SchemaGetter as c, SchemaIssue as l } from "effect";
4
- //#region src/journalEncryption.ts
4
+ // src/journalEncryption.ts
5
5
  var u = () => void 0, d = (e) => {
6
6
  u = typeof e == "function" ? e : () => e;
7
7
  }, f = () => u(), p = r.Reference("@voltro/workflow/CurrentWorkflowEncrypted", { defaultValue: () => !1 }), m = { column: "workflow-journal" }, h = /* @__PURE__ */ new Set(), g = (e) => {
@@ -143,5 +143,4 @@ var u = () => void 0, d = (e) => {
143
143
  }
144
144
  return `${r instanceof Error ? r.name : typeof r}: [withheld — workflow '${t}' is declared encrypted; the full cause is recorded sealed on its row]`;
145
145
  };
146
- //#endregion
147
146
  export { p as CurrentWorkflowEncrypted, j as SEALED_DEFECT_NAME, U as STEP_JOURNAL_BINDING, m as WORKFLOW_JOURNAL_BINDING, F as anyWorkflowEncrypted, H as encryptionAwareActivity, f as getWorkflowJournalCipher, y as isQueueEncrypted, x as isSealedJournalValue, b as isWorkflowEncrypted, K as loggableCause, v as markQueueEncrypted, g as markWorkflowEncrypted, N as openDefect, R as openErrorText, V as openEventPayload, w as openJournalValue, k as openPayloadFields, G as openWorkflowRow, M as sealDefect, I as sealErrorText, B as sealEventPayload, C as sealJournalValue, A as sealPayloadFields, D as sealedPayloadFields, E as sealedSchema, d as setWorkflowJournalCipher, L as tryOpenJournalValue };
@@ -1,5 +1,5 @@
1
1
  import { Context as e, Deferred as t, Effect as n, Option as r, Schedule as i, Semaphore as a } from "effect";
2
- //#region src/journalRoutingGuard.ts
2
+ // src/journalRoutingGuard.ts
3
3
  var o = (e) => n.gen(function* () {
4
4
  let r = e.pollMs ?? 1e3, o = e.verify;
5
5
  if (!Number.isSafeInteger(r) || r < 1 || r > 3e4) return yield* n.fail(/* @__PURE__ */ Error("Invalid journal routing probe interval"));
@@ -46,5 +46,4 @@ var o = (e) => n.gen(function* () {
46
46
  try: e,
47
47
  catch: (e) => e
48
48
  }));
49
- //#endregion
50
49
  export { s as JournalRoutingGuard, o as makeJournalRoutingGuard, l as ownedJournalRoutingPromise, c as protectJournalRoutingEffect, u as tryOwnedJournalRoutingPromise };
@@ -1,4 +1,4 @@
1
- //#region src/journalRoutingLayout.ts
1
+ // src/journalRoutingLayout.ts
2
2
  var e = (e) => {
3
3
  if (e !== "default" && e !== "api-workloads-v1") throw Error("Unknown journal routing layout");
4
4
  let t = e === "api-workloads-v1";
@@ -43,5 +43,4 @@ var e = (e) => {
43
43
  assigned: Object.freeze([...a])
44
44
  });
45
45
  };
46
- //#endregion
47
46
  export { r as journalExecutorGroups, e as journalRoutingLayout, t as journalRoutingTransitions, n as journalWorkflowGroup };
@@ -1,7 +1,7 @@
1
1
  import { Effect as e } from "effect";
2
2
  import { SqlClient as t } from "effect/sql";
3
3
  import { fnv1a64 as n } from "@voltro/database/sql";
4
- //#region src/journalRoutingLock.ts
4
+ // src/journalRoutingLock.ts
5
5
  var r = (r) => e.gen(function* () {
6
6
  let i = r.namespace, a = r.mode, o = r.timeoutMs ?? 3e4;
7
7
  if (!i || i.length > 256 || !["shared", "exclusive"].includes(a) || !Number.isSafeInteger(o) || o < 1 || o > 3e5) return yield* e.fail(/* @__PURE__ */ Error("Invalid journal routing lock options"));
@@ -35,5 +35,4 @@ var r = (r) => e.gen(function* () {
35
35
  }))
36
36
  };
37
37
  });
38
- //#endregion
39
38
  export { r as acquireJournalRoutingLock };
@@ -3,7 +3,7 @@ import { acquireJournalRoutingLock as t } from "./journalRoutingLock.js";
3
3
  import { JournalRoutingMaintenance as n } from "./workflowShardRelocationSql.js";
4
4
  import { Effect as r, Option as i } from "effect";
5
5
  import { SqlClient as a } from "effect/sql";
6
- //#region src/journalRoutingMaintenance.ts
6
+ // src/journalRoutingMaintenance.ts
7
7
  var o = (o, s = 3e4) => r.gen(function* () {
8
8
  let c = yield* a.SqlClient;
9
9
  return c.onDialectOrElse({
@@ -20,5 +20,4 @@ var o = (o, s = 3e4) => r.gen(function* () {
20
20
  return yield* e(c, l, n);
21
21
  })).pipe(r.provideService(a.SqlClient, c)) }) : yield* r.fail(/* @__PURE__ */ Error("Pinned journal maintenance currently requires PostgreSQL"));
22
22
  });
23
- //#endregion
24
23
  export { o as makePostgresJournalRoutingMaintenance };
@@ -2,7 +2,7 @@ import { protectJournalRoutingEffect as e } from "./journalRoutingGuard.js";
2
2
  import { Effect as t } from "effect";
3
3
  import { MessageStorage as n } from "effect/cluster";
4
4
  import { PersistenceError as r } from "effect/cluster/ClusterError";
5
- //#region src/journalRoutingMessageStorage.ts
5
+ // src/journalRoutingMessageStorage.ts
6
6
  var i = (i, a) => {
7
7
  let o = (e) => t.gen(function* () {
8
8
  return yield* yield* a.run(t.exit(e)).pipe(t.mapError((e) => new r({ cause: e })));
@@ -28,5 +28,4 @@ var i = (i, a) => {
28
28
  unregisterShardReplyHandlers: (e) => i.unregisterShardReplyHandlers(e)
29
29
  });
30
30
  };
31
- //#endregion
32
31
  export { i as guardJournalMessageStorage };
@@ -1,7 +1,7 @@
1
1
  import { workflowJournalRoutingTable as e } from "./journalRoutingTable.js";
2
2
  import { Effect as t } from "effect";
3
3
  import { SqlClient as n } from "effect/sql";
4
- //#region src/journalRoutingNamespace.ts
4
+ // src/journalRoutingNamespace.ts
5
5
  var r = t.gen(function* () {
6
6
  let r = (yield* n.SqlClient).withoutTransforms();
7
7
  if (!r.onDialectOrElse({
@@ -19,5 +19,4 @@ var r = t.gen(function* () {
19
19
  routingTable: r.literal(a.routing_table)
20
20
  });
21
21
  }), i = r.pipe(t.map((e) => e.namespace));
22
- //#endregion
23
22
  export { r as resolvePostgresJournalLocation, i as resolvePostgresJournalNamespace };
@@ -1,7 +1,7 @@
1
1
  import { journalRoutingLayout as e, journalWorkflowGroup as t } from "./journalRoutingLayout.js";
2
2
  import { Context as n } from "effect";
3
3
  import { ClusterSchema as r } from "effect/cluster";
4
- //#region src/journalRoutingRuntime.ts
4
+ // src/journalRoutingRuntime.ts
5
5
  var i = class extends n.Service()("@voltro/workflow/JournalRoutingLayout") {}, a = (e, i) => {
6
6
  let a = n.add(e.annotations, r.ShardGroup, () => t(i, e._tag));
7
7
  return new Proxy(e, { get(e, t, n) {
@@ -29,5 +29,4 @@ var i = class extends n.Service()("@voltro/workflow/JournalRoutingLayout") {}, a
29
29
  }
30
30
  };
31
31
  };
32
- //#endregion
33
32
  export { i as JournalRoutingLayout, a as routeJournalWorkflow, s as withJournalEntityRouting, o as withJournalWorkflowRouting };
@@ -1,7 +1,7 @@
1
1
  import { protectJournalRoutingEffect as e } from "./journalRoutingGuard.js";
2
2
  import { Effect as t, Stream as n } from "effect";
3
3
  import { Rpc as r, RpcSchema as i } from "effect/rpc";
4
- //#region src/journalRoutingSharding.ts
4
+ // src/journalRoutingSharding.ts
5
5
  var a = (a, o) => {
6
6
  let s = (i) => {
7
7
  if (typeof i == "object" && i && r.isWrapper(i)) return {
@@ -24,5 +24,4 @@ var a = (a, o) => {
24
24
  registerSingleton: (n, r, i) => e(o, t.suspend(() => a.registerSingleton(n, e(o, r), i)))
25
25
  };
26
26
  };
27
- //#endregion
28
27
  export { a as withJournalRoutingGuard };
@@ -8,7 +8,7 @@ import { JournalRoutingMaintenance as l, relocateWorkflowJournal as u } from "./
8
8
  import { makePostgresJournalRoutingMaintenance as d } from "./journalRoutingMaintenance.js";
9
9
  import { Effect as f, Option as p } from "effect";
10
10
  import { SqlClient as m } from "effect/sql";
11
- //#region src/journalRoutingState.ts
11
+ // src/journalRoutingState.ts
12
12
  var h = (e, t) => f.gen(function* () {
13
13
  let r = yield* e`SELECT c.relkind AS kind
14
14
  FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace
@@ -89,5 +89,4 @@ var h = (e, t) => f.gen(function* () {
89
89
  ...r
90
90
  };
91
91
  });
92
- //#endregion
93
92
  export { x as acquireGuardedPostgresJournalRoutingAdmission, b as acquirePostgresJournalRoutingAdmission, g as captureJournalRoutingState, y as readPostgresJournalRoutingState, _ as transitionPostgresJournalRouting };
@@ -1,5 +1,5 @@
1
1
  import { bigint as e, derivedRowId as t, id as n, table as r, text as i } from "@voltro/database";
2
- //#region src/journalRoutingTable.ts
2
+ // src/journalRoutingTable.ts
3
3
  var a = r("_voltro_workflow_journal_routing", {
4
4
  id: n({ prefix: "wfjr" }),
5
5
  namespace: i(),
@@ -7,5 +7,4 @@ var a = r("_voltro_workflow_journal_routing", {
7
7
  layout: i(),
8
8
  relocation: i()
9
9
  }).unique(["namespace"]).nonReactive(), o = (e) => t("wfjr", e);
10
- //#endregion
11
10
  export { o as workflowJournalRoutingRowId, a as workflowJournalRoutingTable };
@@ -1,10 +1,10 @@
1
1
  import { Effect as e } from "effect";
2
2
  import { SqlClient as t } from "effect/sql";
3
- //#region src/journalRoutingTransaction.ts
3
+ // src/journalRoutingTransaction.ts
4
4
  var n = (n, r, i) => t.makeWithTransaction({
5
5
  transactionService: n.transactionService,
6
6
  spanAttributes: [],
7
- acquireConnection: e.succeed([void 0, r]),
7
+ acquireConnection: () => e.succeed(r),
8
8
  begin: (t) => t.executeUnprepared("BEGIN", [], void 0).pipe(e.asVoid),
9
9
  commit: (t) => t.executeUnprepared("COMMIT", [], void 0).pipe(e.asVoid),
10
10
  rollback: (t) => t.executeUnprepared("ROLLBACK", [], void 0).pipe(e.asVoid),
@@ -12,5 +12,4 @@ var n = (n, r, i) => t.makeWithTransaction({
12
12
  rollbackSavepoint: (t, n) => t.executeUnprepared(`ROLLBACK TO SAVEPOINT voltro_routing_${n}`, [], void 0).pipe(e.asVoid),
13
13
  releaseSavepoint: (t, n) => t.executeUnprepared(`RELEASE SAVEPOINT voltro_routing_${n}`, [], void 0).pipe(e.asVoid)
14
14
  })(i);
15
- //#endregion
16
15
  export { n as withJournalRoutingTransaction };
package/dist/messages.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { openEventPayload as e } from "./journalEncryption.js";
2
2
  import { eq as t } from "@voltro/database";
3
- //#region src/messages.ts
3
+ // src/messages.ts
4
4
  var n = (e) => new Promise((t) => setTimeout(t, e)), r = () => {
5
5
  let e = globalThis.crypto;
6
6
  return typeof e?.randomUUID == "function" ? e.randomUUID() : `${Date.now().toString(36)}${Math.random().toString(36).slice(2)}`;
@@ -88,5 +88,4 @@ var n = (e) => new Promise((t) => setTimeout(t, e)), r = () => {
88
88
  await n(f);
89
89
  }
90
90
  };
91
- //#endregion
92
91
  export { o as WorkflowMessageNotRecorded, i as makeWorkflowUpdateId, a as resolveWorkflowMessageRun, s as sendWorkflowSignal, c as sendWorkflowUpdate };
@@ -1,6 +1,6 @@
1
1
  import { CurrentWorkflowRunId as e, WorkflowRunRecorder as t } from "./recorder.js";
2
2
  import { Context as n, Effect as r } from "effect";
3
- //#region src/nondeterminism.ts
3
+ // src/nondeterminism.ts
4
4
  var i = (e) => {
5
5
  let t = /* @__PURE__ */ new Map();
6
6
  for (let n of e) t.set(n.stepName, (t.get(n.stepName) ?? 0) + 1);
@@ -47,5 +47,4 @@ var i = (e) => {
47
47
  payload: o(e)
48
48
  }).then(() => void 0).catch(() => void 0));
49
49
  });
50
- //#endregion
51
50
  export { a as CurrentWorkflowReplayShape, i as makeReplayShapeTracker, o as nondeterminismEventPayload, s as reportNondeterminism };
@@ -2,7 +2,7 @@ import { acceptWorkflowControlInTransaction as e, hasUnsettledParentClosureContr
2
2
  import { cancelSuspendedWorkflowRunInTransaction as r } from "./runGeneration.js";
3
3
  import { Schema as i } from "effect";
4
4
  import { and as a, derivedRowId as o, eq as s, gt as c } from "@voltro/database";
5
- //#region src/parentClosure.ts
5
+ // src/parentClosure.ts
6
6
  var l = "_voltro_workflow_parent_closures", u = i.NonEmptyString, d = i.Struct({
7
7
  id: u,
8
8
  runId: u,
@@ -137,5 +137,4 @@ var l = "_voltro_workflow_parent_closures", u = i.NonEmptyString, d = i.Struct({
137
137
  wrapped: y
138
138
  };
139
139
  };
140
- //#endregion
141
140
  export { p as stageParentClosureAtChildEntry, m as stageWorkflowParentClosureInTransaction };
@@ -1,6 +1,6 @@
1
1
  import { stageWorkflowParentClosureInTransaction as e } from "./parentClosure.js";
2
2
  import { and as t, eq as n, gt as r, isNull as i } from "@voltro/database";
3
- //#region src/parentClosureRecovery.ts
3
+ // src/parentClosureRecovery.ts
4
4
  var a = "_voltro_workflow_parent_closures", o = /* @__PURE__ */ new WeakMap(), s = async (s, c, l) => {
5
5
  let u = o.get(s), d = await s.store.query({
6
6
  table: a,
@@ -50,5 +50,4 @@ var a = "_voltro_workflow_parent_closures", o = /* @__PURE__ */ new WeakMap(), s
50
50
  examined: d.length > 0
51
51
  });
52
52
  };
53
- //#endregion
54
53
  export { s as recoverWorkflowParentClosures };
@@ -3,7 +3,7 @@ import { persistReservedSubmission as t, readAdmissionSubmission as n, reserveAd
3
3
  import { bindWorkflowStartReceipts as i } from "./startReceipt.js";
4
4
  import { PENDING_TABLE as a, toPendingIntent as o } from "./admissionStore.js";
5
5
  import { eq as s } from "@voltro/database";
6
- //#region src/pendingSubmission.ts
6
+ // src/pendingSubmission.ts
7
7
  var c = async (e, r) => {
8
8
  if (new Set(r.intentIds).size !== r.intentIds.length) throw Error("Admitted transfer requires distinct pending identities");
9
9
  let c = await n(e, r.id);
@@ -81,5 +81,4 @@ var c = async (e, r) => {
81
81
  }
82
82
  };
83
83
  };
84
- //#endregion
85
84
  export { c as takeAdmittedSubmissionInTransaction, l as takePendingAdmissionSubmission, u as takePendingAdmissionSubmissionInTransaction };
@@ -1,5 +1,5 @@
1
1
  import { prepareAdmissionSubmissionExecutionInTransaction as e, readAdmissionSubmission as t } from "./admissionSubmission.js";
2
- //#region src/prepareSubmissionDispatch.ts
2
+ // src/prepareSubmissionDispatch.ts
3
3
  var n = async (n, r, i) => {
4
4
  let a = await n.transaction((e) => t(e, r.id));
5
5
  if (a === void 0 || a.workflowName !== r.workflowName || a.tenantId !== r.tenantId || a.ledgerId !== r.ledgerId) throw Error("Submission dispatch lost its resident owner");
@@ -13,5 +13,4 @@ var n = async (n, r, i) => {
13
13
  if (s.preparedExecutionId === null) throw Error("Submission preparation returned no execution identity");
14
14
  return s.preparedExecutionId;
15
15
  };
16
- //#endregion
17
16
  export { n as prepareSubmissionDispatch };
@@ -1,5 +1,5 @@
1
1
  import { Effect as e } from "effect";
2
- //#region src/preparedExecution.ts
2
+ // src/preparedExecution.ts
3
3
  var t = Symbol.for("@voltro/workflow/PreparedExecution"), n = (e, n) => {
4
4
  Object.defineProperty(e, t, {
5
5
  value: n,
@@ -10,5 +10,4 @@ var t = Symbol.for("@voltro/workflow/PreparedExecution"), n = (e, n) => {
10
10
  let o = n[t];
11
11
  return typeof o == "function" ? o(r, i, a?.discard ?? !0) : e.die(/* @__PURE__ */ Error("Workflow definition has no prepared-execution capability"));
12
12
  });
13
- //#endregion
14
13
  export { n as attachPreparedWorkflowExecution, i as executePreparedWorkflow, r as hasPreparedWorkflowExecution };
@@ -10,7 +10,7 @@ import { Activity as A, Activity as j, DurableClock as M, DurableClock as N, Dur
10
10
  import { RateLimiter as L } from "effect/persistence";
11
11
  import { Cause as R, Duration as z, Effect as B, Effectable as V, Schema as H } from "effect";
12
12
  import { attachWorkflowAccess as U, resolveWorkflowAccess as W } from "@voltro/protocol";
13
- //#region src/primitives.ts
13
+ // src/primitives.ts
14
14
  var G = Symbol.for("voltro.workflow.workerLayer"), K = Symbol.for("voltro.workflow.version"), q = "__voltroWorkflowMessages", J = "__voltroWorkflowFlowControl", Y = (e) => typeof e == "object" && !!e && e[G] === !0, X = (e) => (typeof e == "object" || typeof e == "function") && e !== null, re = (e) => X(e) && e[K] !== void 0 ? e[K] : {
15
15
  version: "1",
16
16
  compatibleWith: ["1"],
@@ -221,5 +221,4 @@ var G = Symbol.for("voltro.workflow.workerLayer"), K = Symbol.for("voltro.workfl
221
221
  execute: i.pipe(B.catchDefect((e) => B.die(s(e, c))))
222
222
  }));
223
223
  }, me = (e) => B.map(g, (t) => t.includes(e)), he = F.withCompensation, ge = A.idempotencyKey;
224
- //#endregion
225
224
  export { T as CurrentWorkflowReplayShape, x as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, u as DEFERRING_CONTROLS, J as WorkflowFlowControlProperty, q as WorkflowMessagesProperty, S as WorkflowScheduleProperty, K as WorkflowVersionTypeId, G as WorkflowWorkerLayerTypeId, d as assertConsistentPools, f as deferringControlsOf, N as durableClock, oe as durableQueue, te as durableQueueModule, ae as getWorkflowFlowControl, C as getWorkflowSchedule, re as getWorkflowVersionMetadata, p as hasCancelOn, m as hasFlowControl, X as isCarrier, Y as isWorkflowWorkerLayer, E as makeReplayShapeTracker, D as nondeterminismEventPayload, me as patch, se as processQueue, Q as queueWorker, ce as rateLimit, O as reportNondeterminism, $ as sleep, le as sleepUntil, pe as step, ge as stepIdempotencyKey, j as stepModule, h as validateFlowControl, w as validateWorkflowSchedule, he as withCompensation, ie as workflow, ne as workflowModule };
@@ -7,7 +7,7 @@ import { cancelSuspendedWorkflowRunInTransaction as c } from "./runGeneration.js
7
7
  import { Schema as l } from "effect";
8
8
  import { WorkflowQueuedCancellationResultSchema as u } from "@voltro/protocol";
9
9
  import { and as d, derivedRowId as f, eq as p, gt as m, id as h, json as g, table as _, text as v, timestamp as y } from "@voltro/database";
10
- //#region src/queuedCancellationRequest.ts
10
+ // src/queuedCancellationRequest.ts
11
11
  var b = _("_voltro_workflow_queued_cancellations", {
12
12
  id: h({ prefix: "wfqc" }),
13
13
  receiptId: v(),
@@ -360,5 +360,4 @@ var b = _("_voltro_workflow_queued_cancellations", {
360
360
  if (e.length < 100) return a;
361
361
  }
362
362
  };
363
- //#endregion
364
363
  export { k as acceptQueuedCancellationInTransaction, A as bindQueuedCancellationRunInTransaction, D as observeQueuedCancellationInTransaction, b as queuedCancellationRequestsTable, O as queuedCancellationResult, w as readQueuedCancellationRequestInTransaction, j as stageQueuedCancellationsAtRunEntry };
@@ -1,6 +1,6 @@
1
1
  import { acceptQueuedCancellationInTransaction as e, observeQueuedCancellationInTransaction as t, queuedCancellationResult as n } from "./queuedCancellationRequest.js";
2
2
  import { Schema as r } from "effect";
3
- //#region src/queuedControl.ts
3
+ // src/queuedControl.ts
4
4
  var i = r.Struct({
5
5
  requestId: r.NonEmptyString,
6
6
  receiptId: r.NonEmptyString,
@@ -17,5 +17,4 @@ var i = r.Struct({
17
17
  let o = r.decodeUnknownSync(i)(a);
18
18
  return n(o, await t(e, o));
19
19
  };
20
- //#endregion
21
20
  export { a as cancelQueuedWorkflowStartInTransaction, o as readQueuedWorkflowCancellationInTransaction };
package/dist/recorder.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Context as e, Effect as t } from "effect";
2
- //#region src/recorder.ts
2
+ // src/recorder.ts
3
3
  var n = class extends e.Service()("@voltro/WorkflowRunRecorder") {}, r = e.Reference("@voltro/workflow/CurrentWorkflowRunId", { defaultValue: () => void 0 }), i = e.Reference("@voltro/workflow/CurrentWorkflowExecutionId", { defaultValue: () => void 0 }), a = e.Reference("@voltro/workflow/CurrentWorkflowStep", { defaultValue: () => void 0 }), o = t.gen(function* () {
4
4
  let e = yield* i, t = yield* a;
5
5
  return e === void 0 || t === void 0 ? void 0 : {
@@ -7,5 +7,4 @@ var n = class extends e.Service()("@voltro/WorkflowRunRecorder") {}, r = e.Refer
7
7
  step: t
8
8
  };
9
9
  }), s = e.Reference("@voltro/workflow/CurrentWorkflowGeneration", { defaultValue: () => void 0 }), c = e.Reference("@voltro/workflow/CurrentWorkflowWakeTenant", { defaultValue: () => void 0 }), l = e.Reference("@voltro/workflow/CurrentWorkflowPatches", { defaultValue: () => [] }), u = () => r, d = () => i, f = class extends e.Service()("@voltro/WorkflowStepInterceptor") {};
10
- //#endregion
11
10
  export { i as CurrentWorkflowExecutionId, s as CurrentWorkflowGeneration, l as CurrentWorkflowPatches, r as CurrentWorkflowRunId, a as CurrentWorkflowStep, c as CurrentWorkflowWakeTenant, n as WorkflowRunRecorder, f as WorkflowStepInterceptorTag, o as currentWorkflowStep, d as getCurrentWorkflowExecutionId, u as getCurrentWorkflowRunId };
@@ -1,6 +1,6 @@
1
1
  import { Schema as e } from "effect";
2
2
  import { eq as t } from "@voltro/database";
3
- //#region src/residentExecutionEvidence.ts
3
+ // src/residentExecutionEvidence.ts
4
4
  var n = e.Struct({
5
5
  runId: e.NonEmptyString,
6
6
  workflowName: e.NonEmptyString,
@@ -60,5 +60,4 @@ var n = e.Struct({
60
60
  completedAt: c.closedAt
61
61
  };
62
62
  };
63
- //#endregion
64
63
  export { r as readResidentExecutionEvidence };
@@ -1,5 +1,5 @@
1
1
  import { Cause as e, Duration as t, Effect as n, Exit as r, Option as i, Schedule as a } from "effect";
2
- //#region src/retryPolicy.ts
2
+ // src/retryPolicy.ts
3
3
  var o = (e) => {
4
4
  if (typeof e != "object" || !e) return;
5
5
  let n = e.retryAfterMillis;
@@ -53,5 +53,4 @@ var o = (e) => {
53
53
  while: i
54
54
  });
55
55
  };
56
- //#endregion
57
56
  export { m as applyRetryPolicy, l as retryPolicyIsActive };
@@ -1,6 +1,6 @@
1
1
  import { _voltroWorkflowRunsTable as e } from "./runsTable.js";
2
2
  import { id as t, integer as n, json as r, reference as i, table as a, text as o, timestamp as s } from "@voltro/database";
3
- //#region src/runEventsTable.ts
3
+ // src/runEventsTable.ts
4
4
  var c = a("_voltro_workflow_run_events", {
5
5
  id: t({ prefix: "wfev" }),
6
6
  runId: i(() => e, {
@@ -13,5 +13,4 @@ var c = a("_voltro_workflow_run_events", {
13
13
  stepName: o().nullable(),
14
14
  attempt: n().nullable()
15
15
  }).index(["runId", "occurredAt"]).index(["eventType"]);
16
- //#endregion
17
16
  export { c as _voltroWorkflowRunEventsTable };
@@ -10,7 +10,7 @@ import { stageQueuedCancellationsAtRunEntry as g } from "./queuedCancellationReq
10
10
  import { Schema as _ } from "effect";
11
11
  import { derivedRowId as v, eq as y } from "@voltro/database";
12
12
  import { createHash as b } from "node:crypto";
13
- //#region src/runGeneration.ts
13
+ // src/runGeneration.ts
14
14
  var x = "_voltro_workflow_runs", S = _.NullOr(_.Struct({
15
15
  requestId: _.NonEmptyString,
16
16
  restartToken: _.NullOr(_.NonEmptyString)
@@ -341,5 +341,4 @@ var x = "_voltro_workflow_runs", S = _.NullOr(_.Struct({
341
341
  terminalEvent: w
342
342
  };
343
343
  }, A = (e, t) => k(e, t, "running");
344
- //#endregion
345
344
  export { D as cancelSuspendedWorkflowRunInTransaction, A as completeWorkflowRunGenerationInTransaction, w as enterWorkflowRestartGenerationInTransaction, T as enterWorkflowRunGenerationInTransaction, O as suspendWorkflowRunGenerationInTransaction };
@@ -10,7 +10,7 @@ import { Cause as v, Effect as y, Exit as b, Fiber as x } from "effect";
10
10
  import { publishServerError as S } from "@voltro/protocol";
11
11
  import { eq as C } from "@voltro/database";
12
12
  import { WorkflowInstance as w } from "effect/workflow/WorkflowEngine";
13
- //#region src/runRecording.ts
13
+ // src/runRecording.ts
14
14
  var T = 8192, E = 3, D = 2e3, O = () => {
15
15
  let e = (e) => {
16
16
  if (e === void 0) return;
@@ -611,5 +611,4 @@ var T = 8192, E = 3, D = 2e3, O = () => {
611
611
  }))), Q;
612
612
  }));
613
613
  };
614
- //#endregion
615
614
  export { E as DEFAULT_MAX_RUN_RECLAIMS, D as DEFAULT_REPLAY_SHAPE_LIMIT, F as makeWorkflowRunRecorder, k as normaliseWorkflowPatches, O as resolveRunGuardTuning, P as serialiseWorkflowRowForWire, M as truncateWorkflowValue, I as wrapWorkflowExecuteWithRunRecording };
@@ -1,6 +1,6 @@
1
1
  import { _voltroWorkflowRunsTable as e } from "./runsTable.js";
2
2
  import { id as t, integer as n, json as r, reference as i, table as a, text as o, timestamp as s } from "@voltro/database";
3
- //#region src/runStepsTable.ts
3
+ // src/runStepsTable.ts
4
4
  var c = a("_voltro_workflow_run_steps", {
5
5
  id: t({ prefix: "wfstep" }),
6
6
  runId: i(() => e, {
@@ -24,5 +24,4 @@ var c = a("_voltro_workflow_run_steps", {
24
24
  completedAt: s().nullable(),
25
25
  durationMs: n().nullable()
26
26
  }).index(["runId", "stepName"]).index(["startedAt"]);
27
- //#endregion
28
27
  export { c as _voltroWorkflowRunStepsTable };
@@ -1,7 +1,7 @@
1
1
  import { Duration as e, Effect as t, Schedule as n } from "effect";
2
2
  import { RunnerStorage as r } from "effect/cluster";
3
3
  import { PersistenceError as i } from "effect/cluster/ClusterError";
4
- //#region src/runnerStorageGuard.ts
4
+ // src/runnerStorageGuard.ts
5
5
  var a = (a, o) => t.gen(function* () {
6
6
  let s = e.fromInputUnsafe(o.interval), c = e.toMillis(o.giveUpAfter), l, u, d = !1, f = !1;
7
7
  yield* o.probe.pipe(t.timeout(s), t.isSuccess, t.flatMap((e) => t.sync(() => {
@@ -25,5 +25,4 @@ var a = (a, o) => t.gen(function* () {
25
25
  })
26
26
  });
27
27
  });
28
- //#endregion
29
28
  export { a as guardRunnerStorage };
package/dist/runsTable.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { boolean as e, id as t, integer as n, json as r, table as i, text as a, timestamp as o } from "@voltro/database";
2
- //#region src/runsTable.ts
2
+ // src/runsTable.ts
3
3
  var s = i("_voltro_workflow_runs", {
4
4
  id: t({ prefix: "wfrun" }),
5
5
  tag: a(),
@@ -38,5 +38,4 @@ var s = i("_voltro_workflow_runs", {
38
38
  "abandon"
39
39
  ]).nullable()
40
40
  }).index(["tag"]).index(["status"]).index(["source"]).index(["startedAt"]).index(["parentExecutionId"]).index(["parentClosePolicy"]);
41
- //#endregion
42
41
  export { s as _voltroWorkflowRunsTable };
@@ -1,5 +1,5 @@
1
1
  import { Cron as e, Duration as t, Result as n } from "effect";
2
- //#region src/scheduleDeclaration.ts
2
+ // src/scheduleDeclaration.ts
3
3
  var r = 864e5, i = /* @__PURE__ */ new Set([
4
4
  "skip",
5
5
  "buffer",
@@ -40,5 +40,4 @@ var r = 864e5, i = /* @__PURE__ */ new Set([
40
40
  let t = e[c];
41
41
  return t === void 0 ? void 0 : t;
42
42
  };
43
- //#endregion
44
43
  export { r as DEFAULT_WORKFLOW_SCHEDULE_MAX_RUNTIME_MS, c as WorkflowScheduleProperty, l as getWorkflowSchedule, o as validateWorkflowSchedule };