@voltro/runtime 0.86.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 (184) hide show
  1. package/CHANGELOG.md +5484 -0
  2. package/README.md +43 -0
  3. package/THIRD-PARTY-NOTICES.md +1511 -276
  4. package/dist/aggregate.js +1 -2
  5. package/dist/aggregateExtrema.js +1 -2
  6. package/dist/aggregateIvm.js +1 -2
  7. package/dist/analyticsMirror.js +1 -2
  8. package/dist/analyticsSink.js +9 -16
  9. package/dist/apiKeyUsage.js +1 -2
  10. package/dist/apiKeys.js +83 -80
  11. package/dist/apiKeysWiring.js +1 -2
  12. package/dist/apiRoleBucketSampler.js +63 -0
  13. package/dist/apiRoleWorkloadHistory.js +55 -0
  14. package/dist/apiRoleWorkloadMetrics.js +77 -0
  15. package/dist/apiRoleWorkloadStorage.js +94 -0
  16. package/dist/approvalBuiltins.js +1 -2
  17. package/dist/approvals.js +68 -76
  18. package/dist/authMiddlewareLayer.js +8 -8
  19. package/dist/bindEvent.js +49 -30
  20. package/dist/boot-refusal.d.ts +10 -0
  21. package/dist/{bootRefusal.js → boot-refusal.js} +1 -2
  22. package/dist/bootListener.js +203 -47
  23. package/dist/bootStoreCodec.js +39 -39
  24. package/dist/businessRules.js +1 -2
  25. package/dist/changeClaimsTable.js +1 -2
  26. package/dist/circuitBreaker.js +1 -72
  27. package/dist/columnOnUpdate.js +1 -2
  28. package/dist/composeAnalytics.js +32 -12
  29. package/dist/computedQuery.js +1 -2
  30. package/dist/computedQueryCache.js +289 -0
  31. package/dist/connectionBuiltins.js +1 -2
  32. package/dist/connectionCredentials.js +1 -2
  33. package/dist/connectionState.js +1 -2
  34. package/dist/connectionVault.js +1 -2
  35. package/dist/connectionsFacade.js +33 -32
  36. package/dist/coordinatedSchedule.js +85 -80
  37. package/dist/crdtHistory.js +1 -2
  38. package/dist/crdtMerge.js +1 -2
  39. package/dist/crdtVersionsTable.js +1 -2
  40. package/dist/credentialBound.js +1 -2
  41. package/dist/crud.js +1 -2
  42. package/dist/dataStore.js +155 -123
  43. package/dist/dataloader.js +1 -2
  44. package/dist/declaredTablesGuard.js +3 -3
  45. package/dist/defineExecutor.js +1 -2
  46. package/dist/dependencyGraph.js +1 -2
  47. package/dist/devices.js +1 -2
  48. package/dist/devicesWiring.js +1 -2
  49. package/dist/dialectReplicationAdapter.js +1 -2
  50. package/dist/dispatcher.js +404 -330
  51. package/dist/effectStore.js +3 -4
  52. package/dist/engineClients.js +23 -0
  53. package/dist/eventBus.js +1 -2
  54. package/dist/eventPublish.js +1 -2
  55. package/dist/events.js +1 -2
  56. package/dist/expectation.js +1 -2
  57. package/dist/expectationEvaluator.js +2 -3
  58. package/dist/experiment.js +1 -2
  59. package/dist/experimentEvaluator.js +1 -2
  60. package/dist/externalizedTasks.js +20 -8
  61. package/dist/fieldCipher.js +110 -42
  62. package/dist/fieldKeyRegistry.js +294 -0
  63. package/dist/fieldKeyRekey.js +285 -0
  64. package/dist/fieldKeyScan.js +135 -0
  65. package/dist/fieldKeyring.js +76 -0
  66. package/dist/fingerprint.js +1 -2
  67. package/dist/finops.js +1 -2
  68. package/dist/finopsAccountant.js +1 -2
  69. package/dist/handlerBody.js +1 -2
  70. package/dist/healthProbes.js +1 -2
  71. package/dist/hot.d.ts +56 -0
  72. package/dist/hot.js +3 -0
  73. package/dist/hotDataStore.js +147 -0
  74. package/dist/hotDataStoreSnapshot.js +97 -0
  75. package/dist/hotDataStoreTables.js +17 -0
  76. package/dist/http-range.d.ts +53 -0
  77. package/dist/http-range.js +51 -0
  78. package/dist/httpClientSsrf.js +13 -39
  79. package/dist/httpClientTracing.js +13 -11
  80. package/dist/httpCompression.js +18 -19
  81. package/dist/httpInputStream.js +81 -0
  82. package/dist/httpKeepAlive.js +1 -2
  83. package/dist/httpRouteMounts.js +2 -2
  84. package/dist/idempotencyStore.js +93 -54
  85. package/dist/idleDetector.js +1 -2
  86. package/dist/index.d.ts +1185 -452
  87. package/dist/index.js +144 -134
  88. package/dist/insertRequiredColumns.js +1 -2
  89. package/dist/instanceMembership.js +1 -2
  90. package/dist/ivm.js +1 -2
  91. package/dist/kvDataStore.js +1 -2
  92. package/dist/kvFacade.js +24 -19
  93. package/dist/matcher.js +1 -2
  94. package/dist/memoryColumnDefaults.js +1 -2
  95. package/dist/memoryQueryJoins.js +17 -18
  96. package/dist/memorySetOperations.js +42 -0
  97. package/dist/metrics.js +39 -26
  98. package/dist/observability.js +2 -3
  99. package/dist/observedGraph.js +1 -2
  100. package/dist/originGuard.js +1 -2
  101. package/dist/outbox.js +2 -3
  102. package/dist/pluginRefRules.js +1 -2
  103. package/dist/policyGuardResolver.js +1 -2
  104. package/dist/preview.js +1 -2
  105. package/dist/projectedRows.js +1 -2
  106. package/dist/provenance.js +1 -2
  107. package/dist/rangeIndex.js +1 -2
  108. package/dist/rawReadScope.js +2 -3
  109. package/dist/reaction.js +1 -2
  110. package/dist/reactiveConfig.js +1 -2
  111. package/dist/readClassification.js +1 -2
  112. package/dist/readRecorder.js +36 -36
  113. package/dist/readScopePredicate.js +11 -0
  114. package/dist/rebac.js +1 -2
  115. package/dist/rebacInterceptor.js +1 -2
  116. package/dist/registry.js +1 -2
  117. package/dist/relevantFields.js +1 -2
  118. package/dist/replicaHealth.js +1 -2
  119. package/dist/replicaLocality.js +1 -2
  120. package/dist/replicaObservations.js +1 -2
  121. package/dist/replicaSelection.js +1 -2
  122. package/dist/replicatedDataStore.js +23 -6
  123. package/dist/requestLoader.js +1 -2
  124. package/dist/resumeCensus.js +1 -2
  125. package/dist/revalidation.js +1 -2
  126. package/dist/rowFilter.js +57 -41
  127. package/dist/rowStateBytes.js +1 -2
  128. package/dist/rpcBodyCap.js +1 -2
  129. package/dist/rpcConnections.js +9 -10
  130. package/dist/rpcDefectDiagnostics.js +1 -2
  131. package/dist/rpcServer.js +523 -451
  132. package/dist/rpcWorkloadAdmission.js +49 -0
  133. package/dist/runAsSystem.js +1 -2
  134. package/dist/rywPositionStore.js +83 -49
  135. package/dist/schedule.js +1 -2
  136. package/dist/scheduleBackfillRequests.js +1 -2
  137. package/dist/scheduleClaimsTable.js +1 -2
  138. package/dist/scheduleRunsTable.js +1 -2
  139. package/dist/scheduler.js +7 -3
  140. package/dist/schemaRegistry.js +1 -2
  141. package/dist/secretsResolver.js +1 -2
  142. package/dist/securityHeaders.js +1 -2
  143. package/dist/servePipeline.js +238 -154
  144. package/dist/serverOnlyAudit.js +1 -2
  145. package/dist/serverTracer.js +1 -2
  146. package/dist/serviceCredentials.js +1 -2
  147. package/dist/setReadScopes.js +27 -0
  148. package/dist/singleNodeOrchestrator.js +1 -2
  149. package/dist/snapshotValueCodec.js +45 -0
  150. package/dist/sourceResolution.js +35 -26
  151. package/dist/storeMiddleware.js +213 -212
  152. package/dist/storeQuery.js +1 -2
  153. package/dist/storeRead.js +1 -2
  154. package/dist/subscriber.js +2 -2
  155. package/dist/subscriptionOutbox.js +1 -2
  156. package/dist/subscriptionRegistry.js +1 -2
  157. package/dist/subscriptionResume.js +1 -2
  158. package/dist/subscriptionSocketMetrics.js +1 -2
  159. package/dist/systemSubject.js +1 -2
  160. package/dist/tenantScope.js +9 -22
  161. package/dist/tenantSelection.js +1 -2
  162. package/dist/timeline.js +1 -2
  163. package/dist/traceContext.js +1 -2
  164. package/dist/traceSink.js +1 -2
  165. package/dist/traceSpansTable.js +1 -2
  166. package/dist/traceparent.js +9 -21
  167. package/dist/transactionSubject.js +1 -2
  168. package/dist/trustedProxy.js +2 -3
  169. package/dist/undo.js +1 -2
  170. package/dist/undoBuiltins.js +1 -2
  171. package/dist/undoCapture.js +1 -2
  172. package/dist/undoLogTable.js +1 -2
  173. package/dist/upsertBinding.js +1 -2
  174. package/dist/wakeOrchestrator.js +1 -2
  175. package/dist/wakeRegistry.js +1 -2
  176. package/dist/wakeRouter.js +1 -2
  177. package/dist/wakeSupervisor.js +1 -2
  178. package/dist/wakeupsTable.js +1 -2
  179. package/dist/webSocketGatewayRuntime.js +112 -73
  180. package/dist/webhookVerification.js +1 -2
  181. package/dist/wireColumnStrip.js +1 -2
  182. package/dist/workflowReadBuiltins.js +1 -2
  183. package/dist/workflowRuntime.js +10 -11
  184. package/package.json +36 -17
@@ -0,0 +1,45 @@
1
+ // src/snapshotValueCodec.ts
2
+ var e = "\0", t = `${e}d`, n = `${e}n`, r = `${e}b`, i = `${e}o`, a = 1, o = (e) => {
3
+ if (typeof e != "object" || !e) return !1;
4
+ let t = Object.getPrototypeOf(e);
5
+ return t === Object.prototype || t === null;
6
+ }, s = (a) => {
7
+ if (typeof a != "object" || !a) return typeof a == "bigint" ? { [n]: a.toString() } : a;
8
+ if (a instanceof Date) return { [t]: Number.isNaN(a.getTime()) ? null : a.toISOString() };
9
+ if (a instanceof Uint8Array) return { [r]: Buffer.from(a.buffer, a.byteOffset, a.byteLength).toString("base64") };
10
+ if (Array.isArray(a)) return a.map(s);
11
+ if (o(a)) {
12
+ let t = {}, n = !1;
13
+ for (let [r, i] of Object.entries(a)) r.startsWith(e) && (n = !0), t[r] = s(i);
14
+ return n ? { [i]: t } : t;
15
+ }
16
+ throw TypeError("A snapshot value carries a non-plain object; it cannot be cached faithfully.");
17
+ }, c = (e) => {
18
+ if (typeof e != "object" || !e) return e;
19
+ if (Array.isArray(e)) return e.map(c);
20
+ let a = e, o = Object.keys(a);
21
+ if (o.length === 1) {
22
+ let e = o[0], s = a[e];
23
+ if (e === t) return s === null ? /* @__PURE__ */ new Date(NaN) : new Date(s);
24
+ if (e === n) return BigInt(s);
25
+ if (e === r) return new Uint8Array(Buffer.from(s, "base64"));
26
+ if (e === i) {
27
+ let e = {};
28
+ for (let [t, n] of Object.entries(s)) e[t] = c(n);
29
+ return e;
30
+ }
31
+ }
32
+ let s = {};
33
+ for (let [e, t] of Object.entries(a)) s[e] = c(t);
34
+ return s;
35
+ }, l = (e) => ({
36
+ v: a,
37
+ value: s(e)
38
+ }), u = (e) => {
39
+ if (o(e) && e.v === a && "value" in e) try {
40
+ return { value: c(e.value) };
41
+ } catch {
42
+ return;
43
+ }
44
+ };
45
+ export { u as decodeSnapshotValue, l as encodeSnapshotValue };
@@ -1,6 +1,6 @@
1
- import { declaredReactivityChannelKeys as e, isReactivityChannelKey as t, sourceKeys as n } from "@voltro/protocol";
2
- //#region src/sourceResolution.ts
3
- var r = (e, t) => {
1
+ import { captureOptionalQuerySources as e, declaredReactivityChannelKeys as t, isReactivityChannelKey as n, sourceKeys as r } from "@voltro/protocol";
2
+ // src/sourceResolution.ts
3
+ var i = (e, t) => {
4
4
  let n, r = 0;
5
5
  for (let i of t) {
6
6
  let t = 0;
@@ -11,32 +11,41 @@ var r = (e, t) => {
11
11
  o > r && o >= .6 && (r = o, n = i);
12
12
  }
13
13
  return n;
14
- }, i = (i, a) => {
15
- let o = e(), s = [], c = /* @__PURE__ */ new Map();
16
- for (let e of i) for (let i of n(e.source)) if (t(i)) {
17
- if (o.has(i)) continue;
18
- s.push({
19
- procedure: e.name,
20
- source: i,
21
- didYouMean: void 0,
22
- channel: !0
23
- });
24
- } else a.size === 0 || a.has(i) || (c.has(i) || c.set(i, r(i, a)), s.push({
25
- procedure: e.name,
26
- source: i,
27
- didYouMean: c.get(i),
28
- channel: !1
29
- }));
30
- return s;
31
- }, a = (e) => {
14
+ }, a = (a, o) => {
15
+ let s = t(), c = [], l = /* @__PURE__ */ new Map();
16
+ for (let t of a) {
17
+ let a = new Set(e(t.name, t.source, t.optionalSource));
18
+ for (let e of r(t.source)) if (n(e)) {
19
+ if (s.has(e)) continue;
20
+ c.push({
21
+ procedure: t.name,
22
+ source: e,
23
+ didYouMean: void 0,
24
+ channel: !0,
25
+ ...a.has(e) ? { optional: !0 } : {}
26
+ });
27
+ } else o.size === 0 || o.has(e) || (l.has(e) || l.set(e, i(e, o)), c.push({
28
+ procedure: t.name,
29
+ source: e,
30
+ didYouMean: a.has(e) ? void 0 : l.get(e),
31
+ channel: !1,
32
+ ...a.has(e) ? { optional: !0 } : {}
33
+ }));
34
+ }
35
+ return c;
36
+ }, o = (e) => {
32
37
  if (e.length === 0) return;
33
- let t = e.map((e) => e.channel ? ` ${e.procedure}: source '${e.source}' names a reactivity channel nobody declared` : ` ${e.procedure}: source '${e.source}' matches no declared table` + (e.didYouMean === void 0 ? "" : ` — did you mean '${e.didYouMean}'?`)), n = e.some((e) => e.channel) ? "\nFor the `channel:` entries: declare it with `reactivityChannel(<name>)` and pass the\nCHANNEL as `source:`, not its key as a string. Authoring against the object is what\nmakes a channel source impossible to leave stale — you cannot import a declaration\nthat does not exist." : "";
34
- return `${e.length} reactive source(s) name a table that does not exist:\n${t.join("\n")}\n
38
+ let t = e.filter((e) => e.optional === !0);
39
+ if (t.length > 0) {
40
+ let n = o(e.filter((e) => e.optional !== !0)), r = t.map((e) => ` ${e.procedure}: optional integration source '${e.source}' is unavailable`);
41
+ return [n, `${t.length} optional integration source(s) are unavailable:\n${r.join("\n")}\nTheir observers remain declared. Installed sources still trigger recomputation; executor authorization still applies.`].filter((e) => e !== void 0).join("\n\n");
42
+ }
43
+ let n = e.map((e) => e.channel ? ` ${e.procedure}: source '${e.source}' names a reactivity channel nobody declared` : ` ${e.procedure}: source '${e.source}' matches no declared table` + (e.didYouMean === void 0 ? "" : ` — did you mean '${e.didYouMean}'?`)), r = e.some((e) => e.channel) ? "\nFor the `channel:` entries: declare it with `reactivityChannel(<name>)` and pass the\nCHANNEL as `source:`, not its key as a string. Authoring against the object is what\nmakes a channel source impossible to leave stale — you cannot import a declaration\nthat does not exist." : "";
44
+ return `${e.length} reactive source(s) name a table that does not exist:\n${n.join("\n")}\n
35
45
  These queries are NOT broken. They serve their first snapshot and then never
36
46
  update again, which is indistinguishable from "nothing has changed" — so the
37
47
  symptom is silence, and silence is what this surface exists to eliminate.
38
48
  A \`source:\` is a STRING, so \`tsc\` cannot see a stale one and a rename leaves it
39
- behind quietly.` + n;
49
+ behind quietly.` + r;
40
50
  };
41
- //#endregion
42
- export { a as formatUnresolvedSources, i as unresolvedSources };
51
+ export { o as formatUnresolvedSources, a as unresolvedSources };