@wildo-ai/platform-config-lib 1.0.1 → 1.1.0

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 (414) hide show
  1. package/LICENSE +34 -0
  2. package/dist/esm/.builder.pid +9 -0
  3. package/dist/esm/_unimplemented/index.d.ts +3 -0
  4. package/dist/esm/_unimplemented/index.d.ts.map +1 -0
  5. package/dist/esm/_unimplemented/index.js +3 -0
  6. package/dist/esm/_unimplemented/index.js.map +1 -0
  7. package/dist/esm/_unimplemented/soft-warn.d.ts +124 -0
  8. package/dist/esm/_unimplemented/soft-warn.d.ts.map +1 -0
  9. package/dist/esm/_unimplemented/soft-warn.js +170 -0
  10. package/dist/esm/_unimplemented/soft-warn.js.map +1 -0
  11. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts +137 -0
  12. package/dist/esm/_unimplemented/unimplemented-field-warning.d.ts.map +1 -0
  13. package/dist/esm/_unimplemented/unimplemented-field-warning.js +153 -0
  14. package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -0
  15. package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
  16. package/dist/esm/bootstrap/application-backend-env.contracts.js +1 -1
  17. package/dist/esm/bootstrap/application-backend-env.contracts.js.map +1 -1
  18. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts +13 -0
  19. package/dist/esm/bootstrap/application-creation-verification-env.contracts.d.ts.map +1 -0
  20. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js +14 -0
  21. package/dist/esm/bootstrap/application-creation-verification-env.contracts.js.map +1 -0
  22. package/dist/esm/bootstrap/bootstrap-planner.d.ts +1 -1
  23. package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
  24. package/dist/esm/bootstrap/bootstrap-planner.js +1 -1
  25. package/dist/esm/bootstrap/bootstrap-planner.js.map +1 -1
  26. package/dist/esm/bootstrap/bootstrap.contracts.d.ts +141 -37
  27. package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
  28. package/dist/esm/bootstrap/bootstrap.contracts.js +104 -18
  29. package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
  30. package/dist/esm/bootstrap/bootstrap.schemas.d.ts +430 -421
  31. package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
  32. package/dist/esm/bootstrap/bootstrap.schemas.js +383 -21
  33. package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
  34. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +213 -8
  35. package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
  36. package/dist/esm/bootstrap/platform-runtime-env.contracts.js +230 -5
  37. package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
  38. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts +79 -0
  39. package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -0
  40. package/dist/esm/bootstrap/runtime-backing-service-access.js +83 -0
  41. package/dist/esm/bootstrap/runtime-backing-service-access.js.map +1 -0
  42. package/dist/esm/bootstrap/runtime-network-policy.d.ts +63 -0
  43. package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -0
  44. package/dist/esm/bootstrap/runtime-network-policy.js +104 -0
  45. package/dist/esm/bootstrap/runtime-network-policy.js.map +1 -0
  46. package/dist/esm/bootstrap/runtime-network-topology.d.ts +78 -0
  47. package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -0
  48. package/dist/esm/bootstrap/runtime-network-topology.js +134 -0
  49. package/dist/esm/bootstrap/runtime-network-topology.js.map +1 -0
  50. package/dist/esm/bootstrap/runtime-platform-access.d.ts +67 -0
  51. package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -0
  52. package/dist/esm/bootstrap/runtime-platform-access.js +57 -0
  53. package/dist/esm/bootstrap/runtime-platform-access.js.map +1 -0
  54. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts +173 -0
  55. package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -0
  56. package/dist/esm/bootstrap/runtime-principal.contracts.js +218 -0
  57. package/dist/esm/bootstrap/runtime-principal.contracts.js.map +1 -0
  58. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +112 -1
  59. package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
  60. package/dist/esm/bootstrap/runtime-topology.contracts.js +141 -8
  61. package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
  62. package/dist/esm/config-authoring.entry.d.ts +3 -0
  63. package/dist/esm/config-authoring.entry.d.ts.map +1 -0
  64. package/dist/esm/config-authoring.entry.js +5 -0
  65. package/dist/esm/config-authoring.entry.js.map +1 -0
  66. package/dist/esm/credentials/credential-generator.service.d.ts.map +1 -1
  67. package/dist/esm/credentials/credential-generator.service.js +1 -1
  68. package/dist/esm/credentials/credential-generator.service.js.map +1 -1
  69. package/dist/esm/index.d.ts +30 -15
  70. package/dist/esm/index.d.ts.map +1 -1
  71. package/dist/esm/index.js +16 -1
  72. package/dist/esm/index.js.map +1 -1
  73. package/dist/esm/lockfile/canonical-json.d.ts +41 -0
  74. package/dist/esm/lockfile/canonical-json.d.ts.map +1 -0
  75. package/dist/esm/lockfile/canonical-json.js +56 -0
  76. package/dist/esm/lockfile/canonical-json.js.map +1 -0
  77. package/dist/esm/lockfile/lockfile-io.d.ts +231 -0
  78. package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -0
  79. package/dist/esm/lockfile/lockfile-io.js +303 -0
  80. package/dist/esm/lockfile/lockfile-io.js.map +1 -0
  81. package/dist/esm/lockfile/materialize-infra-section.d.ts +99 -0
  82. package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -0
  83. package/dist/esm/lockfile/materialize-infra-section.js +153 -0
  84. package/dist/esm/lockfile/materialize-infra-section.js.map +1 -0
  85. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +522 -0
  86. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -0
  87. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +116 -0
  88. package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -0
  89. package/dist/esm/project-config/define-framework-config.d.ts +36 -10
  90. package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
  91. package/dist/esm/project-config/define-framework-config.js +67 -3
  92. package/dist/esm/project-config/define-framework-config.js.map +1 -1
  93. package/dist/esm/project-config/define-infra-env-config.d.ts +570 -0
  94. package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -0
  95. package/dist/esm/project-config/define-infra-env-config.js +726 -0
  96. package/dist/esm/project-config/define-infra-env-config.js.map +1 -0
  97. package/dist/esm/project-config/define-minion-config.d.ts +221 -23
  98. package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
  99. package/dist/esm/project-config/define-minion-config.js +228 -11
  100. package/dist/esm/project-config/define-minion-config.js.map +1 -1
  101. package/dist/esm/project-config/define-saas-config.d.ts +427 -218
  102. package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
  103. package/dist/esm/project-config/define-saas-config.js +704 -75
  104. package/dist/esm/project-config/define-saas-config.js.map +1 -1
  105. package/dist/esm/project-config/define-worker-config.d.ts +106 -10
  106. package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
  107. package/dist/esm/project-config/define-worker-config.js +99 -9
  108. package/dist/esm/project-config/define-worker-config.js.map +1 -1
  109. package/dist/esm/project-config/index.d.ts +28 -21
  110. package/dist/esm/project-config/index.d.ts.map +1 -1
  111. package/dist/esm/project-config/index.js +14 -7
  112. package/dist/esm/project-config/index.js.map +1 -1
  113. package/dist/esm/project-config/loader.d.ts +120 -10
  114. package/dist/esm/project-config/loader.d.ts.map +1 -1
  115. package/dist/esm/project-config/loader.js +290 -38
  116. package/dist/esm/project-config/loader.js.map +1 -1
  117. package/dist/esm/project-config/minion-local-provider-registration.d.ts +69 -0
  118. package/dist/esm/project-config/minion-local-provider-registration.d.ts.map +1 -0
  119. package/dist/esm/project-config/minion-local-provider-registration.js +72 -0
  120. package/dist/esm/project-config/minion-local-provider-registration.js.map +1 -0
  121. package/dist/esm/project-config/provider-catalog-types.d.ts +12 -0
  122. package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -0
  123. package/dist/esm/project-config/provider-catalog-types.js +49 -0
  124. package/dist/esm/project-config/provider-catalog-types.js.map +1 -0
  125. package/dist/esm/project-config/provider-companion-discovery.d.ts +24 -0
  126. package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -0
  127. package/dist/esm/project-config/provider-companion-discovery.js +244 -0
  128. package/dist/esm/project-config/provider-companion-discovery.js.map +1 -0
  129. package/dist/esm/project-config/provider-runtime-artifacts.d.ts +297 -0
  130. package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -0
  131. package/dist/esm/project-config/provider-runtime-artifacts.js +860 -0
  132. package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -0
  133. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts +18 -0
  134. package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -0
  135. package/dist/esm/project-config/shared/application-creation-verification.schemas.js +25 -0
  136. package/dist/esm/project-config/shared/application-creation-verification.schemas.js.map +1 -0
  137. package/dist/esm/project-config/shared/application-modules.schemas.d.ts +10 -2
  138. package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
  139. package/dist/esm/project-config/shared/application-modules.schemas.js +12 -1
  140. package/dist/esm/project-config/shared/application-modules.schemas.js.map +1 -1
  141. package/dist/esm/project-config/shared/application-modules.utils.d.ts +2 -1
  142. package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
  143. package/dist/esm/project-config/shared/application-modules.utils.js +6 -1
  144. package/dist/esm/project-config/shared/application-modules.utils.js.map +1 -1
  145. package/dist/esm/project-config/shared/auth.schemas.d.ts +102 -0
  146. package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -0
  147. package/dist/esm/project-config/shared/auth.schemas.js +100 -0
  148. package/dist/esm/project-config/shared/auth.schemas.js.map +1 -0
  149. package/dist/esm/project-config/shared/backing-services.schemas.d.ts +316 -39
  150. package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
  151. package/dist/esm/project-config/shared/backing-services.schemas.js +359 -24
  152. package/dist/esm/project-config/shared/backing-services.schemas.js.map +1 -1
  153. package/dist/esm/project-config/shared/cdn.example.d.ts +14 -0
  154. package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -0
  155. package/dist/esm/project-config/shared/cdn.example.js +38 -0
  156. package/dist/esm/project-config/shared/cdn.example.js.map +1 -0
  157. package/dist/esm/project-config/shared/cdn.schemas.d.ts +182 -0
  158. package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -0
  159. package/dist/esm/project-config/shared/cdn.schemas.js +151 -0
  160. package/dist/esm/project-config/shared/cdn.schemas.js.map +1 -0
  161. package/dist/esm/project-config/shared/csp-defaults.d.ts +92 -0
  162. package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -0
  163. package/dist/esm/project-config/shared/csp-defaults.js +195 -0
  164. package/dist/esm/project-config/shared/csp-defaults.js.map +1 -0
  165. package/dist/esm/project-config/shared/csp-emit.d.ts +106 -0
  166. package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -0
  167. package/dist/esm/project-config/shared/csp-emit.js +305 -0
  168. package/dist/esm/project-config/shared/csp-emit.js.map +1 -0
  169. package/dist/esm/project-config/shared/csp.schemas.d.ts +266 -0
  170. package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -0
  171. package/dist/esm/project-config/shared/csp.schemas.js +281 -0
  172. package/dist/esm/project-config/shared/csp.schemas.js.map +1 -0
  173. package/dist/esm/project-config/shared/data-services.schemas.d.ts +45 -9
  174. package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
  175. package/dist/esm/project-config/shared/data-services.schemas.js +45 -9
  176. package/dist/esm/project-config/shared/data-services.schemas.js.map +1 -1
  177. package/dist/esm/project-config/shared/env-example-defaults.d.ts +0 -1
  178. package/dist/esm/project-config/shared/env-example-defaults.d.ts.map +1 -1
  179. package/dist/esm/project-config/shared/env-example-defaults.js +1 -2
  180. package/dist/esm/project-config/shared/env-example-defaults.js.map +1 -1
  181. package/dist/esm/project-config/shared/environment.schemas.d.ts +134 -8
  182. package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
  183. package/dist/esm/project-config/shared/environment.schemas.js +185 -2
  184. package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
  185. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +779 -0
  186. package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -0
  187. package/dist/esm/project-config/shared/infra-providers.schemas.js +210 -0
  188. package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -0
  189. package/dist/esm/project-config/shared/infra-service.schemas.d.ts +18 -0
  190. package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -0
  191. package/dist/esm/project-config/shared/infra-service.schemas.js +16 -0
  192. package/dist/esm/project-config/shared/infra-service.schemas.js.map +1 -0
  193. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +83 -1
  194. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
  195. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +99 -2
  196. package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
  197. package/dist/esm/project-config/shared/k8s-utils.d.ts +51 -7
  198. package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
  199. package/dist/esm/project-config/shared/k8s-utils.js +59 -12
  200. package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
  201. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts +31 -0
  202. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -0
  203. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js +32 -0
  204. package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -0
  205. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +142 -0
  206. package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -0
  207. package/dist/esm/project-config/shared/minion-resource-access.validation.js +159 -0
  208. package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -0
  209. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts +100 -0
  210. package/dist/esm/project-config/shared/object-storage-session-policy.d.ts.map +1 -0
  211. package/dist/esm/project-config/shared/object-storage-session-policy.js +130 -0
  212. package/dist/esm/project-config/shared/object-storage-session-policy.js.map +1 -0
  213. package/dist/esm/project-config/shared/platform-services.schemas.d.ts +9 -14
  214. package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
  215. package/dist/esm/project-config/shared/platform-services.schemas.js +13 -9
  216. package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
  217. package/dist/esm/project-config/shared/schema-version.schemas.d.ts +15 -0
  218. package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -0
  219. package/dist/esm/project-config/shared/schema-version.schemas.js +40 -0
  220. package/dist/esm/project-config/shared/schema-version.schemas.js.map +1 -0
  221. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts +283 -8
  222. package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
  223. package/dist/esm/project-config/shared/service-definitions.schemas.js +325 -8
  224. package/dist/esm/project-config/shared/service-definitions.schemas.js.map +1 -1
  225. package/dist/esm/registry/artifact-domain.schemas.d.ts +54 -0
  226. package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -0
  227. package/dist/esm/registry/artifact-domain.schemas.js +40 -0
  228. package/dist/esm/registry/artifact-domain.schemas.js.map +1 -0
  229. package/dist/esm/registry/companion-api.schemas.d.ts +176 -0
  230. package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -0
  231. package/dist/esm/registry/companion-api.schemas.js +165 -0
  232. package/dist/esm/registry/companion-api.schemas.js.map +1 -0
  233. package/dist/esm/registry/digest.schemas.d.ts +20 -0
  234. package/dist/esm/registry/digest.schemas.d.ts.map +1 -0
  235. package/dist/esm/registry/digest.schemas.js +21 -0
  236. package/dist/esm/registry/digest.schemas.js.map +1 -0
  237. package/dist/esm/registry/index.d.ts +33 -0
  238. package/dist/esm/registry/index.d.ts.map +1 -0
  239. package/dist/esm/registry/index.js +33 -0
  240. package/dist/esm/registry/index.js.map +1 -0
  241. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +107 -0
  242. package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -0
  243. package/dist/esm/registry/lockfile-modules-section.schemas.js +67 -0
  244. package/dist/esm/registry/lockfile-modules-section.schemas.js.map +1 -0
  245. package/dist/esm/registry/module-artifact.schemas.d.ts +94 -0
  246. package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -0
  247. package/dist/esm/registry/module-artifact.schemas.js +69 -0
  248. package/dist/esm/registry/module-artifact.schemas.js.map +1 -0
  249. package/dist/esm/registry/module-manifest.schemas.d.ts +134 -0
  250. package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -0
  251. package/dist/esm/registry/module-manifest.schemas.js +155 -0
  252. package/dist/esm/registry/module-manifest.schemas.js.map +1 -0
  253. package/dist/esm/registry/registry-config.schemas.d.ts +31 -0
  254. package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -0
  255. package/dist/esm/registry/registry-config.schemas.js +24 -0
  256. package/dist/esm/registry/registry-config.schemas.js.map +1 -0
  257. package/dist/esm/registry/registry-defaults.constants.d.ts +37 -0
  258. package/dist/esm/registry/registry-defaults.constants.d.ts.map +1 -0
  259. package/dist/esm/registry/registry-defaults.constants.js +37 -0
  260. package/dist/esm/registry/registry-defaults.constants.js.map +1 -0
  261. package/dist/esm/registry/registry-errors.d.ts +109 -0
  262. package/dist/esm/registry/registry-errors.d.ts.map +1 -0
  263. package/dist/esm/registry/registry-errors.js +185 -0
  264. package/dist/esm/registry/registry-errors.js.map +1 -0
  265. package/dist/esm/registry/registry-section-schemas.constants.d.ts +39 -0
  266. package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -0
  267. package/dist/esm/registry/registry-section-schemas.constants.js +22 -0
  268. package/dist/esm/registry/registry-section-schemas.constants.js.map +1 -0
  269. package/dist/esm/release/framework-release.constants.d.ts +26 -1
  270. package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
  271. package/dist/esm/release/framework-release.constants.js +27 -2
  272. package/dist/esm/release/framework-release.constants.js.map +1 -1
  273. package/dist/esm/schemas/framework-info.schemas.d.ts +1 -1
  274. package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
  275. package/dist/esm/schemas/framework-info.schemas.js +1 -1
  276. package/dist/esm/schemas/framework-info.schemas.js.map +1 -1
  277. package/dist/esm/schemas/framework-secrets.schemas.d.ts +5 -5
  278. package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
  279. package/dist/esm/schemas/framework-secrets.schemas.js +1 -1
  280. package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
  281. package/dist/esm/schemas/platform-application-config.schemas.d.ts +1 -1
  282. package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
  283. package/dist/esm/schemas/platform-application-config.schemas.js +11 -2
  284. package/dist/esm/schemas/platform-application-config.schemas.js.map +1 -1
  285. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts +7 -7
  286. package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
  287. package/dist/esm/schemas/platform-application-secrets.schemas.js +17 -2
  288. package/dist/esm/schemas/platform-application-secrets.schemas.js.map +1 -1
  289. package/dist/esm/schemas/platform-config.schemas.d.ts +12 -13
  290. package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
  291. package/dist/esm/schemas/platform-config.schemas.js +15 -3
  292. package/dist/esm/schemas/platform-config.schemas.js.map +1 -1
  293. package/dist/esm/workspace-scope/application-subject-manifest.d.ts +26 -0
  294. package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -0
  295. package/dist/esm/workspace-scope/application-subject-manifest.js +43 -0
  296. package/dist/esm/workspace-scope/application-subject-manifest.js.map +1 -0
  297. package/dist/esm/workspace-scope/index.d.ts +5 -2
  298. package/dist/esm/workspace-scope/index.d.ts.map +1 -1
  299. package/dist/esm/workspace-scope/index.js +4 -1
  300. package/dist/esm/workspace-scope/index.js.map +1 -1
  301. package/dist/esm/workspace-scope/resolve-homes.d.ts +20 -0
  302. package/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -0
  303. package/dist/esm/workspace-scope/resolve-homes.js +62 -0
  304. package/dist/esm/workspace-scope/resolve-homes.js.map +1 -0
  305. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +211 -0
  306. package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -0
  307. package/dist/esm/workspace-scope/workspace-homes.schemas.js +113 -0
  308. package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -0
  309. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts +10 -5
  310. package/dist/esm/workspace-scope/workspace-scope-detector.d.ts.map +1 -1
  311. package/dist/esm/workspace-scope/workspace-scope-detector.js +22 -36
  312. package/dist/esm/workspace-scope/workspace-scope-detector.js.map +1 -1
  313. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +147 -58
  314. package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
  315. package/dist/esm/workspace-scope/workspace-scope.schemas.js +174 -78
  316. package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
  317. package/dist/tsconfig.build.tsbuildinfo +1 -1
  318. package/package.json +31 -17
  319. package/dist/esm/credentials/credentials-provisioner.service.d.ts +0 -190
  320. package/dist/esm/credentials/credentials-provisioner.service.d.ts.map +0 -1
  321. package/dist/esm/credentials/credentials-provisioner.service.js +0 -278
  322. package/dist/esm/credentials/credentials-provisioner.service.js.map +0 -1
  323. package/dist/esm/infra-managers/infra-manager.models.d.ts +0 -146
  324. package/dist/esm/infra-managers/infra-manager.models.d.ts.map +0 -1
  325. package/dist/esm/infra-managers/infra-manager.models.js +0 -2
  326. package/dist/esm/infra-managers/infra-manager.models.js.map +0 -1
  327. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts +0 -64
  328. package/dist/esm/infra-managers/mongo-atlas-manager.service.d.ts.map +0 -1
  329. package/dist/esm/infra-managers/mongo-atlas-manager.service.js +0 -307
  330. package/dist/esm/infra-managers/mongo-atlas-manager.service.js.map +0 -1
  331. package/dist/esm/infra-managers/postgresql-manager.service.d.ts +0 -115
  332. package/dist/esm/infra-managers/postgresql-manager.service.d.ts.map +0 -1
  333. package/dist/esm/infra-managers/postgresql-manager.service.js +0 -403
  334. package/dist/esm/infra-managers/postgresql-manager.service.js.map +0 -1
  335. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts +0 -64
  336. package/dist/esm/infra-managers/rabbitmq-manager.service.d.ts.map +0 -1
  337. package/dist/esm/infra-managers/rabbitmq-manager.service.js +0 -288
  338. package/dist/esm/infra-managers/rabbitmq-manager.service.js.map +0 -1
  339. package/dist/esm/infra-managers/redis-manager.service.d.ts +0 -78
  340. package/dist/esm/infra-managers/redis-manager.service.d.ts.map +0 -1
  341. package/dist/esm/infra-managers/redis-manager.service.js +0 -326
  342. package/dist/esm/infra-managers/redis-manager.service.js.map +0 -1
  343. package/dist/esm/project-config/define-infra-config.d.ts +0 -128
  344. package/dist/esm/project-config/define-infra-config.d.ts.map +0 -1
  345. package/dist/esm/project-config/define-infra-config.js +0 -87
  346. package/dist/esm/project-config/define-infra-config.js.map +0 -1
  347. package/dist/esm/project-config/define-platform-config.d.ts +0 -65
  348. package/dist/esm/project-config/define-platform-config.d.ts.map +0 -1
  349. package/dist/esm/project-config/define-platform-config.js +0 -22
  350. package/dist/esm/project-config/define-platform-config.js.map +0 -1
  351. package/dist/esm/project-config/define-platform-env-config.d.ts +0 -41
  352. package/dist/esm/project-config/define-platform-env-config.d.ts.map +0 -1
  353. package/dist/esm/project-config/define-platform-env-config.js +0 -45
  354. package/dist/esm/project-config/define-platform-env-config.js.map +0 -1
  355. package/dist/esm/project-config/define-project-config.d.ts +0 -38
  356. package/dist/esm/project-config/define-project-config.d.ts.map +0 -1
  357. package/dist/esm/project-config/define-project-config.js +0 -57
  358. package/dist/esm/project-config/define-project-config.js.map +0 -1
  359. package/dist/esm/project-config/define-sharing-policy.d.ts +0 -35
  360. package/dist/esm/project-config/define-sharing-policy.d.ts.map +0 -1
  361. package/dist/esm/project-config/define-sharing-policy.js +0 -30
  362. package/dist/esm/project-config/define-sharing-policy.js.map +0 -1
  363. package/dist/esm/project-config/sharing-policy-validation.d.ts +0 -40
  364. package/dist/esm/project-config/sharing-policy-validation.d.ts.map +0 -1
  365. package/dist/esm/project-config/sharing-policy-validation.js +0 -143
  366. package/dist/esm/project-config/sharing-policy-validation.js.map +0 -1
  367. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts +0 -23
  368. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.d.ts.map +0 -1
  369. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js +0 -13
  370. package/dist/esm/runtime-bridge/platform-runtime-bridge.contracts.js.map +0 -1
  371. package/src/bootstrap/application-backend-env.contracts.ts +0 -17
  372. package/src/bootstrap/bootstrap-planner.ts +0 -46
  373. package/src/bootstrap/bootstrap.contracts.ts +0 -251
  374. package/src/bootstrap/bootstrap.schemas.ts +0 -164
  375. package/src/bootstrap/platform-runtime-env.contracts.ts +0 -99
  376. package/src/bootstrap/runtime-topology.contracts.ts +0 -102
  377. package/src/credentials/credential-generator.service.ts +0 -39
  378. package/src/index.ts +0 -16
  379. package/src/project-config/__tests__/application-modules.utils.test.ts +0 -53
  380. package/src/project-config/__tests__/define-framework-config.test.ts +0 -43
  381. package/src/project-config/__tests__/define-saas-config.test.ts +0 -210
  382. package/src/project-config/__tests__/loader.test.ts +0 -100
  383. package/src/project-config/define-framework-config.ts +0 -44
  384. package/src/project-config/define-infra-config.ts +0 -168
  385. package/src/project-config/define-minion-config.ts +0 -27
  386. package/src/project-config/define-platform-config.ts +0 -28
  387. package/src/project-config/define-platform-env-config.ts +0 -59
  388. package/src/project-config/define-project-config.ts +0 -63
  389. package/src/project-config/define-saas-config.ts +0 -171
  390. package/src/project-config/define-sharing-policy.ts +0 -36
  391. package/src/project-config/define-worker-config.ts +0 -27
  392. package/src/project-config/index.ts +0 -23
  393. package/src/project-config/loader.ts +0 -220
  394. package/src/project-config/shared/application-modules.schemas.ts +0 -12
  395. package/src/project-config/shared/application-modules.utils.ts +0 -65
  396. package/src/project-config/shared/backing-services.schemas.ts +0 -59
  397. package/src/project-config/shared/data-services.schemas.ts +0 -58
  398. package/src/project-config/shared/env-example-defaults.ts +0 -50
  399. package/src/project-config/shared/environment.schemas.ts +0 -136
  400. package/src/project-config/shared/infrastructure-defaults.schemas.ts +0 -47
  401. package/src/project-config/shared/k8s-utils.ts +0 -56
  402. package/src/project-config/shared/platform-services.schemas.ts +0 -33
  403. package/src/project-config/shared/service-definitions.schemas.ts +0 -38
  404. package/src/project-config/sharing-policy-validation.ts +0 -159
  405. package/src/release/framework-release.constants.ts +0 -2
  406. package/src/schemas/__tests__/platform-config.schemas.test.ts +0 -90
  407. package/src/schemas/framework-info.schemas.ts +0 -13
  408. package/src/schemas/framework-secrets.schemas.ts +0 -19
  409. package/src/schemas/platform-application-config.schemas.ts +0 -25
  410. package/src/schemas/platform-application-secrets.schemas.ts +0 -78
  411. package/src/schemas/platform-config.schemas.ts +0 -45
  412. package/src/workspace-scope/index.ts +0 -2
  413. package/src/workspace-scope/workspace-scope-detector.ts +0 -98
  414. package/src/workspace-scope/workspace-scope.schemas.ts +0 -224
@@ -1,14 +1,319 @@
1
1
  import { z } from 'zod';
2
- export var AppFrontendType;
3
- (function (AppFrontendType) {
4
- AppFrontendType["SAAS_APP"] = "saas-app";
5
- AppFrontendType["STATIC_WEBSITE"] = "static-website";
6
- })(AppFrontendType || (AppFrontendType = {}));
7
- export const AppServiceDefinitionSchema = z.object({
2
+ import { WildoCspConfigSchema } from './csp.schemas.js';
3
+ /**
4
+ * `AppFrontendType` lives in `@wildo-ai/saas-models/public-runtime` so the
5
+ * backend's `FrontendServiceDefinitionSchema` (`@wildo-ai/saas-models`) and
6
+ * client-bundle consumers (website discovery, scaffolding, CSP config,
7
+ * companion services) can read the same enum without booting the heavy
8
+ * decorator-bound schema graph. The atom is imported from the
9
+ * `/public-runtime` subpath (NOT the package root barrel) so this file
10
+ * stays free of `initZodDecorators()` side effects — `import { z } from 'zod'`
11
+ * only, plus one decorator-free public-runtime import.
12
+ *
13
+ * The re-export below preserves every existing
14
+ * `import { AppFrontendType } from '@wildo-ai/platform-config-lib'` call site
15
+ * unchanged. Single source of truth (`@wildo-ai/saas-models`) with the
16
+ * original public surface preserved.
17
+ *
18
+ * For the kind-by-kind taxonomy (`SAAS_APP` / `STATIC_WEBSITE` / `TECH_DOC`)
19
+ * and the locked "no native variants" design decision, see the file-level
20
+ * JSDoc in `engine/saas-models/src/config/app-frontend-type.shared.schemas.ts`
21
+ * — that is the canonical home; do NOT duplicate the explanation here.
22
+ */
23
+ import { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';
24
+ export { AppFrontendType };
25
+ export var AppLibraryType;
26
+ (function (AppLibraryType) {
27
+ AppLibraryType["FULLSTACK"] = "fullstack";
28
+ AppLibraryType["FRONTEND"] = "frontend";
29
+ AppLibraryType["BACKEND"] = "backend";
30
+ })(AppLibraryType || (AppLibraryType = {}));
31
+ /**
32
+ * How the receiving frontend stores the JWT pair after a cross-frontend
33
+ * handoff exchange (`cross-app-jwt-propagation.md` K-4).
34
+ *
35
+ * - `'ephemeral'` (default) → `EphemeralSessionTokenStorage` (in-memory,
36
+ * dies with the tab). Avoids token poisoning when the source frontend
37
+ * already holds a persistent session, and matches the existing W7.3b
38
+ * `Auth_OneOffSession` guard that refuses non-`Ephemeral` storage.
39
+ * Correct default for `TECH_DOC`, for secondary `SAAS_APP` surfaces
40
+ * (e.g., an admin console reached by handoff from a primary app),
41
+ * and for `STATIC_WEBSITE` (which never stores tokens anyway).
42
+ * - `'persistent'` → `PersistentSessionTokenStorage` (localStorage).
43
+ * Opt-in for the primary `SAAS_APP` surface where the user expects
44
+ * their session to survive a tab close. Each service authors this
45
+ * explicitly; there is no auto-derivation from `frontendType`
46
+ * because a project can have multiple `SAAS_APP` services where
47
+ * only one is "primary".
48
+ */
49
+ export const APP_SESSION_STORAGES = ['persistent', 'ephemeral'];
50
+ /**
51
+ * The writable mount every containerised app runtime gets, unconditionally.
52
+ *
53
+ * Shared by minions and workers rather than defined twice: it is paired with
54
+ * `readOnlyRootFilesystem: true` in both renderers, and two copies of a path this
55
+ * load-bearing WILL drift. For minions the pairing is acute — the file liveness
56
+ * heartbeat is written here, so separating them restart-loops healthy pods — and
57
+ * while workers probe over HTTP instead, a read-only rootfs with nowhere to write
58
+ * a temp file is its own failure, arriving later and less legibly.
59
+ */
60
+ export const RUNTIME_MANDATORY_WRITABLE_PATH = '/tmp';
61
+ /**
62
+ * Container isolation knobs an app runtime (minion or worker) may author.
63
+ *
64
+ * ## What is deliberately ABSENT
65
+ *
66
+ * The security floor — `runAsNonRoot`, `readOnlyRootFilesystem`,
67
+ * `allowPrivilegeEscalation: false`, `capabilities: drop [ALL]`,
68
+ * `seccompProfile`, `automountServiceAccountToken: false` — is emitted
69
+ * unconditionally by the renderers and cannot be authored down. A config key
70
+ * that turns off root-filesystem protection is a bypass wearing a settings hat;
71
+ * lowering the floor must be a deliberate schema change under review.
72
+ *
73
+ * ## What IS authorable, and why each earns it
74
+ *
75
+ * - `runAsUser` / `runAsGroup` — image-dependent, and demonstrably so: Wonder
76
+ * Todos' Node worker runs as uid 1000 (`USER node`) while its Rust worker uses
77
+ * distroless `nonroot` at uid 65532. No single default is correct, and a wrong
78
+ * uid with `runAsNonRoot: true` means the kubelet refuses to start the
79
+ * container.
80
+ * - `writablePaths` — ADDITIVE only, on top of the always-present
81
+ * {@link RUNTIME_MANDATORY_WRITABLE_PATH}. It can grant writability, never
82
+ * remove it, so it cannot weaken the read-only rootfs.
83
+ * - `pidsLimit` — a fork-bomb ceiling; purely a bound.
84
+ */
85
+ export const RUNTIME_DEFAULT_PIDS_LIMIT = 512;
86
+ /**
87
+ * The field CONSTRAINTS, defined once and shared by the two isolation schemas
88
+ * below so a validation rule cannot hold on one and not the other.
89
+ *
90
+ * `runAsUser`/`runAsGroup` are `.positive()` because 0 is root — the identity
91
+ * the whole floor exists to forbid — and a schema that accepts it would let a
92
+ * config re-enable root while `runAsNonRoot: true` is still emitted, producing a
93
+ * container the kubelet refuses for a reason the config never mentions.
94
+ */
95
+ const runtimeIsolationFields = {
96
+ runAsUser: z.number().int().positive(),
97
+ runAsGroup: z.number().int().positive(),
98
+ writablePaths: z.array(z.string().min(1).startsWith('/')),
99
+ pidsLimit: z.number().int().positive(),
100
+ };
101
+ export const RuntimeIsolationSchema = z.strictObject({
102
+ runAsUser: runtimeIsolationFields.runAsUser.default(10001),
103
+ runAsGroup: runtimeIsolationFields.runAsGroup.default(10001),
104
+ writablePaths: runtimeIsolationFields.writablePaths.default([]),
105
+ pidsLimit: runtimeIsolationFields.pidsLimit.default(RUNTIME_DEFAULT_PIDS_LIMIT),
106
+ });
107
+ /**
108
+ * The AUTHORED form: every knob optional and — critically — carrying NO default.
109
+ *
110
+ * This is not the same thing as `RuntimeIsolationSchema.partial()`, and the
111
+ * difference is a real defect rather than a style point. `.partial()` only makes
112
+ * a field optional; the inner `.default(10001)` still FIRES, so an authored
113
+ * `isolation: { runAsUser: 101 }` parses to a `runAsGroup` of 10001 and the
114
+ * caller can no longer tell "authored 10001" from "authored nothing". For a
115
+ * service row that difference decides which account the container runs as, and
116
+ * the wrong answer is a pod that never starts.
117
+ *
118
+ * Caught by the pin `honours an authored image-dependent uid…` in
119
+ * `service-definitions.schemas.test.ts`, which was written expecting the kind
120
+ * default and got 10001.
121
+ */
122
+ export const AuthoredRuntimeIsolationSchema = z.strictObject({
123
+ runAsUser: runtimeIsolationFields.runAsUser.optional(),
124
+ runAsGroup: runtimeIsolationFields.runAsGroup.optional(),
125
+ writablePaths: runtimeIsolationFields.writablePaths.optional(),
126
+ pidsLimit: runtimeIsolationFields.pidsLimit.optional(),
127
+ });
128
+ /**
129
+ * Shared `superRefine` body for an authored isolation block.
130
+ *
131
+ * `RUNTIME_MANDATORY_WRITABLE_PATH` is mounted by the renderers, so authoring it
132
+ * again emits two volumeMounts on one mountPath — which Kubernetes rejects at
133
+ * admission, meaning the pod never starts and the error names a duplicate mount
134
+ * rather than the config line that caused it. Caught here, where the message can
135
+ * point at the authored value.
136
+ */
137
+ export function refineRuntimeIsolation(isolation, ctx, path = ['isolation']) {
138
+ const mandatory = isolation.writablePaths.filter((p) => p === RUNTIME_MANDATORY_WRITABLE_PATH || p === `${RUNTIME_MANDATORY_WRITABLE_PATH}/`);
139
+ if (mandatory.length > 0) {
140
+ ctx.addIssue({
141
+ code: 'custom',
142
+ path: [...path, 'writablePaths'],
143
+ message: `'${RUNTIME_MANDATORY_WRITABLE_PATH}' is always mounted — remove it from writablePaths, which is `
144
+ + 'for ADDITIONAL scratch mounts only. Authoring it twice emits two volumeMounts on one '
145
+ + 'mountPath and Kubernetes refuses the pod.',
146
+ });
147
+ }
148
+ const seen = new Set();
149
+ for (const p of isolation.writablePaths) {
150
+ if (seen.has(p)) {
151
+ ctx.addIssue({
152
+ code: 'custom',
153
+ path: [...path, 'writablePaths'],
154
+ message: `Duplicate writable path '${p}' — same duplicate-mountPath rejection as above.`,
155
+ });
156
+ }
157
+ seen.add(p);
158
+ }
159
+ }
160
+ /**
161
+ * The uid/gid an application BACKEND container runs as when nothing is authored.
162
+ *
163
+ * 1001 is not arbitrary and not new: `templates/infra/docker-images/platform/
164
+ * Dockerfile.platform-base` has created `wildo` at 1001 and ended on `USER wildo`
165
+ * since the platform images were written. Reusing it makes the app backend match
166
+ * the convention the framework already ships rather than inventing a third number
167
+ * beside the minion/worker 10001.
168
+ *
169
+ * The paired obligation lives in `Dockerfile.backend-base`: an image whose files
170
+ * are owned by root and whose `USER` is root will be REFUSED by the kubelet under
171
+ * `runAsNonRoot: true`. Schema default and image must move together.
172
+ */
173
+ export const APP_BACKEND_DEFAULT_RUNTIME_UID = 1001;
174
+ /**
175
+ * The uid/gid an application FRONTEND container runs as when nothing is authored.
176
+ *
177
+ * 101 is the `nginx` account in `nginx:1.27-alpine` (verified by running the
178
+ * image, not assumed). Every Wildo frontend is a static bundle served by nginx —
179
+ * the framework mandates that runtime — so defaulting to any other uid would make
180
+ * "authored nothing" the broken case, which is exactly the case that must come
181
+ * out working.
182
+ */
183
+ export const APP_FRONTEND_DEFAULT_RUNTIME_UID = 101;
184
+ /**
185
+ * ## Why the frontend container port is NOT changed, measured rather than assumed
186
+ *
187
+ * The obvious reasoning — "the floor drops ALL capabilities, so a non-root nginx
188
+ * cannot bind :80 without `CAP_NET_BIND_SERVICE`" — is FALSE in a container, and
189
+ * an earlier revision of this file asserted it in JSDoc before anyone ran it.
190
+ *
191
+ * Docker and containerd both set `net.ipv4.ip_unprivileged_port_start=0` inside
192
+ * the container's network namespace, so ports below 1024 are not privileged there
193
+ * at all. Measured against `nginx:1.27-alpine`: `cat
194
+ * /proc/sys/net/ipv4/ip_unprivileged_port_start` prints `0`, and nginx running as
195
+ * uid 101 with a read-only rootfs and no capabilities serves HTTP 200 on :80.
196
+ *
197
+ * So the frontends keep `listen 80` and the Service keeps `targetPort: 80`. No
198
+ * nginx config, Dockerfile `EXPOSE`, Service or Traefik router changes are part
199
+ * of this floor. What nginx DOES need is
200
+ * {@link APP_FRONTEND_MANDATORY_WRITABLE_PATHS} — see there.
201
+ */
202
+ /**
203
+ * Writable mounts an nginx frontend needs BEYOND
204
+ * {@link RUNTIME_MANDATORY_WRITABLE_PATH}, emitted unconditionally rather than
205
+ * authored.
206
+ *
207
+ * They are not additive author choices — they are what the runtime the framework
208
+ * MANDATES cannot start without, measured against `nginx:1.27-alpine`:
209
+ *
210
+ * - `/var/cache/nginx` — the parent of `client_temp`/`proxy_temp`/… . Present in
211
+ * the image but owned by `root:root` 0755, so a non-root master cannot create
212
+ * the temp directories inside it.
213
+ * - `/run` — where the stock `nginx.conf` writes `nginx.pid` (`/var/run` is a
214
+ * symlink to it). Root-owned, so the pid write fails and nginx exits.
215
+ *
216
+ * Mounting them as writable volumes is preferred over `chown`-ing in every
217
+ * application's Dockerfile: it keeps the requirement in the framework's runtime
218
+ * spec, where it is emitted once and cannot be forgotten per app.
219
+ */
220
+ export const APP_FRONTEND_MANDATORY_WRITABLE_PATHS = ['/var/cache/nginx', '/run'];
221
+ /**
222
+ * Resolve a service row's effective container isolation.
223
+ *
224
+ * THE reason this exists as a function rather than a schema default: the correct
225
+ * default depends on the container KIND, and a Zod field default cannot see its
226
+ * sibling `frontendType`. Two renderers consume this (k8s manifests and the
227
+ * compose app lane) and they must not each apply their own fallback — that is how
228
+ * a k8s pod and a compose container end up running as different users from one
229
+ * config row.
230
+ *
231
+ * Frontend rows additionally receive {@link APP_FRONTEND_MANDATORY_WRITABLE_PATHS}
232
+ * prepended, because nginx cannot start without them. They are prepended rather
233
+ * than appended so an author reading the rendered manifest sees the framework's
234
+ * mounts first, and deduplicated against the authored list so re-authoring one is
235
+ * tolerated here (unlike `/tmp`, these are nginx implementation detail rather
236
+ * than a documented contract, so a duplicate is a mistake worth absorbing instead
237
+ * of a config error worth failing on).
238
+ */
239
+ export function resolveAppServiceIsolation(service) {
240
+ const isFrontend = service.frontendType !== undefined;
241
+ const defaultUid = isFrontend ? APP_FRONTEND_DEFAULT_RUNTIME_UID : APP_BACKEND_DEFAULT_RUNTIME_UID;
242
+ const authoredPaths = service.isolation?.writablePaths ?? [];
243
+ const mandatory = isFrontend ? APP_FRONTEND_MANDATORY_WRITABLE_PATHS : [];
244
+ return {
245
+ runAsUser: service.isolation?.runAsUser ?? defaultUid,
246
+ runAsGroup: service.isolation?.runAsGroup ?? defaultUid,
247
+ writablePaths: [...mandatory, ...authoredPaths.filter((p) => !mandatory.includes(p))],
248
+ pidsLimit: service.isolation?.pidsLimit ?? RUNTIME_DEFAULT_PIDS_LIMIT,
249
+ };
250
+ }
251
+ /**
252
+ * One service inside `wildo.saas.config.ts` `services` map.
253
+ *
254
+ * `sessionStorage` (default `'ephemeral'`) is the per-service explicit
255
+ * opt-in to localStorage; the default matches the non-primary-surface
256
+ * common case. See `APP_SESSION_STORAGES` JSDoc for the rationale.
257
+ *
258
+ * `csp?` lives here only for `frontendType: SAAS_APP`. Unlike
259
+ * `STATIC_WEBSITE` / `TECH_DOC`, the main app currently has no
260
+ * engine-owned per-service config file (`wildo.website.config.ts` /
261
+ * `wildo.tech-doc.config.ts`) — the service row itself is therefore the
262
+ * honest app-static authoring seam for SPA-specific posture such as CSP.
263
+ * Non-app services MUST reject authored `csp` here to preserve the
264
+ * semantic split between the generic service declaration and the
265
+ * website/docs engine-owned config files.
266
+ *
267
+ * No host-binding or public-URL authoring on this schema. The public
268
+ * hostname per service is authored per-environment in
269
+ * `infra.serviceHosts` — that seam is in `define-infra-env-config.ts`
270
+ * and is intentionally decoupled from `frontendType` and from the
271
+ * service key so the app developer can map any service to any host
272
+ * (e.g. `services.docs` published at `dev.example.com`).
273
+ */
274
+ export const AppServiceDefinitionSchema = z.strictObject({
8
275
  path: z.string().min(1),
9
276
  serviceName: z.string().min(1),
10
277
  defaultPort: z.number().int().positive().optional(),
11
278
  frontendType: z.enum(AppFrontendType).optional(),
279
+ sessionStorage: z.enum(APP_SESSION_STORAGES).default('ephemeral'),
280
+ csp: WildoCspConfigSchema.optional(),
281
+ /**
282
+ * Container isolation — the same contract minions and workers carry, applied to
283
+ * the two container kinds that had none: the app backend and each frontend.
284
+ *
285
+ * `.optional()` here, unlike the minion/worker `.prefault({})`, because the
286
+ * correct DEFAULT depends on the kind and the kind is not known until the row
287
+ * is read: a backend runs Node as {@link APP_BACKEND_DEFAULT_RUNTIME_UID}, a
288
+ * frontend runs nginx as {@link APP_FRONTEND_DEFAULT_RUNTIME_UID}. Emitting one
289
+ * number for both would hand half the services a uid their image does not
290
+ * define. Callers resolve it through {@link resolveAppServiceIsolation}, which
291
+ * is where "authored nothing" becomes a hardened value — never at a renderer,
292
+ * so the two renderers cannot disagree.
293
+ *
294
+ * The floor is absent for the same reason it is absent from the minion and
295
+ * worker schemas: it is emitted unconditionally and must not be authorable
296
+ * down. See {@link RuntimeIsolationSchema}.
297
+ */
298
+ isolation: AuthoredRuntimeIsolationSchema.optional(),
299
+ }).superRefine((service, ctx) => {
300
+ if (service.isolation) {
301
+ refineRuntimeIsolation(resolveAppServiceIsolation(service), ctx);
302
+ }
303
+ if (service.csp !== undefined && service.frontendType !== AppFrontendType.SAAS_APP) {
304
+ ctx.addIssue({
305
+ code: 'custom',
306
+ path: ['csp'],
307
+ message: 'services.<key>.csp is only supported for `frontendType: SAAS_APP`. '
308
+ + 'STATIC_WEBSITE and TECH_DOC services must author CSP in their per-service '
309
+ + '`wildo.website.config.ts` / `wildo.tech-doc.config.ts` files, and '
310
+ + 'non-frontend services cannot ship a document CSP.',
311
+ });
312
+ }
313
+ });
314
+ export const AppLibraryDefinitionSchema = z.object({
315
+ path: z.string().min(1),
316
+ type: z.enum(AppLibraryType),
12
317
  }).strict();
13
318
  export const WorkerRuntimeSchema = z.object({
14
319
  type: z.string().min(1),
@@ -23,7 +328,19 @@ export const DataAccessSchema = z.object({
23
328
  cache: z.boolean().optional(),
24
329
  queue: z.enum(['consumer', 'producer', 'both', 'none']).optional(),
25
330
  });
26
- export const AppRefSchema = z.object({
331
+ /**
332
+ * Minimal "I live at this path" reference for a per-folder app sub-config
333
+ * (`wildo.minion.config.ts`, `wildo.worker.config.ts`, `wildo.specifications.config.ts`).
334
+ *
335
+ * Tightened to `z.strictObject` (M-3 in
336
+ * `.cursor/plans/minions-and-workers-implementation.md`) so authoring an
337
+ * unknown key — e.g. a typo `pat:` instead of `path:`, or a stray
338
+ * `resourceAccess` on a `workers` entry where it has no meaning today —
339
+ * fails fast at parse time rather than being silently dropped. The
340
+ * minions bucket value schema in `define-saas-config.ts` extends this
341
+ * shape (still strict) to add `resourceAccess` per KD-11.
342
+ */
343
+ export const AppRefSchema = z.strictObject({
27
344
  path: z.string().min(1),
28
345
  });
29
- //# sourceMappingURL=service-definitions.schemas.js.map
346
+ //# sourceMappingURL=service-definitions.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service-definitions.schemas.js","sourceRoot":"","sources":["../../../../src/project-config/shared/service-definitions.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,oDAAiC,CAAA;AACnC,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACnD,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC,MAAM,EAAE,CAAA;AAGX,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IAChE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnE,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC"}
1
+ {"version":3,"file":"service-definitions.schemas.js","sourceRoot":"","sources":["../../../../../src/project-config/shared/service-definitions.schemas.ts"],"names":[],"mappings":"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","sourcesContent":["import { z } from 'zod';\nimport { WildoCspConfigSchema } from './csp.schemas';\n\n/**\n * `AppFrontendType` lives in `@wildo-ai/saas-models/public-runtime` so the\n * backend's `FrontendServiceDefinitionSchema` (`@wildo-ai/saas-models`) and\n * client-bundle consumers (website discovery, scaffolding, CSP config,\n * companion services) can read the same enum without booting the heavy\n * decorator-bound schema graph. The atom is imported from the\n * `/public-runtime` subpath (NOT the package root barrel) so this file\n * stays free of `initZodDecorators()` side effects — `import { z } from 'zod'`\n * only, plus one decorator-free public-runtime import.\n *\n * The re-export below preserves every existing\n * `import { AppFrontendType } from '@wildo-ai/platform-config-lib'` call site\n * unchanged. Single source of truth (`@wildo-ai/saas-models`) with the\n * original public surface preserved.\n *\n * For the kind-by-kind taxonomy (`SAAS_APP` / `STATIC_WEBSITE` / `TECH_DOC`)\n * and the locked \"no native variants\" design decision, see the file-level\n * JSDoc in `engine/saas-models/src/config/app-frontend-type.shared.schemas.ts`\n * — that is the canonical home; do NOT duplicate the explanation here.\n */\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\n\nexport { AppFrontendType };\n\nexport enum AppLibraryType {\n FULLSTACK = 'fullstack',\n FRONTEND = 'frontend',\n BACKEND = 'backend',\n}\n\n/**\n * How the receiving frontend stores the JWT pair after a cross-frontend\n * handoff exchange (`cross-app-jwt-propagation.md` K-4).\n *\n * - `'ephemeral'` (default) → `EphemeralSessionTokenStorage` (in-memory,\n * dies with the tab). Avoids token poisoning when the source frontend\n * already holds a persistent session, and matches the existing W7.3b\n * `Auth_OneOffSession` guard that refuses non-`Ephemeral` storage.\n * Correct default for `TECH_DOC`, for secondary `SAAS_APP` surfaces\n * (e.g., an admin console reached by handoff from a primary app),\n * and for `STATIC_WEBSITE` (which never stores tokens anyway).\n * - `'persistent'` → `PersistentSessionTokenStorage` (localStorage).\n * Opt-in for the primary `SAAS_APP` surface where the user expects\n * their session to survive a tab close. Each service authors this\n * explicitly; there is no auto-derivation from `frontendType`\n * because a project can have multiple `SAAS_APP` services where\n * only one is \"primary\".\n */\nexport const APP_SESSION_STORAGES = ['persistent', 'ephemeral'] as const;\nexport type AppSessionStorage = (typeof APP_SESSION_STORAGES)[number];\n\n/**\n * The writable mount every containerised app runtime gets, unconditionally.\n *\n * Shared by minions and workers rather than defined twice: it is paired with\n * `readOnlyRootFilesystem: true` in both renderers, and two copies of a path this\n * load-bearing WILL drift. For minions the pairing is acute — the file liveness\n * heartbeat is written here, so separating them restart-loops healthy pods — and\n * while workers probe over HTTP instead, a read-only rootfs with nowhere to write\n * a temp file is its own failure, arriving later and less legibly.\n */\nexport const RUNTIME_MANDATORY_WRITABLE_PATH = '/tmp';\n\n/**\n * Container isolation knobs an app runtime (minion or worker) may author.\n *\n * ## What is deliberately ABSENT\n *\n * The security floor — `runAsNonRoot`, `readOnlyRootFilesystem`,\n * `allowPrivilegeEscalation: false`, `capabilities: drop [ALL]`,\n * `seccompProfile`, `automountServiceAccountToken: false` — is emitted\n * unconditionally by the renderers and cannot be authored down. A config key\n * that turns off root-filesystem protection is a bypass wearing a settings hat;\n * lowering the floor must be a deliberate schema change under review.\n *\n * ## What IS authorable, and why each earns it\n *\n * - `runAsUser` / `runAsGroup` — image-dependent, and demonstrably so: Wonder\n * Todos' Node worker runs as uid 1000 (`USER node`) while its Rust worker uses\n * distroless `nonroot` at uid 65532. No single default is correct, and a wrong\n * uid with `runAsNonRoot: true` means the kubelet refuses to start the\n * container.\n * - `writablePaths` — ADDITIVE only, on top of the always-present\n * {@link RUNTIME_MANDATORY_WRITABLE_PATH}. It can grant writability, never\n * remove it, so it cannot weaken the read-only rootfs.\n * - `pidsLimit` — a fork-bomb ceiling; purely a bound.\n */\nexport const RUNTIME_DEFAULT_PIDS_LIMIT = 512;\n\n/**\n * The field CONSTRAINTS, defined once and shared by the two isolation schemas\n * below so a validation rule cannot hold on one and not the other.\n *\n * `runAsUser`/`runAsGroup` are `.positive()` because 0 is root — the identity\n * the whole floor exists to forbid — and a schema that accepts it would let a\n * config re-enable root while `runAsNonRoot: true` is still emitted, producing a\n * container the kubelet refuses for a reason the config never mentions.\n */\nconst runtimeIsolationFields = {\n runAsUser: z.number().int().positive(),\n runAsGroup: z.number().int().positive(),\n writablePaths: z.array(z.string().min(1).startsWith('/')),\n pidsLimit: z.number().int().positive(),\n};\n\nexport const RuntimeIsolationSchema = z.strictObject({\n runAsUser: runtimeIsolationFields.runAsUser.default(10001),\n runAsGroup: runtimeIsolationFields.runAsGroup.default(10001),\n writablePaths: runtimeIsolationFields.writablePaths.default([]),\n pidsLimit: runtimeIsolationFields.pidsLimit.default(RUNTIME_DEFAULT_PIDS_LIMIT),\n});\n\n/**\n * The AUTHORED form: every knob optional and — critically — carrying NO default.\n *\n * This is not the same thing as `RuntimeIsolationSchema.partial()`, and the\n * difference is a real defect rather than a style point. `.partial()` only makes\n * a field optional; the inner `.default(10001)` still FIRES, so an authored\n * `isolation: { runAsUser: 101 }` parses to a `runAsGroup` of 10001 and the\n * caller can no longer tell \"authored 10001\" from \"authored nothing\". For a\n * service row that difference decides which account the container runs as, and\n * the wrong answer is a pod that never starts.\n *\n * Caught by the pin `honours an authored image-dependent uid…` in\n * `service-definitions.schemas.test.ts`, which was written expecting the kind\n * default and got 10001.\n */\nexport const AuthoredRuntimeIsolationSchema = z.strictObject({\n runAsUser: runtimeIsolationFields.runAsUser.optional(),\n runAsGroup: runtimeIsolationFields.runAsGroup.optional(),\n writablePaths: runtimeIsolationFields.writablePaths.optional(),\n pidsLimit: runtimeIsolationFields.pidsLimit.optional(),\n});\nexport type AuthoredRuntimeIsolation = z.infer<typeof AuthoredRuntimeIsolationSchema>;\nexport type RuntimeIsolation = z.infer<typeof RuntimeIsolationSchema>;\n\n/**\n * Shared `superRefine` body for an authored isolation block.\n *\n * `RUNTIME_MANDATORY_WRITABLE_PATH` is mounted by the renderers, so authoring it\n * again emits two volumeMounts on one mountPath — which Kubernetes rejects at\n * admission, meaning the pod never starts and the error names a duplicate mount\n * rather than the config line that caused it. Caught here, where the message can\n * point at the authored value.\n */\nexport function refineRuntimeIsolation(\n isolation: RuntimeIsolation,\n ctx: z.RefinementCtx,\n path: readonly (string | number)[] = ['isolation'],\n): void {\n const mandatory = isolation.writablePaths.filter(\n (p) => p === RUNTIME_MANDATORY_WRITABLE_PATH || p === `${RUNTIME_MANDATORY_WRITABLE_PATH}/`,\n );\n if (mandatory.length > 0) {\n ctx.addIssue({\n code: 'custom',\n path: [...path, 'writablePaths'],\n message:\n `'${RUNTIME_MANDATORY_WRITABLE_PATH}' is always mounted — remove it from writablePaths, which is `\n + 'for ADDITIONAL scratch mounts only. Authoring it twice emits two volumeMounts on one '\n + 'mountPath and Kubernetes refuses the pod.',\n });\n }\n\n const seen = new Set<string>();\n for (const p of isolation.writablePaths) {\n if (seen.has(p)) {\n ctx.addIssue({\n code: 'custom',\n path: [...path, 'writablePaths'],\n message: `Duplicate writable path '${p}' — same duplicate-mountPath rejection as above.`,\n });\n }\n seen.add(p);\n }\n}\n\n/**\n * The uid/gid an application BACKEND container runs as when nothing is authored.\n *\n * 1001 is not arbitrary and not new: `templates/infra/docker-images/platform/\n * Dockerfile.platform-base` has created `wildo` at 1001 and ended on `USER wildo`\n * since the platform images were written. Reusing it makes the app backend match\n * the convention the framework already ships rather than inventing a third number\n * beside the minion/worker 10001.\n *\n * The paired obligation lives in `Dockerfile.backend-base`: an image whose files\n * are owned by root and whose `USER` is root will be REFUSED by the kubelet under\n * `runAsNonRoot: true`. Schema default and image must move together.\n */\nexport const APP_BACKEND_DEFAULT_RUNTIME_UID = 1001;\n\n/**\n * The uid/gid an application FRONTEND container runs as when nothing is authored.\n *\n * 101 is the `nginx` account in `nginx:1.27-alpine` (verified by running the\n * image, not assumed). Every Wildo frontend is a static bundle served by nginx —\n * the framework mandates that runtime — so defaulting to any other uid would make\n * \"authored nothing\" the broken case, which is exactly the case that must come\n * out working.\n */\nexport const APP_FRONTEND_DEFAULT_RUNTIME_UID = 101;\n\n/**\n * ## Why the frontend container port is NOT changed, measured rather than assumed\n *\n * The obvious reasoning — \"the floor drops ALL capabilities, so a non-root nginx\n * cannot bind :80 without `CAP_NET_BIND_SERVICE`\" — is FALSE in a container, and\n * an earlier revision of this file asserted it in JSDoc before anyone ran it.\n *\n * Docker and containerd both set `net.ipv4.ip_unprivileged_port_start=0` inside\n * the container's network namespace, so ports below 1024 are not privileged there\n * at all. Measured against `nginx:1.27-alpine`: `cat\n * /proc/sys/net/ipv4/ip_unprivileged_port_start` prints `0`, and nginx running as\n * uid 101 with a read-only rootfs and no capabilities serves HTTP 200 on :80.\n *\n * So the frontends keep `listen 80` and the Service keeps `targetPort: 80`. No\n * nginx config, Dockerfile `EXPOSE`, Service or Traefik router changes are part\n * of this floor. What nginx DOES need is\n * {@link APP_FRONTEND_MANDATORY_WRITABLE_PATHS} — see there.\n */\n\n/**\n * Writable mounts an nginx frontend needs BEYOND\n * {@link RUNTIME_MANDATORY_WRITABLE_PATH}, emitted unconditionally rather than\n * authored.\n *\n * They are not additive author choices — they are what the runtime the framework\n * MANDATES cannot start without, measured against `nginx:1.27-alpine`:\n *\n * - `/var/cache/nginx` — the parent of `client_temp`/`proxy_temp`/… . Present in\n * the image but owned by `root:root` 0755, so a non-root master cannot create\n * the temp directories inside it.\n * - `/run` — where the stock `nginx.conf` writes `nginx.pid` (`/var/run` is a\n * symlink to it). Root-owned, so the pid write fails and nginx exits.\n *\n * Mounting them as writable volumes is preferred over `chown`-ing in every\n * application's Dockerfile: it keeps the requirement in the framework's runtime\n * spec, where it is emitted once and cannot be forgotten per app.\n */\nexport const APP_FRONTEND_MANDATORY_WRITABLE_PATHS: readonly string[] = ['/var/cache/nginx', '/run'];\n\n/**\n * Resolve a service row's effective container isolation.\n *\n * THE reason this exists as a function rather than a schema default: the correct\n * default depends on the container KIND, and a Zod field default cannot see its\n * sibling `frontendType`. Two renderers consume this (k8s manifests and the\n * compose app lane) and they must not each apply their own fallback — that is how\n * a k8s pod and a compose container end up running as different users from one\n * config row.\n *\n * Frontend rows additionally receive {@link APP_FRONTEND_MANDATORY_WRITABLE_PATHS}\n * prepended, because nginx cannot start without them. They are prepended rather\n * than appended so an author reading the rendered manifest sees the framework's\n * mounts first, and deduplicated against the authored list so re-authoring one is\n * tolerated here (unlike `/tmp`, these are nginx implementation detail rather\n * than a documented contract, so a duplicate is a mistake worth absorbing instead\n * of a config error worth failing on).\n */\nexport function resolveAppServiceIsolation(\n service: Pick<AppServiceDefinition, 'frontendType'> & { isolation?: Partial<RuntimeIsolation> },\n): RuntimeIsolation {\n const isFrontend = service.frontendType !== undefined;\n const defaultUid = isFrontend ? APP_FRONTEND_DEFAULT_RUNTIME_UID : APP_BACKEND_DEFAULT_RUNTIME_UID;\n const authoredPaths = service.isolation?.writablePaths ?? [];\n const mandatory = isFrontend ? APP_FRONTEND_MANDATORY_WRITABLE_PATHS : [];\n\n return {\n runAsUser: service.isolation?.runAsUser ?? defaultUid,\n runAsGroup: service.isolation?.runAsGroup ?? defaultUid,\n writablePaths: [...mandatory, ...authoredPaths.filter((p) => !mandatory.includes(p))],\n pidsLimit: service.isolation?.pidsLimit ?? RUNTIME_DEFAULT_PIDS_LIMIT,\n };\n}\n\n/**\n * One service inside `wildo.saas.config.ts` `services` map.\n *\n * `sessionStorage` (default `'ephemeral'`) is the per-service explicit\n * opt-in to localStorage; the default matches the non-primary-surface\n * common case. See `APP_SESSION_STORAGES` JSDoc for the rationale.\n *\n * `csp?` lives here only for `frontendType: SAAS_APP`. Unlike\n * `STATIC_WEBSITE` / `TECH_DOC`, the main app currently has no\n * engine-owned per-service config file (`wildo.website.config.ts` /\n * `wildo.tech-doc.config.ts`) — the service row itself is therefore the\n * honest app-static authoring seam for SPA-specific posture such as CSP.\n * Non-app services MUST reject authored `csp` here to preserve the\n * semantic split between the generic service declaration and the\n * website/docs engine-owned config files.\n *\n * No host-binding or public-URL authoring on this schema. The public\n * hostname per service is authored per-environment in\n * `infra.serviceHosts` — that seam is in `define-infra-env-config.ts`\n * and is intentionally decoupled from `frontendType` and from the\n * service key so the app developer can map any service to any host\n * (e.g. `services.docs` published at `dev.example.com`).\n */\nexport const AppServiceDefinitionSchema = z.strictObject({\n path: z.string().min(1),\n serviceName: z.string().min(1),\n defaultPort: z.number().int().positive().optional(),\n frontendType: z.enum(AppFrontendType).optional(),\n sessionStorage: z.enum(APP_SESSION_STORAGES).default('ephemeral'),\n csp: WildoCspConfigSchema.optional(),\n /**\n * Container isolation — the same contract minions and workers carry, applied to\n * the two container kinds that had none: the app backend and each frontend.\n *\n * `.optional()` here, unlike the minion/worker `.prefault({})`, because the\n * correct DEFAULT depends on the kind and the kind is not known until the row\n * is read: a backend runs Node as {@link APP_BACKEND_DEFAULT_RUNTIME_UID}, a\n * frontend runs nginx as {@link APP_FRONTEND_DEFAULT_RUNTIME_UID}. Emitting one\n * number for both would hand half the services a uid their image does not\n * define. Callers resolve it through {@link resolveAppServiceIsolation}, which\n * is where \"authored nothing\" becomes a hardened value — never at a renderer,\n * so the two renderers cannot disagree.\n *\n * The floor is absent for the same reason it is absent from the minion and\n * worker schemas: it is emitted unconditionally and must not be authorable\n * down. See {@link RuntimeIsolationSchema}.\n */\n isolation: AuthoredRuntimeIsolationSchema.optional(),\n}).superRefine((service, ctx) => {\n if (service.isolation) {\n refineRuntimeIsolation(resolveAppServiceIsolation(service), ctx);\n }\n if (service.csp !== undefined && service.frontendType !== AppFrontendType.SAAS_APP) {\n ctx.addIssue({\n code: 'custom',\n path: ['csp'],\n message:\n 'services.<key>.csp is only supported for `frontendType: SAAS_APP`. '\n + 'STATIC_WEBSITE and TECH_DOC services must author CSP in their per-service '\n + '`wildo.website.config.ts` / `wildo.tech-doc.config.ts` files, and '\n + 'non-frontend services cannot ship a document CSP.',\n });\n }\n});\nexport type AppServiceDefinition = z.infer<typeof AppServiceDefinitionSchema>;\nexport type AppServiceDefinitionInput = z.input<typeof AppServiceDefinitionSchema>;\n\nexport const AppLibraryDefinitionSchema = z.object({\n path: z.string().min(1),\n type: z.enum(AppLibraryType),\n}).strict();\nexport type AppLibraryDefinition = z.infer<typeof AppLibraryDefinitionSchema>;\n\nexport const WorkerRuntimeSchema = z.object({\n type: z.string().min(1),\n language: z.string().min(1),\n});\nexport type WorkerRuntime = z.infer<typeof WorkerRuntimeSchema>;\n\nexport const ResourceLimitsSchema = z.object({\n cpu: z.string().min(1).optional(),\n memory: z.string().min(1).optional(),\n});\nexport type ResourceLimits = z.infer<typeof ResourceLimitsSchema>;\n\nexport const DataAccessSchema = z.object({\n database: z.enum(['read-only', 'read-write', 'none']).optional(),\n cache: z.boolean().optional(),\n queue: z.enum(['consumer', 'producer', 'both', 'none']).optional(),\n});\nexport type DataAccess = z.infer<typeof DataAccessSchema>;\n\n/**\n * Minimal \"I live at this path\" reference for a per-folder app sub-config\n * (`wildo.minion.config.ts`, `wildo.worker.config.ts`, `wildo.specifications.config.ts`).\n *\n * Tightened to `z.strictObject` (M-3 in\n * `.cursor/plans/minions-and-workers-implementation.md`) so authoring an\n * unknown key — e.g. a typo `pat:` instead of `path:`, or a stray\n * `resourceAccess` on a `workers` entry where it has no meaning today —\n * fails fast at parse time rather than being silently dropped. The\n * minions bucket value schema in `define-saas-config.ts` extends this\n * shape (still strict) to add `resourceAccess` per KD-11.\n */\nexport const AppRefSchema = z.strictObject({\n path: z.string().min(1),\n});\nexport type AppRef = z.infer<typeof AppRefSchema>;\n"]}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Artifact-domain access schemas — public vs restricted retrieval.
3
+ *
4
+ * Phase 1 surfaces the access vocabulary so Phase 3 (registry
5
+ * server) and Phase 5 (CLI install) speak the same dialect. The
6
+ * library does NOT implement authorization here — that's
7
+ * gateway-side middleware (KD-7 / Security model). These schemas
8
+ * pin the contract.
9
+ */
10
+ import { z } from 'zod';
11
+ declare const REGISTRY_ARTIFACT_VISIBILITY_VALUES: readonly ["PUBLIC", "RESTRICTED"];
12
+ export declare const RegistryArtifactVisibility: {
13
+ /** Anonymous read allowed; integrity always verified. */
14
+ readonly PUBLIC: "PUBLIC";
15
+ /** Requires a domain `read` API key. */
16
+ readonly RESTRICTED: "RESTRICTED";
17
+ };
18
+ export declare const RegistryArtifactVisibilitySchema: z.ZodEnum<{
19
+ PUBLIC: "PUBLIC";
20
+ RESTRICTED: "RESTRICTED";
21
+ }>;
22
+ export type RegistryArtifactVisibility = (typeof REGISTRY_ARTIFACT_VISIBILITY_VALUES)[number];
23
+ declare const REGISTRY_API_KEY_SCOPE_VALUES: readonly ["read", "publish", "admin"];
24
+ export declare const RegistryApiKeyScope: {
25
+ readonly READ: "read";
26
+ readonly PUBLISH: "publish";
27
+ readonly ADMIN: "admin";
28
+ };
29
+ export declare const RegistryApiKeyScopeSchema: z.ZodEnum<{
30
+ read: "read";
31
+ publish: "publish";
32
+ admin: "admin";
33
+ }>;
34
+ export type RegistryApiKeyScope = (typeof REGISTRY_API_KEY_SCOPE_VALUES)[number];
35
+ /**
36
+ * Per-domain access policy. Held alongside `RegistryDomain` rows on
37
+ * the server; the CLI receives a redacted projection via
38
+ * `wildo registry info`.
39
+ */
40
+ export declare const RegistryDomainAccessPolicySchema: z.ZodObject<{
41
+ /** Default visibility for newly-published modules in this domain. */
42
+ defaultVisibility: z.ZodEnum<{
43
+ PUBLIC: "PUBLIC";
44
+ RESTRICTED: "RESTRICTED";
45
+ }>;
46
+ /**
47
+ * Email of the first-admin / domain owner. Recovery anchor per
48
+ * KD-11 / Security model.
49
+ */
50
+ ownerEmail: z.ZodEmail;
51
+ }, z.core.$strict>;
52
+ export type RegistryDomainAccessPolicy = z.infer<typeof RegistryDomainAccessPolicySchema>;
53
+ export {};
54
+ //# sourceMappingURL=artifact-domain.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-domain.schemas.d.ts","sourceRoot":"","sources":["../../../../src/registry/artifact-domain.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,mCAAmC,mCAAoC,CAAC;AAE9E,eAAO,MAAM,0BAA0B;IACrC,yDAAyD;;IAEzD,wCAAwC;;CAEhC,CAAC;AACX,eAAO,MAAM,gCAAgC;;;EAA8C,CAAC;AAC5F,MAAM,MAAM,0BAA0B,GACpC,CAAC,OAAO,mCAAmC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,QAAA,MAAM,6BAA6B,uCAAwC,CAAC;AAE5E,eAAO,MAAM,mBAAmB;;;;CAItB,CAAC;AACX,eAAO,MAAM,yBAAyB;;;;EAAwC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;IAC3C,qEAAqE;;;;;IAErE;;;OAGG;;kBAEH,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Artifact-domain access schemas — public vs restricted retrieval.
3
+ *
4
+ * Phase 1 surfaces the access vocabulary so Phase 3 (registry
5
+ * server) and Phase 5 (CLI install) speak the same dialect. The
6
+ * library does NOT implement authorization here — that's
7
+ * gateway-side middleware (KD-7 / Security model). These schemas
8
+ * pin the contract.
9
+ */
10
+ import { z } from 'zod';
11
+ const REGISTRY_ARTIFACT_VISIBILITY_VALUES = ['PUBLIC', 'RESTRICTED'];
12
+ export const RegistryArtifactVisibility = {
13
+ /** Anonymous read allowed; integrity always verified. */
14
+ PUBLIC: 'PUBLIC',
15
+ /** Requires a domain `read` API key. */
16
+ RESTRICTED: 'RESTRICTED',
17
+ };
18
+ export const RegistryArtifactVisibilitySchema = z.enum(REGISTRY_ARTIFACT_VISIBILITY_VALUES);
19
+ const REGISTRY_API_KEY_SCOPE_VALUES = ['read', 'publish', 'admin'];
20
+ export const RegistryApiKeyScope = {
21
+ READ: 'read',
22
+ PUBLISH: 'publish',
23
+ ADMIN: 'admin',
24
+ };
25
+ export const RegistryApiKeyScopeSchema = z.enum(REGISTRY_API_KEY_SCOPE_VALUES);
26
+ /**
27
+ * Per-domain access policy. Held alongside `RegistryDomain` rows on
28
+ * the server; the CLI receives a redacted projection via
29
+ * `wildo registry info`.
30
+ */
31
+ export const RegistryDomainAccessPolicySchema = z.strictObject({
32
+ /** Default visibility for newly-published modules in this domain. */
33
+ defaultVisibility: RegistryArtifactVisibilitySchema,
34
+ /**
35
+ * Email of the first-admin / domain owner. Recovery anchor per
36
+ * KD-11 / Security model.
37
+ */
38
+ ownerEmail: z.email(),
39
+ });
40
+ //# sourceMappingURL=artifact-domain.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact-domain.schemas.js","sourceRoot":"","sources":["../../../../src/registry/artifact-domain.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mCAAmC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAU,CAAC;AAE9E,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,yDAAyD;IACzD,MAAM,EAAE,QAAQ;IAChB,wCAAwC;IACxC,UAAU,EAAE,YAAY;CAChB,CAAC;AACX,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;AAI5F,MAAM,6BAA6B,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAE5E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACN,CAAC;AACX,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAG/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7D,qEAAqE;IACrE,iBAAiB,EAAE,gCAAgC;IACnD;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE;CACtB,CAAC,CAAC","sourcesContent":["/**\n * Artifact-domain access schemas — public vs restricted retrieval.\n *\n * Phase 1 surfaces the access vocabulary so Phase 3 (registry\n * server) and Phase 5 (CLI install) speak the same dialect. The\n * library does NOT implement authorization here — that's\n * gateway-side middleware (KD-7 / Security model). These schemas\n * pin the contract.\n */\n\nimport { z } from 'zod';\n\nconst REGISTRY_ARTIFACT_VISIBILITY_VALUES = ['PUBLIC', 'RESTRICTED'] as const;\n\nexport const RegistryArtifactVisibility = {\n /** Anonymous read allowed; integrity always verified. */\n PUBLIC: 'PUBLIC',\n /** Requires a domain `read` API key. */\n RESTRICTED: 'RESTRICTED',\n} as const;\nexport const RegistryArtifactVisibilitySchema = z.enum(REGISTRY_ARTIFACT_VISIBILITY_VALUES);\nexport type RegistryArtifactVisibility =\n (typeof REGISTRY_ARTIFACT_VISIBILITY_VALUES)[number];\n\nconst REGISTRY_API_KEY_SCOPE_VALUES = ['read', 'publish', 'admin'] as const;\n\nexport const RegistryApiKeyScope = {\n READ: 'read',\n PUBLISH: 'publish',\n ADMIN: 'admin',\n} as const;\nexport const RegistryApiKeyScopeSchema = z.enum(REGISTRY_API_KEY_SCOPE_VALUES);\nexport type RegistryApiKeyScope = (typeof REGISTRY_API_KEY_SCOPE_VALUES)[number];\n\n/**\n * Per-domain access policy. Held alongside `RegistryDomain` rows on\n * the server; the CLI receives a redacted projection via\n * `wildo registry info`.\n */\nexport const RegistryDomainAccessPolicySchema = z.strictObject({\n /** Default visibility for newly-published modules in this domain. */\n defaultVisibility: RegistryArtifactVisibilitySchema,\n /**\n * Email of the first-admin / domain owner. Recovery anchor per\n * KD-11 / Security model.\n */\n ownerEmail: z.email(),\n});\nexport type RegistryDomainAccessPolicy = z.infer<typeof RegistryDomainAccessPolicySchema>;\n"]}