@wildo-ai/platform-config-lib 1.1.10 → 1.1.12

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 (396) hide show
  1. package/dist/esm/_unimplemented/soft-warn.d.ts +24 -49
  2. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -1
  3. package/dist/esm/_unimplemented/soft-warn.js +24 -49
  4. package/dist/esm/_unimplemented/soft-warn.js.map +1 -1
  5. package/dist/esm/blueprint/anchored-region.d.ts +83 -0
  6. package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
  7. package/dist/esm/blueprint/anchored-region.js +263 -0
  8. package/dist/esm/blueprint/anchored-region.js.map +1 -0
  9. package/dist/esm/blueprint/blueprint.schemas.d.ts +600 -0
  10. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
  11. package/dist/esm/blueprint/blueprint.schemas.js +638 -0
  12. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
  13. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
  18. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  19. package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
  20. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +29 -4
  22. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  23. package/dist/esm/bootstrap/bootstrap.schemas.js +29 -4
  24. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +131 -2
  26. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  27. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +139 -2
  28. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  29. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  30. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  31. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  32. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  34. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  35. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  36. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  37. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  39. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  41. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  43. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  44. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  45. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  48. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  49. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  51. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  52. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  53. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  54. package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
  55. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
  57. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
  59. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
  60. package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
  61. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
  62. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  63. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  64. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
  65. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
  66. package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
  67. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
  68. package/dist/esm/config-authoring.entry.js.map +1 -1
  69. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  70. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  71. package/dist/esm/index.d.ts +20 -1
  72. package/dist/esm/index.d.ts.map +1 -1
  73. package/dist/esm/index.js +20 -1
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  76. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  78. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  79. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  80. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  81. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  82. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  84. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  85. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  86. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  87. package/dist/esm/key-management/approval-seal-verifier.d.ts +278 -0
  88. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
  89. package/dist/esm/key-management/approval-seal-verifier.js +355 -0
  90. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
  91. package/dist/esm/key-management/approval-seal.contracts.d.ts +128 -0
  92. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
  93. package/dist/esm/key-management/approval-seal.contracts.js +135 -0
  94. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
  95. package/dist/esm/key-management/data-key.contracts.d.ts +106 -0
  96. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
  97. package/dist/esm/key-management/data-key.contracts.js +54 -0
  98. package/dist/esm/key-management/data-key.contracts.js.map +1 -0
  99. package/dist/esm/key-management/es256-jws.d.ts +60 -0
  100. package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
  101. package/dist/esm/key-management/es256-jws.js +135 -0
  102. package/dist/esm/key-management/es256-jws.js.map +1 -0
  103. package/dist/esm/key-management/key-provider.spi.d.ts +158 -0
  104. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
  105. package/dist/esm/key-management/key-provider.spi.js +38 -0
  106. package/dist/esm/key-management/key-provider.spi.js.map +1 -0
  107. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +83 -0
  108. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
  109. package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
  110. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
  111. package/dist/esm/key-management/keyring-status.contracts.d.ts +59 -0
  112. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
  113. package/dist/esm/key-management/keyring-status.contracts.js +45 -0
  114. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
  115. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  116. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  117. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  118. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  119. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  120. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  121. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  122. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  123. package/dist/esm/key-management/qr-code.d.ts +38 -0
  124. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  125. package/dist/esm/key-management/qr-code.js +325 -0
  126. package/dist/esm/key-management/qr-code.js.map +1 -0
  127. package/dist/esm/key-management/signature-request.contracts.d.ts +91 -0
  128. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
  129. package/dist/esm/key-management/signature-request.contracts.js +96 -0
  130. package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
  131. package/dist/esm/key-management/signing-log-export.contracts.d.ts +215 -0
  132. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
  133. package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
  134. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
  135. package/dist/esm/key-management/vault-custody.contracts.d.ts +98 -0
  136. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
  137. package/dist/esm/key-management/vault-custody.contracts.js +154 -0
  138. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
  139. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  140. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  141. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  142. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  143. package/dist/esm/lockfile/canonical-json.js +1 -1
  144. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  145. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  146. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  147. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  148. package/dist/esm/lockfile/lockfile-io.d.ts +13 -17
  149. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  150. package/dist/esm/lockfile/lockfile-io.js +29 -30
  151. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  152. package/dist/esm/lockfile/materialize-infra-section.d.ts +22 -20
  153. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  154. package/dist/esm/lockfile/materialize-infra-section.js +13 -14
  155. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  156. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +27 -249
  157. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  158. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +28 -3
  159. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  160. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  161. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  162. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  163. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  164. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  165. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +22 -3
  166. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  167. package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
  168. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
  169. package/dist/esm/project-config/application-served-public-documents.loader.js +86 -0
  170. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
  171. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  172. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  173. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  174. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  175. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  176. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  177. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  178. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  179. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  180. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  181. package/dist/esm/project-config/config-module-resolution.js +33 -0
  182. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  183. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  184. package/dist/esm/project-config/define-infra-env-config.d.ts +344 -69
  185. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  186. package/dist/esm/project-config/define-infra-env-config.js +194 -143
  187. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  188. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  189. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/define-minion-config.js +64 -25
  191. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  192. package/dist/esm/project-config/define-saas-config.d.ts +82 -348
  193. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  194. package/dist/esm/project-config/define-saas-config.js +262 -103
  195. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  196. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  197. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  198. package/dist/esm/project-config/define-worker-config.js +10 -12
  199. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  200. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  201. package/dist/esm/project-config/hosted-infra-env-config.js +4 -1
  202. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  203. package/dist/esm/project-config/index.d.ts +5 -0
  204. package/dist/esm/project-config/index.d.ts.map +1 -1
  205. package/dist/esm/project-config/index.js +5 -0
  206. package/dist/esm/project-config/index.js.map +1 -1
  207. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  208. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  209. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  210. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  211. package/dist/esm/project-config/loader.d.ts +131 -14
  212. package/dist/esm/project-config/loader.d.ts.map +1 -1
  213. package/dist/esm/project-config/loader.js +226 -12
  214. package/dist/esm/project-config/loader.js.map +1 -1
  215. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  216. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  217. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  218. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  219. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  220. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  221. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  222. package/dist/esm/project-config/npm-version-range.js +39 -16
  223. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  224. package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
  225. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
  226. package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
  227. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
  228. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  229. package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
  230. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  231. package/dist/esm/project-config/provider-companion-discovery.js +16 -10
  232. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  233. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +103 -49
  234. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  235. package/dist/esm/project-config/provider-runtime-artifacts.js +216 -16
  236. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  237. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  238. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  240. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  242. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  243. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  244. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  245. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  246. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  247. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  248. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  249. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  250. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  251. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  252. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  253. package/dist/esm/project-config/shared/csp-defaults.d.ts +36 -9
  254. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  255. package/dist/esm/project-config/shared/csp-defaults.js +54 -11
  256. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  257. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  258. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  259. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  260. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  261. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -85
  262. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/csp.schemas.js +40 -13
  264. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  266. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  270. package/dist/esm/project-config/shared/environment.schemas.d.ts +101 -8
  271. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/environment.schemas.js +128 -9
  273. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  275. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  276. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  277. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  278. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +2 -1
  279. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +4 -1
  281. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  282. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  284. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  285. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  286. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +24 -0
  287. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  288. package/dist/esm/project-config/shared/minion-resource-access.validation.js +25 -2
  289. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  290. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  291. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  292. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +276 -0
  293. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
  294. package/dist/esm/project-config/shared/platform-key-management.schemas.js +296 -0
  295. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
  296. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  297. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  298. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  299. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  300. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  301. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  302. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  303. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  304. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  305. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  306. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  307. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  308. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  309. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  310. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  311. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  312. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  313. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  314. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  315. package/dist/esm/registry/digest.schemas.js.map +1 -1
  316. package/dist/esm/registry/index.d.ts +3 -3
  317. package/dist/esm/registry/index.d.ts.map +1 -1
  318. package/dist/esm/registry/index.js +3 -3
  319. package/dist/esm/registry/index.js.map +1 -1
  320. package/dist/esm/registry/local-checkout-source.d.ts +22 -2
  321. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  322. package/dist/esm/registry/local-checkout-source.js +66 -3
  323. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  324. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +11 -98
  325. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  326. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  327. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  328. package/dist/esm/registry/module-artifact.schemas.d.ts +40 -17
  329. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  330. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  331. package/dist/esm/registry/module-manifest.schemas.d.ts +324 -74
  332. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  333. package/dist/esm/registry/module-manifest.schemas.js +377 -19
  334. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  335. package/dist/esm/registry/module-search.schemas.d.ts +2 -0
  336. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  337. package/dist/esm/registry/module-search.schemas.js +14 -1
  338. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  339. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  340. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  342. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  344. package/dist/esm/registry/registry-errors.d.ts +103 -5
  345. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  346. package/dist/esm/registry/registry-errors.js +213 -6
  347. package/dist/esm/registry/registry-errors.js.map +1 -1
  348. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  349. package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
  350. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  351. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  352. package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
  353. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
  354. package/dist/esm/registry/registry-url-resolution.js +157 -0
  355. package/dist/esm/registry/registry-url-resolution.js.map +1 -0
  356. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  357. package/dist/esm/release/framework-release.constants.js.map +1 -1
  358. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  359. package/dist/esm/schemas/framework-secrets.schemas.d.ts +48 -0
  360. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  361. package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
  362. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  363. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  364. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  365. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  366. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  367. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  368. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  369. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  370. package/dist/esm/workspace-scope/index.js.map +1 -1
  371. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  372. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  373. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  374. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  375. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  376. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  377. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  378. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  379. package/dist/tsconfig.build.tsbuildinfo +1 -1
  380. package/package.json +12 -12
  381. package/dist/esm/_unimplemented/index.d.ts +0 -3
  382. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  383. package/dist/esm/_unimplemented/index.js +0 -3
  384. package/dist/esm/_unimplemented/index.js.map +0 -1
  385. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  386. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  387. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  388. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  389. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  390. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  391. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  392. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  393. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  394. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  395. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  396. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -1,7 +1,8 @@
1
1
  import { createHash } from 'crypto';
2
2
  import { existsSync, mkdirSync, readFileSync } from 'fs';
3
3
  import { dirname, join, relative, resolve } from 'path';
4
- import { fileURLToPath } from 'url';
4
+ import { findPackageJSON } from 'module';
5
+ import { fileURLToPath, pathToFileURL } from 'url';
5
6
  import { createJiti } from 'jiti';
6
7
  import { resolveAppLayout, resolveFrameworkLayout } from '../workspace-scope/workspace-homes.schemas.js';
7
8
  import { isHostedInfraEnvConfig, WildoHostedInfraEnvConfigSchema, } from './define-infra-env-config.js';
@@ -9,6 +10,104 @@ import { realpathSync } from 'fs';
9
10
  import { resolveHostedInfraEnvConfig } from './hosted-infra-env-config.js';
10
11
  import { AUTHORED_CONFIG_FILE_NAMES } from '../workspace-scope/workspace-scope.schemas.js';
11
12
  import { ConfigArtifactsZone, FRAMEWORK_WORKSPACE_MARKER_FILE, resolveConfigArtifactsBaseDir, } from '../workspace-scope/workspace-scope.schemas.js';
13
+ import { ConfigModuleResolution } from './config-module-resolution.js';
14
+ /**
15
+ * The jiti option key the boundary's handler travels under. jiti keeps unknown option keys on the options object it
16
+ * shares with every child instance of one load, which a transpiled module reaches as `require.options`.
17
+ */
18
+ const MODULE_EVALUATION_BOUNDARY_OPTION = 'wildoModuleEvaluationBoundary';
19
+ /** The marker jiti's default transform leaves in place of a module it could not transpile (read by jiti after the module returns). */
20
+ const JITI_TRANSFORM_ERROR_EXPORT = '__JITI_ERROR__';
21
+ /**
22
+ * The wrapper's version, part of a bounded load's transpile-cache directory. jiti's cache entry is valid while the
23
+ * module's SOURCE is unchanged and knows nothing of the wrapper, so a change to {@link wrapModuleInEvaluationBoundary}
24
+ * must bump this, or modules wrapped the old way keep being served from the cache.
25
+ */
26
+ const MODULE_EVALUATION_BOUNDARY_WRAPPER_VERSION = 2;
27
+ /** The jiti option key the import observer travels under, the way {@link MODULE_EVALUATION_BOUNDARY_OPTION} does. */
28
+ const MODULE_IMPORT_OBSERVER_OPTION = 'wildoModuleImportObserver';
29
+ /**
30
+ * One load's import graph over its bounded modules. Recorded at the import, because jiti's module tree cannot answer:
31
+ * a module already evaluated in this load is served from its cache and never becomes a child of a second importer.
32
+ */
33
+ function createModuleImportGraph() {
34
+ const imports = new Map();
35
+ return {
36
+ observe: (filename, specifier, resolver) => {
37
+ if (typeof specifier !== 'string')
38
+ return;
39
+ try {
40
+ const known = imports.get(filename) ?? new Set();
41
+ known.add(resolver.resolve(specifier));
42
+ imports.set(filename, known);
43
+ }
44
+ catch {
45
+ // A specifier that cannot be resolved is the import's own failure, which the import itself is about to raise.
46
+ }
47
+ },
48
+ importedBy: (filename) => {
49
+ const seen = new Set([filename]);
50
+ const pending = [...(imports.get(filename) ?? [])];
51
+ for (let next = pending.pop(); next !== undefined; next = pending.pop()) {
52
+ if (seen.has(next))
53
+ continue;
54
+ seen.add(next);
55
+ pending.push(...(imports.get(next) ?? []));
56
+ }
57
+ seen.delete(filename);
58
+ return [...seen];
59
+ },
60
+ };
61
+ }
62
+ /**
63
+ * Wrap one transpiled module body in its evaluation boundary (see {@link ModuleEvaluationBoundary}). Exported so the
64
+ * wrapper's shape can be pinned without a jiti instance.
65
+ */
66
+ export function wrapModuleInEvaluationBoundary(code, options) {
67
+ // An inline source map must stay the LAST line to be honoured, so it moves after the wrapper.
68
+ const sourceMapMatch = /\n(\/\/# sourceMappingURL=[^\n]*)\s*$/u.exec(code);
69
+ const body = sourceMapMatch === null ? code : code.slice(0, sourceMapMatch.index);
70
+ const handler = `(require.options&&require.options[${JSON.stringify(MODULE_EVALUATION_BOUNDARY_OPTION)}])`;
71
+ const absorbed = (error) => `(typeof ${handler}==="function"&&${handler}({error:${error},filename:__filename,moduleExports:exports})===true)`;
72
+ const observer = `(require.options&&require.options[${JSON.stringify(MODULE_IMPORT_OBSERVER_OPTION)}])`;
73
+ // The body's own `require` and `jitiImport` are these: same functions, and each import is reported on the way through.
74
+ const observed = (load) => `(typeof ${observer}==="function"?new Proxy(${load},{apply:(target,self,args)=>{${observer}(__filename,args[0],require);return Reflect.apply(target,self,args);}}):${load})`;
75
+ const invoke = options.async ? 'await (async function(jitiImport,require){' : '(function(jitiImport,require){';
76
+ /*
77
+ * A module jiti could not transpile is not a throw: its body is one assignment of the error to `exports`, which jiti
78
+ * turns into a throw after the module returns. The boundary turns it into a SyntaxError here, so the handler sees it
79
+ * as the failure of THIS module rather than of its importer, and removes the marker when the handler absorbs it.
80
+ */
81
+ const transformFailure = body.includes(JITI_TRANSFORM_ERROR_EXPORT)
82
+ ? `\nif(exports.${JITI_TRANSFORM_ERROR_EXPORT}){const __wildoTransform=exports.${JITI_TRANSFORM_ERROR_EXPORT};`
83
+ + 'const __wildoTransformError=new SyntaxError(`${__wildoTransform.code}: ${__wildoTransform.message} (${__wildoTransform.filename}:${__wildoTransform.line}:${__wildoTransform.column})`);'
84
+ + `if(${absorbed('__wildoTransformError')})delete exports.${JITI_TRANSFORM_ERROR_EXPORT};}`
85
+ : '';
86
+ return `try{${invoke}${body}\n}).call(this,${observed('jitiImport')},${observed('require')});}catch(__wildoModuleError){if(!${absorbed('__wildoModuleError')})throw __wildoModuleError;}`
87
+ + transformFailure
88
+ + (sourceMapMatch === null ? '' : `\n${sourceMapMatch[1]}`);
89
+ }
90
+ /**
91
+ * jiti options that put every transpiled module `boundary` applies to (except the entry) behind its evaluation
92
+ * boundary. The default transform comes from a second jiti instance with the same options and no on-disk cache: the
93
+ * wrapping instance's own cache already stores the wrapped output, so caching the unwrapped one too would only double
94
+ * the transpile cache for no read.
95
+ */
96
+ function buildModuleEvaluationBoundaryJitiOptions(boundary, entryPath, baseOptions) {
97
+ const defaultTransformer = createJiti(import.meta.url, { ...baseOptions, fsCache: false });
98
+ const imports = createModuleImportGraph();
99
+ return {
100
+ [MODULE_EVALUATION_BOUNDARY_OPTION]: (failure) => boundary.absorb({ ...failure, importedFilenames: imports.importedBy(failure.filename) }),
101
+ [MODULE_IMPORT_OBSERVER_OPTION]: imports.observe,
102
+ transform: (transformOptions) => {
103
+ const code = defaultTransformer.transform(transformOptions);
104
+ const filename = transformOptions.filename;
105
+ if (filename === undefined || resolve(filename) === entryPath || !boundary.appliesTo(resolve(filename)))
106
+ return { code };
107
+ return { code: wrapModuleInEvaluationBoundary(code, { async: transformOptions.async === true }) };
108
+ },
109
+ };
110
+ }
12
111
  const PACKAGE_COMPANION_SUBPATH = './companion';
13
112
  /**
14
113
  * Load and evaluate a TypeScript config file via jiti.
@@ -41,6 +140,18 @@ export async function loadConfigExport(filePath, exportName, options) {
41
140
  const { module } = await importConfigModule(filePath, options);
42
141
  return module[exportName];
43
142
  }
143
+ /**
144
+ * Load EVERY export of an application-authored TypeScript module, through the same resolver `loadConfig`
145
+ * uses. For a reader that names the export it wants only after loading (a landed specification module).
146
+ *
147
+ * Exists so such a reader need not reach for `tsx`'s `tsImport`, which calls `module.register` on EVERY
148
+ * call: each call adds a loader-thread hook chain to the process for good, after which every module
149
+ * resolution in it is a synchronous round trip to that thread (#3208).
150
+ */
151
+ export async function loadConfigModuleExports(filePath, options) {
152
+ const { module } = await importConfigModule(filePath, options);
153
+ return module;
154
+ }
44
155
  async function importConfigModule(filePath, options) {
45
156
  const absolutePath = resolve(filePath);
46
157
  if (!existsSync(absolutePath)) {
@@ -49,20 +160,28 @@ async function importConfigModule(filePath, options) {
49
160
  const cacheBaseDir = options?.artifactLocation
50
161
  ? resolveConfigArtifactsBaseDir(options.artifactLocation)
51
162
  : resolveConfigArtifactsBaseDir(absolutePath);
52
- const cacheDir = join(cacheBaseDir, createHash('sha1').update(absolutePath).digest('hex'));
163
+ // A bounded load caches WRAPPED modules, so it keeps them apart from an unbounded load of the same entry.
164
+ const cacheDir = join(cacheBaseDir, createHash('sha1').update(absolutePath).digest('hex')
165
+ + (options?.moduleEvaluationBoundary === undefined ? '' : `-bounded-v${MODULE_EVALUATION_BOUNDARY_WRAPPER_VERSION}`));
53
166
  mkdirSync(cacheDir, { recursive: true });
54
167
  const currentModuleDirectory = dirname(fileURLToPath(import.meta.url));
55
168
  const platformConfigLibEntry = resolvePlatformConfigLibEntry(currentModuleDirectory);
56
169
  const moduleResolution = options?.moduleResolution
57
170
  ?? inferConfigModuleResolution(absolutePath, currentModuleDirectory);
58
- const frameworkWorkspaceRoot = moduleResolution === 'framework-source'
171
+ const frameworkWorkspaceRoot = moduleResolution === ConfigModuleResolution.FRAMEWORK_SOURCE
59
172
  ? resolveLoaderWorkspaceRoot(currentModuleDirectory)
60
173
  : tryResolveLoaderWorkspaceRoot(currentModuleDirectory);
61
- const jiti = createJiti(import.meta.url, {
174
+ const jitiOptions = {
62
175
  fsCache: cacheDir,
63
176
  // `moduleCache: false` forces re-evaluation of the whole loaded graph — see
64
177
  // `LoadConfigOptions.freshModuleCache` for why a fresh createJiti alone is not enough.
65
- ...(options?.freshModuleCache === true ? { moduleCache: false } : {}),
178
+ /*
179
+ * A bounded load never shares jiti's module cache either, whatever `freshModuleCache` says: a module whose failure
180
+ * the handler absorbed would otherwise sit in the process-global CommonJS registry with whatever the handler left in
181
+ * its exports, and a later unbounded load would be served that instead of the throw it expects.
182
+ */
183
+ ...(options?.freshModuleCache === true || options?.moduleEvaluationBoundary !== undefined ? { moduleCache: false } : {}),
184
+ ...(options?.jsx !== undefined ? { jsx: { runtime: options.jsx.runtime, importSource: options.jsx.importSource } } : {}),
66
185
  alias: {
67
186
  // Package-owned aliases first so framework-owned entries always win a
68
187
  // collision: a package may extend its own resolution, never redirect a
@@ -74,13 +193,16 @@ async function importConfigModule(filePath, options) {
74
193
  platformConfigLibEntry,
75
194
  }),
76
195
  },
77
- });
196
+ };
197
+ const jiti = createJiti(import.meta.url, options?.moduleEvaluationBoundary === undefined
198
+ ? jitiOptions
199
+ : { ...jitiOptions, ...buildModuleEvaluationBoundaryJitiOptions(options.moduleEvaluationBoundary, absolutePath, jitiOptions) });
78
200
  return { absolutePath, module: await jiti.import(absolutePath) };
79
201
  }
80
202
  /**
81
203
  * Which file a package's companion subpath resolves to.
82
204
  *
83
- * Authored source wins when either option asks for it: `moduleResolution: 'framework-source'` (a package inside the
205
+ * Authored source wins when either option asks for it: {@link ConfigModuleResolution.FRAMEWORK_SOURCE} (a package inside the
84
206
  * framework workspace), or `preferAuthoredSource` (a reader whose contract is the working tree, wherever the package
85
207
  * lives — see {@link loadPackageCompanionExport}). Otherwise the declared `exports` entry wins, and authored source
86
208
  * is only the fallback when nothing is built.
@@ -107,7 +229,7 @@ export function resolvePackageCompanionEntryPath(packageRoot, subpath = PACKAGE_
107
229
  ]
108
230
  : [];
109
231
  const preferredSourceCandidate = sourceCandidates.find((candidate) => existsSync(candidate));
110
- if ((options?.moduleResolution === 'framework-source' || options?.preferAuthoredSource === true) && preferredSourceCandidate) {
232
+ if ((options?.moduleResolution === ConfigModuleResolution.FRAMEWORK_SOURCE || options?.preferAuthoredSource === true) && preferredSourceCandidate) {
111
233
  return preferredSourceCandidate;
112
234
  }
113
235
  const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
@@ -298,8 +420,11 @@ function resolveLoaderWorkspaceRoot(startDirectory) {
298
420
  }
299
421
  function buildLoaderAliases(input) {
300
422
  const platformConfigLibPackageRoot = resolveCurrentPackageRoot(dirname(input.platformConfigLibEntry));
423
+ if (input.moduleResolution === ConfigModuleResolution.LOADER_INSTANCES) {
424
+ return buildLoaderInstanceAliases(platformConfigLibPackageRoot);
425
+ }
301
426
  const aliases = buildDeclaredPackageSourceAliases(platformConfigLibPackageRoot, '.', input.platformConfigLibEntry);
302
- if (input.moduleResolution !== 'framework-source' || !input.frameworkWorkspaceRoot) {
427
+ if (input.moduleResolution !== ConfigModuleResolution.FRAMEWORK_SOURCE || !input.frameworkWorkspaceRoot) {
303
428
  return aliases;
304
429
  }
305
430
  const workspaceRoot = input.frameworkWorkspaceRoot;
@@ -377,17 +502,102 @@ function buildDeclaredPackageSourceAliases(workspaceRoot, packageRelativeRoot, r
377
502
  entries.sort(([left], [right]) => right.length - left.length || left.localeCompare(right));
378
503
  return Object.fromEntries(entries);
379
504
  }
505
+ /**
506
+ * The aliases of {@link ConfigModuleResolution.LOADER_INSTANCES} (#3440): this package, and every `@wildo-ai/*` package it
507
+ * depends on, mapped subpath by subpath to the built file its `import` condition names, in the copy THIS package
508
+ * resolves. Those files are plain ES modules, which jiti hands to Node's own `import` rather than transpiling, so a
509
+ * process that already runs this package (the CLI does) gets back the modules it holds: evaluating a configuration
510
+ * costs only the configuration's own modules.
511
+ *
512
+ * ## Why it exists
513
+ *
514
+ * In a framework checkout `framework-source` evaluates every framework package a configuration imports from SOURCE,
515
+ * through jiti, beside the built copy the calling process already runs. Measured on Wonder Todos (2026-11-06):
516
+ * `wildo.saas.config.ts` imports enums from `@wildo-ai/saas-models` and `@wildo-ai/external-connectors-models`, and
517
+ * that evaluation transpiled 533 `saas-models` modules and kept 351 MB of heap, 1.9 s, to answer which services the
518
+ * application declares. With these aliases the same read keeps 7 MB, 0.1 s. One copy of each framework package per
519
+ * thread is also what keeps a caller's own `instanceof` and zod schemas meeting the configuration's (#2598).
520
+ *
521
+ * ## What it does not cover
522
+ *
523
+ * - A framework package this package does not depend on (`@wildo-ai/saas-backend-lib`, imported by a backend
524
+ * configuration) resolves from the configuration's own location, as in `package` mode: its installed build.
525
+ * - A package with ANY declared built file absent (an unbuilt checkout, or a watcher mid-emit that has written the root
526
+ * but not a new subpath yet) gets no alias at all, so the whole package resolves as in `package` mode. Aliasing only
527
+ * the files that exist would be worse than none: jiti matches an alias key as a prefix at a `/`, so a missing
528
+ * subpath would be rewritten onto the root's FILE (`…/index.js/<subpath>`) and fail as a module that does not exist.
529
+ * - A process running this package from SOURCE (a test runner) holds the source modules, not the build these aliases
530
+ * name, so there the configuration gets one more copy: correct, just not shared.
531
+ *
532
+ * Rejected: making this the default for one-shot readers. A reader that relies on `framework-source` to see a framework
533
+ * edit before its watcher has rebuilt (the dev companion's source-first discovery) would silently read the build.
534
+ * Choosing it is the caller's statement that the build its own process runs is the framework it means.
535
+ *
536
+ * Exported so the aliases can be pinned against a fixture package; nothing else should call it.
537
+ */
538
+ export function buildLoaderInstanceAliases(loaderPackageRoot) {
539
+ const loaderPackageJsonPath = join(loaderPackageRoot, 'package.json');
540
+ const loaderPackageJson = JSON.parse(readFileSync(loaderPackageJsonPath, 'utf8'));
541
+ const packageRoots = new Map();
542
+ if (loaderPackageJson.name)
543
+ packageRoots.set(loaderPackageJson.name, loaderPackageRoot);
544
+ for (const dependency of Object.keys({ ...loaderPackageJson.peerDependencies, ...loaderPackageJson.dependencies })) {
545
+ if (!dependency.startsWith(FRAMEWORK_PACKAGE_SCOPE) || packageRoots.has(dependency))
546
+ continue;
547
+ let dependencyPackageJsonPath;
548
+ try {
549
+ // ESM resolution from this package, as its own `import` statements resolve the dependency.
550
+ dependencyPackageJsonPath = findPackageJSON(dependency, pathToFileURL(loaderPackageJsonPath));
551
+ }
552
+ catch {
553
+ dependencyPackageJsonPath = undefined;
554
+ }
555
+ if (dependencyPackageJsonPath !== undefined)
556
+ packageRoots.set(dependency, dirname(dependencyPackageJsonPath));
557
+ }
558
+ const entries = [];
559
+ for (const [packageName, packageRoot] of packageRoots) {
560
+ const packageJson = JSON.parse(readFileSync(join(packageRoot, 'package.json'), 'utf8'));
561
+ const packageEntries = [];
562
+ let everyBuiltFileExists = true;
563
+ for (const [exportKey, exportValue] of Object.entries(packageJson.exports ?? {})) {
564
+ const builtFile = typeof exportValue === 'string'
565
+ ? exportValue
566
+ : typeof exportValue?.import === 'string'
567
+ ? exportValue.import
568
+ : typeof exportValue?.default === 'string' ? exportValue.default : undefined;
569
+ if (builtFile === undefined || !builtFile.startsWith('./'))
570
+ continue;
571
+ const builtPath = resolve(packageRoot, builtFile);
572
+ if (!isPathInsideRoot(builtPath, packageRoot)) {
573
+ throw new Error(`Framework package export "${exportKey}" of "${packageName}" escapes "${packageRoot}".`);
574
+ }
575
+ if (!existsSync(builtPath)) {
576
+ everyBuiltFileExists = false;
577
+ break;
578
+ }
579
+ packageEntries.push([exportKey === '.' ? packageName : `${packageName}/${exportKey.slice(2)}`, builtPath]);
580
+ }
581
+ if (everyBuiltFileExists)
582
+ entries.push(...packageEntries);
583
+ }
584
+ // jiti matches alias keys as prefixes, so a subpath must be tried before its package root.
585
+ entries.sort(([left], [right]) => right.length - left.length || left.localeCompare(right));
586
+ return Object.fromEntries(entries);
587
+ }
588
+ /** The scope every framework package is published under. */
589
+ const FRAMEWORK_PACKAGE_SCOPE = '@wildo-ai/';
380
590
  function inferPackageCompanionModuleResolution(packageRoot) {
381
591
  return inferConfigModuleResolution(packageRoot, dirname(fileURLToPath(import.meta.url)));
382
592
  }
383
593
  function inferConfigModuleResolution(targetPath, loaderModuleDirectory) {
384
594
  const frameworkWorkspaceRoot = tryResolveLoaderWorkspaceRoot(loaderModuleDirectory);
385
595
  if (!frameworkWorkspaceRoot) {
386
- return 'package';
596
+ return ConfigModuleResolution.PACKAGE;
387
597
  }
388
598
  return isPathInsideRoot(targetPath, frameworkWorkspaceRoot)
389
- ? 'framework-source'
390
- : 'package';
599
+ ? ConfigModuleResolution.FRAMEWORK_SOURCE
600
+ : ConfigModuleResolution.PACKAGE;
391
601
  }
392
602
  function isPathInsideRoot(pathToCheck, root) {
393
603
  const relativePath = relative(resolve(root), resolve(pathToCheck));
@@ -427,6 +637,9 @@ export function resolveInfraEnvConfigPath(saasRoot, envName) {
427
637
  * does not need it; a long-lived reader whose question is "what does the file say NOW" does — the dev companion
428
638
  * reads the application's declared store through here, and a cached evaluation would keep answering with the
429
639
  * store the file declared when the process first read it (see {@link LoadConfigOptions.freshModuleCache}).
640
+ *
641
+ * `moduleResolution` decides how the file's own imports are evaluated (see {@link LoadConfigOptions.moduleResolution}),
642
+ * for the application's descriptor and, when it is hosted, for its host's alike. Omitted, the loader infers it.
430
643
  */
431
644
  export async function loadInfraEnvConfig(saasRoot, envName, options) {
432
645
  const authored = await loadAuthoredInfraEnvConfigFile(saasRoot, envName, options);
@@ -510,6 +723,7 @@ async function loadAuthoredInfraEnvConfigFile(saasRoot, envName, options) {
510
723
  const config = await loadConfig(resolve(path), {
511
724
  artifactLocation: { zone: ConfigArtifactsZone.SAAS, ownerRoot: saasRoot },
512
725
  ...(options?.freshModuleCache === true ? { freshModuleCache: true } : {}),
726
+ ...(options?.moduleResolution === undefined ? {} : { moduleResolution: options.moduleResolution }),
513
727
  });
514
728
  if (config.environment !== envName) {
515
729
  throw new Error(`Authored env descriptor mismatch: directory '${envName}' does not match authored environment '${config.environment}'.`);