@bleedingdev/modern-js-server-runtime-extensions 3.5.0-ultramodern.36 → 3.5.0-ultramodern.38

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 (119) hide show
  1. package/dist/cjs/contract-gate-snapshot-normalization.js +122 -0
  2. package/dist/cjs/contract-gate-snapshot-store/file-store.js +13 -13
  3. package/dist/cjs/contract-gate-snapshot-store/http-store.js +2 -11
  4. package/dist/cjs/contract-gate-snapshot-store/resolve.js +8 -6
  5. package/dist/cjs/contractGateAutopilot.js +8 -77
  6. package/dist/cjs/index.js +6 -25
  7. package/dist/cjs/module-federation-css/manifest.js +3 -18
  8. package/dist/cjs/runtime-fallback-signal/index.js +21 -27
  9. package/dist/cjs/runtime-fallback-signal/model.js +157 -0
  10. package/dist/cjs/runtime-fallback-signal/resolver.js +163 -0
  11. package/dist/cjs/runtime-fallback-signal/{contract-gate.js → store.js} +19 -0
  12. package/dist/cjs/telemetry/envelope.js +74 -0
  13. package/dist/cjs/telemetry/registry.js +20 -72
  14. package/dist/esm/contract-gate-snapshot-normalization.mjs +81 -0
  15. package/dist/esm/contract-gate-snapshot-store/file-store.mjs +7 -7
  16. package/dist/esm/contract-gate-snapshot-store/http-store.mjs +1 -1
  17. package/dist/esm/contract-gate-snapshot-store/resolve.mjs +7 -5
  18. package/dist/esm/contractGateAutopilot.mjs +7 -76
  19. package/dist/esm/index.mjs +0 -1
  20. package/dist/esm/module-federation-css/manifest.mjs +3 -3
  21. package/dist/esm/runtime-fallback-signal/index.mjs +3 -9
  22. package/dist/esm/runtime-fallback-signal/model.mjs +73 -0
  23. package/dist/esm/runtime-fallback-signal/resolver.mjs +107 -0
  24. package/dist/esm/runtime-fallback-signal/{contract-gate.mjs → store.mjs} +14 -1
  25. package/dist/esm/telemetry/envelope.mjs +63 -1
  26. package/dist/esm/telemetry/registry.mjs +21 -73
  27. package/dist/esm-node/contract-gate-snapshot-normalization.mjs +82 -0
  28. package/dist/esm-node/contract-gate-snapshot-store/file-store.mjs +7 -7
  29. package/dist/esm-node/contract-gate-snapshot-store/http-store.mjs +1 -1
  30. package/dist/esm-node/contract-gate-snapshot-store/resolve.mjs +8 -7
  31. package/dist/esm-node/contractGateAutopilot.mjs +7 -76
  32. package/dist/esm-node/index.mjs +0 -1
  33. package/dist/esm-node/module-federation-css/manifest.mjs +3 -3
  34. package/dist/esm-node/runtime-fallback-signal/index.mjs +3 -9
  35. package/dist/esm-node/runtime-fallback-signal/model.mjs +74 -0
  36. package/dist/esm-node/runtime-fallback-signal/resolver.mjs +108 -0
  37. package/dist/esm-node/runtime-fallback-signal/{contract-gate.mjs → store.mjs} +14 -1
  38. package/dist/esm-node/telemetry/envelope.mjs +63 -1
  39. package/dist/esm-node/telemetry/registry.mjs +21 -73
  40. package/dist/types/contract-gate-snapshot-normalization.d.ts +15 -0
  41. package/dist/types/contract-gate-snapshot-store/http-store.d.ts +0 -6
  42. package/dist/types/contractGateAutopilot.d.ts +1 -6
  43. package/dist/types/index.d.ts +0 -1
  44. package/dist/types/module-federation-css/manifest.d.ts +0 -5
  45. package/dist/types/runtime-fallback-signal/index.d.ts +4 -10
  46. package/dist/types/runtime-fallback-signal/model.d.ts +70 -0
  47. package/dist/types/runtime-fallback-signal/resolver.d.ts +29 -0
  48. package/dist/types/runtime-fallback-signal/store.d.ts +4 -0
  49. package/dist/types/telemetry/canaryEvaluation.d.ts +3 -2
  50. package/dist/types/telemetry/envelope.d.ts +10 -0
  51. package/dist/types/telemetry/registry.d.ts +1 -4
  52. package/package.json +10 -10
  53. package/src/contract-gate-snapshot-normalization.ts +155 -0
  54. package/src/contract-gate-snapshot-store/file-store.ts +2 -4
  55. package/src/contract-gate-snapshot-store/http-store.ts +3 -3
  56. package/src/contract-gate-snapshot-store/resolve.ts +8 -4
  57. package/src/contractGateAutopilot.ts +13 -141
  58. package/src/index.ts +0 -16
  59. package/src/module-federation-css/manifest.ts +6 -9
  60. package/src/runtime-fallback-signal/index.ts +23 -25
  61. package/src/runtime-fallback-signal/model.ts +230 -0
  62. package/src/runtime-fallback-signal/resolver.ts +304 -0
  63. package/src/runtime-fallback-signal/{contract-gate.ts → store.ts} +38 -3
  64. package/src/telemetry/canaryEvaluation.ts +2 -2
  65. package/src/telemetry/envelope.ts +84 -0
  66. package/src/telemetry/registry.ts +31 -74
  67. package/tests/telemetryAutopilot.test.ts +141 -0
  68. package/tests/telemetryRegistryQueueMatrix.test.ts +227 -0
  69. package/dist/cjs/runtime-fallback-signal/auth.js +0 -87
  70. package/dist/cjs/runtime-fallback-signal/constants.js +0 -72
  71. package/dist/cjs/runtime-fallback-signal/endpoint.js +0 -50
  72. package/dist/cjs/runtime-fallback-signal/errors.js +0 -44
  73. package/dist/cjs/runtime-fallback-signal/payload.js +0 -72
  74. package/dist/cjs/runtime-fallback-signal/source.js +0 -66
  75. package/dist/cjs/runtime-fallback-signal/state.js +0 -57
  76. package/dist/cjs/runtime-fallback-signal/status.js +0 -47
  77. package/dist/cjs/runtime-fallback-signal/trust-policy.js +0 -108
  78. package/dist/cjs/runtime-fallback-signal/types.js +0 -18
  79. package/dist/esm/runtime-fallback-signal/auth.mjs +0 -40
  80. package/dist/esm/runtime-fallback-signal/constants.mjs +0 -10
  81. package/dist/esm/runtime-fallback-signal/endpoint.mjs +0 -12
  82. package/dist/esm/runtime-fallback-signal/errors.mjs +0 -6
  83. package/dist/esm/runtime-fallback-signal/payload.mjs +0 -31
  84. package/dist/esm/runtime-fallback-signal/source.mjs +0 -22
  85. package/dist/esm/runtime-fallback-signal/state.mjs +0 -16
  86. package/dist/esm/runtime-fallback-signal/status.mjs +0 -9
  87. package/dist/esm/runtime-fallback-signal/trust-policy.mjs +0 -67
  88. package/dist/esm/runtime-fallback-signal/types.mjs +0 -0
  89. package/dist/esm-node/runtime-fallback-signal/auth.mjs +0 -41
  90. package/dist/esm-node/runtime-fallback-signal/constants.mjs +0 -11
  91. package/dist/esm-node/runtime-fallback-signal/endpoint.mjs +0 -13
  92. package/dist/esm-node/runtime-fallback-signal/errors.mjs +0 -7
  93. package/dist/esm-node/runtime-fallback-signal/payload.mjs +0 -32
  94. package/dist/esm-node/runtime-fallback-signal/source.mjs +0 -23
  95. package/dist/esm-node/runtime-fallback-signal/state.mjs +0 -17
  96. package/dist/esm-node/runtime-fallback-signal/status.mjs +0 -10
  97. package/dist/esm-node/runtime-fallback-signal/trust-policy.mjs +0 -68
  98. package/dist/esm-node/runtime-fallback-signal/types.mjs +0 -1
  99. package/dist/types/runtime-fallback-signal/auth.d.ts +0 -18
  100. package/dist/types/runtime-fallback-signal/constants.d.ts +0 -9
  101. package/dist/types/runtime-fallback-signal/contract-gate.d.ts +0 -2
  102. package/dist/types/runtime-fallback-signal/endpoint.d.ts +0 -1
  103. package/dist/types/runtime-fallback-signal/errors.d.ts +0 -2
  104. package/dist/types/runtime-fallback-signal/payload.d.ts +0 -6
  105. package/dist/types/runtime-fallback-signal/source.d.ts +0 -3
  106. package/dist/types/runtime-fallback-signal/state.d.ts +0 -3
  107. package/dist/types/runtime-fallback-signal/status.d.ts +0 -2
  108. package/dist/types/runtime-fallback-signal/trust-policy.d.ts +0 -13
  109. package/dist/types/runtime-fallback-signal/types.d.ts +0 -50
  110. package/src/runtime-fallback-signal/auth.ts +0 -117
  111. package/src/runtime-fallback-signal/constants.ts +0 -19
  112. package/src/runtime-fallback-signal/endpoint.ts +0 -22
  113. package/src/runtime-fallback-signal/errors.ts +0 -10
  114. package/src/runtime-fallback-signal/payload.ts +0 -79
  115. package/src/runtime-fallback-signal/source.ts +0 -49
  116. package/src/runtime-fallback-signal/state.ts +0 -34
  117. package/src/runtime-fallback-signal/status.ts +0 -22
  118. package/src/runtime-fallback-signal/trust-policy.ts +0 -179
  119. package/src/runtime-fallback-signal/types.ts +0 -66
@@ -1,4 +1,4 @@
1
- import { clamp, redactObject } from "./envelope.mjs";
1
+ import { buildDroppedEnvelope, buildQueueDepthEnvelope, buildQueueUtilizationEnvelope, buildStartupProbeEnvelope, clamp, redactObject } from "./envelope.mjs";
2
2
  import { TelemetryStartupHealthError } from "./registryTypes.mjs";
3
3
  class TelemetryRegistry {
4
4
  async register(exporter) {
@@ -86,10 +86,7 @@ class TelemetryRegistry {
86
86
  }
87
87
  enqueueMetric(input) {
88
88
  this.enqueue({
89
- timestamp: Date.now(),
90
- service: this.service,
91
- module: this.module,
92
- environment: this.environment,
89
+ ...this.baseEnvelope(),
93
90
  signalType: 'metric',
94
91
  name: input.name,
95
92
  value: input.value,
@@ -103,10 +100,7 @@ class TelemetryRegistry {
103
100
  }
104
101
  enqueueLog(input) {
105
102
  this.enqueue({
106
- timestamp: Date.now(),
107
- service: this.service,
108
- module: this.module,
109
- environment: this.environment,
103
+ ...this.baseEnvelope(),
110
104
  signalType: 'log',
111
105
  name: input.name,
112
106
  level: input.level,
@@ -120,10 +114,7 @@ class TelemetryRegistry {
120
114
  }
121
115
  enqueueTrace(input) {
122
116
  this.enqueue({
123
- timestamp: Date.now(),
124
- service: this.service,
125
- module: this.module,
126
- environment: this.environment,
117
+ ...this.baseEnvelope(),
127
118
  signalType: 'trace',
128
119
  name: input.name,
129
120
  traceId: input.traceId,
@@ -133,49 +124,12 @@ class TelemetryRegistry {
133
124
  attributes: input.attributes
134
125
  });
135
126
  }
136
- buildDroppedEnvelope(droppedCount) {
127
+ baseEnvelope() {
137
128
  return {
138
129
  timestamp: Date.now(),
139
130
  service: this.service,
140
131
  module: this.module,
141
- environment: this.environment,
142
- signalType: 'metric',
143
- name: 'telemetry.queue.dropped',
144
- value: droppedCount,
145
- unit: 'count',
146
- tags: {
147
- reason: 'queue_backpressure'
148
- }
149
- };
150
- }
151
- buildQueueDepthEnvelope(queueDepth) {
152
- return {
153
- timestamp: Date.now(),
154
- service: this.service,
155
- module: this.module,
156
- environment: this.environment,
157
- signalType: 'metric',
158
- name: 'telemetry.queue.depth',
159
- value: queueDepth,
160
- unit: 'count',
161
- tags: {
162
- capacity: String(this.maxQueueSize)
163
- }
164
- };
165
- }
166
- buildQueueUtilizationEnvelope(queueDepth) {
167
- return {
168
- timestamp: Date.now(),
169
- service: this.service,
170
- module: this.module,
171
- environment: this.environment,
172
- signalType: 'metric',
173
- name: 'telemetry.queue.utilization',
174
- value: queueDepth / this.maxQueueSize,
175
- unit: 'ratio',
176
- tags: {
177
- capacity: String(this.maxQueueSize)
178
- }
132
+ environment: this.environment
179
133
  };
180
134
  }
181
135
  async emitBatch(batch) {
@@ -192,27 +146,15 @@ class TelemetryRegistry {
192
146
  this.markExporterHealthy(exporterName);
193
147
  }
194
148
  }
195
- buildStartupProbeEnvelope() {
196
- return {
197
- timestamp: Date.now(),
198
- service: this.service,
199
- module: this.module,
200
- environment: this.environment,
201
- signalType: 'log',
202
- name: 'telemetry.exporter.startup_probe',
203
- level: 'info',
204
- tags: {
205
- phase: 'startup'
206
- },
207
- attributes: {
208
- source: 'TelemetryRegistry'
209
- }
210
- };
211
- }
212
149
  async startupHealthCheck(options) {
213
150
  if (0 === this.exporters.length) return;
214
151
  const probeBatch = [
215
- this.buildStartupProbeEnvelope()
152
+ buildStartupProbeEnvelope({
153
+ service: this.service,
154
+ module: this.module,
155
+ environment: this.environment,
156
+ maxQueueSize: this.maxQueueSize
157
+ })
216
158
  ];
217
159
  const failedExporters = [];
218
160
  await Promise.all(this.exporters.map(async (exporter)=>{
@@ -245,14 +187,20 @@ class TelemetryRegistry {
245
187
  }
246
188
  async flushInternal() {
247
189
  const queueDepthBeforeFlush = this.queue.length;
190
+ const envelopeContext = {
191
+ service: this.service,
192
+ module: this.module,
193
+ environment: this.environment,
194
+ maxQueueSize: this.maxQueueSize
195
+ };
248
196
  if (queueDepthBeforeFlush > 0) {
249
- this.queue.unshift(this.buildQueueUtilizationEnvelope(queueDepthBeforeFlush));
250
- this.queue.unshift(this.buildQueueDepthEnvelope(queueDepthBeforeFlush));
197
+ this.queue.unshift(buildQueueUtilizationEnvelope(envelopeContext, queueDepthBeforeFlush));
198
+ this.queue.unshift(buildQueueDepthEnvelope(envelopeContext, queueDepthBeforeFlush));
251
199
  }
252
200
  if (this.droppedCount > 0) {
253
201
  const droppedCount = this.droppedCount;
254
202
  this.droppedCount = 0;
255
- this.queue.unshift(this.buildDroppedEnvelope(droppedCount));
203
+ this.queue.unshift(buildDroppedEnvelope(envelopeContext, droppedCount));
256
204
  }
257
205
  if (0 === this.queue.length) return;
258
206
  if (0 === this.exporters.length) {
@@ -0,0 +1,82 @@
1
+ import "node:module";
2
+ const getSnapshotGateEntries = (snapshot)=>{
3
+ const gates = snapshot.gates;
4
+ if (!gates || 'object' != typeof gates) return;
5
+ const entries = [];
6
+ for (const [name, value] of Object.entries(gates)){
7
+ const normalizedName = name.trim();
8
+ if (normalizedName) entries.push([
9
+ normalizedName,
10
+ value
11
+ ]);
12
+ }
13
+ return entries;
14
+ };
15
+ const getSnapshotGateNames = (snapshot)=>{
16
+ const entries = getSnapshotGateEntries(snapshot);
17
+ if (!entries) return;
18
+ const names = new Set();
19
+ for (const [name] of entries)names.add(name);
20
+ return names;
21
+ };
22
+ const normalizeSnapshot = (snapshot, { now, gateStaleAfterMs })=>{
23
+ const output = [];
24
+ const entries = getSnapshotGateEntries(snapshot);
25
+ if (!entries) return output;
26
+ for (const [normalizedName, value] of entries){
27
+ const gate = normalizeGateValue(value, snapshot.updatedAt, now);
28
+ if (!gate) continue;
29
+ if ('number' == typeof gate.expiresAt && Number.isFinite(gate.expiresAt) && gate.expiresAt > 0 && now >= gate.expiresAt) {
30
+ output.push({
31
+ name: normalizedName,
32
+ passed: true,
33
+ reason: void 0,
34
+ updatedAt: gate.updatedAt,
35
+ expiresAt: gate.expiresAt
36
+ });
37
+ continue;
38
+ }
39
+ const isStale = gateStaleAfterMs > 0 && now - gate.updatedAt > gateStaleAfterMs;
40
+ if (isStale) {
41
+ output.push({
42
+ name: normalizedName,
43
+ passed: false,
44
+ reason: gate.reason || 'Gate snapshot is stale',
45
+ updatedAt: gate.updatedAt
46
+ });
47
+ continue;
48
+ }
49
+ output.push({
50
+ name: normalizedName,
51
+ passed: gate.passed,
52
+ reason: gate.reason,
53
+ updatedAt: gate.updatedAt
54
+ });
55
+ }
56
+ return output;
57
+ };
58
+ const normalizeGateValue = (value, snapshotUpdatedAt, now)=>{
59
+ if ('boolean' == typeof value) return {
60
+ passed: value,
61
+ updatedAt: normalizeUpdatedAt(snapshotUpdatedAt, now)
62
+ };
63
+ if (!value || 'object' != typeof value) return;
64
+ const hasPassed = 'boolean' == typeof value.passed;
65
+ const passed = true === value.passed;
66
+ let reason = 'string' == typeof value.reason && value.reason.trim().length > 0 ? value.reason : void 0;
67
+ if (!hasPassed) reason = reason || 'Gate snapshot record missing "passed" boolean';
68
+ return {
69
+ passed,
70
+ reason,
71
+ updatedAt: normalizeUpdatedAt(value.updatedAt ?? snapshotUpdatedAt, now),
72
+ expiresAt: normalizeExpiresAt(value.expiresAt)
73
+ };
74
+ };
75
+ const normalizeUpdatedAt = (value, fallback)=>{
76
+ if ('number' == typeof value && Number.isFinite(value) && value > 0) return value;
77
+ return fallback;
78
+ };
79
+ const normalizeExpiresAt = (value)=>{
80
+ if ('number' == typeof value && Number.isFinite(value) && value > 0) return value;
81
+ };
82
+ export { getSnapshotGateNames, normalizeSnapshot };
@@ -1,21 +1,21 @@
1
1
  import "node:module";
2
+ import { promises } from "node:fs";
3
+ import node_path from "node:path";
2
4
  import { fs } from "@modern-js/utils";
3
- import { promises } from "fs";
4
- import path from "path";
5
5
  import { parseServerRuntimeExtensionsEnv } from "../env.mjs";
6
6
  import { normalizeSnapshot } from "./resolve.mjs";
7
7
  import { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION, DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH } from "./types.mjs";
8
8
  const resolveContractGateSnapshotPath = (appDirectory, configuredPath)=>{
9
9
  const rawPath = configuredPath || parseServerRuntimeExtensionsEnv().contractGatesFile || DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH;
10
- if (path.isAbsolute(rawPath)) return rawPath;
11
- return path.resolve(appDirectory, rawPath);
10
+ if (node_path.isAbsolute(rawPath)) return rawPath;
11
+ return node_path.resolve(appDirectory, rawPath);
12
12
  };
13
13
  const writeSnapshotFileAtomically = async (resolvedPath, contents)=>{
14
- const directory = path.dirname(resolvedPath);
14
+ const directory = node_path.dirname(resolvedPath);
15
15
  await promises.mkdir(directory, {
16
16
  recursive: true
17
17
  });
18
- const temporaryPath = path.join(directory, `.${path.basename(resolvedPath)}.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);
18
+ const temporaryPath = node_path.join(directory, `.${node_path.basename(resolvedPath)}.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);
19
19
  try {
20
20
  await promises.writeFile(temporaryPath, contents);
21
21
  await promises.rename(temporaryPath, resolvedPath);
@@ -27,7 +27,7 @@ const writeSnapshotFileAtomically = async (resolvedPath, contents)=>{
27
27
  }
28
28
  };
29
29
  const createFileContractGateSnapshotStore = (gateSnapshotPath)=>{
30
- const resolvedPath = path.resolve(gateSnapshotPath);
30
+ const resolvedPath = node_path.resolve(gateSnapshotPath);
31
31
  return {
32
32
  name: `file:${resolvedPath}`,
33
33
  async readSnapshot () {
@@ -90,4 +90,4 @@ const tryResolveBuiltinSnapshotStore = (input)=>{
90
90
  if (!BUILTIN_HTTP_STATE_STORE_MODULES.has(moduleName)) return;
91
91
  return createHttpContractGateSnapshotStore(input.stateStore.options || {});
92
92
  };
93
- export { BUILTIN_HTTP_STATE_STORE_MODULES, createHttpContractGateSnapshotStore, normalizeHttpStoreOptions, tryResolveBuiltinSnapshotStore, withTimeoutAbort };
93
+ export { createHttpContractGateSnapshotStore, tryResolveBuiltinSnapshotStore };
@@ -1,7 +1,7 @@
1
- import __rslib_shim_module__ from "node:module";
2
- const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
1
+ import "node:module";
3
2
  import { createRequire } from "node:module";
4
- import path from "path";
3
+ import node_path from "node:path";
4
+ import { pathToFileURL } from "node:url";
5
5
  import { createFileContractGateSnapshotStore } from "./file-store.mjs";
6
6
  import { tryResolveBuiltinSnapshotStore } from "./http-store.mjs";
7
7
  import { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION } from "./types.mjs";
@@ -29,15 +29,16 @@ const ensureStoreShape = (store, modulePath)=>{
29
29
  const resolveStoreModulePath = (appDirectory, modulePath)=>{
30
30
  const normalized = modulePath.trim();
31
31
  if (!normalized) throw new Error('Contract gate snapshot stateStore.module must be non-empty');
32
- if (path.isAbsolute(normalized)) return normalized;
33
- if (normalized.startsWith('.')) return path.resolve(appDirectory, normalized);
34
- const appRequire = createRequire(path.join(appDirectory, 'package.json'));
32
+ if (node_path.isAbsolute(normalized)) return normalized;
33
+ if (normalized.startsWith('.')) return node_path.resolve(appDirectory, normalized);
34
+ const appRequire = createRequire(node_path.join(appDirectory, 'package.json'));
35
35
  try {
36
36
  return appRequire.resolve(normalized);
37
37
  } catch (_error) {
38
38
  return normalized;
39
39
  }
40
40
  };
41
+ const toStoreModuleImportSpecifier = (modulePath)=>node_path.isAbsolute(modulePath) ? pathToFileURL(modulePath).href : modulePath;
41
42
  const resolveContractGateSnapshotStore = async (input)=>{
42
43
  const { appDirectory, gateSnapshotPath, stateStore, logger } = input;
43
44
  if (!stateStore?.module) return createFileContractGateSnapshotStore(gateSnapshotPath);
@@ -51,7 +52,7 @@ const resolveContractGateSnapshotStore = async (input)=>{
51
52
  const modulePath = resolveStoreModulePath(appDirectory, stateStore.module);
52
53
  let mod;
53
54
  try {
54
- mod = require(modulePath);
55
+ mod = await import(toStoreModuleImportSpecifier(modulePath));
55
56
  } catch (error) {
56
57
  throw new Error(`[telemetry.canary.autopilot] Failed to load stateStore.module "${stateStore.module}" (${modulePath}): ${error instanceof Error ? error.message : String(error)}`);
57
58
  }
@@ -1,5 +1,6 @@
1
1
  import "node:module";
2
- import { createFileContractGateSnapshotStore } from "./contract-gate-snapshot-store/index.mjs";
2
+ import { getSnapshotGateNames, normalizeSnapshot } from "./contract-gate-snapshot-normalization.mjs";
3
+ import { createFileContractGateSnapshotStore } from "./contract-gate-snapshot-store/file-store.mjs";
3
4
  const DEFAULT_POLL_INTERVAL_MS = 15000;
4
5
  const DEFAULT_GATE_STALE_AFTER_MS = 600000;
5
6
  class ContractGateAutopilot {
@@ -22,8 +23,11 @@ class ContractGateAutopilot {
22
23
  const snapshot = await this.loadSnapshot();
23
24
  if (syncGeneration !== this.syncGeneration) return 0;
24
25
  if (!snapshot) return 0;
25
- const snapshotGateNames = this.getSnapshotGateNames(snapshot);
26
- const gates = this.normalizeSnapshot(snapshot);
26
+ const snapshotGateNames = getSnapshotGateNames(snapshot);
27
+ const gates = normalizeSnapshot(snapshot, {
28
+ now: Date.now(),
29
+ gateStaleAfterMs: this.gateStaleAfterMs
30
+ });
27
31
  let updatedCount = snapshotGateNames ? this.clearOmittedGates(snapshotGateNames) : 0;
28
32
  for (const gate of gates){
29
33
  this.orchestrator.addRequiredContractGate(gate.name);
@@ -37,16 +41,6 @@ class ContractGateAutopilot {
37
41
  }
38
42
  return updatedCount;
39
43
  }
40
- getSnapshotGateNames(snapshot) {
41
- const gates = snapshot.gates;
42
- if (!gates || 'object' != typeof gates) return;
43
- const names = new Set();
44
- for (const name of Object.keys(gates)){
45
- const normalizedName = name.trim();
46
- if (normalizedName) names.add(normalizedName);
47
- }
48
- return names;
49
- }
50
44
  clearOmittedGates(snapshotGateNames) {
51
45
  let updatedCount = 0;
52
46
  for (const gateName of Array.from(this.appliedGateFingerprints.keys()))if (!snapshotGateNames.has(gateName)) {
@@ -68,69 +62,6 @@ class ContractGateAutopilot {
68
62
  return;
69
63
  }
70
64
  }
71
- normalizeSnapshot(snapshot) {
72
- const now = Date.now();
73
- const output = [];
74
- const gates = snapshot.gates;
75
- if (!gates || 'object' != typeof gates) return output;
76
- for (const [name, value] of Object.entries(gates)){
77
- const normalizedName = name.trim();
78
- if (!normalizedName) continue;
79
- const gate = this.normalizeGateValue(value, snapshot.updatedAt, now);
80
- if (!gate) continue;
81
- if ('number' == typeof gate.expiresAt && Number.isFinite(gate.expiresAt) && gate.expiresAt > 0 && now >= gate.expiresAt) {
82
- output.push({
83
- name: normalizedName,
84
- passed: true,
85
- reason: void 0,
86
- updatedAt: gate.updatedAt,
87
- expiresAt: gate.expiresAt
88
- });
89
- continue;
90
- }
91
- const isStale = this.gateStaleAfterMs > 0 && now - gate.updatedAt > this.gateStaleAfterMs;
92
- if (isStale) {
93
- output.push({
94
- name: normalizedName,
95
- passed: false,
96
- reason: gate.reason || 'Gate snapshot is stale',
97
- updatedAt: gate.updatedAt
98
- });
99
- continue;
100
- }
101
- output.push({
102
- name: normalizedName,
103
- passed: gate.passed,
104
- reason: gate.reason,
105
- updatedAt: gate.updatedAt
106
- });
107
- }
108
- return output;
109
- }
110
- normalizeGateValue(value, snapshotUpdatedAt, now) {
111
- if ('boolean' == typeof value) return {
112
- passed: value,
113
- updatedAt: this.normalizeUpdatedAt(snapshotUpdatedAt, now)
114
- };
115
- if (!value || 'object' != typeof value) return;
116
- const hasPassed = 'boolean' == typeof value.passed;
117
- const passed = true === value.passed;
118
- let reason = 'string' == typeof value.reason && value.reason.trim().length > 0 ? value.reason : void 0;
119
- if (!hasPassed) reason = reason || 'Gate snapshot record is missing "passed" boolean';
120
- return {
121
- passed,
122
- reason,
123
- updatedAt: this.normalizeUpdatedAt(value.updatedAt ?? snapshotUpdatedAt, now),
124
- expiresAt: this.normalizeExpiresAt(value.expiresAt)
125
- };
126
- }
127
- normalizeUpdatedAt(value, fallback) {
128
- if ('number' == typeof value && Number.isFinite(value) && value > 0) return value;
129
- return fallback;
130
- }
131
- normalizeExpiresAt(value) {
132
- if ('number' == typeof value && Number.isFinite(value) && value > 0) return value;
133
- }
134
65
  constructor(options){
135
66
  this.syncGeneration = 0;
136
67
  this.appliedGateFingerprints = new Map();
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- export { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION, DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH, createFileContractGateSnapshotStore, createHttpContractGateSnapshotStore, resolveContractGateSnapshotPath, resolveContractGateSnapshotStore } from "./contract-gate-snapshot-store/index.mjs";
3
2
  export { ContractGateAutopilot } from "./contractGateAutopilot.mjs";
4
3
  export { DEFAULT_ENVIRONMENT_NAME, parseServerRuntimeExtensionsEnv } from "./env.mjs";
5
4
  export { getRequestPathname, injectMfAssetCacheHeadersPlugin, isMfManifestAsset, isMfRemoteEntryAsset, resolveMfAssetCacheHeaders } from "./mfCache.mjs";
@@ -1,7 +1,7 @@
1
1
  import "node:module";
2
+ import node_path from "node:path";
2
3
  import { fileReader } from "@modern-js/runtime-utils/fileReader";
3
4
  import { fs } from "@modern-js/utils";
4
- import path from "path";
5
5
  const MODULE_FEDERATION_MANIFEST_FILE = 'mf-manifest.json';
6
6
  const warn = (monitors, message, ...args)=>{
7
7
  if (monitors) return void monitors.warn(message, ...args);
@@ -56,7 +56,7 @@ const collectModuleFederationManifestCss = (manifest, manifestUrl)=>{
56
56
  return result;
57
57
  };
58
58
  const getHostManifest = async (pwd, monitors)=>{
59
- const manifestPath = path.join(pwd, MODULE_FEDERATION_MANIFEST_FILE);
59
+ const manifestPath = node_path.join(pwd, MODULE_FEDERATION_MANIFEST_FILE);
60
60
  if (!await fs.pathExists(manifestPath)) return;
61
61
  const manifestBuffer = await fileReader.readFileFromSystem(manifestPath, 'buffer');
62
62
  if (null === manifestBuffer) return;
@@ -67,4 +67,4 @@ const getHostManifest = async (pwd, monitors)=>{
67
67
  return;
68
68
  }
69
69
  };
70
- export { appendResolvedCssAssets, collectModuleFederationManifestCss, ensureTrailingSlash, getCssAssets, getHostManifest, getManifestFallbackBase, getManifestPublicPathBase, normalizeRemoteEntry, tryResolveUrl, warn };
70
+ export { collectModuleFederationManifestCss, ensureTrailingSlash, getHostManifest, normalizeRemoteEntry, warn };
@@ -1,10 +1,4 @@
1
1
  import "node:module";
2
- export { enforceRuntimeFallbackSignalAuth, enforceRuntimeFallbackSignalAuthToken, normalizeRequiredRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackSignalAuthConfig } from "./auth.mjs";
3
- export { DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS, DEFAULT_RUNTIME_FALLBACK_GATE_NAME, DEFAULT_RUNTIME_FALLBACK_MAX_BODY_BYTES, DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT, DEFAULT_RUNTIME_STATUS_ENDPOINT } from "./constants.mjs";
4
- export { persistRuntimeFallbackContractGate } from "./contract-gate.mjs";
5
- export { resolveRuntimeFallbackSignalEndpoint } from "./endpoint.mjs";
6
- export { createRuntimeSignalError } from "./errors.mjs";
7
- export { parseRuntimeFallbackSignalPayload, parseRuntimeFallbackSignalPayloadFromRawBody } from "./payload.mjs";
8
- export { createRuntimeFallbackSignalRuntimeState } from "./state.mjs";
9
- export { getRuntimeSignalErrorStatusCode } from "./status.mjs";
10
- export { enforceRuntimeFallbackSignalTrustPolicy, normalizeRuntimeFallbackTrustPolicy } from "./trust-policy.mjs";
2
+ export { DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS, DEFAULT_RUNTIME_FALLBACK_GATE_NAME, DEFAULT_RUNTIME_FALLBACK_MAX_BODY_BYTES, DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT, DEFAULT_RUNTIME_STATUS_ENDPOINT, createRuntimeSignalError, getRuntimeSignalErrorStatusCode, parseRuntimeFallbackSignalPayload, parseRuntimeFallbackSignalPayloadFromRawBody } from "./model.mjs";
3
+ export { enforceRuntimeFallbackSignalAuth, enforceRuntimeFallbackSignalAuthToken, enforceRuntimeFallbackSignalTrustPolicy, normalizeRequiredRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackTrustPolicy, resolveRuntimeFallbackSignalEndpoint } from "./resolver.mjs";
4
+ export { createRuntimeFallbackSignalRuntimeState, persistRuntimeFallbackContractGate } from "./store.mjs";
@@ -0,0 +1,74 @@
1
+ import "node:module";
2
+ const DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT = '/_modern/contract-gates/runtime-fallback';
3
+ const DEFAULT_RUNTIME_STATUS_ENDPOINT = '/_modern/runtime/status';
4
+ const DEFAULT_RUNTIME_FALLBACK_GATE_NAME = 'runtime-mf-fallback-health';
5
+ const DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS = 300000;
6
+ const DEFAULT_RUNTIME_FALLBACK_MAX_BODY_BYTES = 16384;
7
+ const DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER = 'x-modernjs-runtime-signal-token';
8
+ const DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW = 30;
9
+ const DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS = 60000;
10
+ const DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS = 10000;
11
+ function createRuntimeSignalError(message, code) {
12
+ const error = new Error(message);
13
+ error.code = code;
14
+ return error;
15
+ }
16
+ function getRuntimeSignalErrorStatusCode(signalError) {
17
+ if ('PAYLOAD_TOO_LARGE' === signalError.code) return 413;
18
+ if ('INVALID_PAYLOAD' === signalError.code) return 400;
19
+ if ('UNAUTHORIZED' === signalError.code) return 401;
20
+ if ('RATE_LIMITED' === signalError.code) return 429;
21
+ if ('UNTRUSTED_SOURCE' === signalError.code) return 403;
22
+ return 500;
23
+ }
24
+ function normalizeRuntimeSignalOrigin(value) {
25
+ if ('string' != typeof value || 0 === value.trim().length) return;
26
+ try {
27
+ return new URL(value).origin;
28
+ } catch (_error) {
29
+ return;
30
+ }
31
+ }
32
+ function normalizeRuntimeSignalAppName(payload) {
33
+ if ('string' != typeof payload.appName) return 'unknown';
34
+ const normalized = payload.appName.trim();
35
+ return normalized.length > 0 ? normalized : 'unknown';
36
+ }
37
+ function normalizeRuntimeSignalRuntimeDigest(payload) {
38
+ if ('string' == typeof payload.runtimeDigest && payload.runtimeDigest.trim()) return payload.runtimeDigest.trim();
39
+ const metadata = payload.metadata;
40
+ if (metadata && 'object' == typeof metadata && !Array.isArray(metadata) && 'string' == typeof metadata.runtimeDigest) {
41
+ const digest = String(metadata.runtimeDigest).trim();
42
+ if (digest) return digest;
43
+ }
44
+ }
45
+ function getUtf8ByteLength(input) {
46
+ if ("u" > typeof Buffer) return Buffer.byteLength(input);
47
+ return new TextEncoder().encode(input).length;
48
+ }
49
+ async function parseRuntimeFallbackSignalPayload(c, maxBodyBytes) {
50
+ const contentLengthHeader = c.req.header('content-length');
51
+ if (contentLengthHeader) {
52
+ const contentLength = Number.parseInt(contentLengthHeader, 10);
53
+ if (Number.isFinite(contentLength) && contentLength > maxBodyBytes) throw createRuntimeSignalError('runtime fallback signal payload too large', 'PAYLOAD_TOO_LARGE');
54
+ }
55
+ const rawBody = await c.req.raw.text();
56
+ const payload = parseRuntimeFallbackSignalPayloadFromRawBody(rawBody, maxBodyBytes);
57
+ return {
58
+ rawBody,
59
+ payload
60
+ };
61
+ }
62
+ function parseRuntimeFallbackSignalPayloadFromRawBody(rawBody, maxBodyBytes) {
63
+ if (!rawBody || 0 === rawBody.trim().length) throw createRuntimeSignalError('runtime fallback signal body empty', 'INVALID_PAYLOAD');
64
+ if (getUtf8ByteLength(rawBody) > maxBodyBytes) throw createRuntimeSignalError('runtime fallback signal payload too large', 'PAYLOAD_TOO_LARGE');
65
+ let payload;
66
+ try {
67
+ payload = JSON.parse(rawBody);
68
+ } catch (_error) {
69
+ throw createRuntimeSignalError('runtime fallback signal body must be valid JSON', 'INVALID_PAYLOAD');
70
+ }
71
+ if (!payload || 'object' != typeof payload || Array.isArray(payload)) throw createRuntimeSignalError('runtime fallback signal body must be a JSON object', 'INVALID_PAYLOAD');
72
+ return payload;
73
+ }
74
+ export { DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER, DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS, DEFAULT_RUNTIME_FALLBACK_GATE_NAME, DEFAULT_RUNTIME_FALLBACK_MAX_BODY_BYTES, DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT, DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS, DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW, DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS, DEFAULT_RUNTIME_STATUS_ENDPOINT, createRuntimeSignalError, getRuntimeSignalErrorStatusCode, normalizeRuntimeSignalAppName, normalizeRuntimeSignalOrigin, normalizeRuntimeSignalRuntimeDigest, parseRuntimeFallbackSignalPayload, parseRuntimeFallbackSignalPayloadFromRawBody };
@@ -0,0 +1,108 @@
1
+ import "node:module";
2
+ import { createHash, timingSafeEqual } from "node:crypto";
3
+ import { DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER, DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT, DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS, DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW, DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS, createRuntimeSignalError, normalizeRuntimeSignalAppName, normalizeRuntimeSignalOrigin, normalizeRuntimeSignalRuntimeDigest } from "./model.mjs";
4
+ import { cleanupRuntimeFallbackSignalRuntimeState } from "./store.mjs";
5
+ function resolveRuntimeFallbackSignalEndpoint(configuredEndpoint) {
6
+ if ('string' == typeof configuredEndpoint && configuredEndpoint.trim()) return configuredEndpoint.trim();
7
+ return DEFAULT_RUNTIME_FALLBACK_SIGNAL_ENDPOINT;
8
+ }
9
+ function normalizeRuntimeFallbackSignalAuthConfig(configured) {
10
+ const headerName = 'string' == typeof configured?.headerName && configured.headerName.trim() ? configured.headerName.trim().toLowerCase() : DEFAULT_RUNTIME_FALLBACK_AUTH_HEADER;
11
+ const expectedFromEnv = 'string' == typeof configured?.expectedValueEnv && configured.expectedValueEnv.trim().length > 0 ? process.env[configured.expectedValueEnv.trim()] : void 0;
12
+ const expectedFromConfig = 'string' == typeof configured?.expectedValue && configured.expectedValue.trim().length > 0 ? configured.expectedValue.trim() : void 0;
13
+ const expectedValue = expectedFromConfig || expectedFromEnv;
14
+ const enabled = configured?.enabled === true;
15
+ if (enabled && !expectedValue) throw new Error('[telemetry.canary.autopilot.runtimeFallbackSignal] auth.enabled true but no expected token configured');
16
+ return {
17
+ enabled,
18
+ headerName,
19
+ expectedValue
20
+ };
21
+ }
22
+ function normalizeRequiredRuntimeFallbackSignalAuthConfig(configured) {
23
+ if (configured?.enabled === false) throw new Error('[telemetry.canary.autopilot.runtimeFallbackSignal] auth.enabled cannot be false when runtimeFallbackSignal.enabled is true');
24
+ const authConfig = normalizeRuntimeFallbackSignalAuthConfig(configured);
25
+ if (!authConfig.expectedValue) throw new Error('[telemetry.canary.autopilot.runtimeFallbackSignal] auth.expectedValue or auth.expectedValueEnv is required when runtimeFallbackSignal.enabled is true');
26
+ return {
27
+ ...authConfig,
28
+ enabled: true
29
+ };
30
+ }
31
+ function safeTokenEquals(candidate, expected) {
32
+ const candidateDigest = createHash('sha256').update(candidate).digest();
33
+ const expectedDigest = createHash('sha256').update(expected).digest();
34
+ return timingSafeEqual(candidateDigest, expectedDigest);
35
+ }
36
+ function enforceRuntimeFallbackSignalAuthToken(token, authConfig) {
37
+ if (!authConfig.enabled) return;
38
+ if (!token || !authConfig.expectedValue || !safeTokenEquals(token, authConfig.expectedValue)) throw createRuntimeSignalError('runtime fallback signal auth failed', 'UNAUTHORIZED');
39
+ }
40
+ function enforceRuntimeFallbackSignalAuth(c, runtimeSignalConfig) {
41
+ enforceRuntimeFallbackSignalAuthToken(c.req.header(runtimeSignalConfig.auth.headerName), runtimeSignalConfig.auth);
42
+ }
43
+ const normalizeInteger = (value, fallback, minimum)=>{
44
+ const candidate = 'number' == typeof value && Number.isFinite(value) ? value : fallback;
45
+ return Math.max(minimum, Math.floor(candidate));
46
+ };
47
+ function normalizeRuntimeFallbackTrustPolicy(configured) {
48
+ const allowedApps = Array.isArray(configured?.allowedApps) ? configured.allowedApps.map((item)=>'string' == typeof item ? item.trim() : '').filter(Boolean) : [];
49
+ const allowedEntryOrigins = Array.isArray(configured?.allowedEntryOrigins) ? configured.allowedEntryOrigins.map((item)=>normalizeRuntimeSignalOrigin(item)).filter((item)=>Boolean(item)) : [];
50
+ const expectedRuntimeDigests = {};
51
+ Object.entries(configured?.expectedRuntimeDigests || {}).forEach(([appName, digest])=>{
52
+ if ('string' == typeof appName && appName.trim().length > 0 && 'string' == typeof digest && digest.trim().length > 0) expectedRuntimeDigests[appName.trim()] = digest.trim();
53
+ });
54
+ return {
55
+ allowedApps,
56
+ allowedEntryOrigins,
57
+ expectedRuntimeDigests,
58
+ enforceRuntimeDigest: configured?.enforceRuntimeDigest === true,
59
+ maxSignalsPerWindow: normalizeInteger(configured?.maxSignalsPerWindow, DEFAULT_RUNTIME_FALLBACK_TRUST_MAX_SIGNALS_PER_WINDOW, 1),
60
+ windowMs: normalizeInteger(configured?.windowMs, DEFAULT_RUNTIME_FALLBACK_TRUST_WINDOW_MS, 1),
61
+ dedupeWindowMs: normalizeInteger(configured?.dedupeWindowMs, DEFAULT_RUNTIME_FALLBACK_TRUST_DEDUPE_WINDOW_MS, 0)
62
+ };
63
+ }
64
+ function enforceRuntimeFallbackSignalTrustPolicy(payload, runtimeSignalContext, source = {}) {
65
+ const { trustPolicy, runtimeState } = runtimeSignalContext;
66
+ const now = Date.now();
67
+ cleanupRuntimeFallbackSignalRuntimeState(now, runtimeState, trustPolicy);
68
+ const appName = normalizeRuntimeSignalAppName(payload);
69
+ const entryOrigin = normalizeRuntimeSignalOrigin(payload.entry);
70
+ const runtimeDigest = normalizeRuntimeSignalRuntimeDigest(payload);
71
+ if (trustPolicy.allowedApps.length > 0 && !trustPolicy.allowedApps.includes(appName)) throw createRuntimeSignalError(`runtime fallback signal app "${appName}" is not trusted`, 'UNTRUSTED_SOURCE');
72
+ if (trustPolicy.allowedEntryOrigins.length > 0) {
73
+ if (!entryOrigin || !trustPolicy.allowedEntryOrigins.includes(entryOrigin)) throw createRuntimeSignalError(`runtime fallback signal entry origin "${entryOrigin || 'unknown'}" is not trusted`, 'UNTRUSTED_SOURCE');
74
+ }
75
+ const expectedDigest = trustPolicy.expectedRuntimeDigests[appName];
76
+ if (expectedDigest && runtimeDigest !== expectedDigest) throw createRuntimeSignalError(`runtime fallback runtimeDigest mismatch for app "${appName}"`, 'UNTRUSTED_SOURCE');
77
+ if (trustPolicy.enforceRuntimeDigest && !runtimeDigest) throw createRuntimeSignalError(`runtime fallback signal app "${appName}" missing runtimeDigest`, 'UNTRUSTED_SOURCE');
78
+ const dedupeFingerprint = JSON.stringify({
79
+ appName,
80
+ entryOrigin: entryOrigin || 'unknown',
81
+ reason: payload.reason || 'runtime_fallback',
82
+ phase: payload.phase || 'unknown',
83
+ runtimeDigest: runtimeDigest || 'unknown'
84
+ });
85
+ const dedupeWindowMs = trustPolicy.dedupeWindowMs;
86
+ if (dedupeWindowMs > 0) {
87
+ const lastSeenAt = runtimeState.dedupeByFingerprint.get(dedupeFingerprint);
88
+ runtimeState.dedupeByFingerprint.set(dedupeFingerprint, now);
89
+ if ('number' == typeof lastSeenAt && now - lastSeenAt <= dedupeWindowMs) return {
90
+ deduped: true
91
+ };
92
+ } else runtimeState.dedupeByFingerprint.set(dedupeFingerprint, now);
93
+ const remoteAddress = source.remoteAddress?.trim();
94
+ const sourceKey = remoteAddress || 'unknown-remote';
95
+ const rateState = runtimeState.rateLimitBySource.get(sourceKey);
96
+ if (!rateState || now - rateState.windowStartedAt > trustPolicy.windowMs) runtimeState.rateLimitBySource.set(sourceKey, {
97
+ count: 1,
98
+ windowStartedAt: now
99
+ });
100
+ else {
101
+ if (rateState.count >= trustPolicy.maxSignalsPerWindow) throw createRuntimeSignalError(`runtime fallback signal rate-limited source "${sourceKey}"`, 'RATE_LIMITED');
102
+ rateState.count += 1;
103
+ }
104
+ return {
105
+ deduped: false
106
+ };
107
+ }
108
+ export { enforceRuntimeFallbackSignalAuth, enforceRuntimeFallbackSignalAuthToken, enforceRuntimeFallbackSignalTrustPolicy, normalizeRequiredRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackTrustPolicy, resolveRuntimeFallbackSignalEndpoint };