@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
@@ -16,7 +16,7 @@ import { WorkerRuntimeSchema, ResourceLimitsSchema, RuntimeIsolationSchema, RUNT
16
16
  *
17
17
  * `gracePeriodSec` is optional and only meaningful for
18
18
  * `'kill_previous'` (forwarded to the K8s `terminationGracePeriodSeconds`
19
- * Phase 3 manifest emitter — Q7 LOCKED). Authoring it on `'let_run'`
19
+ * manifest emitter). Authoring it on `'let_run'`
20
20
  * is harmless today but silently ignored.
21
21
  */
22
22
  export const MinionReinstantiationSchema = z.strictObject({
@@ -24,17 +24,20 @@ export const MinionReinstantiationSchema = z.strictObject({
24
24
  gracePeriodSec: z.number().int().nonnegative().optional(),
25
25
  });
26
26
  /**
27
- * Per-minion liveness contract — G-18 + NR-3 in
28
- * `.cursor/plans/minions-and-workers-implementation.md`.
27
+ * Per-minion liveness contract.
29
28
  *
30
- * Minions have NO inbound HTTP surface (KD-1 / Q5 LOCKED), so the K8s
29
+ * Minions have NO inbound HTTP surface, so the K8s
31
30
  * liveness probe cannot use the `httpGet` shape that workers use. The
32
31
  * supported probes are:
33
32
  *
34
- * - `kind: 'file'` (default) — the minion's actor loop touches
35
- * `filePath` every `heartbeat.intervalSec` seconds. The K8s probe
36
- * is an `exec` probe that runs `find <filePath> -mmin -<staleAfterSec/60>`
37
- * and fails when the file is older than `staleAfterSec`.
33
+ * - `kind: 'file'` (default) — the minion runtime writes a heartbeat to
34
+ * `filePath` every `heartbeat.intervalSec` seconds while its tick consumer
35
+ * is subscribed and its broker connection is up (`MinionLivenessHeartbeat`
36
+ * in `@wildo-ai/saas-minions-lib`). The K8s probe is an `exec` probe that
37
+ * fails once the heartbeat is `staleAfterSec` old. The probe command, its
38
+ * cadence and the env that turns the heartbeat on are all derived from this
39
+ * parsed value in `minion-liveness.contracts.ts`, so the writer and the
40
+ * probe cannot drift (#1859, where the probe existed and the writer did not).
38
41
  *
39
42
  * - `kind: 'exec'` — the minion provides its own probe command (e.g.
40
43
  * `['curl', '-fsS', 'http://localhost:9090/internal/healthz']` for
@@ -45,8 +48,8 @@ export const MinionReinstantiationSchema = z.strictObject({
45
48
  * `superRefine` enforces this — a stale-window equal to or shorter
46
49
  * than the heartbeat would guarantee K8s flaps the pod even when
47
50
  * the minion is healthy). The 90s / 30s defaults give a 3× safety
48
- * margin which the cron-cadence vs liveness-cadence interaction
49
- * documented in NR-3 needs to keep the deploy story sane.
51
+ * margin, which the interaction between cron cadence and liveness
52
+ * cadence needs to keep the deploy story sane.
50
53
  */
51
54
  export const MinionLivenessSchema = z.strictObject({
52
55
  kind: z.enum(['file', 'exec']).default('file'),
@@ -86,7 +89,7 @@ export const MinionLivenessSchema = z.strictObject({
86
89
  * ## ⚠️ The one MINION-SPECIFIC consequence, and it is load-bearing
87
90
  *
88
91
  * {@link MinionLivenessSchema} defaults to a FILE probe at
89
- * `/tmp/wildo-minion-alive`, touched by the actor loop every
92
+ * `/tmp/wildo-minion-alive`, written by the minion runtime every
90
93
  * `heartbeat.intervalSec`. So `readOnlyRootFilesystem: true` with no writable
91
94
  * `/tmp` makes the heartbeat unwritable and Kubernetes restart-loops **every
92
95
  * healthy minion** — the probe fails for a reason unrelated to the workload's
@@ -115,22 +118,58 @@ export const MinionIsolationSchema = RuntimeIsolationSchema;
115
118
  * Matches `MinionLivenessSchema.filePath`'s default directory.
116
119
  */
117
120
  export const MINION_MANDATORY_WRITABLE_PATH = RUNTIME_MANDATORY_WRITABLE_PATH;
121
+ /**
122
+ * A file heartbeat must live inside a mount the container can write: the rootfs is read-only, and only
123
+ * {@link MINION_MANDATORY_WRITABLE_PATH} plus the authored `isolation.writablePaths` are mounted. A heartbeat
124
+ * anywhere else is a write the minion can never make, so every healthy pod would restart-loop on its probe
125
+ * (#1859). Refused at parse time, where the remedy (move the file, or mount its directory) is one line away.
126
+ *
127
+ * String operations rather than `node:path`, so this contract stays free of a Node built-in.
128
+ */
129
+ function refineLivenessFileIsWritable(cfg, ctx) {
130
+ if (cfg.liveness.kind !== 'file')
131
+ return;
132
+ const filePath = cfg.liveness.filePath;
133
+ const roots = [MINION_MANDATORY_WRITABLE_PATH, ...cfg.isolation.writablePaths].map((root) => root.replace(/\/+$/, ''));
134
+ // `$` is refused because the kubelet expands `$(NAME)` in BOTH the env value the writer reads and the exec
135
+ // command the probe runs, with the container's own env; a path that could expand is a path the two might not
136
+ // agree on. A trailing `/` names a directory, not a file the writer can create.
137
+ if (filePath.includes('$') || filePath.endsWith('/')) {
138
+ ctx.addIssue({
139
+ code: 'custom',
140
+ path: ['liveness', 'filePath'],
141
+ message: `liveness.filePath '${filePath}' must be a plain file path: no '$' (the kubelet would expand it) and no trailing '/'.`,
142
+ });
143
+ return;
144
+ }
145
+ const insideAWritableMount = filePath.startsWith('/')
146
+ && !filePath.split('/').includes('..')
147
+ && roots.some((root) => filePath.startsWith(`${root}/`) && filePath.length > root.length + 1);
148
+ if (!insideAWritableMount) {
149
+ ctx.addIssue({
150
+ code: 'custom',
151
+ path: ['liveness', 'filePath'],
152
+ message: `liveness.filePath '${filePath}' is not inside a writable mount (${roots.join(', ')}). The container `
153
+ + 'rootfs is read-only, so the heartbeat could never be written and the probe would restart every healthy '
154
+ + "pod. Put the file under '/tmp', or add its directory to isolation.writablePaths.",
155
+ });
156
+ }
157
+ }
118
158
  /**
119
159
  * Per-folder minion configuration (`wildo.minion.config.ts`).
120
160
  *
121
- * Phase 1 schema honesty (KD-1, KD-3, KD-7, KD-8 + G-18 in
122
- * `.cursor/plans/minions-and-workers-implementation.md`):
161
+ * Schema honesty:
123
162
  *
124
- * - `mode` (`'always-up' | 'cron'`) — KD-3. Determines the K8s
125
- * deployment shape Phase 3 will emit. `schedule` is required iff
163
+ * - `mode` (`'always-up' | 'cron'`). Determines the K8s
164
+ * deployment shape the manifest emitter produces. `schedule` is required iff
126
165
  * `mode === 'cron'` (enforced by the top-level `superRefine`).
127
166
  *
128
- * - `reinstantiation` — KD-7. Only meaningful for `'always-up'`
167
+ * - `reinstantiation`. Only meaningful for `'always-up'`
129
168
  * today (cron minions are short-lived); the schema accepts the
130
169
  * field on cron minions but it stays inert at runtime so the
131
170
  * surface stays uniform.
132
171
  *
133
- * - `replicas` is pinned to `1` per KD-8 — minions are SINGLETONS
172
+ * - `replicas` is pinned to `1` — minions are SINGLETONS
134
173
  * in v1 (no horizontal scaling). The literal-`1` constraint is
135
174
  * enforced at parse time so a future "let me run two of these"
136
175
  * request must come through a deliberate schema bump, not a silent
@@ -138,14 +177,14 @@ export const MINION_MANDATORY_WRITABLE_PATH = RUNTIME_MANDATORY_WRITABLE_PATH;
138
177
  * omitted) so the K8s manifest emitter has a single source of
139
178
  * truth — symmetric with the worker schema's `replicas` field.
140
179
  *
141
- * - `liveness` — G-18 + NR-3. Defaults to file-heartbeat 30s /
142
- * stale-after 90s, which the cron-cadence vs liveness-cadence
143
- * note in NR-3 picked as the safe baseline.
180
+ * - `liveness`. Defaults to file-heartbeat 30s /
181
+ * stale-after 90s, the safe baseline given the interaction between
182
+ * cron cadence and liveness cadence.
144
183
  *
145
184
  * - The legacy `dataAccess` block is REMOVED — minion access to
146
185
  * repositories is governed by the bucket-level `resourceAccess`
147
- * whitelist authored on the minion entry in `wildo.saas.config.ts`
148
- * (KD-11). Keeping a redundant per-minion-config field would
186
+ * whitelist authored on the minion entry in `wildo.saas.config.ts`.
187
+ * Keeping a redundant per-minion-config field would
149
188
  * create a second source of truth and an obvious "which one wins?"
150
189
  * bug surface.
151
190
  *
@@ -219,6 +258,7 @@ export const WildoMinionConfigSchema = z.strictObject({
219
258
  });
220
259
  }
221
260
  refineRuntimeIsolation(cfg.isolation, ctx);
261
+ refineLivenessFileIsWritable(cfg, ctx);
222
262
  if (cfg.mode === 'always-up' && cfg.schedule) {
223
263
  ctx.addIssue({
224
264
  code: 'custom',
@@ -230,9 +270,8 @@ export const WildoMinionConfigSchema = z.strictObject({
230
270
  /**
231
271
  * Define a minion (long-running actor host or scheduled tick) configuration.
232
272
  *
233
- * Minions have NO inbound HTTP surface (KD-1) and are SINGLETONS
234
- * (`replicas: 1`, KD-8). The full v1 architectural rationale is in
235
- * `.cursor/plans/minions-and-workers-implementation.md`.
273
+ * Minions have NO inbound HTTP surface and are SINGLETONS
274
+ * (`replicas: 1`).
236
275
  */
237
276
  export function defineMinionConfig(config) {
238
277
  return WildoMinionConfigSchema.parse(config);
@@ -1 +1 @@
1
- {"version":3,"file":"define-minion-config.js","sourceRoot":"","sources":["../../../../src/project-config/define-minion-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,+BAA+B,EAC/B,sBAAsB,GAEvB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACrE,cA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AClB,OAAO,EACL,uGAAuG;SAC1G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAIH;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,OAAO,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n WorkerRuntimeSchema,\n ResourceLimitsSchema,\n RuntimeIsolationSchema,\n RUNTIME_MANDATORY_WRITABLE_PATH,\n refineRuntimeIsolation,\n type RuntimeIsolation,\n} from './shared/service-definitions.schemas';\n\n/**\n * Reinstantiation policy when an `'always-up'` minion is restarted\n * (deploy, config reload, manual `kubectl rollout restart`).\n *\n * - `'kill_previous'` (default) — the apps-manager terminates the\n * running pod before the new one starts. Matches K8s `Recreate`\n * strategy. Correct default for stateful actor-flow minions where\n * two concurrent instances would corrupt invariants.\n * - `'let_run'` — both pods run side-by-side until the previous one\n * exits naturally. Matches K8s `RollingUpdate` strategy with\n * `maxSurge: 1, maxUnavailable: 0`. Authored explicitly when the\n * minion can tolerate momentary duplication (e.g. an idempotent\n * scraper).\n *\n * `gracePeriodSec` is optional and only meaningful for\n * `'kill_previous'` (forwarded to the K8s `terminationGracePeriodSeconds`\n * Phase 3 manifest emitter — Q7 LOCKED). Authoring it on `'let_run'`\n * is harmless today but silently ignored.\n */\nexport const MinionReinstantiationSchema = z.strictObject({\n policy: z.enum(['kill_previous', 'let_run']).default('kill_previous'),\n gracePeriodSec: z.number().int().nonnegative().optional(),\n});\nexport type MinionReinstantiation = z.infer<typeof MinionReinstantiationSchema>;\n\n/**\n * Per-minion liveness contract — G-18 + NR-3 in\n * `.cursor/plans/minions-and-workers-implementation.md`.\n *\n * Minions have NO inbound HTTP surface (KD-1 / Q5 LOCKED), so the K8s\n * liveness probe cannot use the `httpGet` shape that workers use. The\n * supported probes are:\n *\n * - `kind: 'file'` (default) — the minion's actor loop touches\n * `filePath` every `heartbeat.intervalSec` seconds. The K8s probe\n * is an `exec` probe that runs `find <filePath> -mmin -<staleAfterSec/60>`\n * and fails when the file is older than `staleAfterSec`.\n *\n * - `kind: 'exec'` — the minion provides its own probe command (e.g.\n * `['curl', '-fsS', 'http://localhost:9090/internal/healthz']` for\n * a minion that exposes a loopback-only debug surface). The\n * contract is \"exit 0 = healthy, anything else = restart\".\n *\n * `staleAfterSec` MUST be > `heartbeat.intervalSec` (the schema's\n * `superRefine` enforces this — a stale-window equal to or shorter\n * than the heartbeat would guarantee K8s flaps the pod even when\n * the minion is healthy). The 90s / 30s defaults give a 3× safety\n * margin which the cron-cadence vs liveness-cadence interaction\n * documented in NR-3 needs to keep the deploy story sane.\n */\nexport const MinionLivenessSchema = z.strictObject({\n kind: z.enum(['file', 'exec']).default('file'),\n filePath: z.string().min(1).default('/tmp/wildo-minion-alive'),\n execCommand: z.array(z.string().min(1)).min(1).optional(),\n heartbeat: z\n .strictObject({\n intervalSec: z.number().int().positive().default(30),\n })\n .prefault({}),\n staleAfterSec: z.number().int().positive().default(90),\n}).superRefine((val, ctx) => {\n if (val.kind === 'exec' && (!val.execCommand || val.execCommand.length === 0)) {\n ctx.addIssue({\n code: 'custom',\n path: ['execCommand'],\n message: \"liveness.execCommand is required (and non-empty) when liveness.kind === 'exec'.\",\n });\n }\n if (val.staleAfterSec <= val.heartbeat.intervalSec) {\n ctx.addIssue({\n code: 'custom',\n path: ['staleAfterSec'],\n message:\n `liveness.staleAfterSec (${val.staleAfterSec}s) must be strictly greater than ` +\n `liveness.heartbeat.intervalSec (${val.heartbeat.intervalSec}s) — otherwise the K8s ` +\n 'liveness probe will flap the pod even when the minion is healthy. ' +\n 'Recommended: staleAfterSec ≥ 3× heartbeat.intervalSec.',\n });\n }\n});\nexport type MinionLiveness = z.infer<typeof MinionLivenessSchema>;\n\n/**\n * Per-minion container isolation. An ALIAS of the shared\n * {@link RuntimeIsolationSchema} — minions and workers have identical isolation\n * contracts, and the floor/authorable split is documented there. Kept as a named\n * export so minion-facing code and its pins read in minion terms.\n *\n * ## ⚠️ The one MINION-SPECIFIC consequence, and it is load-bearing\n *\n * {@link MinionLivenessSchema} defaults to a FILE probe at\n * `/tmp/wildo-minion-alive`, touched by the actor loop every\n * `heartbeat.intervalSec`. So `readOnlyRootFilesystem: true` with no writable\n * `/tmp` makes the heartbeat unwritable and Kubernetes restart-loops **every\n * healthy minion** — the probe fails for a reason unrelated to the workload's\n * health. The renderers always emit the `/tmp` mount alongside the read-only\n * flag; the two must never be separated.\n *\n * Workers probe over HTTP and so do not share this acute coupling, which is why\n * the reasoning lives here rather than in the shared schema.\n *\n * @example\n * ```ts\n * // Most minions author nothing — the secure defaults apply.\n * isolation: undefined\n *\n * // A minion whose image runs as uid 1000 and needs a scratch directory:\n * isolation: { runAsUser: 1000, runAsGroup: 1000, writablePaths: ['/var/cache/scraper'] }\n * ```\n */\nexport const MinionIsolationSchema = RuntimeIsolationSchema;\nexport type MinionIsolation = RuntimeIsolation;\n\n/**\n * The mandatory writable mount, kept as a named constant rather than a literal\n * repeated across the k8s and compose renderers — two copies of a path this\n * load-bearing WILL drift, and the failure mode (restart-looping healthy\n * minions) is far from the edit that caused it.\n *\n * Matches `MinionLivenessSchema.filePath`'s default directory.\n */\nexport const MINION_MANDATORY_WRITABLE_PATH = RUNTIME_MANDATORY_WRITABLE_PATH;\n\n/**\n * Per-folder minion configuration (`wildo.minion.config.ts`).\n *\n * Phase 1 schema honesty (KD-1, KD-3, KD-7, KD-8 + G-18 in\n * `.cursor/plans/minions-and-workers-implementation.md`):\n *\n * - `mode` (`'always-up' | 'cron'`) — KD-3. Determines the K8s\n * deployment shape Phase 3 will emit. `schedule` is required iff\n * `mode === 'cron'` (enforced by the top-level `superRefine`).\n *\n * - `reinstantiation` — KD-7. Only meaningful for `'always-up'`\n * today (cron minions are short-lived); the schema accepts the\n * field on cron minions but it stays inert at runtime so the\n * surface stays uniform.\n *\n * - `replicas` is pinned to `1` per KD-8 — minions are SINGLETONS\n * in v1 (no horizontal scaling). The literal-`1` constraint is\n * enforced at parse time so a future \"let me run two of these\"\n * request must come through a deliberate schema bump, not a silent\n * config tweak. Authored explicitly in the schema (rather than\n * omitted) so the K8s manifest emitter has a single source of\n * truth — symmetric with the worker schema's `replicas` field.\n *\n * - `liveness` — G-18 + NR-3. Defaults to file-heartbeat 30s /\n * stale-after 90s, which the cron-cadence vs liveness-cadence\n * note in NR-3 picked as the safe baseline.\n *\n * - The legacy `dataAccess` block is REMOVED — minion access to\n * repositories is governed by the bucket-level `resourceAccess`\n * whitelist authored on the minion entry in `wildo.saas.config.ts`\n * (KD-11). Keeping a redundant per-minion-config field would\n * create a second source of truth and an obvious \"which one wins?\"\n * bug surface.\n *\n * - `isolation` — container security posture. Only the image-dependent and\n * ADDITIVE knobs are authorable; the security floor (non-root, read-only\n * rootfs, dropped capabilities, seccomp, no service-account token) is\n * emitted unconditionally and cannot be configured down. See\n * {@link MinionIsolationSchema} for why that split exists.\n *\n * - `localProviders` — providers this minion AUTHORS beside its own code,\n * for the case the application catalog does not carry them (R7).\n *\n * This is NOT a return of the legacy `providers` block, which was removed so\n * that `defineSaaSProviders({ scopes })` would be the single source of truth\n * and per-minion visibility a PROJECTION of it. That property is preserved:\n * a fragment declared here is REGISTERED INTO the application catalog at\n * config load (`registerMinionLocalProviderFragments`), and everything\n * downstream — scope projection, the fail-closed secret filtering, the\n * generated runtime module — reads the catalog and cannot tell a registered\n * fragment from an application-authored entry.\n *\n * One authoring LOCATION per provider; one runtime SOURCE for all of them.\n * The consequence that matters: because a registered fragment IS a catalog\n * entry, its SECRETS arrive through the same single mechanism as every other\n * provider's. Authoring a provider here creates no second secret channel.\n *\n * The schema is `z.strictObject` so a typo (`scedule:` instead of\n * `schedule:`) fails fast — same posture as `WildoSaasConfigSchema`.\n */\nexport const WildoMinionConfigSchema = z.strictObject({\n version: z.number().int().positive().default(1),\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n /**\n * Provider fragments this minion authors locally — registered into the\n * application catalog at config load, never a parallel catalog. See the\n * `localProviders` note in this file's header for why this is not the legacy\n * `providers` block returning.\n *\n * Keyed by provider ref, exactly as the application catalog is, so a collision\n * with an application-declared ref is detectable — and REFUSED — at\n * registration rather than resolved by a precedence rule nobody reads.\n */\n localProviders: z.record(z.string().min(1), z.record(z.string().min(1), z.unknown())).optional(),\n mode: z.enum(['always-up', 'cron']),\n /** Cron expression (required iff `mode === 'cron'`). */\n schedule: z.string().min(1).optional(),\n // `.prefault({})` (NOT `.default({})`) so the empty input flows\n // through the inner schema and the field defaults are applied —\n // Zod v4's `.default(x)` returns `x` as-is without re-parsing.\n // See the matching JSDoc on `define-worker-config.ts > http` for\n // the rationale.\n reinstantiation: MinionReinstantiationSchema.prefault({}),\n replicas: z.literal(1).default(1),\n liveness: MinionLivenessSchema.prefault({}),\n resources: ResourceLimitsSchema.optional(),\n // `.prefault({})` for the same reason as `reinstantiation`/`liveness`: the\n // empty input must flow through the inner schema so the field defaults apply.\n // NOT `.optional()` — an absent `isolation` block must still produce the\n // secure uid/gid/pids defaults, because \"authored nothing\" is the common case\n // and it is exactly the case that must come out hardened.\n isolation: MinionIsolationSchema.prefault({}),\n}).superRefine((cfg, ctx) => {\n if (cfg.mode === 'cron' && !cfg.schedule) {\n ctx.addIssue({\n code: 'custom',\n path: ['schedule'],\n message: \"schedule is required when mode === 'cron' (a cron minion without a schedule is a no-op).\",\n });\n }\n refineRuntimeIsolation(cfg.isolation, ctx);\n\n if (cfg.mode === 'always-up' && cfg.schedule) {\n ctx.addIssue({\n code: 'custom',\n path: ['schedule'],\n message:\n \"schedule must be omitted when mode === 'always-up'; use mode === 'cron' for platform-scheduled ticks.\",\n });\n }\n});\nexport type WildoMinionConfig = z.infer<typeof WildoMinionConfigSchema>;\nexport type WildoMinionConfigInput = z.input<typeof WildoMinionConfigSchema>;\n\n/**\n * Define a minion (long-running actor host or scheduled tick) configuration.\n *\n * Minions have NO inbound HTTP surface (KD-1) and are SINGLETONS\n * (`replicas: 1`, KD-8). The full v1 architectural rationale is in\n * `.cursor/plans/minions-and-workers-implementation.md`.\n */\nexport function defineMinionConfig(config: WildoMinionConfigInput): WildoMinionConfig {\n return WildoMinionConfigSchema.parse(config);\n}\n"]}
1
+ {"version":3,"file":"define-minion-config.js","sourceRoot":"","sources":["../../../src/project-config/define-minion-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,+BAA+B,EAC/B,sBAAsB,GAEvB,MAAM,sCAAsC,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACrE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CAC1D,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAC9D,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzD,SAAS,EAAE,CAAC;SACT,YAAY,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AAQ,CAAC,EAAE,CAAC;IAC3C,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,2EAA2E;IAC3E,8EAA8E;IAC9E,yEAAyE;IACzE,8EAA8E;IAC9E,0DAA0D;IAC1D,SAAS,EAAE,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC;CAC9C,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IAC1B,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACzC,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,0FAA0F;SACpG,CAAC,CAAC;IACL,CAAC;IACD,sBAAsB,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC3C,4BAA4B,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAEvC,IAAI,GAAG,CAAC,IAAI,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7C,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EACL,uGAAuG;SAC1G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAIH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,OAAO,uBAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { z } from 'zod';\nimport {\n WorkerRuntimeSchema,\n ResourceLimitsSchema,\n RuntimeIsolationSchema,\n RUNTIME_MANDATORY_WRITABLE_PATH,\n refineRuntimeIsolation,\n type RuntimeIsolation,\n} from './shared/service-definitions.schemas';\n\n/**\n * Reinstantiation policy when an `'always-up'` minion is restarted\n * (deploy, config reload, manual `kubectl rollout restart`).\n *\n * - `'kill_previous'` (default) — the apps-manager terminates the\n * running pod before the new one starts. Matches K8s `Recreate`\n * strategy. Correct default for stateful actor-flow minions where\n * two concurrent instances would corrupt invariants.\n * - `'let_run'` — both pods run side-by-side until the previous one\n * exits naturally. Matches K8s `RollingUpdate` strategy with\n * `maxSurge: 1, maxUnavailable: 0`. Authored explicitly when the\n * minion can tolerate momentary duplication (e.g. an idempotent\n * scraper).\n *\n * `gracePeriodSec` is optional and only meaningful for\n * `'kill_previous'` (forwarded to the K8s `terminationGracePeriodSeconds`\n * manifest emitter). Authoring it on `'let_run'`\n * is harmless today but silently ignored.\n */\nexport const MinionReinstantiationSchema = z.strictObject({\n policy: z.enum(['kill_previous', 'let_run']).default('kill_previous'),\n gracePeriodSec: z.number().int().nonnegative().optional(),\n});\nexport type MinionReinstantiation = z.infer<typeof MinionReinstantiationSchema>;\n\n/**\n * Per-minion liveness contract.\n *\n * Minions have NO inbound HTTP surface, so the K8s\n * liveness probe cannot use the `httpGet` shape that workers use. The\n * supported probes are:\n *\n * - `kind: 'file'` (default) — the minion runtime writes a heartbeat to\n * `filePath` every `heartbeat.intervalSec` seconds while its tick consumer\n * is subscribed and its broker connection is up (`MinionLivenessHeartbeat`\n * in `@wildo-ai/saas-minions-lib`). The K8s probe is an `exec` probe that\n * fails once the heartbeat is `staleAfterSec` old. The probe command, its\n * cadence and the env that turns the heartbeat on are all derived from this\n * parsed value in `minion-liveness.contracts.ts`, so the writer and the\n * probe cannot drift (#1859, where the probe existed and the writer did not).\n *\n * - `kind: 'exec'` — the minion provides its own probe command (e.g.\n * `['curl', '-fsS', 'http://localhost:9090/internal/healthz']` for\n * a minion that exposes a loopback-only debug surface). The\n * contract is \"exit 0 = healthy, anything else = restart\".\n *\n * `staleAfterSec` MUST be > `heartbeat.intervalSec` (the schema's\n * `superRefine` enforces this — a stale-window equal to or shorter\n * than the heartbeat would guarantee K8s flaps the pod even when\n * the minion is healthy). The 90s / 30s defaults give a 3× safety\n * margin, which the interaction between cron cadence and liveness\n * cadence needs to keep the deploy story sane.\n */\nexport const MinionLivenessSchema = z.strictObject({\n kind: z.enum(['file', 'exec']).default('file'),\n filePath: z.string().min(1).default('/tmp/wildo-minion-alive'),\n execCommand: z.array(z.string().min(1)).min(1).optional(),\n heartbeat: z\n .strictObject({\n intervalSec: z.number().int().positive().default(30),\n })\n .prefault({}),\n staleAfterSec: z.number().int().positive().default(90),\n}).superRefine((val, ctx) => {\n if (val.kind === 'exec' && (!val.execCommand || val.execCommand.length === 0)) {\n ctx.addIssue({\n code: 'custom',\n path: ['execCommand'],\n message: \"liveness.execCommand is required (and non-empty) when liveness.kind === 'exec'.\",\n });\n }\n if (val.staleAfterSec <= val.heartbeat.intervalSec) {\n ctx.addIssue({\n code: 'custom',\n path: ['staleAfterSec'],\n message:\n `liveness.staleAfterSec (${val.staleAfterSec}s) must be strictly greater than ` +\n `liveness.heartbeat.intervalSec (${val.heartbeat.intervalSec}s) — otherwise the K8s ` +\n 'liveness probe will flap the pod even when the minion is healthy. ' +\n 'Recommended: staleAfterSec ≥ 3× heartbeat.intervalSec.',\n });\n }\n});\nexport type MinionLiveness = z.infer<typeof MinionLivenessSchema>;\n\n/**\n * Per-minion container isolation. An ALIAS of the shared\n * {@link RuntimeIsolationSchema} — minions and workers have identical isolation\n * contracts, and the floor/authorable split is documented there. Kept as a named\n * export so minion-facing code and its pins read in minion terms.\n *\n * ## ⚠️ The one MINION-SPECIFIC consequence, and it is load-bearing\n *\n * {@link MinionLivenessSchema} defaults to a FILE probe at\n * `/tmp/wildo-minion-alive`, written by the minion runtime every\n * `heartbeat.intervalSec`. So `readOnlyRootFilesystem: true` with no writable\n * `/tmp` makes the heartbeat unwritable and Kubernetes restart-loops **every\n * healthy minion** — the probe fails for a reason unrelated to the workload's\n * health. The renderers always emit the `/tmp` mount alongside the read-only\n * flag; the two must never be separated.\n *\n * Workers probe over HTTP and so do not share this acute coupling, which is why\n * the reasoning lives here rather than in the shared schema.\n *\n * @example\n * ```ts\n * // Most minions author nothing — the secure defaults apply.\n * isolation: undefined\n *\n * // A minion whose image runs as uid 1000 and needs a scratch directory:\n * isolation: { runAsUser: 1000, runAsGroup: 1000, writablePaths: ['/var/cache/scraper'] }\n * ```\n */\nexport const MinionIsolationSchema = RuntimeIsolationSchema;\nexport type MinionIsolation = RuntimeIsolation;\n\n/**\n * The mandatory writable mount, kept as a named constant rather than a literal\n * repeated across the k8s and compose renderers — two copies of a path this\n * load-bearing WILL drift, and the failure mode (restart-looping healthy\n * minions) is far from the edit that caused it.\n *\n * Matches `MinionLivenessSchema.filePath`'s default directory.\n */\nexport const MINION_MANDATORY_WRITABLE_PATH = RUNTIME_MANDATORY_WRITABLE_PATH;\n\n/**\n * A file heartbeat must live inside a mount the container can write: the rootfs is read-only, and only\n * {@link MINION_MANDATORY_WRITABLE_PATH} plus the authored `isolation.writablePaths` are mounted. A heartbeat\n * anywhere else is a write the minion can never make, so every healthy pod would restart-loop on its probe\n * (#1859). Refused at parse time, where the remedy (move the file, or mount its directory) is one line away.\n *\n * String operations rather than `node:path`, so this contract stays free of a Node built-in.\n */\nfunction refineLivenessFileIsWritable(\n cfg: { liveness: MinionLiveness; isolation: RuntimeIsolation },\n ctx: z.RefinementCtx,\n): void {\n if (cfg.liveness.kind !== 'file') return;\n const filePath = cfg.liveness.filePath;\n const roots = [MINION_MANDATORY_WRITABLE_PATH, ...cfg.isolation.writablePaths].map((root) => root.replace(/\\/+$/, ''));\n // `$` is refused because the kubelet expands `$(NAME)` in BOTH the env value the writer reads and the exec\n // command the probe runs, with the container's own env; a path that could expand is a path the two might not\n // agree on. A trailing `/` names a directory, not a file the writer can create.\n if (filePath.includes('$') || filePath.endsWith('/')) {\n ctx.addIssue({\n code: 'custom',\n path: ['liveness', 'filePath'],\n message: `liveness.filePath '${filePath}' must be a plain file path: no '$' (the kubelet would expand it) and no trailing '/'.`,\n });\n return;\n }\n const insideAWritableMount = filePath.startsWith('/')\n && !filePath.split('/').includes('..')\n && roots.some((root) => filePath.startsWith(`${root}/`) && filePath.length > root.length + 1);\n if (!insideAWritableMount) {\n ctx.addIssue({\n code: 'custom',\n path: ['liveness', 'filePath'],\n message:\n `liveness.filePath '${filePath}' is not inside a writable mount (${roots.join(', ')}). The container `\n + 'rootfs is read-only, so the heartbeat could never be written and the probe would restart every healthy '\n + \"pod. Put the file under '/tmp', or add its directory to isolation.writablePaths.\",\n });\n }\n}\n\n/**\n * Per-folder minion configuration (`wildo.minion.config.ts`).\n *\n * Schema honesty:\n *\n * - `mode` (`'always-up' | 'cron'`). Determines the K8s\n * deployment shape the manifest emitter produces. `schedule` is required iff\n * `mode === 'cron'` (enforced by the top-level `superRefine`).\n *\n * - `reinstantiation`. Only meaningful for `'always-up'`\n * today (cron minions are short-lived); the schema accepts the\n * field on cron minions but it stays inert at runtime so the\n * surface stays uniform.\n *\n * - `replicas` is pinned to `1` — minions are SINGLETONS\n * in v1 (no horizontal scaling). The literal-`1` constraint is\n * enforced at parse time so a future \"let me run two of these\"\n * request must come through a deliberate schema bump, not a silent\n * config tweak. Authored explicitly in the schema (rather than\n * omitted) so the K8s manifest emitter has a single source of\n * truth — symmetric with the worker schema's `replicas` field.\n *\n * - `liveness`. Defaults to file-heartbeat 30s /\n * stale-after 90s, the safe baseline given the interaction between\n * cron cadence and liveness cadence.\n *\n * - The legacy `dataAccess` block is REMOVED — minion access to\n * repositories is governed by the bucket-level `resourceAccess`\n * whitelist authored on the minion entry in `wildo.saas.config.ts`.\n * Keeping a redundant per-minion-config field would\n * create a second source of truth and an obvious \"which one wins?\"\n * bug surface.\n *\n * - `isolation` — container security posture. Only the image-dependent and\n * ADDITIVE knobs are authorable; the security floor (non-root, read-only\n * rootfs, dropped capabilities, seccomp, no service-account token) is\n * emitted unconditionally and cannot be configured down. See\n * {@link MinionIsolationSchema} for why that split exists.\n *\n * - `localProviders` — providers this minion AUTHORS beside its own code,\n * for the case the application catalog does not carry them (R7).\n *\n * This is NOT a return of the legacy `providers` block, which was removed so\n * that `defineSaaSProviders({ scopes })` would be the single source of truth\n * and per-minion visibility a PROJECTION of it. That property is preserved:\n * a fragment declared here is REGISTERED INTO the application catalog at\n * config load (`registerMinionLocalProviderFragments`), and everything\n * downstream — scope projection, the fail-closed secret filtering, the\n * generated runtime module — reads the catalog and cannot tell a registered\n * fragment from an application-authored entry.\n *\n * One authoring LOCATION per provider; one runtime SOURCE for all of them.\n * The consequence that matters: because a registered fragment IS a catalog\n * entry, its SECRETS arrive through the same single mechanism as every other\n * provider's. Authoring a provider here creates no second secret channel.\n *\n * The schema is `z.strictObject` so a typo (`scedule:` instead of\n * `schedule:`) fails fast — same posture as `WildoSaasConfigSchema`.\n */\nexport const WildoMinionConfigSchema = z.strictObject({\n version: z.number().int().positive().default(1),\n name: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n runtime: WorkerRuntimeSchema,\n /**\n * Provider fragments this minion authors locally — registered into the\n * application catalog at config load, never a parallel catalog. See the\n * `localProviders` note in this file's header for why this is not the legacy\n * `providers` block returning.\n *\n * Keyed by provider ref, exactly as the application catalog is, so a collision\n * with an application-declared ref is detectable — and REFUSED — at\n * registration rather than resolved by a precedence rule nobody reads.\n */\n localProviders: z.record(z.string().min(1), z.record(z.string().min(1), z.unknown())).optional(),\n mode: z.enum(['always-up', 'cron']),\n /** Cron expression (required iff `mode === 'cron'`). */\n schedule: z.string().min(1).optional(),\n // `.prefault({})` (NOT `.default({})`) so the empty input flows\n // through the inner schema and the field defaults are applied —\n // Zod v4's `.default(x)` returns `x` as-is without re-parsing.\n // See the matching JSDoc on `define-worker-config.ts > http` for\n // the rationale.\n reinstantiation: MinionReinstantiationSchema.prefault({}),\n replicas: z.literal(1).default(1),\n liveness: MinionLivenessSchema.prefault({}),\n resources: ResourceLimitsSchema.optional(),\n // `.prefault({})` for the same reason as `reinstantiation`/`liveness`: the\n // empty input must flow through the inner schema so the field defaults apply.\n // NOT `.optional()` — an absent `isolation` block must still produce the\n // secure uid/gid/pids defaults, because \"authored nothing\" is the common case\n // and it is exactly the case that must come out hardened.\n isolation: MinionIsolationSchema.prefault({}),\n}).superRefine((cfg, ctx) => {\n if (cfg.mode === 'cron' && !cfg.schedule) {\n ctx.addIssue({\n code: 'custom',\n path: ['schedule'],\n message: \"schedule is required when mode === 'cron' (a cron minion without a schedule is a no-op).\",\n });\n }\n refineRuntimeIsolation(cfg.isolation, ctx);\n refineLivenessFileIsWritable(cfg, ctx);\n\n if (cfg.mode === 'always-up' && cfg.schedule) {\n ctx.addIssue({\n code: 'custom',\n path: ['schedule'],\n message:\n \"schedule must be omitted when mode === 'always-up'; use mode === 'cron' for platform-scheduled ticks.\",\n });\n }\n});\nexport type WildoMinionConfig = z.infer<typeof WildoMinionConfigSchema>;\nexport type WildoMinionConfigInput = z.input<typeof WildoMinionConfigSchema>;\n\n/**\n * Define a minion (long-running actor host or scheduled tick) configuration.\n *\n * Minions have NO inbound HTTP surface and are SINGLETONS\n * (`replicas: 1`).\n */\nexport function defineMinionConfig(config: WildoMinionConfigInput): WildoMinionConfig {\n return WildoMinionConfigSchema.parse(config);\n}\n"]}