@voltro/runtime 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 (179) hide show
  1. package/CHANGELOG.md +169 -6
  2. package/THIRD-PARTY-NOTICES.md +644 -48
  3. package/dist/aggregate.js +1 -2
  4. package/dist/aggregateExtrema.js +1 -2
  5. package/dist/aggregateIvm.js +1 -2
  6. package/dist/analyticsMirror.js +1 -2
  7. package/dist/analyticsSink.js +1 -2
  8. package/dist/apiKeyUsage.js +1 -2
  9. package/dist/apiKeys.js +1 -2
  10. package/dist/apiKeysWiring.js +1 -2
  11. package/dist/apiRoleBucketSampler.js +1 -2
  12. package/dist/apiRoleWorkloadHistory.js +1 -2
  13. package/dist/apiRoleWorkloadMetrics.js +1 -2
  14. package/dist/apiRoleWorkloadStorage.js +1 -2
  15. package/dist/approvalBuiltins.js +1 -2
  16. package/dist/approvals.js +1 -2
  17. package/dist/authMiddlewareLayer.js +1 -2
  18. package/dist/bindEvent.js +1 -2
  19. package/dist/boot-refusal.d.ts +10 -0
  20. package/dist/{bootRefusal.js → boot-refusal.js} +1 -2
  21. package/dist/bootListener.js +154 -65
  22. package/dist/bootStoreCodec.js +1 -2
  23. package/dist/businessRules.js +1 -2
  24. package/dist/changeClaimsTable.js +1 -2
  25. package/dist/columnOnUpdate.js +1 -2
  26. package/dist/composeAnalytics.js +1 -2
  27. package/dist/computedQuery.js +1 -2
  28. package/dist/computedQueryCache.js +136 -78
  29. package/dist/connectionBuiltins.js +1 -2
  30. package/dist/connectionCredentials.js +1 -2
  31. package/dist/connectionState.js +1 -2
  32. package/dist/connectionVault.js +1 -2
  33. package/dist/connectionsFacade.js +1 -2
  34. package/dist/coordinatedSchedule.js +1 -2
  35. package/dist/crdtHistory.js +1 -2
  36. package/dist/crdtMerge.js +1 -2
  37. package/dist/crdtVersionsTable.js +1 -2
  38. package/dist/credentialBound.js +1 -2
  39. package/dist/crud.js +1 -2
  40. package/dist/dataStore.js +1 -2
  41. package/dist/dataloader.js +1 -2
  42. package/dist/declaredTablesGuard.js +1 -2
  43. package/dist/defineExecutor.js +1 -2
  44. package/dist/dependencyGraph.js +1 -2
  45. package/dist/devices.js +1 -2
  46. package/dist/devicesWiring.js +1 -2
  47. package/dist/dialectReplicationAdapter.js +1 -2
  48. package/dist/dispatcher.js +1 -2
  49. package/dist/effectStore.js +1 -2
  50. package/dist/engineClients.js +1 -2
  51. package/dist/eventBus.js +1 -2
  52. package/dist/eventPublish.js +1 -2
  53. package/dist/events.js +1 -2
  54. package/dist/expectation.js +1 -2
  55. package/dist/expectationEvaluator.js +2 -3
  56. package/dist/experiment.js +1 -2
  57. package/dist/experimentEvaluator.js +1 -2
  58. package/dist/externalizedTasks.js +1 -2
  59. package/dist/fieldCipher.js +1 -2
  60. package/dist/fieldKeyRegistry.js +1 -2
  61. package/dist/fieldKeyRekey.js +1 -2
  62. package/dist/fieldKeyScan.js +1 -2
  63. package/dist/fieldKeyring.js +1 -2
  64. package/dist/fingerprint.js +1 -2
  65. package/dist/finops.js +1 -2
  66. package/dist/finopsAccountant.js +1 -2
  67. package/dist/handlerBody.js +1 -2
  68. package/dist/healthProbes.js +1 -2
  69. package/dist/hotDataStore.js +1 -2
  70. package/dist/hotDataStoreSnapshot.js +1 -2
  71. package/dist/hotDataStoreTables.js +1 -2
  72. package/dist/http-range.js +1 -2
  73. package/dist/httpClientSsrf.js +1 -2
  74. package/dist/httpClientTracing.js +1 -2
  75. package/dist/httpCompression.js +1 -2
  76. package/dist/httpInputStream.js +1 -2
  77. package/dist/httpKeepAlive.js +1 -2
  78. package/dist/httpRouteMounts.js +1 -2
  79. package/dist/idempotencyStore.js +1 -2
  80. package/dist/idleDetector.js +1 -2
  81. package/dist/index.d.ts +22 -2
  82. package/dist/index.js +109 -110
  83. package/dist/insertRequiredColumns.js +1 -2
  84. package/dist/instanceMembership.js +1 -2
  85. package/dist/ivm.js +1 -2
  86. package/dist/kvDataStore.js +1 -2
  87. package/dist/kvFacade.js +1 -2
  88. package/dist/matcher.js +1 -2
  89. package/dist/memoryColumnDefaults.js +1 -2
  90. package/dist/memoryQueryJoins.js +1 -2
  91. package/dist/memorySetOperations.js +1 -2
  92. package/dist/metrics.js +1 -2
  93. package/dist/observability.js +2 -3
  94. package/dist/observedGraph.js +1 -2
  95. package/dist/originGuard.js +1 -2
  96. package/dist/outbox.js +1 -2
  97. package/dist/pluginRefRules.js +1 -2
  98. package/dist/policyGuardResolver.js +1 -2
  99. package/dist/preview.js +1 -2
  100. package/dist/projectedRows.js +1 -2
  101. package/dist/provenance.js +1 -2
  102. package/dist/rangeIndex.js +1 -2
  103. package/dist/rawReadScope.js +2 -3
  104. package/dist/reaction.js +1 -2
  105. package/dist/reactiveConfig.js +1 -2
  106. package/dist/readClassification.js +1 -2
  107. package/dist/readRecorder.js +1 -2
  108. package/dist/readScopePredicate.js +1 -2
  109. package/dist/rebac.js +1 -2
  110. package/dist/rebacInterceptor.js +1 -2
  111. package/dist/registry.js +1 -2
  112. package/dist/relevantFields.js +1 -2
  113. package/dist/replicaHealth.js +1 -2
  114. package/dist/replicaLocality.js +1 -2
  115. package/dist/replicaObservations.js +1 -2
  116. package/dist/replicaSelection.js +1 -2
  117. package/dist/replicatedDataStore.js +1 -2
  118. package/dist/requestLoader.js +1 -2
  119. package/dist/resumeCensus.js +1 -2
  120. package/dist/revalidation.js +1 -2
  121. package/dist/rowFilter.js +1 -2
  122. package/dist/rowStateBytes.js +1 -2
  123. package/dist/rpcBodyCap.js +1 -2
  124. package/dist/rpcConnections.js +1 -2
  125. package/dist/rpcDefectDiagnostics.js +1 -2
  126. package/dist/rpcServer.js +1 -2
  127. package/dist/rpcWorkloadAdmission.js +1 -2
  128. package/dist/runAsSystem.js +1 -2
  129. package/dist/rywPositionStore.js +1 -2
  130. package/dist/schedule.js +1 -2
  131. package/dist/scheduleBackfillRequests.js +1 -2
  132. package/dist/scheduleClaimsTable.js +1 -2
  133. package/dist/scheduleRunsTable.js +1 -2
  134. package/dist/scheduler.js +1 -2
  135. package/dist/schemaRegistry.js +1 -2
  136. package/dist/secretsResolver.js +1 -2
  137. package/dist/securityHeaders.js +1 -2
  138. package/dist/servePipeline.js +198 -183
  139. package/dist/serverOnlyAudit.js +1 -2
  140. package/dist/serverTracer.js +1 -2
  141. package/dist/serviceCredentials.js +1 -2
  142. package/dist/setReadScopes.js +1 -2
  143. package/dist/singleNodeOrchestrator.js +1 -2
  144. package/dist/snapshotValueCodec.js +1 -2
  145. package/dist/sourceResolution.js +1 -2
  146. package/dist/storeMiddleware.js +3 -4
  147. package/dist/storeQuery.js +1 -2
  148. package/dist/storeRead.js +1 -2
  149. package/dist/subscriber.js +1 -2
  150. package/dist/subscriptionOutbox.js +1 -2
  151. package/dist/subscriptionRegistry.js +1 -2
  152. package/dist/subscriptionResume.js +1 -2
  153. package/dist/subscriptionSocketMetrics.js +1 -2
  154. package/dist/systemSubject.js +1 -2
  155. package/dist/tenantScope.js +1 -2
  156. package/dist/tenantSelection.js +1 -2
  157. package/dist/timeline.js +1 -2
  158. package/dist/traceContext.js +1 -2
  159. package/dist/traceSink.js +1 -2
  160. package/dist/traceSpansTable.js +1 -2
  161. package/dist/traceparent.js +1 -2
  162. package/dist/transactionSubject.js +1 -2
  163. package/dist/trustedProxy.js +2 -3
  164. package/dist/undo.js +1 -2
  165. package/dist/undoBuiltins.js +1 -2
  166. package/dist/undoCapture.js +1 -2
  167. package/dist/undoLogTable.js +1 -2
  168. package/dist/upsertBinding.js +1 -2
  169. package/dist/wakeOrchestrator.js +1 -2
  170. package/dist/wakeRegistry.js +1 -2
  171. package/dist/wakeRouter.js +1 -2
  172. package/dist/wakeSupervisor.js +1 -2
  173. package/dist/wakeupsTable.js +1 -2
  174. package/dist/webSocketGatewayRuntime.js +1 -2
  175. package/dist/webhookVerification.js +1 -2
  176. package/dist/wireColumnStrip.js +1 -2
  177. package/dist/workflowReadBuiltins.js +1 -2
  178. package/dist/workflowRuntime.js +1 -2
  179. package/package.json +26 -19
@@ -3,7 +3,7 @@ import { currentRequestLoader as n } from "./requestLoader.js";
3
3
  import { Effect as r } from "effect";
4
4
  import { setPolicyGuardResolver as i } from "@voltro/protocol";
5
5
  import { createLogger as a } from "@voltro/logger";
6
- //#region src/policyGuardResolver.ts
6
+ // src/policyGuardResolver.ts
7
7
  var o = a({ scope: "voltro:policy" }), s, c = (e) => {
8
8
  s = e;
9
9
  }, l = () => s, u = (e) => s === void 0 && (s = e, !0), d = () => {
@@ -51,5 +51,4 @@ var o = a({ scope: "voltro:policy" }), s, c = (e) => {
51
51
  });
52
52
  }));
53
53
  };
54
- //#endregion
55
54
  export { l as getTupleSource, d as installPolicyGuardResolver, u as registerDefaultTupleSource, c as setTupleSource };
package/dist/preview.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/preview.ts
1
+ // src/preview.ts
2
2
  var e = (e) => {
3
3
  let t = e.new?.id;
4
4
  if (typeof t == "string") return t;
@@ -58,5 +58,4 @@ var e = (e) => {
58
58
  if (!i) throw Error("preview: handler did not complete");
59
59
  return n;
60
60
  };
61
- //#endregion
62
61
  export { n as buildPreview, t as diffChange, i as previewInRollback };
@@ -1,4 +1,4 @@
1
- //#region src/projectedRows.ts
1
+ // src/projectedRows.ts
2
2
  var e = (e, t) => {
3
3
  let n = [], r = e.length;
4
4
  for (let i = 0; i < r; i += 1) {
@@ -8,5 +8,4 @@ var e = (e, t) => {
8
8
  }
9
9
  return n;
10
10
  };
11
- //#endregion
12
11
  export { e as collectProjectedRows };
@@ -1,4 +1,4 @@
1
- //#region src/provenance.ts
1
+ // src/provenance.ts
2
2
  var e = (e) => e instanceof Date ? e.toISOString() : typeof e == "string" && e.length > 0 ? e : null, t = (e) => typeof e == "string" && e.length > 0 ? e : null, n = [
3
3
  "updatedAt",
4
4
  "createdAt",
@@ -59,5 +59,4 @@ var e = (e) => e instanceof Date ? e.toISOString() : typeof e == "string" && e.l
59
59
  found: i.length > 0
60
60
  };
61
61
  };
62
- //#endregion
63
62
  export { a as historyProvenance, i as lastWriteProvenance };
@@ -1,4 +1,4 @@
1
- //#region src/rangeIndex.ts
1
+ // src/rangeIndex.ts
2
2
  var e = (e) => e?.height ?? 0, t = (t) => (t.height = 1 + Math.max(e(t.left), e(t.right)), t), n = (e) => {
3
3
  let n = e.left;
4
4
  return e.left = n.right, n.right = t(e), t(n);
@@ -85,5 +85,4 @@ var e = (e) => e?.height ?? 0, t = (t) => (t.height = 1 + Math.max(e(t.left), e(
85
85
  return r;
86
86
  }
87
87
  };
88
- //#endregion
89
88
  export { l as RangeIndex };
@@ -1,11 +1,11 @@
1
1
  import { resolveReactiveConfig as e } from "./reactiveConfig.js";
2
2
  import { AsyncLocalStorage as t } from "node:async_hooks";
3
- //#region src/rawReadScope.ts
3
+ // src/rawReadScope.ts
4
4
  var n = new t(), r = () => {
5
5
  n.getStore() !== void 0 && n.enterWith({ observations: [] });
6
6
  }, i = (t) => {
7
7
  let r = n.getStore();
8
- r === void 0 && (r = { observations: [] }, n.enterWith(r)), r.membership !== void 0 && !a(t) && (r.membership = void 0, r.exposed = !0), !r.exposed && r.membership === void 0 && r.observations.length >= 128 && a(t) && (r.observations.every(a) ? r.membership = new Set(r.observations.map((e) => e.sql)) : r.exposed = !0), !(r.membership?.has(t.sql) ?? r.observations.some((e) => e.sql === t.sql)) && (r.observations.length >= e().rawReadTrackingLimit || (r.observations.push(t), r.membership?.add(t.sql)));
8
+ r === void 0 && (r = { observations: [] }, n.enterWith(r)), r.membership !== void 0 && !a(t) && (r.membership = void 0, r.exposed = !0), !r.exposed && r.membership === void 0 && r.observations.length >= 128 && a(t) && (r.observations.every(a) ? r.membership = new Set(r.observations.map((e) => e.sql)) : r.exposed = !0), (r.membership?.has(t.sql) ?? r.observations.some((e) => e.sql === t.sql)) || r.observations.length >= e().rawReadTrackingLimit || (r.observations.push(t), r.membership?.add(t.sql));
9
9
  }, a = (e) => {
10
10
  let t = Object.getOwnPropertyDescriptor(e, "sql");
11
11
  return Object.isFrozen(e) && t !== void 0 && "value" in t && typeof t.value == "string";
@@ -13,5 +13,4 @@ var n = new t(), r = () => {
13
13
  let e = n.getStore();
14
14
  return e === void 0 ? [] : (e.exposed = !0, e.membership = void 0, e.observations);
15
15
  }, s = (e) => n.run({ observations: [] }, e), c = (e) => e.join("?").replace(/\s+/g, " ").trim();
16
- //#endregion
17
16
  export { o as currentRawReads, r as isolateRawReadScope, c as rawSqlPreview, i as recordRawRead, s as runWithRawReadScope };
package/dist/reaction.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/reaction.ts
1
+ // src/reaction.ts
2
2
  var e = (e) => typeof e.query == "string", t = (t) => e(t.watch), n = /^(\d+(?:\.\d+)?)\s*(ms|milliseconds?|s|seconds?|m|minutes?|h|hours?|d|days?)$/i, r = (e, t, r) => {
3
3
  if (typeof e == "number") {
4
4
  if (!Number.isFinite(e) || e <= 0) throw Error(`reaction '${r}': ${t} must be a positive duration`);
@@ -81,5 +81,4 @@ var c = (e) => {
81
81
  via: "agent"
82
82
  }), "acted");
83
83
  };
84
- //#endregion
85
84
  export { i as DEFAULT_LEVEL_RESYNC_MS, o as DEFAULT_LEVEL_STUCK_MS, a as MIN_LEVEL_RESYNC_MS, d as ReactionRateLimiter, s as defineReaction, t as isLevelReaction, e as isLevelWatch, r as reactionDurationMs, f as reactionRateBucketKey, p as runReaction };
@@ -1,4 +1,4 @@
1
- //#region src/reactiveConfig.ts
1
+ // src/reactiveConfig.ts
2
2
  var e = 8, t = 32, n = (e) => {
3
3
  if (e == null || e === "") return;
4
4
  let t = Number(e);
@@ -7,5 +7,4 @@ var e = 8, t = 32, n = (e) => {
7
7
  deliveryConcurrency: n(t.VOLTRO_REACTIVE_DELIVERY_CONCURRENCY) ?? n(e?.deliveryConcurrency) ?? 8,
8
8
  rawReadTrackingLimit: n(t.VOLTRO_RAW_READ_TRACKING_LIMIT) ?? n(e?.rawReadTrackingLimit) ?? 32
9
9
  });
10
- //#endregion
11
10
  export { e as DEFAULT_DELIVERY_CONCURRENCY, t as DEFAULT_RAW_READ_TRACKING_LIMIT, r as resolveReactiveConfig };
@@ -1,5 +1,5 @@
1
1
  import { getRelations as e } from "@voltro/database";
2
- //#region src/readClassification.ts
2
+ // src/readClassification.ts
3
3
  var t = (e) => {
4
4
  if (typeof e != "object" || !e) return;
5
5
  let t = e.subquery;
@@ -53,5 +53,4 @@ var t = (e) => {
53
53
  restricting: i
54
54
  };
55
55
  };
56
- //#endregion
57
56
  export { a as classifyRead };
@@ -2,7 +2,7 @@ import { classifyRead as e } from "./readClassification.js";
2
2
  import { noteCacheRead as t } from "./computedQueryCache.js";
3
3
  import { Effect as n } from "effect";
4
4
  import { AsyncLocalStorage as r } from "node:async_hooks";
5
- //#region src/readRecorder.ts
5
+ // src/readRecorder.ts
6
6
  var i = new r(), a, o = /* @__PURE__ */ new Set(), s = (e) => {
7
7
  a = e, o.clear();
8
8
  }, c = () => a !== void 0, l = (e, t) => {
@@ -63,5 +63,4 @@ var i = new r(), a, o = /* @__PURE__ */ new Set(), s = (e) => {
63
63
  if (i.length = a, i.sort(), i.length !== 0) return `${e}: read ${i.map((e) => `\`${e}\``).join(", ")} without declaring ${i.length === 1 ? "it" : "them"} in \`source:\`.\n A write to ${i.length === 1 ? "that table" : "those tables"} will not re-run this query, so an open view keeps\n showing what it showed before. The write itself is fine, which is why nothing else reports this.
64
64
  Observed on this boot — a branch that did not run contributes nothing, so this names what WAS\n read and never claims the declaration is otherwise complete.` + (r.size > 0 ? `\n Not counted (read only to narrow the result): ${[...r].sort().map((e) => `\`${e}\``).join(", ")}.` : "");
65
65
  };
66
- //#endregion
67
66
  export { l as enterReadRecording, p as noteRead, c as readRecordingActive, u as recordReads, m as recordingStore, d as restrictingReads, f as restrictingReadsEffect, s as setSourceGapSink, h as sourceGapReport };
@@ -1,5 +1,5 @@
1
1
  import { and as e } from "@voltro/database";
2
- //#region src/readScopePredicate.ts
2
+ // src/readScopePredicate.ts
3
3
  var t = (t, n) => {
4
4
  let r = t.setOp === void 0 ? t.alias ?? ((t.joins?.length ?? 0) > 0 ? t.table : void 0) : void 0, i = n((e) => r === void 0 ? e : `${r}.${e}`);
5
5
  return {
@@ -8,5 +8,4 @@ var t = (t, n) => {
8
8
  predicate: t.predicate ? e(t.predicate, i) : i
9
9
  };
10
10
  };
11
- //#endregion
12
11
  export { t as addReadScopePredicate };
package/dist/rebac.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema as e } from "effect";
2
- //#region src/rebac.ts
2
+ // src/rebac.ts
3
3
  var t = "admin:full", n = class extends e.TaggedError()("AccessDenied", {
4
4
  action: e.String,
5
5
  resourceType: e.String,
@@ -100,5 +100,4 @@ var t = "admin:full", n = class extends e.TaggedError()("AccessDenied", {
100
100
  let n = new Set(t.map((e) => e.id));
101
101
  return e.filter((e) => !n.has(e.id)).map((e) => e.id);
102
102
  };
103
- //#endregion
104
103
  export { n as AccessDenied, t as REBAC_ADMIN_SCOPE, f as assertCan, d as can, s as clearResourcePolicies, i as defineResourcePolicy, u as effectiveRelations, a as getResourcePolicy, o as listResourcePolicies, c as rebacPolicyGraph, g as revokedIds, h as visibleRows };
@@ -1,7 +1,7 @@
1
1
  import { AccessDenied as e, can as t, getResourcePolicy as n, visibleRows as r } from "./rebac.js";
2
2
  import { Effect as i } from "effect";
3
3
  import { and as a, eq as o, id as s, table as c, text as l, timestamp as u } from "@voltro/database";
4
- //#region src/rebacInterceptor.ts
4
+ // src/rebacInterceptor.ts
5
5
  var d = c("_voltro_rebac_tuples", {
6
6
  id: s({ prefix: "rbct" }),
7
7
  subjectId: l(),
@@ -77,5 +77,4 @@ var d = c("_voltro_rebac_tuples", {
77
77
  });
78
78
  };
79
79
  };
80
- //#endregion
81
80
  export { d as _voltroRebacTuplesTable, m as buildRebacInterceptor, g as buildRebacReadFilter, f as loadResourceTuples, h as loadSubjectTuples };
package/dist/registry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Effect as e } from "effect";
2
2
  import { ValidationError as t, ValidationErrors as n, effectiveScopes as r, hasEffectiveScope as i, recheckGuardsEffect as a } from "@voltro/protocol";
3
- //#region src/registry.ts
3
+ // src/registry.ts
4
4
  var o = (t) => ({
5
5
  has: (e) => i(t, e),
6
6
  hasAny: (e) => e.some((e) => i(t, e)),
@@ -25,5 +25,4 @@ var o = (t) => ({
25
25
  ...a === void 0 ? {} : { params: a }
26
26
  }))
27
27
  };
28
- //#endregion
29
28
  export { s as appValidation, o as makeAppAccess };
@@ -1,6 +1,6 @@
1
1
  import { resolveDependentTables as e } from "./dependencyGraph.js";
2
2
  import { getRelations as t, getTable as n, isColumnReference as r } from "@voltro/database";
3
- //#region src/relevantFields.ts
3
+ // src/relevantFields.ts
4
4
  var i = (e) => e.alias !== void 0 || (e.joins?.length ?? 0) > 0 || e.setOp !== void 0 || e.ctes !== void 0 && e.ctes.length > 0 || e.aggregations !== void 0 && e.aggregations.some((e) => e.op.startsWith("window-")), a = /* @__PURE__ */ new Set(["*"]), o = (e, t) => {
5
5
  if (e !== void 0) {
6
6
  if ("not" in e) o(e.not, t);
@@ -61,5 +61,4 @@ var i = (e) => e.alias !== void 0 || (e.joins?.length ?? 0) > 0 || e.setOp !== v
61
61
  for (let e of r) if (n.has(e)) return !0;
62
62
  return !1;
63
63
  };
64
- //#endregion
65
64
  export { a as ALL_COLUMNS, f as isEventRelevant, d as mutatedColumns, u as resolveRelevantFields };
@@ -1,4 +1,4 @@
1
- //#region src/replicaHealth.ts
1
+ // src/replicaHealth.ts
2
2
  var e = (e = {}) => {
3
3
  let t = e.thresholdFailures ?? 3, n = e.windowMs ?? 1e4, r = e.blackoutMs ?? 6e4, i = e.now ?? Date.now, a = /* @__PURE__ */ new Map(), o = (e) => {
4
4
  let t = a.get(e);
@@ -38,5 +38,4 @@ var e = (e = {}) => {
38
38
  }
39
39
  };
40
40
  };
41
- //#endregion
42
41
  export { e as replicaHealth };
@@ -1,4 +1,4 @@
1
- //#region src/replicaLocality.ts
1
+ // src/replicaLocality.ts
2
2
  var e = (e) => {
3
3
  let { currentRegion: t, replicaRegions: n, inner: r } = e, i = (e) => {
4
4
  if (t === void 0) return {
@@ -40,5 +40,4 @@ var e = (e) => {
40
40
  if (typeof n == "string" && n.length > 0) return n;
41
41
  }
42
42
  };
43
- //#endregion
44
43
  export { e as localityAwareSelector, t as resolveCurrentRegion };
@@ -1,6 +1,6 @@
1
1
  import { createLogger as e } from "@voltro/logger";
2
2
  import { processIdentity as t } from "@voltro/protocol/identity";
3
- //#region src/replicaObservations.ts
3
+ // src/replicaObservations.ts
4
4
  var n = e({ scope: "voltro:replica-observations" }), r = "_voltro_replica_observations", i = (e) => e instanceof Date ? e.getTime() : typeof e == "number" ? e : NaN, a = /* @__PURE__ */ new Set(), o = () => {
5
5
  a.clear();
6
6
  }, s = async (e, i, o) => {
@@ -117,5 +117,4 @@ var n = e({ scope: "voltro:replica-observations" }), r = "_voltro_replica_observ
117
117
  ...h === void 0 ? { versions: void 0 } : { versions: h }
118
118
  };
119
119
  };
120
- //#endregion
121
120
  export { f as DEFAULT_STALE_AFTER_MS, l as ObservationsUnavailable, r as REPLICA_OBSERVATIONS_TABLE, d as forgetReplicaObservations, p as mergeFleetObservations, c as readReplicaObservations, o as resetReplicaObservationWarnings, s as writeReplicaObservation };
@@ -1,4 +1,4 @@
1
- //#region src/replicaSelection.ts
1
+ // src/replicaSelection.ts
2
2
  var e = (e = {}) => {
3
3
  let t = e.random ?? Math.random, n = /* @__PURE__ */ new Map(), r = (e) => n.get(e) ?? 0;
4
4
  return {
@@ -28,5 +28,4 @@ var e = (e = {}) => {
28
28
  }
29
29
  };
30
30
  };
31
- //#endregion
32
31
  export { e as powerOfTwoSelector };
@@ -4,7 +4,7 @@ import { memoryRywPositionStore as n } from "./rywPositionStore.js";
4
4
  import { Effect as r, Fiber as i } from "effect";
5
5
  import { createLogger as a } from "@voltro/logger";
6
6
  import { AsyncLocalStorage as o } from "node:async_hooks";
7
- //#region src/replicatedDataStore.ts
7
+ // src/replicatedDataStore.ts
8
8
  var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e, t), u = (e, t) => r.flatMap(r.context(), (n) => r.callback((a) => {
9
9
  let o = l(e, () => r.runForkWith(n)(t));
10
10
  return o.addObserver((e) => {
@@ -253,5 +253,4 @@ var s = a({ scope: "voltro:replication" }), c = new o(), l = (e, t) => c.run(e,
253
253
  this.recordRouting?.(e);
254
254
  }
255
255
  }, p = (e) => new Promise((t) => setTimeout(t, e));
256
- //#endregion
257
256
  export { f as ReplicatedDataStore, d as currentRoutingContext, l as runWithRoutingContext, u as runWithRoutingContextEffect };
@@ -1,7 +1,6 @@
1
1
  import { AsyncLocalStorage as e } from "node:async_hooks";
2
- //#region src/requestLoader.ts
2
+ // src/requestLoader.ts
3
3
  var t = new e(), n = (e) => {
4
4
  t.enterWith(e);
5
5
  }, r = () => t.getStore(), i = (e, n) => t.run(e, n);
6
- //#endregion
7
6
  export { r as currentRequestLoader, n as enterRequestLoader, i as runWithRequestLoader };
@@ -1,5 +1,5 @@
1
1
  import { createLogger as e } from "@voltro/logger";
2
- //#region src/resumeCensus.ts
2
+ // src/resumeCensus.ts
3
3
  var t = Symbol.for("@voltro/runtime/resumeCensus"), n = globalThis, r = n[t] ?? (n[t] = { byLabel: /* @__PURE__ */ new Map() }), i = e({ scope: "voltro:resume" }), a = (e, t) => {
4
4
  let n = e.startsWith("subscription.") ? e.slice(13) : e, a = r.byLabel.get(n) ?? {
5
5
  resumable: 0,
@@ -24,5 +24,4 @@ var t = Symbol.for("@voltro/runtime/resumeCensus"), n = globalThis, r = n[t] ??
24
24
  }, s = () => {
25
25
  r.byLabel.clear();
26
26
  };
27
- //#endregion
28
27
  export { a as noteResumeVerdict, s as resetResumeCensus, o as resumeCensus };
@@ -1,4 +1,4 @@
1
- //#region src/revalidation.ts
1
+ // src/revalidation.ts
2
2
  var e = Symbol.for("@voltro/runtime/revalidation:publisher"), t = () => {
3
3
  let t = globalThis;
4
4
  return t[e] ??= { publisher: null };
@@ -18,5 +18,4 @@ var e = Symbol.for("@voltro/runtime/revalidation:publisher"), t = () => {
18
18
  kind: "tag",
19
19
  value: e
20
20
  });
21
- //#endregion
22
21
  export { i as revalidatePath, a as revalidateTable, o as revalidateTag, n as setRevalidationPublisher };
package/dist/rowFilter.js CHANGED
@@ -4,7 +4,7 @@ import { Effect as n, Schedule as r, Schema as i } from "effect";
4
4
  import { and as a } from "@voltro/database";
5
5
  import { currentSubjectAuthority as o, isMachineSubject as s } from "@voltro/protocol";
6
6
  import { createLogger as c } from "@voltro/logger";
7
- //#region src/rowFilter.ts
7
+ // src/rowFilter.ts
8
8
  var l = class extends i.TaggedError()("RowFilterUnavailable", { cause: i.String }) {}, u = class extends i.TaggedError()("RowFilterDeclarationViolated", {
9
9
  table: i.String,
10
10
  declared: i.Array(i.String)
@@ -78,5 +78,4 @@ var l = class extends i.TaggedError()("RowFilterUnavailable", { cause: i.String
78
78
  return r.success;
79
79
  };
80
80
  };
81
- //#endregion
82
81
  export { d as DEFAULT_ROW_FILTER_RETRY, v as NO_ROW_FILTER, u as RowFilterDeclarationViolated, l as RowFilterUnavailable, O as applyRowFilter, k as applyRowFilterToDescriptor, g as getRowFilter, A as makeDefaultRefilter, x as noteRowFilterResolved, C as resetRowFilterResolvedArms, w as resolveRowFilterScope, T as resolveRowFilterScopeFor, D as rowFilterMayNarrow, _ as rowFilterRegistered, S as rowFilterResolvedArms, h as setRowFilter };
@@ -1,4 +1,4 @@
1
- //#region src/rowStateBytes.ts
1
+ // src/rowStateBytes.ts
2
2
  var e = (t, n) => {
3
3
  if (typeof t != "object" || !t) return typeof t != "bigint";
4
4
  if (n.has(t)) return !1;
@@ -41,5 +41,4 @@ var e = (t, n) => {
41
41
  }
42
42
  };
43
43
  };
44
- //#endregion
45
44
  export { t as createRowStateByteEstimator };
@@ -1,6 +1,6 @@
1
1
  import { Effect as e, Stream as t } from "effect";
2
2
  import { HttpServerError as n, UrlParams as r } from "effect/http";
3
- //#region src/rpcBodyCap.ts
3
+ // src/rpcBodyCap.ts
4
4
  var i = (t, n) => e.callback((r) => {
5
5
  let i = [], a = 0, o = !1, s = () => {
6
6
  t.off("data", l), t.off("end", u), t.off("error", d), t.off("aborted", d);
@@ -59,5 +59,4 @@ var i = (t, n) => e.callback((r) => {
59
59
  }
60
60
  }), o;
61
61
  };
62
- //#endregion
63
62
  export { i as readCappedBody, a as withBufferedBody };
@@ -3,7 +3,7 @@ import { Effect as n, Layer as r, Queue as i } from "effect";
3
3
  import { randomUUID as a } from "node:crypto";
4
4
  import { RpcServer as o } from "effect/rpc";
5
5
  import { Headers as s } from "effect/http";
6
- //#region src/rpcConnections.ts
6
+ // src/rpcConnections.ts
7
7
  var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ??= {
8
8
  nextId: 1,
9
9
  entries: /* @__PURE__ */ new Map(),
@@ -79,5 +79,4 @@ var c = Symbol.for("@voltro/runtime/rpcConnections"), l = globalThis, u = l[c] ?
79
79
  })
80
80
  };
81
81
  })).pipe(r.provide(s));
82
- //#endregion
83
82
  export { d as RPC_CLIENT_ADDRESS_HEADER, h as getRpcConnection, f as stampRpcClientAddress, m as takeRpcClientAddress, p as withRpcClientAddress, g as withRpcConnectionIdentity };
@@ -1,4 +1,4 @@
1
- //#region src/rpcDefectDiagnostics.ts
1
+ // src/rpcDefectDiagnostics.ts
2
2
  var e = (e) => {
3
3
  if (typeof e != "object" || !e) return [];
4
4
  let t = e;
@@ -11,5 +11,4 @@ var e = (e) => {
11
11
  return t._tag === "Die" ? [t.defect] : [];
12
12
  });
13
13
  };
14
- //#endregion
15
14
  export { e as rpcFrameDefects };
package/dist/rpcServer.js CHANGED
@@ -38,7 +38,7 @@ import { HttpRouter as H, HttpServer as Je, HttpServerError as Ye, HttpServerReq
38
38
  import { NodeHttpServer as Xe, NodeHttpServerRequest as Ze, NodeServices as Qe } from "@effect/platform-node";
39
39
  import { dispatchSharedPath as $e, restCorsHeaders as et, restCorsPreflight as tt, routeAcceptsPath as nt } from "@voltro/protocol/rest";
40
40
  import { instanceId as rt, replicaId as it } from "@voltro/protocol/identity";
41
- //#region src/rpcServer.ts
41
+ // src/rpcServer.ts
42
42
  var at = (e) => {
43
43
  let t = e.indexOf(".");
44
44
  if (t <= 0) return;
@@ -1061,5 +1061,4 @@ var at = (e) => {
1061
1061
  }
1062
1062
  a = setTimeout(() => o(/* @__PURE__ */ Error(`rpc server did not bind within ${t}ms`)), t), e.on("listening", s), e.on("error", c);
1063
1063
  });
1064
- //#endregion
1065
1064
  export { kt as DEFAULT_MAX_RPC_BODY_BYTES, Ht as awaitServerListening, mt as bindComputedUntyped, Ot as bindMutation, _t as bindStream, ht as bindSubscription, pt as bindSubscriptionUntyped, Q as defectMessage, Bt as drainForShutdown, Z as isInfraError, Et as makeMutationCodec, Ft as onProcessShutdown, zt as shutdownGraceMsFromEnv, At as startRpcServer };
@@ -1,7 +1,7 @@
1
1
  import { Context as e, Option as t } from "effect";
2
2
  import { EventRpcWorkload as n } from "@voltro/protocol";
3
3
  import { RpcGroup as r, RpcSchema as i } from "effect/rpc";
4
- //#region src/rpcWorkloadAdmission.ts
4
+ // src/rpcWorkloadAdmission.ts
5
5
  var a = (e) => {
6
6
  if (e === void 0) return;
7
7
  if (!e || typeof e != "object" || Array.isArray(e) || ![Object.prototype, null].includes(Object.getPrototypeOf(e))) throw Error("Invalid RPC workload admission");
@@ -46,5 +46,4 @@ var a = (e) => {
46
46
  });
47
47
  return r.make(...c).annotateMerge(a.annotations);
48
48
  };
49
- //#endregion
50
49
  export { a as captureRpcWorkloadAdmission, o as selectRpcWorkloadGroup };
@@ -1,7 +1,7 @@
1
1
  import { NO_ROW_FILTER as e } from "./rowFilter.js";
2
2
  import { wrapStoreWithMixinBehaviour as t } from "./storeMiddleware.js";
3
3
  import { systemSubject as n } from "@voltro/protocol";
4
- //#region src/runAsSystem.ts
4
+ // src/runAsSystem.ts
5
5
  var r, i = (e) => {
6
6
  r = e;
7
7
  }, a = () => {
@@ -19,5 +19,4 @@ var r, i = (e) => {
19
19
  })
20
20
  });
21
21
  };
22
- //#endregion
23
22
  export { a as clearSystemStoreHandle, o as getSystemStoreHandle, s as runAsSystem, i as setSystemStoreHandle };
@@ -1,6 +1,6 @@
1
1
  import { Effect as e } from "effect";
2
2
  import { createLogger as t } from "@voltro/logger";
3
- //#region src/rywPositionStore.ts
3
+ // src/rywPositionStore.ts
4
4
  var n = t({ scope: "voltro:ryw" }), r = (e = {}) => {
5
5
  let t = e.now ?? Date.now, n = /* @__PURE__ */ new Map();
6
6
  return {
@@ -115,5 +115,4 @@ var n = t({ scope: "voltro:ryw" }), r = (e = {}) => {
115
115
  expiresAt: t.expiresAt
116
116
  };
117
117
  };
118
- //#endregion
119
118
  export { i as buildSubjectKey, r as memoryRywPositionStore, a as redisRywPositionStore };
package/dist/schedule.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Cron as e, Result as t } from "effect";
2
- //#region src/schedule.ts
2
+ // src/schedule.ts
3
3
  var n = Symbol.for("@voltro/ScheduleDefinition"), r = (e) => typeof e == "object" && !!e && n in e, i = 18e5, a = (r) => {
4
4
  let i = e.parse(r.cron, r.timezone);
5
5
  if (t.isFailure(i)) throw Error(`defineSchedule("${r.name}"): invalid cron expression "${r.cron}" (tz="${r.timezone}") — ${String(i.failure)}`);
@@ -19,5 +19,4 @@ Use a five-field expression, or leave this schedule on trigger: 'self' (the in-a
19
19
  for (; c.getTime() <= r.getTime() && s.length <= i;) s.push(c), c = e.next(a, c);
20
20
  return s;
21
21
  };
22
- //#endregion
23
22
  export { i as DEFAULT_MAX_RUNTIME_MS, o as compileCron, c as cronOccurrences, a as defineSchedule, r as isScheduleDefinition, s as nextFiring };
@@ -1,7 +1,7 @@
1
1
  import { Schema as e } from "effect";
2
2
  import { and as t, eq as n, id as r, integer as i, isNull as a, json as o, lt as s, table as c, text as l, timestamp as u } from "@voltro/database";
3
3
  import { ScheduleBackfillRequestConflict as d } from "@voltro/protocol/inspect";
4
- //#region src/scheduleBackfillRequests.ts
4
+ // src/scheduleBackfillRequests.ts
5
5
  var f = 5e3, p = 3e4, m = "_voltro_schedule_backfill_requests", h = c(m, {
6
6
  id: r({ prefix: "schbackfill" }),
7
7
  name: l(),
@@ -147,5 +147,4 @@ var f = 5e3, p = 3e4, m = "_voltro_schedule_backfill_requests", h = c(m, {
147
147
  error: "Scheduler stopped before the backfill settled",
148
148
  updatedAt: /* @__PURE__ */ new Date()
149
149
  }, { where: t(n("status", "running"), n("owner", r)) }));
150
- //#endregion
151
150
  export { f as SCHEDULE_BACKFILL_HEARTBEAT_MS, m as SCHEDULE_BACKFILL_REQUESTS_TABLE, p as SCHEDULE_BACKFILL_STALE_MS, b as acceptScheduleBackfillRequest, x as claimScheduleBackfillRequest, S as executeScheduleBackfillRequest, w as interruptOwnedScheduleBackfills, C as interruptStaleScheduleBackfills, y as readScheduleBackfillRequest, h as scheduleBackfillRequestsTable };
@@ -1,5 +1,5 @@
1
1
  import { id as e, table as t, text as n, timestamp as r } from "@voltro/database";
2
- //#region src/scheduleClaimsTable.ts
2
+ // src/scheduleClaimsTable.ts
3
3
  var i = t("_voltro_schedule_claims", {
4
4
  id: e({ prefix: "schclaim" }),
5
5
  scheduleName: n(),
@@ -7,5 +7,4 @@ var i = t("_voltro_schedule_claims", {
7
7
  claimedBy: n(),
8
8
  claimedAt: r()
9
9
  }).index(["scheduleName", "claimedAt"]).index(["claimedAt"]);
10
- //#endregion
11
10
  export { i as _voltroScheduleClaimsTable };
@@ -1,5 +1,5 @@
1
1
  import { id as e, integer as t, json as n, table as r, text as i, timestamp as a } from "@voltro/database";
2
- //#region src/scheduleRunsTable.ts
2
+ // src/scheduleRunsTable.ts
3
3
  var o = r("_voltro_schedule_runs", {
4
4
  id: e({ prefix: "schrun" }),
5
5
  name: i(),
@@ -33,5 +33,4 @@ var o = r("_voltro_schedule_runs", {
33
33
  heartbeatAt: a().nullable(),
34
34
  result: n().nullable()
35
35
  }).index(["name", "scheduledAt"]).index(["status"]);
36
- //#endregion
37
36
  export { o as _voltroScheduleRunsTable };
package/dist/scheduler.js CHANGED
@@ -9,7 +9,7 @@ import { Cron as g, Effect as ne } from "effect";
9
9
  import { and as _, eq as v, extractDbCause as y, lt as re } from "@voltro/database";
10
10
  import { randomUUID as ie } from "node:crypto";
11
11
  import { publishServerError as ae } from "@voltro/protocol";
12
- //#region src/scheduler.ts
12
+ // src/scheduler.ts
13
13
  var b = c, x = "default", S = {
14
14
  kind: "single",
15
15
  tryClaim: async () => !0
@@ -836,5 +836,4 @@ Give each a five-field expression, or set trigger: 'self' on it.`);
836
836
  for (let [n, r] of Object.entries(e)) t[n] = r instanceof Date ? r.toISOString() : r;
837
837
  return t;
838
838
  };
839
- //#endregion
840
839
  export { w as CLAIM_RETENTION_BUCKETS, oe as DEFAULT_CLAIM_BUCKET_MS, ce as DEFAULT_EXTERNAL_RECONCILE_MS, se as DEFAULT_EXTERNAL_TRIGGER_SKEW_MS, fe as DEFAULT_SCHEDULE_HEARTBEAT_MS, x as DORMANCY_WAKEUP_TENANT, le as EXTERNAL_TRIGGER_AHEAD_TOLERANCE_MS, b as SCHEDULE_SUBJECT, de as TERMINAL_RUN_STATUSES, T as claimGraceMs, E as makeAdvisoryLockCoordinator, A as peerRunIsAlive, S as singleCoordinator, j as startScheduler };
@@ -1,4 +1,4 @@
1
- //#region src/schemaRegistry.ts
1
+ // src/schemaRegistry.ts
2
2
  var e = "voltro/audit", t = "voltro/softDelete", n = "voltro/expires", r = "voltro/tenant", i = "voltro/localFirst", a = (e) => {
3
3
  let t = /* @__PURE__ */ new Map();
4
4
  for (let n of e) {
@@ -61,5 +61,4 @@ var e = "voltro/audit", t = "voltro/softDelete", n = "voltro/expires", r = "volt
61
61
  validatePatchSchema: (e) => t.get(e)?.validatePatchSchema
62
62
  };
63
63
  }, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = [], l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = a([]);
64
- //#endregion
65
64
  export { e as VOLTRO_AUDIT_MIXIN_ID, n as VOLTRO_EXPIRES_MIXIN_ID, i as VOLTRO_LOCAL_FIRST_MIXIN_ID, t as VOLTRO_SOFT_DELETE_MIXIN_ID, r as VOLTRO_TENANT_MIXIN_ID, d as emptySchemaRegistry, a as makeSchemaRegistry };
@@ -1,4 +1,4 @@
1
- //#region src/secretsResolver.ts
1
+ // src/secretsResolver.ts
2
2
  var e = { get: (e) => Promise.resolve(process.env[e]) }, t = e, n = (e) => {
3
3
  t = e;
4
4
  }, r = () => {
@@ -31,5 +31,4 @@ var e = { get: (e) => Promise.resolve(process.env[e]) }, t = e, n = (e) => {
31
31
  return typeof t == "string" ? t : void 0;
32
32
  } };
33
33
  }, c = (t) => t === void 0 || t === "env" || typeof t == "object" && t.kind === "env" ? e : t.kind === "custom" ? t.backend : t.kind === "http" ? s(t) : e;
34
- //#endregion
35
34
  export { o as cachedBackend, e as envSecretsBackend, s as httpSecretsBackend, r as resetSecretsBackend, i as resolveSecret, a as resolveSecretSync, c as resolveSecretsBackend, n as setSecretsBackend };
@@ -1,4 +1,4 @@
1
- //#region src/securityHeaders.ts
1
+ // src/securityHeaders.ts
2
2
  var e = "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'", t = "frame-ancestors 'none'; base-uri 'none'; object-src 'none'", n = "max-age=15552000; includeSubDomains", r = /* @__PURE__ */ new Set(["no-referrer"]), i = (e) => {
3
3
  if (e === !1) return !0;
4
4
  let t = e.split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), n = t[t.length - 1];
@@ -29,5 +29,4 @@ var e = "default-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-actio
29
29
  for (let [t, n] of Object.entries(e.extra)) r[t.toLowerCase()] = n;
30
30
  return r;
31
31
  };
32
- //#endregion
33
32
  export { e as API_CSP, n as DEFAULT_HSTS, t as HTML_CSP, r as ORIGIN_NULLING_REFERRER_POLICIES, i as preservesSameOriginHeader, s as resolveSecurityHeaders, c as securityHeadersFor };