@wildo-ai/platform-config-lib 1.1.6 → 1.1.7

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 (187) hide show
  1. package/dist/esm/_unimplemented/index.d.ts.map +1 -1
  2. package/dist/esm/_unimplemented/index.js.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -1
  6. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
  7. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  8. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  9. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  10. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  11. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  12. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  13. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  17. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  18. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  19. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  21. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  22. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  23. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  25. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  26. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  27. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  29. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  30. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  31. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  33. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  34. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  35. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  36. package/dist/esm/config-authoring.entry.js.map +1 -1
  37. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  38. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  39. package/dist/esm/index.d.ts.map +1 -1
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  42. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  43. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  44. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  45. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  46. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  47. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  48. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  49. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  50. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  51. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  52. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  53. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  54. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  55. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  56. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  57. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  58. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  59. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  60. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  61. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  62. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  63. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  64. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  65. package/dist/esm/project-config/index.d.ts.map +1 -1
  66. package/dist/esm/project-config/index.js.map +1 -1
  67. package/dist/esm/project-config/loader.d.ts.map +1 -1
  68. package/dist/esm/project-config/loader.js.map +1 -1
  69. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  70. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  71. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  72. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  73. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  74. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  75. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  76. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  77. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  78. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  79. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  80. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  81. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  82. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  83. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  84. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  85. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  86. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  87. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  88. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  89. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  90. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  91. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
  92. package/dist/esm/project-config/shared/cdn.example.js.map +1 -1
  93. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  94. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  95. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  96. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  97. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  98. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  99. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  100. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  101. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  102. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  103. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  104. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  105. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  106. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  107. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  108. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  109. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  110. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  111. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  112. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  113. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  114. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  115. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  116. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  117. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  118. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  119. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  120. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  121. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  122. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  123. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  124. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  125. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
  126. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -1
  127. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  128. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  129. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  130. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  131. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  132. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  133. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  134. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  135. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  136. package/dist/esm/registry/digest.schemas.js.map +1 -1
  137. package/dist/esm/registry/index.d.ts.map +1 -1
  138. package/dist/esm/registry/index.js.map +1 -1
  139. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  140. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  141. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  142. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  143. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  144. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  145. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  146. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  147. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  148. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  149. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  150. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  151. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  152. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  153. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  154. package/dist/esm/registry/registry-errors.js.map +1 -1
  155. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  156. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  157. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  158. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  159. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  160. package/dist/esm/release/framework-release.constants.js.map +1 -1
  161. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  162. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  163. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  164. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  165. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  166. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  167. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  168. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  169. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  170. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  171. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  172. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  173. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  174. package/dist/esm/workspace-scope/index.js.map +1 -1
  175. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  176. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  177. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  178. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  179. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  180. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  181. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  182. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  183. package/dist/tsconfig.build.tsbuildinfo +1 -0
  184. package/package.json +7 -7
  185. package/dist/esm/registry/companion-api.schemas.d.ts +0 -0
  186. package/dist/esm/registry/companion-api.schemas.d.ts.map +0 -0
  187. package/dist/esm/registry/companion-api.schemas.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"provider-runtime-artifacts.js","sourceRoot":"","sources":["../../../../src/project-config/provider-runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAQ,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,4CAA4C,EAC5C,sCAAsC,EACtC,mCAAmC,EACnC,iCAAiC,EACjC,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,GAK7B,MAAM,uBAAuB,CAAC;AA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C,mBAAmB,EAAE,KAAK,CAAC,cAAc;QACzC,YAAY,EAAE,KAAK,CAAC,cAAc;KACnC,CAAC,CAAC,CAAC;SACH,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACtB,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,KAAK,EAAE,qBAAqB,CAAC,YAAY,CAAC,KAAK,CAAC;QAChD,iBAAiB,EAAE,YAAY,CAAC,iBAAiB;QACjD,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,kBAAkB,EAAE,CAAC,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE;QAC/D,oBAAoB,EAAE,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE;QACnE,SAAS,EAAE,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE;QAC7C,oBAAoB,EAAE,YAAY,CAAC,oBAAoB;QACvD,aAAa,EAAE,YAAY,CAAC,aAAa;YACvC,CAAC,CAAC;gBACA,QAAQ,EAAE,YAAY,CAAC,aAAa,CAAC,QAAQ;gBAC7C,oBAAoB,EAAE,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE;gBACjF,SAAS,EAAE,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE;gBAC3D,YAAY,EAAE,YAAY,CAAC,aAAa,CAAC,YAAY;aACtD;YACD,CAAC,CAAC,SAAS;QACb,cAAc,EAAE,YAAY,CAAC,cAAc;KAC5C,CAAC,CAAC,CAAC;AACR,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve as resolvePath } from 'node:path';\nimport { z } from 'zod';\nimport {\n AppFrontendType,\n assertFrontendProvidersServeOnlyDeclaredKeys,\n assertNoSecretValueInFrontendProviders,\n FRONTEND_PROVIDER_PUBLIC_CONFIG_KEY,\n FrontendProviderPublicConfigError,\n FrontendProvidersBlockSchema,\n overlayFrontendProviderPublicConfig,\n resolveProviderConnectionRef,\n type FrontendProviderEntry,\n type FrontendPublicConfigSecretValue,\n type ProviderSharedConnections,\n type FrontendProvidersBlock,\n} from '@wildo-ai/saas-models';\nimport {\n SaasLockfileProvidersSectionSchema,\n type SaasLockfileProvidersSection,\n type SaasLockfileRuntimeScopesProviders,\n} from '../lockfile/wildo-saas-lock.shared.schemas';\nimport {\n getDeclaredApplicationModuleIds,\n getServiceBoundApplicationModuleIds,\n} from './shared/application-modules.utils';\nimport type { ApplicationModules } from './shared/application-modules.schemas';\nimport {\n SaasProvidersScopesSchema,\n SaasProviderScopeSelectionSchema,\n type SaasProviderScopeSelection,\n type SaasProvidersScopes,\n type WildoSaasConfig,\n} from './define-saas-config';\nimport {\n ProviderContributionOwnerKind,\n readPackageVersion,\n resolveProviderBasePackage,\n selectOptedInProviderAugmentations,\n type AdmittedProviderPackage,\n type DiscoveredProviderAugmentation,\n type DiscoveredProviderCompanionContribution,\n describeProviderRefClaimedByMoreThanOneImportPath,\n readSystemOfRecordFacetModuleSpecifier,\n} from './provider-companion-discovery';\n\nexport const PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING =\n 'AUTO-GENERATED FILE. DO NOT EDIT. Regenerate with `wildo config sync`.';\n\nexport const PROVIDER_RUNTIME_ARTIFACT_GENERATOR = 'wildo provider-runtime-artifact';\n\n/**\n * Canonical relative paths (from saas root) for the per-runtime-kind\n * provider artifact JSON files emitted by `wildo config sync`.\n *\n * Moved from `.wildo-saas/providers/` → `.wildo-saas/generated/providers/`\n * on 2026-05-06 to group ALL CLI-generated runtime topology artifacts\n * under the `.wildo-saas/generated/` namespace (sibling to other\n * generated state). The legacy `.wildo-saas/providers/` location is\n * cleaned up by `cleanupLegacyProviderJsonArtifacts` in the CLI sync\n * so operators don't end up with two copies after the migration.\n */\nexport const PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS = {\n backend: '.wildo-saas/generated/providers/backend.runtime-providers.generated.json',\n companion: '.wildo-saas/generated/providers/companion.runtime-providers.generated.json',\n frontendServices: '.wildo-saas/generated/providers/frontend-services.runtime-providers.generated.json',\n minions: '.wildo-saas/generated/providers/minions.runtime-providers.generated.json',\n nodeWorkers: '.wildo-saas/generated/providers/node-workers.runtime-providers.generated.json',\n} as const;\n\n/**\n * Legacy paths (pre-2026-05-06) for the per-runtime-kind provider\n * artifact JSON files. These are NOT written anymore — kept here so\n * `wildo config sync` can clean them up if they exist on disk from a\n * pre-migration sync. Drop this constant entirely once Wonder Todos\n * + downstream apps have all run a post-migration sync at least once.\n */\nexport const LEGACY_PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS = {\n backend: '.wildo-saas/providers/backend.runtime-providers.generated.json',\n companion: '.wildo-saas/providers/companion.runtime-providers.generated.json',\n frontendServices: '.wildo-saas/providers/frontend-services.runtime-providers.generated.json',\n minions: '.wildo-saas/providers/minions.runtime-providers.generated.json',\n nodeWorkers: '.wildo-saas/providers/node-workers.runtime-providers.generated.json',\n} as const;\n\nexport type ProviderRuntimeArtifactKind = keyof typeof PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS;\n\nexport const PROVIDER_RUNTIME_GENERATED_MODULE_RELATIVE_PATH =\n 'src/generated/wildo-provider-runtime.generated.ts';\n\n/**\n * Canonical lockfile section path the provider-materialization\n * subsystem owns end-to-end. Used by the post-mutation provider sync\n * runner + materialization-hook return types and pinned by tests\n * (`provider-sync-runner.test.ts`, `provider-materialization-hook.test.ts`).\n *\n * Defined here as a single-source constant — used to live as a\n * literal in 3+ places across `wildo-module-client` (third-pass\n * review C-L1).\n */\nexport const PROVIDER_LOCK_SECTION_PATH = 'sections.providers.runtimeScopes' as const;\n\n/**\n * Per-worker generated env file written by `wildo config sync`. Carries\n * provider topology env vars derived from the materialized scope.\n *\n * This file is the **single delivery channel** non-Node workers (Rust /\n * Java / etc.) receive for provider topology — there is no executable\n * JS bundle in their case (Step 5b in\n * `.claude/plans/provider-migration-continuation.md`). Node workers\n * receive both this file and the per-package\n * `wildo-provider-runtime.generated.ts` source module; reading either\n * surface yields a consistent view because they share the same digest.\n *\n * The file is auto-generated and overwritten on every sync. Operator-\n * authored secrets and per-env config stay in the worker's `.env` (not\n * touched by `wildo config sync`); workers should load both files at\n * boot — operator vars from `.env` and provider vars from this file —\n * so the two channels never collide.\n */\nexport const PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME = '.wildo-providers.env';\n\nconst RuntimeProviderScopeArtifactSchema = z.strictObject({\n providers: z.record(z.string(), SaasProviderScopeSelectionSchema).default({}),\n selection: z.record(\n z.string(),\n z.strictObject({\n primary: z.string().min(1),\n whenUnavailable: z.array(z.string().min(1)).default([]),\n }),\n ).default({}),\n});\n\nconst RuntimeProviderModulesArtifactSchema = z.strictObject({\n declaredModules: z.record(\n z.string(),\n z.strictObject({\n services: z.array(z.string().min(1)),\n haveSamlIntegration: z.boolean().optional(),\n }),\n ).default({}),\n moduleIds: z.array(z.string().min(1)).default([]),\n moduleIdsByService: z.record(z.string(), z.array(z.string().min(1))).default({}),\n});\nexport type RuntimeProviderModulesArtifact = z.infer<typeof RuntimeProviderModulesArtifactSchema>;\n\n/**\n * The per-service frontend bootstrap map, keyed by frontend service key.\n *\n * ## It was an ANNOTATED interface until 2026-09-12, and the workaround is gone (#356)\n *\n * `FrontendProvidersBlockSchema` transitively references three atoms — `ProviderFrontendCspOriginBucket`,\n * `ProviderFrontendScriptCrossOrigin`, `ProviderFrontendSelectionDelivery` — that `@wildo-ai/saas-models`\n * published from `/public-runtime` ALONE. While this artifact object stayed small TypeScript inlined the\n * shape and nobody noticed; adding one member past the inline threshold made it reach for the NAME and\n * refuse, here and in `saas-backend-lib` at the same time:\n *\n * `TS2742 … cannot be named without a reference to\n * node_modules/@wildo-ai/saas-models/src/external-providers/provider-frontend-surface.shared.schemas`.\n *\n * #330 stopped the expansion with a locally declared interface, deliberately as a workaround: an\n * interface is written BY NAME in the emitted declaration where a type alias expands structurally and\n * takes the unnameable atoms with it. The boundary has since MOVED — the root barrel now exports that\n * module — so the atoms are nameable through the package root and the workaround has nothing left to do.\n *\n * Verified with the probe `package-public-entrypoints.md` prescribes rather than by re-running the\n * source-mapped packages: a consumer importing ONLY `@wildo-ai/saas-models`, deriving a record over\n * `FrontendProvidersBlockSchema`, compiled with `declaration: true`. It names all three atoms through\n * `import(\"@wildo-ai/saas-models\")` and reaches no relative `node_modules` path at all.\n */\nconst FrontendProviderBootstrapsSchema = z.record(z.string().min(1), FrontendProvidersBlockSchema);\n\n/**\n * One opted-in AUGMENTATION of a provider, as the host's loader needs it (#1672).\n *\n * `operationIds` is recorded so the loader can refuse a package whose installed code delivers a different set\n * from the one `wildo config sync` validated — a stale artifact, or a package upgraded without a resync —\n * instead of admitting operations nobody checked for collisions.\n *\n * `basePackageName` / `basePackageVersion` record which base the augmentation was composed against. Nothing\n * refuses on them here; declaring and enforcing a compatible base range is #1731's, and this is its seam.\n */\nexport const RuntimeProviderAugmentationArtifactSchema = z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1),\n runtimeImportPath: z.string().min(1),\n operationIds: z.array(z.string().min(1)).min(1),\n /**\n * Every vendor scope the augmentation's operations declare (#1671) — recorded so the loader can refuse installed code\n * that needs scopes sync never validated, and so a connection asks a person to consent only to what an opted-in\n * package declared. Absent when it declares none.\n */\n requiredScopes: z.array(z.string().min(1)).min(1).optional(),\n basePackageName: z.string().min(1).optional(),\n basePackageVersion: z.string().min(1).optional(),\n});\nexport type RuntimeProviderAugmentationArtifact = z.infer<typeof RuntimeProviderAugmentationArtifactSchema>;\n\nexport const SaasRuntimeProvidersArtifactSchema = z.strictObject({\n __AUTOGENERATED__: z.literal(PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING),\n generatedBy: z.literal(PROVIDER_RUNTIME_ARTIFACT_GENERATOR),\n generatedAt: z.string().datetime({ offset: true }),\n sourceDigest: z.string().min(1),\n providerRefs: z.array(z.string().min(1)).default([]),\n /**\n * `providerRef` -> the package specifier a host dynamic-imports to obtain that provider's backend\n * module (#330).\n *\n * `providerRefs` says WHICH providers a process may expose; this says WHERE each one comes from,\n * and it is what makes a provider shipped as its own npm package loadable at all. Derived from\n * the discovered contribution whose `runtimeTargets` match the host — never authored.\n *\n * Optional, so an artifact written before this field existed still parses. Every ref such an\n * artifact names is engine-shipped, and a host resolves those from the engine's own on-demand map\n * without consulting this record, so an un-resynced application is unaffected.\n */\n providerRuntimeImports: z.record(z.string().min(1), z.string().min(1)).optional(),\n /**\n * Package specifiers that ship SYSTEM-OF-RECORD VENDOR FACETS, in discovery order (#1057).\n *\n * A list rather than a `vendor -> specifier` map, because a facet module contributes a RECORD of\n * vendors rather than one module per vendor: a map would restate the record's own keys in a\n * generated artifact read by a different process, free to disagree with it. The backend imports\n * each specifier in order and takes the first that answers for the vendor.\n *\n * Discovered from the MANIFEST — a package declaring an `./systems-of-record` export — never from\n * loading it. Sync has no business evaluating a vendor facet, and the manifest is the same door\n * `./companion` is found through.\n */\n systemOfRecordFacetModules: z.array(z.string().min(1)).optional(),\n /**\n * `baseRef` -> the opted-in augmentations the host applies to that provider, sorted by package name (#1672).\n *\n * Only refs in this artifact's scope, and only packages the application names under\n * `providers.augmentations` — an installed augmentation that is not opted in never appears here, and the\n * loader applies nothing this map does not name. Absent when nothing is augmented, which keeps every\n * artifact of an application without augmentations byte-identical to what it was.\n */\n providerRuntimeAugmentations: z.record(z.string().min(1), z.array(RuntimeProviderAugmentationArtifactSchema).min(1)).optional(),\n providerGraphDigest: z.string().min(1),\n lockfileSectionDigest: z.string().min(1),\n artifactKind: z.enum([\n 'backend',\n 'companion',\n 'frontendServices',\n 'minions',\n 'nodeWorkers',\n ]),\n modules: RuntimeProviderModulesArtifactSchema,\n scope: RuntimeProviderScopeArtifactSchema.optional(),\n scopes: z.record(z.string(), RuntimeProviderScopeArtifactSchema).optional(),\n frontendProviderBootstraps: FrontendProviderBootstrapsSchema.optional(),\n});\nexport type SaasRuntimeProvidersArtifact = z.infer<typeof SaasRuntimeProvidersArtifactSchema>;\n\nexport interface MaterializedSaasProviderRuntimeArtifacts {\n artifacts: Partial<Record<ProviderRuntimeArtifactKind, SaasRuntimeProvidersArtifact>>;\n lockSection: SaasLockfileProvidersSection;\n}\n\nexport function materializeSaasProviderRuntimeArtifacts(\n // `providerConfigurations` is where an application supplies a frontend provider's public keys\n // (#394 P3). Optional here so the lockfile check and every existing caller that narrows the\n // config keep compiling; absent means \"the application configured nothing\", never a refusal.\n config: Pick<WildoSaasConfig, 'modules' | 'providers' | 'services'> & Partial<Pick<WildoSaasConfig, 'providerConfigurations'>>,\n options?: {\n generatedAt?: string;\n nodeWorkerKeys?: string[];\n discoveredContributions?: DiscoveredProviderCompanionContribution[];\n /**\n * The augmentations discovery found (#1672). Filtered HERE against `config.providers.augmentations` as well\n * as by the validating walk, so an artifact can never be built from an unfiltered list: an installed\n * augmentation that is not opted in contributes nothing whichever caller passed it.\n */\n discoveredAugmentations?: readonly DiscoveredProviderAugmentation[];\n /**\n * The facet modules the discovery WALK found (#1675) — `ValidatedSaasProviderDiscovery.systemOfRecordFacetModules`.\n * Absent, they are derived from the contributions' package roots, which cannot see a package that ships\n * facets or facet augmentations and no provider; every `wildo` caller passes the walk's answer.\n */\n discoveredSystemOfRecordFacetModules?: readonly string[];\n /**\n * The packages `providers.packages` admitted (#1676) — `ValidatedSaasProviderDiscovery.admittedProviderPackages`.\n * Recorded in the lock section (`admittedPackages`) so a lock diff shows third-party code entering discovery;\n * every `wildo` caller passes the walk's answer, or `lock check` and `config sync` would disagree.\n */\n admittedProviderPackages?: readonly AdmittedProviderPackage[];\n },\n): MaterializedSaasProviderRuntimeArtifacts {\n const scopes = SaasProvidersScopesSchema.parse(config.providers.scopes);\n const generatedAt = options?.generatedAt ?? new Date().toISOString();\n const modules = materializeModules(config);\n const frontendServiceTypes: Record<string, AppFrontendType> = Object.fromEntries(\n Object.entries(config.services ?? {})\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey, definition]) => [serviceKey, definition.frontendType as AppFrontendType]),\n );\n // Backend requests carry public service names; build-time consumers use declaration keys.\n // Validate before publication so two scopes can never silently overwrite one another.\n const frontendServiceNames: Record<string, string> = {};\n const publicNames = new Set<string>();\n for (const serviceKey of Object.keys(frontendServiceTypes)) {\n const name = config.services[serviceKey]?.serviceName;\n if (!name?.trim() || publicNames.has(name)) {\n throw new Error(`Frontend service \"${serviceKey}\" needs a unique non-empty public serviceName; received \"${name ?? ''}\".`);\n }\n publicNames.add(name);\n frontendServiceNames[serviceKey] = name;\n }\n const discoveryContext = buildProviderRuntimeDiscoveryContext({\n discoveredContributions: options?.discoveredContributions,\n discoveredAugmentations: selectOptedInProviderAugmentations(config, options?.discoveredAugmentations ?? []),\n frontendServiceTypes,\n sharedConnections: config.providers.sharedConnections,\n ...(options?.discoveredSystemOfRecordFacetModules !== undefined ? { systemOfRecordFacetModules: options.discoveredSystemOfRecordFacetModules } : {}),\n });\n\n const admittedPackages = [...(options?.admittedProviderPackages ?? [])]\n .sort((left, right) => left.packageName.localeCompare(right.packageName));\n const lockSection = SaasLockfileProvidersSectionSchema.parse({\n runtimeScopes: materializeLockRuntimeScopes({\n scopes,\n discoveryContext,\n }),\n // Absent when nothing is listed, so the lock of every application without a listing is byte-identical (#1676).\n ...(admittedPackages.length > 0 ? { admittedPackages } : {}),\n\n });\n const artifactMetadata = buildArtifactMetadata({\n discoveryContext,\n frontendServiceTypes,\n frontendServiceNames,\n lockSection,\n modules,\n nodeWorkerKeys: options?.nodeWorkerKeys,\n scopes,\n providerConfigurations: config.providerConfigurations ?? {},\n });\n\n const artifacts = materializeRuntimeArtifacts({\n artifactMetadata,\n discoveryContext,\n frontendServiceTypes,\n frontendServiceNames,\n generatedAt,\n modules,\n nodeWorkerKeys: options?.nodeWorkerKeys,\n scopes,\n providerConfigurations: config.providerConfigurations ?? {},\n });\n\n return { artifacts, lockSection };\n}\n\nexport function selectScopedProviderRuntimeArtifact(\n artifact: SaasRuntimeProvidersArtifact,\n scopeKey: string,\n): SaasRuntimeProvidersArtifact {\n if (!artifact.scopes) {\n throw new Error(`Provider runtime artifact '${artifact.artifactKind}' does not contain keyed scopes.`);\n }\n\n const scope = artifact.scopes[scopeKey];\n if (!scope) {\n throw new Error(`Provider runtime artifact '${artifact.artifactKind}' does not contain scope '${scopeKey}'.`);\n }\n\n // Recompute `providerRefs` from the projected per-host scope rather\n // than carrying the parent multi-scope union forward unchanged. The\n // multi-scope artifact's `providerRefs` is the union across all\n // hosts (`buildMultiScopeArtifactMetadata`); preserving that union\n // on a single-scope projection makes the per-host artifact internally\n // inconsistent — `scope.providers` would describe one host while\n // `providerRefs` would describe siblings too. The boot-time\n // `assertProviderRuntimeEnvInSync` guard treats `providerRefs.length > 0`\n // as \"this host has providers to reconcile\" — without this\n // recomputation, an empty-scope host would inherit the union and\n // trip the env-missing guard even though its `.wildo-providers.env`\n // was deliberately not written. Recomputation also tightens\n // `BackendProviderRegistry`'s filter (today defended by an empty-list\n // fallback) so the per-host artifact accurately advertises only the\n // refs it should resolve.\n const projectedProviderRefs = Object.keys(scope.providers).sort();\n\n return SaasRuntimeProvidersArtifactSchema.parse({\n ...artifact,\n providerRefs: projectedProviderRefs,\n // Narrowed for the same reason `providerRefs` is recomputed above: the multi-scope artifact's\n // import map is the union across every host, and a per-host projection that advertised a\n // sibling's packages would tell this host it can load something it never declared.\n providerRuntimeImports: Object.fromEntries(\n Object.entries(artifact.providerRuntimeImports ?? {})\n .filter(([providerRef]) => projectedProviderRefs.includes(providerRef)),\n ),\n // Narrowed for the same reason: a host applies augmentations only to the providers IT declares (#1672).\n providerRuntimeAugmentations: narrowRuntimeAugmentations(artifact.providerRuntimeAugmentations, projectedProviderRefs),\n frontendProviderBootstraps: artifact.frontendProviderBootstraps?.[scopeKey]\n ? { [scopeKey]: artifact.frontendProviderBootstraps[scopeKey] }\n : undefined,\n scope,\n scopes: undefined,\n });\n}\n\n/**\n * The augmentation map restricted to the given refs, or `undefined` when none remain — so a per-host projection\n * of an artifact that augments only a sibling's provider carries no field at all.\n */\nexport function narrowRuntimeAugmentations(\n augmentations: SaasRuntimeProvidersArtifact['providerRuntimeAugmentations'],\n providerRefs: readonly string[],\n): SaasRuntimeProvidersArtifact['providerRuntimeAugmentations'] {\n const narrowed = Object.entries(augmentations ?? {}).filter(([providerRef]) => providerRefs.includes(providerRef));\n return narrowed.length === 0 ? undefined : Object.fromEntries(narrowed);\n}\n\n/**\n * Resolve the absolute path to the canonical\n * `frontend-services.runtime-providers.generated.json` artifact under\n * `<saasRoot>/.wildo-saas/generated/providers/`.\n *\n * Build-time consumers (Wonder Todos website + tech-doc) call this\n * instead of hardcoding the relative path so the artifact location\n * stays canonical (single source of truth is\n * `PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS`).\n */\nexport function resolveFrontendServicesArtifactPath(saasRoot: string): string {\n return resolvePath(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.frontendServices);\n}\n\n/**\n * Read + project the materialized frontend-services artifact for the\n * given service key. Returns `undefined` if the artifact file is\n * missing (sync hasn't run yet / clean checkout) or if the service\n * has no provider bootstrap entry.\n *\n * The single source of truth for build-time loading of the frontend\n * provider bootstraps. Replaces the (previously duplicated)\n * `loadMaterializedFrontendProviders` helpers that lived in\n * `saas-technical-doc/src/build/load-materialized-frontend-providers.ts`\n * and inline in `examples/wonder-todos/website/src/website-site-context.ts`.\n *\n * Both consumers used identical control flow:\n * 1. existsSync() short-circuit\n * 2. JSON.parse + SaasRuntimeProvidersArtifactSchema.parse\n * 3. frontendProviderBootstraps[serviceKey] lookup\n * 4. FrontendProvidersBlockSchema.parse on the per-service block\n * Centralized 2026-05-06 so a future schema/path change only\n * requires editing this function.\n */\nexport function loadMaterializedFrontendProviders(input: {\n artifactPath: string;\n serviceKey: string;\n}): FrontendProvidersBlock | undefined {\n const { artifactPath, serviceKey } = input;\n\n if (!existsSync(artifactPath)) {\n return undefined;\n }\n\n const parsedArtifact = SaasRuntimeProvidersArtifactSchema.safeParse(\n JSON.parse(readFileSync(artifactPath, 'utf8')),\n );\n if (!parsedArtifact.success) {\n throw staleGeneratedArtifactError(artifactPath, parsedArtifact.error.issues);\n }\n const providerBlock = parsedArtifact.data.frontendProviderBootstraps?.[serviceKey];\n if (providerBlock === undefined) return undefined;\n\n const parsedBlock = FrontendProvidersBlockSchema.safeParse(providerBlock);\n if (!parsedBlock.success) {\n throw staleGeneratedArtifactError(artifactPath, parsedBlock.error.issues);\n }\n // The website and documentation builds bake this block into pages served to every visitor (and\n // `wildo dev sync-csp` composes their policy from it), and nothing re-runs the overlay here (#1705).\n // An artifact a sync wrote before a schema was mandatory carries entries with no key list that no gate\n // ever held — so the reader refuses it and names the remedy rather than publishing it. The secret-VALUE\n // screen ran when the artifact was written, by its one writer; a build has no environment secrets.\n assertFrontendProvidersServeOnlyDeclaredKeys({\n producer: `Reading ${artifactPath} for frontend service \"${serviceKey}\"`,\n providers: parsedBlock.data.providers,\n });\n return parsedBlock.data;\n}\n\n/**\n * A materialized artifact that does not satisfy the current schema was almost always generated\n * before the contract changed (#328 added the provider identity to every frontend entry). A raw\n * Zod issue list reads as a logic defect in the consumer; the remedy is regeneration, so the\n * error names it. The backend's `applyProviderRuntime` says the same thing for its own reader —\n * one message, two readers.\n */\nfunction staleGeneratedArtifactError(artifactPath: string, issues: ReadonlyArray<{ path: PropertyKey[]; message: string }>): Error {\n return new Error(\n `The generated provider runtime artifact at ${artifactPath} does not satisfy the current contract — it was most `\n + 'likely generated before the contract changed. Regenerate it with `wildo config sync`. Issues: '\n + issues.map((issue) => `${issue.path.map(String).join('.')}: ${issue.message}`).join('; '),\n );\n}\n\nexport function renderProviderRuntimeGeneratedModule(\n artifact: SaasRuntimeProvidersArtifact,\n): string {\n const artifactLiteral = JSON.stringify(artifact, null, 2);\n\n return [\n '/**',\n ` * ${PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING}`,\n ' *',\n ' * This module is generated from wildo.saas.config.ts by `wildo config sync`.',\n ' * It contains environment-independent provider topology only.',\n ' */',\n '',\n // Intentionally NOT `as const` — the generated artifact is *data*, not a\n // frozen literal-typed tuple. Each host (backend / companion / minion /\n // worker) casts the imported value to its own narrowed runtime-artifact\n // type (`ProviderRuntimeArtifact`, `MinionProviderRuntimeArtifact`, …).\n // `as const` would infer `readonly` tuples (e.g. `readonly [\"openai\"]`)\n // that fail TS2352 against the schema-inferred mutable `string[]` shape.\n // Contract conformance is enforced upstream by\n // `SaasRuntimeProvidersArtifactSchema.parse(...)` at materialization time,\n // so widening the TS surface here costs no runtime safety.\n `export const WILDO_PROVIDER_RUNTIME = ${artifactLiteral};`,\n '',\n 'export default WILDO_PROVIDER_RUNTIME;',\n '',\n ].join('\\n');\n}\n\n/**\n * Canonical worker provider env-var keys. All workers receive the same\n * three keys regardless of language; the values are stable across runs\n * as long as the authored scope and discovered contributions don't\n * change.\n *\n * - `WILDO_PROVIDER_REFS` — comma-separated list of authored refs (sorted).\n * Cheap to read from any language (no JSON parser needed).\n * - `WILDO_PROVIDER_TOPOLOGY_JSON` — the per-worker `scope` block from\n * the materialized artifact, JSON-encoded. Workers that want\n * structured access (capability/protocol set) parse this; workers\n * that only need ref membership read `WILDO_PROVIDER_REFS`.\n * - `WILDO_PROVIDER_RUNTIME_DIGEST` — the artifact's `sourceDigest`.\n * Workers can fail-closed at boot if their copy of the env-file\n * disagrees with the lockfile section digest the platform expects.\n */\nexport const PROVIDER_RUNTIME_ENV_KEYS = {\n REFS: 'WILDO_PROVIDER_REFS',\n TOPOLOGY_JSON: 'WILDO_PROVIDER_TOPOLOGY_JSON',\n RUNTIME_DIGEST: 'WILDO_PROVIDER_RUNTIME_DIGEST',\n} as const;\n\n/**\n * Render the per-worker provider env-file body. Inputs:\n * - `scope` — the per-worker scope block from\n * `WildoSaasConfig.providers.scopes.workers[<workerKey>]`. Carries\n * the authored providers + capability/protocol declarations that\n * this worker needs to resolve at runtime.\n * - `sourceDigest` — `SaasRuntimeProvidersArtifact.sourceDigest`\n * (from the lockfile or the corresponding generated artifact).\n *\n * Output: a deterministic dotenv body — sorted refs, stable JSON\n * key ordering — so re-running `wildo config sync` with no upstream\n * changes produces a byte-identical file.\n */\nexport function renderProviderRuntimeEnvFile(input: {\n scope: SaasProviderScopeSelections;\n sourceDigest: string;\n}): string {\n const refs = Object.keys(input.scope.providers).sort();\n const topology: Record<string, {\n engineCapabilities: string[];\n providerCapabilities: string[];\n protocols: string[];\n }> = {};\n for (const ref of refs) {\n const selection = input.scope.providers[ref];\n topology[ref] = {\n engineCapabilities: [...selection.engineCapabilities].sort(),\n providerCapabilities: [...selection.providerCapabilities].sort(),\n protocols: [...selection.protocols].sort(),\n };\n }\n\n return [\n `# ${PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING}`,\n '#',\n '# This file is regenerated on every `wildo config sync`. Do not edit by hand.',\n '# Operator-authored secrets / per-env config stay in `.env` and are never touched here.',\n '',\n `${PROVIDER_RUNTIME_ENV_KEYS.REFS}=${refs.join(',')}`,\n `${PROVIDER_RUNTIME_ENV_KEYS.TOPOLOGY_JSON}=${JSON.stringify(topology)}`,\n `${PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST}=${input.sourceDigest}`,\n '',\n ].join('\\n');\n}\n\n/**\n * Result of comparing the runtime host's typed\n * `wildo-provider-runtime.generated.ts` module against its\n * `.wildo-providers.env` file at boot.\n *\n * Drift between the two indicates the operator regenerated one surface\n * but not the other — typically: edited `wildo.saas.config.ts` and\n * re-ran `wildo config sync` while the env file was cached, or vice\n * versa. Either case the runtime would silently boot with mismatched\n * topology unless someone reconciles. See\n * `assertProviderRuntimeEnvInSync` for the fail-closed assertion.\n */\nexport type ProviderRuntimeEnvReconciliationResult =\n | { kind: 'in-sync' }\n | { kind: 'env-missing'; missingKeys: ReadonlyArray<string> }\n | {\n kind: 'refs-mismatch';\n envRefs: ReadonlyArray<string>;\n artifactRefs: ReadonlyArray<string>;\n }\n | {\n kind: 'digest-mismatch';\n envDigest: string;\n artifactDigest: string;\n };\n\n/**\n * Reconcile a runtime artifact's typed projection against the\n * `.wildo-providers.env` mounted into the same process. Pure function\n * so callers can decide how to surface the result (throw / log / ignore).\n *\n * The env file is materialized by `renderProviderRuntimeEnvFile` for\n * EVERY runtime host that is a minion or worker; the typed module is\n * imported by the same hosts. Both should agree on\n * `(providerRefs, sourceDigest)` exactly. Drift means stale sync.\n *\n * Hosts that don't receive an env file (backend, companion, frontend\n * services per `provider-runtime-sync.service.ts`) MUST NOT call this —\n * `WILDO_PROVIDER_*` keys won't be set and every call returns\n * `env-missing`.\n */\nexport function reconcileProviderRuntimeEnv(input: {\n artifactProviderRefs: ReadonlyArray<string>;\n artifactSourceDigest: string;\n env?: NodeJS.ProcessEnv;\n}): ProviderRuntimeEnvReconciliationResult {\n const env = input.env ?? process.env;\n const envRefsRaw = env[PROVIDER_RUNTIME_ENV_KEYS.REFS];\n const envDigest = env[PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST];\n\n const missingKeys: string[] = [];\n if (envRefsRaw === undefined) missingKeys.push(PROVIDER_RUNTIME_ENV_KEYS.REFS);\n if (envDigest === undefined) missingKeys.push(PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST);\n if (missingKeys.length > 0) {\n return { kind: 'env-missing', missingKeys };\n }\n\n // Filter empty entries so trailing-comma input (e.g. `'openai,'`) or\n // operator-edited stray whitespace don't produce confusing `''`\n // entries in mismatch diagnostics. Materializer never emits trailing\n // commas, but defense-in-depth keeps the helper robust to anything\n // that lands the env file via dotenv loaders or hand-edits.\n const envRefs = envRefsRaw!\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n .sort();\n const artifactRefs = [...input.artifactProviderRefs].sort();\n\n if (envRefs.length !== artifactRefs.length || envRefs.some((ref, i) => ref !== artifactRefs[i])) {\n return { kind: 'refs-mismatch', envRefs, artifactRefs };\n }\n\n if (envDigest !== input.artifactSourceDigest) {\n return {\n kind: 'digest-mismatch',\n envDigest: envDigest!,\n artifactDigest: input.artifactSourceDigest,\n };\n }\n\n return { kind: 'in-sync' };\n}\n\n/**\n * Fail-closed wrapper around `reconcileProviderRuntimeEnv`. Throws on\n * any divergence, returns silently when in sync. Designed to be called\n * once at runtime-host boot (minion / Node-worker startup) so a stale\n * `.wildo-providers.env` surfaces immediately instead of being masked\n * by `process.env` drift.\n *\n * Throws a plain `Error` (not `WildoError_Backend`) because this runs\n * BEFORE the DI container has built the error builder — the failure\n * mode here is \"the container can't be trusted to boot at all\".\n */\nexport function assertProviderRuntimeEnvInSync(input: {\n artifactProviderRefs: ReadonlyArray<string>;\n artifactSourceDigest: string;\n hostKind: 'minion' | 'node-worker';\n hostKey: string;\n env?: NodeJS.ProcessEnv;\n}): void {\n const result = reconcileProviderRuntimeEnv(input);\n switch (result.kind) {\n case 'in-sync':\n return;\n case 'env-missing':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' booted without `\n + `provider env vars (${result.missingKeys.join(', ')}). The `\n + `\\`.wildo-providers.env\\` file should be mounted into this process — check `\n + `the docker-compose \\`env_file:\\` directive, the K8s ConfigMap mount, or the `\n + `dotenv loader. Re-run \\`wildo config sync\\` to regenerate if missing.`,\n );\n case 'refs-mismatch':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' detected stale provider topology. `\n + `\\`.wildo-providers.env\\` advertises refs [${result.envRefs.join(', ')}] but the `\n + `imported \\`wildo-provider-runtime.generated.ts\\` module declares `\n + `[${result.artifactRefs.join(', ')}]. Run \\`wildo config sync\\` to regenerate `\n + `both surfaces from the same \\`wildo.saas.config.ts\\` source.`,\n );\n case 'digest-mismatch':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' detected provider runtime digest drift. `\n + `\\`.wildo-providers.env\\` carries digest '${result.envDigest}' but the imported `\n + `\\`wildo-provider-runtime.generated.ts\\` module carries '${result.artifactDigest}'. `\n + `Refs match, but per-provider capabilities/protocols may differ. `\n + `Run \\`wildo config sync\\` to regenerate.`,\n );\n }\n}\n\ntype SaasProviderScopeSelections = {\n providers: Record<string, {\n engineCapabilities: ReadonlyArray<string>;\n providerCapabilities: ReadonlyArray<string>;\n protocols: ReadonlyArray<string>;\n }>;\n};\n\nfunction materializeRuntimeArtifacts(input: {\n frontendServiceNames: Record<string, string>;\n artifactMetadata: ProviderRuntimeArtifactMetadataByKind;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n frontendServiceTypes: Record<string, AppFrontendType>;\n generatedAt: string;\n modules: RuntimeProviderModulesArtifact;\n nodeWorkerKeys?: string[];\n scopes: SaasProvidersScopes;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): MaterializedSaasProviderRuntimeArtifacts['artifacts'] {\n const { artifactMetadata, discoveryContext, frontendServiceTypes, generatedAt, modules, nodeWorkerKeys, scopes, providerConfigurations } = input;\n const nodeWorkerKeySet = nodeWorkerKeys ? new Set(nodeWorkerKeys) : undefined;\n const nodeWorkerScopes = scopes.workers\n ? Object.fromEntries(\n Object.entries(scopes.workers).filter(([workerKey]) =>\n nodeWorkerKeySet ? nodeWorkerKeySet.has(workerKey) : true,\n ),\n )\n : undefined;\n\n const backendBootstraps = materializeFrontendProviderBootstraps({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n });\n\n return pruneUndefined({\n backend: materializeRuntimeArtifactFile({\n artifactKind: 'backend',\n generatedAt,\n modules,\n metadata: artifactMetadata.backend,\n // Only the HTTP-facing backend map uses public names. Static artifacts below\n // deliberately retain declaration keys for build-time scope selection.\n frontendProviderBootstraps: backendBootstraps && Object.fromEntries(\n Object.entries(backendBootstraps).map(([serviceKey, block]) => [input.frontendServiceNames[serviceKey]!, block]),\n ),\n scope: materializeRuntimeScope(scopes.backend ?? { providers: {}, selection: {} }),\n }),\n companion: materializeRuntimeArtifactFile({\n artifactKind: 'companion',\n generatedAt,\n modules,\n metadata: artifactMetadata.companion,\n scope: materializeRuntimeScope(scopes.companion ?? { providers: {}, selection: {} }),\n }),\n frontendServices: scopes.frontendServices\n ? materializeRuntimeArtifactFile({\n artifactKind: 'frontendServices',\n generatedAt,\n modules,\n metadata: artifactMetadata.frontendServices,\n frontendProviderBootstraps: materializeFrontendProviderBootstraps({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices,\n frontendServiceTypes,\n providerConfigurations,\n }),\n scopes: mapRecord(scopes.frontendServices, materializeRuntimeScope),\n })\n : undefined,\n minions: scopes.minions\n ? materializeRuntimeArtifactFile({\n artifactKind: 'minions',\n generatedAt,\n modules,\n metadata: artifactMetadata.minions,\n scopes: mapRecord(scopes.minions, materializeRuntimeScope),\n })\n : undefined,\n nodeWorkers: nodeWorkerScopes && Object.keys(nodeWorkerScopes).length > 0\n ? materializeRuntimeArtifactFile({\n artifactKind: 'nodeWorkers',\n generatedAt,\n modules,\n metadata: artifactMetadata.nodeWorkers,\n scopes: mapRecord(nodeWorkerScopes, materializeRuntimeScope),\n })\n : undefined,\n });\n}\n\nfunction materializeRuntimeArtifactFile(input: {\n artifactKind: ProviderRuntimeArtifactKind;\n generatedAt: string;\n metadata: ProviderRuntimeArtifactMetadata;\n modules: RuntimeProviderModulesArtifact;\n frontendProviderBootstraps?: Record<string, FrontendProvidersBlock>;\n scope?: z.infer<typeof RuntimeProviderScopeArtifactSchema>;\n scopes?: Record<string, z.infer<typeof RuntimeProviderScopeArtifactSchema>>;\n}): SaasRuntimeProvidersArtifact {\n return SaasRuntimeProvidersArtifactSchema.parse({\n __AUTOGENERATED__: PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING,\n generatedBy: PROVIDER_RUNTIME_ARTIFACT_GENERATOR,\n generatedAt: input.generatedAt,\n sourceDigest: input.metadata.sourceDigest,\n providerRefs: input.metadata.providerRefs,\n providerRuntimeImports: input.metadata.providerRuntimeImports,\n systemOfRecordFacetModules: input.metadata.systemOfRecordFacetModules,\n providerRuntimeAugmentations: input.metadata.providerRuntimeAugmentations,\n providerGraphDigest: input.metadata.providerGraphDigest,\n lockfileSectionDigest: input.metadata.lockfileSectionDigest,\n artifactKind: input.artifactKind,\n modules: input.modules,\n scope: input.scope,\n scopes: input.scopes,\n frontendProviderBootstraps: input.frontendProviderBootstraps,\n });\n}\n\nfunction materializeRuntimeScope(scope: NonNullable<SaasProvidersScopes['backend']>) {\n return RuntimeProviderScopeArtifactSchema.parse({\n providers: scope.providers,\n selection: scope.selection ?? {},\n });\n}\n\nfunction materializeFrontendProviderBootstraps(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n frontendServiceScopes: NonNullable<SaasProvidersScopes['frontendServices']>;\n frontendServiceTypes: Record<string, AppFrontendType>;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): Record<string, FrontendProvidersBlock> | undefined {\n const { discoveredContributions, frontendServiceScopes, frontendServiceTypes, providerConfigurations } = input;\n const entries = Object.entries(frontendServiceScopes).map(([serviceKey, scope]) => {\n const serviceType = frontendServiceTypes[serviceKey];\n if (!serviceType) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `service has no frontendType — only services with a frontendType may appear under providers.scopes.frontendServices.`,\n );\n }\n const providers = Object.fromEntries(Object.keys(scope.providers).map((providerRef) => {\n const matchingContribution = discoveredContributions.filter(\n (contribution) =>\n contribution.ref === providerRef\n && contribution.runtimeTargets.some(\n (target) => target.kind === 'frontendService' && target.serviceType === serviceType,\n ),\n );\n\n if (matchingContribution.length === 0) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\" (type \"${serviceType}\"): ` +\n `provider \"${providerRef}\" has no discovered frontend companion contribution.`,\n );\n }\n\n if (matchingContribution.some((contribution) => !contribution.frontendEntry)) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `provider \"${providerRef}\" is missing frontendEntry on at least one discovered contribution.`,\n );\n }\n\n if (matchingContribution.length > 1) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `provider \"${providerRef}\" is contributed more than once for the same runtime.`,\n );\n }\n\n return [\n providerRef,\n applyApplicationPublicConfig({\n serviceKey,\n providerRef,\n entry: matchingContribution[0].frontendEntry as FrontendProviderEntry,\n supplied: providerConfigurations[providerRef]?.[FRONTEND_PROVIDER_PUBLIC_CONFIG_KEY],\n discoveredContributions,\n }),\n ] as const;\n }));\n\n return [serviceKey, FrontendProvidersBlockSchema.parse({ providers })] as const;\n });\n\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\n/**\n * Overlays what the application supplied under `providerConfigurations[ref].frontend_sdk` onto the\n * module's authored `publicConfig` (#394 P3) — the FIRST of the two sites that produce a\n * `FrontendProviderEntry` from a module; the backend fallback is the other, and both call the one\n * function in `saas-models` so they cannot disagree about what crosses.\n *\n * The forbidden set is built from the SAME vendor's non-frontend contributions: a frontend provider\n * owns no secrets (`secretsContractShape: []` by construction), so the only secret NAMES that could\n * be typed into its bag are the backend module's, and those are exactly what this walk has in hand.\n *\n * Runs for EVERY entry, supplied or not (#1705): the overlay is also where an entry with no readable\n * key list is refused and where the module's own and any contribution-mapped keys are held to that\n * list. Returning early when nothing was supplied skipped both. Secret VALUES are not compared here —\n * this walk holds no secrets — but by the one publisher of these artifacts before it writes them\n * ({@link assertFrontendProviderBootstrapsCarryNoSecretValue}).\n */\nfunction applyApplicationPublicConfig(input: {\n serviceKey: string;\n providerRef: string;\n entry: FrontendProviderEntry;\n supplied: unknown;\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n}): FrontendProviderEntry {\n const { serviceKey, providerRef, entry, supplied, discoveredContributions } = input;\n\n const forbiddenKeys = new Set(\n discoveredContributions\n .filter((contribution) =>\n contribution.ref === providerRef\n && contribution.runtimeTargets.some((target) => target.kind !== 'frontendService'))\n .flatMap((contribution) => contribution.secretsContractShape.flatMap((slot) => [slot.slug, slot.envVarName])),\n );\n\n try {\n const publicConfig = overlayFrontendProviderPublicConfig({\n providerRef,\n authored: entry.publicConfig,\n supplied,\n declaredKeys: entry.publicConfigKeys,\n forbiddenKeys,\n });\n return publicConfig === undefined || publicConfig === entry.publicConfig ? entry : { ...entry, publicConfig };\n } catch (error) {\n if (error instanceof FrontendProviderPublicConfigError) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ${error.message}`,\n );\n }\n throw error;\n }\n}\n\n/**\n * Refuses a set of materialized provider runtime artifacts when any frontend provider they would\n * SERVE carries one of the environment's secret values (#1705).\n *\n * Walks every `frontendProviderBootstraps` block of every artifact kind — the backend artifact (whose\n * blocks the backend serves on `/application-config` and bakes into its generated module) and the\n * frontend-services artifact (which the website and documentation builds read) — so no served copy is\n * screened while another is not. The comparison itself is the shared\n * `assertNoSecretValueInFrontendProviders`, which the backend runs over what it serves too.\n *\n * Its one caller is the one writer of these artifacts, `wildo config sync`, and it must run BEFORE\n * anything is written: a refused artifact that already reached disk would be picked up by a watcher\n * and served.\n */\nexport function assertFrontendProviderBootstrapsCarryNoSecretValue(input: {\n readonly artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'];\n readonly secrets: readonly FrontendPublicConfigSecretValue[];\n readonly producer: string;\n}): void {\n for (const artifact of Object.values(input.artifacts)) {\n for (const [serviceKey, block] of Object.entries(artifact?.frontendProviderBootstraps ?? {})) {\n assertNoSecretValueInFrontendProviders({\n producer: `${input.producer} (${artifact!.artifactKind} artifact, frontend service \"${serviceKey}\")`,\n providers: block.providers,\n secrets: input.secrets,\n });\n }\n }\n}\n\n/** Whether any materialized artifact would serve a frontend provider at all — the only case that needs secrets to screen. */\nexport function materializedArtifactsServeFrontendProviders(\n artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'],\n): boolean {\n return Object.values(artifacts).some((artifact) =>\n Object.values(artifact?.frontendProviderBootstraps ?? {}).some((block) => Object.keys(block.providers).length > 0));\n}\n\nfunction buildFrontendProviderBootstrapDigestInput(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n frontendServiceScopes: NonNullable<SaasProvidersScopes['frontendServices']>;\n frontendServiceTypes: Record<string, AppFrontendType>;\n // In the digest on purpose: an application changing a picker's `appId` changes the served\n // artifact, and a digest that did not move would report the old artifact as current.\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): Record<string, unknown> | undefined {\n const bootstraps = materializeFrontendProviderBootstraps(input);\n if (!bootstraps) {\n return undefined;\n }\n\n return Object.fromEntries(\n Object.entries(bootstraps).map(([serviceKey, block]) => [\n serviceKey,\n Object.fromEntries(\n Object.entries(block.providers).map(([providerRef, providerEntry]) => [\n providerRef,\n /*\n * The WHOLE served entry, not a hand-picked subset (#1743). This used to name four\n * fields — metadata, capabilities, protocols, publicConfig — and so every field added to\n * the entry later (the CSP footprint, scripts, the SDK descriptor, components, the\n * declared public-config keys, the fronted storage, and now the vendor's compliance\n * profile) changed the SERVED artifact without moving its digest: the exact \"old artifact\n * reported as current\" the `providerConfigurations` note above exists to prevent, and a\n * processor register reading such an artifact would name yesterday's regions. Spreading\n * the entry makes a new field a digest input by default rather than by someone\n * remembering. The two arrays are still sorted so their authoring order is not a change,\n * and a key present as `undefined` is dropped because the artifact is written as JSON,\n * where it does not exist — two producers that differ only in spelling \"absent\" must not\n * differ in digest.\n */\n pruneUndefined({\n ...providerEntry,\n providerCapabilities: [...providerEntry.providerCapabilities].sort(),\n protocols: [...providerEntry.protocols].sort(),\n }),\n ]),\n ),\n ]),\n );\n}\n\nfunction materializeModules(\n config: Pick<WildoSaasConfig, 'modules' | 'services'>,\n): RuntimeProviderModulesArtifact {\n const modules = (config.modules ?? {}) as NonNullable<ApplicationModules>;\n return RuntimeProviderModulesArtifactSchema.parse({\n declaredModules: modules,\n moduleIds: getDeclaredApplicationModuleIds(modules),\n moduleIdsByService: Object.fromEntries(\n Object.keys(config.services ?? {}).map((serviceKey) => [\n serviceKey,\n getServiceBoundApplicationModuleIds(modules, serviceKey),\n ]),\n ),\n });\n}\n\nfunction materializeLockRuntimeScopes(input: {\n scopes: SaasProvidersScopes;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n}): SaasLockfileRuntimeScopesProviders {\n const { scopes, discoveryContext } = input;\n return pruneUndefined({\n backend: scopes.backend\n ? materializeLockScope(\n scopes.backend.providers,\n discoveryContext,\n discoveryContext.backend.matchesRuntimeTarget,\n discoveryContext.augmentations,\n )\n : undefined,\n companion: scopes.companion\n ? materializeLockScope(\n scopes.companion.providers,\n discoveryContext,\n discoveryContext.companion.matchesRuntimeTarget,\n discoveryContext.augmentations,\n )\n : undefined,\n frontendServices: scopes.frontendServices\n ? mapRecord(\n scopes.frontendServices,\n (scope, serviceKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.frontendServices.matchesRuntimeTarget(serviceKey),\n // A browser facet merges no augmentation (#1672): a browser reaches an augmented operation only through\n // the backend's operation door, so recording one here would describe code this facet never loads.\n [],\n ),\n )\n : undefined,\n minions: scopes.minions\n ? mapRecord(\n scopes.minions,\n (scope, minionKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.minions.matchesRuntimeTarget(minionKey),\n discoveryContext.augmentations,\n ),\n )\n : undefined,\n workers: scopes.workers\n ? mapRecord(\n scopes.workers,\n (scope, workerKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.workers.matchesRuntimeTarget(workerKey),\n discoveryContext.augmentations,\n ),\n )\n : undefined,\n });\n}\n\nfunction materializeLockScope(\n providers: Record<string, SaasProviderScopeSelection>,\n discoveryContext: ProviderRuntimeDiscoveryContext,\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean,\n augmentations: readonly DiscoveredProviderAugmentation[],\n): SaasLockfileRuntimeScopesProviders['backend'] {\n return mapRecord(providers, (selection, ref) => {\n const matchingContributions = findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget,\n providerRef: ref,\n });\n const secretsContractShape = resolveProviderSecretsContractShape(ref, matchingContributions);\n const recordedAugmentations = buildRuntimeAugmentations([ref], matchingContributions, augmentations)[ref];\n const connectionRef = resolveProviderConnectionRef(discoveryContext.sharedConnections, ref);\n\n return {\n ref,\n digest: digestJson({\n selection,\n providerGraph: normalizeDiscoveredContributionsForDigest(matchingContributions),\n }),\n engineCapabilities: selection.engineCapabilities,\n providerCapabilities: selection.providerCapabilities,\n protocols: selection.protocols,\n // assurance-control: WILDO.SECRETS.CONTRACT_INTEGRITY — lock drift\n // covers the values-free provider contract without persisting secret values.\n secretsContractDigest: digestJson({ ref, secretsContractShape }),\n // Third-party code admitted to this provider's grant (#1672), recorded so a lock diff shows it ARRIVING —\n // and moving: a new package, a new version or a changed operation set each change this entry. Absent\n // when nothing is augmented, and deliberately NOT folded into `secretsContractDigest` (an augmentation\n // changes no secret) or `digest` (which would re-key every provider's lock entry for a field most never carry).\n // The connection whose grant this ref spends (#1725), only when it is ANOTHER ref's: a lock diff then shows a\n // ref joining or leaving a shared connection, while every undeclared ref's entry keeps its bytes.\n ...(connectionRef === ref ? {} : { connectionRef }),\n ...(recordedAugmentations === undefined ? {} : {\n augmentations: recordedAugmentations.map((augmentation) => ({\n packageName: augmentation.packageName,\n packageVersion: augmentation.packageVersion,\n operationIdsDigest: digestJson(augmentation.operationIds),\n // A package that starts asking for a new scope changes what a person is asked to consent to (#1671).\n ...(augmentation.requiredScopes === undefined ? {} : { requiredScopesDigest: digestJson(augmentation.requiredScopes) }),\n })),\n }),\n };\n });\n}\n\n/**\n * Resolves one authoritative values-free secret contract for a provider in a\n * concrete runtime scope.\n *\n * Multiple runtime owners may legitimately contribute the same provider, but\n * they must agree on its secret requirements. Missing discovery and divergent\n * shapes fail closed: hashing either state as an empty contract would make the\n * lockfile claim integrity evidence it does not possess.\n */\nfunction resolveProviderSecretsContractShape(\n providerRef: string,\n matchingContributions: DiscoveredProviderCompanionContribution[],\n): DiscoveredProviderCompanionContribution['secretsContractShape'] {\n if (matchingContributions.length === 0) {\n throw new Error(\n `Cannot materialize provider lock entry for \"${providerRef}\": no discovered contribution supplies its secret-contract shape for this runtime.`,\n );\n }\n\n const canonicalShape = matchingContributions[0].secretsContractShape;\n const canonicalDigestInput = stableStringify(canonicalShape);\n for (const contribution of matchingContributions.slice(1)) {\n if (stableStringify(contribution.secretsContractShape) !== canonicalDigestInput) {\n throw new Error(\n `Cannot materialize provider lock entry for \"${providerRef}\": discovered runtime owners disagree on its secret-contract shape.`,\n );\n }\n }\n\n return canonicalShape;\n}\n\nfunction digestJson(value: unknown): string {\n return `sha256:${createHash('sha256').update(stableStringify(value)).digest('hex')}`;\n}\n\nfunction stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(',')}]`;\n }\n if (value && typeof value === 'object') {\n const record = value as Record<string, unknown>;\n return `{${Object.keys(record)\n .sort()\n .map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`)\n .join(',')}}`;\n }\n return JSON.stringify(value);\n}\n\nfunction mapRecord<TValue, TResult>(\n record: Record<string, TValue>,\n mapper: (value: TValue, key: string) => TResult,\n): Record<string, TResult> {\n return Object.fromEntries(\n Object.entries(record).map(([key, value]) => [key, mapper(value, key)]),\n );\n}\n\nfunction pruneUndefined<T extends Record<string, unknown>>(record: T): T {\n return Object.fromEntries(\n Object.entries(record).filter(([, value]) => value !== undefined),\n ) as T;\n}\n\ninterface ProviderRuntimeArtifactMetadata {\n sourceDigest: string;\n providerRefs: string[];\n providerRuntimeImports: Record<string, string>;\n providerRuntimeAugmentations?: Record<string, RuntimeProviderAugmentationArtifact[]>;\n systemOfRecordFacetModules: string[];\n providerGraphDigest: string;\n lockfileSectionDigest: string;\n}\n\ninterface ProviderRuntimeArtifactMetadataByKind {\n backend: ProviderRuntimeArtifactMetadata;\n companion: ProviderRuntimeArtifactMetadata;\n frontendServices: ProviderRuntimeArtifactMetadata;\n minions: ProviderRuntimeArtifactMetadata;\n nodeWorkers: ProviderRuntimeArtifactMetadata;\n}\n\ninterface RuntimeContributionMatcherFactory {\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n}\n\ninterface ScopedRuntimeContributionMatcherFactory {\n matchesRuntimeTarget: (\n scopeKey: string,\n ) => (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n}\n\ninterface ProviderRuntimeDiscoveryContext {\n contributions: DiscoveredProviderCompanionContribution[];\n /** The application's `providers.sharedConnections` (#1725), read through `resolveProviderConnectionRef`. */\n sharedConnections: ProviderSharedConnections | undefined;\n /** The OPTED-IN augmentations only (#1672) — see `materializeSaasProviderRuntimeArtifacts`. */\n augmentations: readonly DiscoveredProviderAugmentation[];\n /** The facet modules the discovery walk found, when the caller supplied them (#1675). */\n systemOfRecordFacetModules: readonly string[] | undefined;\n backend: RuntimeContributionMatcherFactory;\n companion: RuntimeContributionMatcherFactory;\n frontendServices: ScopedRuntimeContributionMatcherFactory;\n minions: ScopedRuntimeContributionMatcherFactory;\n workers: ScopedRuntimeContributionMatcherFactory;\n}\n\nfunction buildProviderRuntimeDiscoveryContext(input: {\n discoveredContributions?: DiscoveredProviderCompanionContribution[];\n discoveredAugmentations: readonly DiscoveredProviderAugmentation[];\n frontendServiceTypes: Record<string, AppFrontendType>;\n sharedConnections?: ProviderSharedConnections;\n systemOfRecordFacetModules?: readonly string[];\n}): ProviderRuntimeDiscoveryContext {\n const contributions = input.discoveredContributions ?? [];\n const { frontendServiceTypes } = input;\n\n return {\n contributions,\n sharedConnections: input.sharedConnections,\n augmentations: input.discoveredAugmentations,\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n backend: {\n matchesRuntimeTarget: (target) => target.kind === 'backend',\n },\n companion: {\n matchesRuntimeTarget: (target) => target.kind === 'companion',\n },\n frontendServices: {\n matchesRuntimeTarget: (serviceKey) => {\n const serviceType = frontendServiceTypes[serviceKey];\n // Service has no frontendType ⇒ no contribution can match it.\n if (!serviceType) return () => false;\n return (target) => target.kind === 'frontendService' && target.serviceType === serviceType;\n },\n },\n minions: {\n matchesRuntimeTarget: (minionKey) => (target) => target.kind === 'minion' && target.minionKey === minionKey,\n },\n workers: {\n matchesRuntimeTarget: (workerKey) => (target) => target.kind === 'worker' && target.workerKey === workerKey,\n },\n };\n}\n\nfunction buildArtifactMetadata(input: {\n frontendServiceNames: Record<string, string>;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n frontendServiceTypes: Record<string, AppFrontendType>;\n lockSection: SaasLockfileProvidersSection;\n modules: RuntimeProviderModulesArtifact;\n nodeWorkerKeys?: string[];\n scopes: SaasProvidersScopes;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): ProviderRuntimeArtifactMetadataByKind {\n const { discoveryContext, frontendServiceTypes, lockSection, modules, nodeWorkerKeys, scopes, providerConfigurations } = input;\n const augmentations = discoveryContext.augmentations;\n /*\n * Computed ONCE for every artifact kind, because a vendor facet is not scoped to a runtime the way\n * a provider is: it says what a vendor NEEDS, which does not change between a backend and a\n * minion. Only the backend reads it today (#1055 D2 gives the instance environment to that runtime\n * alone), and recording it everywhere is what keeps that a policy of the RUNTIME rather than a\n * property of the artifact.\n */\n const systemOfRecordFacetModules = discoveryContext.systemOfRecordFacetModules !== undefined\n ? [...discoveryContext.systemOfRecordFacetModules].sort()\n : discoverSystemOfRecordFacetModules(discoveryContext.contributions);\n const nodeWorkerKeySet = nodeWorkerKeys ? new Set(nodeWorkerKeys) : undefined;\n\n return {\n backend: buildSingleScopeArtifactMetadata({\n runtimeLabel: 'the backend',\n systemOfRecordFacetModules,\n augmentations,\n modules,\n providers: scopes.backend?.providers ?? {},\n matchingContributions: findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.backend.matchesRuntimeTarget,\n }),\n extraArtifactState: {\n frontendServiceNames: input.frontendServiceNames,\n bootstraps: buildFrontendProviderBootstrapDigestInput({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n }),\n },\n runtimeLockSection: lockSection.runtimeScopes.backend ?? {},\n scopes,\n }),\n companion: buildSingleScopeArtifactMetadata({\n runtimeLabel: 'the companion',\n systemOfRecordFacetModules,\n augmentations,\n modules,\n providers: scopes.companion?.providers ?? {},\n matchingContributions: findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.companion.matchesRuntimeTarget,\n }),\n runtimeLockSection: lockSection.runtimeScopes.companion ?? {},\n scopes,\n }),\n frontendServices: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'frontend service',\n /*\n * Per service only: one ref legitimately has a different browser module per frontend type (posthog is\n * `…-public/app` for the SaaS app and `…-public/website` for the site), and no runtime loads this\n * artifact's merged import map — a browser receives its providers through its bootstrap entries.\n */\n oneImportPathAcrossScopes: false,\n systemOfRecordFacetModules,\n // No augmentation reaches a browser facet — see `materializeLockRuntimeScopes`.\n augmentations: [],\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.frontendServices ?? {}).map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.frontendServices ?? {}).map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.frontendServices.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n extraArtifactState: buildFrontendProviderBootstrapDigestInput({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n }),\n runtimeLockSection: lockSection.runtimeScopes.frontendServices ?? {},\n scopes,\n }),\n minions: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'minion',\n // Every minion reads its ref's path from this one merged map, so two minions may not disagree either.\n oneImportPathAcrossScopes: true,\n systemOfRecordFacetModules,\n augmentations,\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.minions ?? {}).map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.minions ?? {}).map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.minions.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n runtimeLockSection: lockSection.runtimeScopes.minions ?? {},\n scopes,\n }),\n nodeWorkers: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'worker',\n // Every worker reads its ref's path from this one merged map, so two workers may not disagree either.\n oneImportPathAcrossScopes: true,\n systemOfRecordFacetModules,\n augmentations,\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.workers ?? {})\n .filter(([scopeKey]) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true)\n .map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.workers ?? {})\n .filter((scopeKey) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true)\n .map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.workers.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n runtimeLockSection: Object.fromEntries(\n Object.entries(lockSection.runtimeScopes.workers ?? {})\n .filter(([scopeKey]) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true),\n ),\n scopes,\n }),\n };\n}\n\nfunction buildSingleScopeArtifactMetadata(input: {\n /** Names the runtime in a refusal (`the backend`). */\n runtimeLabel: string;\n systemOfRecordFacetModules: string[];\n augmentations: readonly DiscoveredProviderAugmentation[];\n matchingContributions: DiscoveredProviderCompanionContribution[];\n modules: RuntimeProviderModulesArtifact;\n providers: Record<string, SaasProviderScopeSelection>;\n extraArtifactState?: Record<string, unknown>;\n runtimeLockSection: Record<string, unknown>;\n scopes: SaasProvidersScopes;\n}): ProviderRuntimeArtifactMetadata {\n const providerRefs = Object.keys(input.providers).sort();\n const normalizedContributions = normalizeDiscoveredContributionsForDigest(input.matchingContributions);\n const providerRuntimeAugmentations = buildRuntimeAugmentations(providerRefs, input.matchingContributions, input.augmentations);\n const hasAugmentations = Object.keys(providerRuntimeAugmentations).length > 0;\n const providerGraphDigestInput = withAugmentationsForDigest(input.extraArtifactState\n ? {\n providerGraph: normalizedContributions,\n extraArtifactState: input.extraArtifactState,\n }\n : normalizedContributions, providerRuntimeAugmentations);\n\n return {\n sourceDigest: digestJson({\n modules: input.modules,\n providers: input.providers,\n providerGraph: normalizedContributions,\n scopes: input.scopes,\n extraArtifactState: input.extraArtifactState,\n ...(hasAugmentations ? { augmentations: providerRuntimeAugmentations } : {}),\n }),\n providerRefs,\n providerRuntimeImports: buildProviderRuntimeImports(providerRefs, input.matchingContributions, input.runtimeLabel),\n ...(hasAugmentations ? { providerRuntimeAugmentations } : {}),\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n providerGraphDigest: digestJson(providerGraphDigestInput),\n lockfileSectionDigest: digestJson(input.runtimeLockSection),\n };\n}\n\nfunction buildMultiScopeArtifactMetadata(input: {\n /** Names a scope's runtime in a refusal (`minion` → `minion \"scraper\"`). */\n runtimeKindLabel: string;\n /**\n * Whether the merged import map is what each scope's runtime loads from. When it is, a ref must have one path\n * across ALL scopes; when it is not, one path per scope is the whole requirement.\n */\n oneImportPathAcrossScopes: boolean;\n systemOfRecordFacetModules: string[];\n augmentations: readonly DiscoveredProviderAugmentation[];\n keyedProviders: Record<string, Record<string, SaasProviderScopeSelection>>;\n matchingContributionsByScope: Record<string, DiscoveredProviderCompanionContribution[]>;\n modules: RuntimeProviderModulesArtifact;\n extraArtifactState?: Record<string, unknown>;\n runtimeLockSection: Record<string, unknown>;\n scopes: SaasProvidersScopes;\n}): ProviderRuntimeArtifactMetadata {\n const providerRefs = [...new Set(\n Object.values(input.keyedProviders).flatMap((providers) => Object.keys(providers)),\n )].sort();\n const normalizedContributionsByScope = Object.fromEntries(\n Object.entries(input.matchingContributionsByScope).map(([scopeKey, contributions]) => [\n scopeKey,\n normalizeDiscoveredContributionsForDigest(contributions),\n ]),\n );\n\n const allMatchingContributions = Object.values(input.matchingContributionsByScope).flat();\n const providerRuntimeAugmentations = buildRuntimeAugmentations(providerRefs, allMatchingContributions, input.augmentations);\n const hasAugmentations = Object.keys(providerRuntimeAugmentations).length > 0;\n const providerGraphDigestInput = withAugmentationsForDigest(input.extraArtifactState\n ? {\n providerGraphByScope: normalizedContributionsByScope,\n extraArtifactState: input.extraArtifactState,\n }\n : normalizedContributionsByScope, providerRuntimeAugmentations);\n\n return {\n sourceDigest: digestJson({\n keyedProviders: input.keyedProviders,\n modules: input.modules,\n providerGraphByScope: normalizedContributionsByScope,\n scopes: input.scopes,\n extraArtifactState: input.extraArtifactState,\n ...(hasAugmentations ? { augmentations: providerRuntimeAugmentations } : {}),\n }),\n providerRefs,\n providerRuntimeImports: buildMultiScopeProviderRuntimeImports(providerRefs, input),\n ...(hasAugmentations ? { providerRuntimeAugmentations } : {}),\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n providerGraphDigest: digestJson(providerGraphDigestInput),\n lockfileSectionDigest: digestJson(input.runtimeLockSection),\n };\n}\n\n/**\n * Which packages ship SYSTEM-OF-RECORD VENDOR FACETS (#1057) — the FALLBACK used when a caller supplies no\n * walk answer (`discoveredSystemOfRecordFacetModules`).\n *\n * Derived from the contributions' package roots, so it is bounded by what the walk's RESULTS contain: a\n * package that ships facets or facet augmentations and NO provider contribution is not found here. That\n * package now exists (#1675), which is why discovery answers from its TARGETS\n * (`DiscoverSaasProviderCompanionContributionsResult.systemOfRecordFacetModules`) and every `wildo` caller\n * passes that answer. Kept for a caller that builds an artifact from contributions alone (tests, the proofs).\n *\n * Sorted, so the artifact does not churn on filesystem order, and de-duplicated because one package root\n * contributes hundreds of providers and exactly one facet module.\n */\nfunction discoverSystemOfRecordFacetModules(\n contributions: readonly DiscoveredProviderCompanionContribution[],\n): string[] {\n const specifiers = new Set<string>();\n const visitedRoots = new Set<string>();\n\n for (const contribution of contributions) {\n const packageRoot = contribution.owner?.packageRoot;\n if (packageRoot === undefined || visitedRoots.has(packageRoot)) continue;\n visitedRoots.add(packageRoot);\n const specifier = readSystemOfRecordFacetModuleSpecifier(packageRoot);\n if (specifier !== undefined) specifiers.add(specifier);\n }\n\n return [...specifiers].sort();\n}\n\n/**\n * The merged import map of a multi-scope artifact. Every scope is checked on its own first, so a refusal names the\n * scope that disagrees with itself; then, where the runtimes load from the merged map, across scopes.\n */\nfunction buildMultiScopeProviderRuntimeImports(\n providerRefs: string[],\n input: {\n runtimeKindLabel: string;\n oneImportPathAcrossScopes: boolean;\n keyedProviders: Record<string, Record<string, SaasProviderScopeSelection>>;\n matchingContributionsByScope: Record<string, DiscoveredProviderCompanionContribution[]>;\n },\n): Record<string, string> {\n for (const [scopeKey, contributions] of Object.entries(input.matchingContributionsByScope).sort(([left], [right]) => left.localeCompare(right))) {\n buildProviderRuntimeImports(Object.keys(input.keyedProviders[scopeKey] ?? {}), contributions, `${input.runtimeKindLabel} \"${scopeKey}\"`);\n }\n const allMatchingContributions = Object.values(input.matchingContributionsByScope).flat();\n if (input.oneImportPathAcrossScopes) {\n return buildProviderRuntimeImports(providerRefs, allMatchingContributions, `every ${input.runtimeKindLabel}`);\n }\n /*\n * Not loaded by any runtime (see the caller), and each scope already has one path per ref: keep the historical\n * deterministic merge, the sorted-first path per ref, so the artifact does not churn.\n */\n const inScope = new Set(providerRefs);\n const candidatesByRef = new Map<string, string[]>();\n for (const contribution of allMatchingContributions) {\n if (!inScope.has(contribution.ref)) continue;\n candidatesByRef.set(contribution.ref, [...(candidatesByRef.get(contribution.ref) ?? []), contribution.runtimeImportPath]);\n }\n return Object.fromEntries(\n [...candidatesByRef.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([ref, candidates]) => [ref, [...candidates].sort()[0]!]),\n );\n}\n\n/**\n * Project the per-ref runtime import path a host dynamic-imports.\n *\n * Only refs actually in scope are recorded, so a per-host artifact never advertises a sibling's\n * packages. A ref no contribution covers is simply absent: the host then resolves it from the\n * engine's on-demand map, and the single fail-loud refusal in the backend registry names it if that\n * map does not hold it either.\n *\n * When several contributions claim one ref with DIFFERENT import paths, the artifact REFUSES (#2014): the\n * sorted-first path used to win silently, so a second package contributing a ref the application's own copy\n * (`@<app>/provider-asana`) also contributes decided which module loaded — the #2014 case was a leftover install of\n * the since-archived provider catalogue, whose `asana` subpath sorted first.\n * Discovery validation refuses the same case through the same predicate,\n * {@link describeProviderRefClaimedByMoreThanOneImportPath}; this is the second site, so an artifact can never\n * be built from contributions that skipped validation. `runtimeLabel` names the runtime in the refusal.\n */\nfunction buildProviderRuntimeImports(\n providerRefs: string[],\n contributions: DiscoveredProviderCompanionContribution[],\n runtimeLabel: string,\n): Record<string, string> {\n const inScope = new Set(providerRefs);\n const candidatesByRef = new Map<string, Set<string>>();\n\n for (const contribution of contributions) {\n if (!inScope.has(contribution.ref)) {\n continue;\n }\n const candidates = candidatesByRef.get(contribution.ref) ?? new Set<string>();\n candidates.add(contribution.runtimeImportPath);\n candidatesByRef.set(contribution.ref, candidates);\n }\n\n const refusals = [...candidatesByRef.keys()]\n .sort()\n .map((ref) => describeProviderRefClaimedByMoreThanOneImportPath(ref, runtimeLabel, contributions))\n .filter((refusal): refusal is string => refusal !== undefined);\n if (refusals.length > 0) {\n throw new Error(`Provider runtime artifact refused:\\n- ${refusals.join('\\n- ')}`);\n }\n\n return Object.fromEntries(\n [...candidatesByRef.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([ref, candidates]) => [ref, [...candidates][0]!]),\n );\n}\n\n/**\n * The opted-in augmentations of the given refs, per ref, sorted by package name (#1672).\n *\n * A ref no scope-matched contribution covers gets none: an augmentation applies to a provider the host actually\n * loads. The base package is read from the base's contribution — its runtime import path's package, and that\n * package's installed version when discovery walked it — and recorded for #1731; nothing here refuses on it.\n */\nfunction buildRuntimeAugmentations(\n providerRefs: readonly string[],\n matchingContributions: readonly DiscoveredProviderCompanionContribution[],\n augmentations: readonly DiscoveredProviderAugmentation[],\n): Record<string, RuntimeProviderAugmentationArtifact[]> {\n const result: Record<string, RuntimeProviderAugmentationArtifact[]> = {};\n for (const ref of [...providerRefs].sort()) {\n const base = [...matchingContributions]\n .filter((contribution) => contribution.ref === ref)\n .sort((left, right) => left.runtimeImportPath.localeCompare(right.runtimeImportPath))[0];\n if (base === undefined) continue;\n const entries = augmentations\n .filter((augmentation) => augmentation.augments === ref && augmentation.packageVersion !== undefined)\n .map((augmentation) => RuntimeProviderAugmentationArtifactSchema.parse({\n packageName: augmentation.packageName,\n packageVersion: augmentation.packageVersion,\n runtimeImportPath: augmentation.runtimeImportPath,\n operationIds: [...augmentation.operationIds],\n ...(augmentation.requiredScopes.length === 0 ? {} : { requiredScopes: [...augmentation.requiredScopes] }),\n ...resolveProviderBasePackage(base),\n }))\n .sort((left, right) => left.packageName.localeCompare(right.packageName));\n if (entries.length > 0) result[ref] = entries;\n }\n return result;\n}\n\n/**\n * Fold augmentations into a provider-graph digest input only when there are some, so the digest of every\n * artifact that augments nothing is byte-identical to what it was before augmentation existed — a running host\n * compares these digests, and an unrelated field must not read as drift.\n */\nfunction withAugmentationsForDigest(digestInput: unknown, augmentations: Record<string, RuntimeProviderAugmentationArtifact[]>): unknown {\n return Object.keys(augmentations).length === 0 ? digestInput : { providerGraph: digestInput, augmentations };\n}\n\nfunction findMatchingDiscoveredContributions(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n providerRef?: string;\n}): DiscoveredProviderCompanionContribution[] {\n return input.discoveredContributions.flatMap((contribution) => {\n if (input.providerRef && contribution.ref !== input.providerRef) {\n return [];\n }\n const runtimeTargets = contribution.runtimeTargets.filter(input.matchesRuntimeTarget);\n if (runtimeTargets.length === 0) {\n return [];\n }\n return [{ ...contribution, runtimeTargets }];\n });\n}\n\n/**\n * The portion of a contribution's `owner` that may enter a digest.\n *\n * **`packageRoot` is deliberately excluded, and this is the whole point of the\n * function.** Discovery builds it as `resolve(saasRoot, definition.path)` — an\n * ABSOLUTE filesystem path — so hashing it makes every value derived from this\n * normalizer a property of WHERE THE REPOSITORY HAPPENS TO BE CHECKED OUT\n * rather than of the provider graph.\n *\n * That is not a theoretical concern; it was measured on 2026-08-30. The same\n * Wonder Todos tree, materialized from its real directory and from a symlink to\n * it, produced two different lock digests for every provider in every scope\n * (`sha256:f7eeb2d6…` vs `sha256:d933b95a…` for backend `anthropic`), and a dump\n * of the two contribution sets differed in `owner.packageRoot` and nothing else.\n * The consequences were both real:\n *\n * - `examples/wonder-todos/.wildo-saas/wildo-saas.lock.json` carried 22 digests\n * scoped to whichever checkout last ran `wildo config sync`, so the\n * `Lockfile Drift Check` gate — which runs at `/home/runner/work/…` — could\n * never have agreed with a committed value regardless of actual drift.\n * - The same input feeds `sourceDigest` / `providerGraphDigest` in the generated\n * runtime artifacts and `.wildo-providers.env`, so artifacts generated on a\n * developer's machine and re-materialized under a container's `/app` would\n * trip the `digest-mismatch` runtime diagnostic while describing an identical\n * provider graph.\n *\n * `kind` + `key` already identify an owner uniquely (both are record keys within\n * their config block), so nothing distinguishing is lost. What IS given up is\n * that relocating an owner package without changing its contribution content no\n * longer moves the digest — accepted deliberately: a repository-layout change is\n * not a provider-contract change, and if that signal is ever wanted it must\n * arrive as a saas-root-RELATIVE path, never an absolute one.\n */\nfunction projectOwnerForDigest(\n owner: DiscoveredProviderCompanionContribution['owner'],\n): { kind: string; key: string } {\n return { kind: owner.kind, key: owner.key };\n}\n\nfunction normalizeDiscoveredContributionsForDigest(\n contributions: DiscoveredProviderCompanionContribution[],\n): Array<Record<string, unknown>> {\n return [...contributions]\n .sort((left, right) => stableStringify({\n leftOwner: projectOwnerForDigest(left.owner),\n leftRef: left.ref,\n leftRuntimeImportPath: left.runtimeImportPath,\n leftSourceModuleId: left.sourceModuleId,\n leftTargets: left.runtimeTargets,\n }).localeCompare(stableStringify({\n rightOwner: projectOwnerForDigest(right.owner),\n rightRef: right.ref,\n rightRuntimeImportPath: right.runtimeImportPath,\n rightSourceModuleId: right.sourceModuleId,\n rightTargets: right.runtimeTargets,\n })))\n .map((contribution) => ({\n ref: contribution.ref,\n owner: projectOwnerForDigest(contribution.owner),\n runtimeImportPath: contribution.runtimeImportPath,\n runtimeTargets: contribution.runtimeTargets,\n engineCapabilities: [...contribution.engineCapabilities].sort(),\n providerCapabilities: [...contribution.providerCapabilities].sort(),\n protocols: [...contribution.protocols].sort(),\n secretsContractShape: contribution.secretsContractShape,\n frontendEntry: contribution.frontendEntry\n ? {\n metadata: contribution.frontendEntry.metadata,\n providerCapabilities: [...contribution.frontendEntry.providerCapabilities].sort(),\n protocols: [...contribution.frontendEntry.protocols].sort(),\n publicConfig: contribution.frontendEntry.publicConfig,\n }\n : undefined,\n sourceModuleId: contribution.sourceModuleId,\n }));\n}\n"]}
1
+ {"version":3,"file":"provider-runtime-artifacts.js","sourceRoot":"","sources":["../../../src/project-config/provider-runtime-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAQ,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,4CAA4C,EAC5C,sCAAsC,EACtC,mCAAmC,EACnC,iCAAiC,EACjC,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,GAK7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,kCAAkC,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AAC,cAAc;QACzC,YAAY,EAAE,KAAK,CAAC,cAAc;KACnC,CAAC,CAAC,CAAC;SACH,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACtB,GAAG,EAAE,YAAY,CAAC,GAAG;QACrB,KAAK,EAAE,qBAAqB,CAAC,YAAY,CAAC,KAAK,CAAC;QAChD,iBAAiB,EAAE,YAAY,CAAC,iBAAiB;QACjD,cAAc,EAAE,YAAY,CAAC,cAAc;QAC3C,kBAAkB,EAAE,CAAC,GAAG,YAAY,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE;QAC/D,oBAAoB,EAAE,CAAC,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE;QACnE,SAAS,EAAE,CAAC,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE;QAC7C,oBAAoB,EAAE,YAAY,CAAC,oBAAoB;QACvD,aAAa,EAAE,YAAY,CAAC,aAAa;YACvC,CAAC,CAAC;gBACA,QAAQ,EAAE,YAAY,CAAC,aAAa,CAAC,QAAQ;gBAC7C,oBAAoB,EAAE,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE;gBACjF,SAAS,EAAE,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE;gBAC3D,YAAY,EAAE,YAAY,CAAC,aAAa,CAAC,YAAY;aACtD;YACD,CAAC,CAAC,SAAS;QACb,cAAc,EAAE,YAAY,CAAC,cAAc;KAC5C,CAAC,CAAC,CAAC;AACR,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve as resolvePath } from 'node:path';\nimport { z } from 'zod';\nimport {\n AppFrontendType,\n assertFrontendProvidersServeOnlyDeclaredKeys,\n assertNoSecretValueInFrontendProviders,\n FRONTEND_PROVIDER_PUBLIC_CONFIG_KEY,\n FrontendProviderPublicConfigError,\n FrontendProvidersBlockSchema,\n overlayFrontendProviderPublicConfig,\n resolveProviderConnectionRef,\n type FrontendProviderEntry,\n type FrontendPublicConfigSecretValue,\n type ProviderSharedConnections,\n type FrontendProvidersBlock,\n} from '@wildo-ai/saas-models';\nimport {\n SaasLockfileProvidersSectionSchema,\n type SaasLockfileProvidersSection,\n type SaasLockfileRuntimeScopesProviders,\n} from '../lockfile/wildo-saas-lock.shared.schemas';\nimport {\n getDeclaredApplicationModuleIds,\n getServiceBoundApplicationModuleIds,\n} from './shared/application-modules.utils';\nimport type { ApplicationModules } from './shared/application-modules.schemas';\nimport {\n SaasProvidersScopesSchema,\n SaasProviderScopeSelectionSchema,\n type SaasProviderScopeSelection,\n type SaasProvidersScopes,\n type WildoSaasConfig,\n} from './define-saas-config';\nimport {\n ProviderContributionOwnerKind,\n readPackageVersion,\n resolveProviderBasePackage,\n selectOptedInProviderAugmentations,\n type AdmittedProviderPackage,\n type DiscoveredProviderAugmentation,\n type DiscoveredProviderCompanionContribution,\n describeProviderRefClaimedByMoreThanOneImportPath,\n readSystemOfRecordFacetModuleSpecifier,\n} from './provider-companion-discovery';\n\nexport const PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING =\n 'AUTO-GENERATED FILE. DO NOT EDIT. Regenerate with `wildo config sync`.';\n\nexport const PROVIDER_RUNTIME_ARTIFACT_GENERATOR = 'wildo provider-runtime-artifact';\n\n/**\n * Canonical relative paths (from saas root) for the per-runtime-kind\n * provider artifact JSON files emitted by `wildo config sync`.\n *\n * Moved from `.wildo-saas/providers/` → `.wildo-saas/generated/providers/`\n * on 2026-05-06 to group ALL CLI-generated runtime topology artifacts\n * under the `.wildo-saas/generated/` namespace (sibling to other\n * generated state). The legacy `.wildo-saas/providers/` location is\n * cleaned up by `cleanupLegacyProviderJsonArtifacts` in the CLI sync\n * so operators don't end up with two copies after the migration.\n */\nexport const PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS = {\n backend: '.wildo-saas/generated/providers/backend.runtime-providers.generated.json',\n companion: '.wildo-saas/generated/providers/companion.runtime-providers.generated.json',\n frontendServices: '.wildo-saas/generated/providers/frontend-services.runtime-providers.generated.json',\n minions: '.wildo-saas/generated/providers/minions.runtime-providers.generated.json',\n nodeWorkers: '.wildo-saas/generated/providers/node-workers.runtime-providers.generated.json',\n} as const;\n\n/**\n * Legacy paths (pre-2026-05-06) for the per-runtime-kind provider\n * artifact JSON files. These are NOT written anymore — kept here so\n * `wildo config sync` can clean them up if they exist on disk from a\n * pre-migration sync. Drop this constant entirely once Wonder Todos\n * + downstream apps have all run a post-migration sync at least once.\n */\nexport const LEGACY_PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS = {\n backend: '.wildo-saas/providers/backend.runtime-providers.generated.json',\n companion: '.wildo-saas/providers/companion.runtime-providers.generated.json',\n frontendServices: '.wildo-saas/providers/frontend-services.runtime-providers.generated.json',\n minions: '.wildo-saas/providers/minions.runtime-providers.generated.json',\n nodeWorkers: '.wildo-saas/providers/node-workers.runtime-providers.generated.json',\n} as const;\n\nexport type ProviderRuntimeArtifactKind = keyof typeof PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS;\n\nexport const PROVIDER_RUNTIME_GENERATED_MODULE_RELATIVE_PATH =\n 'src/generated/wildo-provider-runtime.generated.ts';\n\n/**\n * Canonical lockfile section path the provider-materialization\n * subsystem owns end-to-end. Used by the post-mutation provider sync\n * runner + materialization-hook return types and pinned by tests\n * (`provider-sync-runner.test.ts`, `provider-materialization-hook.test.ts`).\n *\n * Defined here as a single-source constant — used to live as a\n * literal in 3+ places across `wildo-module-client` (third-pass\n * review C-L1).\n */\nexport const PROVIDER_LOCK_SECTION_PATH = 'sections.providers.runtimeScopes' as const;\n\n/**\n * Per-worker generated env file written by `wildo config sync`. Carries\n * provider topology env vars derived from the materialized scope.\n *\n * This file is the **single delivery channel** non-Node workers (Rust /\n * Java / etc.) receive for provider topology — there is no executable\n * JS bundle in their case (Step 5b in\n * `.claude/plans/provider-migration-continuation.md`). Node workers\n * receive both this file and the per-package\n * `wildo-provider-runtime.generated.ts` source module; reading either\n * surface yields a consistent view because they share the same digest.\n *\n * The file is auto-generated and overwritten on every sync. Operator-\n * authored secrets and per-env config stay in the worker's `.env` (not\n * touched by `wildo config sync`); workers should load both files at\n * boot — operator vars from `.env` and provider vars from this file —\n * so the two channels never collide.\n */\nexport const PROVIDER_RUNTIME_GENERATED_ENV_FILE_NAME = '.wildo-providers.env';\n\nconst RuntimeProviderScopeArtifactSchema = z.strictObject({\n providers: z.record(z.string(), SaasProviderScopeSelectionSchema).default({}),\n selection: z.record(\n z.string(),\n z.strictObject({\n primary: z.string().min(1),\n whenUnavailable: z.array(z.string().min(1)).default([]),\n }),\n ).default({}),\n});\n\nconst RuntimeProviderModulesArtifactSchema = z.strictObject({\n declaredModules: z.record(\n z.string(),\n z.strictObject({\n services: z.array(z.string().min(1)),\n haveSamlIntegration: z.boolean().optional(),\n }),\n ).default({}),\n moduleIds: z.array(z.string().min(1)).default([]),\n moduleIdsByService: z.record(z.string(), z.array(z.string().min(1))).default({}),\n});\nexport type RuntimeProviderModulesArtifact = z.infer<typeof RuntimeProviderModulesArtifactSchema>;\n\n/**\n * The per-service frontend bootstrap map, keyed by frontend service key.\n *\n * ## It was an ANNOTATED interface until 2026-09-12, and the workaround is gone (#356)\n *\n * `FrontendProvidersBlockSchema` transitively references three atoms — `ProviderFrontendCspOriginBucket`,\n * `ProviderFrontendScriptCrossOrigin`, `ProviderFrontendSelectionDelivery` — that `@wildo-ai/saas-models`\n * published from `/public-runtime` ALONE. While this artifact object stayed small TypeScript inlined the\n * shape and nobody noticed; adding one member past the inline threshold made it reach for the NAME and\n * refuse, here and in `saas-backend-lib` at the same time:\n *\n * `TS2742 … cannot be named without a reference to\n * node_modules/@wildo-ai/saas-models/src/external-providers/provider-frontend-surface.shared.schemas`.\n *\n * #330 stopped the expansion with a locally declared interface, deliberately as a workaround: an\n * interface is written BY NAME in the emitted declaration where a type alias expands structurally and\n * takes the unnameable atoms with it. The boundary has since MOVED — the root barrel now exports that\n * module — so the atoms are nameable through the package root and the workaround has nothing left to do.\n *\n * Verified with the probe `package-public-entrypoints.md` prescribes rather than by re-running the\n * source-mapped packages: a consumer importing ONLY `@wildo-ai/saas-models`, deriving a record over\n * `FrontendProvidersBlockSchema`, compiled with `declaration: true`. It names all three atoms through\n * `import(\"@wildo-ai/saas-models\")` and reaches no relative `node_modules` path at all.\n */\nconst FrontendProviderBootstrapsSchema = z.record(z.string().min(1), FrontendProvidersBlockSchema);\n\n/**\n * One opted-in AUGMENTATION of a provider, as the host's loader needs it (#1672).\n *\n * `operationIds` is recorded so the loader can refuse a package whose installed code delivers a different set\n * from the one `wildo config sync` validated — a stale artifact, or a package upgraded without a resync —\n * instead of admitting operations nobody checked for collisions.\n *\n * `basePackageName` / `basePackageVersion` record which base the augmentation was composed against. Nothing\n * refuses on them here; declaring and enforcing a compatible base range is #1731's, and this is its seam.\n */\nexport const RuntimeProviderAugmentationArtifactSchema = z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1),\n runtimeImportPath: z.string().min(1),\n operationIds: z.array(z.string().min(1)).min(1),\n /**\n * Every vendor scope the augmentation's operations declare (#1671) — recorded so the loader can refuse installed code\n * that needs scopes sync never validated, and so a connection asks a person to consent only to what an opted-in\n * package declared. Absent when it declares none.\n */\n requiredScopes: z.array(z.string().min(1)).min(1).optional(),\n basePackageName: z.string().min(1).optional(),\n basePackageVersion: z.string().min(1).optional(),\n});\nexport type RuntimeProviderAugmentationArtifact = z.infer<typeof RuntimeProviderAugmentationArtifactSchema>;\n\nexport const SaasRuntimeProvidersArtifactSchema = z.strictObject({\n __AUTOGENERATED__: z.literal(PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING),\n generatedBy: z.literal(PROVIDER_RUNTIME_ARTIFACT_GENERATOR),\n generatedAt: z.string().datetime({ offset: true }),\n sourceDigest: z.string().min(1),\n providerRefs: z.array(z.string().min(1)).default([]),\n /**\n * `providerRef` -> the package specifier a host dynamic-imports to obtain that provider's backend\n * module (#330).\n *\n * `providerRefs` says WHICH providers a process may expose; this says WHERE each one comes from,\n * and it is what makes a provider shipped as its own npm package loadable at all. Derived from\n * the discovered contribution whose `runtimeTargets` match the host — never authored.\n *\n * Optional, so an artifact written before this field existed still parses. Every ref such an\n * artifact names is engine-shipped, and a host resolves those from the engine's own on-demand map\n * without consulting this record, so an un-resynced application is unaffected.\n */\n providerRuntimeImports: z.record(z.string().min(1), z.string().min(1)).optional(),\n /**\n * Package specifiers that ship SYSTEM-OF-RECORD VENDOR FACETS, in discovery order (#1057).\n *\n * A list rather than a `vendor -> specifier` map, because a facet module contributes a RECORD of\n * vendors rather than one module per vendor: a map would restate the record's own keys in a\n * generated artifact read by a different process, free to disagree with it. The backend imports\n * each specifier in order and takes the first that answers for the vendor.\n *\n * Discovered from the MANIFEST — a package declaring an `./systems-of-record` export — never from\n * loading it. Sync has no business evaluating a vendor facet, and the manifest is the same door\n * `./companion` is found through.\n */\n systemOfRecordFacetModules: z.array(z.string().min(1)).optional(),\n /**\n * `baseRef` -> the opted-in augmentations the host applies to that provider, sorted by package name (#1672).\n *\n * Only refs in this artifact's scope, and only packages the application names under\n * `providers.augmentations` — an installed augmentation that is not opted in never appears here, and the\n * loader applies nothing this map does not name. Absent when nothing is augmented, which keeps every\n * artifact of an application without augmentations byte-identical to what it was.\n */\n providerRuntimeAugmentations: z.record(z.string().min(1), z.array(RuntimeProviderAugmentationArtifactSchema).min(1)).optional(),\n providerGraphDigest: z.string().min(1),\n lockfileSectionDigest: z.string().min(1),\n artifactKind: z.enum([\n 'backend',\n 'companion',\n 'frontendServices',\n 'minions',\n 'nodeWorkers',\n ]),\n modules: RuntimeProviderModulesArtifactSchema,\n scope: RuntimeProviderScopeArtifactSchema.optional(),\n scopes: z.record(z.string(), RuntimeProviderScopeArtifactSchema).optional(),\n frontendProviderBootstraps: FrontendProviderBootstrapsSchema.optional(),\n});\nexport type SaasRuntimeProvidersArtifact = z.infer<typeof SaasRuntimeProvidersArtifactSchema>;\n\nexport interface MaterializedSaasProviderRuntimeArtifacts {\n artifacts: Partial<Record<ProviderRuntimeArtifactKind, SaasRuntimeProvidersArtifact>>;\n lockSection: SaasLockfileProvidersSection;\n}\n\nexport function materializeSaasProviderRuntimeArtifacts(\n // `providerConfigurations` is where an application supplies a frontend provider's public keys\n // (#394 P3). Optional here so the lockfile check and every existing caller that narrows the\n // config keep compiling; absent means \"the application configured nothing\", never a refusal.\n config: Pick<WildoSaasConfig, 'modules' | 'providers' | 'services'> & Partial<Pick<WildoSaasConfig, 'providerConfigurations'>>,\n options?: {\n generatedAt?: string;\n nodeWorkerKeys?: string[];\n discoveredContributions?: DiscoveredProviderCompanionContribution[];\n /**\n * The augmentations discovery found (#1672). Filtered HERE against `config.providers.augmentations` as well\n * as by the validating walk, so an artifact can never be built from an unfiltered list: an installed\n * augmentation that is not opted in contributes nothing whichever caller passed it.\n */\n discoveredAugmentations?: readonly DiscoveredProviderAugmentation[];\n /**\n * The facet modules the discovery WALK found (#1675) — `ValidatedSaasProviderDiscovery.systemOfRecordFacetModules`.\n * Absent, they are derived from the contributions' package roots, which cannot see a package that ships\n * facets or facet augmentations and no provider; every `wildo` caller passes the walk's answer.\n */\n discoveredSystemOfRecordFacetModules?: readonly string[];\n /**\n * The packages `providers.packages` admitted (#1676) — `ValidatedSaasProviderDiscovery.admittedProviderPackages`.\n * Recorded in the lock section (`admittedPackages`) so a lock diff shows third-party code entering discovery;\n * every `wildo` caller passes the walk's answer, or `lock check` and `config sync` would disagree.\n */\n admittedProviderPackages?: readonly AdmittedProviderPackage[];\n },\n): MaterializedSaasProviderRuntimeArtifacts {\n const scopes = SaasProvidersScopesSchema.parse(config.providers.scopes);\n const generatedAt = options?.generatedAt ?? new Date().toISOString();\n const modules = materializeModules(config);\n const frontendServiceTypes: Record<string, AppFrontendType> = Object.fromEntries(\n Object.entries(config.services ?? {})\n .filter(([, definition]) => definition.frontendType !== undefined)\n .map(([serviceKey, definition]) => [serviceKey, definition.frontendType as AppFrontendType]),\n );\n // Backend requests carry public service names; build-time consumers use declaration keys.\n // Validate before publication so two scopes can never silently overwrite one another.\n const frontendServiceNames: Record<string, string> = {};\n const publicNames = new Set<string>();\n for (const serviceKey of Object.keys(frontendServiceTypes)) {\n const name = config.services[serviceKey]?.serviceName;\n if (!name?.trim() || publicNames.has(name)) {\n throw new Error(`Frontend service \"${serviceKey}\" needs a unique non-empty public serviceName; received \"${name ?? ''}\".`);\n }\n publicNames.add(name);\n frontendServiceNames[serviceKey] = name;\n }\n const discoveryContext = buildProviderRuntimeDiscoveryContext({\n discoveredContributions: options?.discoveredContributions,\n discoveredAugmentations: selectOptedInProviderAugmentations(config, options?.discoveredAugmentations ?? []),\n frontendServiceTypes,\n sharedConnections: config.providers.sharedConnections,\n ...(options?.discoveredSystemOfRecordFacetModules !== undefined ? { systemOfRecordFacetModules: options.discoveredSystemOfRecordFacetModules } : {}),\n });\n\n const admittedPackages = [...(options?.admittedProviderPackages ?? [])]\n .sort((left, right) => left.packageName.localeCompare(right.packageName));\n const lockSection = SaasLockfileProvidersSectionSchema.parse({\n runtimeScopes: materializeLockRuntimeScopes({\n scopes,\n discoveryContext,\n }),\n // Absent when nothing is listed, so the lock of every application without a listing is byte-identical (#1676).\n ...(admittedPackages.length > 0 ? { admittedPackages } : {}),\n\n });\n const artifactMetadata = buildArtifactMetadata({\n discoveryContext,\n frontendServiceTypes,\n frontendServiceNames,\n lockSection,\n modules,\n nodeWorkerKeys: options?.nodeWorkerKeys,\n scopes,\n providerConfigurations: config.providerConfigurations ?? {},\n });\n\n const artifacts = materializeRuntimeArtifacts({\n artifactMetadata,\n discoveryContext,\n frontendServiceTypes,\n frontendServiceNames,\n generatedAt,\n modules,\n nodeWorkerKeys: options?.nodeWorkerKeys,\n scopes,\n providerConfigurations: config.providerConfigurations ?? {},\n });\n\n return { artifacts, lockSection };\n}\n\nexport function selectScopedProviderRuntimeArtifact(\n artifact: SaasRuntimeProvidersArtifact,\n scopeKey: string,\n): SaasRuntimeProvidersArtifact {\n if (!artifact.scopes) {\n throw new Error(`Provider runtime artifact '${artifact.artifactKind}' does not contain keyed scopes.`);\n }\n\n const scope = artifact.scopes[scopeKey];\n if (!scope) {\n throw new Error(`Provider runtime artifact '${artifact.artifactKind}' does not contain scope '${scopeKey}'.`);\n }\n\n // Recompute `providerRefs` from the projected per-host scope rather\n // than carrying the parent multi-scope union forward unchanged. The\n // multi-scope artifact's `providerRefs` is the union across all\n // hosts (`buildMultiScopeArtifactMetadata`); preserving that union\n // on a single-scope projection makes the per-host artifact internally\n // inconsistent — `scope.providers` would describe one host while\n // `providerRefs` would describe siblings too. The boot-time\n // `assertProviderRuntimeEnvInSync` guard treats `providerRefs.length > 0`\n // as \"this host has providers to reconcile\" — without this\n // recomputation, an empty-scope host would inherit the union and\n // trip the env-missing guard even though its `.wildo-providers.env`\n // was deliberately not written. Recomputation also tightens\n // `BackendProviderRegistry`'s filter (today defended by an empty-list\n // fallback) so the per-host artifact accurately advertises only the\n // refs it should resolve.\n const projectedProviderRefs = Object.keys(scope.providers).sort();\n\n return SaasRuntimeProvidersArtifactSchema.parse({\n ...artifact,\n providerRefs: projectedProviderRefs,\n // Narrowed for the same reason `providerRefs` is recomputed above: the multi-scope artifact's\n // import map is the union across every host, and a per-host projection that advertised a\n // sibling's packages would tell this host it can load something it never declared.\n providerRuntimeImports: Object.fromEntries(\n Object.entries(artifact.providerRuntimeImports ?? {})\n .filter(([providerRef]) => projectedProviderRefs.includes(providerRef)),\n ),\n // Narrowed for the same reason: a host applies augmentations only to the providers IT declares (#1672).\n providerRuntimeAugmentations: narrowRuntimeAugmentations(artifact.providerRuntimeAugmentations, projectedProviderRefs),\n frontendProviderBootstraps: artifact.frontendProviderBootstraps?.[scopeKey]\n ? { [scopeKey]: artifact.frontendProviderBootstraps[scopeKey] }\n : undefined,\n scope,\n scopes: undefined,\n });\n}\n\n/**\n * The augmentation map restricted to the given refs, or `undefined` when none remain — so a per-host projection\n * of an artifact that augments only a sibling's provider carries no field at all.\n */\nexport function narrowRuntimeAugmentations(\n augmentations: SaasRuntimeProvidersArtifact['providerRuntimeAugmentations'],\n providerRefs: readonly string[],\n): SaasRuntimeProvidersArtifact['providerRuntimeAugmentations'] {\n const narrowed = Object.entries(augmentations ?? {}).filter(([providerRef]) => providerRefs.includes(providerRef));\n return narrowed.length === 0 ? undefined : Object.fromEntries(narrowed);\n}\n\n/**\n * Resolve the absolute path to the canonical\n * `frontend-services.runtime-providers.generated.json` artifact under\n * `<saasRoot>/.wildo-saas/generated/providers/`.\n *\n * Build-time consumers (Wonder Todos website + tech-doc) call this\n * instead of hardcoding the relative path so the artifact location\n * stays canonical (single source of truth is\n * `PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS`).\n */\nexport function resolveFrontendServicesArtifactPath(saasRoot: string): string {\n return resolvePath(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.frontendServices);\n}\n\n/**\n * Read + project the materialized frontend-services artifact for the\n * given service key. Returns `undefined` if the artifact file is\n * missing (sync hasn't run yet / clean checkout) or if the service\n * has no provider bootstrap entry.\n *\n * The single source of truth for build-time loading of the frontend\n * provider bootstraps. Replaces the (previously duplicated)\n * `loadMaterializedFrontendProviders` helpers that lived in\n * `saas-technical-doc/src/build/load-materialized-frontend-providers.ts`\n * and inline in `examples/wonder-todos/website/src/website-site-context.ts`.\n *\n * Both consumers used identical control flow:\n * 1. existsSync() short-circuit\n * 2. JSON.parse + SaasRuntimeProvidersArtifactSchema.parse\n * 3. frontendProviderBootstraps[serviceKey] lookup\n * 4. FrontendProvidersBlockSchema.parse on the per-service block\n * Centralized 2026-05-06 so a future schema/path change only\n * requires editing this function.\n */\nexport function loadMaterializedFrontendProviders(input: {\n artifactPath: string;\n serviceKey: string;\n}): FrontendProvidersBlock | undefined {\n const { artifactPath, serviceKey } = input;\n\n if (!existsSync(artifactPath)) {\n return undefined;\n }\n\n const parsedArtifact = SaasRuntimeProvidersArtifactSchema.safeParse(\n JSON.parse(readFileSync(artifactPath, 'utf8')),\n );\n if (!parsedArtifact.success) {\n throw staleGeneratedArtifactError(artifactPath, parsedArtifact.error.issues);\n }\n const providerBlock = parsedArtifact.data.frontendProviderBootstraps?.[serviceKey];\n if (providerBlock === undefined) return undefined;\n\n const parsedBlock = FrontendProvidersBlockSchema.safeParse(providerBlock);\n if (!parsedBlock.success) {\n throw staleGeneratedArtifactError(artifactPath, parsedBlock.error.issues);\n }\n // The website and documentation builds bake this block into pages served to every visitor (and\n // `wildo dev sync-csp` composes their policy from it), and nothing re-runs the overlay here (#1705).\n // An artifact a sync wrote before a schema was mandatory carries entries with no key list that no gate\n // ever held — so the reader refuses it and names the remedy rather than publishing it. The secret-VALUE\n // screen ran when the artifact was written, by its one writer; a build has no environment secrets.\n assertFrontendProvidersServeOnlyDeclaredKeys({\n producer: `Reading ${artifactPath} for frontend service \"${serviceKey}\"`,\n providers: parsedBlock.data.providers,\n });\n return parsedBlock.data;\n}\n\n/**\n * A materialized artifact that does not satisfy the current schema was almost always generated\n * before the contract changed (#328 added the provider identity to every frontend entry). A raw\n * Zod issue list reads as a logic defect in the consumer; the remedy is regeneration, so the\n * error names it. The backend's `applyProviderRuntime` says the same thing for its own reader —\n * one message, two readers.\n */\nfunction staleGeneratedArtifactError(artifactPath: string, issues: ReadonlyArray<{ path: PropertyKey[]; message: string }>): Error {\n return new Error(\n `The generated provider runtime artifact at ${artifactPath} does not satisfy the current contract — it was most `\n + 'likely generated before the contract changed. Regenerate it with `wildo config sync`. Issues: '\n + issues.map((issue) => `${issue.path.map(String).join('.')}: ${issue.message}`).join('; '),\n );\n}\n\nexport function renderProviderRuntimeGeneratedModule(\n artifact: SaasRuntimeProvidersArtifact,\n): string {\n const artifactLiteral = JSON.stringify(artifact, null, 2);\n\n return [\n '/**',\n ` * ${PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING}`,\n ' *',\n ' * This module is generated from wildo.saas.config.ts by `wildo config sync`.',\n ' * It contains environment-independent provider topology only.',\n ' */',\n '',\n // Intentionally NOT `as const` — the generated artifact is *data*, not a\n // frozen literal-typed tuple. Each host (backend / companion / minion /\n // worker) casts the imported value to its own narrowed runtime-artifact\n // type (`ProviderRuntimeArtifact`, `MinionProviderRuntimeArtifact`, …).\n // `as const` would infer `readonly` tuples (e.g. `readonly [\"openai\"]`)\n // that fail TS2352 against the schema-inferred mutable `string[]` shape.\n // Contract conformance is enforced upstream by\n // `SaasRuntimeProvidersArtifactSchema.parse(...)` at materialization time,\n // so widening the TS surface here costs no runtime safety.\n `export const WILDO_PROVIDER_RUNTIME = ${artifactLiteral};`,\n '',\n 'export default WILDO_PROVIDER_RUNTIME;',\n '',\n ].join('\\n');\n}\n\n/**\n * Canonical worker provider env-var keys. All workers receive the same\n * three keys regardless of language; the values are stable across runs\n * as long as the authored scope and discovered contributions don't\n * change.\n *\n * - `WILDO_PROVIDER_REFS` — comma-separated list of authored refs (sorted).\n * Cheap to read from any language (no JSON parser needed).\n * - `WILDO_PROVIDER_TOPOLOGY_JSON` — the per-worker `scope` block from\n * the materialized artifact, JSON-encoded. Workers that want\n * structured access (capability/protocol set) parse this; workers\n * that only need ref membership read `WILDO_PROVIDER_REFS`.\n * - `WILDO_PROVIDER_RUNTIME_DIGEST` — the artifact's `sourceDigest`.\n * Workers can fail-closed at boot if their copy of the env-file\n * disagrees with the lockfile section digest the platform expects.\n */\nexport const PROVIDER_RUNTIME_ENV_KEYS = {\n REFS: 'WILDO_PROVIDER_REFS',\n TOPOLOGY_JSON: 'WILDO_PROVIDER_TOPOLOGY_JSON',\n RUNTIME_DIGEST: 'WILDO_PROVIDER_RUNTIME_DIGEST',\n} as const;\n\n/**\n * Render the per-worker provider env-file body. Inputs:\n * - `scope` — the per-worker scope block from\n * `WildoSaasConfig.providers.scopes.workers[<workerKey>]`. Carries\n * the authored providers + capability/protocol declarations that\n * this worker needs to resolve at runtime.\n * - `sourceDigest` — `SaasRuntimeProvidersArtifact.sourceDigest`\n * (from the lockfile or the corresponding generated artifact).\n *\n * Output: a deterministic dotenv body — sorted refs, stable JSON\n * key ordering — so re-running `wildo config sync` with no upstream\n * changes produces a byte-identical file.\n */\nexport function renderProviderRuntimeEnvFile(input: {\n scope: SaasProviderScopeSelections;\n sourceDigest: string;\n}): string {\n const refs = Object.keys(input.scope.providers).sort();\n const topology: Record<string, {\n engineCapabilities: string[];\n providerCapabilities: string[];\n protocols: string[];\n }> = {};\n for (const ref of refs) {\n const selection = input.scope.providers[ref];\n topology[ref] = {\n engineCapabilities: [...selection.engineCapabilities].sort(),\n providerCapabilities: [...selection.providerCapabilities].sort(),\n protocols: [...selection.protocols].sort(),\n };\n }\n\n return [\n `# ${PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING}`,\n '#',\n '# This file is regenerated on every `wildo config sync`. Do not edit by hand.',\n '# Operator-authored secrets / per-env config stay in `.env` and are never touched here.',\n '',\n `${PROVIDER_RUNTIME_ENV_KEYS.REFS}=${refs.join(',')}`,\n `${PROVIDER_RUNTIME_ENV_KEYS.TOPOLOGY_JSON}=${JSON.stringify(topology)}`,\n `${PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST}=${input.sourceDigest}`,\n '',\n ].join('\\n');\n}\n\n/**\n * Result of comparing the runtime host's typed\n * `wildo-provider-runtime.generated.ts` module against its\n * `.wildo-providers.env` file at boot.\n *\n * Drift between the two indicates the operator regenerated one surface\n * but not the other — typically: edited `wildo.saas.config.ts` and\n * re-ran `wildo config sync` while the env file was cached, or vice\n * versa. Either case the runtime would silently boot with mismatched\n * topology unless someone reconciles. See\n * `assertProviderRuntimeEnvInSync` for the fail-closed assertion.\n */\nexport type ProviderRuntimeEnvReconciliationResult =\n | { kind: 'in-sync' }\n | { kind: 'env-missing'; missingKeys: ReadonlyArray<string> }\n | {\n kind: 'refs-mismatch';\n envRefs: ReadonlyArray<string>;\n artifactRefs: ReadonlyArray<string>;\n }\n | {\n kind: 'digest-mismatch';\n envDigest: string;\n artifactDigest: string;\n };\n\n/**\n * Reconcile a runtime artifact's typed projection against the\n * `.wildo-providers.env` mounted into the same process. Pure function\n * so callers can decide how to surface the result (throw / log / ignore).\n *\n * The env file is materialized by `renderProviderRuntimeEnvFile` for\n * EVERY runtime host that is a minion or worker; the typed module is\n * imported by the same hosts. Both should agree on\n * `(providerRefs, sourceDigest)` exactly. Drift means stale sync.\n *\n * Hosts that don't receive an env file (backend, companion, frontend\n * services per `provider-runtime-sync.service.ts`) MUST NOT call this —\n * `WILDO_PROVIDER_*` keys won't be set and every call returns\n * `env-missing`.\n */\nexport function reconcileProviderRuntimeEnv(input: {\n artifactProviderRefs: ReadonlyArray<string>;\n artifactSourceDigest: string;\n env?: NodeJS.ProcessEnv;\n}): ProviderRuntimeEnvReconciliationResult {\n const env = input.env ?? process.env;\n const envRefsRaw = env[PROVIDER_RUNTIME_ENV_KEYS.REFS];\n const envDigest = env[PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST];\n\n const missingKeys: string[] = [];\n if (envRefsRaw === undefined) missingKeys.push(PROVIDER_RUNTIME_ENV_KEYS.REFS);\n if (envDigest === undefined) missingKeys.push(PROVIDER_RUNTIME_ENV_KEYS.RUNTIME_DIGEST);\n if (missingKeys.length > 0) {\n return { kind: 'env-missing', missingKeys };\n }\n\n // Filter empty entries so trailing-comma input (e.g. `'openai,'`) or\n // operator-edited stray whitespace don't produce confusing `''`\n // entries in mismatch diagnostics. Materializer never emits trailing\n // commas, but defense-in-depth keeps the helper robust to anything\n // that lands the env file via dotenv loaders or hand-edits.\n const envRefs = envRefsRaw!\n .split(',')\n .map((s) => s.trim())\n .filter((s) => s.length > 0)\n .sort();\n const artifactRefs = [...input.artifactProviderRefs].sort();\n\n if (envRefs.length !== artifactRefs.length || envRefs.some((ref, i) => ref !== artifactRefs[i])) {\n return { kind: 'refs-mismatch', envRefs, artifactRefs };\n }\n\n if (envDigest !== input.artifactSourceDigest) {\n return {\n kind: 'digest-mismatch',\n envDigest: envDigest!,\n artifactDigest: input.artifactSourceDigest,\n };\n }\n\n return { kind: 'in-sync' };\n}\n\n/**\n * Fail-closed wrapper around `reconcileProviderRuntimeEnv`. Throws on\n * any divergence, returns silently when in sync. Designed to be called\n * once at runtime-host boot (minion / Node-worker startup) so a stale\n * `.wildo-providers.env` surfaces immediately instead of being masked\n * by `process.env` drift.\n *\n * Throws a plain `Error` (not `WildoError_Backend`) because this runs\n * BEFORE the DI container has built the error builder — the failure\n * mode here is \"the container can't be trusted to boot at all\".\n */\nexport function assertProviderRuntimeEnvInSync(input: {\n artifactProviderRefs: ReadonlyArray<string>;\n artifactSourceDigest: string;\n hostKind: 'minion' | 'node-worker';\n hostKey: string;\n env?: NodeJS.ProcessEnv;\n}): void {\n const result = reconcileProviderRuntimeEnv(input);\n switch (result.kind) {\n case 'in-sync':\n return;\n case 'env-missing':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' booted without `\n + `provider env vars (${result.missingKeys.join(', ')}). The `\n + `\\`.wildo-providers.env\\` file should be mounted into this process — check `\n + `the docker-compose \\`env_file:\\` directive, the K8s ConfigMap mount, or the `\n + `dotenv loader. Re-run \\`wildo config sync\\` to regenerate if missing.`,\n );\n case 'refs-mismatch':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' detected stale provider topology. `\n + `\\`.wildo-providers.env\\` advertises refs [${result.envRefs.join(', ')}] but the `\n + `imported \\`wildo-provider-runtime.generated.ts\\` module declares `\n + `[${result.artifactRefs.join(', ')}]. Run \\`wildo config sync\\` to regenerate `\n + `both surfaces from the same \\`wildo.saas.config.ts\\` source.`,\n );\n case 'digest-mismatch':\n throw new Error(\n `[provider-runtime-env] ${input.hostKind} '${input.hostKey}' detected provider runtime digest drift. `\n + `\\`.wildo-providers.env\\` carries digest '${result.envDigest}' but the imported `\n + `\\`wildo-provider-runtime.generated.ts\\` module carries '${result.artifactDigest}'. `\n + `Refs match, but per-provider capabilities/protocols may differ. `\n + `Run \\`wildo config sync\\` to regenerate.`,\n );\n }\n}\n\ntype SaasProviderScopeSelections = {\n providers: Record<string, {\n engineCapabilities: ReadonlyArray<string>;\n providerCapabilities: ReadonlyArray<string>;\n protocols: ReadonlyArray<string>;\n }>;\n};\n\nfunction materializeRuntimeArtifacts(input: {\n frontendServiceNames: Record<string, string>;\n artifactMetadata: ProviderRuntimeArtifactMetadataByKind;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n frontendServiceTypes: Record<string, AppFrontendType>;\n generatedAt: string;\n modules: RuntimeProviderModulesArtifact;\n nodeWorkerKeys?: string[];\n scopes: SaasProvidersScopes;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): MaterializedSaasProviderRuntimeArtifacts['artifacts'] {\n const { artifactMetadata, discoveryContext, frontendServiceTypes, generatedAt, modules, nodeWorkerKeys, scopes, providerConfigurations } = input;\n const nodeWorkerKeySet = nodeWorkerKeys ? new Set(nodeWorkerKeys) : undefined;\n const nodeWorkerScopes = scopes.workers\n ? Object.fromEntries(\n Object.entries(scopes.workers).filter(([workerKey]) =>\n nodeWorkerKeySet ? nodeWorkerKeySet.has(workerKey) : true,\n ),\n )\n : undefined;\n\n const backendBootstraps = materializeFrontendProviderBootstraps({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n });\n\n return pruneUndefined({\n backend: materializeRuntimeArtifactFile({\n artifactKind: 'backend',\n generatedAt,\n modules,\n metadata: artifactMetadata.backend,\n // Only the HTTP-facing backend map uses public names. Static artifacts below\n // deliberately retain declaration keys for build-time scope selection.\n frontendProviderBootstraps: backendBootstraps && Object.fromEntries(\n Object.entries(backendBootstraps).map(([serviceKey, block]) => [input.frontendServiceNames[serviceKey]!, block]),\n ),\n scope: materializeRuntimeScope(scopes.backend ?? { providers: {}, selection: {} }),\n }),\n companion: materializeRuntimeArtifactFile({\n artifactKind: 'companion',\n generatedAt,\n modules,\n metadata: artifactMetadata.companion,\n scope: materializeRuntimeScope(scopes.companion ?? { providers: {}, selection: {} }),\n }),\n frontendServices: scopes.frontendServices\n ? materializeRuntimeArtifactFile({\n artifactKind: 'frontendServices',\n generatedAt,\n modules,\n metadata: artifactMetadata.frontendServices,\n frontendProviderBootstraps: materializeFrontendProviderBootstraps({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices,\n frontendServiceTypes,\n providerConfigurations,\n }),\n scopes: mapRecord(scopes.frontendServices, materializeRuntimeScope),\n })\n : undefined,\n minions: scopes.minions\n ? materializeRuntimeArtifactFile({\n artifactKind: 'minions',\n generatedAt,\n modules,\n metadata: artifactMetadata.minions,\n scopes: mapRecord(scopes.minions, materializeRuntimeScope),\n })\n : undefined,\n nodeWorkers: nodeWorkerScopes && Object.keys(nodeWorkerScopes).length > 0\n ? materializeRuntimeArtifactFile({\n artifactKind: 'nodeWorkers',\n generatedAt,\n modules,\n metadata: artifactMetadata.nodeWorkers,\n scopes: mapRecord(nodeWorkerScopes, materializeRuntimeScope),\n })\n : undefined,\n });\n}\n\nfunction materializeRuntimeArtifactFile(input: {\n artifactKind: ProviderRuntimeArtifactKind;\n generatedAt: string;\n metadata: ProviderRuntimeArtifactMetadata;\n modules: RuntimeProviderModulesArtifact;\n frontendProviderBootstraps?: Record<string, FrontendProvidersBlock>;\n scope?: z.infer<typeof RuntimeProviderScopeArtifactSchema>;\n scopes?: Record<string, z.infer<typeof RuntimeProviderScopeArtifactSchema>>;\n}): SaasRuntimeProvidersArtifact {\n return SaasRuntimeProvidersArtifactSchema.parse({\n __AUTOGENERATED__: PROVIDER_RUNTIME_ARTIFACT_AUTOGENERATED_WARNING,\n generatedBy: PROVIDER_RUNTIME_ARTIFACT_GENERATOR,\n generatedAt: input.generatedAt,\n sourceDigest: input.metadata.sourceDigest,\n providerRefs: input.metadata.providerRefs,\n providerRuntimeImports: input.metadata.providerRuntimeImports,\n systemOfRecordFacetModules: input.metadata.systemOfRecordFacetModules,\n providerRuntimeAugmentations: input.metadata.providerRuntimeAugmentations,\n providerGraphDigest: input.metadata.providerGraphDigest,\n lockfileSectionDigest: input.metadata.lockfileSectionDigest,\n artifactKind: input.artifactKind,\n modules: input.modules,\n scope: input.scope,\n scopes: input.scopes,\n frontendProviderBootstraps: input.frontendProviderBootstraps,\n });\n}\n\nfunction materializeRuntimeScope(scope: NonNullable<SaasProvidersScopes['backend']>) {\n return RuntimeProviderScopeArtifactSchema.parse({\n providers: scope.providers,\n selection: scope.selection ?? {},\n });\n}\n\nfunction materializeFrontendProviderBootstraps(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n frontendServiceScopes: NonNullable<SaasProvidersScopes['frontendServices']>;\n frontendServiceTypes: Record<string, AppFrontendType>;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): Record<string, FrontendProvidersBlock> | undefined {\n const { discoveredContributions, frontendServiceScopes, frontendServiceTypes, providerConfigurations } = input;\n const entries = Object.entries(frontendServiceScopes).map(([serviceKey, scope]) => {\n const serviceType = frontendServiceTypes[serviceKey];\n if (!serviceType) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `service has no frontendType — only services with a frontendType may appear under providers.scopes.frontendServices.`,\n );\n }\n const providers = Object.fromEntries(Object.keys(scope.providers).map((providerRef) => {\n const matchingContribution = discoveredContributions.filter(\n (contribution) =>\n contribution.ref === providerRef\n && contribution.runtimeTargets.some(\n (target) => target.kind === 'frontendService' && target.serviceType === serviceType,\n ),\n );\n\n if (matchingContribution.length === 0) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\" (type \"${serviceType}\"): ` +\n `provider \"${providerRef}\" has no discovered frontend companion contribution.`,\n );\n }\n\n if (matchingContribution.some((contribution) => !contribution.frontendEntry)) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `provider \"${providerRef}\" is missing frontendEntry on at least one discovered contribution.`,\n );\n }\n\n if (matchingContribution.length > 1) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ` +\n `provider \"${providerRef}\" is contributed more than once for the same runtime.`,\n );\n }\n\n return [\n providerRef,\n applyApplicationPublicConfig({\n serviceKey,\n providerRef,\n entry: matchingContribution[0].frontendEntry as FrontendProviderEntry,\n supplied: providerConfigurations[providerRef]?.[FRONTEND_PROVIDER_PUBLIC_CONFIG_KEY],\n discoveredContributions,\n }),\n ] as const;\n }));\n\n return [serviceKey, FrontendProvidersBlockSchema.parse({ providers })] as const;\n });\n\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n}\n\n/**\n * Overlays what the application supplied under `providerConfigurations[ref].frontend_sdk` onto the\n * module's authored `publicConfig` (#394 P3) — the FIRST of the two sites that produce a\n * `FrontendProviderEntry` from a module; the backend fallback is the other, and both call the one\n * function in `saas-models` so they cannot disagree about what crosses.\n *\n * The forbidden set is built from the SAME vendor's non-frontend contributions: a frontend provider\n * owns no secrets (`secretsContractShape: []` by construction), so the only secret NAMES that could\n * be typed into its bag are the backend module's, and those are exactly what this walk has in hand.\n *\n * Runs for EVERY entry, supplied or not (#1705): the overlay is also where an entry with no readable\n * key list is refused and where the module's own and any contribution-mapped keys are held to that\n * list. Returning early when nothing was supplied skipped both. Secret VALUES are not compared here —\n * this walk holds no secrets — but by the one publisher of these artifacts before it writes them\n * ({@link assertFrontendProviderBootstrapsCarryNoSecretValue}).\n */\nfunction applyApplicationPublicConfig(input: {\n serviceKey: string;\n providerRef: string;\n entry: FrontendProviderEntry;\n supplied: unknown;\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n}): FrontendProviderEntry {\n const { serviceKey, providerRef, entry, supplied, discoveredContributions } = input;\n\n const forbiddenKeys = new Set(\n discoveredContributions\n .filter((contribution) =>\n contribution.ref === providerRef\n && contribution.runtimeTargets.some((target) => target.kind !== 'frontendService'))\n .flatMap((contribution) => contribution.secretsContractShape.flatMap((slot) => [slot.slug, slot.envVarName])),\n );\n\n try {\n const publicConfig = overlayFrontendProviderPublicConfig({\n providerRef,\n authored: entry.publicConfig,\n supplied,\n declaredKeys: entry.publicConfigKeys,\n forbiddenKeys,\n });\n return publicConfig === undefined || publicConfig === entry.publicConfig ? entry : { ...entry, publicConfig };\n } catch (error) {\n if (error instanceof FrontendProviderPublicConfigError) {\n throw new Error(\n `Cannot materialize frontend bootstrap for service \"${serviceKey}\": ${error.message}`,\n );\n }\n throw error;\n }\n}\n\n/**\n * Refuses a set of materialized provider runtime artifacts when any frontend provider they would\n * SERVE carries one of the environment's secret values (#1705).\n *\n * Walks every `frontendProviderBootstraps` block of every artifact kind — the backend artifact (whose\n * blocks the backend serves on `/application-config` and bakes into its generated module) and the\n * frontend-services artifact (which the website and documentation builds read) — so no served copy is\n * screened while another is not. The comparison itself is the shared\n * `assertNoSecretValueInFrontendProviders`, which the backend runs over what it serves too.\n *\n * Its one caller is the one writer of these artifacts, `wildo config sync`, and it must run BEFORE\n * anything is written: a refused artifact that already reached disk would be picked up by a watcher\n * and served.\n */\nexport function assertFrontendProviderBootstrapsCarryNoSecretValue(input: {\n readonly artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'];\n readonly secrets: readonly FrontendPublicConfigSecretValue[];\n readonly producer: string;\n}): void {\n for (const artifact of Object.values(input.artifacts)) {\n for (const [serviceKey, block] of Object.entries(artifact?.frontendProviderBootstraps ?? {})) {\n assertNoSecretValueInFrontendProviders({\n producer: `${input.producer} (${artifact!.artifactKind} artifact, frontend service \"${serviceKey}\")`,\n providers: block.providers,\n secrets: input.secrets,\n });\n }\n }\n}\n\n/** Whether any materialized artifact would serve a frontend provider at all — the only case that needs secrets to screen. */\nexport function materializedArtifactsServeFrontendProviders(\n artifacts: MaterializedSaasProviderRuntimeArtifacts['artifacts'],\n): boolean {\n return Object.values(artifacts).some((artifact) =>\n Object.values(artifact?.frontendProviderBootstraps ?? {}).some((block) => Object.keys(block.providers).length > 0));\n}\n\nfunction buildFrontendProviderBootstrapDigestInput(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n frontendServiceScopes: NonNullable<SaasProvidersScopes['frontendServices']>;\n frontendServiceTypes: Record<string, AppFrontendType>;\n // In the digest on purpose: an application changing a picker's `appId` changes the served\n // artifact, and a digest that did not move would report the old artifact as current.\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): Record<string, unknown> | undefined {\n const bootstraps = materializeFrontendProviderBootstraps(input);\n if (!bootstraps) {\n return undefined;\n }\n\n return Object.fromEntries(\n Object.entries(bootstraps).map(([serviceKey, block]) => [\n serviceKey,\n Object.fromEntries(\n Object.entries(block.providers).map(([providerRef, providerEntry]) => [\n providerRef,\n /*\n * The WHOLE served entry, not a hand-picked subset (#1743). This used to name four\n * fields — metadata, capabilities, protocols, publicConfig — and so every field added to\n * the entry later (the CSP footprint, scripts, the SDK descriptor, components, the\n * declared public-config keys, the fronted storage, and now the vendor's compliance\n * profile) changed the SERVED artifact without moving its digest: the exact \"old artifact\n * reported as current\" the `providerConfigurations` note above exists to prevent, and a\n * processor register reading such an artifact would name yesterday's regions. Spreading\n * the entry makes a new field a digest input by default rather than by someone\n * remembering. The two arrays are still sorted so their authoring order is not a change,\n * and a key present as `undefined` is dropped because the artifact is written as JSON,\n * where it does not exist — two producers that differ only in spelling \"absent\" must not\n * differ in digest.\n */\n pruneUndefined({\n ...providerEntry,\n providerCapabilities: [...providerEntry.providerCapabilities].sort(),\n protocols: [...providerEntry.protocols].sort(),\n }),\n ]),\n ),\n ]),\n );\n}\n\nfunction materializeModules(\n config: Pick<WildoSaasConfig, 'modules' | 'services'>,\n): RuntimeProviderModulesArtifact {\n const modules = (config.modules ?? {}) as NonNullable<ApplicationModules>;\n return RuntimeProviderModulesArtifactSchema.parse({\n declaredModules: modules,\n moduleIds: getDeclaredApplicationModuleIds(modules),\n moduleIdsByService: Object.fromEntries(\n Object.keys(config.services ?? {}).map((serviceKey) => [\n serviceKey,\n getServiceBoundApplicationModuleIds(modules, serviceKey),\n ]),\n ),\n });\n}\n\nfunction materializeLockRuntimeScopes(input: {\n scopes: SaasProvidersScopes;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n}): SaasLockfileRuntimeScopesProviders {\n const { scopes, discoveryContext } = input;\n return pruneUndefined({\n backend: scopes.backend\n ? materializeLockScope(\n scopes.backend.providers,\n discoveryContext,\n discoveryContext.backend.matchesRuntimeTarget,\n discoveryContext.augmentations,\n )\n : undefined,\n companion: scopes.companion\n ? materializeLockScope(\n scopes.companion.providers,\n discoveryContext,\n discoveryContext.companion.matchesRuntimeTarget,\n discoveryContext.augmentations,\n )\n : undefined,\n frontendServices: scopes.frontendServices\n ? mapRecord(\n scopes.frontendServices,\n (scope, serviceKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.frontendServices.matchesRuntimeTarget(serviceKey),\n // A browser facet merges no augmentation (#1672): a browser reaches an augmented operation only through\n // the backend's operation door, so recording one here would describe code this facet never loads.\n [],\n ),\n )\n : undefined,\n minions: scopes.minions\n ? mapRecord(\n scopes.minions,\n (scope, minionKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.minions.matchesRuntimeTarget(minionKey),\n discoveryContext.augmentations,\n ),\n )\n : undefined,\n workers: scopes.workers\n ? mapRecord(\n scopes.workers,\n (scope, workerKey) => materializeLockScope(\n scope.providers,\n discoveryContext,\n discoveryContext.workers.matchesRuntimeTarget(workerKey),\n discoveryContext.augmentations,\n ),\n )\n : undefined,\n });\n}\n\nfunction materializeLockScope(\n providers: Record<string, SaasProviderScopeSelection>,\n discoveryContext: ProviderRuntimeDiscoveryContext,\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean,\n augmentations: readonly DiscoveredProviderAugmentation[],\n): SaasLockfileRuntimeScopesProviders['backend'] {\n return mapRecord(providers, (selection, ref) => {\n const matchingContributions = findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget,\n providerRef: ref,\n });\n const secretsContractShape = resolveProviderSecretsContractShape(ref, matchingContributions);\n const recordedAugmentations = buildRuntimeAugmentations([ref], matchingContributions, augmentations)[ref];\n const connectionRef = resolveProviderConnectionRef(discoveryContext.sharedConnections, ref);\n\n return {\n ref,\n digest: digestJson({\n selection,\n providerGraph: normalizeDiscoveredContributionsForDigest(matchingContributions),\n }),\n engineCapabilities: selection.engineCapabilities,\n providerCapabilities: selection.providerCapabilities,\n protocols: selection.protocols,\n // assurance-control: WILDO.SECRETS.CONTRACT_INTEGRITY — lock drift\n // covers the values-free provider contract without persisting secret values.\n secretsContractDigest: digestJson({ ref, secretsContractShape }),\n // Third-party code admitted to this provider's grant (#1672), recorded so a lock diff shows it ARRIVING —\n // and moving: a new package, a new version or a changed operation set each change this entry. Absent\n // when nothing is augmented, and deliberately NOT folded into `secretsContractDigest` (an augmentation\n // changes no secret) or `digest` (which would re-key every provider's lock entry for a field most never carry).\n // The connection whose grant this ref spends (#1725), only when it is ANOTHER ref's: a lock diff then shows a\n // ref joining or leaving a shared connection, while every undeclared ref's entry keeps its bytes.\n ...(connectionRef === ref ? {} : { connectionRef }),\n ...(recordedAugmentations === undefined ? {} : {\n augmentations: recordedAugmentations.map((augmentation) => ({\n packageName: augmentation.packageName,\n packageVersion: augmentation.packageVersion,\n operationIdsDigest: digestJson(augmentation.operationIds),\n // A package that starts asking for a new scope changes what a person is asked to consent to (#1671).\n ...(augmentation.requiredScopes === undefined ? {} : { requiredScopesDigest: digestJson(augmentation.requiredScopes) }),\n })),\n }),\n };\n });\n}\n\n/**\n * Resolves one authoritative values-free secret contract for a provider in a\n * concrete runtime scope.\n *\n * Multiple runtime owners may legitimately contribute the same provider, but\n * they must agree on its secret requirements. Missing discovery and divergent\n * shapes fail closed: hashing either state as an empty contract would make the\n * lockfile claim integrity evidence it does not possess.\n */\nfunction resolveProviderSecretsContractShape(\n providerRef: string,\n matchingContributions: DiscoveredProviderCompanionContribution[],\n): DiscoveredProviderCompanionContribution['secretsContractShape'] {\n if (matchingContributions.length === 0) {\n throw new Error(\n `Cannot materialize provider lock entry for \"${providerRef}\": no discovered contribution supplies its secret-contract shape for this runtime.`,\n );\n }\n\n const canonicalShape = matchingContributions[0].secretsContractShape;\n const canonicalDigestInput = stableStringify(canonicalShape);\n for (const contribution of matchingContributions.slice(1)) {\n if (stableStringify(contribution.secretsContractShape) !== canonicalDigestInput) {\n throw new Error(\n `Cannot materialize provider lock entry for \"${providerRef}\": discovered runtime owners disagree on its secret-contract shape.`,\n );\n }\n }\n\n return canonicalShape;\n}\n\nfunction digestJson(value: unknown): string {\n return `sha256:${createHash('sha256').update(stableStringify(value)).digest('hex')}`;\n}\n\nfunction stableStringify(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableStringify).join(',')}]`;\n }\n if (value && typeof value === 'object') {\n const record = value as Record<string, unknown>;\n return `{${Object.keys(record)\n .sort()\n .map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`)\n .join(',')}}`;\n }\n return JSON.stringify(value);\n}\n\nfunction mapRecord<TValue, TResult>(\n record: Record<string, TValue>,\n mapper: (value: TValue, key: string) => TResult,\n): Record<string, TResult> {\n return Object.fromEntries(\n Object.entries(record).map(([key, value]) => [key, mapper(value, key)]),\n );\n}\n\nfunction pruneUndefined<T extends Record<string, unknown>>(record: T): T {\n return Object.fromEntries(\n Object.entries(record).filter(([, value]) => value !== undefined),\n ) as T;\n}\n\ninterface ProviderRuntimeArtifactMetadata {\n sourceDigest: string;\n providerRefs: string[];\n providerRuntimeImports: Record<string, string>;\n providerRuntimeAugmentations?: Record<string, RuntimeProviderAugmentationArtifact[]>;\n systemOfRecordFacetModules: string[];\n providerGraphDigest: string;\n lockfileSectionDigest: string;\n}\n\ninterface ProviderRuntimeArtifactMetadataByKind {\n backend: ProviderRuntimeArtifactMetadata;\n companion: ProviderRuntimeArtifactMetadata;\n frontendServices: ProviderRuntimeArtifactMetadata;\n minions: ProviderRuntimeArtifactMetadata;\n nodeWorkers: ProviderRuntimeArtifactMetadata;\n}\n\ninterface RuntimeContributionMatcherFactory {\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n}\n\ninterface ScopedRuntimeContributionMatcherFactory {\n matchesRuntimeTarget: (\n scopeKey: string,\n ) => (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n}\n\ninterface ProviderRuntimeDiscoveryContext {\n contributions: DiscoveredProviderCompanionContribution[];\n /** The application's `providers.sharedConnections` (#1725), read through `resolveProviderConnectionRef`. */\n sharedConnections: ProviderSharedConnections | undefined;\n /** The OPTED-IN augmentations only (#1672) — see `materializeSaasProviderRuntimeArtifacts`. */\n augmentations: readonly DiscoveredProviderAugmentation[];\n /** The facet modules the discovery walk found, when the caller supplied them (#1675). */\n systemOfRecordFacetModules: readonly string[] | undefined;\n backend: RuntimeContributionMatcherFactory;\n companion: RuntimeContributionMatcherFactory;\n frontendServices: ScopedRuntimeContributionMatcherFactory;\n minions: ScopedRuntimeContributionMatcherFactory;\n workers: ScopedRuntimeContributionMatcherFactory;\n}\n\nfunction buildProviderRuntimeDiscoveryContext(input: {\n discoveredContributions?: DiscoveredProviderCompanionContribution[];\n discoveredAugmentations: readonly DiscoveredProviderAugmentation[];\n frontendServiceTypes: Record<string, AppFrontendType>;\n sharedConnections?: ProviderSharedConnections;\n systemOfRecordFacetModules?: readonly string[];\n}): ProviderRuntimeDiscoveryContext {\n const contributions = input.discoveredContributions ?? [];\n const { frontendServiceTypes } = input;\n\n return {\n contributions,\n sharedConnections: input.sharedConnections,\n augmentations: input.discoveredAugmentations,\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n backend: {\n matchesRuntimeTarget: (target) => target.kind === 'backend',\n },\n companion: {\n matchesRuntimeTarget: (target) => target.kind === 'companion',\n },\n frontendServices: {\n matchesRuntimeTarget: (serviceKey) => {\n const serviceType = frontendServiceTypes[serviceKey];\n // Service has no frontendType ⇒ no contribution can match it.\n if (!serviceType) return () => false;\n return (target) => target.kind === 'frontendService' && target.serviceType === serviceType;\n },\n },\n minions: {\n matchesRuntimeTarget: (minionKey) => (target) => target.kind === 'minion' && target.minionKey === minionKey,\n },\n workers: {\n matchesRuntimeTarget: (workerKey) => (target) => target.kind === 'worker' && target.workerKey === workerKey,\n },\n };\n}\n\nfunction buildArtifactMetadata(input: {\n frontendServiceNames: Record<string, string>;\n discoveryContext: ProviderRuntimeDiscoveryContext;\n frontendServiceTypes: Record<string, AppFrontendType>;\n lockSection: SaasLockfileProvidersSection;\n modules: RuntimeProviderModulesArtifact;\n nodeWorkerKeys?: string[];\n scopes: SaasProvidersScopes;\n providerConfigurations: Readonly<Record<string, Readonly<Record<string, unknown>> | undefined>>;\n}): ProviderRuntimeArtifactMetadataByKind {\n const { discoveryContext, frontendServiceTypes, lockSection, modules, nodeWorkerKeys, scopes, providerConfigurations } = input;\n const augmentations = discoveryContext.augmentations;\n /*\n * Computed ONCE for every artifact kind, because a vendor facet is not scoped to a runtime the way\n * a provider is: it says what a vendor NEEDS, which does not change between a backend and a\n * minion. Only the backend reads it today (#1055 D2 gives the instance environment to that runtime\n * alone), and recording it everywhere is what keeps that a policy of the RUNTIME rather than a\n * property of the artifact.\n */\n const systemOfRecordFacetModules = discoveryContext.systemOfRecordFacetModules !== undefined\n ? [...discoveryContext.systemOfRecordFacetModules].sort()\n : discoverSystemOfRecordFacetModules(discoveryContext.contributions);\n const nodeWorkerKeySet = nodeWorkerKeys ? new Set(nodeWorkerKeys) : undefined;\n\n return {\n backend: buildSingleScopeArtifactMetadata({\n runtimeLabel: 'the backend',\n systemOfRecordFacetModules,\n augmentations,\n modules,\n providers: scopes.backend?.providers ?? {},\n matchingContributions: findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.backend.matchesRuntimeTarget,\n }),\n extraArtifactState: {\n frontendServiceNames: input.frontendServiceNames,\n bootstraps: buildFrontendProviderBootstrapDigestInput({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n }),\n },\n runtimeLockSection: lockSection.runtimeScopes.backend ?? {},\n scopes,\n }),\n companion: buildSingleScopeArtifactMetadata({\n runtimeLabel: 'the companion',\n systemOfRecordFacetModules,\n augmentations,\n modules,\n providers: scopes.companion?.providers ?? {},\n matchingContributions: findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.companion.matchesRuntimeTarget,\n }),\n runtimeLockSection: lockSection.runtimeScopes.companion ?? {},\n scopes,\n }),\n frontendServices: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'frontend service',\n /*\n * Per service only: one ref legitimately has a different browser module per frontend type (posthog is\n * `…-public/app` for the SaaS app and `…-public/website` for the site), and no runtime loads this\n * artifact's merged import map — a browser receives its providers through its bootstrap entries.\n */\n oneImportPathAcrossScopes: false,\n systemOfRecordFacetModules,\n // No augmentation reaches a browser facet — see `materializeLockRuntimeScopes`.\n augmentations: [],\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.frontendServices ?? {}).map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.frontendServices ?? {}).map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.frontendServices.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n extraArtifactState: buildFrontendProviderBootstrapDigestInput({\n discoveredContributions: discoveryContext.contributions,\n frontendServiceScopes: scopes.frontendServices ?? {},\n frontendServiceTypes,\n providerConfigurations,\n }),\n runtimeLockSection: lockSection.runtimeScopes.frontendServices ?? {},\n scopes,\n }),\n minions: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'minion',\n // Every minion reads its ref's path from this one merged map, so two minions may not disagree either.\n oneImportPathAcrossScopes: true,\n systemOfRecordFacetModules,\n augmentations,\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.minions ?? {}).map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.minions ?? {}).map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.minions.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n runtimeLockSection: lockSection.runtimeScopes.minions ?? {},\n scopes,\n }),\n nodeWorkers: buildMultiScopeArtifactMetadata({\n runtimeKindLabel: 'worker',\n // Every worker reads its ref's path from this one merged map, so two workers may not disagree either.\n oneImportPathAcrossScopes: true,\n systemOfRecordFacetModules,\n augmentations,\n keyedProviders: Object.fromEntries(\n Object.entries(scopes.workers ?? {})\n .filter(([scopeKey]) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true)\n .map(([scopeKey, scope]) => [scopeKey, scope.providers]),\n ),\n matchingContributionsByScope: Object.fromEntries(\n Object.keys(scopes.workers ?? {})\n .filter((scopeKey) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true)\n .map((scopeKey) => [\n scopeKey,\n findMatchingDiscoveredContributions({\n discoveredContributions: discoveryContext.contributions,\n matchesRuntimeTarget: discoveryContext.workers.matchesRuntimeTarget(scopeKey),\n }),\n ]),\n ),\n modules,\n runtimeLockSection: Object.fromEntries(\n Object.entries(lockSection.runtimeScopes.workers ?? {})\n .filter(([scopeKey]) => nodeWorkerKeySet ? nodeWorkerKeySet.has(scopeKey) : true),\n ),\n scopes,\n }),\n };\n}\n\nfunction buildSingleScopeArtifactMetadata(input: {\n /** Names the runtime in a refusal (`the backend`). */\n runtimeLabel: string;\n systemOfRecordFacetModules: string[];\n augmentations: readonly DiscoveredProviderAugmentation[];\n matchingContributions: DiscoveredProviderCompanionContribution[];\n modules: RuntimeProviderModulesArtifact;\n providers: Record<string, SaasProviderScopeSelection>;\n extraArtifactState?: Record<string, unknown>;\n runtimeLockSection: Record<string, unknown>;\n scopes: SaasProvidersScopes;\n}): ProviderRuntimeArtifactMetadata {\n const providerRefs = Object.keys(input.providers).sort();\n const normalizedContributions = normalizeDiscoveredContributionsForDigest(input.matchingContributions);\n const providerRuntimeAugmentations = buildRuntimeAugmentations(providerRefs, input.matchingContributions, input.augmentations);\n const hasAugmentations = Object.keys(providerRuntimeAugmentations).length > 0;\n const providerGraphDigestInput = withAugmentationsForDigest(input.extraArtifactState\n ? {\n providerGraph: normalizedContributions,\n extraArtifactState: input.extraArtifactState,\n }\n : normalizedContributions, providerRuntimeAugmentations);\n\n return {\n sourceDigest: digestJson({\n modules: input.modules,\n providers: input.providers,\n providerGraph: normalizedContributions,\n scopes: input.scopes,\n extraArtifactState: input.extraArtifactState,\n ...(hasAugmentations ? { augmentations: providerRuntimeAugmentations } : {}),\n }),\n providerRefs,\n providerRuntimeImports: buildProviderRuntimeImports(providerRefs, input.matchingContributions, input.runtimeLabel),\n ...(hasAugmentations ? { providerRuntimeAugmentations } : {}),\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n providerGraphDigest: digestJson(providerGraphDigestInput),\n lockfileSectionDigest: digestJson(input.runtimeLockSection),\n };\n}\n\nfunction buildMultiScopeArtifactMetadata(input: {\n /** Names a scope's runtime in a refusal (`minion` → `minion \"scraper\"`). */\n runtimeKindLabel: string;\n /**\n * Whether the merged import map is what each scope's runtime loads from. When it is, a ref must have one path\n * across ALL scopes; when it is not, one path per scope is the whole requirement.\n */\n oneImportPathAcrossScopes: boolean;\n systemOfRecordFacetModules: string[];\n augmentations: readonly DiscoveredProviderAugmentation[];\n keyedProviders: Record<string, Record<string, SaasProviderScopeSelection>>;\n matchingContributionsByScope: Record<string, DiscoveredProviderCompanionContribution[]>;\n modules: RuntimeProviderModulesArtifact;\n extraArtifactState?: Record<string, unknown>;\n runtimeLockSection: Record<string, unknown>;\n scopes: SaasProvidersScopes;\n}): ProviderRuntimeArtifactMetadata {\n const providerRefs = [...new Set(\n Object.values(input.keyedProviders).flatMap((providers) => Object.keys(providers)),\n )].sort();\n const normalizedContributionsByScope = Object.fromEntries(\n Object.entries(input.matchingContributionsByScope).map(([scopeKey, contributions]) => [\n scopeKey,\n normalizeDiscoveredContributionsForDigest(contributions),\n ]),\n );\n\n const allMatchingContributions = Object.values(input.matchingContributionsByScope).flat();\n const providerRuntimeAugmentations = buildRuntimeAugmentations(providerRefs, allMatchingContributions, input.augmentations);\n const hasAugmentations = Object.keys(providerRuntimeAugmentations).length > 0;\n const providerGraphDigestInput = withAugmentationsForDigest(input.extraArtifactState\n ? {\n providerGraphByScope: normalizedContributionsByScope,\n extraArtifactState: input.extraArtifactState,\n }\n : normalizedContributionsByScope, providerRuntimeAugmentations);\n\n return {\n sourceDigest: digestJson({\n keyedProviders: input.keyedProviders,\n modules: input.modules,\n providerGraphByScope: normalizedContributionsByScope,\n scopes: input.scopes,\n extraArtifactState: input.extraArtifactState,\n ...(hasAugmentations ? { augmentations: providerRuntimeAugmentations } : {}),\n }),\n providerRefs,\n providerRuntimeImports: buildMultiScopeProviderRuntimeImports(providerRefs, input),\n ...(hasAugmentations ? { providerRuntimeAugmentations } : {}),\n systemOfRecordFacetModules: input.systemOfRecordFacetModules,\n providerGraphDigest: digestJson(providerGraphDigestInput),\n lockfileSectionDigest: digestJson(input.runtimeLockSection),\n };\n}\n\n/**\n * Which packages ship SYSTEM-OF-RECORD VENDOR FACETS (#1057) — the FALLBACK used when a caller supplies no\n * walk answer (`discoveredSystemOfRecordFacetModules`).\n *\n * Derived from the contributions' package roots, so it is bounded by what the walk's RESULTS contain: a\n * package that ships facets or facet augmentations and NO provider contribution is not found here. That\n * package now exists (#1675), which is why discovery answers from its TARGETS\n * (`DiscoverSaasProviderCompanionContributionsResult.systemOfRecordFacetModules`) and every `wildo` caller\n * passes that answer. Kept for a caller that builds an artifact from contributions alone (tests, the proofs).\n *\n * Sorted, so the artifact does not churn on filesystem order, and de-duplicated because one package root\n * contributes hundreds of providers and exactly one facet module.\n */\nfunction discoverSystemOfRecordFacetModules(\n contributions: readonly DiscoveredProviderCompanionContribution[],\n): string[] {\n const specifiers = new Set<string>();\n const visitedRoots = new Set<string>();\n\n for (const contribution of contributions) {\n const packageRoot = contribution.owner?.packageRoot;\n if (packageRoot === undefined || visitedRoots.has(packageRoot)) continue;\n visitedRoots.add(packageRoot);\n const specifier = readSystemOfRecordFacetModuleSpecifier(packageRoot);\n if (specifier !== undefined) specifiers.add(specifier);\n }\n\n return [...specifiers].sort();\n}\n\n/**\n * The merged import map of a multi-scope artifact. Every scope is checked on its own first, so a refusal names the\n * scope that disagrees with itself; then, where the runtimes load from the merged map, across scopes.\n */\nfunction buildMultiScopeProviderRuntimeImports(\n providerRefs: string[],\n input: {\n runtimeKindLabel: string;\n oneImportPathAcrossScopes: boolean;\n keyedProviders: Record<string, Record<string, SaasProviderScopeSelection>>;\n matchingContributionsByScope: Record<string, DiscoveredProviderCompanionContribution[]>;\n },\n): Record<string, string> {\n for (const [scopeKey, contributions] of Object.entries(input.matchingContributionsByScope).sort(([left], [right]) => left.localeCompare(right))) {\n buildProviderRuntimeImports(Object.keys(input.keyedProviders[scopeKey] ?? {}), contributions, `${input.runtimeKindLabel} \"${scopeKey}\"`);\n }\n const allMatchingContributions = Object.values(input.matchingContributionsByScope).flat();\n if (input.oneImportPathAcrossScopes) {\n return buildProviderRuntimeImports(providerRefs, allMatchingContributions, `every ${input.runtimeKindLabel}`);\n }\n /*\n * Not loaded by any runtime (see the caller), and each scope already has one path per ref: keep the historical\n * deterministic merge, the sorted-first path per ref, so the artifact does not churn.\n */\n const inScope = new Set(providerRefs);\n const candidatesByRef = new Map<string, string[]>();\n for (const contribution of allMatchingContributions) {\n if (!inScope.has(contribution.ref)) continue;\n candidatesByRef.set(contribution.ref, [...(candidatesByRef.get(contribution.ref) ?? []), contribution.runtimeImportPath]);\n }\n return Object.fromEntries(\n [...candidatesByRef.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([ref, candidates]) => [ref, [...candidates].sort()[0]!]),\n );\n}\n\n/**\n * Project the per-ref runtime import path a host dynamic-imports.\n *\n * Only refs actually in scope are recorded, so a per-host artifact never advertises a sibling's\n * packages. A ref no contribution covers is simply absent: the host then resolves it from the\n * engine's on-demand map, and the single fail-loud refusal in the backend registry names it if that\n * map does not hold it either.\n *\n * When several contributions claim one ref with DIFFERENT import paths, the artifact REFUSES (#2014): the\n * sorted-first path used to win silently, so a second package contributing a ref the application's own copy\n * (`@<app>/provider-asana`) also contributes decided which module loaded — the #2014 case was a leftover install of\n * the since-archived provider catalogue, whose `asana` subpath sorted first.\n * Discovery validation refuses the same case through the same predicate,\n * {@link describeProviderRefClaimedByMoreThanOneImportPath}; this is the second site, so an artifact can never\n * be built from contributions that skipped validation. `runtimeLabel` names the runtime in the refusal.\n */\nfunction buildProviderRuntimeImports(\n providerRefs: string[],\n contributions: DiscoveredProviderCompanionContribution[],\n runtimeLabel: string,\n): Record<string, string> {\n const inScope = new Set(providerRefs);\n const candidatesByRef = new Map<string, Set<string>>();\n\n for (const contribution of contributions) {\n if (!inScope.has(contribution.ref)) {\n continue;\n }\n const candidates = candidatesByRef.get(contribution.ref) ?? new Set<string>();\n candidates.add(contribution.runtimeImportPath);\n candidatesByRef.set(contribution.ref, candidates);\n }\n\n const refusals = [...candidatesByRef.keys()]\n .sort()\n .map((ref) => describeProviderRefClaimedByMoreThanOneImportPath(ref, runtimeLabel, contributions))\n .filter((refusal): refusal is string => refusal !== undefined);\n if (refusals.length > 0) {\n throw new Error(`Provider runtime artifact refused:\\n- ${refusals.join('\\n- ')}`);\n }\n\n return Object.fromEntries(\n [...candidatesByRef.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([ref, candidates]) => [ref, [...candidates][0]!]),\n );\n}\n\n/**\n * The opted-in augmentations of the given refs, per ref, sorted by package name (#1672).\n *\n * A ref no scope-matched contribution covers gets none: an augmentation applies to a provider the host actually\n * loads. The base package is read from the base's contribution — its runtime import path's package, and that\n * package's installed version when discovery walked it — and recorded for #1731; nothing here refuses on it.\n */\nfunction buildRuntimeAugmentations(\n providerRefs: readonly string[],\n matchingContributions: readonly DiscoveredProviderCompanionContribution[],\n augmentations: readonly DiscoveredProviderAugmentation[],\n): Record<string, RuntimeProviderAugmentationArtifact[]> {\n const result: Record<string, RuntimeProviderAugmentationArtifact[]> = {};\n for (const ref of [...providerRefs].sort()) {\n const base = [...matchingContributions]\n .filter((contribution) => contribution.ref === ref)\n .sort((left, right) => left.runtimeImportPath.localeCompare(right.runtimeImportPath))[0];\n if (base === undefined) continue;\n const entries = augmentations\n .filter((augmentation) => augmentation.augments === ref && augmentation.packageVersion !== undefined)\n .map((augmentation) => RuntimeProviderAugmentationArtifactSchema.parse({\n packageName: augmentation.packageName,\n packageVersion: augmentation.packageVersion,\n runtimeImportPath: augmentation.runtimeImportPath,\n operationIds: [...augmentation.operationIds],\n ...(augmentation.requiredScopes.length === 0 ? {} : { requiredScopes: [...augmentation.requiredScopes] }),\n ...resolveProviderBasePackage(base),\n }))\n .sort((left, right) => left.packageName.localeCompare(right.packageName));\n if (entries.length > 0) result[ref] = entries;\n }\n return result;\n}\n\n/**\n * Fold augmentations into a provider-graph digest input only when there are some, so the digest of every\n * artifact that augments nothing is byte-identical to what it was before augmentation existed — a running host\n * compares these digests, and an unrelated field must not read as drift.\n */\nfunction withAugmentationsForDigest(digestInput: unknown, augmentations: Record<string, RuntimeProviderAugmentationArtifact[]>): unknown {\n return Object.keys(augmentations).length === 0 ? digestInput : { providerGraph: digestInput, augmentations };\n}\n\nfunction findMatchingDiscoveredContributions(input: {\n discoveredContributions: DiscoveredProviderCompanionContribution[];\n matchesRuntimeTarget: (target: DiscoveredProviderCompanionContribution['runtimeTargets'][number]) => boolean;\n providerRef?: string;\n}): DiscoveredProviderCompanionContribution[] {\n return input.discoveredContributions.flatMap((contribution) => {\n if (input.providerRef && contribution.ref !== input.providerRef) {\n return [];\n }\n const runtimeTargets = contribution.runtimeTargets.filter(input.matchesRuntimeTarget);\n if (runtimeTargets.length === 0) {\n return [];\n }\n return [{ ...contribution, runtimeTargets }];\n });\n}\n\n/**\n * The portion of a contribution's `owner` that may enter a digest.\n *\n * **`packageRoot` is deliberately excluded, and this is the whole point of the\n * function.** Discovery builds it as `resolve(saasRoot, definition.path)` — an\n * ABSOLUTE filesystem path — so hashing it makes every value derived from this\n * normalizer a property of WHERE THE REPOSITORY HAPPENS TO BE CHECKED OUT\n * rather than of the provider graph.\n *\n * That is not a theoretical concern; it was measured on 2026-08-30. The same\n * Wonder Todos tree, materialized from its real directory and from a symlink to\n * it, produced two different lock digests for every provider in every scope\n * (`sha256:f7eeb2d6…` vs `sha256:d933b95a…` for backend `anthropic`), and a dump\n * of the two contribution sets differed in `owner.packageRoot` and nothing else.\n * The consequences were both real:\n *\n * - `examples/wonder-todos/.wildo-saas/wildo-saas.lock.json` carried 22 digests\n * scoped to whichever checkout last ran `wildo config sync`, so the\n * `Lockfile Drift Check` gate — which runs at `/home/runner/work/…` — could\n * never have agreed with a committed value regardless of actual drift.\n * - The same input feeds `sourceDigest` / `providerGraphDigest` in the generated\n * runtime artifacts and `.wildo-providers.env`, so artifacts generated on a\n * developer's machine and re-materialized under a container's `/app` would\n * trip the `digest-mismatch` runtime diagnostic while describing an identical\n * provider graph.\n *\n * `kind` + `key` already identify an owner uniquely (both are record keys within\n * their config block), so nothing distinguishing is lost. What IS given up is\n * that relocating an owner package without changing its contribution content no\n * longer moves the digest — accepted deliberately: a repository-layout change is\n * not a provider-contract change, and if that signal is ever wanted it must\n * arrive as a saas-root-RELATIVE path, never an absolute one.\n */\nfunction projectOwnerForDigest(\n owner: DiscoveredProviderCompanionContribution['owner'],\n): { kind: string; key: string } {\n return { kind: owner.kind, key: owner.key };\n}\n\nfunction normalizeDiscoveredContributionsForDigest(\n contributions: DiscoveredProviderCompanionContribution[],\n): Array<Record<string, unknown>> {\n return [...contributions]\n .sort((left, right) => stableStringify({\n leftOwner: projectOwnerForDigest(left.owner),\n leftRef: left.ref,\n leftRuntimeImportPath: left.runtimeImportPath,\n leftSourceModuleId: left.sourceModuleId,\n leftTargets: left.runtimeTargets,\n }).localeCompare(stableStringify({\n rightOwner: projectOwnerForDigest(right.owner),\n rightRef: right.ref,\n rightRuntimeImportPath: right.runtimeImportPath,\n rightSourceModuleId: right.sourceModuleId,\n rightTargets: right.runtimeTargets,\n })))\n .map((contribution) => ({\n ref: contribution.ref,\n owner: projectOwnerForDigest(contribution.owner),\n runtimeImportPath: contribution.runtimeImportPath,\n runtimeTargets: contribution.runtimeTargets,\n engineCapabilities: [...contribution.engineCapabilities].sort(),\n providerCapabilities: [...contribution.providerCapabilities].sort(),\n protocols: [...contribution.protocols].sort(),\n secretsContractShape: contribution.secretsContractShape,\n frontendEntry: contribution.frontendEntry\n ? {\n metadata: contribution.frontendEntry.metadata,\n providerCapabilities: [...contribution.frontendEntry.providerCapabilities].sort(),\n protocols: [...contribution.frontendEntry.protocols].sort(),\n publicConfig: contribution.frontendEntry.publicConfig,\n }\n : undefined,\n sourceModuleId: contribution.sourceModuleId,\n }));\n}\n"]}