@wildo-ai/platform-config-lib 1.1.11 → 1.1.13

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 (389) 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.map +1 -1
  6. package/dist/esm/blueprint/anchored-region.js.map +1 -1
  7. package/dist/esm/blueprint/blueprint.schemas.d.ts +0 -89
  8. package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -1
  9. package/dist/esm/blueprint/blueprint.schemas.js.map +1 -1
  10. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  11. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  12. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -1
  13. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -1
  14. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  15. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  16. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  17. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +8 -1
  19. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  20. package/dist/esm/bootstrap/bootstrap.schemas.js +15 -1
  21. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  22. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +10 -2
  23. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +10 -2
  25. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  26. package/dist/esm/bootstrap/platform-store-preconnect.d.ts +21 -0
  27. package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/platform-store-preconnect.js +25 -0
  29. package/dist/esm/bootstrap/platform-store-preconnect.js.map +1 -1
  30. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +80 -0
  31. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -0
  32. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +81 -0
  33. package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -0
  34. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +41 -9
  35. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/runtime-backing-service-access.js +77 -28
  37. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-network-policy.d.ts +117 -12
  39. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
  40. package/dist/esm/bootstrap/runtime-network-policy.js +222 -23
  41. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -1
  42. package/dist/esm/bootstrap/runtime-network-topology.d.ts +31 -4
  43. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
  44. package/dist/esm/bootstrap/runtime-network-topology.js +43 -2
  45. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -1
  46. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
  47. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -1
  48. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +40 -2
  49. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
  50. package/dist/esm/bootstrap/runtime-principal.contracts.js +66 -3
  51. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -1
  52. package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -1
  53. package/dist/esm/bootstrap/runtime-response-integrity.js +3 -3
  54. package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -1
  55. package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -1
  56. package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -1
  57. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  58. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  59. package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
  61. package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -1
  62. package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -1
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -1
  64. package/dist/esm/config-authoring.entry.js.map +1 -1
  65. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  66. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  67. package/dist/esm/index.d.ts +5 -1
  68. package/dist/esm/index.d.ts.map +1 -1
  69. package/dist/esm/index.js +5 -1
  70. package/dist/esm/index.js.map +1 -1
  71. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts +119 -0
  72. package/dist/esm/key-management/application-legacy-envelope-key.contracts.d.ts.map +1 -0
  73. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js +109 -0
  74. package/dist/esm/key-management/application-legacy-envelope-key.contracts.js.map +1 -0
  75. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts +182 -0
  76. package/dist/esm/key-management/application-signing-key-rotation.contracts.d.ts.map +1 -0
  77. package/dist/esm/key-management/application-signing-key-rotation.contracts.js +145 -0
  78. package/dist/esm/key-management/application-signing-key-rotation.contracts.js.map +1 -0
  79. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts +156 -0
  80. package/dist/esm/key-management/approval-seal-manifested-copy.d.ts.map +1 -0
  81. package/dist/esm/key-management/approval-seal-manifested-copy.js +617 -0
  82. package/dist/esm/key-management/approval-seal-manifested-copy.js.map +1 -0
  83. package/dist/esm/key-management/approval-seal-verifier.d.ts +114 -40
  84. package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
  85. package/dist/esm/key-management/approval-seal-verifier.js +143 -12
  86. package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
  87. package/dist/esm/key-management/approval-seal.contracts.d.ts +12 -15
  88. package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -1
  89. package/dist/esm/key-management/approval-seal.contracts.js +20 -0
  90. package/dist/esm/key-management/approval-seal.contracts.js.map +1 -1
  91. package/dist/esm/key-management/data-key.contracts.d.ts +0 -2
  92. package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -1
  93. package/dist/esm/key-management/data-key.contracts.js.map +1 -1
  94. package/dist/esm/key-management/es256-jws.d.ts.map +1 -1
  95. package/dist/esm/key-management/es256-jws.js.map +1 -1
  96. package/dist/esm/key-management/key-provider.spi.d.ts +8 -1
  97. package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -1
  98. package/dist/esm/key-management/key-provider.spi.js.map +1 -1
  99. package/dist/esm/key-management/keyring-rotation.contracts.d.ts +2 -12
  100. package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -1
  101. package/dist/esm/key-management/keyring-rotation.contracts.js +3 -3
  102. package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -1
  103. package/dist/esm/key-management/keyring-status.contracts.d.ts +0 -7
  104. package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -1
  105. package/dist/esm/key-management/keyring-status.contracts.js.map +1 -1
  106. package/dist/esm/key-management/pdf-incremental-update.d.ts +158 -0
  107. package/dist/esm/key-management/pdf-incremental-update.d.ts.map +1 -0
  108. package/dist/esm/key-management/pdf-incremental-update.js +730 -0
  109. package/dist/esm/key-management/pdf-incremental-update.js.map +1 -0
  110. package/dist/esm/key-management/pdf-truetype-font.d.ts +35 -0
  111. package/dist/esm/key-management/pdf-truetype-font.d.ts.map +1 -0
  112. package/dist/esm/key-management/pdf-truetype-font.js +152 -0
  113. package/dist/esm/key-management/pdf-truetype-font.js.map +1 -0
  114. package/dist/esm/key-management/qr-code.d.ts +38 -0
  115. package/dist/esm/key-management/qr-code.d.ts.map +1 -0
  116. package/dist/esm/key-management/qr-code.js +325 -0
  117. package/dist/esm/key-management/qr-code.js.map +1 -0
  118. package/dist/esm/key-management/signature-request.contracts.d.ts +0 -4
  119. package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -1
  120. package/dist/esm/key-management/signature-request.contracts.js.map +1 -1
  121. package/dist/esm/key-management/signing-log-export.contracts.d.ts +0 -1
  122. package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -1
  123. package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -1
  124. package/dist/esm/key-management/vault-custody.contracts.d.ts +43 -0
  125. package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -1
  126. package/dist/esm/key-management/vault-custody.contracts.js +66 -0
  127. package/dist/esm/key-management/vault-custody.contracts.js.map +1 -1
  128. package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -1
  129. package/dist/esm/lockfile/build-parallelism.js.map +1 -1
  130. package/dist/esm/lockfile/canonical-json.d.ts +1 -1
  131. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -1
  132. package/dist/esm/lockfile/canonical-json.js +1 -1
  133. package/dist/esm/lockfile/canonical-json.js.map +1 -1
  134. package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
  135. package/dist/esm/lockfile/file-lock-hold.js +2 -1
  136. package/dist/esm/lockfile/file-lock-hold.js.map +1 -1
  137. package/dist/esm/lockfile/lockfile-io.d.ts +6 -8
  138. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
  139. package/dist/esm/lockfile/lockfile-io.js +6 -8
  140. package/dist/esm/lockfile/lockfile-io.js.map +1 -1
  141. package/dist/esm/lockfile/materialize-infra-section.d.ts +5 -6
  142. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
  143. package/dist/esm/lockfile/materialize-infra-section.js +4 -5
  144. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
  145. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +1 -247
  146. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
  147. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +1 -1
  148. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
  149. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +146 -0
  150. package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts.map +1 -0
  151. package/dist/esm/pnpm-settings/application-pnpm-settings.js +573 -0
  152. package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -0
  153. package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
  154. package/dist/esm/project-config/application-public-pricing-catalog.loader.js +15 -3
  155. package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
  156. package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -1
  157. package/dist/esm/project-config/application-served-public-documents.loader.js +16 -8
  158. package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -1
  159. package/dist/esm/project-config/backend-compliance-section.reader.d.ts +35 -0
  160. package/dist/esm/project-config/backend-compliance-section.reader.d.ts.map +1 -0
  161. package/dist/esm/project-config/backend-compliance-section.reader.js +123 -0
  162. package/dist/esm/project-config/backend-compliance-section.reader.js.map +1 -0
  163. package/dist/esm/project-config/backend-compliance-section.worker.d.ts +20 -0
  164. package/dist/esm/project-config/backend-compliance-section.worker.d.ts.map +1 -0
  165. package/dist/esm/project-config/backend-compliance-section.worker.js +78 -0
  166. package/dist/esm/project-config/backend-compliance-section.worker.js.map +1 -0
  167. package/dist/esm/project-config/config-module-resolution.d.ts +32 -0
  168. package/dist/esm/project-config/config-module-resolution.d.ts.map +1 -0
  169. package/dist/esm/project-config/config-module-resolution.js +33 -0
  170. package/dist/esm/project-config/config-module-resolution.js.map +1 -0
  171. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  172. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  173. package/dist/esm/project-config/define-infra-env-config.d.ts +146 -55
  174. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
  175. package/dist/esm/project-config/define-infra-env-config.js +124 -71
  176. package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
  177. package/dist/esm/project-config/define-minion-config.d.ts +26 -36
  178. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  179. package/dist/esm/project-config/define-minion-config.js +64 -25
  180. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  181. package/dist/esm/project-config/define-saas-config.d.ts +41 -437
  182. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  183. package/dist/esm/project-config/define-saas-config.js +102 -94
  184. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  185. package/dist/esm/project-config/define-worker-config.d.ts +10 -20
  186. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  187. package/dist/esm/project-config/define-worker-config.js +10 -12
  188. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  189. package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
  190. package/dist/esm/project-config/hosted-infra-env-config.js +2 -1
  191. package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
  192. package/dist/esm/project-config/index.d.ts +2 -0
  193. package/dist/esm/project-config/index.d.ts.map +1 -1
  194. package/dist/esm/project-config/index.js +2 -0
  195. package/dist/esm/project-config/index.js.map +1 -1
  196. package/dist/esm/project-config/loader-instances-zod.d.ts +19 -0
  197. package/dist/esm/project-config/loader-instances-zod.d.ts.map +1 -0
  198. package/dist/esm/project-config/loader-instances-zod.js +40 -0
  199. package/dist/esm/project-config/loader-instances-zod.js.map +1 -0
  200. package/dist/esm/project-config/loader.d.ts +131 -14
  201. package/dist/esm/project-config/loader.d.ts.map +1 -1
  202. package/dist/esm/project-config/loader.js +226 -12
  203. package/dist/esm/project-config/loader.js.map +1 -1
  204. package/dist/esm/project-config/minion-liveness.contracts.d.ts +131 -0
  205. package/dist/esm/project-config/minion-liveness.contracts.d.ts.map +1 -0
  206. package/dist/esm/project-config/minion-liveness.contracts.js +167 -0
  207. package/dist/esm/project-config/minion-liveness.contracts.js.map +1 -0
  208. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -1
  209. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -1
  210. package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
  211. package/dist/esm/project-config/npm-version-range.js.map +1 -1
  212. package/dist/esm/project-config/owning-package-tsconfig.d.ts +7 -7
  213. package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -1
  214. package/dist/esm/project-config/owning-package-tsconfig.js +7 -7
  215. package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -1
  216. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
  217. package/dist/esm/project-config/provider-catalog-types.js.map +1 -1
  218. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
  219. package/dist/esm/project-config/provider-companion-discovery.js +3 -1
  220. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
  221. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -46
  222. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
  223. package/dist/esm/project-config/provider-runtime-artifacts.js +150 -4
  224. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
  225. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +0 -2
  226. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
  227. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -1
  228. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  229. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  230. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  231. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  232. package/dist/esm/project-config/shared/auth.schemas.d.ts +0 -17
  233. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
  234. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
  235. package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
  236. package/dist/esm/project-config/shared/backing-service-servability.js.map +1 -1
  237. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +9 -10
  238. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  239. package/dist/esm/project-config/shared/backing-services.schemas.js +13 -15
  240. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  241. package/dist/esm/project-config/shared/cdn.schemas.d.ts +0 -51
  242. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
  243. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -1
  244. package/dist/esm/project-config/shared/csp-defaults.d.ts +34 -6
  245. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
  246. package/dist/esm/project-config/shared/csp-defaults.js +52 -8
  247. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
  248. package/dist/esm/project-config/shared/csp-emit.d.ts +60 -13
  249. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
  250. package/dist/esm/project-config/shared/csp-emit.js +77 -24
  251. package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
  252. package/dist/esm/project-config/shared/csp.schemas.d.ts +72 -84
  253. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
  254. package/dist/esm/project-config/shared/csp.schemas.js +40 -12
  255. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
  256. package/dist/esm/project-config/shared/data-services.schemas.d.ts +0 -8
  257. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  258. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  259. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  260. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  261. package/dist/esm/project-config/shared/environment.schemas.d.ts +95 -8
  262. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  263. package/dist/esm/project-config/shared/environment.schemas.js +122 -10
  264. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  265. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +10 -4
  266. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
  267. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
  268. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
  269. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -1
  270. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -1
  271. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  272. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +1 -1
  273. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  274. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  275. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  276. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
  277. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
  278. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +20 -0
  279. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
  280. package/dist/esm/project-config/shared/minion-resource-access.validation.js +21 -2
  281. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
  282. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -1
  283. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -1
  284. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +67 -38
  285. package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -1
  286. package/dist/esm/project-config/shared/platform-key-management.schemas.js +113 -5
  287. package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -1
  288. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  289. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  290. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +2 -2
  291. package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
  292. package/dist/esm/project-config/shared/platform-storage.schemas.js +16 -2
  293. package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -1
  294. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +21 -23
  295. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  296. package/dist/esm/project-config/shared/service-definitions.schemas.js +4 -5
  297. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  298. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts +0 -18
  299. package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
  300. package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -1
  301. package/dist/esm/project-config/static-asset-import-noop.d.ts +20 -3
  302. package/dist/esm/project-config/static-asset-import-noop.d.ts.map +1 -1
  303. package/dist/esm/project-config/static-asset-import-noop.js +36 -20
  304. package/dist/esm/project-config/static-asset-import-noop.js.map +1 -1
  305. package/dist/esm/registry/artifact-domain.schemas.d.ts +0 -5
  306. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
  307. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -1
  308. package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
  309. package/dist/esm/registry/digest.schemas.js.map +1 -1
  310. package/dist/esm/registry/index.d.ts +2 -3
  311. package/dist/esm/registry/index.d.ts.map +1 -1
  312. package/dist/esm/registry/index.js +2 -3
  313. package/dist/esm/registry/index.js.map +1 -1
  314. package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
  315. package/dist/esm/registry/local-checkout-source.js.map +1 -1
  316. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +1 -98
  317. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
  318. package/dist/esm/registry/lockfile-modules-section.schemas.js +1 -2
  319. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -1
  320. package/dist/esm/registry/module-artifact.schemas.d.ts +17 -17
  321. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
  322. package/dist/esm/registry/module-artifact.schemas.js.map +1 -1
  323. package/dist/esm/registry/module-manifest.schemas.d.ts +151 -219
  324. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
  325. package/dist/esm/registry/module-manifest.schemas.js +145 -13
  326. package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
  327. package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
  328. package/dist/esm/registry/module-search.schemas.js.map +1 -1
  329. package/dist/esm/registry/registry-config.schemas.d.ts +0 -18
  330. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
  331. package/dist/esm/registry/registry-config.schemas.js.map +1 -1
  332. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -1
  333. package/dist/esm/registry/registry-defaults.constants.js.map +1 -1
  334. package/dist/esm/registry/registry-errors.d.ts +81 -3
  335. package/dist/esm/registry/registry-errors.d.ts.map +1 -1
  336. package/dist/esm/registry/registry-errors.js +185 -4
  337. package/dist/esm/registry/registry-errors.js.map +1 -1
  338. package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
  339. package/dist/esm/registry/registry-keys.schemas.js.map +1 -1
  340. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
  341. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -1
  342. package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -1
  343. package/dist/esm/registry/registry-url-resolution.js.map +1 -1
  344. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  345. package/dist/esm/release/framework-release.constants.js.map +1 -1
  346. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  347. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  348. package/dist/esm/schemas/framework-secrets.schemas.d.ts +0 -7
  349. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  350. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  351. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  352. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  353. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  354. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +1 -1
  355. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  356. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  357. package/dist/esm/schemas/platform-config.schemas.d.ts +2 -2
  358. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  359. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  360. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
  361. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -1
  362. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  363. package/dist/esm/workspace-scope/index.js.map +1 -1
  364. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
  365. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -1
  366. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
  367. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
  368. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  369. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  370. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  371. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  372. package/dist/tsconfig.build.tsbuildinfo +1 -1
  373. package/package.json +12 -12
  374. package/dist/esm/_unimplemented/index.d.ts +0 -3
  375. package/dist/esm/_unimplemented/index.d.ts.map +0 -1
  376. package/dist/esm/_unimplemented/index.js +0 -3
  377. package/dist/esm/_unimplemented/index.js.map +0 -1
  378. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +0 -137
  379. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +0 -1
  380. package/dist/esm/_unimplemented/unimplemented-field-warning.js +0 -153
  381. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +0 -1
  382. package/dist/esm/project-config/shared/cdn.example.d.ts +0 -14
  383. package/dist/esm/project-config/shared/cdn.example.d.ts.map +0 -1
  384. package/dist/esm/project-config/shared/cdn.example.js +0 -38
  385. package/dist/esm/project-config/shared/cdn.example.js.map +0 -1
  386. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +0 -15
  387. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +0 -1
  388. package/dist/esm/project-config/shared/schema-version.schemas.js +0 -40
  389. package/dist/esm/project-config/shared/schema-version.schemas.js.map +0 -1
@@ -31,6 +31,13 @@ export var WildoRuntimeNetwork;
31
31
  WildoRuntimeNetwork["DATA_AUDIT"] = "wildo-data-audit";
32
32
  /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */
33
33
  WildoRuntimeNetwork["DATA_TELEMETRY"] = "wildo-data-telemetry";
34
+ /**
35
+ * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no
36
+ * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are
37
+ * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the
38
+ * way the compose lane always has).
39
+ */
40
+ WildoRuntimeNetwork["DATA_KEYS"] = "wildo-data-keys";
34
41
  /**
35
42
  * The ONLY non-internal network below the edge. Attachment to any non-internal
36
43
  * network restores NAT, so "can this runtime reach the internet?" is decided
@@ -88,7 +95,7 @@ export const NETWORK_FOR_CAPABILITY = {
88
95
  * grants no application data.
89
96
  */
90
97
  export function resolveRuntimeNetworkMembership(principal, declaration, options) {
91
- const access = resolveRuntimeBackingServiceAccess(principal, declaration);
98
+ const access = resolveRuntimeBackingServiceAccess(principal, declaration, options);
92
99
  const networks = new Set();
93
100
  // PLATFORM is for runtimes that FETCH their own bootstrap material — every
94
101
  // runtime principal does, including a worker that holds no backing-service
@@ -112,7 +119,7 @@ export function resolveRuntimeNetworkMembership(principal, declaration, options)
112
119
  // not of what the runtime declared, so it arrives separately rather than being
113
120
  // inferred from the principal kind — an application backend that serves no
114
121
  // public route should not be on the edge merely for being a backend.
115
- if (options?.servesHttp)
122
+ if (options.servesHttp)
116
123
  networks.add(WildoRuntimeNetwork.EDGE);
117
124
  // Authored, never inferred. See `RuntimeBackingServiceAccess`.
118
125
  if (access.requiresInternetEgress)
@@ -129,4 +136,38 @@ export function resolveRuntimeNetworkMembership(principal, declaration, options)
129
136
  export function isInternalNetwork(network) {
130
137
  return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;
131
138
  }
139
+ /**
140
+ * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and
141
+ * the self-hosted application stack).
142
+ *
143
+ * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a
144
+ * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data
145
+ * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`
146
+ * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.
147
+ */
148
+ export const COMPOSE_NETWORK_NAME = {
149
+ [WildoRuntimeNetwork.EDGE]: 'wildo-edge',
150
+ [WildoRuntimeNetwork.PLATFORM]: 'wildo-platform-net',
151
+ [WildoRuntimeNetwork.DATA_MONGO]: 'wildo-data-mongo',
152
+ [WildoRuntimeNetwork.DATA_POSTGRES]: 'wildo-data-postgres',
153
+ [WildoRuntimeNetwork.DATA_REDIS]: 'wildo-data-redis',
154
+ [WildoRuntimeNetwork.DATA_RABBIT]: 'wildo-data-rabbit',
155
+ [WildoRuntimeNetwork.DATA_OBJECTS]: 'wildo-data-objects',
156
+ [WildoRuntimeNetwork.DATA_ANTIVIRUS]: 'wildo-data-antivirus',
157
+ [WildoRuntimeNetwork.DATA_AUDIT]: 'wildo-data-audit',
158
+ [WildoRuntimeNetwork.DATA_TELEMETRY]: 'wildo-data-telemetry',
159
+ [WildoRuntimeNetwork.DATA_KEYS]: 'wildo-data-keys',
160
+ [WildoRuntimeNetwork.EGRESS]: null,
161
+ };
162
+ /**
163
+ * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and
164
+ * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.
165
+ */
166
+ export function resolveRuntimeComposeNetworks(principal, declaration, options) {
167
+ const membership = resolveRuntimeNetworkMembership(principal, declaration, options);
168
+ return Object.values(WildoRuntimeNetwork)
169
+ .filter((network) => membership.has(network))
170
+ .map((network) => COMPOSE_NETWORK_NAME[network])
171
+ .filter((name) => name !== null);
172
+ }
132
173
  //# sourceMappingURL=runtime-network-topology.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAEnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBA0BX;AA1BD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8FAA8F;IAC9F,sDAA+B,CAAA;IAC/B,0FAA0F;IAC1F,8DAAuC,CAAA;IACvC;;;;;OAKG;IACH,8CAAuB,CAAA;AACzB,CAA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AC/E,+EAA+E;IAC/E,qCAAqC;IACrC,IAAI,SAAS;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE1D,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,sBAAsB,CAAC,UAAU,CAAC,CAAC;QACnD,IAAI,OAAO;YAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,4EAA4E;IAC5E,+EAA+E;IAC/E,2EAA2E;IAC3E,qEAAqE;IACrE,IAAI,OAAO,EAAE,UAAU;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAEhE,+DAA+D;IAC/D,IAAI,MAAM,CAAC,sBAAsB;QAAE,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAE5E,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAAO,OAAO,KAAK,mBAAmB,CAAC,IAAI,IAAI,OAAO,KAAK,mBAAmB,CAAC,MAAM,CAAC;AACxF,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration?: RuntimeAccessDeclaration | undefined,\n options?: { readonly servesHttp?: boolean },\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options?.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n"]}
1
+ {"version":3,"file":"runtime-network-topology.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-network-topology.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EACL,kCAAkC,GAGnC,MAAM,kCAAkC,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,mBAiCX;AAjCD,WAAY,mBAAmB;IAC7B,sFAAsF;IACtF,0CAAmB,CAAA;IACnB;;;;OAIG;IACH,kDAA2B,CAAA;IAC3B,sDAA+B,CAAA;IAC/B,4DAAqC,CAAA;IACrC,sDAA+B,CAAA;IAC/B,wDAAiC,CAAA;IACjC,0DAAmC,CAAA;IACnC,8DAAuC,CAAA;IACvC,8FAA8F;IAC9F,sDAA+B,CAAA;IAC/B,0FAA0F;IAC1F,8DAAuC,CAAA;IACvC;;;;;OA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ACtD,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,oBAAoB;IACxD,CAAC,mBAAmB,CAAC,cAAc,CAAC,EAAE,sBAAsB;IAC5D,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,kBAAkB;IACpD,CAAC,mBAAmB,CAAC,cAAc,CAAC,EAAE,sBAAsB;IAC5D,CAAC,mBAAmB,CAAC,SAAS,CAAC,EAAE,iBAAiB;IAClD,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,IAAI;CACnC,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAC3C,SAAkD,EAClD,WAAiD,EACjD,OAAwC;IAExC,MAAM,UAAU,GAAG,+BAA+B,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IACpF,OAAO,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;SACtC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SAC5C,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;SAC/C,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { InfraCapability } from '../project-config/shared/infra-providers.schemas';\nimport type { ApplicationRuntimePrincipal } from './runtime-principal.contracts';\nimport {\n resolveRuntimeBackingServiceAccess,\n type RuntimeAccessDeclaration,\n type RuntimeApplicationStores,\n} from './runtime-backing-service-access';\n\n/**\n * The network segments a Wildo deployment is divided into (Step 5-egress).\n *\n * Docker Compose has no `NetworkPolicy` object, but it has the mechanism that\n * matters for the destination half: membership of user-defined bridge networks,\n * with per-network embedded DNS. A container not attached to a network can\n * neither resolve nor route to the services on it — deny-by-default at the\n * network level. Kubernetes expresses the same division as `NetworkPolicy`\n * egress rules. Both renderers derive from THIS enum so they cannot describe\n * different topologies.\n */\nexport enum WildoRuntimeNetwork {\n /** Reverse proxy + every container serving HTTP. Not internal: it faces the world. */\n EDGE = 'wildo-edge',\n /**\n * The control plane — apps-manager, module-registry, crontabs — plus every\n * runtime that must fetch its secrets and configuration. Internal: nothing here\n * needs a route off the host.\n */\n PLATFORM = 'wildo-platform',\n DATA_MONGO = 'wildo-data-mongo',\n DATA_POSTGRES = 'wildo-data-postgres',\n DATA_REDIS = 'wildo-data-redis',\n DATA_RABBIT = 'wildo-data-rabbit',\n DATA_OBJECTS = 'wildo-data-objects',\n DATA_ANTIVIRUS = 'wildo-data-antivirus',\n /** Tamper-evident audit-log storage (immudb) — a service of its own, not a database table. */\n DATA_AUDIT = 'wildo-data-audit',\n /** The OTel collector. Nearly every runtime emits to it; almost nothing reads from it. */\n DATA_TELEMETRY = 'wildo-data-telemetry',\n /**\n * The platform's own key custodian (#2933, the self-hosted OpenBao). No application runtime joins it: no\n * {@link InfraCapability} maps here, so {@link resolveRuntimeNetworkMembership} can never return it. Its members are\n * the Vault itself and apps-manager, its only client (#3372 named it here so the Kubernetes lane can segment it the\n * way the compose lane always has).\n */\n DATA_KEYS = 'wildo-data-keys',\n /**\n * The ONLY non-internal network below the edge. Attachment to any non-internal\n * network restores NAT, so \"can this runtime reach the internet?\" is decided\n * here and nowhere else — marking the data networks internal is necessary but\n * not sufficient.\n */\n EGRESS = 'wildo-egress',\n}\n\n/**\n * Which network serves each backing-service capability.\n *\n * A total `Record`, deliberately: adding a member to {@link InfraCapability}\n * becomes a COMPILE ERROR here rather than a capability that silently reaches no\n * network — or worse, one whose runtimes silently keep the flat-network\n * reachability this segmentation exists to remove. `null` means the capability\n * needs no network of its own, and every `null` states why.\n */\nexport const NETWORK_FOR_CAPABILITY: Record<InfraCapability, WildoRuntimeNetwork | null> = {\n [InfraCapability.DOCUMENT_DATABASE]: WildoRuntimeNetwork.DATA_MONGO,\n [InfraCapability.RELATIONAL_DATABASE]: WildoRuntimeNetwork.DATA_POSTGRES,\n [InfraCapability.CACHE_MANAGER]: WildoRuntimeNetwork.DATA_REDIS,\n [InfraCapability.QUEUING_SYSTEM]: WildoRuntimeNetwork.DATA_RABBIT,\n [InfraCapability.OBJECT_STORAGE]: WildoRuntimeNetwork.DATA_OBJECTS,\n [InfraCapability.ANTIVIRUS_SCANNING]: WildoRuntimeNetwork.DATA_ANTIVIRUS,\n // ⚠️ CORRECTED 2026-08-12. Both of the entries below were `null`, on reasoning\n // that measurement disproved while building the 5B service table:\n //\n // - AUDIT_LOG_STORAGE was \"served BY the document/relational database\". It is\n // not: `immudb` is a service of its own, with its own container, and a\n // runtime that writes audit records dials IT rather than a database table.\n // - METRICS_TELEMETRY was \"no application runtime dials them directly today\".\n // Also false — runtimes emit spans and metrics to the collector, and that\n // traffic is live in development. A `null` here would have cut tracing for\n // every runtime the moment segmentation was enforced, with NO readiness\n // check covering it: a first-use failure, silent until someone noticed spans\n // had stopped.\n [InfraCapability.AUDIT_LOG_STORAGE]: WildoRuntimeNetwork.DATA_AUDIT,\n [InfraCapability.METRICS_TELEMETRY]: WildoRuntimeNetwork.DATA_TELEMETRY,\n // Backup remains genuinely operator-side: no application runtime dials it, and\n // the backup tooling runs outside the application's network entirely.\n [InfraCapability.BACKUP_MANAGER]: null,\n};\n\n/**\n * What a deployment lane knows beyond the runtime's own declaration: the application's store (#3367), required so no\n * lane can omit it and keep a route to the other store, and whether a proxy routes HTTP to the container.\n */\nexport interface RuntimeNetworkMembershipOptions extends RuntimeApplicationStores {\n readonly servesHttp?: boolean;\n}\n\n/**\n * The networks a runtime's container joins.\n *\n * Derived from the SAME declaration as its credentials and its environment\n * topology — see {@link resolveRuntimeBackingServiceAccess}. That is the whole\n * point: a runtime kept off a service's network must also not hold that service's\n * credential nor receive its connect URL, and the only way three enforcement\n * points stay in agreement is by not deriving the answer three times.\n *\n * `PLATFORM` is unconditional. Every runtime — including a worker, which holds no\n * backing-service credentials at all — must reach apps-manager to fetch its own\n * bootstrap material. Withholding it would strand every runtime at boot, and it\n * grants no application data.\n */\nexport function resolveRuntimeNetworkMembership(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: RuntimeAccessDeclaration | undefined,\n options: RuntimeNetworkMembershipOptions,\n): ReadonlySet<WildoRuntimeNetwork> {\n const access = resolveRuntimeBackingServiceAccess(principal, declaration, options);\n const networks = new Set<WildoRuntimeNetwork>();\n\n // PLATFORM is for runtimes that FETCH their own bootstrap material — every\n // runtime principal does, including a worker that holds no backing-service\n // credentials at all. A caller with NO principal is not a runtime principal:\n // today that is the static frontend, an nginx container that authenticates to\n // nothing and has no bootstrap material to fetch.\n //\n // This was previously unconditional, which put that frontend on the platform\n // segment. Harmless — the segment carries no application data and the container\n // could not authenticate anyway — but it is reachability nobody asked for, and\n // \"unconditional because every case so far needed it\" is exactly the default a\n // later reader assumes was measured.\n if (principal) networks.add(WildoRuntimeNetwork.PLATFORM);\n\n for (const capability of access.capabilities) {\n const network = NETWORK_FOR_CAPABILITY[capability];\n if (network) networks.add(network);\n }\n\n // Serving HTTP is a property of the DEPLOYMENT (does a proxy route to it?),\n // not of what the runtime declared, so it arrives separately rather than being\n // inferred from the principal kind — an application backend that serves no\n // public route should not be on the edge merely for being a backend.\n if (options.servesHttp) networks.add(WildoRuntimeNetwork.EDGE);\n\n // Authored, never inferred. See `RuntimeBackingServiceAccess`.\n if (access.requiresInternetEgress) networks.add(WildoRuntimeNetwork.EGRESS);\n\n return networks;\n}\n\n/**\n * Networks that must be declared `internal: true`.\n *\n * Derived by EXCLUSION from the two that legitimately carry a route off the host,\n * so a network added to the enum is internal by default. The safe posture is the\n * one you get by not thinking about it.\n */\nexport function isInternalNetwork(network: WildoRuntimeNetwork): boolean {\n return network !== WildoRuntimeNetwork.EDGE && network !== WildoRuntimeNetwork.EGRESS;\n}\n\n/**\n * The Docker Compose network NAME of each runtime segment, for the compose lanes (the platform stack's app runtimes and\n * the self-hosted application stack).\n *\n * Total over {@link WildoRuntimeNetwork}, so a segment added there is a compile error here rather than a membership a\n * compose file silently drops. `null` means compose declares no such network: `EGRESS`, because the compose data\n * segments are `internal: true` and no compose file declares an egress network, so an authored `requiresInternetEgress`\n * cannot be expressed there; it stays a Kubernetes `NetworkPolicy` fact.\n */\nexport const COMPOSE_NETWORK_NAME: Record<WildoRuntimeNetwork, string | null> = {\n [WildoRuntimeNetwork.EDGE]: 'wildo-edge',\n [WildoRuntimeNetwork.PLATFORM]: 'wildo-platform-net',\n [WildoRuntimeNetwork.DATA_MONGO]: 'wildo-data-mongo',\n [WildoRuntimeNetwork.DATA_POSTGRES]: 'wildo-data-postgres',\n [WildoRuntimeNetwork.DATA_REDIS]: 'wildo-data-redis',\n [WildoRuntimeNetwork.DATA_RABBIT]: 'wildo-data-rabbit',\n [WildoRuntimeNetwork.DATA_OBJECTS]: 'wildo-data-objects',\n [WildoRuntimeNetwork.DATA_ANTIVIRUS]: 'wildo-data-antivirus',\n [WildoRuntimeNetwork.DATA_AUDIT]: 'wildo-data-audit',\n [WildoRuntimeNetwork.DATA_TELEMETRY]: 'wildo-data-telemetry',\n [WildoRuntimeNetwork.DATA_KEYS]: 'wildo-data-keys',\n [WildoRuntimeNetwork.EGRESS]: null,\n};\n\n/**\n * A runtime's compose networks: {@link resolveRuntimeNetworkMembership}, the one derivation the Kubernetes pod labels and\n * the runtime's environment also read, named for compose and in segment order so a rendered file is stable between syncs.\n */\nexport function resolveRuntimeComposeNetworks(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: RuntimeAccessDeclaration | undefined,\n options: RuntimeNetworkMembershipOptions,\n): string[] {\n const membership = resolveRuntimeNetworkMembership(principal, declaration, options);\n return Object.values(WildoRuntimeNetwork)\n .filter((network) => membership.has(network))\n .map((network) => COMPOSE_NETWORK_NAME[network])\n .filter((name): name is string => name !== null);\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-platform-access.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAGlH,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAEvG;;;;;;;;;;;;;;;GAeG;AAGH,kEAAkE;AAClE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,+BAA+B,GAAG,SAAS,GACvD;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQxC"}
1
+ {"version":3,"file":"runtime-platform-access.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAGlH,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAEvG;;;;;;;;;;;;;;;GAeG;AAGH,kEAAkE;AAClE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,2BAA2B,GAAG,SAAS,EAClD,WAAW,EAAE,+BAA+B,GAAG,SAAS,GACvD;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAClH,+EAA+E;AAC/E,8DAA8D;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAyBvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAkD,EAClD,WAAwD;IAExD,2EAA2E;IAC3E,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,IAAI,SAAS,EAAE,IAAI,KAAK,+BAA+B,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n// Declared under `project-config` so an authored config can NAME it — see that\n// file for why the authoring entry cannot reach `bootstrap/`.\nimport { MinionPlatformAccessScope } from '../project-config/shared/minion-platform-access.vocabulary';\n\n/**\n * The PLATFORM-ACCESS axis (Step 3 / R4 / R5) — a minion reading its own\n * platform-level records, today its cron/schedule entries.\n *\n * ## Why this is a SECOND axis and not part of `resourceAccess`\n *\n * `resourceAccess` answers \"which of the APPLICATION's resources may this minion\n * touch?\". This answers \"may it see the PLATFORM's record OF ITSELF?\" — a\n * different subject, a different store, and a different blast radius. R5 requires\n * the two be separately declarable with neither implying the other, so nothing\n * here consults `resourceAccess` and nothing there consults this.\n *\n * A minion that declares data access but no platform access is a normal shape\n * (it works on todos, never inspects its own schedule). So is the reverse (a\n * health-reporting minion that reads its tick history and touches no app data).\n */\n\n\n/** The authored declaration — optional, and absent means none. */\nexport interface MinionPlatformAccessDeclaration {\n readonly scopes?: readonly MinionPlatformAccessScope[];\n}\n\n/**\n * A filter that can ONLY ever address the caller's own records.\n *\n * ## Scoped-to-self BY SHAPE, which is the whole point of R4\n *\n * The obvious implementation takes a minion NAME and refuses when it does not\n * match the caller. That is scoped-to-self by CHECK, and it fails the way every\n * check fails: someone adds an admin path, or an internal caller passes the name\n * it was given, and the refusal is one conditional away from gone.\n *\n * This takes **no target parameter at all**. The subject is derived from the\n * PRINCIPAL, so \"read minion B's schedule\" is not a request that gets refused —\n * it is a request that cannot be expressed. A future caller wanting cross-minion\n * reads must add a new function, which is a reviewable act, rather than passing a\n * different string to this one, which is not.\n *\n * Returns `null` when the principal may not read platform records at all, so the\n * caller has nothing to query WITH — the same fail-closed shape as\n * `deriveMinionResourceGrants` returning `null`.\n *\n * ## ⚠️ PRECONDITION: `principal` must be VERIFIED, not self-asserted\n *\n * The by-shape property above is real and it is CONDITIONAL. This function makes a\n * cross-minion read inexpressible *given a trustworthy principal* — it says\n * nothing about where the principal came from, and a caller that accepts a\n * self-asserted one has a hole this signature cannot close.\n *\n * That is not hypothetical. A minion is delivered the application's\n * `APPLICATION_PLATFORM_REQUEST` **private** key: the delivery projection strips\n * per-app CREDENTIAL paths (`database.*`) and the JWT material is not among them,\n * so it survives in the base blob. A minion can therefore sign a token naming a\n * sibling minion or the application backend, and a by-shape endpoint would\n * satisfy \"no selector exists\" while still failing R4's acceptance criterion.\n *\n * So a caller MUST obtain the principal from a party that learns it from the\n * secret PRESENTED rather than one asserted in a claim — today that is\n * apps-manager, which resolves it by matching the presenting secret against the\n * minted per-principal set. Found by the `Minion Scope` session while building the\n * transport for this axis; recorded here because the precondition belongs with the\n * contract, not only in the transport that happens to satisfy it.\n */\nexport function buildOwnCronRecordFilter(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: MinionPlatformAccessDeclaration | undefined,\n): { readonly minionName: string } | null {\n // Only a MINION has cron records of its own. The application backend reads\n // schedules through its own authority, and a worker has none — so neither is a\n // subject here, and granting them a filter would invent a record that has no\n // referent.\n if (principal?.kind !== ApplicationRuntimePrincipalKind.MINION || !principal.name) return null;\n if (!declaration?.scopes?.includes(MinionPlatformAccessScope.OWN_CRON_RECORDS)) return null;\n return { minionName: principal.name };\n}\n"]}
1
+ {"version":3,"file":"runtime-platform-access.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-platform-access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAoC,MAAM,+BAA+B,CAAC;AAClH,+EAA+E;AAC/E,8DAA8D;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AAyBvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,wBAAwB,CACtC,SAAkD,EAClD,WAAwD;IAExD,2EAA2E;IAC3E,+EAA+E;IAC/E,6EAA6E;IAC7E,YAAY;IACZ,IAAI,SAAS,EAAE,IAAI,KAAK,+BAA+B,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/F,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,yBAAyB,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5F,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC","sourcesContent":["import { ApplicationRuntimePrincipalKind, type ApplicationRuntimePrincipal } from './runtime-principal.contracts';\n// Declared under `project-config` so an authored config can NAME it — see that\n// file for why the authoring entry cannot reach `bootstrap/`.\nimport { MinionPlatformAccessScope } from '../project-config/shared/minion-platform-access.vocabulary';\n\n/**\n * The PLATFORM-ACCESS axis (Step 3 / R4 / R5) — a minion reading its own\n * platform-level records, today its cron/schedule entries.\n *\n * ## Why this is a SECOND axis and not part of `resourceAccess`\n *\n * `resourceAccess` answers \"which of the APPLICATION's resources may this minion\n * touch?\". This answers \"may it see the PLATFORM's record OF ITSELF?\" — a\n * different subject, a different store, and a different blast radius. R5 requires\n * the two be separately declarable with neither implying the other, so nothing\n * here consults `resourceAccess` and nothing there consults this.\n *\n * A minion that declares data access but no platform access is a normal shape\n * (it works on todos, never inspects its own schedule). So is the reverse (a\n * health-reporting minion that reads its tick history and touches no app data).\n */\n\n\n/** The authored declaration — optional, and absent means none. */\nexport interface MinionPlatformAccessDeclaration {\n readonly scopes?: readonly MinionPlatformAccessScope[];\n}\n\n/**\n * A filter that can ONLY ever address the caller's own records.\n *\n * ## Scoped-to-self BY SHAPE, which is the whole point of R4\n *\n * The obvious implementation takes a minion NAME and refuses when it does not\n * match the caller. That is scoped-to-self by CHECK, and it fails the way every\n * check fails: someone adds an admin path, or an internal caller passes the name\n * it was given, and the refusal is one conditional away from gone.\n *\n * This takes **no target parameter at all**. The subject is derived from the\n * PRINCIPAL, so \"read minion B's schedule\" is not a request that gets refused —\n * it is a request that cannot be expressed. A future caller wanting cross-minion\n * reads must add a new function, which is a reviewable act, rather than passing a\n * different string to this one, which is not.\n *\n * Returns `null` when the principal may not read platform records at all, so the\n * caller has nothing to query WITH — the same fail-closed shape as\n * `deriveMinionResourceGrants` returning `null`.\n *\n * ## ⚠️ PRECONDITION: `principal` must be VERIFIED, not self-asserted\n *\n * The by-shape property above is real and it is CONDITIONAL. This function makes a\n * cross-minion read inexpressible *given a trustworthy principal* — it says\n * nothing about where the principal came from, and a caller that accepts a\n * self-asserted one has a hole this signature cannot close.\n *\n * That is not hypothetical. A minion is delivered the application's\n * `APPLICATION_PLATFORM_REQUEST` **private** key: the delivery projection strips\n * per-app CREDENTIAL paths (`database.*`) and the JWT material is not among them,\n * so it survives in the base blob. A minion can therefore sign a token naming a\n * sibling minion or the application backend, and a by-shape endpoint would\n * satisfy \"no selector exists\" while still failing R4's acceptance criterion.\n *\n * So a caller MUST obtain the principal from a party that learns it from the\n * secret PRESENTED rather than one asserted in a claim — today that is\n * apps-manager, which resolves it by matching the presenting secret against the\n * minted per-principal set. Found by the `Minion Scope` session while building the\n * transport for this axis; recorded here because the precondition belongs with the\n * contract, not only in the transport that happens to satisfy it.\n */\nexport function buildOwnCronRecordFilter(\n principal: ApplicationRuntimePrincipal | undefined,\n declaration: MinionPlatformAccessDeclaration | undefined,\n): { readonly minionName: string } | null {\n // Only a MINION has cron records of its own. The application backend reads\n // schedules through its own authority, and a worker has none — so neither is a\n // subject here, and granting them a filter would invent a record that has no\n // referent.\n if (principal?.kind !== ApplicationRuntimePrincipalKind.MINION || !principal.name) return null;\n if (!declaration?.scopes?.includes(MinionPlatformAccessScope.OWN_CRON_RECORDS)) return null;\n return { minionName: principal.name };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { BackgroundRuntimeType } from '@wildo-ai/saas-models';
1
+ import { BackgroundRuntimeType, RuntimeEnvironment } from '@wildo-ai/saas-models';
2
2
  /**
3
3
  * WHOSE credentials are these? — the credential-principal axis.
4
4
  *
@@ -33,7 +33,23 @@ export declare enum ApplicationRuntimePrincipalKind {
33
33
  */
34
34
  APPLICATION_BACKEND = "application_backend",
35
35
  MINION = "minion",
36
- WORKER = "worker"
36
+ WORKER = "worker",
37
+ /**
38
+ * The application's development companion (#2941): the long-running local daemon that serves the workbench and
39
+ * runs the app-creation lane beside a developer's checkout.
40
+ *
41
+ * It used to present the BACKEND's `primarySecret`, so apps-manager could not tell it from the backend, and
42
+ * everything the backend may do on the platform (a platform-custody signature, a data key, the application's
43
+ * secrets blob) the companion, and any coding agent able to read its workspace `.env`, could do too.
44
+ *
45
+ * Like the backend it is nameless: an application has at most one companion. Unlike every other principal it is
46
+ * not DECLARED in `wildo.saas.config.ts`: it exists on a development platform only (production runs no companion),
47
+ * which is why {@link enumerateRuntimePrincipalsWithBootstrapSecrets} adds it from the platform's runtime
48
+ * environment rather than from the declaration. apps-manager admits it on the routes the companion calls and on
49
+ * no other, and it is in no key purpose's `heldBy` / `mayRequestSignature` / `mayRequestDataKeys`, so the signing
50
+ * and data-key proxies refuse it.
51
+ */
52
+ DEVELOPMENT_COMPANION = "development_companion"
37
53
  }
38
54
  /**
39
55
  * Map a deployable background-runtime kind onto its credential principal.
@@ -64,6 +80,17 @@ export interface ApplicationRuntimePrincipal {
64
80
  }
65
81
  /** The canonical backend principal — one per application, by definition. */
66
82
  export declare const APPLICATION_BACKEND_PRINCIPAL: ApplicationRuntimePrincipal;
83
+ /** The development companion's principal — at most one per application, so nameless like the backend (#2941). */
84
+ export declare const DEVELOPMENT_COMPANION_PRINCIPAL: ApplicationRuntimePrincipal;
85
+ /**
86
+ * Whether a platform running in `runtimeEnvironment` hosts development companions, and so mints each application a
87
+ * {@link ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION} secret (#2941).
88
+ *
89
+ * Development only. A staging or production platform runs no companion, and minting it a credential anyway would leave
90
+ * one more secret able to authenticate at apps-manager with nothing that uses it. apps-manager reads its own
91
+ * `APPLICATION_ENV` (the platform is mono-environment) and the CLI reads the environment it bootstraps; both ask here.
92
+ */
93
+ export declare function runtimeEnvironmentHostsDevelopmentCompanion(runtimeEnvironment: RuntimeEnvironment | undefined): boolean;
67
94
  /**
68
95
  * Render a principal as a single stable string.
69
96
  *
@@ -106,6 +133,17 @@ export declare function enumerateDeclaredRuntimePrincipals(declaration: {
106
133
  minions?: Record<string, unknown> | undefined;
107
134
  workers?: Record<string, unknown> | undefined;
108
135
  }): ApplicationRuntimePrincipal[];
136
+ /**
137
+ * Every principal apps-manager mints a bootstrap secret for, other than the backend (whose secret is `primarySecret`):
138
+ * one per declared minion and worker, plus the development companion on a platform that hosts one (#2941).
139
+ *
140
+ * The ONE derivation both sides use. apps-manager mints exactly this set (and prunes any stored secret outside it), and
141
+ * the CLI fetches exactly this set, so a companion the platform never minted is never asked for, and a companion
142
+ * secret left over from a development era is revoked the moment the platform stops hosting companions.
143
+ */
144
+ export declare function enumerateRuntimePrincipalsWithBootstrapSecrets(declaration: Parameters<typeof enumerateDeclaredRuntimePrincipals>[0], options: {
145
+ hostsDevelopmentCompanion: boolean;
146
+ }): ApplicationRuntimePrincipal[];
109
147
  /**
110
148
  * The Redis key namespace a MINION owns (D20).
111
149
  *
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-principal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GACjC,+BAA+B,GAAG,SAAS,CAW7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,+BAA+B,GAAG,SAAS,EAC1D,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAQpB"}
1
+ {"version":3,"file":"runtime-principal.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,+BAA+B;IACzC;;;;;OAKG;IACH,mBAAmB,wBAAwB;IAC3C,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,0BAA0B;CAChD;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,qBAAqB,GACjC,+BAA+B,CAOjC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,+BAA+B,CAAC;IACtC,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,4EAA4E;AAC5E,eAAO,MAAM,6BAA6B,EAAE,2BAE3C,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,+BAA+B,EAAE,2BAE7C,CAAC;AAiBF;;;;;;;GAOG;AACH,wBAAgB,2CAA2C,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAEvH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,2BAA2B,GAAG,MAAM,CAIvF;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,GAAG,IAAI,CAgBxF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kCAAkC,CAAC,WAAW,EAAE;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/C,GAAG,2BAA2B,EAAE,CAYhC;AAED;;;;;;;GAOG;AACH,wBAAgB,8CAA8C,CAC5D,WAAW,EAAE,UAAU,CAAC,OAAO,kCAAkC,CAAC,CAAC,CAAC,CAAC,EACrE,OAAO,EAAE;IAAE,yBAAyB,EAAE,OAAO,CAAA;CAAE,GAC9C,2BAA2B,EAAE,CAM/B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sCAAsC,CACpD,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,+BAA+B,GAAG,SAAS,CAW7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,+BAA+B,GAAG,SAAS,EAC1D,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,MAAM,GAAG,SAAS,CAQpB"}
@@ -2,7 +2,7 @@
2
2
  // lives in the decorator-bound graph, not the browser-safe `/public-runtime`
3
3
  // atom subset. This module is platform/CLI-side only and never reaches a
4
4
  // browser bundle, so the root import costs nothing here.
5
- import { BackgroundRuntimeType } from '@wildo-ai/saas-models';
5
+ import { BackgroundRuntimeType, RuntimeEnvironment } from '@wildo-ai/saas-models';
6
6
  /**
7
7
  * WHOSE credentials are these? — the credential-principal axis.
8
8
  *
@@ -39,6 +39,22 @@ export var ApplicationRuntimePrincipalKind;
39
39
  ApplicationRuntimePrincipalKind["APPLICATION_BACKEND"] = "application_backend";
40
40
  ApplicationRuntimePrincipalKind["MINION"] = "minion";
41
41
  ApplicationRuntimePrincipalKind["WORKER"] = "worker";
42
+ /**
43
+ * The application's development companion (#2941): the long-running local daemon that serves the workbench and
44
+ * runs the app-creation lane beside a developer's checkout.
45
+ *
46
+ * It used to present the BACKEND's `primarySecret`, so apps-manager could not tell it from the backend, and
47
+ * everything the backend may do on the platform (a platform-custody signature, a data key, the application's
48
+ * secrets blob) the companion, and any coding agent able to read its workspace `.env`, could do too.
49
+ *
50
+ * Like the backend it is nameless: an application has at most one companion. Unlike every other principal it is
51
+ * not DECLARED in `wildo.saas.config.ts`: it exists on a development platform only (production runs no companion),
52
+ * which is why {@link enumerateRuntimePrincipalsWithBootstrapSecrets} adds it from the platform's runtime
53
+ * environment rather than from the declaration. apps-manager admits it on the routes the companion calls and on
54
+ * no other, and it is in no key purpose's `heldBy` / `mayRequestSignature` / `mayRequestDataKeys`, so the signing
55
+ * and data-key proxies refuse it.
56
+ */
57
+ ApplicationRuntimePrincipalKind["DEVELOPMENT_COMPANION"] = "development_companion";
42
58
  })(ApplicationRuntimePrincipalKind || (ApplicationRuntimePrincipalKind = {}));
43
59
  /**
44
60
  * Map a deployable background-runtime kind onto its credential principal.
@@ -60,6 +76,35 @@ export function principalKindForBackgroundRuntime(runtimeType) {
60
76
  export const APPLICATION_BACKEND_PRINCIPAL = {
61
77
  kind: ApplicationRuntimePrincipalKind.APPLICATION_BACKEND,
62
78
  };
79
+ /** The development companion's principal — at most one per application, so nameless like the backend (#2941). */
80
+ export const DEVELOPMENT_COMPANION_PRINCIPAL = {
81
+ kind: ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION,
82
+ };
83
+ /**
84
+ * Whether a principal kind is a singleton per application, and therefore carries no name. ONE predicate shared by the
85
+ * key renderer and its parser, so the two cannot disagree about which kinds take a name segment.
86
+ */
87
+ function isNamelessRuntimePrincipalKind(kind) {
88
+ switch (kind) {
89
+ case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:
90
+ case ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION:
91
+ return true;
92
+ case ApplicationRuntimePrincipalKind.MINION:
93
+ case ApplicationRuntimePrincipalKind.WORKER:
94
+ return false;
95
+ }
96
+ }
97
+ /**
98
+ * Whether a platform running in `runtimeEnvironment` hosts development companions, and so mints each application a
99
+ * {@link ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION} secret (#2941).
100
+ *
101
+ * Development only. A staging or production platform runs no companion, and minting it a credential anyway would leave
102
+ * one more secret able to authenticate at apps-manager with nothing that uses it. apps-manager reads its own
103
+ * `APPLICATION_ENV` (the platform is mono-environment) and the CLI reads the environment it bootstraps; both ask here.
104
+ */
105
+ export function runtimeEnvironmentHostsDevelopmentCompanion(runtimeEnvironment) {
106
+ return runtimeEnvironment === RuntimeEnvironment.DEVELOPMENT;
107
+ }
63
108
  /**
64
109
  * Render a principal as a single stable string.
65
110
  *
@@ -75,8 +120,8 @@ export const APPLICATION_BACKEND_PRINCIPAL = {
75
120
  * boundary rather than resolving to the wrong principal.
76
121
  */
77
122
  export function buildRuntimePrincipalKey(principal) {
78
- return principal.kind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND
79
- ? ApplicationRuntimePrincipalKind.APPLICATION_BACKEND
123
+ return isNamelessRuntimePrincipalKind(principal.kind)
124
+ ? principal.kind
80
125
  : `${principal.kind}:${principal.name ?? ''}`;
81
126
  }
82
127
  /**
@@ -92,6 +137,9 @@ export function parseRuntimePrincipalKey(key) {
92
137
  if (key === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {
93
138
  return APPLICATION_BACKEND_PRINCIPAL;
94
139
  }
140
+ if (key === ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION) {
141
+ return DEVELOPMENT_COMPANION_PRINCIPAL;
142
+ }
95
143
  const separatorIndex = key.indexOf(':');
96
144
  if (separatorIndex <= 0)
97
145
  return null;
@@ -130,6 +178,21 @@ export function enumerateDeclaredRuntimePrincipals(declaration) {
130
178
  })),
131
179
  ];
132
180
  }
181
+ /**
182
+ * Every principal apps-manager mints a bootstrap secret for, other than the backend (whose secret is `primarySecret`):
183
+ * one per declared minion and worker, plus the development companion on a platform that hosts one (#2941).
184
+ *
185
+ * The ONE derivation both sides use. apps-manager mints exactly this set (and prunes any stored secret outside it), and
186
+ * the CLI fetches exactly this set, so a companion the platform never minted is never asked for, and a companion
187
+ * secret left over from a development era is revoked the moment the platform stops hosting companions.
188
+ */
189
+ export function enumerateRuntimePrincipalsWithBootstrapSecrets(declaration, options) {
190
+ return [
191
+ ...enumerateDeclaredRuntimePrincipals(declaration)
192
+ .filter((principal) => principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND),
193
+ ...(options.hostsDevelopmentCompanion ? [DEVELOPMENT_COMPANION_PRINCIPAL] : []),
194
+ ];
195
+ }
133
196
  /**
134
197
  * The Redis key namespace a MINION owns (D20).
135
198
  *
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-principal.contracts.js","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yDAAyD;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAN,IAAY,+BAUX;AAVD,WAAY,+BAA+B;IACzC;;;;;OAKG;IACH,8EAA2C,CAAA;IAC3C,oDAAiB,CAAA;IACjB,oDAAiB,CAAA;AACnB,CAAC,EAVW,+BAA+B,KAA/B,+BAA+B,QAU1C;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iCAAiC,CAC/C,WAAkC;IAElC,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,qBAAqB,CAAC,MAAM;YAC/B,OAAO,+BAA+B,CAAC,MAAM,CAAC;QAChD,KAAK,qBAAqB,CAAC,MAAM;YAC/B,OAAO,+BAA+B,CAAC,MAAM,CAA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AAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC","sourcesContent":["// Root barrel, matching the sibling bootstrap files: `BackgroundRuntimeType`\n// lives in the decorator-bound graph, not the browser-safe `/public-runtime`\n// atom subset. This module is platform/CLI-side only and never reaches a\n// browser bundle, so the root import costs nothing here.\nimport { BackgroundRuntimeType } from '@wildo-ai/saas-models';\n\n/**\n * WHOSE credentials are these? — the credential-principal axis.\n *\n * Wildo now has three runtime-identity vocabularies and they answer three\n * different questions. They are deliberately NOT collapsed, even where their\n * members currently coincide:\n *\n * - `BackgroundRuntimeType` (`MINION | WORKER`) — *what kind of deployable is\n * this?* A compose service, a K8s workload, a provider-runtime scope. It has\n * no application-backend member because the backend is not a background\n * runtime.\n * - `ApplicationRuntimeProfile` (`APPLICATION_BACKEND | MINION`) — *does this\n * boot assertion apply to me?* Inside a single process. It has no worker\n * member because workers never boot that lifecycle.\n * - **This enum** (`APPLICATION_BACKEND | MINION | WORKER`) — *which principal\n * is authenticating, and whose secrets may it receive?* It is the only one of\n * the three that spans every runtime capable of presenting a credential, which\n * is exactly why it cannot be expressed as either neighbour.\n *\n * Merging any pair would be convenient and wrong: a future runtime that boots no\n * lifecycle but does hold credentials (or the reverse) would silently inherit a\n * decision made for a different question.\n *\n * @see BackgroundRuntimeType — the deployable-kind axis this maps FROM\n */\nexport enum ApplicationRuntimePrincipalKind {\n /**\n * The application's own backend service. Historically the ONLY principal:\n * before per-runtime identity, one `primarySecret` per application was held\n * identically by the backend and by every minion and worker, so at the\n * apps-manager door they were indistinguishable.\n */\n APPLICATION_BACKEND = 'application_backend',\n MINION = 'minion',\n WORKER = 'worker',\n}\n\n/**\n * Map a deployable background-runtime kind onto its credential principal.\n *\n * The one place the two vocabularies meet. Keeping the translation in a single\n * exhaustive switch means adding a member to `BackgroundRuntimeType` is a\n * COMPILE error here rather than a silent gap at whichever call site happened to\n * assume a mapping.\n */\nexport function principalKindForBackgroundRuntime(\n runtimeType: BackgroundRuntimeType,\n): ApplicationRuntimePrincipalKind {\n switch (runtimeType) {\n case BackgroundRuntimeType.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case BackgroundRuntimeType.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n }\n}\n\n/**\n * A runtime principal's stable identity within one application.\n *\n * `name` is the `wildo.saas.config.ts` bucket key (`marketingScrapper`,\n * `myNodeWorker`) — the SAME identity axis the deploy path already carries as\n * `wildo.ai/owned-service-name` and `APP_OWNED_SERVICE_NAME`. Reusing the bucket\n * key rather than the `serviceName` matters: the bucket key is what the\n * declaration, the config lookup and the pod label all agree on, while\n * `serviceName` is a rendering concern that is normalised for DNS.\n *\n * The backend principal carries no name — an application has exactly one, so a\n * name would be a second way to say `APPLICATION_BACKEND`.\n */\nexport interface ApplicationRuntimePrincipal {\n kind: ApplicationRuntimePrincipalKind;\n /** Absent for {@link ApplicationRuntimePrincipalKind.APPLICATION_BACKEND}. */\n name?: string | undefined;\n}\n\n/** The canonical backend principal — one per application, by definition. */\nexport const APPLICATION_BACKEND_PRINCIPAL: ApplicationRuntimePrincipal = {\n kind: ApplicationRuntimePrincipalKind.APPLICATION_BACKEND,\n};\n\n/**\n * Render a principal as a single stable string.\n *\n * Used as the stored key for a principal's secret, as the URL segment when the\n * CLI asks for a named principal's bootstrap credentials, and in log/audit\n * fields. ONE renderer so those three never drift into three spellings of the\n * same identity.\n *\n * `:` is the separator because neither half can contain it — the kinds are a\n * closed enum, and a bucket key is a TypeScript object key in\n * `wildo.saas.config.ts`. {@link parseRuntimePrincipalKey} rejects anything that\n * does not round-trip, so a key that ever gains a colon fails loudly at the\n * boundary rather than resolving to the wrong principal.\n */\nexport function buildRuntimePrincipalKey(principal: ApplicationRuntimePrincipal): string {\n return principal.kind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n ? ApplicationRuntimePrincipalKind.APPLICATION_BACKEND\n : `${principal.kind}:${principal.name ?? ''}`;\n}\n\n/**\n * Inverse of {@link buildRuntimePrincipalKey}. Returns `null` for anything\n * malformed — an unknown kind, a missing name on a named kind, or a name\n * containing the separator.\n *\n * Fail-closed by returning `null` rather than throwing OR guessing: this parses\n * values that reach the system from a URL segment and from stored rows, and a\n * lenient parse there is how one principal's key resolves to another's secret.\n */\nexport function parseRuntimePrincipalKey(key: string): ApplicationRuntimePrincipal | null {\n if (key === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return APPLICATION_BACKEND_PRINCIPAL;\n }\n const separatorIndex = key.indexOf(':');\n if (separatorIndex <= 0) return null;\n const kind = key.slice(0, separatorIndex);\n const name = key.slice(separatorIndex + 1);\n if (name.length === 0 || name.includes(':')) return null;\n if (kind !== ApplicationRuntimePrincipalKind.MINION && kind !== ApplicationRuntimePrincipalKind.WORKER) {\n return null;\n }\n return { kind, name };\n}\n\n/**\n * Every principal an application declares: its backend, plus one per declared\n * minion and worker.\n *\n * Derived from the managed declaration — the same input the config seed already\n * consumes — so the credential set and the deployed runtime set cannot diverge.\n * That is also what makes revocation fall out for free: a runtime removed from\n * `wildo.saas.config.ts` simply stops appearing here, and the mint step prunes\n * any stored secret whose key is no longer in this list (R15).\n *\n * The backend is ALWAYS included, including for an application that declares no\n * minions and no workers — it is the principal that must never be absent.\n */\nexport function enumerateDeclaredRuntimePrincipals(declaration: {\n minions?: Record<string, unknown> | undefined;\n workers?: Record<string, unknown> | undefined;\n}): ApplicationRuntimePrincipal[] {\n return [\n APPLICATION_BACKEND_PRINCIPAL,\n ...Object.keys(declaration.minions ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.MINION,\n name,\n })),\n ...Object.keys(declaration.workers ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.WORKER,\n name,\n })),\n ];\n}\n\n/**\n * The Redis key namespace a MINION owns (D20).\n *\n * `<appSlug>:minions:<name>:` — a strict extension of the application's own\n * `<appSlug>:` prefix, which is what lets `RedisService` keep enforcing \"an\n * authored prefix must start with `<appSlug>:`\" unchanged.\n *\n * ## One derivation, deliberately, because it is a COUPLED PAIR\n *\n * Two places consume this and they must agree exactly: the Redis ACL key pattern\n * apps-manager grants the minion's user, and the `REDIS_KEY_PREFIX` the CLI\n * writes into that minion's environment. If they disagree by even a character,\n * every Redis operation the minion performs is DENIED — and the error names an\n * ACL, not the mismatch, so nothing in the minion's own configuration explains\n * it. Deriving both from this function is what makes that class of failure\n * unrepresentable rather than merely unlikely.\n *\n * Based on `appSlug` rather than an authored `dataServices.redis.keyPrefix`\n * because the ACL pattern already is (`RedisSelfInfraProviderModule`), and one\n * inconsistency is better than two competing bases. An application that authors\n * a custom prefix therefore has a PRE-EXISTING mismatch with its own ACL; that\n * gap is older than per-principal credentials and is not narrowed here.\n */\nexport function buildMinionRedisKeyPrefix(appSlug: string, minionName: string): string {\n return `${appSlug}:minions:${minionName}:`;\n}\n\n/**\n * Map an `ApplicationRuntimeProfile` value onto the credential-principal axis.\n *\n * The two vocabularies are deliberately SEPARATE — a runtime profile answers\n * \"which declaration class am I?\", a principal kind answers \"whose credential do\n * I hold?\" — but their string values coincide today. A consumer that relies on\n * that coincidence by comparing raw strings has made the coupling invisible; this\n * function is where the crossing is allowed to happen, once.\n *\n * Fail-closed: an unrecognised profile returns `undefined` rather than a\n * plausible default, because every caller uses the result to decide how narrowly\n * a runtime is confined, and guessing there widens confinement silently.\n */\nexport function runtimePrincipalKindFromRuntimeProfile(\n runtimeProfile: string | undefined,\n): ApplicationRuntimePrincipalKind | undefined {\n switch (runtimeProfile) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n return ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n case ApplicationRuntimePrincipalKind.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case ApplicationRuntimePrincipalKind.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n default:\n return undefined;\n }\n}\n\n/**\n * The principal segment embedded in a runtime's RPC reply-queue name.\n *\n * ## Why this exists — the same reason as {@link buildMinionRedisKeyPrefix}\n *\n * Two places consume this and they must agree EXACTLY: the broker permission\n * pattern apps-manager grants a minion's user, and the reply-queue name the\n * minion's own AMQP adapter declares and consumes. If they disagree by even a\n * character the minion's every reply is refused with `403 ACCESS_REFUSED`, and\n * the error names a permission rather than the mismatch — so nothing in the\n * minion's own configuration explains it.\n *\n * It previously WAS derived twice: the adapter sanitised its runtime key while\n * the permission builder escaped the raw minion name, coupled only by a comment\n * saying the two \"mirror\" each other. They agreed for `marketingScrapper` and\n * would have diverged for any name containing a character sanitisation rewrites\n * (`marketing.scrapper` → `marketing-scrapper` on one side, `marketing.scrapper`\n * on the other). A comment describing what the other side must do is not a site\n * that upholds an invariant; deriving both from here makes the divergence\n * unrepresentable instead of merely unlikely.\n *\n * Returns `undefined` for the APPLICATION BACKEND, which keeps the historical\n * segment-less reply-queue layout — that is what stops a minion's permission\n * from ever matching the backend's replies.\n */\nexport function buildRuntimePrincipalQueueSegment(\n principalKind: ApplicationRuntimePrincipalKind | undefined,\n principalName: string | undefined,\n): string | undefined {\n if (!principalKind || principalKind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return undefined;\n }\n // Sanitised for the same reason the ACL usernames are: a principal name comes\n // from a TypeScript object key and may hold characters a queue name should not.\n const sanitized = (principalName ?? '').replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return sanitized ? `${principalKind}-${sanitized}` : undefined;\n}\n\n"]}
1
+ {"version":3,"file":"runtime-principal.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-principal.contracts.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,yDAAyD;AACzD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;;;;;;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AAI,CAAC,aAAa,IAAI,aAAa,KAAK,+BAA+B,CAAC,mBAAmB,EAAE,CAAC;QAC5F,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IAC9E,gFAAgF;IAChF,MAAM,SAAS,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,SAAS,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC","sourcesContent":["// Root barrel, matching the sibling bootstrap files: `BackgroundRuntimeType`\n// lives in the decorator-bound graph, not the browser-safe `/public-runtime`\n// atom subset. This module is platform/CLI-side only and never reaches a\n// browser bundle, so the root import costs nothing here.\nimport { BackgroundRuntimeType, RuntimeEnvironment } from '@wildo-ai/saas-models';\n\n/**\n * WHOSE credentials are these? — the credential-principal axis.\n *\n * Wildo now has three runtime-identity vocabularies and they answer three\n * different questions. They are deliberately NOT collapsed, even where their\n * members currently coincide:\n *\n * - `BackgroundRuntimeType` (`MINION | WORKER`) — *what kind of deployable is\n * this?* A compose service, a K8s workload, a provider-runtime scope. It has\n * no application-backend member because the backend is not a background\n * runtime.\n * - `ApplicationRuntimeProfile` (`APPLICATION_BACKEND | MINION`) — *does this\n * boot assertion apply to me?* Inside a single process. It has no worker\n * member because workers never boot that lifecycle.\n * - **This enum** (`APPLICATION_BACKEND | MINION | WORKER`) — *which principal\n * is authenticating, and whose secrets may it receive?* It is the only one of\n * the three that spans every runtime capable of presenting a credential, which\n * is exactly why it cannot be expressed as either neighbour.\n *\n * Merging any pair would be convenient and wrong: a future runtime that boots no\n * lifecycle but does hold credentials (or the reverse) would silently inherit a\n * decision made for a different question.\n *\n * @see BackgroundRuntimeType — the deployable-kind axis this maps FROM\n */\nexport enum ApplicationRuntimePrincipalKind {\n /**\n * The application's own backend service. Historically the ONLY principal:\n * before per-runtime identity, one `primarySecret` per application was held\n * identically by the backend and by every minion and worker, so at the\n * apps-manager door they were indistinguishable.\n */\n APPLICATION_BACKEND = 'application_backend',\n MINION = 'minion',\n WORKER = 'worker',\n /**\n * The application's development companion (#2941): the long-running local daemon that serves the workbench and\n * runs the app-creation lane beside a developer's checkout.\n *\n * It used to present the BACKEND's `primarySecret`, so apps-manager could not tell it from the backend, and\n * everything the backend may do on the platform (a platform-custody signature, a data key, the application's\n * secrets blob) the companion, and any coding agent able to read its workspace `.env`, could do too.\n *\n * Like the backend it is nameless: an application has at most one companion. Unlike every other principal it is\n * not DECLARED in `wildo.saas.config.ts`: it exists on a development platform only (production runs no companion),\n * which is why {@link enumerateRuntimePrincipalsWithBootstrapSecrets} adds it from the platform's runtime\n * environment rather than from the declaration. apps-manager admits it on the routes the companion calls and on\n * no other, and it is in no key purpose's `heldBy` / `mayRequestSignature` / `mayRequestDataKeys`, so the signing\n * and data-key proxies refuse it.\n */\n DEVELOPMENT_COMPANION = 'development_companion',\n}\n\n/**\n * Map a deployable background-runtime kind onto its credential principal.\n *\n * The one place the two vocabularies meet. Keeping the translation in a single\n * exhaustive switch means adding a member to `BackgroundRuntimeType` is a\n * COMPILE error here rather than a silent gap at whichever call site happened to\n * assume a mapping.\n */\nexport function principalKindForBackgroundRuntime(\n runtimeType: BackgroundRuntimeType,\n): ApplicationRuntimePrincipalKind {\n switch (runtimeType) {\n case BackgroundRuntimeType.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case BackgroundRuntimeType.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n }\n}\n\n/**\n * A runtime principal's stable identity within one application.\n *\n * `name` is the `wildo.saas.config.ts` bucket key (`marketingScrapper`,\n * `myNodeWorker`) — the SAME identity axis the deploy path already carries as\n * `wildo.ai/owned-service-name` and `APP_OWNED_SERVICE_NAME`. Reusing the bucket\n * key rather than the `serviceName` matters: the bucket key is what the\n * declaration, the config lookup and the pod label all agree on, while\n * `serviceName` is a rendering concern that is normalised for DNS.\n *\n * The backend principal carries no name — an application has exactly one, so a\n * name would be a second way to say `APPLICATION_BACKEND`.\n */\nexport interface ApplicationRuntimePrincipal {\n kind: ApplicationRuntimePrincipalKind;\n /** Absent for {@link ApplicationRuntimePrincipalKind.APPLICATION_BACKEND}. */\n name?: string | undefined;\n}\n\n/** The canonical backend principal — one per application, by definition. */\nexport const APPLICATION_BACKEND_PRINCIPAL: ApplicationRuntimePrincipal = {\n kind: ApplicationRuntimePrincipalKind.APPLICATION_BACKEND,\n};\n\n/** The development companion's principal — at most one per application, so nameless like the backend (#2941). */\nexport const DEVELOPMENT_COMPANION_PRINCIPAL: ApplicationRuntimePrincipal = {\n kind: ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION,\n};\n\n/**\n * Whether a principal kind is a singleton per application, and therefore carries no name. ONE predicate shared by the\n * key renderer and its parser, so the two cannot disagree about which kinds take a name segment.\n */\nfunction isNamelessRuntimePrincipalKind(kind: ApplicationRuntimePrincipalKind): boolean {\n switch (kind) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n case ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION:\n return true;\n case ApplicationRuntimePrincipalKind.MINION:\n case ApplicationRuntimePrincipalKind.WORKER:\n return false;\n }\n}\n\n/**\n * Whether a platform running in `runtimeEnvironment` hosts development companions, and so mints each application a\n * {@link ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION} secret (#2941).\n *\n * Development only. A staging or production platform runs no companion, and minting it a credential anyway would leave\n * one more secret able to authenticate at apps-manager with nothing that uses it. apps-manager reads its own\n * `APPLICATION_ENV` (the platform is mono-environment) and the CLI reads the environment it bootstraps; both ask here.\n */\nexport function runtimeEnvironmentHostsDevelopmentCompanion(runtimeEnvironment: RuntimeEnvironment | undefined): boolean {\n return runtimeEnvironment === RuntimeEnvironment.DEVELOPMENT;\n}\n\n/**\n * Render a principal as a single stable string.\n *\n * Used as the stored key for a principal's secret, as the URL segment when the\n * CLI asks for a named principal's bootstrap credentials, and in log/audit\n * fields. ONE renderer so those three never drift into three spellings of the\n * same identity.\n *\n * `:` is the separator because neither half can contain it — the kinds are a\n * closed enum, and a bucket key is a TypeScript object key in\n * `wildo.saas.config.ts`. {@link parseRuntimePrincipalKey} rejects anything that\n * does not round-trip, so a key that ever gains a colon fails loudly at the\n * boundary rather than resolving to the wrong principal.\n */\nexport function buildRuntimePrincipalKey(principal: ApplicationRuntimePrincipal): string {\n return isNamelessRuntimePrincipalKind(principal.kind)\n ? principal.kind\n : `${principal.kind}:${principal.name ?? ''}`;\n}\n\n/**\n * Inverse of {@link buildRuntimePrincipalKey}. Returns `null` for anything\n * malformed — an unknown kind, a missing name on a named kind, or a name\n * containing the separator.\n *\n * Fail-closed by returning `null` rather than throwing OR guessing: this parses\n * values that reach the system from a URL segment and from stored rows, and a\n * lenient parse there is how one principal's key resolves to another's secret.\n */\nexport function parseRuntimePrincipalKey(key: string): ApplicationRuntimePrincipal | null {\n if (key === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return APPLICATION_BACKEND_PRINCIPAL;\n }\n if (key === ApplicationRuntimePrincipalKind.DEVELOPMENT_COMPANION) {\n return DEVELOPMENT_COMPANION_PRINCIPAL;\n }\n const separatorIndex = key.indexOf(':');\n if (separatorIndex <= 0) return null;\n const kind = key.slice(0, separatorIndex);\n const name = key.slice(separatorIndex + 1);\n if (name.length === 0 || name.includes(':')) return null;\n if (kind !== ApplicationRuntimePrincipalKind.MINION && kind !== ApplicationRuntimePrincipalKind.WORKER) {\n return null;\n }\n return { kind, name };\n}\n\n/**\n * Every principal an application declares: its backend, plus one per declared\n * minion and worker.\n *\n * Derived from the managed declaration — the same input the config seed already\n * consumes — so the credential set and the deployed runtime set cannot diverge.\n * That is also what makes revocation fall out for free: a runtime removed from\n * `wildo.saas.config.ts` simply stops appearing here, and the mint step prunes\n * any stored secret whose key is no longer in this list (R15).\n *\n * The backend is ALWAYS included, including for an application that declares no\n * minions and no workers — it is the principal that must never be absent.\n */\nexport function enumerateDeclaredRuntimePrincipals(declaration: {\n minions?: Record<string, unknown> | undefined;\n workers?: Record<string, unknown> | undefined;\n}): ApplicationRuntimePrincipal[] {\n return [\n APPLICATION_BACKEND_PRINCIPAL,\n ...Object.keys(declaration.minions ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.MINION,\n name,\n })),\n ...Object.keys(declaration.workers ?? {}).map((name) => ({\n kind: ApplicationRuntimePrincipalKind.WORKER,\n name,\n })),\n ];\n}\n\n/**\n * Every principal apps-manager mints a bootstrap secret for, other than the backend (whose secret is `primarySecret`):\n * one per declared minion and worker, plus the development companion on a platform that hosts one (#2941).\n *\n * The ONE derivation both sides use. apps-manager mints exactly this set (and prunes any stored secret outside it), and\n * the CLI fetches exactly this set, so a companion the platform never minted is never asked for, and a companion\n * secret left over from a development era is revoked the moment the platform stops hosting companions.\n */\nexport function enumerateRuntimePrincipalsWithBootstrapSecrets(\n declaration: Parameters<typeof enumerateDeclaredRuntimePrincipals>[0],\n options: { hostsDevelopmentCompanion: boolean },\n): ApplicationRuntimePrincipal[] {\n return [\n ...enumerateDeclaredRuntimePrincipals(declaration)\n .filter((principal) => principal.kind !== ApplicationRuntimePrincipalKind.APPLICATION_BACKEND),\n ...(options.hostsDevelopmentCompanion ? [DEVELOPMENT_COMPANION_PRINCIPAL] : []),\n ];\n}\n\n/**\n * The Redis key namespace a MINION owns (D20).\n *\n * `<appSlug>:minions:<name>:` — a strict extension of the application's own\n * `<appSlug>:` prefix, which is what lets `RedisService` keep enforcing \"an\n * authored prefix must start with `<appSlug>:`\" unchanged.\n *\n * ## One derivation, deliberately, because it is a COUPLED PAIR\n *\n * Two places consume this and they must agree exactly: the Redis ACL key pattern\n * apps-manager grants the minion's user, and the `REDIS_KEY_PREFIX` the CLI\n * writes into that minion's environment. If they disagree by even a character,\n * every Redis operation the minion performs is DENIED — and the error names an\n * ACL, not the mismatch, so nothing in the minion's own configuration explains\n * it. Deriving both from this function is what makes that class of failure\n * unrepresentable rather than merely unlikely.\n *\n * Based on `appSlug` rather than an authored `dataServices.redis.keyPrefix`\n * because the ACL pattern already is (`RedisSelfInfraProviderModule`), and one\n * inconsistency is better than two competing bases. An application that authors\n * a custom prefix therefore has a PRE-EXISTING mismatch with its own ACL; that\n * gap is older than per-principal credentials and is not narrowed here.\n */\nexport function buildMinionRedisKeyPrefix(appSlug: string, minionName: string): string {\n return `${appSlug}:minions:${minionName}:`;\n}\n\n/**\n * Map an `ApplicationRuntimeProfile` value onto the credential-principal axis.\n *\n * The two vocabularies are deliberately SEPARATE — a runtime profile answers\n * \"which declaration class am I?\", a principal kind answers \"whose credential do\n * I hold?\" — but their string values coincide today. A consumer that relies on\n * that coincidence by comparing raw strings has made the coupling invisible; this\n * function is where the crossing is allowed to happen, once.\n *\n * Fail-closed: an unrecognised profile returns `undefined` rather than a\n * plausible default, because every caller uses the result to decide how narrowly\n * a runtime is confined, and guessing there widens confinement silently.\n */\nexport function runtimePrincipalKindFromRuntimeProfile(\n runtimeProfile: string | undefined,\n): ApplicationRuntimePrincipalKind | undefined {\n switch (runtimeProfile) {\n case ApplicationRuntimePrincipalKind.APPLICATION_BACKEND:\n return ApplicationRuntimePrincipalKind.APPLICATION_BACKEND;\n case ApplicationRuntimePrincipalKind.MINION:\n return ApplicationRuntimePrincipalKind.MINION;\n case ApplicationRuntimePrincipalKind.WORKER:\n return ApplicationRuntimePrincipalKind.WORKER;\n default:\n return undefined;\n }\n}\n\n/**\n * The principal segment embedded in a runtime's RPC reply-queue name.\n *\n * ## Why this exists — the same reason as {@link buildMinionRedisKeyPrefix}\n *\n * Two places consume this and they must agree EXACTLY: the broker permission\n * pattern apps-manager grants a minion's user, and the reply-queue name the\n * minion's own AMQP adapter declares and consumes. If they disagree by even a\n * character the minion's every reply is refused with `403 ACCESS_REFUSED`, and\n * the error names a permission rather than the mismatch — so nothing in the\n * minion's own configuration explains it.\n *\n * It previously WAS derived twice: the adapter sanitised its runtime key while\n * the permission builder escaped the raw minion name, coupled only by a comment\n * saying the two \"mirror\" each other. They agreed for `marketingScrapper` and\n * would have diverged for any name containing a character sanitisation rewrites\n * (`marketing.scrapper` → `marketing-scrapper` on one side, `marketing.scrapper`\n * on the other). A comment describing what the other side must do is not a site\n * that upholds an invariant; deriving both from here makes the divergence\n * unrepresentable instead of merely unlikely.\n *\n * Returns `undefined` for the APPLICATION BACKEND, which keeps the historical\n * segment-less reply-queue layout — that is what stops a minion's permission\n * from ever matching the backend's replies.\n */\nexport function buildRuntimePrincipalQueueSegment(\n principalKind: ApplicationRuntimePrincipalKind | undefined,\n principalName: string | undefined,\n): string | undefined {\n if (!principalKind || principalKind === ApplicationRuntimePrincipalKind.APPLICATION_BACKEND) {\n return undefined;\n }\n // Sanitised for the same reason the ACL usernames are: a principal name comes\n // from a TypeScript object key and may hold characters a queue name should not.\n const sanitized = (principalName ?? '').replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n return sanitized ? `${principalKind}-${sanitized}` : undefined;\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-response-integrity.d.ts","sourceRoot":"","sources":["../../../../src/bootstrap/runtime-response-integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE3E,OAAO,EAAuF,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACtJ,OAAO,EAA4B,KAAK,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE3G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,uGAAuG;AACvG,eAAO,MAAM,4BAA4B,gDAAgD,CAAC;AAE1F;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAsD,CAAC;AAE/F,iHAAiH;AACjH,eAAO,MAAM,8BAA8B,UAA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AED,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,2BAA2B,CAAC;IACvC,sFAAsF;IACtF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kCAAkC;IAClC,OAAO,EAAE,6BAA6B,CAAC;IACvC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAkB3E;AAED,mDAAmD;AACnD,MAAM,WAAW,0BAA0B;IACzC,8FAA8F;IAC9F,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,SAAS,8BAA8B,EAAE,CAAC;IAChD,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,2BAA2B,CAAC;IACxC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,OAAO,EAAE,6BAA6B,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAYD;;;GAGG;AAEH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,qBAAqB,CA8D9F"}
1
+ {"version":3,"file":"runtime-response-integrity.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-response-integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAmB,iBAAiB,EAAuB,MAAM,uBAAuB,CAAC;AAEhG,OAAO,EAAuF,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACtJ,OAAO,EAA4B,K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@ -1,6 +1,6 @@
1
1
  import { createHash, createPrivateKey, createPublicKey, randomBytes, sign as signWithKey, verify as verifyWithKey, } from 'node:crypto';
2
2
  import { PlatformApplicationType } from '@wildo-ai/platform-core-shared';
3
- import { singleJwsTypeOf, CryptoKey_Purpose } from '@wildo-ai/saas-models';
3
+ import { singleJwsTypeOf, CryptoKey_Purpose, describeCaughtError } from '@wildo-ai/saas-models';
4
4
  import { canonicalizeJson } from '../canonical-json/rfc8785-canonical-json.js';
5
5
  import { base64url, ES256_JWS_ALGORITHM, isP256PublicJwk, p256JwkThumbprint, p256PublicJwkOf } from '../key-management/es256-jws.js';
6
6
  import { buildRuntimePrincipalKey } from './runtime-principal.contracts.js';
@@ -242,14 +242,14 @@ export function describeRuntimeResponseSigningKeyMismatch(privateKeyPem, verific
242
242
  kid = runtimeResponseKeyThumbprint(publicJwkOf(createPublicKey(createPrivateKey(privateKeyPem.trim()))));
243
243
  }
244
244
  catch (error) {
245
- return `the response signing key does not parse as an EC P-256 private key (${error instanceof Error ? error.message : String(error)})`;
245
+ return `the response signing key does not parse as an EC P-256 private key (${describeCaughtError(error)})`;
246
246
  }
247
247
  let published;
248
248
  try {
249
249
  published = parseRuntimeResponseVerificationKeySet(verificationKeySet);
250
250
  }
251
251
  catch (error) {
252
- return error instanceof Error ? error.message : String(error);
252
+ return describeCaughtError(error);
253
253
  }
254
254
  return published.some((key) => key.kid === kid)
255
255
  ? null