@wildo-ai/platform-config-lib 1.1.2 → 1.1.3

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 (77) hide show
  1. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +49 -1
  2. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  3. package/dist/esm/bootstrap/bootstrap.schemas.js +36 -2
  4. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  5. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +2 -3
  6. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  7. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +2 -3
  8. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/runtime-network-topology.d.ts +0 -1
  10. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/runtime-network-topology.js +0 -2
  12. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  13. package/dist/esm/config-authoring.entry.d.ts +1 -2
  14. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  15. package/dist/esm/config-authoring.entry.js +35 -2
  16. package/dist/esm/config-authoring.entry.js.map +1 -1
  17. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +0 -20
  18. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  19. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +0 -1
  20. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  21. package/dist/esm/project-config/define-infra-env-config.d.ts +3 -39
  22. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  23. package/dist/esm/project-config/define-infra-env-config.js +2 -2
  24. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  25. package/dist/esm/project-config/define-saas-config.d.ts +366 -14
  26. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  27. package/dist/esm/project-config/define-saas-config.js +121 -11
  28. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  29. package/dist/esm/project-config/provider-companion-discovery.d.ts +74 -1
  30. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  31. package/dist/esm/project-config/provider-companion-discovery.js +203 -6
  32. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  33. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +41 -15
  34. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  35. package/dist/esm/project-config/provider-runtime-artifacts.js +75 -6
  36. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  37. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +7 -43
  38. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  39. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -30
  40. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  41. package/dist/esm/project-config/shared/csp-emit.d.ts +36 -5
  42. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  43. package/dist/esm/project-config/shared/csp-emit.js +65 -5
  44. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  45. package/dist/esm/project-config/shared/csp.schemas.d.ts +46 -10
  46. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  47. package/dist/esm/project-config/shared/csp.schemas.js +45 -10
  48. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  49. package/dist/esm/project-config/shared/environment.schemas.d.ts +8 -6
  50. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  51. package/dist/esm/project-config/shared/environment.schemas.js +7 -5
  52. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  53. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +18 -3
  54. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  55. package/dist/esm/project-config/shared/infra-providers.schemas.js +34 -2
  56. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  57. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +0 -2
  58. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  59. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +0 -2
  60. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  61. package/dist/esm/project-config/shared/k8s-utils.d.ts +70 -10
  62. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  63. package/dist/esm/project-config/shared/k8s-utils.js +75 -11
  64. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  65. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +15 -15
  66. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +15 -15
  67. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  68. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +30 -0
  69. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  70. package/dist/esm/project-config/shared/platform-services.schemas.js +31 -0
  71. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  72. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +14 -0
  73. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  74. package/dist/esm/workspace-scope/workspace-homes.schemas.js +2 -0
  75. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  76. package/dist/tsconfig.build.tsbuildinfo +1 -1
  77. package/package.json +7 -7
@@ -24,7 +24,6 @@ export declare enum BackingServiceKind {
24
24
  RABBITMQ = "rabbitmq",
25
25
  S3 = "s3",
26
26
  POSTGRESQL = "postgresql",
27
- GOTENBERG = "gotenberg",
28
27
  CLAMAV = "clamav",
29
28
  /**
30
29
  * immudb — an immutable, cryptographically-verifiable database used as a
@@ -32,11 +31,6 @@ export declare enum BackingServiceKind {
32
31
  * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.
33
32
  */
34
33
  IMMUDB = "immudb",
35
- /**
36
- * Metrics / telemetry sink (Prometheus, DataDog, OpenTelemetry, …).
37
- * Stateless base for now.
38
- */
39
- METRICS = "metrics-telemetry",
40
34
  /**
41
35
  * Backup orchestration target. Stateless base for now.
42
36
  */
@@ -142,14 +136,6 @@ export declare const S3BackingServiceSchema: z.ZodObject<{
142
136
  bucket: z.ZodOptional<z.ZodString>;
143
137
  }, z.core.$strict>;
144
138
  export type S3BackingService = z.infer<typeof S3BackingServiceSchema>;
145
- /** Gotenberg PDF service. Stateless, no database/vhost/bucket. */
146
- export declare const GotenbergBackingServiceSchema: z.ZodObject<{
147
- source: z.ZodEnum<typeof BackingServiceSource>;
148
- provider: z.ZodOptional<z.ZodString>;
149
- host: z.ZodOptional<z.ZodString>;
150
- port: z.ZodOptional<z.ZodNumber>;
151
- }, z.core.$strict>;
152
- export type GotenbergBackingService = z.infer<typeof GotenbergBackingServiceSchema>;
153
139
  /** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */
154
140
  export declare const ClamAvBackingServiceSchema: z.ZodObject<{
155
141
  source: z.ZodEnum<typeof BackingServiceSource>;
@@ -188,17 +174,6 @@ export declare const ImmudbBackingServiceSchema: z.ZodObject<{
188
174
  database: z.ZodOptional<z.ZodString>;
189
175
  }, z.core.$strict>;
190
176
  export type ImmudbBackingService = z.infer<typeof ImmudbBackingServiceSchema>;
191
- /**
192
- * Metrics / telemetry sink (Prometheus / DataDog / OpenTelemetry / …).
193
- * Stateless base for now.
194
- */
195
- export declare const MetricsBackingServiceSchema: z.ZodObject<{
196
- source: z.ZodEnum<typeof BackingServiceSource>;
197
- provider: z.ZodOptional<z.ZodString>;
198
- host: z.ZodOptional<z.ZodString>;
199
- port: z.ZodOptional<z.ZodNumber>;
200
- }, z.core.$strict>;
201
- export type MetricsBackingService = z.infer<typeof MetricsBackingServiceSchema>;
202
177
  /**
203
178
  * Backup orchestration target. Stateless base for now.
204
179
  */
@@ -216,7 +191,7 @@ export type BackupBackingService = z.infer<typeof BackupBackingServiceSchema>;
216
191
  * kind-specific fields MUST narrow first (e.g. via the per-kind type
217
192
  * exports above).
218
193
  */
219
- export type BackingServiceEnvConfig = MongoBackingService | RedisBackingService | PostgresBackingService | RabbitBackingService | S3BackingService | GotenbergBackingService | ClamAvBackingService | ImmudbBackingService | MetricsBackingService | BackupBackingService;
194
+ export type BackingServiceEnvConfig = MongoBackingService | RedisBackingService | PostgresBackingService | RabbitBackingService | S3BackingService | ClamAvBackingService | ImmudbBackingService | BackupBackingService;
220
195
  /**
221
196
  * Per-environment backing services config (source for each service).
222
197
  * Used in environment-specific infra descriptors.
@@ -263,12 +238,6 @@ export declare const BackingServicesEnvConfigSchema: z.ZodObject<{
263
238
  port: z.ZodOptional<z.ZodNumber>;
264
239
  database: z.ZodOptional<z.ZodString>;
265
240
  }, z.core.$strict>>;
266
- gotenberg: z.ZodOptional<z.ZodObject<{
267
- source: z.ZodEnum<typeof BackingServiceSource>;
268
- provider: z.ZodOptional<z.ZodString>;
269
- host: z.ZodOptional<z.ZodString>;
270
- port: z.ZodOptional<z.ZodNumber>;
271
- }, z.core.$strict>>;
272
241
  clamav: z.ZodOptional<z.ZodObject<{
273
242
  source: z.ZodEnum<typeof BackingServiceSource>;
274
243
  provider: z.ZodOptional<z.ZodString>;
@@ -282,12 +251,6 @@ export declare const BackingServicesEnvConfigSchema: z.ZodObject<{
282
251
  port: z.ZodOptional<z.ZodNumber>;
283
252
  database: z.ZodOptional<z.ZodString>;
284
253
  }, z.core.$strict>>;
285
- "metrics-telemetry": z.ZodOptional<z.ZodObject<{
286
- source: z.ZodEnum<typeof BackingServiceSource>;
287
- provider: z.ZodOptional<z.ZodString>;
288
- host: z.ZodOptional<z.ZodString>;
289
- port: z.ZodOptional<z.ZodNumber>;
290
- }, z.core.$strict>>;
291
254
  backup: z.ZodOptional<z.ZodObject<{
292
255
  source: z.ZodEnum<typeof BackingServiceSource>;
293
256
  provider: z.ZodOptional<z.ZodString>;
@@ -298,10 +261,12 @@ export declare const BackingServicesEnvConfigSchema: z.ZodObject<{
298
261
  export type BackingServicesEnvConfig = z.infer<typeof BackingServicesEnvConfigSchema>;
299
262
  /** @wildo_source:part:end platform.config.backing-services */
300
263
  /**
301
- * Bijective `BackingServiceKind` → `InfraCapability` mapping. Every
302
- * extension to `BackingServiceKind` MUST extend this map in the same
303
- * commit, otherwise the planner cannot project the new kind to its
304
- * capability slot.
264
+ * `BackingServiceKind` → `InfraCapability`. Every extension to `BackingServiceKind` MUST extend this
265
+ * map in the same commit, otherwise the planner cannot project the new kind to its capability slot.
266
+ *
267
+ * INJECTIVE, not bijective — and the difference is a real property of the model rather than a gap.
268
+ * A capability may be granted to a runtime without any environment declaring a backing service for
269
+ * it; see {@link RUNTIME_GRANTED_INFRA_CAPABILITIES} for the ones that are, and why.
305
270
  */
306
271
  export declare const BackingServiceKindToInfraCapability: Record<BackingServiceKind, InfraCapability>;
307
272
  /**
@@ -331,7 +296,6 @@ export declare const BackingServiceKindToInfraCapability: Record<BackingServiceK
331
296
  * | `S3` | `SELF` | (`'minio'` or unset) | `MINIO_SELF` |
332
297
  * | `S3` | `MANAGED` | `'aws'` | `AWS_S3` |
333
298
  * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` |
334
- * | `GOTENBERG` | `SELF` | (any) | `GOTENBERG_SELF` |
335
299
  *
336
300
  * Returns `undefined` for combinations not in the table — for kinds
337
301
  * whose `InfraProvider` catalog has no concrete entry yet (METRICS,
@@ -1 +1 @@
1
- {"version":3,"file":"backing-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,Y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Q,CAAC,EAAE,MAAM,GAChB,aAAa,GAAG,SAAS,CAsE3B"}
1
+ {"version":3,"file":"backing-services.schemas.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,EAAE,OAAO;IACT,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB;;;;OAIG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAuDD;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;;;;;;kBAE3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB;;;;;;kBAE3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;kBAE9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;;;;;;kBAE5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB;;;;;;;kBA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@@ -25,7 +25,6 @@ export var BackingServiceKind;
25
25
  BackingServiceKind["RABBITMQ"] = "rabbitmq";
26
26
  BackingServiceKind["S3"] = "s3";
27
27
  BackingServiceKind["POSTGRESQL"] = "postgresql";
28
- BackingServiceKind["GOTENBERG"] = "gotenberg";
29
28
  BackingServiceKind["CLAMAV"] = "clamav";
30
29
  /**
31
30
  * immudb — an immutable, cryptographically-verifiable database used as a
@@ -33,11 +32,6 @@ export var BackingServiceKind;
33
32
  * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.
34
33
  */
35
34
  BackingServiceKind["IMMUDB"] = "immudb";
36
- /**
37
- * Metrics / telemetry sink (Prometheus, DataDog, OpenTelemetry, …).
38
- * Stateless base for now.
39
- */
40
- BackingServiceKind["METRICS"] = "metrics-telemetry";
41
35
  /**
42
36
  * Backup orchestration target. Stateless base for now.
43
37
  */
@@ -171,8 +165,6 @@ export const S3BackingServiceSchema = BackingServiceBaseSchema.extend({
171
165
  endpoint: z.string().min(1).optional(),
172
166
  bucket: z.string().min(1).optional(),
173
167
  }).strict();
174
- /** Gotenberg PDF service. Stateless, no database/vhost/bucket. */
175
- export const GotenbergBackingServiceSchema = BackingServiceBaseSchema;
176
168
  /** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */
177
169
  export const ClamAvBackingServiceSchema = BackingServiceBaseSchema;
178
170
  /**
@@ -200,11 +192,6 @@ export const ClamAvBackingServiceSchema = BackingServiceBaseSchema;
200
192
  export const ImmudbBackingServiceSchema = BackingServiceBaseSchema.extend({
201
193
  database: z.string().min(1).optional(),
202
194
  }).strict();
203
- /**
204
- * Metrics / telemetry sink (Prometheus / DataDog / OpenTelemetry / …).
205
- * Stateless base for now.
206
- */
207
- export const MetricsBackingServiceSchema = BackingServiceBaseSchema;
208
195
  /**
209
196
  * Backup orchestration target. Stateless base for now.
210
197
  */
@@ -224,10 +211,8 @@ export const BackingServicesEnvConfigSchema = z.object({
224
211
  [BackingServiceKind.RABBITMQ]: RabbitBackingServiceSchema.optional(),
225
212
  [BackingServiceKind.S3]: S3BackingServiceSchema.optional(),
226
213
  [BackingServiceKind.POSTGRESQL]: PostgresBackingServiceSchema.optional(),
227
- [BackingServiceKind.GOTENBERG]: GotenbergBackingServiceSchema.optional(),
228
214
  [BackingServiceKind.CLAMAV]: ClamAvBackingServiceSchema.optional(),
229
215
  [BackingServiceKind.IMMUDB]: ImmudbBackingServiceSchema.optional(),
230
- [BackingServiceKind.METRICS]: MetricsBackingServiceSchema.optional(),
231
216
  [BackingServiceKind.BACKUP]: BackupBackingServiceSchema.optional(),
232
217
  }).strict();
233
218
  /** @wildo_source:part:end platform.config.backing-services */
@@ -244,10 +229,12 @@ export const BackingServicesEnvConfigSchema = z.object({
244
229
  // single source of truth for that projection — no other code may
245
230
  // reconstruct them locally.
246
231
  /**
247
- * Bijective `BackingServiceKind` → `InfraCapability` mapping. Every
248
- * extension to `BackingServiceKind` MUST extend this map in the same
249
- * commit, otherwise the planner cannot project the new kind to its
250
- * capability slot.
232
+ * `BackingServiceKind` → `InfraCapability`. Every extension to `BackingServiceKind` MUST extend this
233
+ * map in the same commit, otherwise the planner cannot project the new kind to its capability slot.
234
+ *
235
+ * INJECTIVE, not bijective — and the difference is a real property of the model rather than a gap.
236
+ * A capability may be granted to a runtime without any environment declaring a backing service for
237
+ * it; see {@link RUNTIME_GRANTED_INFRA_CAPABILITIES} for the ones that are, and why.
251
238
  */
252
239
  export const BackingServiceKindToInfraCapability = {
253
240
  [BackingServiceKind.MONGODB]: InfraCapability.DOCUMENT_DATABASE,
@@ -255,10 +242,8 @@ export const BackingServiceKindToInfraCapability = {
255
242
  [BackingServiceKind.RABBITMQ]: InfraCapability.QUEUING_SYSTEM,
256
243
  [BackingServiceKind.REDIS]: InfraCapability.CACHE_MANAGER,
257
244
  [BackingServiceKind.S3]: InfraCapability.OBJECT_STORAGE,
258
- [BackingServiceKind.GOTENBERG]: InfraCapability.DOCUMENT_RENDERING,
259
245
  [BackingServiceKind.CLAMAV]: InfraCapability.ANTIVIRUS_SCANNING,
260
246
  [BackingServiceKind.IMMUDB]: InfraCapability.AUDIT_LOG_STORAGE,
261
- [BackingServiceKind.METRICS]: InfraCapability.METRICS_TELEMETRY,
262
247
  [BackingServiceKind.BACKUP]: InfraCapability.BACKUP_MANAGER,
263
248
  };
264
249
  /**
@@ -288,7 +273,6 @@ export const BackingServiceKindToInfraCapability = {
288
273
  * | `S3` | `SELF` | (`'minio'` or unset) | `MINIO_SELF` |
289
274
  * | `S3` | `MANAGED` | `'aws'` | `AWS_S3` |
290
275
  * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` |
291
- * | `GOTENBERG` | `SELF` | (any) | `GOTENBERG_SELF` |
292
276
  *
293
277
  * Returns `undefined` for combinations not in the table — for kinds
294
278
  * whose `InfraProvider` catalog has no concrete entry yet (METRICS,
@@ -364,20 +348,19 @@ export function resolveInfraProvider(kind, source, provider) {
364
348
  if (source === BackingServiceSource.SELF)
365
349
  return InfraProvider.CLAMAV_SELF;
366
350
  return undefined;
367
- case BackingServiceKind.GOTENBERG:
368
- if (source === BackingServiceSource.SELF)
369
- return InfraProvider.GOTENBERG_SELF;
370
- return undefined;
371
351
  case BackingServiceKind.IMMUDB:
372
352
  if (source === BackingServiceSource.SELF)
373
353
  return InfraProvider.IMMUDB_SELF;
374
354
  // Managed immudb (immudb Vault) — not catalogued yet; future expansion.
375
355
  return undefined;
376
- case BackingServiceKind.METRICS:
377
356
  case BackingServiceKind.BACKUP:
378
- // No concrete `InfraProvider` declared yet for these kinds.
379
- // Extend `InfraProvider` enum + this branch in the same slice
380
- // that introduces the first concrete provider for each kind.
357
+ // No concrete `InfraProvider` declared yet for this kind. Extend the `InfraProvider` enum +
358
+ // this branch in the same slice that introduces the first concrete provider for it.
359
+ //
360
+ // `METRICS` was the other kind here and was WITHDRAWN 2026-09-09: telemetry is authored at
361
+ // `observability.telemetry` and its auth header derived from the selected
362
+ // `OBSERVABILITY_TELEMETRY` provider, so a backing-service kind was a third declaration
363
+ // surface that nothing read. See `RUNTIME_GRANTED_INFRA_CAPABILITIES`.
381
364
  return undefined;
382
365
  }
383
366
  }
@@ -1 +1 @@
1
- {"version":3,"file":"backing-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,kBAuBX;AAvBD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,+BAAS,CAAA;IACT,+CAAyB,CAAA;IACzB,6CAAuB,CAAA;IACvB,uCAAiB,CAAA;IACjB;;;;OAIG;IACH,uCAAiB,CAAA;IACjB;;;OAGG;IACH,mDAA6B,CAAA;IAC7B;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAvBW,kBAAkB,KAAlB,kBAAkB,QAuB7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qCAAa,CAAA;IACb,2CAAmB,CAAA;AACrB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC;IACpC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtC;;;;;;OAMG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClC;;;;OAIG;I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B,4DAA4D;YAC5D,8DAA8D;YAC9D,6DAA6D;YAC7D,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n InfraCapability,\n InfraProvider,\n} from './infra-providers.schemas';\n\n/**\n * The backing-service authoring surface of `wildo.infra.<env>.config.ts`.\n *\n * Import from `@wildo-ai/platform-config-lib`. Everything below is what an\n * environment file may declare under `backingServices: { ... }` — the closed kind\n * vocabulary, the hosting-model axis, and the per-kind entry shape. The\n * `InfraCapability` / `InfraProvider` projections further down this file are\n * planner-internal and deliberately outside the anchor: an app author never writes\n * them.\n *\n * Declare a kind ONLY when the environment actually runs it — keys are optional so a\n * flattened app declaration stays truthful about what it enables. Omitting a kind an\n * enabled engine capability depends on is the classic silent-degradation bug: e.g.\n * `COMPLIANCE_AUDIT_TRAIL` without `immudb` leaves the tamper-evident audit store\n * unbacked, which `wildo config sync` reports as a warning per environment.\n *\n * @wildo_source:part:start platform.config.backing-services facet:layer:platform facet:family:infra\n */\nexport enum BackingServiceKind {\n MONGODB = 'mongodb',\n REDIS = 'redis',\n RABBITMQ = 'rabbitmq',\n S3 = 's3',\n POSTGRESQL = 'postgresql',\n GOTENBERG = 'gotenberg',\n CLAMAV = 'clamav',\n /**\n * immudb — an immutable, cryptographically-verifiable database used as a\n * tamper-evident audit-log store (fills the `AUDIT_LOG_STORAGE` capability).\n * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.\n */\n IMMUDB = 'immudb',\n /**\n * Metrics / telemetry sink (Prometheus, DataDog, OpenTelemetry, …).\n * Stateless base for now.\n */\n METRICS = 'metrics-telemetry',\n /**\n * Backup orchestration target. Stateless base for now.\n */\n BACKUP = 'backup',\n}\n\n/**\n * Hosting model of a backing service instance — the orthogonal axis to\n * the **brand** (which is captured by the per-kind `provider` field).\n *\n * - `self`: self-hosted (Docker/K8s container managed by the platform,\n * or operator-managed on-prem). Brands here are open-source\n * software names (e.g. MinIO for S3, vanilla Postgres / MongoDB).\n * - `managed`: external vendor-managed service. Brands here are\n * vendor names (e.g. `'atlas'` for MongoDB Atlas, `'aws-rds'` for\n * AWS RDS, `'supabase'` for Supabase Postgres, `'aws'` for AWS S3).\n *\n * **Slice 4.B.0 reshape (2026-05-07)**: the `ATLAS` value was removed.\n * Pre-reshape `source: ATLAS` becomes `source: MANAGED, provider:\n * 'atlas'`. The reshape generalizes from \"Mongo + S3 are the only\n * brand-aware kinds\" to \"every kind can be brand-aware when the\n * managed market has multiple vendors\" — Postgres in particular\n * (RDS / GCP Cloud SQL / Supabase / Neon / Render / Azure).\n */\nexport enum BackingServiceSource {\n SELF = 'self',\n MANAGED = 'managed',\n}\n\n/**\n * Common fields every backing-service entry shares.\n *\n * Per-kind extensions add the fields that are SEMANTICALLY meaningful\n * for that kind only. Slice 3 closeout (M-4 + L-5): the previous shared\n * `BackingServiceEnvConfigSchema` collapsed `database` into a\n * `union(int, string)` and put `name` only on Mongo; both compromised\n * the framework-mindset rule that \"every field must carry its semantic\n * weight\". The split below means a typo like `redis: { database:\n * 'staging' }` (string on a kind that needs an integer DB index) is\n * rejected at parse time instead of crashing the runtime client at\n * connect time.\n */\nconst BackingServiceBaseSchema = z.object({\n source: z.enum(BackingServiceSource),\n /**\n * Brand of the backing service. Orthogonal to `source` (hosting\n * model). Required-in-spirit when `source === MANAGED` and the\n * managed market has multiple vendors (Mongo: `'atlas'` /\n * `'aws-documentdb'` / …; Postgres: `'aws-rds'` / `'gcp-cloud-sql'`\n * / `'supabase'` / `'neon'` / `'render'` / `'azure-database'`;\n * S3: `'aws'` / `'cloudflare-r2'` / …); optional when `source ===\n * SELF` (e.g. S3-self-hosted defaults to MinIO; `provider:\n * 'minio'` is allowed but redundant).\n *\n * Modeled as `z.string().optional()` rather than per-kind enum\n * unions to keep this base schema simple — the canonical brand\n * vocabulary lives in `resolveInfraProvider`'s dispatch table\n * (each kind documents which brand strings it recognizes; unknown\n * brands fall back to the kind's generic `<KIND>_MANAGED` /\n * `<KIND>_SELF` entry where one exists, otherwise return\n * `undefined`).\n *\n * Slice 4.B.0 (2026-05-07) generalized this from \"S3-only\" to\n * every brand-aware kind.\n */\n provider: z.string().min(1).optional(),\n /**\n * Override the catalog-derived hostname for this kind. Honored at\n * `HOST_FACING` perspective (always) and at `CONTAINER_INTERNAL` for\n * `MANAGED` sources. SELF + `CONTAINER_INTERNAL` keeps the catalog\n * container name because that is the only DNS the container network\n * can resolve.\n */\n host: z.string().min(1).optional(),\n /**\n * Override the catalog-derived listen port. Threaded into both\n * docker-compose `<authored>:<authored>` publish and the per-app\n * env-vars (`<KIND>_PORT`).\n */\n port: z.number().int().positive().optional(),\n}).strict();\n\n/**\n * MongoDB backing service. `database` is the database NAME (string).\n *\n * Mongo's connection URL has the shape `mongodb://host:port/<database>`\n * — this string corresponds to the path segment. Pre-3 the field was\n * `name`; renamed to `database` in Slice 3 closeout (L-5) so all\n * data-store kinds use the same property name for the same concept\n * (vs. Postgres which already used `database`).\n */\nexport const MongoBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type MongoBackingService = z.infer<typeof MongoBackingServiceSchema>;\n\n/**\n * Redis backing service. `database` is the LOGICAL DB INDEX (integer).\n *\n * Redis exposes 16 logical databases (0–15) on a single connection.\n * Authoring a string here (e.g. `'staging'`) would silently parse on\n * the pre-3 union schema and crash ioredis at connect; the integer\n * constraint with `max(15)` fails loud at parse time.\n */\nexport const RedisBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.number().int().min(0).max(15).optional(),\n}).strict();\nexport type RedisBackingService = z.infer<typeof RedisBackingServiceSchema>;\n\n/**\n * PostgreSQL backing service. `database` is the database NAME (string).\n *\n * Symmetric with `MongoBackingService.database` — both are the\n * database identifier in their respective connection URLs.\n */\nexport const PostgresBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type PostgresBackingService = z.infer<typeof PostgresBackingServiceSchema>;\n\n/**\n * RabbitMQ backing service. `vhost` is the RabbitMQ virtual host.\n *\n * AMQP virtual hosts isolate exchange/queue namespaces inside a single\n * broker. NOT a database — RabbitMQ has no DB concept — so the field\n * is intentionally NOT named `database`.\n */\nexport const RabbitBackingServiceSchema = BackingServiceBaseSchema.extend({\n vhost: z.string().min(1).optional(),\n}).strict();\nexport type RabbitBackingService = z.infer<typeof RabbitBackingServiceSchema>;\n\n/**\n * S3-compatible backing service (MinIO, Scaleway Object Storage, AWS).\n *\n * `endpoint` is a URL (`http://localhost:9000`, `https://s3.eu-west.amazonaws.com`)\n * — the resolver parses it into host/port. `bucket` is the S3 bucket\n * name. NOT a database — S3 has no DB concept.\n */\nexport const S3BackingServiceSchema = BackingServiceBaseSchema.extend({\n endpoint: z.string().min(1).optional(),\n bucket: z.string().min(1).optional(),\n}).strict();\nexport type S3BackingService = z.infer<typeof S3BackingServiceSchema>;\n\n/** Gotenberg PDF service. Stateless, no database/vhost/bucket. */\nexport const GotenbergBackingServiceSchema = BackingServiceBaseSchema;\nexport type GotenbergBackingService = z.infer<typeof GotenbergBackingServiceSchema>;\n\n/** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */\nexport const ClamAvBackingServiceSchema = BackingServiceBaseSchema;\nexport type ClamAvBackingService = z.infer<typeof ClamAvBackingServiceSchema>;\n\n/**\n * immudb backing service (tamper-evident audit-log store). A stateful DB —\n * `database` names the immudb database (defaults to `defaultdb` at runtime);\n * credentials come from the secrets pipeline like every other backing service.\n *\n * Declare this in EVERY environment where the `COMPLIANCE_AUDIT_TRAIL` engine\n * capability is enabled. `wildo config sync` warns per environment when the audit\n * capability is on but no environment declares an audit store, and the audit client\n * then has nowhere tamper-evident to write.\n *\n * You do NOT author the state-signing keypair that makes the store's\n * whole-server-substitution defense work. The framework provisions it (private half\n * mounted into a `source: SELF` immudb via `--signingKey`, public half pinned by the\n * audit client as `IMMUDB_STATE_PUBLIC_KEY`) — declaring the service is the whole job.\n *\n * @example\n * ```ts\n * backingServices: {\n * immudb: { source: BackingServiceSource.SELF },\n * }\n * ```\n */\nexport const ImmudbBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type ImmudbBackingService = z.infer<typeof ImmudbBackingServiceSchema>;\n\n/**\n * Metrics / telemetry sink (Prometheus / DataDog / OpenTelemetry / …).\n * Stateless base for now.\n */\nexport const MetricsBackingServiceSchema = BackingServiceBaseSchema;\nexport type MetricsBackingService = z.infer<typeof MetricsBackingServiceSchema>;\n\n/**\n * Backup orchestration target. Stateless base for now.\n */\nexport const BackupBackingServiceSchema = BackingServiceBaseSchema;\nexport type BackupBackingService = z.infer<typeof BackupBackingServiceSchema>;\n\n/**\n * Discriminated UNION over all backing-service kinds. Used by the\n * `ServiceAddressResolver` and helpers that accept any kind and read\n * only base fields (`source`, `host`, `port`). Consumers that need\n * kind-specific fields MUST narrow first (e.g. via the per-kind type\n * exports above).\n */\nexport type BackingServiceEnvConfig =\n | MongoBackingService\n | RedisBackingService\n | PostgresBackingService\n | RabbitBackingService\n | S3BackingService\n | GotenbergBackingService\n | ClamAvBackingService\n | ImmudbBackingService\n | MetricsBackingService\n | BackupBackingService;\n\n/**\n * Per-environment backing services config (source for each service).\n * Used in environment-specific infra descriptors.\n *\n * Keys stay optional because an app-owned environment only needs to declare the\n * backing services it actually enables. Requiring the full enum-keyed record\n * would force disabled services (for example `postgresql`) into every env file\n * and breaks truthful flattened targeted-app declarations.\n */\nexport const BackingServicesEnvConfigSchema = z.object({\n [BackingServiceKind.MONGODB]: MongoBackingServiceSchema.optional(),\n [BackingServiceKind.REDIS]: RedisBackingServiceSchema.optional(),\n [BackingServiceKind.RABBITMQ]: RabbitBackingServiceSchema.optional(),\n [BackingServiceKind.S3]: S3BackingServiceSchema.optional(),\n [BackingServiceKind.POSTGRESQL]: PostgresBackingServiceSchema.optional(),\n [BackingServiceKind.GOTENBERG]: GotenbergBackingServiceSchema.optional(),\n [BackingServiceKind.CLAMAV]: ClamAvBackingServiceSchema.optional(),\n [BackingServiceKind.IMMUDB]: ImmudbBackingServiceSchema.optional(),\n [BackingServiceKind.METRICS]: MetricsBackingServiceSchema.optional(),\n [BackingServiceKind.BACKUP]: BackupBackingServiceSchema.optional(),\n}).strict();\nexport type BackingServicesEnvConfig = z.infer<typeof BackingServicesEnvConfigSchema>;\n/** @wildo_source:part:end platform.config.backing-services */\n\n// =============================================================================\n// BackingServiceKind ↔ InfraCapability / InfraProvider projections\n// =============================================================================\n//\n// Per `infra-provider-planner.md` R-B (locked 2026-05-06): `BackingServicesEnvConfig`\n// IS the canonical per-env infra-selection authoring surface. The\n// `InfraCapability` / `InfraProvider` enums are the planner's projection\n// vocabulary (used by `InfraProviderModule.supportedCapabilities`,\n// `wildo-saas.lock.json sections.infra` keying, and any tooling that\n// walks \"what infra is selected per env\"). The mappings below are the\n// single source of truth for that projection — no other code may\n// reconstruct them locally.\n\n/**\n * Bijective `BackingServiceKind` → `InfraCapability` mapping. Every\n * extension to `BackingServiceKind` MUST extend this map in the same\n * commit, otherwise the planner cannot project the new kind to its\n * capability slot.\n */\nexport const BackingServiceKindToInfraCapability: Record<BackingServiceKind, InfraCapability> = {\n [BackingServiceKind.MONGODB]: InfraCapability.DOCUMENT_DATABASE,\n [BackingServiceKind.POSTGRESQL]: InfraCapability.RELATIONAL_DATABASE,\n [BackingServiceKind.RABBITMQ]: InfraCapability.QUEUING_SYSTEM,\n [BackingServiceKind.REDIS]: InfraCapability.CACHE_MANAGER,\n [BackingServiceKind.S3]: InfraCapability.OBJECT_STORAGE,\n [BackingServiceKind.GOTENBERG]: InfraCapability.DOCUMENT_RENDERING,\n [BackingServiceKind.CLAMAV]: InfraCapability.ANTIVIRUS_SCANNING,\n [BackingServiceKind.IMMUDB]: InfraCapability.AUDIT_LOG_STORAGE,\n [BackingServiceKind.METRICS]: InfraCapability.METRICS_TELEMETRY,\n [BackingServiceKind.BACKUP]: InfraCapability.BACKUP_MANAGER,\n};\n\n/**\n * Project `(BackingServiceKind, source, provider?)` → `InfraProvider`.\n *\n * The three-axis dispatch (kind × hosting-model × brand) generalizes\n * the source/brand split across all kinds (Slice 4.B.0, 2026-05-07\n * — was source-only with Atlas as a special source value before).\n *\n * **Brand vocabulary** per kind (`provider` field on the authored\n * `BackingService<X>Schema`):\n *\n * | Kind | source | provider | InfraProvider |\n * |---|---|---|---|\n * | `MONGODB` | `SELF` | (any) | `MONGODB_SELF` |\n * | `MONGODB` | `MANAGED` | `'atlas'` | `MONGODB_ATLAS` |\n * | `POSTGRESQL` | `SELF` | (any) | `POSTGRES_SELF` |\n * | `POSTGRESQL` | `MANAGED` | `'aws-rds'` | `POSTGRES_AWS_RDS` |\n * | `POSTGRESQL` | `MANAGED` | `'gcp-cloud-sql'` | `POSTGRES_GCP_CLOUD_SQL` |\n * | `POSTGRESQL` | `MANAGED` | `'azure-database'` | `POSTGRES_AZURE_DATABASE` |\n * | `POSTGRESQL` | `MANAGED` | `'supabase'` | `POSTGRES_SUPABASE` |\n * | `POSTGRESQL` | `MANAGED` | `'neon'` | `POSTGRES_NEON` |\n * | `POSTGRESQL` | `MANAGED` | `'render'` | `POSTGRES_RENDER` |\n * | `POSTGRESQL` | `MANAGED` | (unset) | `POSTGRES_MANAGED` (generic fallback) |\n * | `REDIS` | `SELF` | (any) | `REDIS_SELF` |\n * | `RABBITMQ` | `SELF` | (any) | `RABBITMQ_SELF` |\n * | `S3` | `SELF` | (`'minio'` or unset) | `MINIO_SELF` |\n * | `S3` | `MANAGED` | `'aws'` | `AWS_S3` |\n * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` |\n * | `GOTENBERG` | `SELF` | (any) | `GOTENBERG_SELF` |\n *\n * Returns `undefined` for combinations not in the table — for kinds\n * whose `InfraProvider` catalog has no concrete entry yet (METRICS,\n * BACKUP) and for unrecognized brand strings on managed\n * Mongo / S3 (they don't have a generic `<KIND>_MANAGED` fallback,\n * unlike Postgres). Callers decide whether `undefined` is fail-closed\n * (planner running with unknown infra catalog) or accepted (lockfile\n * pre-declaration).\n */\nexport function resolveInfraProvider(\n kind: BackingServiceKind,\n source: BackingServiceSource,\n provider?: string,\n): InfraProvider | undefined {\n switch (kind) {\n case BackingServiceKind.MONGODB:\n if (source === BackingServiceSource.SELF) return InfraProvider.MONGODB_SELF;\n if (source === BackingServiceSource.MANAGED && provider === 'atlas') return InfraProvider.MONGODB_ATLAS;\n // Other Mongo managed brands (e.g., AWS DocumentDB) — extend\n // the `InfraProvider` enum + this branch in the same slice\n // that adds the first concrete consumer.\n return undefined;\n case BackingServiceKind.POSTGRESQL:\n if (source === BackingServiceSource.SELF) return InfraProvider.POSTGRES_SELF;\n if (source === BackingServiceSource.MANAGED) {\n switch (provider) {\n case 'aws-rds': return InfraProvider.POSTGRES_AWS_RDS;\n case 'gcp-cloud-sql': return InfraProvider.POSTGRES_GCP_CLOUD_SQL;\n case 'azure-database': return InfraProvider.POSTGRES_AZURE_DATABASE;\n case 'supabase': return InfraProvider.POSTGRES_SUPABASE;\n case 'neon': return InfraProvider.POSTGRES_NEON;\n case 'render': return InfraProvider.POSTGRES_RENDER;\n // Generic fallback when the operator has authored\n // `source: MANAGED` without naming a brand (or with an\n // unrecognized brand). Acceptable while the brand catalog\n // is incomplete — the lockfile records `POSTGRES_MANAGED`\n // and the planner can still emit env vars + compose\n // contributions; brand-specific runtime behavior is what\n // the named-brand modules (Slice 4.B+) layer on top.\n default: return InfraProvider.POSTGRES_MANAGED;\n }\n }\n return undefined;\n case BackingServiceKind.REDIS:\n if (source === BackingServiceSource.SELF) return InfraProvider.REDIS_SELF;\n // Managed Redis brands (ElastiCache, Upstash, Redis Cloud, …)\n // — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.RABBITMQ:\n if (source === BackingServiceSource.SELF) return InfraProvider.RABBITMQ_SELF;\n // Managed RabbitMQ brands (CloudAMQP, AWS MQ, …) —\n // not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.S3:\n // S3 dispatch is brand-first because the protocol is\n // standardized (S3-compatible) and the same `source` can host\n // multiple software stacks — `source: SELF` could be MinIO or\n // a self-managed AWS S3 cluster (theoretically). The brand is\n // the canonical disambiguator.\n if (provider === 'minio') return InfraProvider.MINIO_SELF;\n if (provider === 'aws') return InfraProvider.AWS_S3;\n // Default source-based mapping for unbranded S3 — MinIO is\n // the canonical self-hosted; AWS is the canonical managed.\n if (source === BackingServiceSource.SELF) return InfraProvider.MINIO_SELF;\n if (source === BackingServiceSource.MANAGED) return InfraProvider.AWS_S3;\n return undefined;\n case BackingServiceKind.CLAMAV:\n if (source === BackingServiceSource.SELF) return InfraProvider.CLAMAV_SELF;\n return undefined;\n case BackingServiceKind.GOTENBERG:\n if (source === BackingServiceSource.SELF) return InfraProvider.GOTENBERG_SELF;\n return undefined;\n case BackingServiceKind.IMMUDB:\n if (source === BackingServiceSource.SELF) return InfraProvider.IMMUDB_SELF;\n // Managed immudb (immudb Vault) — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.METRICS:\n case BackingServiceKind.BACKUP:\n // No concrete `InfraProvider` declared yet for these kinds.\n // Extend `InfraProvider` enum + this branch in the same slice\n // that introduces the first concrete provider for each kind.\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"backing-services.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/backing-services.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,qCAAe,CAAA;IACf,2CAAqB,CAAA;IACrB,+BAAS,CAAA;IACT,+CAAyB,CAAA;IACzB,uCAAiB,CAAA;IACjB;;;;OAIG;IACH,uCAAiB,CAAA;IACjB;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAjBW,kBAAkB,KAAlB,kBA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F;YACpF,EAAE;YACF,2FAA2F;YAC3F,0EAA0E;YAC1E,wFAAwF;YACxF,uEAAuE;YACvE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n InfraCapability,\n InfraProvider,\n} from './infra-providers.schemas';\n\n/**\n * The backing-service authoring surface of `wildo.infra.<env>.config.ts`.\n *\n * Import from `@wildo-ai/platform-config-lib`. Everything below is what an\n * environment file may declare under `backingServices: { ... }` — the closed kind\n * vocabulary, the hosting-model axis, and the per-kind entry shape. The\n * `InfraCapability` / `InfraProvider` projections further down this file are\n * planner-internal and deliberately outside the anchor: an app author never writes\n * them.\n *\n * Declare a kind ONLY when the environment actually runs it — keys are optional so a\n * flattened app declaration stays truthful about what it enables. Omitting a kind an\n * enabled engine capability depends on is the classic silent-degradation bug: e.g.\n * `COMPLIANCE_AUDIT_TRAIL` without `immudb` leaves the tamper-evident audit store\n * unbacked, which `wildo config sync` reports as a warning per environment.\n *\n * @wildo_source:part:start platform.config.backing-services facet:layer:platform facet:family:infra\n */\nexport enum BackingServiceKind {\n MONGODB = 'mongodb',\n REDIS = 'redis',\n RABBITMQ = 'rabbitmq',\n S3 = 's3',\n POSTGRESQL = 'postgresql',\n CLAMAV = 'clamav',\n /**\n * immudb — an immutable, cryptographically-verifiable database used as a\n * tamper-evident audit-log store (fills the `AUDIT_LOG_STORAGE` capability).\n * A stateful DB: a data volume in dev, self-hosted or immudb Vault in prod.\n */\n IMMUDB = 'immudb',\n /**\n * Backup orchestration target. Stateless base for now.\n */\n BACKUP = 'backup',\n}\n\n/**\n * Hosting model of a backing service instance — the orthogonal axis to\n * the **brand** (which is captured by the per-kind `provider` field).\n *\n * - `self`: self-hosted (Docker/K8s container managed by the platform,\n * or operator-managed on-prem). Brands here are open-source\n * software names (e.g. MinIO for S3, vanilla Postgres / MongoDB).\n * - `managed`: external vendor-managed service. Brands here are\n * vendor names (e.g. `'atlas'` for MongoDB Atlas, `'aws-rds'` for\n * AWS RDS, `'supabase'` for Supabase Postgres, `'aws'` for AWS S3).\n *\n * **Slice 4.B.0 reshape (2026-05-07)**: the `ATLAS` value was removed.\n * Pre-reshape `source: ATLAS` becomes `source: MANAGED, provider:\n * 'atlas'`. The reshape generalizes from \"Mongo + S3 are the only\n * brand-aware kinds\" to \"every kind can be brand-aware when the\n * managed market has multiple vendors\" — Postgres in particular\n * (RDS / GCP Cloud SQL / Supabase / Neon / Render / Azure).\n */\nexport enum BackingServiceSource {\n SELF = 'self',\n MANAGED = 'managed',\n}\n\n/**\n * Common fields every backing-service entry shares.\n *\n * Per-kind extensions add the fields that are SEMANTICALLY meaningful\n * for that kind only. Slice 3 closeout (M-4 + L-5): the previous shared\n * `BackingServiceEnvConfigSchema` collapsed `database` into a\n * `union(int, string)` and put `name` only on Mongo; both compromised\n * the framework-mindset rule that \"every field must carry its semantic\n * weight\". The split below means a typo like `redis: { database:\n * 'staging' }` (string on a kind that needs an integer DB index) is\n * rejected at parse time instead of crashing the runtime client at\n * connect time.\n */\nconst BackingServiceBaseSchema = z.object({\n source: z.enum(BackingServiceSource),\n /**\n * Brand of the backing service. Orthogonal to `source` (hosting\n * model). Required-in-spirit when `source === MANAGED` and the\n * managed market has multiple vendors (Mongo: `'atlas'` /\n * `'aws-documentdb'` / …; Postgres: `'aws-rds'` / `'gcp-cloud-sql'`\n * / `'supabase'` / `'neon'` / `'render'` / `'azure-database'`;\n * S3: `'aws'` / `'cloudflare-r2'` / …); optional when `source ===\n * SELF` (e.g. S3-self-hosted defaults to MinIO; `provider:\n * 'minio'` is allowed but redundant).\n *\n * Modeled as `z.string().optional()` rather than per-kind enum\n * unions to keep this base schema simple — the canonical brand\n * vocabulary lives in `resolveInfraProvider`'s dispatch table\n * (each kind documents which brand strings it recognizes; unknown\n * brands fall back to the kind's generic `<KIND>_MANAGED` /\n * `<KIND>_SELF` entry where one exists, otherwise return\n * `undefined`).\n *\n * Slice 4.B.0 (2026-05-07) generalized this from \"S3-only\" to\n * every brand-aware kind.\n */\n provider: z.string().min(1).optional(),\n /**\n * Override the catalog-derived hostname for this kind. Honored at\n * `HOST_FACING` perspective (always) and at `CONTAINER_INTERNAL` for\n * `MANAGED` sources. SELF + `CONTAINER_INTERNAL` keeps the catalog\n * container name because that is the only DNS the container network\n * can resolve.\n */\n host: z.string().min(1).optional(),\n /**\n * Override the catalog-derived listen port. Threaded into both\n * docker-compose `<authored>:<authored>` publish and the per-app\n * env-vars (`<KIND>_PORT`).\n */\n port: z.number().int().positive().optional(),\n}).strict();\n\n/**\n * MongoDB backing service. `database` is the database NAME (string).\n *\n * Mongo's connection URL has the shape `mongodb://host:port/<database>`\n * — this string corresponds to the path segment. Pre-3 the field was\n * `name`; renamed to `database` in Slice 3 closeout (L-5) so all\n * data-store kinds use the same property name for the same concept\n * (vs. Postgres which already used `database`).\n */\nexport const MongoBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type MongoBackingService = z.infer<typeof MongoBackingServiceSchema>;\n\n/**\n * Redis backing service. `database` is the LOGICAL DB INDEX (integer).\n *\n * Redis exposes 16 logical databases (0–15) on a single connection.\n * Authoring a string here (e.g. `'staging'`) would silently parse on\n * the pre-3 union schema and crash ioredis at connect; the integer\n * constraint with `max(15)` fails loud at parse time.\n */\nexport const RedisBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.number().int().min(0).max(15).optional(),\n}).strict();\nexport type RedisBackingService = z.infer<typeof RedisBackingServiceSchema>;\n\n/**\n * PostgreSQL backing service. `database` is the database NAME (string).\n *\n * Symmetric with `MongoBackingService.database` — both are the\n * database identifier in their respective connection URLs.\n */\nexport const PostgresBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type PostgresBackingService = z.infer<typeof PostgresBackingServiceSchema>;\n\n/**\n * RabbitMQ backing service. `vhost` is the RabbitMQ virtual host.\n *\n * AMQP virtual hosts isolate exchange/queue namespaces inside a single\n * broker. NOT a database — RabbitMQ has no DB concept — so the field\n * is intentionally NOT named `database`.\n */\nexport const RabbitBackingServiceSchema = BackingServiceBaseSchema.extend({\n vhost: z.string().min(1).optional(),\n}).strict();\nexport type RabbitBackingService = z.infer<typeof RabbitBackingServiceSchema>;\n\n/**\n * S3-compatible backing service (MinIO, Scaleway Object Storage, AWS).\n *\n * `endpoint` is a URL (`http://localhost:9000`, `https://s3.eu-west.amazonaws.com`)\n * — the resolver parses it into host/port. `bucket` is the S3 bucket\n * name. NOT a database — S3 has no DB concept.\n */\nexport const S3BackingServiceSchema = BackingServiceBaseSchema.extend({\n endpoint: z.string().min(1).optional(),\n bucket: z.string().min(1).optional(),\n}).strict();\nexport type S3BackingService = z.infer<typeof S3BackingServiceSchema>;\n\n/** ClamAV anti-virus daemon. Stateless, no database/vhost/bucket. */\nexport const ClamAvBackingServiceSchema = BackingServiceBaseSchema;\nexport type ClamAvBackingService = z.infer<typeof ClamAvBackingServiceSchema>;\n\n/**\n * immudb backing service (tamper-evident audit-log store). A stateful DB —\n * `database` names the immudb database (defaults to `defaultdb` at runtime);\n * credentials come from the secrets pipeline like every other backing service.\n *\n * Declare this in EVERY environment where the `COMPLIANCE_AUDIT_TRAIL` engine\n * capability is enabled. `wildo config sync` warns per environment when the audit\n * capability is on but no environment declares an audit store, and the audit client\n * then has nowhere tamper-evident to write.\n *\n * You do NOT author the state-signing keypair that makes the store's\n * whole-server-substitution defense work. The framework provisions it (private half\n * mounted into a `source: SELF` immudb via `--signingKey`, public half pinned by the\n * audit client as `IMMUDB_STATE_PUBLIC_KEY`) — declaring the service is the whole job.\n *\n * @example\n * ```ts\n * backingServices: {\n * immudb: { source: BackingServiceSource.SELF },\n * }\n * ```\n */\nexport const ImmudbBackingServiceSchema = BackingServiceBaseSchema.extend({\n database: z.string().min(1).optional(),\n}).strict();\nexport type ImmudbBackingService = z.infer<typeof ImmudbBackingServiceSchema>;\n\n/**\n * Backup orchestration target. Stateless base for now.\n */\nexport const BackupBackingServiceSchema = BackingServiceBaseSchema;\nexport type BackupBackingService = z.infer<typeof BackupBackingServiceSchema>;\n\n/**\n * Discriminated UNION over all backing-service kinds. Used by the\n * `ServiceAddressResolver` and helpers that accept any kind and read\n * only base fields (`source`, `host`, `port`). Consumers that need\n * kind-specific fields MUST narrow first (e.g. via the per-kind type\n * exports above).\n */\nexport type BackingServiceEnvConfig =\n | MongoBackingService\n | RedisBackingService\n | PostgresBackingService\n | RabbitBackingService\n | S3BackingService\n | ClamAvBackingService\n | ImmudbBackingService\n | BackupBackingService;\n\n/**\n * Per-environment backing services config (source for each service).\n * Used in environment-specific infra descriptors.\n *\n * Keys stay optional because an app-owned environment only needs to declare the\n * backing services it actually enables. Requiring the full enum-keyed record\n * would force disabled services (for example `postgresql`) into every env file\n * and breaks truthful flattened targeted-app declarations.\n */\nexport const BackingServicesEnvConfigSchema = z.object({\n [BackingServiceKind.MONGODB]: MongoBackingServiceSchema.optional(),\n [BackingServiceKind.REDIS]: RedisBackingServiceSchema.optional(),\n [BackingServiceKind.RABBITMQ]: RabbitBackingServiceSchema.optional(),\n [BackingServiceKind.S3]: S3BackingServiceSchema.optional(),\n [BackingServiceKind.POSTGRESQL]: PostgresBackingServiceSchema.optional(),\n [BackingServiceKind.CLAMAV]: ClamAvBackingServiceSchema.optional(),\n [BackingServiceKind.IMMUDB]: ImmudbBackingServiceSchema.optional(),\n [BackingServiceKind.BACKUP]: BackupBackingServiceSchema.optional(),\n}).strict();\nexport type BackingServicesEnvConfig = z.infer<typeof BackingServicesEnvConfigSchema>;\n/** @wildo_source:part:end platform.config.backing-services */\n\n// =============================================================================\n// BackingServiceKind ↔ InfraCapability / InfraProvider projections\n// =============================================================================\n//\n// Per `infra-provider-planner.md` R-B (locked 2026-05-06): `BackingServicesEnvConfig`\n// IS the canonical per-env infra-selection authoring surface. The\n// `InfraCapability` / `InfraProvider` enums are the planner's projection\n// vocabulary (used by `InfraProviderModule.supportedCapabilities`,\n// `wildo-saas.lock.json sections.infra` keying, and any tooling that\n// walks \"what infra is selected per env\"). The mappings below are the\n// single source of truth for that projection — no other code may\n// reconstruct them locally.\n\n/**\n * `BackingServiceKind` → `InfraCapability`. Every extension to `BackingServiceKind` MUST extend this\n * map in the same commit, otherwise the planner cannot project the new kind to its capability slot.\n *\n * INJECTIVE, not bijective — and the difference is a real property of the model rather than a gap.\n * A capability may be granted to a runtime without any environment declaring a backing service for\n * it; see {@link RUNTIME_GRANTED_INFRA_CAPABILITIES} for the ones that are, and why.\n */\nexport const BackingServiceKindToInfraCapability: Record<BackingServiceKind, InfraCapability> = {\n [BackingServiceKind.MONGODB]: InfraCapability.DOCUMENT_DATABASE,\n [BackingServiceKind.POSTGRESQL]: InfraCapability.RELATIONAL_DATABASE,\n [BackingServiceKind.RABBITMQ]: InfraCapability.QUEUING_SYSTEM,\n [BackingServiceKind.REDIS]: InfraCapability.CACHE_MANAGER,\n [BackingServiceKind.S3]: InfraCapability.OBJECT_STORAGE,\n [BackingServiceKind.CLAMAV]: InfraCapability.ANTIVIRUS_SCANNING,\n [BackingServiceKind.IMMUDB]: InfraCapability.AUDIT_LOG_STORAGE,\n [BackingServiceKind.BACKUP]: InfraCapability.BACKUP_MANAGER,\n};\n\n/**\n * Project `(BackingServiceKind, source, provider?)` → `InfraProvider`.\n *\n * The three-axis dispatch (kind × hosting-model × brand) generalizes\n * the source/brand split across all kinds (Slice 4.B.0, 2026-05-07\n * — was source-only with Atlas as a special source value before).\n *\n * **Brand vocabulary** per kind (`provider` field on the authored\n * `BackingService<X>Schema`):\n *\n * | Kind | source | provider | InfraProvider |\n * |---|---|---|---|\n * | `MONGODB` | `SELF` | (any) | `MONGODB_SELF` |\n * | `MONGODB` | `MANAGED` | `'atlas'` | `MONGODB_ATLAS` |\n * | `POSTGRESQL` | `SELF` | (any) | `POSTGRES_SELF` |\n * | `POSTGRESQL` | `MANAGED` | `'aws-rds'` | `POSTGRES_AWS_RDS` |\n * | `POSTGRESQL` | `MANAGED` | `'gcp-cloud-sql'` | `POSTGRES_GCP_CLOUD_SQL` |\n * | `POSTGRESQL` | `MANAGED` | `'azure-database'` | `POSTGRES_AZURE_DATABASE` |\n * | `POSTGRESQL` | `MANAGED` | `'supabase'` | `POSTGRES_SUPABASE` |\n * | `POSTGRESQL` | `MANAGED` | `'neon'` | `POSTGRES_NEON` |\n * | `POSTGRESQL` | `MANAGED` | `'render'` | `POSTGRES_RENDER` |\n * | `POSTGRESQL` | `MANAGED` | (unset) | `POSTGRES_MANAGED` (generic fallback) |\n * | `REDIS` | `SELF` | (any) | `REDIS_SELF` |\n * | `RABBITMQ` | `SELF` | (any) | `RABBITMQ_SELF` |\n * | `S3` | `SELF` | (`'minio'` or unset) | `MINIO_SELF` |\n * | `S3` | `MANAGED` | `'aws'` | `AWS_S3` |\n * | `CLAMAV` | `SELF` | (any) | `CLAMAV_SELF` |\n *\n * Returns `undefined` for combinations not in the table — for kinds\n * whose `InfraProvider` catalog has no concrete entry yet (METRICS,\n * BACKUP) and for unrecognized brand strings on managed\n * Mongo / S3 (they don't have a generic `<KIND>_MANAGED` fallback,\n * unlike Postgres). Callers decide whether `undefined` is fail-closed\n * (planner running with unknown infra catalog) or accepted (lockfile\n * pre-declaration).\n */\nexport function resolveInfraProvider(\n kind: BackingServiceKind,\n source: BackingServiceSource,\n provider?: string,\n): InfraProvider | undefined {\n switch (kind) {\n case BackingServiceKind.MONGODB:\n if (source === BackingServiceSource.SELF) return InfraProvider.MONGODB_SELF;\n if (source === BackingServiceSource.MANAGED && provider === 'atlas') return InfraProvider.MONGODB_ATLAS;\n // Other Mongo managed brands (e.g., AWS DocumentDB) — extend\n // the `InfraProvider` enum + this branch in the same slice\n // that adds the first concrete consumer.\n return undefined;\n case BackingServiceKind.POSTGRESQL:\n if (source === BackingServiceSource.SELF) return InfraProvider.POSTGRES_SELF;\n if (source === BackingServiceSource.MANAGED) {\n switch (provider) {\n case 'aws-rds': return InfraProvider.POSTGRES_AWS_RDS;\n case 'gcp-cloud-sql': return InfraProvider.POSTGRES_GCP_CLOUD_SQL;\n case 'azure-database': return InfraProvider.POSTGRES_AZURE_DATABASE;\n case 'supabase': return InfraProvider.POSTGRES_SUPABASE;\n case 'neon': return InfraProvider.POSTGRES_NEON;\n case 'render': return InfraProvider.POSTGRES_RENDER;\n // Generic fallback when the operator has authored\n // `source: MANAGED` without naming a brand (or with an\n // unrecognized brand). Acceptable while the brand catalog\n // is incomplete — the lockfile records `POSTGRES_MANAGED`\n // and the planner can still emit env vars + compose\n // contributions; brand-specific runtime behavior is what\n // the named-brand modules (Slice 4.B+) layer on top.\n default: return InfraProvider.POSTGRES_MANAGED;\n }\n }\n return undefined;\n case BackingServiceKind.REDIS:\n if (source === BackingServiceSource.SELF) return InfraProvider.REDIS_SELF;\n // Managed Redis brands (ElastiCache, Upstash, Redis Cloud, …)\n // — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.RABBITMQ:\n if (source === BackingServiceSource.SELF) return InfraProvider.RABBITMQ_SELF;\n // Managed RabbitMQ brands (CloudAMQP, AWS MQ, …) —\n // not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.S3:\n // S3 dispatch is brand-first because the protocol is\n // standardized (S3-compatible) and the same `source` can host\n // multiple software stacks — `source: SELF` could be MinIO or\n // a self-managed AWS S3 cluster (theoretically). The brand is\n // the canonical disambiguator.\n if (provider === 'minio') return InfraProvider.MINIO_SELF;\n if (provider === 'aws') return InfraProvider.AWS_S3;\n // Default source-based mapping for unbranded S3 — MinIO is\n // the canonical self-hosted; AWS is the canonical managed.\n if (source === BackingServiceSource.SELF) return InfraProvider.MINIO_SELF;\n if (source === BackingServiceSource.MANAGED) return InfraProvider.AWS_S3;\n return undefined;\n case BackingServiceKind.CLAMAV:\n if (source === BackingServiceSource.SELF) return InfraProvider.CLAMAV_SELF;\n return undefined;\n case BackingServiceKind.IMMUDB:\n if (source === BackingServiceSource.SELF) return InfraProvider.IMMUDB_SELF;\n // Managed immudb (immudb Vault) — not catalogued yet; future expansion.\n return undefined;\n case BackingServiceKind.BACKUP:\n // No concrete `InfraProvider` declared yet for this kind. Extend the `InfraProvider` enum +\n // this branch in the same slice that introduces the first concrete provider for it.\n //\n // `METRICS` was the other kind here and was WITHDRAWN 2026-09-09: telemetry is authored at\n // `observability.telemetry` and its auth header derived from the selected\n // `OBSERVABILITY_TELEMETRY` provider, so a backing-service kind was a third declaration\n // surface that nothing read. See `RUNTIME_GRANTED_INFRA_CAPABILITIES`.\n return undefined;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
1
+ import { AppFrontendType, type ProviderFrontendCspFootprint } from '@wildo-ai/saas-models/public-runtime';
2
2
  import { type CspDirectiveName, type EnvCspOverride, type WildoCspConfig } from './csp.schemas';
3
3
  export type ResolvedCspDirectiveMap = Readonly<Partial<Record<CspDirectiveName, readonly string[]>>>;
4
4
  export interface ResolvedCspPolicy {
@@ -22,6 +22,28 @@ export interface ResolveCspPolicyInput {
22
22
  readonly frontendType: AppFrontendType;
23
23
  readonly appCsp: WildoCspConfig | undefined;
24
24
  readonly envOverride?: EnvCspOverride;
25
+ /**
26
+ * The CSP footprints of the providers DECLARED for this service — the fourth
27
+ * layer, added by #332.
28
+ *
29
+ * Without it, a marketing site that wants an embedded meeting or a SaaS app
30
+ * that wants a Drive picker means hand-editing script / frame / connect
31
+ * origins per application, per service, per environment; and getting it wrong
32
+ * is invisible until production, because development is report-only. The
33
+ * caller reads these from the service's materialized provider block, which is
34
+ * DATA precisely so that no frontend module has to be executed to obtain them.
35
+ *
36
+ * Providers declared for ANOTHER service must not appear here: the point of
37
+ * the layer is that a Zoom origin admitted for the marketing site is not
38
+ * thereby admitted for the SaaS app.
39
+ *
40
+ * A footprint's `derivedOrigins` must ALREADY BE RESOLVED into its buckets by
41
+ * the caller. This resolver sees no `publicConfig` — it composes a policy, it
42
+ * does not read a provider's configuration — and the one caller that has both
43
+ * halves is `CspSyncService`, which reads each entry out of the materialized
44
+ * block.
45
+ */
46
+ readonly providerCspFootprints?: ReadonlyArray<ProviderFrontendCspFootprint>;
25
47
  /**
26
48
  * Environment id this CSP is being resolved for (e.g. `'local'`,
27
49
  * `'staging'`, `'production'`, or any custom slug). Optional for
@@ -37,10 +59,19 @@ export interface ResolveCspPolicyInput {
37
59
  export declare const NGINX_CSP_BEGIN_MARKER = "# >>> wildo csp begin";
38
60
  export declare const NGINX_CSP_END_MARKER = "# <<< wildo csp end";
39
61
  /**
40
- * Resolves the generic three-layer CSP model shared by all frontend
41
- * surfaces: platform baseline, app-static config, then env-selected
42
- * overrides. This lives with the CSP schemas/defaults so consumers do
43
- * not depend on any concrete frontend package to process security config.
62
+ * Resolves the generic layered CSP model shared by all frontend surfaces:
63
+ * platform baseline, app-static config, env-selected overrides, then the
64
+ * declared providers' own footprints (#332).
65
+ *
66
+ * The provider layer is fourth on purpose. The first three describe what the
67
+ * APPLICATION decided; the fourth describes what the things the application
68
+ * declared actually need in order to work. Placing it last means a provider
69
+ * cannot be silently dropped by an app-level `REPLACE_BASELINE`, and placing it
70
+ * before the WebSocket derivation means a provider's `connect-src` origin gets
71
+ * its `wss://` companion exactly like the backend API's.
72
+ *
73
+ * This lives with the CSP schemas/defaults so consumers do not depend on any
74
+ * concrete frontend package to process security config.
44
75
  */
45
76
  export declare function resolveCspPolicy(input: ResolveCspPolicyInput): ResolvedCspPolicy | null;
46
77
  export declare function emitCspArtifacts(policy: ResolvedCspPolicy): CspEmitArtifacts;
@@ -1 +1 @@
1
- {"version":3,"file":"csp-emit.d.ts","sourceRoot":"","sources":["../../../../../src/project-config/shared/csp-emit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAMvE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,SA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;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAGzE;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,yBAAyB;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClD,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,iBAAiB,GAAG,yBAAyB,CAQlG;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,kBAAkB,CAkBpB;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,QAAQ,SAAgB,GACvB;IACD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CA4DA"}
@@ -1,8 +1,36 @@
1
1
  import { readFileSync, writeFileSync } from 'node:fs';
2
- import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
2
+ import { AppFrontendType, ProviderFrontendCspOriginBucket, } from '@wildo-ai/saas-models/public-runtime';
3
3
  import { CSP_BASELINES, } from './csp-defaults.js';
4
4
  import { CspMergeStrategy, } from './csp.schemas.js';
5
5
  import { WildoEnvironment } from './environment.schemas.js';
6
+ /**
7
+ * Where each of a provider's declared origin buckets lands in the policy.
8
+ *
9
+ * THE ONE PLACE the mapping exists. A provider declares what it is REACHING
10
+ * — a script it loads, an API it calls, an iframe it embeds — and which
11
+ * directive grades that fetch is framework knowledge, so a provider author
12
+ * never has to learn the CSP directive taxonomy and a change to it is a change
13
+ * here rather than in every provider package.
14
+ *
15
+ * The bucket names are also why `ProviderFrontendCspFootprint` does not restate
16
+ * `CSP_DIRECTIVE_NAMES`: that vocabulary already has one named source, in this
17
+ * package, and `@wildo-ai/saas-models` — where the footprint has to live,
18
+ * because it rides on the wire — depends on nothing of ours.
19
+ *
20
+ * Total over the footprint's buckets: adding a bucket without deciding its
21
+ * directive is a compile error here, which is the coupling this shape exists
22
+ * for. A bucket with no mapping would be authored, serialized, read, and
23
+ * silently contribute nothing — in production only, since CSP is report-only
24
+ * in development.
25
+ */
26
+ const PROVIDER_CSP_BUCKET_DIRECTIVES = {
27
+ [ProviderFrontendCspOriginBucket.SCRIPT]: 'script-src',
28
+ [ProviderFrontendCspOriginBucket.CONNECT]: 'connect-src',
29
+ [ProviderFrontendCspOriginBucket.FRAME]: 'frame-src',
30
+ [ProviderFrontendCspOriginBucket.IMG]: 'img-src',
31
+ [ProviderFrontendCspOriginBucket.STYLE]: 'style-src',
32
+ [ProviderFrontendCspOriginBucket.FONT]: 'font-src',
33
+ };
6
34
  export const NGINX_CSP_BEGIN_MARKER = '# >>> wildo csp begin';
7
35
  export const NGINX_CSP_END_MARKER = '# <<< wildo csp end';
8
36
  const META_INVALID_DIRECTIVES = new Set([
@@ -80,10 +108,19 @@ function mergeSourceLists(a, b) {
80
108
  return out;
81
109
  }
82
110
  /**
83
- * Resolves the generic three-layer CSP model shared by all frontend
84
- * surfaces: platform baseline, app-static config, then env-selected
85
- * overrides. This lives with the CSP schemas/defaults so consumers do
86
- * not depend on any concrete frontend package to process security config.
111
+ * Resolves the generic layered CSP model shared by all frontend surfaces:
112
+ * platform baseline, app-static config, env-selected overrides, then the
113
+ * declared providers' own footprints (#332).
114
+ *
115
+ * The provider layer is fourth on purpose. The first three describe what the
116
+ * APPLICATION decided; the fourth describes what the things the application
117
+ * declared actually need in order to work. Placing it last means a provider
118
+ * cannot be silently dropped by an app-level `REPLACE_BASELINE`, and placing it
119
+ * before the WebSocket derivation means a provider's `connect-src` origin gets
120
+ * its `wss://` companion exactly like the backend API's.
121
+ *
122
+ * This lives with the CSP schemas/defaults so consumers do not depend on any
123
+ * concrete frontend package to process security config.
87
124
  */
88
125
  export function resolveCspPolicy(input) {
89
126
  const { frontendType, appCsp, envOverride } = input;
@@ -115,6 +152,29 @@ export function resolveCspPolicy(input) {
115
152
  }
116
153
  merged = out;
117
154
  }
155
+ // Provider layer (#332) — the origins the providers DECLARED FOR THIS SERVICE
156
+ // need, merged after the app-static and env layers and before the WebSocket
157
+ // derivation below (so a provider's `connect-src` origin gets its `wss://`
158
+ // companion for free, exactly like the backend API's).
159
+ //
160
+ // Additive in every merge strategy, including REPLACE_BASELINE. That strategy
161
+ // exists so an app can discard the platform BASELINE when it is wrong for the
162
+ // surface; a provider the same app declared is a dependency it chose, not a
163
+ // default it is overriding, and silently dropping its origins would produce a
164
+ // policy that blocks a feature the app asked for — in production only.
165
+ const providerFootprints = input.providerCspFootprints ?? [];
166
+ if (providerFootprints.length > 0) {
167
+ const out = { ...merged };
168
+ for (const footprint of providerFootprints) {
169
+ for (const [bucket, directive] of Object.entries(PROVIDER_CSP_BUCKET_DIRECTIVES)) {
170
+ const origins = footprint[bucket];
171
+ if (origins.length === 0)
172
+ continue;
173
+ out[directive] = mergeSourceLists(out[directive], origins);
174
+ }
175
+ }
176
+ merged = out;
177
+ }
118
178
  // Vite dev-mode loosening (auto-applied for local SAAS_APP).
119
179
  //
120
180
  // Vite's dev server REQUIRES both `'unsafe-eval'` (lazy module +